# Maintainer: Antoine Martin (ayakael) 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." # fix firefox #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 "