diff --git a/Makefile.am b/Makefile.am index 786d79f9..a3825099 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,125 +1,127 @@ # Makefile.am - Installer for GnuPG 4 Windows Makefile. # Copyright (C) 2005, 2008, 2012 g10 Code GmbH # # This file is part of GPG4Win. # # GPG4Win 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. # # GPG4Win 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 this program; if not, see . ACLOCAL_AMFLAGS = -I m4 AUTOMAKE_OPTIONS = dist-bzip2 no-dist-gzip DISTCHECK_CONFIGURE_FLAGS = --host=i686-w64-mingw32 if BUILD_GPG4WIN po = po else po = endif if BUILD_GPG4WIN doc = doc else doc = endif SUBDIRS = ${po} packages ${doc} src # find patches -type f | sort | sed 's/$/ \\/' | sed 's/^/ /' # find patches-appimage -type f | sort | sed 's/$/ \\/' | sed 's/^/ /' EXTRA_DIST = autogen.sh README.GIT ONEWS \ doc/license-page doc/GPLv3 \ build-aux/git-log-footer build-aux/git-log-fix \ docker/appimage/build-appimage.sh \ docker/appimage/Dockerfile \ docker/build-appimage-docker-image.sh \ docker/run-appimage-build.sh \ patches/boost/boost-1-fixes.patch \ patches/breeze-icons/0001-Make-binary-icons-cross-compilable.patch \ patches/extra-cmake-modules/0001-Use-BIN_INSTALL_DIR-data-for-DATAROOTDIR-on-Windows.patch \ patches/glib/glib-1-fixes.patch \ patches/glib/glib-2-fixes.patch \ patches/gpgol/0001-Enable-sync-encryption-again.patch \ patches/kconfigwidgets/0001-Make-QDbus-optional.patch \ patches/kiconthemes/0001-Make-DBus-optional.patch \ patches/kleopatra/build-fixes.patch \ patches/kleopatra/lower-cmake-requirement.patch \ patches/kleopatra/set-cxx-standard.patch \ patches/kxmlgui/0001-make-qdbus-optional.patch \ patches/kxmlgui/0004-Cruedly-disable-KSendbugmail.patch \ patches/libkleo/lower-cmake-requirement.patch \ patches/libkleo/set-cxx-standard.patch \ patches/qtbase/0001-Fix-build-without-std-thread.patch \ patches/qtbase/0001-Gpg4win-qstandardpaths-patch.patch \ patches/qtbase/0002-Gpg4win-theme-names-and-relpaths.patch \ patches/qtbase/0003-Fix-build-with-GCC-11-include-limits.patch \ patches/qttools/disable-most-tools.patch \ patches/w32pth-2.0.5/workaround-broken-libtool.patch \ patches-appimage/kconfigwidgets/0001-build-without-KF5Auth.patch \ patches-appimage/ki18n/0001-Load-Qt-translations-even-if-some-catalogs-are-missi.patch \ patches-appimage/qtwayland-5.15.0/00-disable-wayland-server.patch \ patches-appimage/0001-Add-support-for-non-standard-boost-include-directori.patch \ patches-appimage/set-cxx-standard.patch \ patches-appimage/kleopatra/build-fixes.patch \ patches-appimage/kleopatra/set-cxx-standard.patch \ - patches-appimage/libkleo/set-cxx-standard.patch + patches-appimage/libkleo/set-cxx-standard.patch \ + patches-appimage/libkleo/gpg4win-check.patch \ + patches-appimage/kleopatra/aboutdata.patch copy-news: cp NEWS doc/website/NEWS.last copy-release: gpg4win-$(VERSION).tar.bz2 installers/gpg4win-$(VERSION).exe \ installers/gpg4win-light-$(VERSION).exe \ installers/gpg4win-vanilla-$(VERSION).exe @echo Copying $(VERSION) to $(RELEASEHOST) >&2 @set -e;\ if ssh "$$(echo $(RELEASEHOST)|cut -d: -f -1)" \ test -f "$$(echo $(RELEASEHOST)/gpg4win-$(VERSION).exe|cut -d: -f2-)";\ then echo "This release has already been copied to the server" >&2 ;\ else scp gpg4win-$(VERSION).tar.bz2 \ installers/gpg4win-$(VERSION).exe \ installers/gpg4win-light-$(VERSION).exe \ installers/gpg4win-vanilla-$(VERSION).exe \ installers/gpg4win-src-$(VERSION).exe $(RELEASEHOST)/ ;\ for f in en de ; do \ scp src/README.$$f.txt \ $(RELEASEHOST)/README-$(VERSION).$$f.txt; \ done;\ fi dist-hook: gen-ChangeLog gen_start_date = 2012-03-26T00:00:00 .PHONY: gen-ChangeLog gen-ChangeLog: set -e; \ if test -d $(top_srcdir)/.git; then \ (cd $(top_srcdir) && \ $(GITLOG_TO_CHANGELOG) --append-dot --tear-off \ --amend=build-aux/git-log-fix \ --since=$(gen_start_date) ) > $(distdir)/cl-t; \ cat $(top_srcdir)/build-aux/git-log-footer >> $(distdir)/cl-t;\ rm -f $(distdir)/ChangeLog; \ mv $(distdir)/cl-t $(distdir)/ChangeLog; \ fi download: packages/packages.common packages/packages.4 packages/packages.3 (cd packages; ./download.sh) msi: $(MAKE) $(AM_MAKEFLAGS) -C src msi msi-signed: $(MAKE) $(AM_MAKEFLAGS) -C src msi-signed msi-upload: $(MAKE) $(AM_MAKEFLAGS) -C src msi-upload diff --git a/docker/appimage/build-appimage.sh b/docker/appimage/build-appimage.sh index 55ee50ee..fbddfc41 100644 --- a/docker/appimage/build-appimage.sh +++ b/docker/appimage/build-appimage.sh @@ -1,113 +1,114 @@ #!/bin/sh # Build an AppImage of Kleopatra # Copyright (C) 2021 g10 Code GmbH # # Software engineering by Ingo Klöcker # # This file is part of GnuPG. # # GnuPG 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 3 of the License, or # (at your option) any later version. # # GnuPG 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 this program; if not, see . # # SPDX-License-Identifier: GPL-3.0+ set -e . /opt/rh/devtoolset-7/enable cd /src ./configure --enable-appimage --enable-maintainer-mode --disable-manuals cd /src make if [ -f /src/src/gnupg-vsd/custom.mk ]; then GNUPG_BUILD_VSD=yes else GNUPG_BUILD_VSD=no fi export GNUPG_BUILD_VSD echo 'rootdir = $APPDIR/usr' >/build/AppDir/usr/bin/gpgconf.ctl if [ $GNUPG_BUILD_VSD = yes ]; then echo 'sysconfdir = /etc/gnupg-vsd' >>/build/AppDir/usr/bin/gpgconf.ctl else echo 'sysconfdir = /etc/gnupg' >>/build/AppDir/usr/bin/gpgconf.ctl fi # Copy the start-shell helper for use AppRun cp /src/src/appimage/start-shell /build/AppDir/ chmod +x /build/AppDir/start-shell # Copy standard global configuration if [ $GNUPG_BUILD_VSD = yes ]; then mkdir -p /build/AppDir/usr/share/gnupg/conf/gnupg-vsd rsync -aLv --delete --omit-dir-times \ /src/src/gnupg-vsd/Standard/etc/gnupg/ \ /build/AppDir/usr/share/gnupg/conf/gnupg-vsd/ fi export PATH=/opt/linuxdeploy/usr/bin:$PATH export LD_LIBRARY_PATH=/build/install/lib # tell the linuxdeploy qt-plugin where to find qmake export QMAKE=/build/install/bin/qmake # create plugin directories expected by linuxdeploy qt-plugin # workaround for # [qt/stdout] Deploy[qt/stderr] terminate called after throwing an instance of 'boost::filesystem::filesystem_error' # [qt/stderr] what(): boost::filesystem::directory_iterator::construct: No such file or directory: "/build/AppDir/usr/plugins/sqldrivers" # ERROR: Failed to run plugin: qt (exit code: 6) mkdir -p /build/install/plugins/sqldrivers # copy KDE plugins for d in iconengines kf5 pim; do mkdir -p /build/AppDir/usr/plugins/${d}/ rsync -av --delete --omit-dir-times /build/install/lib64/plugins/${d}/ /build/AppDir/usr/plugins/${d}/ done cd /build # Remove existing AppRun and wrapped AppRun, that may be left over # from a previous run of linuxdeploy, to ensure that our custom AppRun # is deployed rm -f /build/AppDir/AppRun /build/AppDir/AppRun.wrapped 2>/dev/null # Remove existing translations that may be left over from a previous # run of linuxdeploy rm -rf /build/AppDir/usr/translations # Remove the version files to make sure that only one will be created. rm -f /build/AppDir/GnuPG-VS-Desktop-VERSION 2>/dev/null rm -f /build/AppDir/GnuPG-Desktop-VERSION 2>/dev/null # Extract gnupg version or (for VSD builds) gpg4win version for use # as filename of the AppImage if [ $GNUPG_BUILD_VSD = yes ]; then myversion=$(grep PACKAGE_VERSION /src/config.h|sed -n 's/.*"\(.*\)"$/\1/p') OUTPUT=gnupg-vs-desktop-${myversion}-x86_64.AppImage echo "Packaging GnuPG VS-Desktop Appimage: $myversion" echo $myversion >/build/AppDir/GnuPG-VS-Desktop-VERSION + cp /src/src/gnupg-vsd/Standard/VERSION* /build/AppDir/usr/ else myversion=$(ls /src/packages/gnupg-2.*tar.* \ | sed -n 's,.*/gnupg-\(2.*\).tar.*,\1,p') OUTPUT=gnupg-desktop-${myversion}-x86_64.AppImage echo "Packaging Gpg4win Appimage: $myversion" echo $myversion >/build/AppDir/GnuPG-Desktop-VERSION fi export OUTPUT linuxdeploy --appdir /build/AppDir \ --desktop-file /build/AppDir/usr/share/applications/org.kde.kleopatra.desktop \ --icon-file /build/AppDir/usr/share/icons/hicolor/256x256/apps/kleopatra.png \ --custom-apprun /src/src/appimage/AppRun \ --plugin qt \ --output appimage \ 2>&1 | tee /build/logs/linuxdeploy-gnupg-desktop.log diff --git a/patches-appimage/kleopatra/aboutdata.patch b/patches-appimage/kleopatra/aboutdata.patch new file mode 100755 index 00000000..af421ca4 --- /dev/null +++ b/patches-appimage/kleopatra/aboutdata.patch @@ -0,0 +1,22 @@ +#! /bin/sh +patch -p1 -l -f $* < $0 +exit $? + +diff --git a/src/aboutdata.cpp b/src/aboutdata.cpp +index c6df6bf6..7ffd5acb 100644 +--- a/src/aboutdata.cpp ++++ b/src/aboutdata.cpp +@@ -128,4 +128,13 @@ AboutData::AboutData() + #ifdef Q_OS_WIN + setBugAddress("https://dev.gnupg.org/u/rgpg4win"); + #endif ++ ++ /* For Linux it is possible that kleo is shipped as part ++ * of a Gpg4win based Appimage */ ++ if (Kleo::gpg4winSignedversion()) { ++ setVersion(Kleo::gpg4winVersion().toUtf8()); ++ setShortDescription(Kleo::gpg4winDescription()); ++ setOtherText(Kleo::gpg4winLongDescription()); ++ setBugAddress("https://dev.gnupg.org/u/rgpg4win"); ++ } + } diff --git a/patches-appimage/libkleo/gpg4win-check.patch b/patches-appimage/libkleo/gpg4win-check.patch new file mode 100755 index 00000000..14eb16b8 --- /dev/null +++ b/patches-appimage/libkleo/gpg4win-check.patch @@ -0,0 +1,17 @@ +#! /bin/sh +patch -p1 -l -f $* < $0 +exit $? + +diff --git a/src/utils/gnupg.cpp b/src/utils/gnupg.cpp +index de7994a..c8e3d36 100644 +--- a/src/utils/gnupg.cpp ++++ b/src/utils/gnupg.cpp +@@ -163,7 +163,7 @@ private: + /* We have a signed version so let us check it against the GnuPG + * release keys. */ + QProcess gpgv; +- gpgv.setProgram(Kleo::gpgPath().replace(QStringLiteral("gpg.exe"), QStringLiteral("gpgv.exe"))); ++ gpgv.setProgram(Kleo::gpgPath().replace(QStringLiteral("gpg"), QStringLiteral("gpgv"))); + const QString keyringPath(QStringLiteral("%1/../share/gnupg/distsigkey.gpg").arg(Kleo::gnupgInstallPath())); + gpgv.setArguments(QStringList() << QStringLiteral("--keyring") + << keyringPath