diff --git a/.github/workflows/docker-debian13.yml b/.github/workflows/docker-debian13.yml new file mode 100644 index 00000000..9ee45c2f --- /dev/null +++ b/.github/workflows/docker-debian13.yml @@ -0,0 +1,122 @@ +name: CI Build Linux Debian13 +on: [push] + +jobs: + build: + name: Linux Debian13 build + runs-on: ubuntu-latest + container: + image: debian:trixie + options: --privileged --device /dev/fuse -v /usr/lib/modules/6.11.0-1018-azure:/lib/modules/6.11.0-1018-azure:shared + permissions: + contents: write + steps: + - name: Show Distro sources + run: | + # ls -l /etc/apt/ + # cat /etc/apt/sources.list + # ls -l /etc/apt/sources.list.d/ + cat /etc/apt/sources.list.d/debian.sources + + - name: Add Distro sources + run: | + sed -i 's/Types: deb/Types: deb deb-src/g' /etc/apt/sources.list.d/debian.sources + sed -i 's/Components: main/Components: main contrib non-free non-free-firmware/g' /etc/apt/sources.list.d/debian.sources + echo " + Types: deb deb-src + URIs: http://deb.debian.org/debian + Suites: trixie-backports + Components: main contrib non-free non-free-firmware + Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg" >> /etc/apt/sources.list.d/debian.sources + cat /etc/apt/sources.list.d/debian.sources + + - name: Update distro + run: apt update + # - name: Upgrade distro + # run: apt upgrade + + - name: Install build dependencies + run: apt -y install git cmake debhelper debhelper-compat intltool libcairomm-1.0-dev libdjvulibre-dev libenchant-2-dev libgtkmm-3.0-dev libgtksourceviewmm-3.0-dev libgtkspellmm-3.0-dev libjpeg-dev libjson-glib-dev libpangomm-1.4-dev libpodofo-dev libpoppler-glib-dev libpoppler-qt5-dev libpoppler-qt6-dev libqtspell-qt6-dev libquazip5-dev libquazip1-qt6-dev libsane-dev libtesseract-dev libxml++2.6-dev libzip-dev python3-gi qtbase5-dev qttools5-dev qttools5-dev-tools qt6-base-dev uuid-dev + # run: apt -y install git cmake debhelper intltool libcairomm-1.0-dev libdjvulibre-dev libgtkmm-3.0-dev libgtksourceviewmm-3.0-dev libgtkspellmm-3.0-dev libjson-glib-dev libpodofo-dev libpoppler-glib-dev libpoppler-qt5-dev libqtspell-qt5-dev libquazip5-dev libsane-dev libtesseract-dev libxml++2.6-dev libzip-dev python3-gi qtbase5-dev qttools5-dev qttools5-dev-tools uuid-dev + + - name: Install packaging dependencies + run: | + apt -y install kmod fuse 7zip wget + modprobe fuse + + - uses: actions/checkout@v4.2.2 + + - name: Build application GTK + run: | + mkdir -p build + cd build + cmake -DINTERFACE_TYPE=gtk .. + make + + - name: Build Packages GTK + run: | + cd build + ../packaging/AppImage/makePkg.sh -y Linux 64 -gtk + + # - name: Build application QT5 + # run: | + # mkdir -p build + # cd build + # rm -rf * 2> /dev/null + # cmake -DINTERFACE_TYPE=qt5 .. + # make + + # - name: Build Packages QT5 + # run: | + # cd build + # ../packaging/AppImage/makePkg.sh -y Linux 64 -qt5 + + - name: Build application QT6 + run: | + mkdir -p build + cd build + rm -rf * 2> /dev/null + cmake -DINTERFACE_TYPE=qt6 .. + make + + - name: Build Packages QT6 + run: | + cd build + ../packaging/AppImage/makePkg.sh -y Linux 64 -qt6 + + - name: Show packages + run: | + pwd + echo "list packaging/ ..." + ls -l packaging + + - name: Set safe directory + run: git config --global --add safe.directory ${GITHUB_WORKSPACE} + + - name: Reset ci-latest tag + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + git config --global user.email "ci@github.com" + git config --global user.name "Github CI" + git tag -d ci-latest || true + git push origin :ci-latest || true + git tag -m ci-latest ci-latest + git push --tags + + - name: Create release + id: create_release + uses: ncipollo/release-action@v1.18.0 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + allowUpdates: true + tag: ci-latest + name: CI Build + draft: false + prerelease: true + replacesArtifacts: true + artifacts: " + ./packaging/gImageReader*_Linux_x86_64_64bit.tgz, + ./packaging/gImageReader*_Linux_x86_64_64bit.AppImage + " diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml new file mode 100644 index 00000000..babc4dee --- /dev/null +++ b/.github/workflows/linux.yml @@ -0,0 +1,92 @@ +name: CI Build Linux +on: [push] + +jobs: + build: + name: Linux build + runs-on: ubuntu-latest + permissions: + contents: write + steps: + # - name: Update distro + # run: sudo apt update + # - name: Upgrade distro + # run: sudo apt upgrade + + - name: Install build dependencies + # run: sudo apt install cmake debhelper-compat intltool libcairomm-1.0-dev libdjvulibre-dev libenchant-2-dev libgtkmm-3.0-dev libgtksourceviewmm-3.0-dev libgtkspellmm-3.0-dev libjpeg-dev libjson-glib-dev libpangomm-1.4-dev libpodofo-dev libpoppler-glib-dev libpoppler-qt6-dev libqtspell-qt6-dev libquazip1-qt6-dev libsane-dev libtesseract-dev libxml++2.6-dev libzip-dev python3-gi qt6-base-dev uuid-dev + run: sudo apt install cmake debhelper intltool libcairomm-1.0-dev libdjvulibre-dev libgtkmm-3.0-dev libgtksourceviewmm-3.0-dev libgtkspellmm-3.0-dev libjson-glib-dev libpodofo-dev libpoppler-glib-dev libpoppler-qt5-dev libqtspell-qt5-dev libquazip5-dev libsane-dev libtesseract-dev libxml++2.6-dev libzip-dev python3-gi qtbase5-dev qttools5-dev qttools5-dev-tools uuid-dev + + - uses: actions/checkout@v4.2.2 + + - name: Build application GTK + run: | + mkdir -p build + cd build + cmake -DINTERFACE_TYPE=gtk .. + make + + - name: Build Packages GTK + run: | + cd build + ../packaging/AppImage/makePkg.sh -y Linux 64 -gtk + + - name: Build application QT5 + run: | + mkdir -p build + cd build + rm -rf * + cmake -DINTERFACE_TYPE=qt5 .. + make + + - name: Build Packages QT5 + run: | + cd build + ../packaging/AppImage/makePkg.sh -y Linux 64 -qt5 + + # - name: Build application QT6 + # run: | + # mkdir -p build + # cd build + # rm -rf .* * + # cmake -DINTERFACE_TYPE=qt6 .. + # make + + # - name: Build Packages QT6 + # run: | + # cd build + # ../packaging/AppImage/makePkg.sh -y Linux 64 -qt6 + + - name: Show packages + run: | + pwd + echo "list packaging/ ..." + ls -l packaging + + - name: Reset ci-latest tag + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + git config --global user.email "ci@github.com" + git config --global user.name "Github CI" + git tag -d ci-latest || true + git push origin :ci-latest || true + git tag -m ci-latest ci-latest + git push --tags + + - name: Create release + id: create_release + uses: ncipollo/release-action@v1.18.0 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + allowUpdates: true + tag: ci-latest + name: CI Build + draft: false + prerelease: true + replacesArtifacts: true + artifacts: " + ./packaging/gImageReader*_Linux_x86_64_64bit.tgz, + ./packaging/gImageReader*_Linux_x86_64_64bit.AppImage + " diff --git a/packaging/AppImage/gImageReader-gtk.desktop b/packaging/AppImage/gImageReader-gtk.desktop new file mode 100644 index 00000000..084398a0 --- /dev/null +++ b/packaging/AppImage/gImageReader-gtk.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Version=1.0 +Type=Application +Terminal=false +Exec=gimagereader-gtk +Comment=Start gImageReader-gtk +Comment[it_IT]=Avvia gImageReader-gtk +Icon=gImageReader +Icon[it_IT]=gImageReader +Name=gImageReader-gtk +Name[it_IT]=gImageReader-gtk +Categories=Utility diff --git a/packaging/AppImage/gImageReader-qt5.desktop b/packaging/AppImage/gImageReader-qt5.desktop new file mode 100644 index 00000000..0bfe265c --- /dev/null +++ b/packaging/AppImage/gImageReader-qt5.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Version=1.0 +Type=Application +Terminal=false +Exec=gimagereader-qt5 +Comment=Start gImageReader-qt5 +Comment[it_IT]=Avvia gImageReader-qt5 +Icon=gImageReader +Icon[it_IT]=gImageReader +Name=gImageReader-qt5 +Name[it_IT]=gImageReader-qt5 +Categories=Utility diff --git a/packaging/AppImage/gImageReader-qt6.desktop b/packaging/AppImage/gImageReader-qt6.desktop new file mode 100644 index 00000000..7e662740 --- /dev/null +++ b/packaging/AppImage/gImageReader-qt6.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Version=1.0 +Type=Application +Terminal=false +Exec=gimagereader-qt6 +Comment=Start gImageReader-qt6 +Comment[it_IT]=Avvia gImageReader-qt6 +Icon=gImageReader +Icon[it_IT]=gImageReader +Name=gImageReader-qt6 +Name[it_IT]=gImageReader-qt6 +Categories=Utility diff --git a/packaging/AppImage/gImageReader.png b/packaging/AppImage/gImageReader.png new file mode 100644 index 00000000..7d8a28ae Binary files /dev/null and b/packaging/AppImage/gImageReader.png differ diff --git a/packaging/AppImage/makePkg.sh b/packaging/AppImage/makePkg.sh new file mode 100755 index 00000000..cbb05109 --- /dev/null +++ b/packaging/AppImage/makePkg.sh @@ -0,0 +1,453 @@ +#!/bin/bash +# gImageReader v3.4.3 tesseract OCR front-end GUI +# makePkg.sh: Copyright 2005-2025 Valerio Messina efa@iol.it +# makePkg.sh is part of gImageReader +# gImageReader is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# gImageReader is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with gImageReader. If not, see . +# +# Script to generate a Linux|Mingw|MXE|OSX package of 'gImageReader' +# used on: Linux=>bin64, Linux=>bin32, Linux=>macOS64 +# MinGw64=>bin64, MinGw32=>bin32, MXE64=>bin64, MXE32=>bin32 +# 7z Win packages: $AppName/ (bin+assets) src/ +# tar.gz packages: $AppName/ (bin+assets) src/ +# AppImage packages: AppDir/ usr/bin +# macOS packages: DiskImage/$AppName.app/Contents/MacOS/ +# +# Syntax: $ makePkg.sh [-y] Linux|WinMxe|WinMgw|Osx [32|64] [trail] + +makePkgVer=2025-08-19 + +APP="gImageReader" # app name +BINRAD="gimagereader" # binary radix +BINPATH=`pwd` # where find the just build binary +SRCPATH="../gtk/src" # source package path +RESPATH="../packaging/AppImage" # other resources (readme, icons, desktop files) to copy in packages +TMPPATH="../packaging" # temp path where create uncompressed dir,AppDir,DiskImage +DSTPATH="../packaging" # path where write the final Linux|Mingw/MXE|OSX package + +DEPSPATHMGW64="/mingw64/bin" # path of DLLs needed to generate the Mingw64 package +DEPSPATHMGW32="/mingw32/bin" # path of DLLs needed to generate the Mingw32 package +DEPSLISTMGW="" # list of dll for MinGW cross-build dynamic link + +echo "makePkg.sh: create a Linux|MinGW|MXE|OSX package for $APP ..." + +# check for external dependency compliance +flag=0 +for extCmd in 7z chmod cp cut date getconf grep mkdir mv pwd realpath rm tar uname wget ; do + exist=`which $extCmd 2> /dev/null` + if (test "" = "$exist") then + echo "ERROR: makePkg.sh Required external dependency: "\"$extCmd\"" unsatisfied!" + flag=1 + fi +done +if [[ "$flag" = 1 ]]; then + echo "ERROR: makePkg.sh Install the required packages and retry. Exit" + exit +fi + +if (test "$1" = "-y") then + batch=1 + shift +fi +if [[ "$1" = "" || "$1" != "Linux" && "$1" != "WinMxe" && "$1" != "WinMgw" && "$1" != "Osx" ]]; then + echo "ERROR: makePkg.sh unsupported/miss target:'$1' platform to create package" + echo "Syntax: $ makePkg.sh [-y] Linux|WinMxe|WinMgw|Osx [32|64] [trail]" + echo " -y for batch execution without confirmations" + echo " trail is the GUI binary trailer. eg. Gui, -gtk, -qt5, -qt6" + exit +fi + +#exist=`which gtk-mac-bundler 2> /dev/null` +#if (test "$1" = "Osx" && test "" = "$exist") then +# echo "ERROR: makePkg.sh depend on 'gtk-mac-bundler' to generate for macOS. Exit" +# exit +#fi +exist=`which osxcross-dmg 2> /dev/null` +if (test "$1" = "OSX64" && test "" = "$exist") then + echo "ERROR: makePkg.sh depend on 'osxcross-dmg' to generate for macOS. Exit" + exit +fi + +PKG="$1" +CPU=`uname -m` # i686 or x86_64 +if (test "" = "$2") then + BIT=$(getconf LONG_BIT) +else # at least 2 + if [[ "$2" = "32" || "$2" = "64" ]]; then + BIT="$2" + if [[ "" != "$3" ]]; then + TRAIL="$3" + fi + else + TRAIL="$2" + fi +fi +if [[ "$TRAIL" = "" ]]; then + TRAIL="Gui" +fi + +BINCLI="" +BINGUI="${BINRAD}${TRAIL}" +BINPATH=`realpath "$BINPATH"` +SRCPATH=`realpath "$SRCPATH"` +RESPATH=`realpath "$RESPATH"` +DSTPATH=`realpath "$DSTPATH"` +if [[ ! -d "$BINPATH" ]]; then + echo "ERROR: makePkg.sh cannot find binary path '$BINPATH'. Exit" + exit +fi +if [[ ! -d "$SRCPATH" ]]; then + echo "ERROR: makePkg.sh cannot find source path '$SRCPATH'. Exit" + exit +fi +if [[ ! -d "$RESPATH" ]]; then + echo "ERROR: makePkg.sh cannot find resource path '$RESPATH'. Exit" + exit +fi +if (test "$BINCLI" = "" && test "$BINGUI" = "") then + echo "ERROR: makePkg.sh cannot be both NULL 'BINCLI' and 'BINGUI'. Exit" + exit +fi +if (test "$BINCLI" != "") then + if [[ ! -f "$BINPATH/$BINCLI" ]]; then + echo "ERROR: makePkg.sh cannot find just built binary '$BINPATH/$BINCLI'. Exit" + exit + fi +fi +if (test "$BINGUI" != "") then + if [[ ! -f "$BINPATH/$BINGUI" ]]; then + echo "ERROR: makePkg.sh cannot find just built binary '$BINPATH/$BINGUI'. Exit" + exit + fi +fi + +OS=`uname` +if (test "$OS" != "Darwin") then + OS=`uname -o` # Msys or GNU/Linux, illegal on macOS +fi +if [[ "$OS" != "Msys" && "$OS" != "GNU/Linux" ]]; then + echo "ERROR makePkg.sh: work in Linux|MXE(Linux)|MinGW only" + exit +fi +if [[ "$OS" = "Msys" && "$PKG" != "MGW32" && "$PKG" != "MGW64" ]]; then + echo "ERROR makePkg.sh: Unsupported target package:$PKG on MinGW/MSYS2" + exit +fi + +if [[ "$OS" = "GNU/Linux" && "$PKG" != "Linux" && "$PKG" != "WinMxe" && "$PKG" != "Osx" ]]; then + echo "ERROR makePkg.sh: Unsupported target package:$PKG on Linux" + exit +fi + +DATE=`date -I` +VER="3.4.3" # VER=`grep VER version.h | cut -d'"' -f2` # M.mm.bb +TGT=$PKG +if [[ "$OS" = "Msys" ]]; then + if [[ "$BIT" = "64" ]]; then + DEPPATH=$DEPSPATHMGW64 + fi + if [[ "$BIT" = "32" ]]; then + DEPPATH=$DEPSPATHMGW32 + fi +fi +TMPBINP="" # temp bin Package Path +if [[ "$PKG" = "Osx" ]]; then + TMPBINP="DiskImage/$APP.app/Contents/MacOS" +fi +if [[ "$PKG" = "Linux" ]]; then + TMPBINP="usr/bin" +fi +if (test "$CPU" = "x86_64" && test "$BIT" = "32") then + CPU=i686 +fi +if (test "$PKG" = "WinMxe" || test "$PKG" = "WinMgw") then + EXT=".exe" +fi +PKGNAME="${APP}${TRAIL}_${VER}_${DATE}_${TGT}_${CPU}_${BIT}bit" +echo "DATE : $DATE" # today +echo "HOSTOS : $OS" # current OS +echo "APP : $APP" # app name +echo "VER : $VER" # app src ver +echo "PKG : $PKG" # input parameter +echo "TGTOS : $TGT" # target OS +echo "TGTCPU : $CPU" # target CPU +echo "TGTBIT : $BIT" # target BIT +echo "BINRAD : $BINRAD" # binary radix +if (test "$BINCLI" != "") then +echo "BINCLI : $BINCLI" # binary file for CLI +fi +if (test "$BINGUI" != "") then +echo "BINGUI : $BINGUI" # binary file for GUI +fi +if (test "$EXT" != "") then +echo "EXT : $EXT" # binary extension (Mxe|MinGw) +fi +echo "BINPATH: $BINPATH" # binary path +echo "SRCPATH: $SRCPATH" # packaging file source path +echo "RESPATH: $RESPATH" # resources path +if (test "$DEPPATH" != "") then +echo "DEPPATH: $DEPPATH" # dependancy path (MinGw) +fi +echo "TMPPATH: $TMPPATH" # temp path where create uncompressed dir,AppDir,DiskImage +echo "TMPBINP: $TMPBINP" # tmp bin path. eg. usr/bin | DiskImage/$APP.app/Contents/MacOS +echo "DSTPATH: $DSTPATH" # package creation path +echo "PKGNAME: $PKGNAME" # package name +if (test "$batch" != "1") then + read -p "Proceed? A key to continue" +fi +echo "" + +echo "makePkg: Creating $APP $VER package for $TGT$BIT.$CPU ..." +#cp -a $RESPATH/README.txt $RESPATH/README.md + +echo "Creating temp and destination path if miss ..." +if [[ ! -d "$TMPPATH" ]]; then + mkdir -p "$TMPPATH" +fi +if [[ ! -d "$DSTPATH" ]]; then + mkdir -p "$DSTPATH" +fi + +echo "Removing old temp files if present ..." +if (test "$TGT" = "Linux" || test "$TGT" = "WinMxe" || test "$TGT" = "WinMgw") then + if [[ -d "$TMPPATH/$APP" ]]; then + echo "Removing old $APP ..." + rm -rf "$TMPPATH/$APP" + fi +fi +if (test "$TGT" = "Linux") then + if [[ -d "$TMPPATH/AppDir" ]]; then + echo "Removing old AppDir ..." + rm -rf "$TMPPATH/AppDir" + fi +fi + +echo "Removing old temp packages if present ..." +if (test "$TGT" = "Linux") then + if [[ -f "$TMPPATH/$PKGNAME.tgz" ]]; then + echo "Removing old tgz Package ..." + rm -rf "$TMPPATH/$PKGNAME.tgz" + fi + if [[ -f "$TMPPATH/$PKGNAME.AppImage" ]]; then + echo "Removing old AppImage ..." + rm -f "$TMPPATH/$PKGNAME.AppImage" + fi +fi +if (test "$TGT" = "WinMxe" || test "$TGT" = "WinMgw") then + if [[ -f "$TMPPATH/$PKGNAME.7z" ]]; then + echo "Removing old 7z Package ..." + rm -rf "$TMPPATH/$PKGNAME.7z" + fi +fi +if (test "$TGT" = "Osx") then + if [[ -f "$TMPPATH/$APP.dmg" ]]; then + echo "Removing old dmg Package ..." + rm -rf "$TMPPATH/$APP.dmg" + fi +fi + +if [[ "$TGT" = "Osx" ]]; then + if (test "$BINCLI" != "") then + cp -a $BINPATH/$BINCLI $TMPPATH # bin + fi + if (test "$BINGUI" != "") then + cp -a $BINPATH/$BINGUI $TMPPATH # bin + fi + cp -a $RESPATH/$APP.icns $TMPPATH # need to be near bin + cd $TMPPATH + #gtk-mac-bundler $APP.bundle + osxcross-dmg -rw $BIN $APP $VER # create compressed MacOS package + rm uncompressed.dmg $APP.icns # remove copied + rm $BINCLI $BINGUI 2>/dev/null # remove copied + mv $APP$VER.dmg $DSTPATH + exit +fi + +echo "Creating package directory structure ..." +mkdir -p $TMPPATH/$APP/src +if (test "$TGT" = "Linux") then + mkdir -p "$TMPPATH/AppDir/$TMPBINP" +fi + +echo "Copying sources ..." +cp -a $SRCPATH/*.h* $TMPPATH/$APP/src/ +cp -a $SRCPATH/*.c* $TMPPATH/$APP/src/ +#cp -a $SRCPATH/Makefile* $TMPPATH/$APP/src/ +#cp -a $SRCPATH/*.ini $TMPPATH/$APP/src/ # if needed +#cp -aL $SRCPATH/$APP.png $TMPPATH/$APP/src/ # if needed + +echo "Copying assets ..." +#cp -a $RESPATH/*.ini $TMPPATH/$APP/ # if needed +if (test "$TGT" = "Linux") then +#cp -a $RESPATH/*.ini $TMPPATH/AppDir/$TMPBINP # if needed +cp -a $RESPATH/$APP$TRAIL.desktop $TMPPATH/$APP/ +cp -a $RESPATH/$APP$TRAIL.desktop $TMPPATH/AppDir/ +cp -a $RESPATH/$APP.png $TMPPATH/$APP/ +cp -a $RESPATH/$APP.png $TMPPATH/AppDir/ +cp -a $RESPATH/makePkg.sh $TMPPATH/$APP/ +fi +if (test "$TGT" = "WinMxe" || test "$TGT" = "WinMgw") then +cp -a $RESPATH/$APP.ico $TMPPATH/$APP/ +fi + +echo "Copying docs ..." +cp -a ../COPYING $TMPPATH/$APP/ +#cp -a $RESPATH/README.txt $TMPPATH/$APP/ # if needed +#cp -a $RESPATH/Changelog.txt $TMPPATH/$APP/ # if needed +#cp -a $RESPATH/${APP}GUI.png $TMPPATH/$APP/ # if needed +if (test "$TGT" = "Linux") then +cp -a ../COPYING $TMPPATH/AppDir/ +#cp -a $RESPATH/README.txt $TMPPATH/AppDir/ # if needed +#cp -a $RESPATH/Changelog.txt $TMPPATH/AppDir/ # if needed +fi + +echo "Copying binary ..." +if [[ "$TGT" = "Linux" && "$BIT" = "64" ]]; then + if (test "$BINCLI" != "") then + cp -a $BINPATH/$BINCLI $TMPPATH/$APP/ + cp -a $BINPATH/$BINCLI $TMPPATH/AppDir/$TMPBINP/ + fi + if (test "$BINGUI" != "") then + cp -a $BINPATH/$BINGUI $TMPPATH/$APP/ + cp -a $BINPATH/$BINGUI $TMPPATH/AppDir/$TMPBINP/ + fi +fi +if [[ "$TGT" = "Linux" && "$BIT" = "32" ]]; then + if (test "$BINCLI" != "") then + cp -a $BINPATH/$BINCLI $TMPPATH/$APP/ + cp -a $BINPATH/$BINCLI $TMPPATH/AppDir/$TMPBINP/ + fi + if (test "$BINGUI" != "") then + cp -a $BINPATH/$BINGUI $TMPPATH/$APP/ + cp -a $BINPATH/$BINGUI $TMPPATH/AppDir/$TMPBINP/ + fi +fi + +if [[ "$TGT" = "WinMgw" && "$BIT" = "64" ]]; then + if (test "$BINCLI" != "") then + cp -a $BINPATH/$BINCLI$EXT $TMPPATH/$APP/ + fi + if (test "$BINGUI" != "") then + cp -a $BINPATH/$BINGUI$EXT $TMPPATH/$APP/ + fi + echo "Copying deps ..." + for DLL in $DEPSLISTMGW ; do + cp -a $DEPPATH/$DLL $TMPPATH/$APP/ + done +fi +if [[ "$TGT" = "WinMgw" && "$BIT" = "32" ]]; then + if (test "$BINCLI" != "") then + cp -a $BINPATH/$BINCLI$EXT $TMPPATH/$APP/ + fi + if (test "$BINGUI" != "") then + cp -a $BINPATH/$BINGUI$EXT $TMPPATH/$APP/ + fi + echo "Copying deps ..." + for DLL in $DEPSLISTMGW ; do + if [[ "$DLL" = "libgcc_s_seh-1.dll" ]]; then continue ; fi + cp -a $DEPPATH/$DLL $TMPPATH/$APP/ + done + cp -a $DEPPATH/libgcc_s_dw2-1.dll $TMPPATH/$APP/ +fi + +if [[ "$TGT" = "WinMxe" && "$BIT" = "64" ]]; then + if (test "$BINCLI" != "") then + cp -a $BINPATH/$BINCLI$EXT $TMPPATH/$APP/ + fi + if (test "$BINGUI" != "") then + cp -a $BINPATH/$BINGUI$EXT $TMPPATH/$APP/ + fi +fi +if [[ "$TGT" = "WinMxe" && "$BIT" = "32" ]]; then + if (test "$BINCLI" != "") then + cp -a $BINPATH/$BINCLI$EXT $TMPPATH/$APP/ + fi + if (test "$BINGUI" != "") then + cp -a $BINPATH/$BINGUI$EXT $TMPPATH/$APP/ + fi +fi + +# remove unwanted files if any + +echo "Compressing package ..." +cwd=`pwd` +cd $TMPPATH +if (test "$TGT" = "Linux") then + file="$PKGNAME.tgz" + echo "Creating package file:'$file' ..." + tar -cvaf $file $APP > /dev/null + echo "Package file:'$file' done" +fi +if (test "$TGT" = "WinMxe" || test "$TGT" = "WinMgw") then + file="$PKGNAME.7z" + echo "Creating package file:'$file' ..." + 7z a -m0=lzma -mx=9 -r $file $APP > /dev/null + echo "Package file:'$file' done" +fi +#rm -r AppDir +#rm -r $APP +mv $file $DSTPATH/ +echo "Release file: '$DSTPATH/$file'" + +# make AppImage +if [[ ("$TGT" = "Linux") && ("$CPU" = "x86_64" || "$CPU" = "i686")]]; then # skip on ARM & RISC-V + if (test -f logWget$DATE.txt) then { rm logWget$DATE.txt ; } fi + if (test "$BIT" = "64") then + echo "Generating the AppDir (about 3'50\") ..." + if (! test -x linuxdeploy-x86_64.AppImage) then + echo "Downloading linuxdeploy ..." + wget -nv "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage" 2>> logWget$DATE.txt + chmod +x linuxdeploy-x86_64.AppImage + fi + if (test "$TRAIL" = "-gtk") then + if (! test -x linuxdeploy-plugin-gtk.sh) then + echo "Downloading linuxdeploy GTK plugin ..." + wget -nv "https://raw.githubusercontent.com/linuxdeploy/linuxdeploy-plugin-gtk/master/linuxdeploy-plugin-gtk.sh" 2>> logWget$DATE.txt + chmod +x linuxdeploy-plugin-gtk.sh + fi + #./linuxdeploy-x86_64.AppImage -e $TMPPATH/AppDir/$TMPBINP/$BINGUI --appdir AppDir -p gtk -i $TMPPATH/AppDir/$APP.png -d $TMPPATH/AppDir/$APP$TRAIL.desktop --output appimage" + ./linuxdeploy-x86_64.AppImage -e $TMPPATH/AppDir/$TMPBINP/$BINGUI --appdir AppDir -p gtk -i $TMPPATH/AppDir/$APP.png -d $TMPPATH/AppDir/$APP$TRAIL.desktop > logLinuxdeploy$DATE.txt + cp -a $BINPATH/glib-2.0/schemas/org.gnome.gimagereader.gschema.xml $TMPPATH/AppDir/usr/share/glib-2.0/schemas/ + mv $TMPPATH/AppDir/usr/share/glib-2.0/schemas/gschemas.compiled $TMPPATH/AppDir/usr/share/glib-2.0/schemas/gschemas.compiled.orig + cp -a $BINPATH/glib-2.0/schemas/gschemas.compiled $TMPPATH/AppDir/usr/share/glib-2.0/schemas/ + fi + if [[ "$TRAIL" = "-qt5" || "$TRAIL" = "-qt6" ]]; then + if (! test -x linuxdeploy-plugin-qt-x86_64.AppImage) then + echo "Downloading linuxdeploy QT plugin ..." + wget -nv "https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage" 2>> logWget$DATE.txt + chmod +x linuxdeploy-plugin-qt-x86_64.AppImage + fi + #./linuxdeploy-x86_64.AppImage -e $TMPPATH/AppDir/$TMPBINP/$BINGUI --appdir AppDir -p qt -i $TMPPATH/AppDir/$APP.png -d $TMPPATH/AppDir/$APP$TRAIL.desktop --output appimage" + ./linuxdeploy-x86_64.AppImage -e $TMPPATH/AppDir/$TMPBINP/$BINGUI --appdir AppDir -p qt -i $TMPPATH/AppDir/$APP.png -d $TMPPATH/AppDir/$APP$TRAIL.desktop > logLinuxdeploy$DATE.txt + #cp -a $BINPATH/glib-2.0/schemas/org.gnome.gimagereader.gschema.xml $TMPPATH/AppDir/usr/share/glib-2.0/schemas/ + #mv $TMPPATH/AppDir/usr/share/glib-2.0/schemas/gschemas.compiled $TMPPATH/AppDir/usr/share/glib-2.0/schemas/gschemas.compiled.orig + #cp -a $BINPATH/glib-2.0/schemas/gschemas.compiled $TMPPATH/AppDir/usr/share/glib-2.0/schemas/ + fi + echo "Generating the AppImage (about 3'10\") ..." + ./linuxdeploy-x86_64.AppImage --appdir AppDir --output appimage >> logLinuxdeploy$DATE.txt + ret=$? + file="$PKGNAME.AppImage" + if (test "$ret" = "0") then + echo "AppImage created: $DSTPATH/$file" + mv ${APP}${TRAIL}-x86_64.AppImage $DSTPATH/$file + else + echo "AppImage failed: $file" + fi + fi + if (test "$BIT" = "32") then + echo "As now skip AppImage at 32 bit" + fi + #rm -rf $TMPPATH/AppDir + cd $cwd +fi +echo Done