From 45627c634fe9678ce9e422f7901cc141cc723778 Mon Sep 17 00:00:00 2001 From: Nick White Date: Fri, 11 Nov 2022 13:21:11 +0000 Subject: Add flatpak support, including a appdata and .desktop files --- cmd/rescribe/makefile | 10 ++++++ cmd/rescribe/xyz.rescribe.rescribe.appdata.xml | 30 ++++++++++++++++++ cmd/rescribe/xyz.rescribe.rescribe.desktop | 9 ++++++ cmd/rescribe/xyz.rescribe.rescribe.yml | 42 ++++++++++++++++++++++++++ 4 files changed, 91 insertions(+) create mode 100644 cmd/rescribe/xyz.rescribe.rescribe.appdata.xml create mode 100644 cmd/rescribe/xyz.rescribe.rescribe.desktop create mode 100644 cmd/rescribe/xyz.rescribe.rescribe.yml (limited to 'cmd/rescribe') diff --git a/cmd/rescribe/makefile b/cmd/rescribe/makefile index 4d06e36..f1db3f3 100644 --- a/cmd/rescribe/makefile +++ b/cmd/rescribe/makefile @@ -28,6 +28,10 @@ dist/linux/rescribe: $(GODEPS) mkdir -p dist/linux GOOS=linux GOARCH=amd64 go build -tags embed -o $@ . +dist/linux/rescribe-nogenerate: $(GODEPS) + mkdir -p dist/linux + GOOS=linux GOARCH=amd64 go build -tags embed -o $@ . + build/darwin_amd64/rescribe: $(GODEPS) go generate mkdir -p build/darwin_amd64 @@ -61,5 +65,11 @@ dist/windows/rescribe.exe: build/windows/rescribe-bin.exe CC="x86_64-w64-mingw32-gcc" fyne package --name Rescribe --exe build/windows/rescribe-bin.exe --os windows --icon icon.png mv rescribe.exe $@ +# used for flatpak building +modules.tar.xz: ../../go.mod + go mod vendor + cd ../.. && tar c vendor | xz > cmd/rescribe/$@ + clean: rm -rf dist build + rm -rf ../../vendor diff --git a/cmd/rescribe/xyz.rescribe.rescribe.appdata.xml b/cmd/rescribe/xyz.rescribe.rescribe.appdata.xml new file mode 100644 index 0000000..7dbef66 --- /dev/null +++ b/cmd/rescribe/xyz.rescribe.rescribe.appdata.xml @@ -0,0 +1,30 @@ + + + xyz.rescribe.rescribe + + Rescribe + Rescribe Ltd + An easy-to-use desktop tool for performing OCR on image files, PDFs and Google Books. + +

An easy-to-use desktop tool for performing OCR on image files, PDFs and Google Books. It uses the Tesseract OCR engine, combined with modern and efficient preprocessing and analysis pipelines, to produce high quality output. The tool has been built with a focus on OCR of historical printed works, but it includes modern language options and also works well on modern printed works.

+ + + https://rescribe.xyz/rescribe/screenshot-02.png + + + https://rescribe.xyz/rescribe + + MIT + GPL-3.0 + + xyz.rescribe.rescribe.desktop + + + + +

Thanks to our fabulous Kickstarter backers, lots of improvements! Added GUI, added PDF extractor, added Google Book downloader, created a single binary for OSX for M1 and amd64, added file renamer so page files no longer need a particular naming format, added option to disable page wiping, added option to create full size PDF.

+
+
+
+ +
diff --git a/cmd/rescribe/xyz.rescribe.rescribe.desktop b/cmd/rescribe/xyz.rescribe.rescribe.desktop new file mode 100644 index 0000000..331079f --- /dev/null +++ b/cmd/rescribe/xyz.rescribe.rescribe.desktop @@ -0,0 +1,9 @@ +[Desktop Entry] +Version=1.0 +Type=Application +Name=Rescribe +Comment=An easy-to-use desktop tool for performing OCR on image files, PDFs and Google Books. +Categories=Office;Literature;OCR;Scanning;TextTools +Icon=xyz.rescribe.rescribe +Exec=rescribe +Terminal=false diff --git a/cmd/rescribe/xyz.rescribe.rescribe.yml b/cmd/rescribe/xyz.rescribe.rescribe.yml new file mode 100644 index 0000000..85ad046 --- /dev/null +++ b/cmd/rescribe/xyz.rescribe.rescribe.yml @@ -0,0 +1,42 @@ +app-id: xyz.rescribe.rescribe +runtime: org.freedesktop.Platform +runtime-version: '22.08' +sdk: org.freedesktop.Sdk +sdk-extensions: org.freedesktop.Sdk.Extension.golang +build-options: + append-path: /usr/lib/sdk/golang/bin +finish-args: + - --socket=fallback-x11 + - --share=ipc # needed for X11 + - --socket=wayland + - --device=dri # OpenGL + - --share=network # Used for google book downloading + - --filesystem=home +command: rescribe +modules: + - name: rescribe + buildsystem: simple + build-commands: + - cd cmd/rescribe && make dist/linux/rescribe-nogenerate + - install -Dm00755 cmd/rescribe/dist/linux/rescribe-nogenerate $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 + - chmod 755 $FLATPAK_DEST/bin/rescribe + sources: + - type: dir # not git 'til the makefile with nogenerate rule there + path: ../.. + - 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 + - type: file + url: https://rescribe.xyz/rescribe/embeds/tesseract-linux-v5.0.0-alpha.20210510.zip + sha256: 81cfba632b8aaf0a00180b1aa62d357d50f343b0e9bd51b941ee14c289ccd889 + - type: file + url: https://rescribe.xyz/rescribe/embeds/tessdata.20220322.zip + sha256: 725fd570a3c3dc0eba9463248ce47a8646db8bafb198d428d6bb8f0be18540ee -- cgit v1.2.1-24-ge1ad