Skip to content

Commit

Permalink
New: Prepate flathub release
Browse files Browse the repository at this point in the history
  • Loading branch information
ollm committed Oct 7, 2024
1 parent 2d8803f commit 40c1b22
Show file tree
Hide file tree
Showing 21 changed files with 257 additions and 60 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ You can see the changes between versions in the [Changelog 📝](https://github.
- [.deb](https://github.com/ollm/OpenComic/releases/download/v1.3.1/opencomic_1.3.1_amd64.deb)
- [.rpm](https://github.com/ollm/OpenComic/releases/download/v1.3.1/opencomic-1.3.1.x86_64.rpm)
- [.7z](https://github.com/ollm/OpenComic/releases/download/v1.3.1/opencomic-1.3.1.7z)
- [.tar.gz](https://github.com/ollm/OpenComic/releases/download/v1.3.1/opencomic-1.3.1.tar.gz)
- [.snap](https://github.com/ollm/OpenComic/releases/download/v1.3.1/opencomic_1.3.1_amd64.snap)
- [.flatpak](https://github.com/ollm/OpenComic/releases/download/v1.3.1/OpenComic-1.3.1-x86_64.flatpak)
- [.AppImage](https://github.com/ollm/OpenComic/releases/download/v1.3.1/OpenComic-1.3.1.AppImage)
Expand All @@ -73,6 +74,7 @@ You can see the changes between versions in the [Changelog 📝](https://github.
- [arm64.deb](https://github.com/ollm/OpenComic/releases/download/v1.3.1/opencomic_1.3.1_arm64.deb)
- [arm64.rpm](https://github.com/ollm/OpenComic/releases/download/v1.3.1/opencomic-1.3.1.aarch64.rpm)
- [arm64.7z](https://github.com/ollm/OpenComic/releases/download/v1.3.1/opencomic-1.3.1-arm64.7z)
- [arm64.tar.gz](https://github.com/ollm/OpenComic/releases/download/v1.3.1/opencomic-1.3.1-arm64.tar.gz)
- [arm64.flatpak](https://github.com/ollm/OpenComic/releases/download/v1.3.1/OpenComic-1.3.1-aarch64.flatpak)
- [arm64.AppImage](https://github.com/ollm/OpenComic/releases/download/v1.3.1/OpenComic-1.3.1-arm64.AppImage)

Expand Down
5 changes: 4 additions & 1 deletion build/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
*.provisionprofile
node_gyp_bins
node_gyp_bins

# OSX
.DS_Store
2 changes: 2 additions & 0 deletions build/flatpak/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
build
.flatpak-builder
Binary file added build/flatpak/128x128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added build/flatpak/16x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added build/flatpak/256x256.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added build/flatpak/32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added build/flatpak/48x48.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added build/flatpak/64x64.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions build/flatpak/org.opencomic.app.desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[Desktop Entry]
Name=OpenComic
Exec=/app/bin/run.sh %U
Terminal=false
Type=Application
Icon=org.opencomic.app
StartupWMClass=OpenComic
Comment=Comic and manga reader
MimeType=application/x-cbz;application/x-cbr;application/x-cb7;application/x-cbt;application/pdf;application/x-bzpdf;application/x-gzpdf;application/epub+zip;
Categories=Graphics;
67 changes: 67 additions & 0 deletions build/flatpak/org.opencomic.app.metainfo.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop-application">
<id>org.opencomic.app</id>
<launchable type="desktop-id">org.opencomic.app.desktop</launchable>
<name>OpenComic</name>
<summary>Comic and Manga reader</summary>
<metadata_license>CC0-1.0</metadata_license>
<project_license>GPL-3.0-only</project_license>
<developer id="dev.ollm">
<name>Oleguer Llopart</name>
</developer>
<description>
<p>OpenComic is a comic/manga reader, can also open PDF files and ebooks (epub) among other features.</p>
</description>
<url type="homepage">https://github.com/ollm/OpenComic</url>
<url type="bugtracker">https://github.com/ollm/OpenComic/issues</url>
<url type="help">https://github.com/ollm/OpenComic/issues</url>
<url type="translate">https://github.com/ollm/OpenComic/blob/master/TRANSLATE.md/</url>
<url type="donation">https://github.com/ollm/OpenComic/blob/master/FUNDING.md</url>
<url type="vcs-browser">https://github.com/ollm/OpenComic</url>
<icon type="remote">https://raw.githubusercontent.com/ollm/OpenComic/master/images/icon-border-transparent.png</icon>
<screenshots>
<screenshot type="default">
<caption>OpenComic</caption>
<image>https://raw.githubusercontent.com/ollm/OpenComic/master/images/screenshots/main.png</image>
</screenshot>
<screenshot>
<caption>Colorize</caption>
<image>https://raw.githubusercontent.com/ollm/OpenComic/master/images/screenshots/colorize.png</image>
</screenshot>
<screenshot>
<caption>Colorize menu</caption>
<image>https://raw.githubusercontent.com/ollm/OpenComic/master/images/screenshots/colorize-menu.png</image>
</screenshot>
<screenshot>
<caption>eBook</caption>
<image>https://raw.githubusercontent.com/ollm/OpenComic/master/images/screenshots/ebook.png</image>
</screenshot>
<screenshot>
<caption>eBook menu</caption>
<image>https://raw.githubusercontent.com/ollm/OpenComic/master/images/screenshots/ebook-menu.png</image>
</screenshot>
<screenshot>
<caption>Master folders</caption>
<image>https://raw.githubusercontent.com/ollm/OpenComic/master/images/screenshots/master-folders.png</image>
</screenshot>
<screenshot>
<caption>Shortcuts (Keyboard and Gamepad)</caption>
<image>https://raw.githubusercontent.com/ollm/OpenComic/master/images/screenshots/shortcuts.png</image>
</screenshot>
</screenshots>
<content_rating type="oars-1.1"/>
<categories>
<category>Graphics</category>
</categories>
<branding>
<color type="primary" scheme_preference="light">#fde4e5</color>
<color type="primary" scheme_preference="dark">#fde4e5</color>
</branding>
<releases>
<release version="1.3.1" date="2024-10-05">
<description>
<p>Release to Flathub.</p>
</description>
</release>
</releases>
</component>
60 changes: 60 additions & 0 deletions build/flatpak/org.opencomic.app.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
app-id: org.opencomic.app
runtime: org.freedesktop.Platform
runtime-version: '22.08'
sdk: org.freedesktop.Sdk
base: org.electronjs.Electron2.BaseApp
base-version: '22.08'
command: run.sh
separate-locales: false
finish-args:
- --device=dri
- --share=ipc
- --socket=x11
- --socket=pulseaudio
- --share=network
modules:
- name: opencomic
buildsystem: simple
build-commands:
- mkdir -p /app/main/
- cp -r * /app/main/
- install -D 16x16.png --target-directory=/app/share/icons/hicolor/16x16/apps/org.opencomic.app.png
- install -D 32x32.png --target-directory=/app/share/icons/hicolor/32x32/apps/org.opencomic.app.png
- install -D 48x48.png --target-directory=/app/share/icons/hicolor/48x48/apps/org.opencomic.app.png
- install -D 64x64.png --target-directory=/app/share/icons/hicolor/64x64/apps/org.opencomic.app.png
- install -D 128x128.png --target-directory=/app/share/icons/hicolor/128x128/apps/org.opencomic.app.png
- install -D 256x256.png --target-directory=/app/share/icons/hicolor/256x256/apps/org.opencomic.app.png
- install -D org.opencomic.app.metainfo.xml --target-directory=/app/share/metainfo/
- install -D org.opencomic.app.desktop --target-directory=/app/share/applications/
- install -D run.sh --target-directory=/app/bin/
sources:
- type: archive
url: https://github.com/ollm/OpenComic/releases/download/v1.3.1/opencomic-1.3.1.tar.gz
sha256: 6bb0e222783cbf529ead024c7bcf30cdc0e83bdb074db38ed0ff9c21547e3a33
only-arches:
- x86_64
- type: archive
url: https://github.com/ollm/OpenComic/releases/download/v1.3.1/opencomic-1.3.1-arm64.tar.gz
sha256: c4bbbb8dbabc7ca4af0417dedb3dc6c7eb2888a4c55b78974555725101db4412
only-arches:
- aarch64
- type: file
path: org.opencomic.app.desktop
- type: file
path: org.opencomic.app.metainfo.xml
- type: file
path: 16x16.png
- type: file
path: 32x32.png
- type: file
path: 48x48.png
- type: file
path: 64x64.png
- type: file
path: 128x128.png
- type: file
path: 256x256.png
- type: script
dest-filename: run.sh
commands:
- zypak-wrapper /app/main/opencomic "$@"
Binary file modified images/logo-win-poster.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
78 changes: 38 additions & 40 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,41 +30,43 @@
"prebuild": "npm run test && npm run prebuild-start",
"prebuild-start": "node scripts/build.js && node themes/material-design/colors/generate-colors.js && node languages/fill-languages.js",
"prebuild-store": "node scripts/build-store.js",
"postbuild": "node scripts/test-postbuild.js",
"watch": "nodemon --ignore 'dist/' --ignore scripts/builded --watch * --exec npm run start",
"build": "npm run prebuild && electron-builder build",
"build-dist": "npm run prebuild && electron-builder --x64 --linux deb rpm AppImage 7z flatpak && electron-builder --arm64 --linux deb rpm AppImage 7z flatpak",
"build-linux": "npm run prebuild && electron-builder --x64 --linux deb rpm AppImage 7z",
"build-deb": "npm run prebuild && electron-builder --x64 --linux deb",
"build-rpm": "npm run prebuild && electron-builder --x64 --linux rpm",
"build-snap": "npm run prebuild && node ./scripts/snapcraft.js && electron-builder --x64 --linux snap",
"build-snap-store": "npm run prebuild && npm run prebuild-store && node ./scripts/snapcraft.js && electron-builder --x64 --linux snap",
"build-flatpak": "npm run prebuild && electron-builder --x64 --linux flatpak",
"build-appimage": "npm run prebuild && electron-builder --x64 --linux AppImage",
"build-tar": "npm run prebuild && electron-builder --x64 --linux tar.gz",
"build-zip": "npm run prebuild && electron-builder --x64 --linux zip",
"build-7z": "npm run prebuild && electron-builder --x64 --linux 7z",
"build-win": "npm run prebuild && electron-builder --win nsis portable",
"build-nsis": "npm run prebuild && electron-builder --win nsis",
"build-appx": "npm run prebuild && electron-builder --win appx",
"build-appx-store": "npm run prebuild && npm run prebuild-store && electron-builder --win appx",
"build-portable": "npm run prebuild && electron-builder --win portable",
"build-mac": "npm run prebuild && electron-builder --mac 7z dmg pkg && electron-builder --arm64 --mac 7z dmg pkg",
"build-mac-store": "npm run prebuild && npm run prebuild-store && electron-builder --universal --mac mas",
"build-mac-tar": "npm run prebuild && electron-builder --mac tar.gz",
"build-mac-zip": "npm run prebuild && electron-builder --mac zip",
"build-mac-dmg": "npm run prebuild && electron-builder --mac dmg && electron-builder --arm64 --mac dmg",
"build-mac-pkg": "npm run prebuild && electron-builder --mac pkg && electron-builder --arm64 --mac pkg",
"build-linux-arm": "npm run prebuild && electron-builder --arm64 --linux deb rpm AppImage 7z",
"build-deb-arm": "npm run prebuild && electron-builder --arm64 --linux deb",
"build-rpm-arm": "npm run prebuild && electron-builder --arm64 --linux rpm",
"build-snap-arm": "npm run prebuild && electron-builder --arm64 --linux snap",
"build-flatpak-arm": "npm run prebuild && electron-builder --arm64 --linux flatpak",
"build-appimage-arm": "npm run prebuild && electron-builder --arm64 --linux AppImage",
"build-tar-arm": "npm run prebuild && electron-builder --arm64 --linux tar.gz",
"build-zip-arm": "npm run prebuild && electron-builder --arm64 --linux zip",
"build-7z-arm": "npm run prebuild && electron-builder --arm64 --linux 7z",
"snapcraft": "npm run prebuild && node ./scripts/snapcraft.js && cd dist/__snap-amd64/ && snapcraft",
"snapcraft-arm": "npm run prebuild && node ./scripts/snapcraft.js && cd dist/__snap-arm64/ && snapcraft --target-arch=arm64",
"build": "npm run prebuild && electron-builder build && npm run postbuild",
"build-dist": "npm run prebuild && electron-builder --x64 --linux deb rpm AppImage 7z flatpak && electron-builder --arm64 --linux deb rpm AppImage 7z flatpak && npm run postbuild",
"build-linux": "npm run prebuild && electron-builder --x64 --linux deb rpm AppImage 7z tar.gz && npm run postbuild",
"build-deb": "npm run prebuild && electron-builder --x64 --linux deb && npm run postbuild",
"build-rpm": "npm run prebuild && electron-builder --x64 --linux rpm && npm run postbuild",
"build-snap": "npm run prebuild && node ./scripts/snapcraft.js && electron-builder --x64 --linux snap && npm run postbuild",
"build-snap-store": "npm run prebuild && npm run prebuild-store && node ./scripts/snapcraft.js && electron-builder --x64 --linux snap && npm run postbuild",
"build-flatpak": "npm run prebuild && electron-builder --x64 --linux flatpak && npm run postbuild",
"build-appimage": "npm run prebuild && electron-builder --x64 --linux AppImage && npm run postbuild",
"build-tar": "npm run prebuild && electron-builder --x64 --linux tar.gz && npm run postbuild",
"build-tar-store": "npm run prebuild && npm run prebuild-store && electron-builder --x64 --linux tar.gz && electron-builder --arm64 --linux tar.gz && npm run postbuild",
"build-zip": "npm run prebuild && electron-builder --x64 --linux zip && npm run postbuild",
"build-7z": "npm run prebuild && electron-builder --x64 --linux 7z && npm run postbuild",
"build-win": "npm run prebuild && electron-builder --win nsis portable && npm run postbuild",
"build-nsis": "npm run prebuild && electron-builder --win nsis && npm run postbuild",
"build-appx": "npm run prebuild && electron-builder --win appx && npm run postbuild",
"build-appx-store": "npm run prebuild && npm run prebuild-store && electron-builder --win appx && npm run postbuild",
"build-portable": "npm run prebuild && electron-builder --win portable && npm run postbuild",
"build-mac": "npm run prebuild && electron-builder --mac 7z dmg pkg && electron-builder --arm64 --mac 7z dmg pkg && npm run postbuild",
"build-mac-store": "npm run prebuild && npm run prebuild-store && electron-builder --universal --mac mas && npm run postbuild",
"build-mac-tar": "npm run prebuild && electron-builder --mac tar.gz && npm run postbuild",
"build-mac-zip": "npm run prebuild && electron-builder --mac zip && npm run postbuild",
"build-mac-dmg": "npm run prebuild && electron-builder --mac dmg && electron-builder --arm64 --mac dmg && npm run postbuild",
"build-mac-pkg": "npm run prebuild && electron-builder --mac pkg && electron-builder --arm64 --mac pkg && npm run postbuild",
"build-linux-arm": "npm run prebuild && electron-builder --arm64 --linux deb rpm AppImage 7z && npm run postbuild",
"build-deb-arm": "npm run prebuild && electron-builder --arm64 --linux deb && npm run postbuild",
"build-rpm-arm": "npm run prebuild && electron-builder --arm64 --linux rpm && npm run postbuild",
"build-snap-arm": "npm run prebuild && electron-builder --arm64 --linux snap && npm run postbuild",
"build-flatpak-arm": "npm run prebuild && electron-builder --arm64 --linux flatpak && npm run postbuild",
"build-appimage-arm": "npm run prebuild && electron-builder --arm64 --linux AppImage && npm run postbuild",
"build-tar-arm": "npm run prebuild && electron-builder --arm64 --linux tar.gz && npm run postbuild",
"build-zip-arm": "npm run prebuild && electron-builder --arm64 --linux zip && npm run postbuild",
"build-7z-arm": "npm run prebuild && electron-builder --arm64 --linux 7z && npm run postbuild",
"snapcraft": "npm run prebuild && node ./scripts/snapcraft.js && cd dist/__snap-amd64/ && snapcraft && npm run postbuild",
"snapcraft-arm": "npm run prebuild && node ./scripts/snapcraft.js && cd dist/__snap-arm64/ && snapcraft --target-arch=arm64 && npm run postbuild",
"postinstall": "electron-builder install-app-deps && node scripts/zstd-copy-native.js"
},
"dependencies": {
Expand Down Expand Up @@ -125,14 +127,13 @@
"!node_modules/ssh2/lib/protocol/crypto/build/node_gyp_bins",
"!node_modules/@img/",
"!node_modules/7zip-bin/+(linux|win|mac)/**",
"!node_modules/@toondepauw/",
"!node_modules/pdfjs-dist/",
"node_modules/@img/*${arch}*/**/*",
"!node_modules/@img/*linuxmusl*/**/*",
"node_modules/7zip-bin/${os}/${arch}",
"node_modules/@toondepauw/*${arch}*/**/*",
"node_modules/pdfjs-dist/build/pdf.mjs",
"node_modules/pdfjs-dist/build/pdf.worker.mjs",
"images/icon-border-transparent.png",
"images/logo.png",
"images/logo.svg",
"templates/index.html",
Expand Down Expand Up @@ -225,10 +226,7 @@
"application/pdf",
"application/x-bzpdf",
"application/x-gzpdf",
"application/epub+zip",
"text/directory",
"inode/directory",
"application/x-directory"
"application/epub+zip"
]
},
"snap": {
Expand Down
3 changes: 1 addition & 2 deletions scripts/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,14 @@ function createWindow() {
backgroundThrottling: false,
nativeWindowOpen: false,
},
titleBarStyle: (process.platform == 'linux') ? 'native' : 'hidden',
titleBarStyle: (process.platform == 'linux' && !configInit.forceLinuxHiddenTitleBar) ? 'native' : 'hidden',
titleBarOverlay: {
color: '#242a3000',
symbolColor: '#c2c7cf',
height: 29,
},
trafficLightPosition: {x: 10, y: 7},
backgroundColor: '#242a30',
//icon: __dirname + '/icon.svg',
});

require("@electron/remote/main").enable(win.webContents)
Expand Down
4 changes: 2 additions & 2 deletions scripts/opencomic.js
Original file line number Diff line number Diff line change
Expand Up @@ -882,8 +882,8 @@ function showAboutWindow()
var about = new electronRemote.BrowserWindow({
show: false,
title: language.menu.help.about,
width: 380,
height: 260,
width: 460,
height: 320,
minWidth: 380,
minHeight: 260,
//resizable: false,
Expand Down
3 changes: 2 additions & 1 deletion scripts/storage.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var changes = 89; // Update this if readingPagesConfig is updated
var changes = 90; // Update this if readingPagesConfig is updated

var readingPagesConfig = {
readingConfigName: '',
Expand Down Expand Up @@ -191,6 +191,7 @@ var storageDefault = {
},
configInit: {
forceColorProfile: '',
forceLinuxHiddenTitleBar: false,
},
readingShortcutPagesConfig: {
wildcard: {
Expand Down
64 changes: 64 additions & 0 deletions scripts/test-postbuild.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
const fs = require('fs');

function exists(path, permissions = false, fix = false)
{
if(!fs.existsSync(path))
throw new Error('Not exists! '+path+(fix ? '\nTry "'+fix+'"' : '')+'\n');

if(permissions !== false)
{
try
{
fs.accessSync(path, permissions);
}
catch (err)
{
throw new Error('No access! '+path);
}
}
}

const linux = './dist/linux-unpacked/resources/app.asar.unpacked/node_modules';
const linuxArm = './dist/linux-arm64-unpacked/resources/app.asar.unpacked/node_modules';

if(process.platform == 'darwin')
{


}
else if(process.platform == 'linux')
{
if(fs.existsSync('./dist/linux-unpacked/'))
{
// Node ZSTD All
exists(linux+'/@toondepauw/node-zstd/index.js', fs.constants.R_OK);
exists(linux+'/@toondepauw/node-zstd/node_modules/@toondepauw/node-zstd-linux-x64-gnu/node-zstd.linux-x64-gnu.node', fs.constants.R_OK);

// Sharp x64
exists(linux+'/@img/sharp-libvips-linux-x64/lib/libvips-cpp.so.42', fs.constants.R_OK);
exists(linux+'/@img/sharp-linux-x64/lib/sharp-linux-x64.node', fs.constants.X_OK | fs.constants.R_OK);

// 7zip
exists(linux+'/7zip-bin/linux/x64/7za', fs.constants.X_OK | fs.constants.R_OK);
}

if(fs.existsSync('./dist/linux-arm64-unpacked/'))
{
// Node ZSTD All
exists(linuxArm+'/@toondepauw/node-zstd/index.js', fs.constants.R_OK);
exists(linuxArm+'/@toondepauw/node-zstd/node_modules/@toondepauw/node-zstd-linux-arm64-gnu/node-zstd.linux-arm64-gnu.node', fs.constants.R_OK);

// Sharp arm64
exists(linuxArm+'/@img/sharp-libvips-linux-arm64/lib/libvips-cpp.so.42', fs.constants.R_OK);
exists(linuxArm+'/@img/sharp-linux-arm64/lib/sharp-linux-arm64.node', fs.constants.X_OK | fs.constants.R_OK);

// 7zip
exists(linuxArm+'/7zip-bin/linux/arm64/7za', fs.constants.X_OK | fs.constants.R_OK);
}
}
else if(process.platform == 'win32')
{

}

console.log('Runed postbuild tests: Ok');
Loading

0 comments on commit 40c1b22

Please sign in to comment.