You are not logged in.

#1 2026-11-14 12:54:02

Dulbi
Member
Registered: 2026-04-01
Posts: 8

Request for a HatchZip AUR package

Hi team,

May I request anyone create a HatchZip AUR package? AFAIK, it's not present in AUR. The code comes from https://github.com/xevrion/hatchzip.

I have already made a -bin PKGBUILD file but I wonder if we can refine it, what do you think?

pkgname=hatchzip-bin
pkgver=0.1.10
pkgrel=1
pkgdesc="Free, open-source archive extractor that extracts files in place to save disk space (pre-compiled binary)"
arch=('x86_64')
url="https://github.com/xevrion/hatchzip"
license=('MIT' 'Apache-2.0')
provides=('hatchzip' 'hz')
conflicts=('hatchzip')
depends=('glibc')

source_x86_64=("https://github.com/xevrion/hatchzip/releases/download/v${pkgver}/hatchzip-x86_64-linux.tar.gz")
sha256sums_x86_64=('508b9534e2451040745de5f1cb140ee2d050e8ed114e280158d8110b392ab929')

package() {
    install -Dm755 "${srcdir}/hatchzip-x86_64-linux/hatchzip" "${pkgdir}/usr/bin/hatchzip"
    ln -s hatchzip "${pkgdir}/usr/bin/hz"

    install -Dm644 "${srcdir}/hatchzip-x86_64-linux/man/hatchzip.1" "${pkgdir}/usr/share/man/man1/hatchzip.1"

    install -Dm644 "${srcdir}/hatchzip-x86_64-linux/completions/hatchzip.bash" "${pkgdir}/usr/share/bash-completion/completions/hatchzip"
    install -Dm644 "${srcdir}/hatchzip-x86_64-linux/completions/_hatchzip" "${pkgdir}/usr/share/zsh/site-functions/_hatchzip"
    install -Dm644 "${srcdir}/hatchzip-x86_64-linux/completions/hatchzip.fish" "${pkgdir}/usr/share/fish/vendor_completions.d/hatchzip.fish"

    install -Dm644 "${srcdir}/hatchzip-x86_64-linux/LICENSE-MIT" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE-MIT"
    install -Dm644 "${srcdir}/hatchzip-x86_64-linux/LICENSE-APACHE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE-APACHE"
    if [ -f "${srcdir}/hatchzip-x86_64-linux/LICENSE-UNRAR" ]; then
        install -Dm644 "${srcdir}/hatchzip-x86_64-linux/LICENSE-UNRAR" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE-UNRAR"
    fi
}

Last edited by Dulbi (2026-11-14 12:59:08)

Offline

#2 2026-11-14 13:09:31

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,557
Website

Re: Request for a HatchZip AUR package

That PKGBUILD looks appropriate and properly done - but is there a reason you are using the precompiled binary rather than building it from source?  The latter should be preferred unless there are good reasons to do otherwise.  I can't imagine this is particularly resource intensive to build.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#3 2026-11-14 13:15:56

Dulbi
Member
Registered: 2026-04-01
Posts: 8

Re: Request for a HatchZip AUR package

I was not experienced enough to compile it to be honest. And it was quickiest way to get the package installed.

If you look at the assets from GitHub for other distributions, all are based directly from the binary, so I've decided to go the same way.

BTW, thanks for the assessment. Does anyone want to endorse it on AUR?

Last edited by Dulbi (2026-11-14 13:48:01)

Offline

#4 2026-11-15 01:08:28

loqs
Member
Registered: 2014-03-06
Posts: 19,129

Re: Request for a HatchZip AUR package

source_x86_64=("https://github.com/xevrion/hatchzip/releases/download/v${pkgver}/hatchzip-x86_64-linux.tar.gz")

This creates the local file as hatchzip-x86_64-linux.tar.gz with no version identifier so when the PKGBUILD is updated for the next release it will collide with old already downloaded archive. You can have makepkg locally add pkgver into the local name

source_x86_64=("hatchzip-$pkgver-x86_64-linux.tar.gz::https://github.com/xevrion/hatchzip/releases/download/v${pkgver}/hatchzip-x86_64-linux.tar.gz")

Offline

#5 2026-11-15 06:17:36

Dulbi
Member
Registered: 2026-04-01
Posts: 8

Re: Request for a HatchZip AUR package

loqs wrote:

(...)You can have makepkg locally add pkgver into the local name

source_x86_64=("hatchzip-$pkgver-x86_64-linux.tar.gz::https://github.com/xevrion/hatchzip/releases/download/v${pkgver}/hatchzip-x86_64-linux.tar.gz")

That's a good catch, thanks for this improvement.

Offline

#6 2026-11-20 00:35:43

loqs
Member
Registered: 2014-03-06
Posts: 19,129

Re: Request for a HatchZip AUR package

Source build for comparison based on your current PKGBUILD and https://manual.archlinux.page/package-guidelines/rust/

pkgname=hatchzip
pkgver=0.1.10
pkgrel=1
pkgdesc="Free, open-source archive extractor that extracts files in place to save disk space"
arch=(x86_64)
url="https://github.com/xevrion/$pkgname"
license=(MIT Apache-2.0)
depends=(gcc-libs glibc)
makedepends=(cargo)
provides=(hz)
conflicts=(hatchzip-bin)
source=("$pkgname-$pkgver.tar.gz::$url/archive/v$pkgver/$pkgname-$pkgver.tar.gz")
sha256sums=('453fc3ff6ac2a4f81d5e18589323e61c637c32d45a1f151d1bd1c44e9df5403f')

prepare() {
  cd "$pkgname-$pkgver"
  export RUSTUP_TOOLCHAIN=stable
  cargo fetch --locked --target host-tuple
}

build() {
  cd "$pkgname-$pkgver"
  export RUSTUP_TOOLCHAIN=stable
  export CARGO_TARGET_DIR=target
  export CFLAGS+=" -ffat-lto-objects"
  export CXXFLAGS+=" -ffat-lto-objects"
  cargo build --frozen --release -p hatchzip --features rar
}

check() {
  cd "$pkgname-$pkgver"
  export RUSTUP_TOOLCHAIN=stable
  cargo test --frozen -p hatchzip-core -p hatchzip --features rar
}

package() {
  cd "$pkgname-$pkgver"

  install -Dm755 target/release/hatchzip "$pkgdir/usr/bin/hatchzip"
  ln -s hatchzip "$pkgdir/usr/bin/hz"

  install -d "$pkgdir/usr/share/man/man1" \
    "$pkgdir/usr/share/bash-completion/completions" \
    "$pkgdir/usr/share/zsh/site-functions" \
    "$pkgdir/usr/share/fish/vendor_completions.d"

  ./target/release/hatchzip man > "$pkgdir/usr/share/man/man1/hatchzip.1"
  ./target/release/hatchzip completions bash > "$pkgdir/usr/share/bash-completion/completions/hatchzip"
  ./target/release/hatchzip completions zsh > "$pkgdir/usr/share/zsh/site-functions/_hatchzip"
  ./target/release/hatchzip completions fish > "$pkgdir/usr/share/fish/vendor_completions.d/hatchzip.fish"

  install -Dm644 LICENSE-MIT "$pkgdir/usr/share/licenses/$pkgname/LICENSE-MIT"
  install -Dm644 LICENSE-APACHE "$pkgdir/usr/share/licenses/$pkgname/LICENSE-APACHE"
  install -Dm644 LICENSE-UNRAR "$pkgdir/usr/share/licenses/$pkgname/LICENSE-UNRAR"
}

Offline

Board footer

Powered by FluxBB