summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick White <git@njw.name>2022-11-11 13:21:11 +0000
committerNick White <git@njw.name>2022-11-11 13:21:11 +0000
commit45627c634fe9678ce9e422f7901cc141cc723778 (patch)
tree6c4e68f3ca762a04cabc7cf6d572550372e94756
parent06b68d5765048e0adb27395b8df90e90251db76a (diff)
Add flatpak support, including a appdata and .desktop files
-rw-r--r--cmd/rescribe/makefile10
-rw-r--r--cmd/rescribe/xyz.rescribe.rescribe.appdata.xml30
-rw-r--r--cmd/rescribe/xyz.rescribe.rescribe.desktop9
-rw-r--r--cmd/rescribe/xyz.rescribe.rescribe.yml42
4 files changed, 91 insertions, 0 deletions
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 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<component type="desktop-application">
+ <id>xyz.rescribe.rescribe</id>
+
+ <name>Rescribe</name>
+ <developer_name>Rescribe Ltd</developer_name>
+ <summary>An easy-to-use desktop tool for performing OCR on image files, PDFs and Google Books.</summary>
+
+ <description><p>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.</p></description>
+
+ <screenshots>
+ <screenshot type="default"><image>https://rescribe.xyz/rescribe/screenshot-02.png</image></screenshot>
+ </screenshots>
+
+ <url type="homepage">https://rescribe.xyz/rescribe</url>
+
+ <metadata_license>MIT</metadata_license>
+ <project_license>GPL-3.0</project_license>
+
+ <launchable type="desktop-id">xyz.rescribe.rescribe.desktop</launchable>
+
+ <releases>
+ <release version="1.0.0" date="2022-03-22" type="stable">
+ <description>
+ <p>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.</p>
+ </description>
+ </release>
+ </releases>
+
+</component>
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