user/zotero: new aport

This commit is contained in:
Antoine Martin 2023-05-03 00:43:18 -04:00 committed by Antoine Martin
parent e1a4b2cafe
commit 629e559309
3 changed files with 181 additions and 0 deletions

93
user/zotero/APKBUILD Normal file
View file

@ -0,0 +1,93 @@
# Maintainer: Antoine Martin (ayakael) <dev@ayakael.net>
pkgname=zotero
pkgver=7.0.0_git20230415
pkgrel=0
pkgdesc="A free, easy-to-use tool to help you collect, organize, cite, and share your research sources."
arch="x86_64"
url="https://github.com/zotero/zotero"
_giturl="https://lab.ilot.io/mirrors/zotero"
_gittag_client=7.0.0_20230415
_gittag_standalone=7.0.0_20230415
_gittag_build=20230314
license="AGPL3"
depends="
dbus-glib
gtk+3.0
nss
libxt
"
makedepends="
npm
grep
zip
unzip
perl
python3
curl
nodejs
firefox-esr~=102
"
source="
zotero.desktop
xulrunner-get-alpine-firefox.diff
$_giturl-client/-/releases/$_gittag_client/downloads/tarball/zotero-client-$_gittag_client.tar.gz
$_giturl-standalone-build/-/releases/$_gittag_standalone/downloads/tarball/zotero-standalone-build-$_gittag_standalone.tar.gz
$_giturl-build/-/releases/$_gittag_build/downloads/tarball/zotero-build-$_gittag_build.tar.gz
"
builddir="$srcdir"/zotero-client-$_gittag_client
options="!check"
prepare() {
default_prepare
ln -s "$srcdir"/zotero-client-$_gittag_client "$srcdir"/zotero-client
ln -s "$srcdir"/zotero-build-$_gittag_build "$srcdir"/zotero-build
git init
git commit --allow-empty -m 'Initial'
npm i --legacy-peer-deps
cd "$srcdir"/zotero-standalone-build*
patch -p1 -i "$srcdir"/xulrunner-get-alpine-firefox.diff
# We need to had '.git/HEAD' and '.git/config' to the archive as the build expects those
mkdir .git
echo '[remote "origin"]\nurl="http://github.com/zotero/zotero-standalone-build"' > .git/config
echo "$_gittag_standalone" > .git/HEAD
./fetch_xulrunner.sh -p l
./fetch_pdftools
}
build() {
NODE_OPTIONS=--openssl-legacy-provider npm run build
cd "$srcdir"/zotero-standalone-build*
scripts/dir_build -p l
}
package() {
install -dDm755 "$pkgdir"/usr/bin
install -dDm755 "$pkgdir"/usr/lib/zotero
cp -r "$srcdir"/zotero-standalone-build*/staging/Zotero_linux-$CARCH/* "$pkgdir/usr/lib/zotero"
rm "$pkgdir/usr/lib/zotero/updater"
ln -s /usr/lib/zotero/zotero "$pkgdir/usr/bin/zotero"
install -Dm644 "$srcdir/zotero.desktop" "$pkgdir/usr/share/applications/zotero.desktop"
# Copy zotero icons to a standard location
install -Dm644 "$pkgdir/usr/lib/zotero/chrome/icons/default/default16.png" "$pkgdir/usr/share/icons/hicolor/16x16/apps/zotero.png"
install -Dm644 "$pkgdir/usr/lib/zotero/chrome/icons/default/default32.png" "$pkgdir/usr/share/icons/hicolor/32x32/apps/zotero.png"
install -Dm644 "$pkgdir/usr/lib/zotero/chrome/icons/default/default48.png" "$pkgdir/usr/share/icons/hicolor/48x48/apps/zotero.png"
install -Dm644 "$pkgdir/usr/lib/zotero/chrome/icons/default/default256.png" "$pkgdir/usr/share/icons/hicolor/256x256/apps/zotero.png"
# Close shell when launching
sed -i -r 's:^("\$CALLDIR/zotero-bin" -app "\$CALLDIR/application.ini" "\$@"):exec \1:' "$pkgdir/usr/lib/zotero/zotero"
}
sha512sums="
e1a0a4ff5cc1b53f13776ca11927d671426b0691e78e74a4adf2166d57bb2ae8ac409cc11a37ce5e2f680fdf05d5bc3849c33a9717aca1bb62d03ae5231a67fb zotero.desktop
1002732c348e3caceb077b8595a3a8b5c15dc17bc9c443e8dc96f8efe82ee37d9b5d7241530d82188846007504a277fd261763a4c64c3c259d9130db3139043d xulrunner-get-alpine-firefox.diff
88ae8204fde34bd6b1595ddddc153ded3a3bfcaeb5d65ffd8398d58f41787ddd2ff35051c4f74e0c83483b6ec234f1bf987acbebccfe73ad31be5cb4b55cc403 zotero-client-7.0.0_20230415.tar.gz
2dad54ac1a75e9ed62eec9fe08081e6807ce0167992059d3b7cd7aee3fb4803c694dc852ffe27f82cbe162c7536f2d77c302a8f947b507c6548f729a8c9d3057 zotero-standalone-build-7.0.0_20230415.tar.gz
8379985c0da84d82bdba72a03daaf3afe80a30ef696a2da837cff12b23fdec75b62dd43061ede4687c6acc756181ecefd0a025a7fedce500137faba4ae3326ae zotero-build-20230314.tar.gz
"

View file

@ -0,0 +1,79 @@
diff --git a/fetch_xulrunner.sh.orig b/fetch_xulrunner.sh
index b1e812f..ca3caa5 100755
--- a/fetch_xulrunner.sh.orig
+++ b/fetch_xulrunner.sh
@@ -114,15 +114,6 @@ function modify_omni {
replace_line 'MOZ_CRASHREPORTER:' 'MOZ_CRASHREPORTER: false \&\&' modules/AppConstants.jsm
replace_line 'MOZ_UPDATE_CHANNEL:.+' 'MOZ_UPDATE_CHANNEL: "none",' modules/AppConstants.jsm
replace_line '"https:\/\/[^\/]+mozilla.com.+"' '""' modules/AppConstants.jsm
-
- replace_line 'if \(!updateAuto\) \{' 'if (update.type == "major") {
- LOG("UpdateService:_selectAndInstallUpdate - prompting because it is a major update");
- AUSTLMY.pingCheckCode(this._pingSuffix, AUSTLMY.CHK_SHOWPROMPT_PREF);
- Services.obs.notifyObservers(update, "update-available", "show-prompt");
- return;
- }
- if (!updateAuto) {' modules/UpdateService.jsm
-
replace_line 'pref\("network.captive-portal-service.enabled".+' 'pref("network.captive-portal-service.enabled", false);' greprefs.js
replace_line 'pref\("network.connectivity-service.enabled".+' 'pref("network.connectivity-service.enabled", false);' greprefs.js
replace_line 'pref\("toolkit.telemetry.server".+' 'pref("toolkit.telemetry.server", "");' greprefs.js
@@ -368,31 +359,13 @@ fi
if [ $BUILD_LINUX == 1 ]; then
GECKO_VERSION="$GECKO_VERSION_LINUX"
- DOWNLOAD_URL="https://ftp.mozilla.org/pub/firefox/releases/$GECKO_VERSION"
- rm -rf firefox
-
- curl -O "$DOWNLOAD_URL/linux-i686/en-US/firefox-$GECKO_VERSION.tar.bz2"
- rm -rf firefox-i686
- tar xvf firefox-$GECKO_VERSION.tar.bz2
- mv firefox firefox-i686
-
- pushd firefox-i686
- modify_omni linux32
- popd
-
- rm "firefox-$GECKO_VERSION.tar.bz2"
-
- curl -O "$DOWNLOAD_URL/linux-x86_64/en-US/firefox-$GECKO_VERSION.tar.bz2"
rm -rf firefox-x86_64
- tar xvf firefox-$GECKO_VERSION.tar.bz2
- mv firefox firefox-x86_64
-
- pushd firefox-x86_64
- modify_omni linux64
- popd
-
- rm "firefox-$GECKO_VERSION.tar.bz2"
+ cp -r /usr/lib/firefox-esr firefox-x86_64
+
+ pushd firefox-x86_64
+ modify_omni linux64
+ popd
fi
echo Done
diff --git a/build.sh.orig b/build.sh
index 893f9fb..51ae170 100755
--- a/build.sh.orig
+++ b/build.sh
@@ -794,7 +794,7 @@ fi
# Linux
if [ $BUILD_LINUX == 1 ]; then
- for arch in "i686" "x86_64"; do
+ for arch in "x86_64"; do
runtime_path="${LINUX_RUNTIME_PATH_PREFIX}${arch}"
# Set up directory
@@ -807,7 +807,7 @@ if [ $BUILD_LINUX == 1 ]; then
cp -r "$runtime_path/"!(application.ini|browser|defaults|devtools-files|crashreporter|crashreporter.ini|firefox|pingsender|precomplete|removed-files|run-mozilla.sh|update-settings.ini|updater|updater.ini) "$APPDIR"
# Use our own launcher that calls the original Firefox executable with -app
- mv "$APPDIR"/firefox-bin "$APPDIR"/zotero-bin
+ mv "$APPDIR"/firefox-esr "$APPDIR"/zotero-bin
cp "$CALLDIR/linux/zotero" "$APPDIR"/zotero
# Copy Ubuntu launcher files

View file

@ -0,0 +1,9 @@
[Desktop Entry]
Type=Application
Name=Zotero
GenericName=Zotero Standalone. Is a free, easy-to-use tool to help you collect, organize, cite, and share your research sources.
Icon=zotero
Exec=/usr/bin/zotero -url %U
Categories=Office
Terminal=false
MimeType=x-scheme-handler/zotero