# Maintainer: Florian Maunier pkgname=httpie-desktop-appimage pkgver=2022.16.0 pkgrel=1 pkgdesc="HTTPie for Desktop (AppImage)" arch=(x86_64 aarch64) url="https://httpie.io/product" license=('unknown') depends=('fuse2') options=(!strip) # necessary otherwise the AppImage file in the package is truncated source_x86_64=("https://github.com/httpie/desktop/releases/download/v$pkgver/HTTPie-$pkgver.AppImage") source_aarch64=("https://github.com/httpie/desktop/releases/download/v$pkgver/HTTPie-$pkgver-arm64.AppImage") b2sums_x86_64=('9a978587afe27bf3bc862b12d990114baf37d2edde8b76c717a3fff1d86904a0700527b5b9e05681788e7843df5ff8b92308933fedbcdbafccf326df1fc99268') b2sums_aarch64=('3ce926cc8f7c041b7b250bb1902ece1bea769e3dbb4633e7c5acb09037821665c7050fdcaafc475000c6d6a7e555e3574ebf3293865539100540fda8b3c83bb7') [ $CARCH = "x86_64" ] && _filename=HTTPie-$pkgver.AppImage [ $CARCH = "aarch64" ] && _filename=HTTPie-$pkgver-arm64.AppImage _appimage_name=$(echo "${_filename}"|sed -E 's/-[0-9]*.[0-9]*.[0-9]*//') _install_path="/opt/appimages/$_appimage_name" prepare() { chmod +x $_filename mkdir -p squashfs-root/usr/share/icons/hicolor ./$_filename --appimage-extract "usr/share/icons/hicolor/*/apps/httpie.png" > /dev/null 2>&1 ./$_filename --appimage-extract httpie.desktop > /dev/null 2>&1 } build() { sed -i -E "s|Exec=AppRun|Exec=env DESKTOPINTEGRATION=0 APPIMAGELAUNCHER_DISABLE=1 /usr/bin/httpie-desktop|" squashfs-root/httpie.desktop # Fix permissions; .AppImage permissions are 700 for all directories chmod -R a-x+rX squashfs-root/usr } package() { # install icons install -dm755 "$pkgdir/usr/share/icons" cp -dpr --no-preserve=ownership "squashfs-root/usr/share/icons" "$pkgdir/usr/share" chmod -R 755 "$pkgdir/usr/share/icons" find "$pkgdir/usr/share/icons" -type f -name "httpie.png" -exec chmod 644 {} \; # install .desktop file and image file install -Dm644 "squashfs-root/httpie.desktop" "$pkgdir/usr/share/applications/httpie.desktop" install -Dm755 "$_filename" "$pkgdir$_install_path" mkdir "${pkgdir}/usr/bin/" && chmod 755 "${pkgdir}/usr/bin/" ln -s "${_install_path}" "${pkgdir}/usr/bin/httpie-desktop" # disable AppImage integration prompt # https://github.com/electron-userland/electron-builder/issues/1962 install -dm755 "$pkgdir/usr/share/appimagekit" }