Skip to content

Commit

Permalink
Zotero 7.0 beta build
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastian-de committed Oct 31, 2023
1 parent 05ca795 commit 83fab7f
Show file tree
Hide file tree
Showing 3 changed files with 118 additions and 131 deletions.
131 changes: 63 additions & 68 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh
X86_64_URL=$(curl -I 'https://www.zotero.org/download/client/dl?channel=release&platform=linux-x86_64' | grep -i '^Location:' | cut -c 11- | tr -d '[:space:]')
I386_URL=$(curl -I 'https://www.zotero.org/download/client/dl?channel=release&platform=linux-i686' | grep -i '^Location:' | cut -c 11- | tr -d '[:space:]')
X86_64_URL=$(curl -I 'https://www.zotero.org/download/client/dl?channel=beta&platform=linux-x86_64' | grep -i '^Location:' | cut -c 11- | tr -d '[:space:]')
I386_URL=$(curl -I 'https://www.zotero.org/download/client/dl?channel=beta&platform=linux-i686' | grep -i '^Location:' | cut -c 11- | tr -d '[:space:]')

X86_64_SHA512=$(curl "$X86_64_URL" | sha512sum | cut -c -128)
I386_SHA512=$(curl "$I386_URL" | sha512sum | cut -c -128)
Expand All @@ -9,79 +9,74 @@ GITHUB_TAG=$(curl "$(curl https://api.github.com/repos/zotero/zotero/git/refs/ta
VERSION=$(echo $GITHUB_TAG | jq -r '.tag')
DATE=$(echo $GITHUB_TAG | jq -r '.tagger.date' | cut -c -10)

cat > flathub.json <<"EOF"
cat > flathub.json << 'EOF'
{
"only-arches": ["x86_64", "i386"]
}
EOF

cat > org.zotero.Zotero.json <<EOF
{
"id": "org.zotero.Zotero",
"runtime": "org.freedesktop.Platform",
"runtime-version": "22.08",
"sdk": "org.freedesktop.Sdk",
"command": "zotero",
"rename-desktop-file": "zotero.desktop",
"rename-icon": "zotero",
"finish-args": [
"--socket=x11",
"--share=ipc",
"--share=network",
"--filesystem=home",
"--filesystem=xdg-desktop",
"--filesystem=xdg-documents",
"--filesystem=xdg-download",
"--filesystem=xdg-music",
"--filesystem=xdg-pictures",
"--filesystem=xdg-public-share",
"--filesystem=xdg-videos"
],
"modules": [
"shared-modules/dbus-glib/dbus-glib.json",
{
"name": "zotero",
"buildsystem": "simple",
"sources": [
{
"type": "archive",
"url": "$X86_64_URL",
"sha512": "$X86_64_SHA512",
"only-arches": [
"x86_64"
]
},
{
"type": "archive",
"url": "$I386_URL",
"sha512": "$I386_SHA512",
"only-arches": [
"i386"
]
},
{
"type": "file",
"path": "org.zotero.Zotero.appdata.xml"
}
],
"build-commands": [
"mkdir -p /app/{bin,share}",
"cp -R . /app/share/zotero",
"install -D chrome/icons/default/default16.png /app/share/icons/hicolor/16x16/apps/zotero.png",
"install -D chrome/icons/default/default32.png /app/share/icons/hicolor/32x32/apps/zotero.png",
"install -D chrome/icons/default/default48.png /app/share/icons/hicolor/48x48/apps/zotero.png",
"install -D chrome/icons/default/default256.png /app/share/icons/hicolor/256x256/apps/zotero.png",
"desktop-file-install --dir=/app/share/applications --set-key=Exec --set-value='zotero -url %U' --set-key=Icon --set-value=org.zotero.Zotero --remove-key=SingleMainWindow --set-key=X-GNOME-SingleWindow --set-value=true --add-mime-type=x-scheme-handler/zotero zotero.desktop",
"install -D org.zotero.Zotero.appdata.xml /app/share/appdata/org.zotero.Zotero.appdata.xml",
"ln -s /app/share/zotero/zotero /app/bin/zotero",
"sed -i 's/pref(\"app.update.enabled\", true);/pref(\"app.update.enabled\", false);/' /app/share/zotero/defaults/preferences/prefs.js"
]
}
]
}
cat > org.zotero.Zotero.yaml << EOF
id: org.zotero.Zotero
runtime: org.freedesktop.Platform
runtime-version: "23.08"
sdk: org.freedesktop.Sdk
command: zotero
rename-desktop-file: zotero.desktop
finish-args:
- --filesystem=home
- --filesystem=xdg-desktop
- --filesystem=xdg-documents
- --filesystem=xdg-download
- --filesystem=xdg-music
- --filesystem=xdg-pictures
- --filesystem=xdg-public-share
- --filesystem=xdg-videos
- --share=ipc
- --share=network
- --socket=fallback-x11
- --socket=wayland
modules:
- shared-modules/dbus-glib/dbus-glib.json
- name: zotero
buildsystem: simple
sources:
- type: archive
url: $X86_64_URL
sha512: $X86_64_SHA512
only-arches:
- x86_64
- type: archive
url: $I386_URL
sha512: $I386_SHA512
only-arches:
- i386
- type: file
path: org.zotero.Zotero.appdata.xml
EOF

cat >> org.zotero.Zotero.yaml << 'EOF'
build-commands:
- 'mkdir -p /app/{bin,share}'
- cp -R . /app/share/zotero
- install -D chrome/icons/default/default16.png /app/share/icons/hicolor/16x16/apps/${FLATPAK_ID}.png
- install -D chrome/icons/default/default32.png /app/share/icons/hicolor/32x32/apps/${FLATPAK_ID}.png
- install -D chrome/icons/default/default48.png /app/share/icons/hicolor/48x48/apps/${FLATPAK_ID}.png
- install -D chrome/icons/default/default256.png /app/share/icons/hicolor/256x256/apps/${FLATPAK_ID}.png
- >-
desktop-file-install
--dir=/app/share/applications
--set-key=Exec --set-value='zotero -url %U'
--set-key=Icon --set-value=org.zotero.Zotero
--add-mime-type=x-scheme-handler/zotero
zotero.desktop
- install -D org.zotero.Zotero.appdata.xml /app/share/appdata/${FLATPAK_ID}.appdata.xml
- ln -s /app/share/zotero/zotero /app/bin/zotero
# TODO: Find out how to correctly disable the auto-updater in Zotero 7
# The command below has no effect
# - echo "pref("app.update.auto", false);" >> /app/share/zotero/app/prefs.js
EOF

cat > org.zotero.Zotero.appdata.xml <<EOF
cat > org.zotero.Zotero.appdata.xml << EOF
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright [2006] [Corporation for Digital Scholarship] -->
<component type="desktop-application">
Expand Down
63 changes: 0 additions & 63 deletions org.zotero.Zotero.json

This file was deleted.

55 changes: 55 additions & 0 deletions org.zotero.Zotero.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
id: org.zotero.Zotero
runtime: org.freedesktop.Platform
runtime-version: "23.08"
sdk: org.freedesktop.Sdk
command: zotero
rename-desktop-file: zotero.desktop
finish-args:
- --filesystem=home
- --filesystem=xdg-desktop
- --filesystem=xdg-documents
- --filesystem=xdg-download
- --filesystem=xdg-music
- --filesystem=xdg-pictures
- --filesystem=xdg-public-share
- --filesystem=xdg-videos
- --share=ipc
- --share=network
- --socket=fallback-x11
- --socket=wayland
modules:
- shared-modules/dbus-glib/dbus-glib.json
- name: zotero
buildsystem: simple
sources:
- type: archive
url: https://download.zotero.org/client/beta/7.0.0-beta.47%2Bf012a348a/Zotero-7.0.0-beta.47%2Bf012a348a_linux-x86_64.tar.bz2
sha512: d1d0d0819a0fc3d4b6fcca9d6a54cbeb2eb6c015bda0f4d434ba2934505d8ffb6e2e69d6ed7a557d35f1a1b073fcfabe7e12068b898d26c3b8db56b746d6a03f
only-arches:
- x86_64
- type: archive
url: https://download.zotero.org/client/beta/7.0.0-beta.47%2Bf012a348a/Zotero-7.0.0-beta.47%2Bf012a348a_linux-i686.tar.bz2
sha512: 276cb768191ac1e621582bf720ef12edb48fd87ce02ff8f8f896de8864ba397e9aeb94533adbcc1a63e5a2e56c11de6bc38b7b1b1a34aaf8343151ef4c721832
only-arches:
- i386
- type: file
path: org.zotero.Zotero.appdata.xml
build-commands:
- 'mkdir -p /app/{bin,share}'
- cp -R . /app/share/zotero
- install -D chrome/icons/default/default16.png /app/share/icons/hicolor/16x16/apps/${FLATPAK_ID}.png
- install -D chrome/icons/default/default32.png /app/share/icons/hicolor/32x32/apps/${FLATPAK_ID}.png
- install -D chrome/icons/default/default48.png /app/share/icons/hicolor/48x48/apps/${FLATPAK_ID}.png
- install -D chrome/icons/default/default256.png /app/share/icons/hicolor/256x256/apps/${FLATPAK_ID}.png
- >-
desktop-file-install
--dir=/app/share/applications
--set-key=Exec --set-value='zotero -url %U'
--set-key=Icon --set-value=org.zotero.Zotero
--add-mime-type=x-scheme-handler/zotero
zotero.desktop
- install -D org.zotero.Zotero.appdata.xml /app/share/appdata/${FLATPAK_ID}.appdata.xml
- ln -s /app/share/zotero/zotero /app/bin/zotero
# TODO: Find out how to correctly disable the auto-updater in Zotero 7
# The command below has no effect
# - echo "pref("app.update.auto", false);" >> /app/share/zotero/app/prefs.js

0 comments on commit 83fab7f

Please sign in to comment.