diff --git a/.gitignore b/.gitignore index f445ec4c..86780445 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,5 @@ result-* .idea/ .vscode/ + +*.snap diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index d4d14682..6be19d0e 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -23,34 +23,31 @@ parts: yazi: plugin: rust source: https://github.com/sxyazi/yazi.git - build-packages: - - wget + stage-snaps: + - jq + stage-packages: + - 7zip + - fd-find + - fzf + - ripgrep + - zoxide override-build: | craftctl default craftctl set version=$(git describe --tags --abbrev=0) + organize: + # Ubuntu's `fd` package installs a binary named `fdfind`. Rename it in the snap. + usr/bin/fdfind: usr/bin/fd - wget ripgrep-14.1.1-aarch64-unknown-linux-gnu.tar.gz - tar fxz ripgrep-*.tar.gz - mv ripgrep-*/rg $CRAFT_PART_INSTALL/bin/ - - wget https://github.com/sharkdp/fd/releases/download/v10.2.0/fd-v10.2.0-aarch64-unknown-linux-gnu.tar.gz - tar fxz fd-*.tar.gz - mv fd-*/fd $CRAFT_PART_INSTALL/bin/ - - wget https://github.com/jqlang/jq/releases/download/jq-1.7.1/jq-linux-amd64 - mv jq-linux-amd64 $CRAFT_PART_INSTALL/bin/jq - - wget https://imagemagick.org/archive/binaries/magick - mv magick $CRAFT_PART_INSTALL/bin/magick - - wget https://github.com/junegunn/fzf/releases/download/v0.56.2/fzf-0.56.2-linux_amd64.tar.gz - tar fxz fzf-*.tar.gz - mv fzf $CRAFT_PART_INSTALL/bin/ - - wget https://www.7-zip.org/a/7z2408-linux-x64.tar.xz - tar fxz 7z*.tar.xz - mv 7zz 7zzs $CRAFT_PART_INSTALL/bin/ - - wget https://github.com/ajeetdsouza/zoxide/releases/download/v0.9.6/zoxide-0.9.6-x86_64-unknown-linux-musl.tar.gz - tar fxz zoxide-*.tar.gz - mv zoxide $CRAFT_PART_INSTALL/bin/ + # The Ubuntu `imagemagick` package does not ship a `magick` binary, + # which `yazi` looks for. Building the package oursleves yields the + # expected binary without much overhead, and works across platforms. + magick: + plugin: autotools + source: https://imagemagick.org/archive/ImageMagick.tar.gz + source-type: tar + stage-packages: + - libgomp1 + autotools-configure-parameters: + - --prefix=/usr + build-attributes: + - enable-patchelf