summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorNick White <git@njw.name>2022-11-12 21:41:20 +0000
committerNick White <git@njw.name>2022-11-12 21:41:20 +0000
commitbe3a836725a22d8bc41f576502f9db721283021c (patch)
tree1b4b56a1f36bfa6aa11f90caaf93882c9d9c0ec7 /cmd
parent3fb28b552eb1e945ff8ba48dd96271e641c295bc (diff)
rescribe: improve flatpak build, making it work cross platform
- compile all dependencies from scratch - don't explicitly set GOOS and GOARCH so a flatpak builder can cross-compile properly - switch from embedding compiled dependencies to having the wrapper script specify where the relevant things can be found
Diffstat (limited to 'cmd')
-rw-r--r--cmd/rescribe/xyz.rescribe.rescribe.yml44
1 files changed, 30 insertions, 14 deletions
diff --git a/cmd/rescribe/xyz.rescribe.rescribe.yml b/cmd/rescribe/xyz.rescribe.rescribe.yml
index 7d1ad77..f25455c 100644
--- a/cmd/rescribe/xyz.rescribe.rescribe.yml
+++ b/cmd/rescribe/xyz.rescribe.rescribe.yml
@@ -17,31 +17,47 @@ modules:
- name: rescribe
buildsystem: simple
build-commands:
- - cd cmd/rescribe && GOOS=linux GOARCH=amd64 go build -tags embed .
+ - cd cmd/rescribe && go build .
- install -Dm00755 cmd/rescribe/rescribe $FLATPAK_DEST/bin/rescribe-bin
- install -Dm00644 cmd/rescribe/icon.256.png $FLATPAK_DEST/share/icons/hicolor/256x256/apps/xyz.rescribe.rescribe.png
- install -Dm00644 cmd/rescribe/xyz.rescribe.rescribe.desktop $FLATPAK_DEST/share/applications/xyz.rescribe.rescribe.desktop
- install -Dm00644 cmd/rescribe/xyz.rescribe.rescribe.appdata.xml $FLATPAK_DEST/share/appdata/xyz.rescribe.rescribe.appdata.xml
- - printf '#!/bin/sh\nTMPDIR=$XDG_RUNTIME_DIR rescribe-bin\n' > $FLATPAK_DEST/bin/rescribe
+ - printf '#!/bin/sh\nTMPDIR=$XDG_RUNTIME_DIR rescribe-bin -gbookcmd "/app/bin/getgbook" -tesscmd "/app/bin/tesseract" -t "/app/share/tessdata/rescribev9_fast.traineddata"\n' > $FLATPAK_DEST/bin/rescribe
- chmod 755 $FLATPAK_DEST/bin/rescribe
+ - mkdir -p $FLATPAK_DEST/share/tessdata
+ - cp -r tessdata/* $FLATPAK_DEST/share/tessdata/
sources:
- type: git
url: https://github.com/rescribe/bookpipeline
- tag: v1.0.1
- commit: eac3d2a6c3302e78b34f4b680b7672d4bb44f9e3
+ tag: v1.0.2
+ commit: 3fb28b552eb1e945ff8ba48dd96271e641c295bc
- type: archive
url: https://rescribe.xyz/rescribe/modules-20221030-3a6024.tar.xz
sha256: 98fdbe455f7cb916cda570d0a30fca0de331809d4549e655e25b95e9be119856
strip-components: 0
- - type: file
- url: https://rescribe.xyz/rescribe/embeds/getgbook-linux-cac42fb.zip
- sha256: c3b40a1c13da613d383f990bda5dd72425a7f26b89102d272a3388eb3d05ddb6
- dest: cmd/rescribe
- - type: file
- url: https://rescribe.xyz/rescribe/embeds/tesseract-linux-v5.0.0-alpha.20210510.zip
- sha256: 81cfba632b8aaf0a00180b1aa62d357d50f343b0e9bd51b941ee14c289ccd889
- dest: cmd/rescribe
- - type: file
+ - type: archive
url: https://rescribe.xyz/rescribe/embeds/tessdata.20220322.zip
sha256: 725fd570a3c3dc0eba9463248ce47a8646db8bafb198d428d6bb8f0be18540ee
- dest: cmd/rescribe
+ strip-components: 0
+ dest: tessdata
+ - name: leptonica
+ sources:
+ - type: git
+ url: https://github.com/DanBloomberg/leptonica
+ tag: 1.82.0
+ commit: f4138265b390f1921b9891d6669674d3157887d8
+ - name: tesseract-ocr
+ sources:
+ - type: git
+ url: https://github.com/tesseract-ocr/tesseract
+ tag: 5.2.0
+ commit: 5ad5325a0aa8effc47ca033625b6a51682f82767
+ - name: getxbook
+ buildsystem: simple
+ build-commands:
+ - make DESTDIR=$FLATPAK_DEST PREFIX='' install
+ sources:
+ - type: git
+ url: https://git.njw.name/getxbook.git
+ commit: c770a86cca74f3b6235000c77c2ab74487e2ac2a
+ disable-shallow-clone: true