summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Wagie2023-08-26 13:28:02 -0600
committerMark Wagie2023-08-26 13:28:02 -0600
commit95160483d623644a6e339805b330c40603accb7c (patch)
tree6b90b655973c32622caa0f90ae7376013851dfaa
parente6296d13e34982dd1e18ba5e50b51c8a27515c3b (diff)
downloadaur-95160483d623644a6e339805b330c40603accb7c.tar.gz
Adopt package
- Use system Electron - Use NPM to match upstream
-rw-r--r--.gitignore9
-rw-r--r--PKGBUILD75
-rw-r--r--tagspaces.desktop4
-rw-r--r--tagspaces.sh3
4 files changed, 63 insertions, 28 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000000..0f7bb7b1b27b
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,9 @@
+# Ignore everything
+*
+
+# But not these files...
+!.gitignore
+!PKGBUILD
+!.SRCINFO
+!tagspaces.desktop
+!tagspaces.sh
diff --git a/PKGBUILD b/PKGBUILD
index 40c5f3e87878..305484e4120d 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,24 +1,37 @@
-# Maintainer: syntheit <daniel@matv.io>
+# Maintainer: Mark Wagie <mark dot wagie at proton dot me>
+# Contributor: syntheit <daniel@matv.io>
pkgname=tagspaces
-pkgver=4.4.3
+pkgver=5.4.6
pkgrel=1
-pkgdesc='An offline, open source, document manager with tagging support'
-arch=('i686' 'x86_64')
-url='https://www.tagspaces.org'
+_electronversion=25
+pkgdesc="An offline, open source, document manager with tagging support"
+arch=('x86_64')
+url="https://www.tagspaces.org"
license=('AGPL3')
-depends=('gtk3' 'nss' 'libxtst' 'at-spi2-core' 'util-linux-libs' 'ffmpeg' 'libvips' 'libxcrypt-compat')
-makedepends=('git' 'yarn' 'python')
-source=("https://github.com/tagspaces/tagspaces/archive/v${pkgver}.tar.gz" "tagspaces.desktop")
-sha512sums=('6480f30467bc5131ad06af9fd4563d5a7b0b820655c9289956cb22a5c9dd0ca9f0320ec6812f4ef45335967c26b222254b5e57d87d19103b09064cb0128dd554' 'cb241109c6a2d721bb629014062b59fdb6c55408c02de4c3decb0e83ddfb3fdb6d0eaac8c7ce0492e3a38ded352a9868335caf1cd75355bcda15f73ac8e2cdc7')
+depends=("electron${_electronversion}" 'libnotify' 'libsecret' 'xdg-utils')
+makedepends=('git' 'libxcrypt-compat' 'npm')
+source=("$pkgname-$pkgver.tar.gz::https://github.com/tagspaces/tagspaces/archive/refs/tags/v$pkgver.tar.gz"
+ "$pkgname.desktop"
+ "$pkgname.sh")
+sha256sums=('e96a0c9b44073c4228ca8441edbbd71f11ce0947b0bd39681bfe968e702167de'
+ 'a548e2b62a61a93d80482ebe43ef11e33e2c2bfef9db641fc583bd5539ac6948'
+ '99a8679718609b93f61ac8119fbeb080ca0ec5e5f2d99b08e673fa86a3d8b32b')
prepare() {
- cd ${srcdir}/${pkgname}-${pkgver}
- mkdir -p ${srcdir}/yarn_cache
- # Make .git directory because husky must be run in the same directory as .git
+ cd "$pkgname-$pkgver"
+ export npm_config_cache="$srcdir/npm_cache"
+
+ # Modify build target
+ sed -i 's/"deb", "tar.gz", "appImage"/"deb"/g' resources/builder.json
+
+ # Skip husky
mkdir -p .git
- yarn --cache-folder=${srcdir}/yarn_cache install
- yarn --cache-folder=${srcdir}/yarn_cache install-ext-node
- yarn --cache-folder=${srcdir}/yarn_cache global add node-gyp
+ npm run skip:husky:pre-commit
+
+ npm install
+ npm run install-ext-node
+
+ # A key is required in order for the main application to communicate with the web server
cd app
touch .env
generated_key=$(tr -dc A-Za-z0-9 </dev/urandom | head -c 128)
@@ -26,18 +39,28 @@ prepare() {
}
build() {
- cd ${srcdir}/${pkgname}-${pkgver}
- yarn --cache-folder=${srcdir}/yarn_cache build
- yarn --cache-folder=${srcdir}/yarn_cache package-linux
- cd ${srcdir}/${pkgname}-${pkgver}
+ cd "$pkgname-$pkgver"
+ export npm_config_cache="$srcdir/npm_cache"
+ electronDist="/usr/lib/electron${_electronversion}"
+ electronVer="$(sed s/^v// /usr/lib/electron${_electronversion}/version)"
+ export ELECTRON_SKIP_BINARY_DOWNLOAD=1
+ npm run build
+ npm run install-ext-node-linux
+ ./node_modules/.bin/electron-builder --linux --config resources/builder.json \
+ ${dist} -c.electronDist=${electronDist} -c.electronVersion=${electronVer}
}
package() {
- mkdir -p "${pkgdir}/opt/${pkgname}"
- mkdir -p "${pkgdir}/usr/bin/"
- cp -R "${srcdir}/builds/linux-unpacked"/* "${pkgdir}/opt/${pkgname}"
- chmod 755 "${pkgdir}/opt/${pkgname}/tagspaces"
- ln -s "/opt/${pkgname}/tagspaces" "${pkgdir}/usr/bin/tagspaces"
- install -Dm644 "${srcdir}/${pkgname}.desktop" "${pkgdir}/usr/share/applications/${pkgname}.desktop"
- install -Dm644 "${srcdir}/${pkgname}-${pkgver}/resources/icons/256x256.png" "${pkgdir}/usr/share/pixmaps/${pkgname}.png"
+ install -Dm644 builds/linux-unpacked/resources/app.asar -t \
+ "$pkgdir/usr/lib/$pkgname/"
+ cp -r builds/linux-unpacked/resources/app.asar.unpacked -t \
+ "$pkgdir/usr/lib/$pkgname/"
+ for i in 16 32 48 64 128 256; do
+ install -Dm644 "builds/.icon-set/icon_${i}x${i}.png" \
+ "$pkgdir/usr/share/icons/hicolor/${i}x${i}/apps/$pkgname.png"
+ install -Dm644 builds/.icon-set/icon_512.png \
+ "$pkgdir/usr/share/icons/hicolor/512x512/apps/$pkgname.png"
+ done
+ install -Dm755 "$pkgname.sh" "$pkgdir/usr/bin/$pkgname"
+ install -Dm644 "$pkgname.desktop" -t "$pkgdir/usr/share/applications/"
}
diff --git a/tagspaces.desktop b/tagspaces.desktop
index 74746d18472d..062cdb2f16e0 100644
--- a/tagspaces.desktop
+++ b/tagspaces.desktop
@@ -1,9 +1,9 @@
[Desktop Entry]
Name=TagSpaces
-Exec=/usr/bin/tagspaces %U
+Exec=tagspaces
Terminal=false
Type=Application
Icon=tagspaces
StartupWMClass=TagSpaces
Comment=Offline file organizer and browser with tagging support.
-Categories=Office; \ No newline at end of file
+Categories=Office;
diff --git a/tagspaces.sh b/tagspaces.sh
new file mode 100644
index 000000000000..00deebe8fe0c
--- /dev/null
+++ b/tagspaces.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+exec electron25 /usr/lib/tagspaces/app.asar "$@"