From d5d85a538c9dee074771b10bd88e92616196808a Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Tue, 5 Mar 2024 00:45:28 -0500 Subject: [PATCH] user/zotero: enable on aarch64 --- user/zotero/APKBUILD | 31 +-- ....diff => zotero_build-modifications.patch} | 53 +++- user/zotero/zotero_drop-phantomjs.patch | 243 ++++++++++++++++++ 3 files changed, 301 insertions(+), 26 deletions(-) rename user/zotero/{zotero_build-modifications.diff => zotero_build-modifications.patch} (66%) create mode 100644 user/zotero/zotero_drop-phantomjs.patch diff --git a/user/zotero/APKBUILD b/user/zotero/APKBUILD index 6d73609..cbe92c1 100644 --- a/user/zotero/APKBUILD +++ b/user/zotero/APKBUILD @@ -8,7 +8,7 @@ _gittag=$pkgver # Date of release, YY-MM-DD for metainfo file (see package()) _releasedate=2024-02-03 pkgdesc="A free, easy-to-use tool to help you collect, organize, cite, and share your research sources." -arch="x86_64" +arch="x86_64 aarch64" url="https://github.com/zotero/zotero" license="GPL-3.0-only AND LGPL-2.1-only AND LGPL-3.0-only AND MPL-2.0" options="!check" # No test suite @@ -99,7 +99,8 @@ source=" zotero.desktop https://lab.ilot.io/mirrors/zotero-client/-/releases/$_gittag/downloads/tarball/zotero-client-$_gittag.tar.gz - zotero_build-modifications.diff + zotero_build-modifications.patch + zotero_drop-phantomjs.patch " builddir="$srcdir"/firefox-$_fxver @@ -143,6 +144,7 @@ export CXXFLAGS="${CXXFLAGS/-fstack-clash-protection/} -g0 -O2 -Wno-deprecated-b export LDFLAGS="$LDFLAGS -Wl,--undefined-version" prepare() { + mv "$_zoterodir" "$builddir"/zotero default_prepare cp "$srcdir"/stab.h toolkit/crashreporter/google-breakpad/src/ @@ -257,20 +259,10 @@ prepare() { # zotero prepare ( - cd "$_zoterodir" + cd "$builddir"/zotero # zotero build expects to be in a git repo git init git commit --allow-empty -m 'Initial' - - # zorero patches - for i in $source; do - case ${i%::*} in - *.diff) - msg ${i%::*} - patch ${patch_args:--p1} -i "$srcdir/$(filename_from_uri $i)" - ;; - esac - done ) } @@ -321,13 +313,13 @@ build() { ./mach build # install to where zotero expects it - DESTDIR="$_zoterodir"/app/xulrunner/firefox-$CARCH ./mach install - mv "$_zoterodir"/app/xulrunner/firefox-$CARCH/usr/lib/firefox-esr/* "$_zoterodir"/app/xulrunner/firefox-$CARCH/. - rm -R "$_zoterodir"/app/xulrunner/firefox-$CARCH/usr + DESTDIR="$builddir"/zotero/app/xulrunner/firefox ./mach install + mv "$builddir"/zotero/app/xulrunner/firefox/usr/lib/firefox-esr/* "$builddir"/zotero/app/xulrunner/firefox/. + rm -R "$builddir"/zotero/app/xulrunner/firefox/usr # zotero build ( - cd "$_zoterodir" + cd "$builddir"/zotero npm i --legacy-peer-deps NODE_OPTIONS=--openssl-legacy-provider npm run build @@ -338,7 +330,7 @@ build() { package() { install -dDm755 "$pkgdir"/usr/bin install -dDm755 "$pkgdir"/usr/lib/zotero - cp -r "$_zoterodir"/app/staging/Zotero_linux-$CARCH/* "$pkgdir/usr/lib/zotero" + cp -r "$builddir"/zotero/app/staging/Zotero_linux/* "$pkgdir/usr/lib/zotero" ln -s /usr/lib/zotero/zotero "$pkgdir/usr/bin/zotero" install -Dm644 "$srcdir/zotero.desktop" "$pkgdir/usr/share/applications/zotero.desktop" @@ -383,5 +375,6 @@ d354f48a29bfc16719f3b230b1395063239d4420f9e47522de4662392d9697b15f931ca3bf6055d1 fc45bc3ffb9404e5338ea26a9f04807b40f6f516324972cddd48bedb91b8bd7c6b8d4e03a0209020f5e67b703bc4ff89389985791b9bd544a0fc3951e2dc338e vendor-prefs.js e1a0a4ff5cc1b53f13776ca11927d671426b0691e78e74a4adf2166d57bb2ae8ac409cc11a37ce5e2f680fdf05d5bc3849c33a9717aca1bb62d03ae5231a67fb zotero.desktop 32263fda93adc17050e253b085cd42949db751e4ec9e9e84add7f934159031042649ca55d2546535f91e9b89d5de7b14eb5d1f10495037164c57bf8349ed9654 zotero-client-7.0.0_beta60.tar.gz -089370d86388b34003179ebf95894fb68069fe7ee1624f88e6c411bbbb4f7bc846287cf593034487967cf2bdf807c761212bdb6356bd604d1d04de35aeb3e646 zotero_build-modifications.diff +f196d9d82e50a5123342634b4d49a0776ca3668fcccd8b48bb28fac94107e11a039204f13030b405309cfafe53615a7a9f5c278d2b278140cbc0fb1cecf4cebc zotero_build-modifications.patch +cfe583f2da7508a4e07734a42519d7c28265928fe14c14b2f650ca6e56c35cb79272b03ed3bfb81e06c4e01458b55e04d10df5cbdd549da0d97206b2c10c3530 zotero_drop-phantomjs.patch " diff --git a/user/zotero/zotero_build-modifications.diff b/user/zotero/zotero_build-modifications.patch similarity index 66% rename from user/zotero/zotero_build-modifications.diff rename to user/zotero/zotero_build-modifications.patch index d8ff0c6..1d0d045 100644 --- a/user/zotero/zotero_build-modifications.diff +++ b/user/zotero/zotero_build-modifications.patch @@ -1,7 +1,7 @@ -diff --git a/app/build.sh b/app/build.sh +diff --git a/zotero/app/build.sh b/zotero/app/build.sh index 649d629..7d078b8 100755 ---- a/app/build.sh -+++ b/app/build.sh +--- a/zotero/app/build.sh ++++ b/zotero/app/build.sh @@ -59,10 +59,7 @@ function abspath { } @@ -43,10 +43,10 @@ index 649d629..7d078b8 100755 cp "$CALLDIR/linux/icons/icon64.png" "$APPDIR/icons/" cp "$CALLDIR/linux/icons/icon128.png" "$APPDIR/icons/" -diff --git a/app/scripts/fetch_xulrunner b/app/scripts/fetch_xulrunner +diff --git a/zotero/app/scripts/fetch_xulrunner b/zotero/app/scripts/fetch_xulrunner index 8b3d918..120b085 100755 ---- a/app/scripts/fetch_xulrunner -+++ b/app/scripts/fetch_xulrunner +--- a/zotero/app/scripts/fetch_xulrunner ++++ b/zotero/app/scripts/fetch_xulrunner @@ -132,15 +132,6 @@ function modify_omni { # Continue using app.update.auto in prefs.js on Windows replace_line 'PER_INSTALLATION_PREFS_PLATFORMS = \["win"\]' 'PER_INSTALLATION_PREFS_PLATFORMS = []' modules/UpdateUtils.jsm @@ -69,7 +69,7 @@ index 8b3d918..120b085 100755 GECKO_VERSION="$GECKO_VERSION_LINUX" - DOWNLOAD_URL="https://ftp.mozilla.org/pub/firefox/releases/$GECKO_VERSION" -+ pushd firefox-x86_64 ++ pushd firefox + modify_omni linux64 + popd @@ -103,3 +103,42 @@ index 8b3d918..120b085 100755 fi echo Done +diff --git a/zotero/app/build.sh.orig b/zotero/app/build.sh +index 702f499..3ee7e34 100755 +--- a/zotero/app/build.sh.orig ++++ b/zotero/app/build.sh +@@ -189,7 +189,7 @@ BUILD_ID=`date +%Y%m%d%H%M%S` + # Paths to Gecko runtimes + MAC_RUNTIME_PATH="$CALLDIR/xulrunner/Firefox.app" + WIN_RUNTIME_PATH_PREFIX="$CALLDIR/xulrunner/firefox-" +-LINUX_RUNTIME_PATH_PREFIX="$CALLDIR/xulrunner/firefox-" ++LINUX_RUNTIME_PATH_PREFIX="$CALLDIR/xulrunner/firefox" + + base_dir="$BUILD_DIR/base" + app_dir="$BUILD_DIR/base/app" +@@ -223,8 +223,8 @@ elif [ $BUILD_WIN == 1 ]; then + unzip -qj "${WIN_RUNTIME_PATH_PREFIX}win-x64"/omni.ja "hyphenation/*" -d "$app_dir"/hyphenation/ + elif [ $BUILD_LINUX == 1 ]; then + # Non-arch-specific files, so just use 64-bit version +- cp -Rp "${LINUX_RUNTIME_PATH_PREFIX}x86_64"/browser/omni "$app_dir" +- unzip -qj "${LINUX_RUNTIME_PATH_PREFIX}x86_64"/omni.ja "hyphenation/*" -d "$app_dir"/hyphenation/ ++ cp -Rp "${LINUX_RUNTIME_PATH_PREFIX}"/browser/omni "$app_dir" ++ unzip -qj "${LINUX_RUNTIME_PATH_PREFIX}"/omni.ja "hyphenation/*" -d "$app_dir"/hyphenation/ + fi + set -e + cd $omni_dir +@@ -825,11 +825,11 @@ if [ $BUILD_LINUX == 1 ]; then + fi + + for arch in $archs; do +- runtime_path="${LINUX_RUNTIME_PATH_PREFIX}${arch}" ++ runtime_path="${LINUX_RUNTIME_PATH_PREFIX}" + + # Set up directory +- echo 'Building Zotero_linux-'$arch +- APPDIR="$STAGE_DIR/Zotero_linux-$arch" ++ echo 'Building Zotero_linux' ++ APPDIR="$STAGE_DIR/Zotero_linux" + rm -rf "$APPDIR" + mkdir "$APPDIR" + diff --git a/user/zotero/zotero_drop-phantomjs.patch b/user/zotero/zotero_drop-phantomjs.patch new file mode 100644 index 0000000..1333cbe --- /dev/null +++ b/user/zotero/zotero_drop-phantomjs.patch @@ -0,0 +1,243 @@ +diff --git a/zotero/reader/epubjs/epub.js/package.json.orig b/zotero/reader/epubjs/epub.js/package.json +index bb440ac..b4c5c32 100644 +--- a/zotero/reader/epubjs/epub.js/package.json.orig ++++ b/zotero/reader/epubjs/epub.js/package.json +@@ -41,7 +41,6 @@ + "karma-chrome-launcher": "^3.1.0", + "karma-mocha": "^2.0.1", + "karma-mocha-reporter": "^2.2.5", +- "karma-phantomjs-launcher": "^1.0.4", + "karma-sourcemap-loader": "^0.3.7", + "karma-webpack": "^5.0.0", + "mocha": "^7.2.0", +diff --git a/zotero/reader/epubjs/epub.js/package-lock.json.orig b/zotero/reader/epubjs/epub.js/package-lock.json +index 6d728e7..c889b68 100644 +--- a/zotero/reader/epubjs/epub.js/package-lock.json.orig ++++ b/zotero/reader/epubjs/epub.js/package-lock.json +@@ -28,7 +28,6 @@ + "karma-chrome-launcher": "^3.1.0", + "karma-mocha": "^2.0.1", + "karma-mocha-reporter": "^2.2.5", +- "karma-phantomjs-launcher": "^1.0.4", + "karma-sourcemap-loader": "^0.3.7", + "karma-webpack": "^5.0.0", + "mocha": "^7.2.0", +@@ -8855,16 +8854,6 @@ + "node": ">=4" + } + }, +- "node_modules/karma-phantomjs-launcher": { +- "version": "1.0.4", +- "resolved": "https://registry.npmjs.org/karma-phantomjs-launcher/-/karma-phantomjs-launcher-1.0.4.tgz", +- "integrity": "sha1-0jyjSAG9qYY60xjju0vUBisTrNI=", +- "dev": true, +- "dependencies": { +- "lodash": "^4.0.1", +- "phantomjs-prebuilt": "^2.1.7" +- } +- }, + "node_modules/karma-sourcemap-loader": { + "version": "0.3.7", + "resolved": "https://registry.npmjs.org/karma-sourcemap-loader/-/karma-sourcemap-loader-0.3.7.tgz", +@@ -11342,26 +11331,6 @@ + "integrity": "sha1-elfrVQpng/kRUzH89GY9XI4AelA=", + "dev": true + }, +- "node_modules/phantomjs-prebuilt": { +- "version": "2.1.14", +- "resolved": "https://registry.npmjs.org/phantomjs-prebuilt/-/phantomjs-prebuilt-2.1.14.tgz", +- "integrity": "sha1-1T0xH8+30dCN2yQBRVjxGIxRbaA=", +- "dev": true, +- "dependencies": { +- "es6-promise": "~4.0.3", +- "extract-zip": "~1.5.0", +- "fs-extra": "~1.0.0", +- "hasha": "~2.2.0", +- "kew": "~0.7.0", +- "progress": "~1.1.8", +- "request": "~2.79.0", +- "request-progress": "~2.0.1", +- "which": "~1.2.10" +- }, +- "bin": { +- "phantomjs": "bin/phantomjs" +- } +- }, + "node_modules/picocolors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", +@@ -22124,16 +22093,6 @@ + } + } + }, +- "karma-phantomjs-launcher": { +- "version": "1.0.4", +- "resolved": "https://registry.npmjs.org/karma-phantomjs-launcher/-/karma-phantomjs-launcher-1.0.4.tgz", +- "integrity": "sha1-0jyjSAG9qYY60xjju0vUBisTrNI=", +- "dev": true, +- "requires": { +- "lodash": "^4.0.1", +- "phantomjs-prebuilt": "^2.1.7" +- } +- }, + "karma-sourcemap-loader": { + "version": "0.3.7", + "resolved": "https://registry.npmjs.org/karma-sourcemap-loader/-/karma-sourcemap-loader-0.3.7.tgz", +@@ -23984,23 +23943,6 @@ + "integrity": "sha1-elfrVQpng/kRUzH89GY9XI4AelA=", + "dev": true + }, +- "phantomjs-prebuilt": { +- "version": "2.1.14", +- "resolved": "https://registry.npmjs.org/phantomjs-prebuilt/-/phantomjs-prebuilt-2.1.14.tgz", +- "integrity": "sha1-1T0xH8+30dCN2yQBRVjxGIxRbaA=", +- "dev": true, +- "requires": { +- "es6-promise": "~4.0.3", +- "extract-zip": "~1.5.0", +- "fs-extra": "~1.0.0", +- "hasha": "~2.2.0", +- "kew": "~0.7.0", +- "progress": "~1.1.8", +- "request": "~2.79.0", +- "request-progress": "~2.0.1", +- "which": "~1.2.10" +- } +- }, + "picocolors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", +diff --git a/zotero/reader/package-lock.json.orig b/zotero/reader/package-lock.json +index 949e5de..0485ddd 100644 +--- a/zotero/reader/package-lock.json.orig ++++ b/zotero/reader/package-lock.json +@@ -83,7 +83,6 @@ + "karma-chrome-launcher": "^3.1.0", + "karma-mocha": "^2.0.1", + "karma-mocha-reporter": "^2.2.5", +- "karma-phantomjs-launcher": "^1.0.4", + "karma-sourcemap-loader": "^0.3.7", + "karma-webpack": "^5.0.0", + "mocha": "^7.2.0", +@@ -12332,20 +12331,6 @@ + "node": ">=4" + } + }, +- "node_modules/karma-phantomjs-launcher": { +- "version": "1.0.4", +- "resolved": "https://registry.npmjs.org/karma-phantomjs-launcher/-/karma-phantomjs-launcher-1.0.4.tgz", +- "integrity": "sha512-tf4P3plsE7wb5Pqh8GJ6RnElxfI/UM4MtVnjbSIZFpdFJlKnjRzfIx8MLCcSYJBwZ1+qSKFz4uBe3XNoq2t3KA==", +- "deprecated": "PhantomJS development have stopped, use puppeteer or similar", +- "dev": true, +- "dependencies": { +- "lodash": "^4.0.1", +- "phantomjs-prebuilt": "^2.1.7" +- }, +- "peerDependencies": { +- "karma": ">=0.9" +- } +- }, + "node_modules/karma-sourcemap-loader": { + "version": "0.3.8", + "resolved": "https://registry.npmjs.org/karma-sourcemap-loader/-/karma-sourcemap-loader-0.3.8.tgz", +@@ -15330,40 +15315,6 @@ + "integrity": "sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==", + "dev": true + }, +- "node_modules/phantomjs-prebuilt": { +- "version": "2.1.16", +- "resolved": "https://registry.npmjs.org/phantomjs-prebuilt/-/phantomjs-prebuilt-2.1.16.tgz", +- "integrity": "sha512-PIiRzBhW85xco2fuj41FmsyuYHKjKuXWmhjy3A/Y+CMpN/63TV+s9uzfVhsUwFe0G77xWtHBG8xmXf5BqEUEuQ==", +- "deprecated": "this package is now deprecated", +- "dev": true, +- "hasInstallScript": true, +- "dependencies": { +- "es6-promise": "^4.0.3", +- "extract-zip": "^1.6.5", +- "fs-extra": "^1.0.0", +- "hasha": "^2.2.0", +- "kew": "^0.7.0", +- "progress": "^1.1.8", +- "request": "^2.81.0", +- "request-progress": "^2.0.1", +- "which": "^1.2.10" +- }, +- "bin": { +- "phantomjs": "bin/phantomjs" +- } +- }, +- "node_modules/phantomjs-prebuilt/node_modules/which": { +- "version": "1.3.1", +- "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", +- "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", +- "dev": true, +- "dependencies": { +- "isexe": "^2.0.0" +- }, +- "bin": { +- "which": "bin/which" +- } +- }, + "node_modules/picocolors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", +@@ -27177,7 +27128,6 @@ + "karma-chrome-launcher": "^3.1.0", + "karma-mocha": "^2.0.1", + "karma-mocha-reporter": "^2.2.5", +- "karma-phantomjs-launcher": "^1.0.4", + "karma-sourcemap-loader": "^0.3.7", + "karma-webpack": "^5.0.0", + "mocha": "^7.2.0", +@@ -30497,16 +30447,6 @@ + } + } + }, +- "karma-phantomjs-launcher": { +- "version": "1.0.4", +- "resolved": "https://registry.npmjs.org/karma-phantomjs-launcher/-/karma-phantomjs-launcher-1.0.4.tgz", +- "integrity": "sha512-tf4P3plsE7wb5Pqh8GJ6RnElxfI/UM4MtVnjbSIZFpdFJlKnjRzfIx8MLCcSYJBwZ1+qSKFz4uBe3XNoq2t3KA==", +- "dev": true, +- "requires": { +- "lodash": "^4.0.1", +- "phantomjs-prebuilt": "^2.1.7" +- } +- }, + "karma-sourcemap-loader": { + "version": "0.3.8", + "resolved": "https://registry.npmjs.org/karma-sourcemap-loader/-/karma-sourcemap-loader-0.3.8.tgz", +@@ -32672,34 +32612,6 @@ + "integrity": "sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==", + "dev": true + }, +- "phantomjs-prebuilt": { +- "version": "2.1.16", +- "resolved": "https://registry.npmjs.org/phantomjs-prebuilt/-/phantomjs-prebuilt-2.1.16.tgz", +- "integrity": "sha512-PIiRzBhW85xco2fuj41FmsyuYHKjKuXWmhjy3A/Y+CMpN/63TV+s9uzfVhsUwFe0G77xWtHBG8xmXf5BqEUEuQ==", +- "dev": true, +- "requires": { +- "es6-promise": "^4.0.3", +- "extract-zip": "^1.6.5", +- "fs-extra": "^1.0.0", +- "hasha": "^2.2.0", +- "kew": "^0.7.0", +- "progress": "^1.1.8", +- "request": "^2.81.0", +- "request-progress": "^2.0.1", +- "which": "^1.2.10" +- }, +- "dependencies": { +- "which": { +- "version": "1.3.1", +- "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", +- "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", +- "dev": true, +- "requires": { +- "isexe": "^2.0.0" +- } +- } +- } +- }, + "picocolors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz",