diff options
-rw-r--r-- | .SRCINFO | 9 | ||||
-rw-r--r-- | PKGBUILD | 60 | ||||
-rw-r--r-- | nixnote2-release-bin:desktop.patch (renamed from nixnote2.desktop.patch) | 0 |
3 files changed, 37 insertions, 32 deletions
@@ -6,7 +6,6 @@ pkgbase = nixnote2-release-bin arch = x86_64 license = GPL3 makedepends = git - depends = bash depends = hicolor-icon-theme depends = zlib provides = nixnote=2.1.0.beta4 @@ -15,11 +14,11 @@ pkgbase = nixnote2-release-bin replaces = nevernote replaces = nixnote replaces = nixnote-beta - source = https://github.com/robert7/nixnote2//releases/download/v2.1.0-beta4/NixNote2-x86_64.AppImage - source = nixnote2 - source = nixnote2.desktop.patch + noextract = nixnote2-release-bin-2.1.0.beta4-AppImage + noextract = nixnote2-release-bin:desktop.patch + source = nixnote2-release-bin-2.1.0.beta4-AppImage::https://github.com/robert7/nixnote2//releases/download/v2.1.0-beta4/NixNote2-x86_64.AppImage + source = nixnote2-release-bin:desktop.patch sha256sums = SKIP - sha256sums = 5d73ed58f17b5c360a0068808cb74580f9bf2d9ce959bb6300b63f5f837ac818 sha256sums = 4f12cddc49e0c694f41e344acebc0d8a3bce07a3496098eb2fae258ba9044967 pkgname = nixnote2-release-bin @@ -1,5 +1,7 @@ # Maintainer: Tom Hale <tom[noodle]hale[point]ee> +OPTIONS=(!strip) # Stripping an AppImage renders it non-functional + _pkgname=nixnote2 pkgname=${_pkgname}-release-bin pkgver=2.1.0.beta4 @@ -8,7 +10,7 @@ pkgdesc='Evernote clone (formerly Nevernote) - latest binary release' url="https://github.com/robert7/$_pkgname" arch=(x86_64) license=(GPL3) -depends=(bash hicolor-icon-theme zlib) +depends=(hicolor-icon-theme zlib) makedepends=(git) conflicts=(nixnote2-git) provides=("nixnote=${pkgver%.r*}" "$_pkgname=${pkgver%.r*}") @@ -16,15 +18,11 @@ replaces=(nevernote nixnote nixnote-beta) _appimage_path=$(curl -s 'https://github.com/robert7/nixnote2/releases' | sed -En 's:.*(/releases/download/v[^"/]+/[^"/]+[Aa]pp[Ii]mage)".*:\1:p' | head -n1) -source=("$url/$_appimage_path" - nixnote2 - nixnote2.desktop.patch) +source=("$pkgname-$pkgver-AppImage::$url/$_appimage_path" + "$pkgname:desktop.patch") sha256sums=(SKIP - 5d73ed58f17b5c360a0068808cb74580f9bf2d9ce959bb6300b63f5f837ac818 4f12cddc49e0c694f41e344acebc0d8a3bce07a3496098eb2fae258ba9044967) -OPTIONS=(!strip) # Stripping an AppImage makes it non-functional - -PKGEXT=".pkg.tar" +noextract=("${source[@]%%::*}") # Don't extract anything # All files in the directories specified are extracted # Note that --appimage-extract currently doesn't support recursive extraction: @@ -36,11 +34,23 @@ _extract_dirs=(usr/share/applications usr/share/nixnote2/help usr/share/nixnote2/translations) +_version_file=$pkgname-PKGBUILD-version # For version from the download URL +_appimage=${_appimage_path##*/} # basename of AppImage XXX XXXXXXXXXXXXXX +_appimage=$_pkgname.AppImage # Constant name of AppImage prepare() { - _appimage=${_appimage_path##*/} # basename of AppImage + # Make download executable and give constant name + mv "$pkgname-$pkgver-AppImage" "$_appimage" chmod 755 "$_appimage" + # # Rename AppImage to remove version so wrapper has constant filename to call + # mv "$pkgname-$pkgver-AppImage" "" + + # Save version of extracted files for `makepkg -e` + [[ $_appimage_path =~ /releases/download/v([^/]+).* ]] + local version=${BASH_REMATCH[1]} + echo ${version//-/.} >| "$_version_file" + # Due to this issue, all --appimage-extract target directories must already exist # https://github.com/AppImage/AppImageKit/issues/363 local dir @@ -55,34 +65,30 @@ prepare() { find squashfs-root -type d -exec chmod go+rx -- {} + # Have the .desktop point explicitly at the icon - patch -d squashfs-root/usr/share/applications < nixnote2.desktop.patch + patch -d squashfs-root/usr/share/applications < "$pkgname:desktop.patch" } -pkgver() - # Curly braces are not needed for a single compound command :-P - if [[ -n $_saved_version ]]; then - echo "$_saved_version" - else - [[ $_appimage_path =~ /releases/download/v([^/]+).* ]] - local _saved_version=${BASH_REMATCH[1]} - _saved_version=${_saved_version//-/.} - echo "$_saved_version" - fi +pkgver() { + cat "$_version_file" +} + package() { cd "$pkgdir" - _appimage=${_appimage_path##*/} # basename of AppImage # User resources cp -pr "$srcdir"/squashfs-root/usr . - # AppImage itself - install -Dm755 -t "opt/$_pkgname" "$SRCDEST/$_appimage" + # # AppImage itself (install will dereference symlink) + # install -Dm755 -t "opt/$_pkgname" "$srcdir/$_appimage" + + # # Wrapper script for /usr/bin + # install -Dm755 -t usr/bin "$SRCDEST/$_pkgname" - # Wrapper script for /usr/bin - install -Dm755 -t usr/bin "$SRCDEST/$_pkgname" + # Install AppImage + install -Dm755 -T "$srcdir/$_appimage" usr/bin/"$_pkgname" - # Make a constant filename that the wrapper can execute - ( cd opt/"$_pkgname" && ln -s "$_appimage" "$_pkgname" ) + # # Make a constant filename that the wrapper can execute + # ( cd opt/"$_pkgname" && ln -s "$_appimage" "$_pkgname" ) } diff --git a/nixnote2.desktop.patch b/nixnote2-release-bin:desktop.patch index 831c196a2cac..831c196a2cac 100644 --- a/nixnote2.desktop.patch +++ b/nixnote2-release-bin:desktop.patch |