Page Menu
Home
GnuPG
Search
Configure Global Search
Log In
Files
F35313411
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Size
74 KB
Subscribers
None
View Options
diff --git a/build.sh b/build.sh
index 64a43b30..a0bfb10a 100755
--- a/build.sh
+++ b/build.sh
@@ -1,815 +1,815 @@
#!/bin/bash
# Copyright (C) 2024 g10 Code GmbH
#
# Software engineering by Andre Heinecke <aheinecke@gnupg.org>
#
# 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 <https://www.gnu.org/licenses/>.
# SPDX-License-Identifier: GPL-2.0-or-later
set -e
PGM=build.sh
usage()
{
cat <<EOF
Usage: $PGM [OPTIONS]
Build Gpg4win in a docker containter.
Options:
--appimage Build the AppImage instead of the NSIS installer.
--gnupg22 Use GnuPG 2.2
--gnupg24 Use GnuPG 2.4
--gnupg26 Use GnuPG 2.6 (default)
--w32 Use 32 bit Windows as primary host arch
--clean Remove a pre-existing build directory
--dist Create a distributable tarball
--release Create a tarball and then build this tarball
--shell Start a shell instead of starting the build script
--builddir=DIR Directory where the build should take place
(default is ~/b/SRCDIRNAME-playground for gpg4win
and ~/b/SRCDIRNAME-appimage for the AppImage)
--logfile=file Change default build log file to FILE
--force Force configure run
--no-sign Do not authenticode sign packages
--update-image Update the docker image before build
--msi Building MSI packages
--user=name Use NAME as FTP server user
--download Download packages first
--runcmd CMD Run a command via a pair of FIFOs
--git-pkgs Use latest git versions for the frontend
packages:
libkleo kleopatra gpgol gpgol.js
gpgpass gpg4win-tools mimetreeparser
This script is used to build either the Appimage or the Windows
installer. The build is done in a build directory with the suffix
"-playground". Use the option --builddir to use a non-default build
directory. Take care not to use the source directory for building.
Examples:
./$PGM
Build in the default build directory ~/b/SRCDIRNAME-playground
./$PGM --builddir=/foo/bar/my-playground
Build in the given directory.
EOF
exit $1
}
# Other constants
WINE=wine
WINHOST=win10
WINLIGHT=c:/wix/light.exe
# WINEPREFIX - determined at runtime or passed by caller
# WIXPREFIX - determined at runtime or passed by caller
# Store the original script and the command line
# for diagnostic reasons
myself="$0"
commandline="$0 $@"
# Preset variables.
indocker="no"
gnupgtag="gnupg26"
shell="no"
clean="no"
dist="no"
release="no"
branch="master"
srcdir=$(cd $(dirname $0); pwd)
is_tmpbuild="no"
update_image="no"
w64="yes"
download="no"
runcmd="no"
fromgit="no"
withmsi="no"
force=no
nosign=no
ftpuser=
verbose=
logfile=
quiet=
# Get UID for use by docker.
userid=$(id -u)
groupid=$(id -g)
# Track whether we reset the tty to cooked mode. docker sets it to raw mode
# and we set it back via our runner process so that we are sure docker is
# already running.
recooked=
# Parse the command line options.
skipshift=
while [ $# -gt 0 ]; do
case "$1" in
--*=*)
optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'`
;;
*)
optarg=""
;;
esac
case "$1" in
--appimage) appimage="yes";;
--gnupg22) gnupgtag="gnupg22";;
--gnupg24) gnupgtag="gnupg24";;
--gnupg26) gnupgtag="gnupg26";;
--shell) shell="yes";;
--clean|-c) clean="yes";;
--dist) dist="yes";;
--release) release="yes";;
--update-image|--update-img|-u) update_image="yes";;
--w32) w64="no";;
--w64) w64="yes";;
--force) force="yes";;
--no-sign) nosign="yes" ;;
--download) download="yes";;
--runcmd) runcmd="yes";;
--git|-g|--git-pkgs) fromgit="yes";;
--builddir|--builddir=*) builddir="${optarg}" ;;
--logfile|--logfile=*) logfile="${optarg}" ;;
--user|--user=*) ftpuser="${optarg}" ;;
--msi|--with-msi) withmsi=yes ;;
--verbose|-v) verbose=yes ;;
--*) usage 1 1>&2; exit 1;;
*) skipshift=1; break ;;
esac
[ -z "$skipshift" ] && shift
done
[ -z "$verbose" ] && quiet="--quiet"
if [ -z "$builddir" ]; then
if [ "$release" = "yes" ]; then
builddir="${HOME}/b/$(basename "$srcdir")-mill"
elif [ "$appimage" = "yes" ]; then
builddir="${HOME}/b/$(basename "$srcdir")-appimage"
else
builddir="${HOME}/b/$(basename "$srcdir")-playground"
fi
fi
# Check whether we are running in the docker container.
if [ -d /src/src -a -d /src/patches -a -d /build ]; then
indocker="yes"
srcdir=/src
builddir=/build
echo >&2 "$PGM: running in docker"
fi
echo >&2 "$PGM: source directory: $srcdir"
echo >&2 "$PGM: build directory: $builddir"
# First build a tarball and then build from that tarball
build_from_tarball() {
local milldir
local tarballname
local extraopt
if [ "$indocker" = yes ]; then
echo >&2 "$PGM: error: option --release may not be used from docker"
exit 2
fi
[ -d "${builddir}" ] || mkdir -p "${builddir}"
milldir=$(cd "${builddir}"; pwd)
# Use a common log file in the top directory.
logfile="${milldir}/build-log.txt"
( echo "$PGM: *"
echo "$PGM: * Building release in $milldir"
echo "$PGM: *" ) | tee -a ${logfile} >&2
rm -rf "$milldir/tarball" || true
rm -rf "$milldir/source" || true
rm -rf "$milldir/binary" || true
mkdir "$milldir/tarball"
mkdir "$milldir/source"
mkdir "$milldir/binary"
extraopt="--logfile=$logfile"
[ -n "$verbose" ] && extraopt="$extraopt --verbose"
[ "$download" = yes ] && extraopt="$extraopt --download"
$myself --builddir="$milldir/tarball" --dist $extraopt
if [ $? != 0 ]; then
( echo "$PGM: *"
echo "$PGM: * ERROR: creating tarball failed"
echo "$PGM: *" ) | tee -a ${logfile} >&2
exit 2
fi
tarballname=$(ls "$milldir/tarball/artifacts/"gpg4win*xz)
cd "$milldir/source"
tar --strip-components=1 -xJf "$tarballname"
if [ $? != 0 ]; then
( echo "$PGM: *"
echo "$PGM: * ERROR: failed to extract tarball"
echo "$PGM: *" ) | tee -a ${logfile} >&2
exit 2
fi
extraopt="--logfile=$logfile"
[ -n "$verbose" ] && extraopt="$extraopt --verbose"
[ $withmsi = yes ] && extraopt="$extraopt --msi"
[ $nosign = yes ] && extraopt="$extraopt --no-sign"
$myself --builddir="$milldir/binary" $extraopt
if [ $? != 0 ]; then
( echo "$PGM: *"
echo "$PGM: * ERROR: building release failed"
echo "$PGM: *" ) | tee -a ${logfile} >&2
exit 2
fi
( cd "$milldir/binary/artifacts"
ln -s "$tarballname" . )
( echo "$PGM: *"
echo "$PGM: * READY"
echo "$PGM: *" ) | tee -a ${logfile} >&2
exit 0
}
# The main GUI packages. Check the gen-tarball script to see which
# branches are used.
FRONTEND_PKGS="
libkleo
kleopatra
gpgol
gpgoljs
gpgpass
gpg4win-tools
mimetreeparser"
# Function to download the packages. Optionally generate new tarballs
# for the main GUI components.
download_packages() {
if [ "$indocker" = yes ]; then
echo >&2 "$PGM: error: downloading files from docker is not possible"
exit 2
fi
cd packages
if [ "$fromgit" = yes ]; then
# FIXME: We should check at least the commits from the gpg4win
# repo before doing this. But well, this very scripts is a
# catch22 so that we need to have an external installed test
# script before running this script from an updated repo. Or
# well, we could use us to check our next version.
echo >&2 "$PGM: Creating new tarballs and updating packages file ... "
myargs=
[ -n "$ftpuser" ] && myargs="$myargs --user=$ftpuser"
./gen-tarball.sh $myargs -u $FRONTEND_PKGS
echo >&2 "$PGM: Generating tarballs done"
fi
echo "$PGM: Downloading packages"
./download.sh $quiet --$gnupgtag --update
echo >&2 "$PGM: downloading done"
cd ..
}
# Run a command using the FIFOs. This needs to be called via a FIFO
# from the docker. Note that we don't explicit serialize access to the
# FIFO, hopefully no parallel make rules are run.
if [ "$runcmd" = yes ]; then
if [ "$indocker" != yes ]; then
echo >&2 "$PGM: Option --runcmd must be called from docker"
echo >&2 "$PGM: Available commands are:"
echo >&2 "$PGM: ping - Wait for a pong"
echo >&2 "$PGM: gpg - Run a gpg command"
echo >&2 "$PGM: msibase - Prepare MSI linking"
echo >&2 "$PGM: litcandle - Run candle.exe"
exit 2
fi
# Running in docker
if [ -z "$1" ]; then
echo >&2 "usage: /src/build.sh --runcmd COMMAND ARGS"
exit 2
fi
[ -f /build/S.build.sh-rc ] && rm /build/S.build.sh-rc
echo "$@" >/build/S.build.sh-in
cat /build/S.build.sh-out
while [ ! -f /build/S.build.sh-rc ]; do sleep 0.05; done
rc=$(sed -ne 's/EXITSTATUS=\([0-9]*\).*$/\1/p' \
</build/S.build.sh-rc 2>/dev/null || true)
[ -z "$rc" ] && rc=0
exit $rc
fi
# Check whether we are in the docker image and run appropriate commands.
# Note that this script is used to start the docker container and also
# within the docker container to run the desired commands.
if [ "$indocker" = yes ]; then
# NB: In docker the builddir is always /build and the source /src
cd /build
if [ ! -f config.status ]; then
force=yes
elif [ /src/configure -nt config.status ]; then
force=yes
fi
if [ $force = no ]; then
echo >&2 "$PGM: Not running configure (--force not used)"
elif [ "$w64" = "yes" ]; then
/src/autogen.sh --build-w64
else
/src/autogen.sh --build-w32
fi
export CMAKE_COLOR_DIAGNOSTICS=OFF
if [ $dist = yes ]; then
make dist XZ_OPT=-2 TOPSRCDIR=/src PLAYGROUND=/build
else
make TOPSRCDIR=/src PLAYGROUND=/build VERBOSE=1
if [ $? = 0 -a $withmsi = yes ]; then
make TOPSRCDIR=/src PLAYGROUND=/build msi
fi
fi
exit $?
fi # (end of script use inside the docker container) #
# Setup for using the Wix tools under Wine if requested.
if [ $withmsi = yes ]; then
if [ -z "$(which $WINE)" ]; then
echo >&2 "$PGM: error: For MSI packaging Wine needs to be installed"
exit 1
fi
[ -z "$WINEPREFIX" ] && WINEPREFIX="$HOME/.wine"
if [ ! -e "$WINEPREFIX/dosdevices" ]; then
echo >&2 "PGM: error: No value for WINEPREFIX found"
exit 1
fi
if [ -z "$WIXPREFIX" ]; then
tmp="$(readlink -f ~/w32root/wixtools)"
if [ -d "$tmp" ]; then
WIXPREFIX="$tmp"
echo >&2 "$PGM: Using $WIXPREFIX as WIXPREFIX"
else
echo >&2 "$PGM: error: You must set WIXPREFIX" \
" to an installation of wixtools"
exit 1
fi
fi
WINEINST="$WINEPREFIX/dosdevices/k:"
WINESRC="$WINEPREFIX/dosdevices/i:"
WINEINSTEX="$WINEPREFIX/dosdevices/j:"
WINEBLD="$WINEPREFIX/dosdevices/l:"
die=no
for f in "$WINEINST" "$WINESRC" "$WINEINSTEX" "$WINEBLD" ; do
if [ -e "$f" -a ! -h "$f" ]; then
echo >&2 "$PGM: error: '$f' already exists. Please remove."
die=yes
fi
done
[ $die = yes ] && exit 1
fi
# Determine the needed docker image
if [ "$appimage" = "yes" ]; then
cmd=/src/src/appimage/build-appimage.sh
- docker_image=g10-build-appimage:sles15
+ docker_image=g10-build-appimage:almalinux810
dockerfile=${srcdir}/docker/appimage
else
# We will run our self again in the docker image.
if [ "$w64" = "yes" ]; then
cmd="/src/build.sh --w64"
else
cmd="/src/build.sh --w32"
fi
[ $dist = yes ] && cmd="$cmd --dist"
[ $force = yes ] && cmd="$cmd --force"
[ $withmsi = yes -a $shell = no ] && cmd="$cmd --msi"
docker_image=g10-build-gpg4win:trixie
dockerfile=${srcdir}/docker/gpg4win-trixie
fi
# Update the docker image if requested or if it does not exist.
drep=$(echo $docker_image | cut -d : -f 1)
dtag=$(echo $docker_image | cut -d : -f 2)
if [ -z "$(docker images | grep $drep | grep $dtag)" \
-o "$update_image" = "yes" ]; then
echo >&2 "$PGM: Local image $docker_image not found"
echo >&2 "$PGM: Building docker image"
docker build -t $docker_image $dockerfile 2>&1
fi
# Make sure we have a BUILDTYPE file
if [ ! -e packages/BUILDTYPE ]; then
echo >&2 "PGM: packages/BUILDTYPE not found - see README"
exit 1
fi
# If --shell was used override the command for docker.
# if not used try to download first.
if [ "$shell" = "yes" ]; then
cmd="bash"
elif [ "$release" = yes ]; then
build_from_tarball
elif [ "$download" = yes ]; then
download_packages
else
echo >&2 "$PGM: package download skipped"
fi
start_time=$(date +"%s")
[ -z "$logfile" ] && logfile="${builddir}/build-log.txt"
# Kill the given process and all its descendants
killtree() {
local parent=$1 child
for child in $(ps -o ppid= -o pid= | awk "\$1==$parent {print \$2}"); do
killtree $child
done
kill $parent
}
# Remove FIFO files.
remove_fifos() {
[ -e "${builddir}/S.build.sh-in" ] && rm "${builddir}/S.build.sh-in"
[ -e "${builddir}/S.build.sh-out" ] && rm "${builddir}/S.build.sh-out"
return 0
}
# Create FIFO files.
create_fifos() {
remove_fifos
mkfifo -m 600 "${builddir}/S.build.sh-in"
mkfifo -m 600 "${builddir}/S.build.sh-out"
return 0
}
# Make sure we have an absolute build directory and the fifos
# so that docker does not create it with root as owner.
[ -d "${builddir}" ] || mkdir -p "${builddir}"
builddir=$(cd "${builddir}"; pwd)
[ -d "${builddir}/po" ] || mkdir -p "${builddir}/po"
create_fifos
# Function to stop our command runner
runnerpid=
stop_runner() {
printf >&2 -- "$PGM: stop-runner called\n"
if [ -n "$runnerpid" ]; then
echo >&2 "$PGM: stopping runner ..."
killtree $runnerpid
runnerpid=
remove_fifos
fi
return 0
}
# Transform a directory from docker to host directory
transform_dir() {
echo "$1"|sed -e "s,^/build/,$builddir/," -e "s,/src/,$srcdir/,"
}
# Transform all directories in the provided string
# Fixme: This sed expression is not robust enough.
transform_multi_dir() {
echo "$1"|sed -e "s, /build/, $builddir/,g" -e "s, /src/, $srcdir,g"
}
# Run a gpg command
runner_cmd_gpg() {
local cmd="$1"
cmd=$(transform_multi_dir "$cmd")
printf >&2 -- "$PGM(runner): invoking gpg\n"
set +e
$cmd </dev/null
rc=$?
set -e
printf >&2 -- "$PGM(runner): gpg returned $rc\n"
return 0
}
# Run the gpg-authcode-sign command
runner_cmd_gpg_authcode_sign() {
local cmd="$1"
[ $nosign = yes ] && cmd="--dry-run $cmd"
printf >&2 -- "$PGM(runner): gpg-authcode-sign.sh --stamp $cmd\n"
set +e
[ -n "$verbose" ] && set -x
( cd "$builddir"/install && gpg-authcode-sign.sh --stamp $cmd </dev/null )
rc=$?
[ -n "$verbose" ] && set +x
set -e
printf >&2 -- "$PGM(runner): gpg-authcode-sign.sh returned $rc\n"
return 0
}
# Copy some files to the Windows host to prepare the MSI linking
# Args are: See below
runner_cmd_msibase() {
local version="$1" gnupgmsi="$2"
set +e
[ -n "$verbose" ] && set -x
ssh "$WINHOST" "mkdir AppData\\Local\\Temp\\gpg4win-$version" || true
scp "$srcdir"/packages/gnupg-msi-${gnupgmsi}-bin.wixlib \
"$WINHOST":AppData/Local/Temp/gpg4win-"$version";
scp "$srcdir"/src/icons/shield.ico \
"$WINHOST":AppData/Local/Temp/gpg4win-"$version"
scp "$srcdir"/doc/logo/gpg4win-msi-header_install-493x58.bmp \
"$WINHOST":AppData/Local/Temp/gpg4win-"$version"/header.bmp
scp "$srcdir"/doc/logo/gpg4win-msi-wizard_install-493x312.bmp \
"$WINHOST":AppData/Local/Temp/gpg4win-"$version"/dialog.bmp
scp "$srcdir"/doc/logo/gpg4win-msi-wizard_install-493x312.bmp \
"$WINHOST":AppData/Local/Temp/gpg4win-"$version"/dialog.bmp
scp "$srcdir"/doc/logo/gpg4win-msi-wizard_install-info-32x32.bmp \
"$WINHOST":AppData/Local/Temp/gpg4win-"$version"/info.bmp
scp "$srcdir"/doc/logo/gpg4win-msi-wizard_install-exclamation-32x32.bmp \
"$WINHOST":AppData/Local/Temp/gpg4win-"$version"/exclamation.bmp
scp "$srcdir"/po/gpg4win-en.wxl \
"$WINHOST":AppData/Local/Temp/gpg4win-"$version"
scp "$srcdir"/po/gpg4win-de.wxl \
"$WINHOST":AppData/Local/Temp/gpg4win-"$version"
scp WixUI_Gpg4win.wxs \
"$WINHOST":AppData/Local/Temp/gpg4win-"$version"
rc=0
[ -n "$verbose" ] && set +x
set -e
return 0
}
# Copy files to the Windows host
runner_cmd_cptowinhost() {
local version="$1"
local target="$WINHOST":AppData/Local/Temp/gpg4win-"$version"
local files
shift
files=
for f in $@; do
files="$files $(transform_dir "$f")"
done
set +e
echo >&2 "$PGM: running scp $files $target"
scp $files "$target"
rc=$?
set -e
return 0
}
# Copy file from the Windows host
runner_cmd_cpfromwinhost() {
local version="$1" prefix="$2" name="$3" vsdvers="$4"
local mydir="$WINHOST":AppData/Local/Temp/gpg4win-"$version"
set +e
scp "$mydir/$prefix-$version-$name.msi" \
"$builddir/src/installers/$prefix-$vsdvers-$name.msi"
rc=$?
set -e
return 0
}
# Copy files to the Windows host
runner_cmd_lightwinhost() {
local version="$1" prefix="$2" name="$3" intlopt="$4" msivers="$5"
[ -n "$verbose" ] && set -x
set +e
ssh "$WINHOST" "cd AppData/Local/Temp/gpg4win-$version \
&& $WINLIGHT \
-cc . -reusecab -spdb \
-ext WixUIExtension \
-ext WixUtilExtension \
-out $prefix-$version-$name.msi \
$(echo "$intlopt" | sed 's,%20, ,g') \
-dcl:high -pedantic \
$prefix-$version.wixlib gnupg-msi-$msivers-bin.wixlib $name-$version.wixlib" \
| grep -v "ICE80" | grep -v "ICE57"
rc="${PIPESTATUS[0]}"
set -e
[ -n "$verbose" ] && set +x
# FIXME:
echo >&2 "$PGM(runner): cmd lightwinhost exited with $rc - forcing 0"
rc=0
return 0
}
# Run the Wix tools under Wine.
runner_cmd_litcandle() {
local mode="$1" version="$2" prefix="$3" idir="$4" exidir="$5"
local dwixobj fwxs
if [ $withmsi = no ]; then
echo >&2 "$PGM(runner): litcandle requires --with-msi option"
rc=2
return 0
fi
idir=$(transform_dir "$idir")
exidir=$(transform_dir "$exidir")
fwixlib="$prefix"-"$version".wixlib
fwixobj="$prefix"-"$version".wixobj
if [ "$mode" = ui ]; then
fwxs="l:\\src\\gnupg-vsd\\$prefix\\$prefix".wxs
fextraobj="k:\\gpg4win-ui.wixobj"
else
fwxs="l:\\src\\$prefix"-"$version".wxs
fextraobj=
fi
# Create symlinks into the Wine dosdevices directory
if [ -n "$verbose" ]; then
echo >&2 "$PGM(runner): idir : $WINEINST"
echo >&2 "$PGM(runner): exidir : $WINEINSTEX"
echo >&2 "$PGM(runner): srcdir : $WINESRC"
echo >&2 "$PGM(runner): builddir: $WINEBLD"
fi
ln -sf "$idir" "$WINEINST"
ln -sf "$exidir" "$WINEINSTEX"
ln -sf "$srcdir" "$WINESRC"
ln -sf "$builddir" "$WINEBLD"
# Run the tools
rc=0
[ -n "$verbose" ] && set -x
set +e
if [ $rc -eq 0 ]; then
$WINE "$WIXPREFIX/candle.exe" \
-dInstDir=k: \
-dInstDirEx=j: \
-dSrcDir=i:\\ \
-dBldDir=l:\\ \
-dVersion="$version" \
-dWin64="yes" \
-out k:\\"$fwixobj" \
-pedantic -wx "$fwxs" \
-arch x64
rc=$?
fi
if [ $rc -eq 0 -a -n "$fextraobj" ]; then
$WINE "$WIXPREFIX/candle.exe" \
-dInstDir=k: \
-dInstDirEx=j: \
-dSrcDir=i:\\ \
-dBldDir=l:\\ \
-dVersion="$version" \
-dWin64="yes" \
-out "$fextraobj" \
-arch x64 \
-pedantic -wx i:\\src\\WixUI_Gpg4win.wxs
rc=$?
fi
if [ $rc -eq 0 ]; then
$WINE "$WIXPREFIX/lit.exe" \
-out k:\\"$fwixlib" \
-bf \
-wx \
-pedantic \
k:\\"$fwixobj" "$fextraobj"
rc=$?
fi
set -e
[ -n "$verbose" ] && set +x
# Remove the symlinks
rm "$WINEINST" "$WINESRC" "$WINEINSTEX" "$WINEBLD" || true
return 0
}
# Run a command received from the fifo. Args are command and the line
# with args for the command.
runner_exec_cmd() {
local cmd="$1" line="$2" rc
printf >&2 -- "$PGM: cmd='%s' line='%s'\n" "$cmd" "$line"
# The called functions need to set RC to the desired exit status
rc=42
case "$cmd" in
ping) echo pong; rc=0 ;;
gpg) runner_cmd_gpg "gpg $line" ;;
gpg-authcode-sign) runner_cmd_gpg_authcode_sign "$line" ;;
msibase) runner_cmd_msibase $line ;;
cptowinhost) runner_cmd_cptowinhost $line ;;
cpfromwinhost) runner_cmd_cpfromwinhost $line ;;
lightwinhost) runner_cmd_lightwinhost $line ;;
litcandle) runner_cmd_litcandle $line ;;
*) echo "$PGM(runner): $cmd: no such command"; rc=4 ;;
esac
echo >&2 "$PGM: runner cmd '$cmd' returned $rc"
# Make sure that we have a final LF in the output and then write
# the error line
echo
echo "EXITSTATUS=$rc" > "${builddir}/S.build.sh-rc"
return 0
}
# Start our FIFO command runner.
runner_loop() {
echo >&2 "$PGM: command runner started pid=$$"
while : ; do
if read -r cmd line < "${builddir}/S.build.sh-in" ; then
if [ -z "$recooked" ]; then
stty cooked </dev/tty
recooked=yes
fi
echo >&2 "$PGM(runner): executing cmd"
runner_exec_cmd "$cmd" "$line" >"${builddir}/S.build.sh-out" &
echo >&2 "$PGM(runner): waiting for cmd"
wait
echo >&2 "$PGM(runner): cmd finished"
fi
done
echo >&2 "$PGM: command runner stopped"
exit 0
}
# Start our FIFO command runner
trap stop_runner EXIT SIGTERM SIGINT SIGHUP
runner_loop &
runnerpid=$!
echo >&2 "$PGM: command runner pid is $runnerpid"
# Run docker
docker_cmdline="run -it --rm --user $userid:$groupid"
docker_cmdline="$docker_cmdline -v "${srcdir}":/src:ro"
docker_cmdline="$docker_cmdline -v "${builddir}":/build:rw"
docker_cmdline="$docker_cmdline -v "$HOME/.gnupg-autogen.rc":/.gnupg-autogen.rc:ro"
docker_cmdline="$docker_cmdline $docker_image $cmd"
echo >&2 "$PGM: running: docker $docker_cmdline"
docker $docker_cmdline 2>&1 | tee -a ${logfile}
err="${PIPESTATUS[0]}"
echo >&2 "$PGM: docker finished. rc=$err"
end_time=$(date +"%s")
duration=$((end_time - start_time))
hours=$((duration / 3600))
minutes=$((duration % 3600 / 60))
seconds=$((duration % 60))
buildtime=$(printf "%02d:%02d:%02d\n" "$hours" "$minutes" "$seconds")
if [ "$err" = "1" -a "$appimage" = "yes" ]; then
echo >&2 "$PGM: Return code 1 on AppImage build. Treating as success."
err=0
fi
if [ "$err" = "0" ]; then
mkdir -p "${builddir}/artifacts"
if [ "$dist" = "yes" ]; then
results=$(find "${builddir}" -maxdepth 1 -name \*.tar.xz \
-a -type f -printf '%p ')
elif [ "$appimage" = "yes" ]; then
results=$(find "${builddir}" -maxdepth 1 -iname \*.appimage \
-a -type f -printf '%p ')
else
results=$(find "${builddir}/src/installers" -type f -printf '%p ')
fi
echo >&2 ""
echo >&2 "$PGM: ############### Success 🥳 ####################"
for result in $results; do
ln -sf -t "${builddir}/artifacts/" "$result"
echo >&2 "$PGM: Created: ${builddir}/artifacts/$(basename $result)"
done
else
echo >&2 "$PGM: ############### Failure 😪 ####################"
fi
echo >&2 "$PGM: Logfile: ${logfile}"
echo >&2 "$PGM: Build command: ${commandline}"
echo >&2 "$PGM: Build time: $buildtime"
echo >&2 "$PGM: ##############################################"
diff --git a/configure.ac b/configure.ac
index 6e275c6a..149d72cc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,677 +1,675 @@
# configure.ac for GPG4Win
# Copyright (C) 2005, 2006, 2007, 2008, 2010, 2023 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 <http://www.gnu.org/licenses/>.
# (Process this file with autoconf to produce a configure script.)
AC_PREREQ(2.59)
min_automake_version="1.9.3"
# To build a release you need to create a tag with the version number
# (git tag -s gpg4win-2.x.y) and run "./autogen.sh --force". Please
# bump the version number immediately after the release and do another
# commit and push so that the git magic is able to work.
# BUILDTYPE can be used to build the VSD or GPD versions. Note that
# IS_VSD_BUILD is set along with IS_GPD_BUILD.
m4_define([mym4_package],[gpg4win])
m4_define([mym4_isvsd],[no])
m4_define([mym4_isgpd],[no])
m4_define([mym4_isv3build], m4_if(m4_esyscmd([ls packages/gnupg-2.*.tar.* | \
head -1 | cut -d. -f2 | \
tr -d '\n']),
[2], [yes], [no]))
m4_define([mym4_buildtype],
m4_chomp_all(m4_esyscmd([(cat packages/BUILDTYPE 2>/dev/null\
|| echo default)])))
m4_if(mym4_buildtype,[vsd],[m4_define([mym4_isvsd],[yes])
m4_define([mym4_isv3build],[yes]]))
# For VSD with GnuPG 2.6 we will use version 4.x
# For GPD and Gpg4win with GnuPG 2.6 we use version 5.x
m4_if(mym4_buildtype,vsd,
[m4_define([mym4_major],[4])
m4_define([mym4_minor],[0])
m4_define([mym4_micro],[0])],
[m4_define([mym4_major],[5])
m4_define([mym4_minor],[0])
m4_define([mym4_micro],[1])])
# We need to set isgpd only after having set the version number.
m4_if(mym4_buildtype,[gpd],[m4_define([mym4_isvsd],[yes])
m4_define([mym4_isgpd],[yes])])
# Below is m4 magic to extract and compute the git revision number,
# the decimalized short revision number, a beta version string and a
# flag indicating a development version (mym4_isbeta). Note that the
# m4 processing is done by autoconf and not during the configure run.
m4_define([mym4_tsdir], m4_chomp_all(m4_esyscmd([./autogen.sh --print-tsdir])))
m4_define([mym4_verslist], m4_split(m4_esyscmd([./autogen.sh --find-version] \
mym4_package mym4_major mym4_minor mym4_micro),[:]))
m4_define([mym4_isbeta], m4_argn(2, mym4_verslist))
m4_define([mym4_ingit], m4_argn(3, mym4_verslist))
m4_define([mym4_version], m4_argn(4, mym4_verslist))
m4_define([mym4_betastr], m4_argn(6, mym4_verslist))
m4_define([mym4_revision], m4_argn(7, mym4_verslist))
m4_define([mym4_revision_dec], m4_argn(8, mym4_verslist))
m4_define([mym4_commitid], m4_argn(9, mym4_verslist))
m4_esyscmd([echo ]mym4_version[>VERSION])
m4_esyscmd([echo ]mym4_commitid[>>VERSION])
AC_INIT([mym4_package],[mym4_version],[https://bugs.gnupg.org])
PACKAGE=$PACKAGE_NAME
VERSION=$PACKAGE_VERSION
BUILD_COMMITID="mym4_commitid"
GIT_REVISION=mym4_revision
GIT_REVISION_DEC=mym4_revision_dec
GIT_BETASTRING=mym4_betastr
IS_BETA_BUILD=mym4_isbeta
IS_VSD_BUILD=mym4_isvsd
IS_GPD_BUILD=mym4_isgpd
# Variables for the version info
PRODUCT_NAME=m4_if(mym4_isgpd, [yes], ["GnuPG Desktop"],
m4_if(mym4_isvsd, [yes], ["GnuPG VS-Desktop"], ["Gpg4win"]))
COMPANY_NAME=m4_if(mym4_buildtype, [default],
["Gpg4win Community"], ["g10 Code GmbH"])
# Early sanity checks and dirs
AC_CONFIG_SRCDIR(src/nsis/config.nsi.in)
AC_CONFIG_MACRO_DIR(m4)
AC_CONFIG_AUX_DIR([build-aux])
AM_INIT_AUTOMAKE([tar-ustar])
AM_MAINTAINER_MODE
AC_CANONICAL_HOST
AC_CONFIG_HEADERS([config.h])
AC_SUBST(PRODUCT_NAME)
AC_SUBST(COMPANY_NAME)
AC_SUBST(PACKAGE)
AC_SUBST(VERSION)
AC_SUBST(GIT_BETASTRING)
AC_SUBST(IS_BETA_BUILD)
AC_SUBST(IS_VSD_BUILD)
AC_SUBST(IS_GPD_BUILD)
AC_SUBST(BUILD_COMMITID)
# Generate extended version information. Note, that for NSIS use we
# must not translate the dots to commas in the BUILD_FILEVERSION.
BUILD_TIMESTAMP=`date --iso-8601=minutes`
BUILD_ISODATE=`date --iso-8601`
BUILD_DATETIME=`date +%Y%m%d%H%M`
changequote(,)dnl
BUILD_FILEVERSION=`echo "$VERSION" | sed 's/\([0-9.]*\).*/\1./'`
changequote([,])dnl
BUILD_FILEVERSION="${BUILD_FILEVERSION}${GIT_REVISION_DEC}"
BUILD_FILEVERSION_TR=`echo "${BUILD_FILEVERSION}" | tr . ,`
changequote(,)dnl
BUILD_BETANUM=`let a=$(($(echo "${GIT_BETASTRING}"|sed 's/[^0-9]*//')+0));echo $a`
changequote([,])dnl
AC_SUBST(BUILD_BETANUM)
AC_SUBST(BUILD_TIMESTAMP)
AC_SUBST(BUILD_ISODATE)
AC_SUBST(BUILD_FILEVERSION)
AC_SUBST(BUILD_FILEVERSION_TR)
# The final release is copied to an archive server. The default
# location may be changed by setting the RELEASEHOST envvar.
if test -z "$RELEASEHOST" ; then
RELEASEHOST="vigenere:tarballs/gpg4win"
if test "${IS_BETA_BUILD}" = yes ; then
RELEASEHOST="${RELEASEHOST}/Beta"
fi
fi
AC_SUBST(RELEASEHOST)
# Substitutions to set generated files in a Emacs buffer to read-only.
AC_SUBST(emacs_local_vars_begin, ['Local Variables:'])
AC_SUBST(emacs_local_vars_read_only, ['buffer-read-only: t'])
AC_SUBST(emacs_local_vars_end, ['End:'])
GPG4WIN_BUILD_RELEASE(gpg4win, no)
GPG4WIN_BUILD_RELEASE(appimage, no)
# Additionaly enable building gpgex for another host
AC_ARG_WITH([additional-gpgex-host],
AS_HELP_STRING([--with-additional-gpgex-host=HOST],
[Additionaly build gpgex for this host]),
[if test "$withval" = yes; then
AC_MSG_FAILURE(
[--with-additional-gpgex-host was given,
but no host specified])
else
gpgex_host=$withval
fi
],
gpgex_host=no)
if test "$gpgex_host" != no; then
GPGEX_ADD_HOST="$gpgex_host"
fi
AC_SUBST(GPGEX_ADD_HOST)
AC_ARG_ENABLE(fast-makensis,
AS_HELP_STRING([--enable-fast-makensis],
[Use a less efficient compressor to speed up building]),
use_fast_makensis=$enableval,
use_fast_makensis=no)
if test "$use_fast_makensis" = yes; then
EXTRA_MAKENSIS_FLAGS="${EXTRA_MAKENSIS_FLAGS} -DDISABLE_LZMA=1"
fi
AC_SUBST(EXTRA_MAKENSIS_FLAGS)
# Use ninja instead of make for cmake projects
AC_ARG_ENABLE(ninja,
AS_HELP_STRING([--enable-ninja],
[Use ninja instead of make]),
use_ninja=$enableval,
use_ninja=no)
#
# Set variables for use by automake makefiles.
#
if test -f /src/packages/BUILDTYPE ; then
dockerbuild=yes
else
dockerbuild=no
fi
AM_CONDITIONAL(DOCKERBUILD, test "$dockerbuild" = "yes")
AM_CONDITIONAL(BUILD_GPG4WIN, test "$build_gpg4win" = "yes")
AM_CONDITIONAL(BUILD_APPIMAGE, test "$build_appimage" = "yes")
AM_CONDITIONAL(BUILD_W64_COND, test "$BUILD_W64" = "yes")
# Required tools.
AC_PROG_CC
AC_PROG_CPP
AC_PROG_RANLIB
AC_PROG_AWK
AC_CHECK_TOOL(AR, ar, :)
AC_CHECK_TOOLS(STRIP, strip)
AC_CHECK_TOOLS(DLLTOOL, dlltool)
AC_CHECK_PROGS(MAKE, make)
AC_CHECK_PROGS(UNZIP, unzip)
AC_CHECK_PROGS(TAR, tar)
AC_CHECK_PROGS(MKDIR, mkdir)
AC_CHECK_PROGS(CP, cp)
AC_CHECK_PROGS(RM, rm)
AC_CHECK_PROGS(STOW, stow)
AC_CHECK_PROGS(MAKENSIS, makensis)
AC_CHECK_PROGS(ZCAT, zcat)
AC_CHECK_PROGS(TEXI2DVI, texi2dvi)
AC_CHECK_PROGS(DVIPDF, dvipdf)
AC_CHECK_PROGS(CONVERT, convert)
AC_CHECK_PROGS(SHA1SUM, sha1sum)
AC_CHECK_PROGS(MSGFMT, msgfmt)
AC_CHECK_PROGS(MSGFMT, msgmerge)
AC_CHECK_PROGS(GITLOG_TO_CHANGELOG, gitlog-to-changelog,
[build-aux/gitlog-to-changelog])
AC_CHECK_PROGS(BUILD_CC, gcc cc)
AC_CHECK_PROGS(CMAKE, cmake3 cmake)
AC_CHECK_PROGS(RSYNC, rsync)
if test "${use_ninja}" = "yes"; then
AC_CHECK_PROGS(NINJA, ninja)
MAKETOOL=${NINJA}
CMAKE_GENERATOR_FLAGS="-G Ninja -DCMAKE_GENERATOR=Ninja"
AC_MSG_NOTICE([Using ${NINJA} in cmake projects])
else
MAKETOOL=${MAKE}
fi
AC_SUBST(CMAKE_GENERATOR_FLAGS)
AC_SUBST(MAKETOOL)
AC_PROG_INSTALL
if test -n "$GPGEX_ADD_HOST"; then
AC_CHECK_TOOLS(STRIP_EX, ${GPGEX_ADD_HOST}-strip)
fi
if test -z "$GPG4WIN_PARALLEL"; then
JOBS=$(nproc 2>/dev/null || echo 1)
GPG4WIN_PARALLEL=-j$JOBS
AC_MSG_NOTICE([Using autodetected $JOBS make jobs. You can override this by setting GPG4WIN_PARALLEL.])
fi
AC_SUBST(GPG4WIN_PARALLEL)
required_tools="MAKE TAR MKDIR CP RM ZCAT SHA1SUM MSGFMT BUILD_CC CMAKE"
if test "$build_gpg4win" = yes ; then
required_tools="$required_tools DLLTOOL UNZIP STOW MAKENSIS TEXI2DVI DVIPDF CONVERT"
fi
if test "$build_appimage" = yes ; then
required_tools="$required_tools RSYNC"
fi
missing_tools=
for i in $required_tools; do
eval tmp='$'$i
if test -z "$tmp"; then
missing_tools="$missing_tools `echo $i | tr 'A-Z' 'a-z'`"
fi
done
if test "$build_gpg4win" = yes ; then
case "${host}" in
x86_64*-mingw32*)
BUILD_W64=yes
# Since we use 32 makensis we need to compile our plugin
# for NSIS also for 32bit so we hardcode this here.
# Otherwise for 64 bit builds --with-additional-gpgex-host
# is then 32 bit to take care of that.
AC_CHECK_PROGS(W32CC32, i686-w64-mingw32-gcc)
GPG4WIN_RUNTIME_LIBRARY(libgcc_s_seh-1)
;;
*)
W32CC32=${CC}
BUILD_W64=no
;;
esac
AC_SUBST(BUILD_W64)
GPG4WIN_RUNTIME_LIBRARY(libstdc++-6, REQUIRED)
GPG4WIN_RUNTIME_LIBRARY(libwinpthread-1, REQUIRED)
GPG4WIN_RUNTIME_LIBRARY_EX(libwinpthread-1)
# One of these is required
GPG4WIN_RUNTIME_LIBRARY(libgcc_s_dw2-1)
GPG4WIN_RUNTIME_LIBRARY(libgcc_s_sjlj-1)
if test "${gpg4win_rtlib_libgcc_s_dw2_1}" = no \
-a "${gpg4win_rtlib_libgcc_s_sjlj_1}" = no \
-a "${gpg4win_rtlib_libgcc_s_seh_1}" = no ; then
AC_MSG_ERROR(No exception library found. Please check what your system
uses and see above message about either dw2- sjlj- or seh-
dlls.)
fi
fi
AC_CHECK_PROGS(WGET, wget)
#
# Set source and build directory.
#
# They are always set to the directories seen outside of the
# container.
#
TOPSRCDIR="mym4_tsdir"
AC_ARG_WITH([playground],
AS_HELP_STRING([--with-playground=DIR],
[Use DIR as the build directory]),
[PLAYGROUND="$withval"], [PLAYGROUND=""])
if test -n "$PLAYGROUND" ; then
if test ! -d "$PLAYGROUND"; then
AC_MSG_ERROR([[
***
*** Given playground directory does not exist.
*** Please create it first or use the default.
***]])
fi
PLAYGROUND="$(cd "$PLAYGROUND" && pwd)"
else
PLAYGROUND="${HOME}/b/$(basename "$TOPSRCDIR")-playground"
fi
PLAYGROUND=$(echo "$PLAYGROUND" | sed s,^//,/,)
AC_SUBST(TOPSRCDIR)
AC_SUBST(PLAYGROUND)
#
# Prepare variables for po/Makefile.am
# Note that we do not use the ususal GNU gettext make system.
#
# LINGUAS := The list of all translated languages taken from po/LINGUAS
# POTFILES := The list of NSI files with translatable strings taken from
# po/POTFILES
# POFILES := The actual available translations (w/o directory)
# NSIFILES := The to-be generated translation files in the NSI format.
# (w/o directory)
#
if test $dockerbuild = yes ; then
posrcdir=/src/po
else
posrcdir="$TOPSRCDIR/po"
fi
LINGUAS=$(sed -e "/^#/d" -e "s/#.*//" "$posrcdir/LINGUAS" | xargs -- )
POTFILES=$(for f in $(sed -e "/^#/d" -e "s/#.*//" "$posrcdir/POTFILES");\
do echo "$posrcdir/$f"; done | xargs -- )
AC_SUBST(LINGUAS)
AC_SUBST(POTFILES)
POFILES=
NSIFILES=
for lang in $LINGUAS; do
if test -f "$posrcdir/$lang.po" ; then
POFILES="$POFILES $lang.po"
NSIFILES="$NSIFILES $lang.nsi"
fi
done
AC_SUBST(POFILES)
AC_SUBST(NSIFILES)
#
# Packages for Gpg4Win.
#
if test "$build_gpg4win" = yes ; then
gpg4win_dup_sources=""
GPG4WIN_SPKG([zlib])
GPG4WIN_BPKG_GTK([pkgconfig])
GPG4WIN_SPKG([bzip2])
GPG4WIN_SPKG([libgpg-error], [libiconv gettext])
GPG4WIN_SPKG([libassuan], [libgpg-error])
GPG4WIN_SPKG([scute], [libgpg-error libassuan])
GPG4WIN_SPKG([pinentry], [qtbase libassuan libiconv])
GPG4WIN_SPKG([gpgme], [libgpg-error libassuan])
GPG4WIN_KDEPKG([gpgmepp], [gpgme])
GPG4WIN_KDEPKG([qgpgme], [gpgmepp qtbase])
GPG4WIN_SPKG([gpgol], [gpgmepp libassuan])
GPG4WIN_SPKG([gpgex], [libassuan])
GPG4WIN_SPKG([paperkey])
GPG4WIN_SPKG([libiconv])
GPG4WIN_SPKG([gettext], [libiconv])
GPG4WIN_SPKG([libpng], [zlib])
GPG4WIN_SPKG([jpeg])
GPG4WIN_KDEPKG([libqrencode], [libpng libiconv])
# Packages needed for gpgex
GPG4WIN_SPKGEX([libgpg-error])
GPG4WIN_SPKGEX([libassuan], [libgpg-error])
GPG4WIN_SPKGEX([gpgex], [libassuan])
GPG4WIN_SPKGEX([gpgme], [libgpg-error libassuan])
GPG4WIN_CMKPKGEX([gpgmepp], [gpgme])
GPG4WIN_SPKGEX([gpgol], [gpgmepp])
# The GnuPG Package.
GPG4WIN_BPKG_BINSRC([gnupg-w32])
GPG4WIN_BPKG_MSISRC([gnupg-msi])
# Tools required for cross compiling
GPG4WIN_NATIVEPKG([qtbase])
GPG4WIN_NATIVEPKG([extra-cmake-modules])
GPG4WIN_NATIVEPKG([breeze-icons], [qtbase extra-cmake-modules])
GPG4WIN_NATIVEPKG([qttools], [qtbase])
GPG4WIN_NATIVEPKG([kconfig], [qtbase qttools extra-cmake-modules])
# Qt related stuff.
GPG4WIN_KDEPKG([zstd])
GPG4WIN_KDEPKG([qtbase], [jpeg zlib zstd libpng freetype pcre2])
GPG4WIN_KDEPKG([qttools], [qtbase])
GPG4WIN_KDEPKG([qttranslations], [qtsvg qttools native-qttools])
GPG4WIN_KDEPKG([qtsvg], [qtbase])
GPG4WIN_KDEPKG([qthttpserver], [qtbase])
GPG4WIN_KDEPKG([qtwebsockets], [qtbase])
GPG4WIN_KDEPKG([tiff])
GPG4WIN_KDEPKG([pcre2])
GPG4WIN_KDEPKG([breeze], [qtbase kcoreaddons kconfig kconfigwidgets kguiaddons kiconthemes kwindowsystem native-kconfig])
# GPG4WIN_KDEPKG([snoretoast])
GPG4WIN_KDEPKG([openjpeg], [tiff jpeg])
GPG4WIN_KDEPKG([breeze-icons], [extra-cmake-modules qtbase])
GPG4WIN_KDEPKG([kleopatra], [kstatusnotifieritem mimetreeparser kio gnupg-w32 breeze-icons kxmlgui libkleo kitemmodels qttranslations ktextwidgets native-kconfig])
GPG4WIN_KDEPKG([extra-cmake-modules])
GPG4WIN_KDEPKG([kconfig], [qtbase native-qttools extra-cmake-modules])
GPG4WIN_KDEPKG([ki18n], [qtbase gettext native-qttools extra-cmake-modules])
GPG4WIN_KDEPKG([kwidgetsaddons], [kconfig native-qttools qtbase])
GPG4WIN_KDEPKG([kcompletion], [kwidgetsaddons])
GPG4WIN_KDEPKG([kwindowsystem], [qtbase native-qttools extra-cmake-modules])
GPG4WIN_KDEPKG([kcoreaddons], [qtbase native-qttools extra-cmake-modules])
GPG4WIN_KDEPKG([kcodecs], [qtbase native-qttools extra-cmake-modules])
GPG4WIN_KDEPKG([kguiaddons], [qtbase native-qttools extra-cmake-modules])
GPG4WIN_KDEPKG([kmime], [kcodecs ki18n])
GPG4WIN_KDEPKG([kmbox], [kmime])
GPG4WIN_KDEPKG([kconfigwidgets], [kwidgetsaddons kguiaddons ki18n kcodecs kconfig kcolorscheme])
GPG4WIN_KDEPKG([kitemviews], [qtbase native-qttools extra-cmake-modules])
GPG4WIN_KDEPKG([kitemmodels], [qtbase native-qttools extra-cmake-modules])
GPG4WIN_KDEPKG([karchive], [qtbase native-qttools extra-cmake-modules])
GPG4WIN_KDEPKG([kcrash], [kwindowsystem kcoreaddons])
GPG4WIN_KDEPKG([solid], [native-qttools qtbase extra-cmake-modules])
GPG4WIN_KDEPKG([kjobwidgets], [kwidgetsaddons kcoreaddons qtbase extra-cmake-modules])
GPG4WIN_KDEPKG([kservice], [kconfig kcoreaddons ki18n])
GPG4WIN_KDEPKG([kbookmarks], [kconfig kxmlgui kcoreaddons kconfigwidgets kwidgetsaddons kcodecs])
GPG4WIN_KDEPKG([kio], [kcrash kjobwidgets solid kservice kbookmarks kwidgetsaddons kxmlgui kwindowsystem karchive kconfig kcoreaddons ki18n])
GPG4WIN_KDEPKG([kiconthemes], [qtsvg kconfigwidgets karchive])
GPG4WIN_KDEPKG([kxmlgui], [kiconthemes kconfigwidgets kitemviews ktextwidgets])
GPG4WIN_KDEPKG([libkleo], [kmime kconfigwidgets kwindowsystem kcompletion qgpgme])
GPG4WIN_KDEPKG([gpg4win-tools], [libkleo qgpgme])
GPG4WIN_KDEPKG([threadweaver], [qtbase extra-cmake-modules])
GPG4WIN_KDEPKG([kcolorscheme], [kconfig kguiaddons ki18n])
GPG4WIN_KDEPKG([freetype], [zlib bzip2])
GPG4WIN_KDEPKG([sonnet], [qtbase native-qttools])
GPG4WIN_KDEPKG([ktextwidgets], [sonnet kcompletion kconfig kconfigwidgets ki18n kwidgetsaddons])
GPG4WIN_KDEPKG([poppler], [libpng openjpeg tiff gpgmepp kio qtbase freetype])
GPG4WIN_KDEPKG([kparts], [kio kservice kxmlgui kconfigwidgets kwidgetsaddons ktextwidgets])
GPG4WIN_KDEPKG([okular], [kparts gpgmepp kio poppler threadweaver qtsvg native-kconfig])
GPG4WIN_KDEPKG([libical])
GPG4WIN_KDEPKG([kcalendarcore], [qtbase libical extra-cmake-modules])
GPG4WIN_KDEPKG([mimetreeparser], [libkleo kwidgetsaddons ki18n kmbox kmime kcodecs kcalendarcore])
GPG4WIN_KDEPKG([prison], [qtbase extra-cmake-modules libqrencode])
GPG4WIN_KDEPKG([kstatusnotifieritem], [kwindowsystem qtbase extra-cmake-modules])
GPG4WIN_KDEPKG([gpgpass], [kio prison kconfigwidgets kiconthemes ki18n qgpgme native-kconfig])
GPG4WIN_KDEPKG([kcontacts], [kcoreaddons qtbase ki18n kconfig kcodecs])
GPG4WIN_KDEPKG([gpgoljs],[qtwebsockets kcontacts qthttpserver mimetreeparser libkleo sonnet kcompletion ki18n kwidgetsaddons kio])
GPG4WIN_FINALIZE
fi
# Packages for the AppImage
if test "$build_appimage" = yes ; then
appimage_dup_sources=""
+ # poppler requires freetype >= 2.11
APPIMAGE_SPKG([freetype])
APPIMAGE_SPKG([sqlite])
- APPIMAGE_SPKG([jpeg])
APPIMAGE_KDEPKG([libqrencode])
APPIMAGE_SPKG([xcb-util-cursor])
APPIMAGE_SPKG([libgpg-error])
APPIMAGE_SPKG([libassuan], [libgpg-error])
APPIMAGE_SPKG([npth])
APPIMAGE_SPKG([libgcrypt], [libgpg-error])
APPIMAGE_SPKG([libksba], [libgpg-error])
APPIMAGE_SPKG([ntbtls], [libgcrypt libksba])
APPIMAGE_SPKG([gnupg], [libgpg-error libassuan npth libgcrypt libksba sqlite ntbtls])
APPIMAGE_SPKG([pinentry], [qtbase])
APPIMAGE_SPKG([gpgme], [libgpg-error libassuan])
APPIMAGE_KDEPKG([gpgmepp], [gpgme])
APPIMAGE_KDEPKG([qgpgme], [gpgmepp qtbase])
APPIMAGE_SPKG([paperkey])
# Qt related stuff.
# (dependency on gnupg is only to make sure gnupg is build first so
# that we don't need to wait for the long running Qt builds)
- APPIMAGE_KDEPKG([zstd])
- APPIMAGE_KDEPKG([pcre2])
- APPIMAGE_KDEPKG([qtbase], [jpeg zstd freetype pcre2 gnupg xcb-util-cursor])
+ APPIMAGE_KDEPKG([qtbase], [freetype gnupg xcb-util-cursor])
APPIMAGE_KDEPKG([qttools], [qtbase])
APPIMAGE_KDEPKG([qttranslations], [qtsvg qttools])
APPIMAGE_KDEPKG([qtsvg], [qtbase])
APPIMAGE_KDEPKG([qtwayland], [qtbase])
APPIMAGE_KDEPKG([wayland-protocols], [qtwayland])
APPIMAGE_KDEPKG([plasma-wayland-protocols], [wayland-protocols])
APPIMAGE_KDEPKG([breeze], [qtbase kcoreaddons kconfig kconfigwidgets kguiaddons kiconthemes kwindowsystem])
# KDE Frameworks Tier 1
APPIMAGE_KDEPKG([extra-cmake-modules], [qttools])
APPIMAGE_KDEPKG([breeze-icons], [extra-cmake-modules qtbase])
APPIMAGE_KDEPKG([karchive], [qtbase qttools extra-cmake-modules])
APPIMAGE_KDEPKG([kauth], [qtbase qttools extra-cmake-modules])
APPIMAGE_KDEPKG([kcodecs], [qtbase qttools extra-cmake-modules])
APPIMAGE_KDEPKG([kcolorscheme], [kconfig kguiaddons ki18n])
APPIMAGE_KDEPKG([kconfig], [qtbase qttools extra-cmake-modules])
APPIMAGE_KDEPKG([kcoreaddons], [qtbase qttools extra-cmake-modules])
APPIMAGE_KDEPKG([kdbusaddons], [qtbase qttools extra-cmake-modules])
APPIMAGE_KDEPKG([kguiaddons], [qtbase qttools extra-cmake-modules])
APPIMAGE_KDEPKG([ki18n], [qtbase qttools extra-cmake-modules])
APPIMAGE_KDEPKG([kitemmodels], [qtbase qttools extra-cmake-modules])
APPIMAGE_KDEPKG([kitemviews], [qtbase qttools extra-cmake-modules])
APPIMAGE_KDEPKG([kwindowsystem], [qtbase qtwayland extra-cmake-modules wayland-protocols plasma-wayland-protocols])
APPIMAGE_KDEPKG([solid], [qtbase extra-cmake-modules])
APPIMAGE_KDEPKG([sonnet], [qtbase extra-cmake-modules])
APPIMAGE_KDEPKG([threadweaver], [qtbase extra-cmake-modules])
# KDE Frameworks Tier 2
APPIMAGE_KDEPKG([kcompletion], [kwidgetsaddons])
APPIMAGE_KDEPKG([kcrash], [kwindowsystem kcoreaddons])
APPIMAGE_KDEPKG([kjobwidgets], [kwidgetsaddons kcoreaddons qtbase extra-cmake-modules])
APPIMAGE_KDEPKG([kstatusnotifieritem], [kwindowsystem qtbase extra-cmake-modules])
APPIMAGE_KDEPKG([kwidgetsaddons], [kconfig qttools qtbase])
# KDE Frameworks Tier 3
APPIMAGE_KDEPKG([kconfigwidgets], [kwidgetsaddons kguiaddons ki18n kcodecs kconfig])
APPIMAGE_KDEPKG([kiconthemes], [qtsvg kconfigwidgets karchive])
APPIMAGE_KDEPKG([ktextwidgets], [sonnet kcompletion kconfig kconfigwidgets ki18n kwidgetsaddons])
APPIMAGE_KDEPKG([kxmlgui], [kiconthemes kconfigwidgets kitemviews ktextwidgets breeze])
APPIMAGE_KDEPKG([kbookmarks], [kconfig kxmlgui kcoreaddons kconfigwidgets kwidgetsaddons kcodecs])
APPIMAGE_KDEPKG([kservice], [kconfig kcoreaddons ki18n])
APPIMAGE_KDEPKG([kio], [kcrash kjobwidgets solid kservice kbookmarks kwidgetsaddons kxmlgui kwindowsystem karchive kconfig kcoreaddons ki18n kauth])
APPIMAGE_KDEPKG([kparts], [kio kservice kxmlgui kconfigwidgets kwidgetsaddons ktextwidgets])
# KDE PIM
APPIMAGE_KDEPKG([libical])
APPIMAGE_KDEPKG([kcalendarcore], [qtbase libical extra-cmake-modules])
APPIMAGE_KDEPKG([mimetreeparser], [libkleo kwidgetsaddons ki18n kmime kcodecs kcalendarcore kmbox])
APPIMAGE_KDEPKG([kmime], [kcodecs ki18n])
APPIMAGE_KDEPKG([kmbox], [kmime])
APPIMAGE_KDEPKG([libkleo], [kmime kconfigwidgets kwindowsystem kcompletion qgpgme])
APPIMAGE_KDEPKG([kleopatra], [mimetreeparser gnupg qgpgme breeze-icons kio kxmlgui libkleo kitemmodels qttranslations kdbusaddons kstatusnotifieritem])
# Okular/Poppler
APPIMAGE_KDEPKG([poppler], [gpgmepp kio qtbase freetype])
APPIMAGE_KDEPKG([okular], [kparts gpgmepp kio poppler threadweaver qtsvg])
# Gpgpass
APPIMAGE_KDEPKG([prison], [qtbase extra-cmake-modules libqrencode])
APPIMAGE_KDEPKG([gpgpass], [kio prison kconfigwidgets kiconthemes ki18n qgpgme])
APPIMAGE_FINALIZE
fi
# Throw an error if required tools are missing
if test -n "$missing_tools"; then
for i in $missing_tools; do
AC_MSG_NOTICE([$i is missing])
done
AC_MSG_ERROR([[
***
*** Required tools not found. Please consult the above messages
*** and install them before running configure again.
***]])
fi
# Throw an error if any duplicate source packages have been found The
# packages_dirpfx is set depending on whether we are running under
# docker. See also GPG4WIN_PACKAGES.
packages_dirpfx=
test -f /src/packages/BUILDTYPE && packages_dirpfx=/src/
packages_files=${packages_dirpfx}packages/packages.list
if test -n "$gpg4win_dup_sources"; then
tmp=
for i in $gpg4win_dup_sources; do
tmp="$tmp
$i"
done
tmp2="
You might remove them with:"
for i in $gpg4win_rm_candidates; do
if ! grep -q $(basename $i) $packages_files; then
tmp2="$tmp2
rm $i"
fi
done
AC_MSG_ERROR([Packages with more that one source version:$tmp$tmp2])
fi
if test -n "$appimage_dup_sources"; then
tmp=
for i in $appimage_dup_sources; do
tmp="$tmp
$i"
done
tmp2="
You might remove them with:"
for i in $appimage_rm_candidates; do
if ! grep -q $(basename $i) $packages_files; then
tmp2="$tmp2
rm $i"
fi
done
AC_MSG_ERROR([Packages with more that one source version:$tmp$tmp2])
fi
# Finalize.
AC_CONFIG_FILES(Makefile)
AC_CONFIG_FILES(packages/Makefile src/Makefile po/Makefile)
AC_CONFIG_FILES(src/nsis/config.nsi src/gpg4win.mk)
AC_CONFIG_FILES(doc/Makefile)
AC_CONFIG_FILES(doc/logo/Makefile)
AC_CONFIG_FILES(src/qt.conf)
AC_CONFIG_FILES(src/toolchain.cmake)
AC_CONFIG_FILES(src/toolchain-ex.cmake)
AC_CONFIG_FILES(src/toolchain-native.cmake)
AC_CONFIG_FILES(src/appimage/Makefile src/appimage/appimage.mk)
AC_CONFIG_FILES(src/appimage/rsync-filters/Makefile)
AC_CONFIG_FILES(src/nsis/Makefile)
AC_CONFIG_FILES(src/versioninfo.rc.in)
AC_CONFIG_FILES(src/gpg4win.w32-manifest.in)
AC_CONFIG_FILES(src/gccwrap.sh)
AC_CONFIG_COMMANDS([chmod],[chmod +x src/gccwrap.sh])
AC_OUTPUT
# Throw a warning if optional tools are missing
if test -n "$missing_opt_tools"; then
AC_MSG_WARN([[
***
*** Some tools not found. They may or may not be needed depending on
*** the packages you want to include. For example GLIB and GTK+
*** require certain tools; you may need to install a recent version of
*** GLIB and GTK+ on the build machine to allow for cross-compiling.
***]])
for i in $missing_opt_tools; do
AC_MSG_NOTICE([$i is missing])
done
fi
echo -n "
$PACKAGE_NAME-$PACKAGE_VERSION prepared for make
Revision .....: ${GIT_REVISION} (${GIT_REVISION_DEC})
Main platform : $host
Extra platform: ${GPGEX_ADD_HOST}
Distribution .: ${PRODUCT_NAME} (mym4_buildtype)
Source dir ...: ${TOPSRCDIR}
Build dir ....: ${PLAYGROUND}
"
if test -n "$JOBS"; then
echo " make jobs ....: ${JOBS}"
else
echo ""
fi
diff --git a/docker/appimage/Dockerfile b/docker/appimage/Dockerfile
index 60fc17fb..2d3e58b3 100644
--- a/docker/appimage/Dockerfile
+++ b/docker/appimage/Dockerfile
@@ -1,101 +1,130 @@
# Dockerfile - docker/appimage
# Copyright (C) 2024 g10 Code GmbH
#
# Software engineering by Ingo Klöcker <dev@ingo-kloecker.de>
# Andre Heinecke <aheinecke@gnupg.org>
#
# 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 <https://www.gnu.org/licenses/>.
#
# SPDX-License-Identifier: GPL-2.0+
-FROM registry.suse.com/suse/sle15:latest
-RUN zypper --non-interactive update \
- && zypper --non-interactive install \
- # Build basics
- flex bison gperf awk patch wget automake rsync xz bzip2 \
- gettext gettext-tools gettext-runtime meson ninja \
- which file git-core cmake gcc14 gcc14-c++ glibc-devel-static pkg-config \
- glibc-locale-base \
- # Python
- python311 python311-lxml \
- # Libraries
- alsa-devel \
+FROM almalinux:8.10
+
+# Enable the PowerTools repo (needed at least for gperf)
+RUN dnf install -y 'dnf-command(config-manager)' \
+ && dnf config-manager --set-enabled powertools \
+ && dnf update -y \
+ && dnf clean all
+
+# Package Needed by
+# boost-devel libkleo
+# file appimagetool
+# glibc-gconv-extra iconv.m4 (when checking for working iconv which needs the eucJP codec)
+# hunspell-devel sonnet
+# libmount-devel solid
+# meson wayland-protocols
+# openjpeg2-devel poppler
+# python3.11-lxml breeze-icons
+# wget docker build to download linuxdeploy (see below)
+# xz-devel karchive
+RUN dnf install -y \
at-spi2-core-devel \
- cups-devel \
+ bison \
boost-devel \
+ brotli-devel \
+ bzip2 \
+ bzip2-devel \
+ cmake \
+ cups-devel \
+ dbus-devel \
+ file \
+ flex \
fontconfig-devel \
+ gcc-toolset-14 \
+ gettext \
+ git-core \
+ git-lfs \
+ glibc-gconv-extra \
+ gnutls-devel \
+ gperf \
hunspell-devel \
- openssl-devel \
- libtiff-devel \
- libusb-devel \
- libicu-devel \
- libmount-devel \
- libudev-devel \
- libSM-devel \
+ iso-codes-devel \
libX11-devel \
- libX11-xcb1 \
- libxcb-devel \
+ libX11-xcb \
libXcomposite-devel \
libXcursor-devel \
libXi-devel \
- libxkbcommon-devel \
- libxkbcommon-x11-devel \
libXrandr-devel \
libXtst-devel \
-# Mesa-libEGL-devel \
- Mesa-libGL-devel \
+ libicu-devel \
+ libjpeg-turbo-devel \
+ libmount-devel \
+ libpng-devel \
+ libusbx-devel \
+ libxcb-devel \
+ libxkbcommon-devel \
+ libxkbcommon-x11-devel \
+ libzstd-devel \
+ mesa-libEGL-devel \
+ mesa-libGL-devel \
+ mesa-vulkan-devel \
+ meson \
openjpeg2-devel \
- openldap2-devel \
+ openldap-devel \
+ openssl-devel \
+ patch \
+ pcre2-devel \
+ python3.11-lxml \
readline-devel \
- vulkan-devel \
+ rsync \
+ systemd-devel \
vulkan-headers \
wayland-devel \
+ wget \
+ xcb-util-devel \
+ xcb-util-image \
xcb-util-image-devel \
+ xcb-util-keysyms \
xcb-util-keysyms-devel \
+ xcb-util-renderutil \
xcb-util-renderutil-devel \
+ xcb-util-wm \
xcb-util-wm-devel \
- xcb-proto-devel \
- xkbcomp-devel \
+ xorg-x11-util-macros \
xz-devel \
+ zlib \
zlib-devel \
- # cleanup to ensure we don't leave behind anything that doesn't need to be in the image
- && zypper --non-interactive clean -a \
- # make sure the appropriate gcc/python versions are the defaults
- && alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-14 1 \
- && alternatives --install /usr/bin/cc cc /usr/bin/gcc-14 1 \
- && alternatives --install /usr/bin/cpp cpp /usr/bin/g++-14 1 \
- && alternatives --install /usr/bin/g++ gcc++ /usr/bin/g++-14 1 \
- && alternatives --install /usr/bin/python python /usr/bin/python3.11 1 \
- && alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 1
+ && dnf clean all
# download the necessary linuxdeploy AppImages and extract them because we have no fuse in the container
-RUN mkdir -p /tmp/download \
+RUN set -x \
+ && mkdir -p /tmp/download \
&& cd /tmp/download \
&& wget --no-verbose https://github.com/linuxdeploy/linuxdeploy/releases/download/1-alpha-20240109-1/linuxdeploy-x86_64.AppImage \
&& wget --no-verbose https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/1-alpha-20240109-1/linuxdeploy-plugin-qt-x86_64.AppImage \
&& echo "f53349093d333a6558c560844c1a0f64a3b6bd077bf02740af3ad3dbb8827433 linuxdeploy-plugin-qt-x86_64.AppImage" > chk \
&& echo "c86d6540f1df31061f02f539a2d3445f8d7f85cc3994eee1e74cd1ac97b76df0 linuxdeploy-x86_64.AppImage" >> chk \
&& sha256sum -c chk \
&& chmod +x linuxdeploy-* \
&& cd /tmp \
&& download/linuxdeploy-plugin-qt-x86_64.AppImage --appimage-extract \
&& download/linuxdeploy-x86_64.AppImage --appimage-extract \
&& rm -rf /tmp/download \
&& mkdir -p /opt \
&& mv /tmp/squashfs-root /opt/linuxdeploy
ENV LANG=C.UTF-8
ENV LC_ALL=C.UTF-8
diff --git a/src/appimage/Makefile.am b/src/appimage/Makefile.am
index 234eed26..9df387b9 100644
--- a/src/appimage/Makefile.am
+++ b/src/appimage/Makefile.am
@@ -1,274 +1,271 @@
# Makefile.am - Makefile for building AppImage of Kleopatra
# Copyright (C) 2005, 2006, 2007, 2008, 2009, 2021 g10 Code GmbH
#
# Software engineering by Ingo Klöcker <dev@ingo-kloecker.de>
#
# 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 <https://www.gnu.org/licenses/>.
#
# SPDX-License-Identifier: GPL-2.0+
EXTRA_DIST = AppRun start-shell build-appimage.sh
SUBDIRS = rsync-filters
# Define macros for the various directories. These directory names
# must be absolute, as we switch pretty often between them and don't
# want to track relative names. The directories are created as needed
# by the $(stampdir)/stamp-directories target. tsdir is used instead
# of the predefined top_srcdir so that we can override it using make
# variables.
#
# tsdir :: The top source directory.
# root :: Our build root. The make variable PLAYGROUND can be used
# to override the default.
# stampdir :: The directory to hold stamp files.
# logdir :: The directory for the build logs.
# bdir :: The build dir for the individual packages.
# idir :: The directory with the installed files from the packages.
# ipdir :: A subdir of the install directory to hold the installed
# packages which will be stowed to other subdirs of $(idir).
# appdir :: The directory for preparing the content of the AppImage.
# patdir :: The source directory patches-appimage/ below tsdir.
# rsyncfilterdir :: The source directory with the package-specific
# rsync filters (rsync replaces stow in the AppImage
# build).
tsdir := $(TOPSRCDIR)
root := $(PLAYGROUND)
stampdir := $(root)/stamps
logdir := $(root)/logs
bdir := $(root)/build
idir := $(root)/install
ipdir := $(root)/install/pkgs
appdir := $(root)/AppDir
patdir := $(tsdir)/patches-appimage
rsyncfilterdir := $(tsdir)/src/appimage/rsync-filters
$(info -------------------------------------------------)
$(info Topsource ....: $(tsdir))
$(info Playground ...: $(root))
$(info Stamps at ....: $(stampdir))
$(info Building at ..: $(bdir))
$(info Logs at ......: $(logdir))
$(info -------------------------------------------------)
# Source packages for the AppImage (see also ../src/Makefile.am)
appimage_spkgs = sqlite libgpg-error libassuan npth libgcrypt libksba gnupg \
pinentry gpgme paperkey ntbtls \
- freetype jpeg libpng xcb-util-cursor
+ freetype libpng xcb-util-cursor
appimage_pkg_libgpg_error_configure = --enable-install-gpg-error-config
# KDE packages for the AppImage
appimage_kdepkgs = gpgmepp qgpgme \
kconfig kwidgetsaddons ki18n extra-cmake-modules \
kcompletion kwindowsystem kcoreaddons libkleo kcodecs \
kmime kmbox kconfigwidgets kxmlgui kguiaddons kitemviews \
kiconthemes kleopatra breeze-icons kitemmodels karchive \
kcrash kdbusaddons kio kbookmarks kservice solid \
kjobwidgets libical kcalendarcore mimetreeparser \
kcolorscheme sonnet ktextwidgets kauth kstatusnotifieritem \
threadweaver kparts poppler okular \
libqrencode \
- prison gpgpass zstd pcre2 \
+ prison gpgpass \
qtbase qttools qtsvg qttranslations qtwayland \
plasma-wayland-protocols breeze
appimage_bpkgs = wayland-protocols
define appimage_pkg_wayland_protocols_post_install
( \
cd ..; \
mv $$$${pkgidir}/$$$${pkg_version} $$$${pkgsdir};\
cd $$$${pkgsdir}; \
meson setup --prefix $$$${pkgidir} build; \
cd build; \
ninja && ninja install; \
cd $$$${pkgidir}; \
)
endef
appimage_pkg_gpgme_configure = \
--enable-languages= \
--disable-gpg-test \
--disable-gpgsm-test
appimage_pkg_qgpgme_configure = -DBUILD_WITH_QT5=OFF
appimage_pkg_qtbase_configure = \
-DQT_BUILD_EXAMPLES=OFF \
-DQT_BUILD_TESTS=OFF \
-DBUILD_WITH_PCH=OFF \
-DFEATURE_accessibility=ON \
-DFEATURE_glib=OFF \
-DFEATURE_dynamicgl=OFF \
-DFEATURE_egl=OFF \
-DFEATURE_opengl_desktop=OFF \
-DFEATURE_opengl_dynamic=OFF \
-DFEATURE_opengles2=OFF \
-DFEATURE_opengl=OFF \
-DINPUT_opengl=no \
-DFEATURE_pkg_config=ON \
-DFEATURE_sql_mysql=OFF \
-DFEATURE_sql_odbc=OFF \
-DFEATURE_sql_psql=OFF \
-DFEATURE_qt_freetype=ON \
-DFEATURE_system_pcre=ON \
-DFEATURE_system_jpeg=ON \
-DFEATURE_system_zstd=ON \
-DFEATURE_xcb=ON \
-DFEATURE_use_gold_linker_alias=OFF \
-DCMAKE_MESSAGE_LOG_LEVEL=STATUS \
-DCMAKE_VERBOSE_MAKEFILE=ON
appimage_pkg_qttools_configure = \
-DFEATURE_assistant=OFF \
-DFEATURE_qdoc=OFF \
-DFEATURE_designer=OFF \
-DFEATURE_distancefieldgenerator=OFF \
-DFEATURE_kmap2qmap=OFF \
-DFEATURE_pixeltool=OFF \
-DFEATURE_qdbus=OFF \
-DFEATURE_qev=OFF \
-DFEATURE_qtattributionsscanner=OFF \
-DFEATURE_qtdiag=OFF \
-DFEATURE_qtplugininfo=OFF
# do not create the huge icon resource files
appimage_pkg_breeze_icons_configure = -DBINARY_ICONS_RESOURCE=OFF
appimage_pkg_breeze_configure = \
-DBUILD_QT6=ON \
-DBUILD_QT5=OFF \
-DWITH_DECORATIONS=OFF \
-DCMAKE_DISABLE_FIND_PACKAGE_KF6KCMUtils=ON
appimage_pkg_karchive_configure = -DWITH_BZIP2=OFF
appimage_pkg_kcompletion_configure = \
-DBUILD_DESIGNERPLUGIN=OFF
appimage_pkg_kconfigwidgets_configure = \
-DBUILD_DESIGNERPLUGIN=OFF
appimage_pkg_kconfig_configure = -DKCONFIG_USE_DBUS=OFF -DKCONFIG_USE_QML=OFF
appimage_pkg_kcrash_configure = -DWITH_OPENGL=OFF
appimage_pkg_kguiaddons_configure = -DWITH_WAYLAND=OFF
appimage_pkg_sonnet_configure = -DSONNET_USE_QML=OFF
appimage_pkg_ki18n_configure = -DBUILD_WITH_QML=OFF
appimage_pkg_kitemviews_configure = \
-DBUILD_DESIGNERPLUGIN=OFF
appimage_pkg_kwidgetsaddons_configure = \
-DBUILD_DESIGNERPLUGIN=OFF
# FIXME: Uses spaces in distribution text
appimage_pkg_kxmlgui_configure = \
-DBUILD_DESIGNERPLUGIN=OFF \
-DFORCE_DISABLE_KGLOBALACCEL=ON
appimage_pkg_libkleo_configure = \
-DBOOST_INCLUDEDIR=/usr/include/boost169 \
-DBOOST_LIBRARYDIR=/usr/lib64/boost169
appimage_pkg_kleopatra_configure = \
-DBOOST_INCLUDEDIR=/usr/include/boost169 \
-DBOOST_LIBRARYDIR=/usr/lib64/boost169 \
-DDISABLE_KWATCHGNUPG=ON \
-DRELEASE_SERVICE_VERSION=AppImage-$(VERSION)
appimage_pkg_poppler_configure = \
-DENABLE_BOOST=OFF \
-DENABLE_NSS3=OFF \
-DENABLE_GOBJECT_INTROSPECTION=OFF \
-DENABLE_QT5=OFF \
-DENABLE_LCMS=OFF \
-DENABLE_LIBCURL=OFF \
-DFONT_CONFIGURATION=generic
appimage_pkg_okular_configure = \
-DFORCE_NOT_REQUIRED_DEPENDENCIES="PlasmaActivities\;KF6Wallet\;KF6Purpose\;Qt6TextToSpeech\;LibZip\;KF6DocTools\;Phonon4Qt6\;LibSpectre\;KExiv2Qt6\;CHM\;DjVuLibre\;EPub\;QMobipocket\;Discount\;Qt6Qml\;Qt6DBus\;KF6Pty"
appimage_pkg_libical_configure = \
-DICAL_GLIB=false \
-DENABLE_GTK_DOC=false
appimage_pkg_prison_configure = \
-DWITH_QUICK=OFF \
-DWITH_MULTIMEDIA=OFF
appimage_pkg_kiconthemes_configure = \
-DKICONTHEMES_USE_QTQUICK=OFF
appimage_pkg_kcoreaddons_configure = -DKCOREADDONS_USE_QML=OFF
appimage_pkg_kcalendarcore_configure = -DUSE_QML=OFF
appimage_pkg_ktextwidgets_configure = -DWITH_TEXT_TO_SPEECH=OFF
appimage_pkg_kio_configure = -DWITH_WAYLAND=OFF
appimage_pkg_kwindowsystem_configure = -DKWINDOWSYSTEM_QML=OFF
appimage_pkg_xcb_util_cursor_configure = --enable-static --disable-shared
appimage_pkg_xcb_util_cursor_extracflags = -fPIC
-appimage_pkg_zstd_conf_subdir = /build/cmake
-appimage_pkg_zstd_configure = -DZSTD_BUILD_PROGRAMS=OFF
-
########################################################################
# The build area is our scratch area, where we unpack, build and
# install the packages.
$(stampdir)/stamp-directories:
$(MKDIR) -p $(root)
$(MKDIR) -p $(stampdir)
$(MKDIR) -p $(logdir)
$(MKDIR) -p $(bdir)
$(MKDIR) -p $(idir)
$(MKDIR) -p $(ipdir)
$(MKDIR) -p $(appdir)/usr
touch $(bdir)/versioninfo.txt
touch $(stampdir)/stamp-directories
# Now do the bunch of the work. This is a bunch of dirty magic to
# integrate our special makefile into automake, while not actually
# including it (make should include it). This is in turn necessary
# because automake can't deal with the elegant magic in the actual
# Makefile.
define INCLUDE_BY_MAKE
include $(1)
endef
$(eval $(call INCLUDE_BY_MAKE,appimage.mk))
clean-local: clean-appimage
license.blurb: $(top_srcdir)/doc/license-page $(top_srcdir)/doc/GPLv3
cat $(top_srcdir)/doc/license-page $(top_srcdir)/doc/GPLv3 >$@
all-local: $(stampdir)/stamp-final
@echo "###################################################"
@echo " AppDir prepared successfully for the AppImage!"
@echo " Now run linuxdeploy to create the AppImage."
@echo "###################################################"
diff --git a/src/appimage/build-appimage.sh b/src/appimage/build-appimage.sh
index 7e892038..85fd0ddb 100755
--- a/src/appimage/build-appimage.sh
+++ b/src/appimage/build-appimage.sh
@@ -1,197 +1,198 @@
#!/bin/sh
# Build an AppImage of GnuPG (VS-)Desktop
# Copyright (C) 2021, 2024 g10 Code GmbH
#
# Software engineering by: Ingo Klöcker <dev@ingo-kloecker.de>
# Andre Heinecke <aheinecke@gnupg.org>
# 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 <https://www.gnu.org/licenses/>.
#
# SPDX-License-Identifier: GPL-3.0+
set -e
BUILDROOT=/build
SRCDIR=/src
APPDIR=${BUILDROOT}/AppDir
INSTDIR=${BUILDROOT}/install
VSD_DIR=${SRCDIR}/src/gnupg-vsd
# Check for the buildtype and existence of required files
# early
BUILDTYPE=$(cat ${SRCDIR}/packages/BUILDTYPE || echo default)
if [ $BUILDTYPE != default ] && [ ! -f ${VSD_DIR}/custom.mk ]; then
echo "ERROR: Non default build without custom file."
echo "Check that ${VSD_DIR}/custom.mk exists or "
echo "change the BUILDTYPE in ${SRCDIR}/packages/BUILDTYPE"
exit 2
fi
if [ $BUILDTYPE = vsd ] && \
[ ! -f ${VSD_DIR}/Standard/VERSION ]; then
echo "No VERSION file in Standard dir."
exit 2
fi
if [ $BUILDTYPE = gpd ] && \
[ ! -f ${VSD_DIR}/Desktop/VERSION ]; then
echo "No VERSION file in Desktop dir."
exit 2
fi
# The actual build
cd ${BUILDROOT}
+source /opt/rh/gcc-toolset-14/enable
${SRCDIR}/configure --enable-appimage --with-playground=${BUILDROOT}
make TOPSRCDIR=${SRCDIR} PLAYGROUND=${BUILDROOT}
echo 'rootdir = $APPDIR/usr' >${APPDIR}/usr/bin/gpgconf.ctl
if [ $BUILDTYPE = vsd ]; then
echo 'sysconfdir = /etc/gnupg-vsd' >>${APPDIR}/usr/bin/gpgconf.ctl
else
echo 'sysconfdir = /etc/gnupg' >>${APPDIR}/usr/bin/gpgconf.ctl
fi
# Copy the start-shell helper for use AppRun
cp ${SRCDIR}/src/appimage/start-shell ${APPDIR}/
chmod +x ${APPDIR}/start-shell
# Copy standard global configuration
if [ $BUILDTYPE = vsd ]; then
mkdir -p ${APPDIR}/usr/share/gnupg/conf/gnupg-vsd
rsync -aLv --delete --omit-dir-times \
${VSD_DIR}/Standard/etc/gnupg/ \
${APPDIR}/usr/share/gnupg/conf/gnupg-vsd/
fi
export PATH=/opt/linuxdeploy/usr/bin:$PATH
export LD_LIBRARY_PATH=${INSTDIR}/lib:${INSTDIR}/lib64
# tell the linuxdeploy qt-plugin where to find qmake
export QMAKE=${INSTDIR}/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 ${INSTDIR}/plugins/sqldrivers
# copy KDE plugins to ${APPDIR}/usr/lib/plugins/
# copying the plugins to a subfolder of ${APPDIR}/usr/lib (instead of to
# ${APPDIR}/usr/plugins/ as linuxdeploy does for the Qt plugins) ensures that
# linuxdeploy copies the dependencies of the plugins to APPDIR so that
# we don't have to take care of this ourselves
mkdir -p ${APPDIR}/usr/lib/plugins
for d in kf6 kiconthemes6 styles; do
rsync -av --delete --omit-dir-times ${INSTDIR}/lib64/plugins/${d}/ ${APPDIR}/usr/lib/plugins/${d}/
done
rsync -av --delete --omit-dir-times ${INSTDIR}/lib64/plugins/okular_generators/okularGenerator_poppler.so ${APPDIR}/usr/lib/plugins/okular_generators/
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 ${APPDIR}/AppRun ${APPDIR}/AppRun.wrapped 2>/dev/null
# Remove existing translations that may be left over from a previous
# run of linuxdeploy
rm -rf ${APPDIR}/usr/translations
# Remove the version files to make sure that only one will be created.
rm -f ${APPDIR}/GnuPG-VS-Desktop-VERSION 2>/dev/null
rm -f ${APPDIR}/GnuPG-Desktop-VERSION 2>/dev/null
rm -f ${APPDIR}/Gpg4win-VERSION 2>/dev/null
myversion=$(grep PACKAGE_VERSION ${BUILDROOT}/config.h|sed -n 's/.*"\(.*\)"$/\1/p')
if [ $BUILDTYPE = vsd ]; then
OUTPUT=gnupg-vs-desktop-${myversion}-x86_64.AppImage
echo "Packaging GnuPG VS-Desktop Appimage: $myversion"
echo $myversion >${APPDIR}/GnuPG-VS-Desktop-VERSION
cp ${VSD_DIR}/Standard/VERSION* ${APPDIR}/usr/
echo "Packaging help files"
mkdir -p ${APPDIR}/usr/share/doc/gnupg-vsd
cp ${VSD_DIR}/help/*.pdf ${APPDIR}/usr/share/doc/gnupg-vsd
if [ -f ${VSD_DIR}/Standard/kleopatrarc ]; then
echo "Packaging kleopatrarc"
mkdir -p ${APPDIR}/usr/etc/xdg
cp ${VSD_DIR}/Standard/kleopatrarc ${APPDIR}/usr/etc/xdg
fi
kleopatra_icon=${SRCDIR}/src/icons/kleopatra-vsd.svg
elif [ $BUILDTYPE = gpd ]; then
OUTPUT=gnupg-desktop-${myversion}-x86_64.AppImage
echo "Packaging GnuPG Desktop Appimage: $myversion"
echo $myversion >${APPDIR}/GnuPG-Desktop-VERSION
cp ${VSD_DIR}/Desktop/VERSION* ${APPDIR}/usr/
echo "Packaging help files"
mkdir -p ${APPDIR}/usr/share/doc/gnupg-vsd
cp ${VSD_DIR}/help/*.pdf ${APPDIR}/usr/share/doc/gnupg-vsd
if [ -f ${VSD_DIR}/Desktop/kleopatrarc ]; then
echo "Packaging kleopatrarc"
mkdir -p ${APPDIR}/usr/etc/xdg
cp ${VSD_DIR}/Desktop/kleopatrarc ${APPDIR}/usr/etc/xdg
fi
kleopatra_icon=${SRCDIR}/src/icons/gpd/sc-apps-kleopatra.svg
else
OUTPUT=gpg4win-${myversion}-x86_64.AppImage
echo "Packaging Gpg4win Appimage: $myversion"
echo $myversion >${APPDIR}/Gpg4win-VERSION
fi
export OUTPUT
if [ -n "${kleopatra_icon}" ]; then
# Replace Breeze icons for kleopatra with our icon
find ${APPDIR}/usr/share/icons/breeze -name 'kleopatra*.svg' -delete
find ${APPDIR}/usr/share/icons/breeze-dark -name 'kleopatra*.svg' -delete
cp -av ${kleopatra_icon} ${APPDIR}/usr/share/icons/breeze/apps/22/kleopatra-symbolic.svg
cp -av ${kleopatra_icon} ${APPDIR}/usr/share/icons/breeze/apps/48/kleopatra.svg
cp -av ${kleopatra_icon} ${APPDIR}/usr/share/icons/breeze-dark/apps/22/kleopatra-symbolic.svg
cp -av ${kleopatra_icon} ${APPDIR}/usr/share/icons/breeze-dark/apps/48/kleopatra.svg
else
# Restore the Breeze icons that may have been replaced in a previous build
for f in breeze/apps/22/kleopatra-symbolic.svg breeze/apps/48/kleopatra.svg \
breeze-dark/apps/22/kleopatra-symbolic.svg breeze-dark/apps/48/kleopatra.svg; do
cp -av ${INSTDIR}/share/icons/$f ${APPDIR}/usr/share/icons/$f
done
fi
# Hack around that linuxdeploy does not know libexec
for f in dirmngr_ldap gpg-check-pattern \
gpg-preset-passphrase gpg-protect-tool \
gpg-wks-client scdaemon \
keyboxd gpg-pair-tool; do
# Ignore errors because some files might not exist depending
# on GnuPG Version
/opt/linuxdeploy/usr/bin/patchelf --debug \
--set-rpath '$ORIGIN/../lib' ${APPDIR}/usr/libexec/$f || true
done
# linuxdeploy also doesn't know about non-Qt plugins
for f in $(find ${APPDIR}/usr/lib/plugins/ -mindepth 2 -maxdepth 2 -type f); do
/opt/linuxdeploy/usr/bin/patchelf --debug --set-rpath '$ORIGIN/../..' $f
done
for f in $(find ${APPDIR}/usr/lib/plugins/ -mindepth 3 -maxdepth 3 -type f); do
/opt/linuxdeploy/usr/bin/patchelf --debug --set-rpath '$ORIGIN/../../..' $f
done
for f in $(find ${APPDIR}/usr/lib/plugins/ -mindepth 4 -maxdepth 4 -type f); do
/opt/linuxdeploy/usr/bin/patchelf --debug --set-rpath '$ORIGIN/../../../..' $f
done
# Fix up everything and build the file system
linuxdeploy --appdir ${APPDIR} \
--desktop-file ${APPDIR}/usr/share/applications/org.kde.kleopatra.desktop \
--icon-file ${APPDIR}/usr/share/icons/hicolor/256x256/apps/kleopatra.png \
--custom-apprun ${SRCDIR}/src/appimage/AppRun \
--plugin qt \
--output appimage \
2>&1 | tee /build/logs/linuxdeploy-gnupg-desktop.log
echo ready
exit 0
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Thu, Feb 5, 9:33 PM (1 d, 1 h)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
eb/87/ac887b912b27e2684964fc12539b
Attached To
rW Gpg4win
Event Timeline
Log In to Comment