flathub / rocks.koreader.KOReader

https://flathub.org/apps/details/rocks.koreader.KOReader
1 stars 2 forks source link

unbreak build #46

Closed pazos closed 3 months ago

pazos commented 4 months ago

Unbreak build with new koreader.appdata.xml since it is currently pulled from github and contains placeholders to be replaced for app version and release data.

This is an ugly hack that just hardcodes latest released version values (pulled from rocks.koreader.KOReader.metainfo.xml) into koreader.appdata.xml. Is required in order to build the app until the next KO version (2024.06) is out.

When that happens we can switch to tar.xz and remove the parts of the manifest labeled as "remove me"

flathubbot commented 4 months ago

Started test build 122294

flathubbot commented 4 months ago

Build 122294 failed

flathubbot commented 4 months ago

Started test build 122307

flathubbot commented 4 months ago

Build 122307 failed

flathubbot commented 4 months ago

Started test build 122308

flathubbot commented 4 months ago

Build 122308 successful To test this build, install it from the testing repository:

flatpak install --user https://dl.flathub.org/build-repo/105248/rocks.koreader.KOReader.flatpakref
pazos commented 4 months ago

Pinging @Frenzie. Do you think it makes sense to unbreak this now or do you want to wait to the next release and avoid hackish workarounds?

Frenzie commented 4 months ago

The current release is up on Flathub so if it'll fix itself automatically with the next one I see no reason for hacks.

pazos commented 4 months ago

The current release is up on Flathub so if it'll fix itself automatically with the next one I see no reason for hacks.

It won't get fixed automatically. It needs manual intervention.

All the bot can do is try: https://github.com/flathub/rocks.koreader.KOReader/pull/44 https://github.com/flathub/rocks.koreader.KOReader/pull/45 https://github.com/flathub/rocks.koreader.KOReader/pull/47 :)

pazos commented 4 months ago

I see no reason for hacks.

Me neither.

FWIW here's the future fix with no hacks. Relies on a future 2024.06 (and shasums!). Everything is pulled from the bundle, except the svg.

app-id: rocks.koreader.KOReader
runtime: org.freedesktop.Platform
runtime-version: '23.08'
sdk: org.freedesktop.Sdk
base-version: '23.08'
command: koreader
separate-locales: false

finish-args:
  # For game controller access
  - --device=all
  - --share=ipc
  - --share=network
  - --socket=wayland
  - --socket=fallback-x11
  - --filesystem=host
  - --filesystem=xdg-run/gvfs
  - --env=LD_LIBRARY_PATH=/app/lib

modules:
  - shared-modules/SDL2/SDL2-with-libdecor.json

  - name: koreader
    buildsystem: simple
    build-commands:
      - tar xf koreader.tar.xz
      - desktop-file-edit --set-icon ${FLATPAK_ID} --set-key Exec --set-value 'koreader %u' share/applications/koreader.desktop
      - install -Dm755 koreader.sh ${FLATPAK_DEST}/bin/koreader
      - install -Dm644 koreader.svg ${FLATPAK_DEST}/share/icons/hicolor/scalable/apps/${FLATPAK_ID}.svg
      - install -Dm644 koreader.appdata.xml ${FLATPAK_DEST}/share/metainfo/${FLATPAK_ID}.metainfo.xml
      - install -Dm644 share/applications/koreader.desktop ${FLATPAK_DEST}/share/applications/${FLATPAK_ID}.desktop
      - mv lib/koreader ${FLATPAK_DEST}/koreader
      - ln -s /run/host/user-fonts ${FLATPAK_DEST}/koreader/fonts/host

    sources:
      - type: file
        only-arches: [x86_64]
        url: https://github.com/koreader/koreader/releases/download/v2024.06/koreader-2024.06-linux-x86_64.tar.xz
        sha256: ?
        dest-filename: koreader.tar.xz
        x-checker-data:
          type: json
          url: https://api.github.com/repos/koreader/koreader/releases/latest
          version-query: .tag_name | sub("^v"; "")
          url-query: .assets[] | select(.name == "koreader-" + $version + "-x86_64.tar.xz")
            | .browser_download_url
          is-main-source: true

      - type: file
        only-arches: [aarch64]
        url: https://github.com/koreader/koreader/releases/download/v2024.06/koreader-2024.06-linux-aarch64.tar.xz
        sha256: ?
        dest-filename: koreader.tar.xz
        x-checker-data:
          type: json
          url: https://api.github.com/repos/koreader/koreader/releases/latest
          version-query: .tag_name | sub("^v"; "")
          url-query: .assets[] | select(.name == "koreader-" + $version + "-aarch64.tar.xz")
            | .browser_download_url

      - type: file
        url: https://raw.githubusercontent.com/koreader/koreader/master/resources/koreader.svg
        sha256: b285123a86736a5c317de1e9362c6a84fcebd7075c1f947586541d81f99ef29d
        dest-filename: koreader.svg
        x-checker-data:
          type: rotating-url
          url: https://github.com/koreader/koreader/raw/master/resources/koreader.svg
          pattern: https://github.com/koreader/koreader/raw/master/resources/koreader.svg

      - type: script
        dest-filename: koreader.sh
        commands:
          - |
            export FLATPAK=1
            cd /app/koreader
            RETURN_VALUE=85
            while [ ${RETURN_VALUE} -eq 85 ]; do
                ./reader.lua "$@"
                RETURN_VALUE=$?
                set --
            done
            exit ${RETURN_VALUE}
Frenzie commented 4 months ago

Sounds good!

pazos commented 3 months ago

Superseeded by #48