├── .gitignore └── com.calibre_ebook.calibre.yaml /.gitignore: -------------------------------------------------------------------------------- 1 | .flatpak-builder/ 2 | build/ 3 | -------------------------------------------------------------------------------- /com.calibre_ebook.calibre.yaml: -------------------------------------------------------------------------------- 1 | app-id: com.calibre_ebook.calibre 2 | runtime: org.freedesktop.Platform 3 | runtime-version: '24.08' 4 | sdk: org.freedesktop.Sdk 5 | command: calibre 6 | separate-locales: false 7 | rename-desktop-file: calibre-gui.desktop 8 | rename-appdata-file: calibre-gui.metainfo.xml 9 | rename-mime-file: calibre-mimetypes.xml 10 | rename-icon: calibre-gui 11 | finish-args: 12 | - --device=all 13 | - --filesystem=host 14 | - --filesystem=xdg-config/kdeglobals:ro 15 | - --share=ipc 16 | - --share=network 17 | - --socket=fallback-x11 18 | - --socket=pulseaudio 19 | - --socket=wayland 20 | - --filesystem=xdg-run/speech-dispatcher:ro 21 | - --filesystem=xdg-data/Trash 22 | - --system-talk-name=org.freedesktop.UDisks2 23 | - --talk-name=com.canonical.AppMenu.Registrar 24 | - --talk-name=org.kde.StatusNotifierWatcher 25 | - --env=KDE_FORK_SLAVES=1 26 | - --env=SSL_CERT_DIR=/etc/ssl/certs 27 | - --env=OPENSSL_CONF=/dev/null 28 | modules: 29 | - name: calibre 30 | buildsystem: simple 31 | build-options: 32 | env: 33 | - XDG_UTILS_INSTALL_MODE=system 34 | build-commands: 35 | # Extract Calibre archive to target location 36 | - mkdir -p "${FLATPAK_DEST}/lib/calibre" 37 | - tar -xvf calibre*.txz -C "${FLATPAK_DEST}/lib/calibre" 38 | - rm -f calibre*.txz 39 | 40 | # Reuse liberation font files from runtime (saves 4MB) 41 | - rm "${FLATPAK_DEST}/lib/calibre/resources/fonts/liberation"/*.ttf 42 | - ln -s /usr/share/fonts/liberation-fonts/*.ttf "${FLATPAK_DEST}/lib/calibre/resources/fonts/liberation/" 43 | 44 | # Ensure that Calibre install script and the `xdg-utils` it uses will not 45 | # report errors because they are unable to find any suitable destination 46 | # directory to place their files into 47 | - mkdir -p "${FLATPAK_DEST}/bin" "${FLATPAK_DEST}"/share/{applications,desktop-directories,icons/hicolor,mime/packages} 48 | 49 | # Run Calibre system integration scripts 50 | - $FLATPAK_DEST/lib/calibre/calibre_postinstall --root=$FLATPAK_DEST 51 | 52 | # post-install for ebook-edit 53 | - mv $FLATPAK_DEST/share/applications/{calibre-ebook-edit,$FLATPAK_ID.ebook-edit}.desktop 54 | - for p in 16 32 48 64 128 256; do mv $FLATPAK_DEST/share/icons/hicolor/${p}x${p}/apps/{calibre-ebook-edit,$FLATPAK_ID.ebook-edit}.png; 55 | done 56 | - desktop-file-edit --set-key Icon --set-value $FLATPAK_ID.ebook-edit $FLATPAK_DEST/share/applications/$FLATPAK_ID.ebook-edit.desktop 57 | 58 | # post-install for ebook-viewer 59 | # NOTE: Upstream desktop and icon basenames do not match 60 | - mv $FLATPAK_DEST/share/applications/{calibre-ebook-viewer,$FLATPAK_ID.ebook-viewer}.desktop 61 | - for p in 16 32 48 64 128 256; do mv $FLATPAK_DEST/share/icons/hicolor/${p}x${p}/apps/{calibre-viewer,$FLATPAK_ID.ebook-viewer}.png; 62 | done 63 | - desktop-file-edit --set-key Icon --set-value $FLATPAK_ID.ebook-viewer $FLATPAK_DEST/share/applications/$FLATPAK_ID.ebook-viewer.desktop 64 | 65 | # post-install for lrfviewer 66 | # NOTE: Both lrfviewer and ebook-viewer share the same icon 67 | - mv $FLATPAK_DEST/share/applications/{calibre-lrfviewer,$FLATPAK_ID.lrfviewer}.desktop 68 | - desktop-file-edit --set-key Icon --set-value $FLATPAK_ID.ebook-viewer $FLATPAK_DEST/share/applications/$FLATPAK_ID.lrfviewer.desktop 69 | cleanup: 70 | - /bin/calibre-uninstall 71 | - /share/applications/mimeinfo.cache 72 | sources: 73 | - type: file 74 | only-arches: 75 | - x86_64 76 | url: https://github.com/kovidgoyal/calibre/releases/download/v8.4.0/calibre-8.4.0-x86_64.txz 77 | x-checker-data: 78 | type: anitya 79 | project-id: 6141 80 | url-template: https://github.com/kovidgoyal/calibre/releases/download/v$version/calibre-$version-x86_64.txz 81 | sha256: 5dc7a18c639f758bcff1b35cd0fbc34a8d5d5ef14d6038225bb5685d590238e9 82 | - type: file 83 | only-arches: 84 | - aarch64 85 | url: https://github.com/kovidgoyal/calibre/releases/download/v8.4.0/calibre-8.4.0-arm64.txz 86 | x-checker-data: 87 | type: anitya 88 | project-id: 6141 89 | url-template: https://github.com/kovidgoyal/calibre/releases/download/v$version/calibre-$version-arm64.txz 90 | sha256: b144eaf4828e4d90d5b6f48e50ab2844b595e678a0a123b1f1c838d51231354d 91 | modules: 92 | # Required by post-installation script only 93 | - name: xdg-utils 94 | buildsystem: autotools 95 | cleanup: ['*'] 96 | sources: 97 | - type: archive 98 | url: https://portland.freedesktop.org/download/xdg-utils-1.1.3.tar.gz 99 | sha256: d798b08af8a8e2063ddde6c9fa3398ca81484f27dec642c5627ffcaa0d4051d9 100 | modules: 101 | # Required by xmlto for converting HTML files to plain text 102 | # 103 | # Technically, we don't need this but patching the xmlto dependency 104 | # out of xdg-utils just isn't worth it. 105 | - name: links 106 | buildsystem: autotools 107 | post-install: 108 | - ln -s links "${FLATPAK_DEST}/bin/elinks" 109 | cleanup: ['*'] 110 | sources: 111 | - type: archive 112 | url: http://links.twibright.com/download/links-2.30.tar.bz2 113 | sha256: c4631c6b5a11527cdc3cb7872fc23b7f2b25c2b021d596be410dadb40315f166 114 | x-checker-data: 115 | type: anitya 116 | project-id: 1822 117 | url-template: http://links.twibright.com/download/links-$version.tar.bz2 118 | # Required by xdg-util's build system 119 | - name: xmlto 120 | buildsystem: autotools 121 | cleanup: ['*'] 122 | sources: 123 | - type: archive 124 | url: https://releases.pagure.org/xmlto/xmlto-0.0.29.tar.bz2 125 | sha256: 6000d8e8f0f9040426c4f85d7ad86789bc88d4aeaef585c4d4110adb0b214f21 126 | x-checker-data: 127 | type: anitya 128 | project-id: 13307 129 | url-template: https://releases.pagure.org/xmlto/xmlto-$version.tar.bz2 130 | - type: script 131 | commands: 132 | - autoreconf -fiv 133 | dest-filename: autogen.sh 134 | --------------------------------------------------------------------------------