Skip to content

Commit

Permalink
Support older GLIBC and popup fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ath3 committed Jan 21, 2025
1 parent ba4793f commit ee95654
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 107 deletions.
109 changes: 5 additions & 104 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
name: Release
on:
workflow_dispatch:
push:
tags:
- '[0-9]+.[0-9]+'
- '[0-9]+.[0-9]+.[0-9]+'
branches:
- 'patch/ci-release-*'
- myhx
pull_request:
paths:
- '.github/workflows/release.yml'
Expand All @@ -21,6 +19,7 @@ jobs:
fetch-grammars:
name: Fetch Grammars
runs-on: ubuntu-latest
container: quay.io/pypa/manylinux_2_28_x86_64
steps:
- name: Checkout sources
uses: actions/checkout@v4
Expand Down Expand Up @@ -55,51 +54,17 @@ jobs:
# Emit backtraces on panics.
RUST_BACKTRACE: 1
runs-on: ${{ matrix.os }}
container: quay.io/pypa/manylinux_2_28_x86_64
strategy:
fail-fast: false # don't fail other jobs if one fails
matrix:
build: [x86_64-linux, x86_64-macos, x86_64-windows] #, x86_64-win-gnu, win32-msvc
build: [x86_64-linux]
include:
- build: x86_64-linux
os: ubuntu-22.04
rust: stable
target: x86_64-unknown-linux-gnu
cross: false
- build: aarch64-linux
os: ubuntu-22.04
rust: stable
target: aarch64-unknown-linux-gnu
cross: true
# - build: riscv64-linux
# os: ubuntu-22.04
# rust: stable
# target: riscv64gc-unknown-linux-gnu
# cross: true
- build: x86_64-macos
os: macos-latest
rust: stable
target: x86_64-apple-darwin
cross: false
- build: x86_64-windows
os: windows-latest
rust: stable
target: x86_64-pc-windows-msvc
cross: false
# 23.03: build issues
- build: aarch64-macos
os: macos-latest
rust: stable
target: aarch64-apple-darwin
cross: false
skip_tests: true # x86_64 host can't run aarch64 code
# - build: x86_64-win-gnu
# os: windows-2019
# rust: stable-x86_64-gnu
# target: x86_64-pc-windows-gnu
# - build: win32-msvc
# os: windows-2019
# rust: stable
# target: i686-pc-windows-msvc

steps:
- name: Checkout sources
Expand Down Expand Up @@ -150,65 +115,6 @@ jobs:
- name: Build release binary
run: ${{ env.CARGO }} build --profile opt --locked --target ${{ matrix.target }}

- name: Build AppImage
shell: bash
if: matrix.build == 'x86_64-linux'
run: |
# Required as of 22.x https://github.com/AppImage/AppImageKit/wiki/FUSE
sudo add-apt-repository universe
sudo apt install libfuse2
mkdir dist
name=dev
if [[ $GITHUB_REF == refs/tags/* ]]; then
name=${GITHUB_REF:10}
fi
build="${{ matrix.build }}"
export VERSION="$name"
export ARCH=${build%-linux}
export APP=helix
export OUTPUT="helix-$VERSION-$ARCH.AppImage"
export UPDATE_INFORMATION="gh-releases-zsync|$GITHUB_REPOSITORY_OWNER|helix|latest|$APP-*-$ARCH.AppImage.zsync"
mkdir -p "$APP.AppDir"/usr/{bin,lib/helix}
cp "target/${{ matrix.target }}/opt/hx" "$APP.AppDir/usr/bin/hx"
rm -rf runtime/grammars/sources
cp -r runtime "$APP.AppDir/usr/lib/helix/runtime"
cat << 'EOF' > "$APP.AppDir/AppRun"
#!/bin/sh
APPDIR="$(dirname "$(readlink -f "${0}")")"
HELIX_RUNTIME="$APPDIR/usr/lib/helix/runtime" exec "$APPDIR/usr/bin/hx" "$@"
EOF
chmod 755 "$APP.AppDir/AppRun"
curl -Lo linuxdeploy-x86_64.AppImage \
https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
chmod +x linuxdeploy-x86_64.AppImage
./linuxdeploy-x86_64.AppImage \
--appdir "$APP.AppDir" -d contrib/Helix.desktop \
-i contrib/helix.png --output appimage
mv "$APP-$VERSION-$ARCH.AppImage" \
"$APP-$VERSION-$ARCH.AppImage.zsync" dist
- name: Build Deb
shell: bash
if: matrix.build == 'x86_64-linux'
run: |
cargo install cargo-deb
mkdir -p target/release
cp target/${{ matrix.target }}/opt/hx target/release/
cargo deb --no-build
mkdir -p dist
mv target/debian/*.deb dist/
- name: Build archive
shell: bash
run: |
Expand Down Expand Up @@ -267,11 +173,6 @@ jobs:
mv bins-$platform/hx$exe $pkgname
chmod +x $pkgname/hx$exe
if [[ "$platform" = "x86_64-linux" ]]; then
mv bins-$platform/helix-*.AppImage* dist/
mv bins-$platform/*.deb dist/
fi
if [ "$exe" = "" ]; then
tar cJf dist/$pkgname.tar.xz $pkgname
else
Expand Down
14 changes: 11 additions & 3 deletions helix-term/src/ui/popup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ impl<T: Component> Popup<T> {
// if we're on the bottom part, do above
let can_put_below = viewport.height > rel_y + MIN_HEIGHT;
let can_put_above = rel_y.checked_sub(MIN_HEIGHT).is_some();
let final_pos = match self.position_bias {
let mut final_pos = match self.position_bias {
Open::Below => match can_put_below {
true => Open::Below,
false => Open::Above,
Expand Down Expand Up @@ -184,8 +184,14 @@ impl<T: Component> Popup<T> {
.required_size((max_width, max_height))
.expect("Component needs required_size implemented in order to be embedded in a popup");

if max_height < child_height
&& final_pos == Open::Below
&& rel_y > max_height + 2 * u16::from(render_borders)
{
final_pos = Open::Above;
}
width = width.min(MAX_WIDTH);
let height = if render_borders {
let height = if render_borders && is_menu {
(child_height + 2).min(MAX_HEIGHT)
} else {
child_height.min(MAX_HEIGHT)
Expand Down Expand Up @@ -323,7 +329,9 @@ impl<T: Component> Component for Popup<T> {

let mut inner = area;
if render_borders {
inner = area.inner(Margin::all(1));
if is_menu {
inner = area.inner(Margin::all(1));
}
Widget::render(Block::bordered(), area, surface);
}
let border = usize::from(render_borders);
Expand Down

0 comments on commit ee95654

Please sign in to comment.