summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authorTom "Ravi" Hale2018-11-05 15:30:29 +0700
committerTom "Ravi" Hale2023-06-29 09:40:08 +0700
commit376d0f5049ed4fb29cc9ab7b963fe4536cf7fbbd (patch)
tree1e4fcd7cbbc79d469787f9124d4910343ad45486 /PKGBUILD
parente25800642c9cea9eaf0636d5c7fe5b919cab375a (diff)
downloadaur-376d0f5049ed4fb29cc9ab7b963fe4536cf7fbbd.tar.gz
Install AppImage as /usr/bin/nixnote2
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD60
1 files changed, 33 insertions, 27 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 96830791c500..1167a4932ac4 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -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" )
}