Page MenuHome GnuPG

No OneTemporary

diff --git a/autogen.rc b/autogen.rc
index 181e472d..b71f8f15 100644
--- a/autogen.rc
+++ b/autogen.rc
@@ -1,27 +1,29 @@
# autogen.sh configuration for gpg4win -*- sh -*-
display_name="Gpg4win"
patches_to="https://bugs.gnupg.org"
# We don't want the maintainer mode due to the docker build
# with the source directory mounted read-only
maintainer_mode_option=off
+# We always want to use the force option.
+autogen_use_force=yes
case "$myhost:$myhostsub" in
w32:64)
extraoptions="--with-additional-gpgex-host=i686-w64-mingw32"
;;
w32:)
extraoptions="--with-additional-gpgex-host=x86_64-w64-mingw32"
;;
esac
case "$myhost" in
w32)
configure_opts="--enable-gpg4win"
;;
esac
extra_automake_flags="-Wno-portability"
final_info="For building a Gpg4win installer: \"./build.sh\".
For building an AppImage: check the README."
diff --git a/autogen.sh b/autogen.sh
index 8695fcb5..c0cde6ec 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -1,545 +1,546 @@
#! /bin/sh
# autogen.sh
# Copyright (C) 2003, 2014, 2017, 2018, 2022 g10 Code GmbH
#
# This file is free software; as a special exception the author gives
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#
# This is a generic script to create the configure script and handle cross
# build environments. It requires the presence of a autogen.rc file to
# configure it for the respective package. It is maintained as part of
# GnuPG and source copied by other packages.
#
# Version: 2025-03-10
configure_ac="configure.ac"
cvtver () {
awk 'NR==1 {split($NF,A,".");X=1000000*A[1]+1000*A[2]+A[3];print X;exit 0}'
}
check_version () {
if [ $(( `("$1" --version || echo "0") | cvtver` >= $2 )) = 1 ]; then
return 0
fi
echo "**Error**: "\`$1\'" not installed or too old." >&2
echo ' Version '$3' or newer is required.' >&2
[ -n "$4" ] && echo ' Note that this is part of '\`$4\''.' >&2
DIE="yes"
return 1
}
fatal () {
echo "autogen.sh:" "$*" >&2
DIE=yes
}
info () {
if [ -z "${SILENT}" ]; then
echo "autogen.sh:" "$*" >&2
fi
}
die_p () {
if [ "$DIE" = "yes" ]; then
echo "autogen.sh: Stop." >&2
exit 1
fi
}
replace_sysroot () {
configure_opts=$(echo $configure_opts | sed "s#@SYSROOT@#${w32root}#g")
extraoptions=$(echo $extraoptions | sed "s#@SYSROOT@#${w32root}#g")
}
# Allow to override the default tool names
AUTOCONF=${AUTOCONF_PREFIX}${AUTOCONF:-autoconf}${AUTOCONF_SUFFIX}
AUTOHEADER=${AUTOCONF_PREFIX}${AUTOHEADER:-autoheader}${AUTOCONF_SUFFIX}
AUTOMAKE=${AUTOMAKE_PREFIX}${AUTOMAKE:-automake}${AUTOMAKE_SUFFIX}
ACLOCAL=${AUTOMAKE_PREFIX}${ACLOCAL:-aclocal}${AUTOMAKE_SUFFIX}
GETTEXT=${GETTEXT_PREFIX}${GETTEXT:-gettext}${GETTEXT_SUFFIX}
MSGMERGE=${GETTEXT_PREFIX}${MSGMERGE:-msgmerge}${GETTEXT_SUFFIX}
DIE=no
FORCE=
SILENT=
PRINT_HOST=no
PRINT_BUILD=no
PRINT_TSDIR=no
tmp=$(dirname "$0")
tsdir=$(cd "${tmp}"; pwd)
if [ -n "${AUTOGEN_SH_SILENT}" ]; then
SILENT=" --silent"
fi
if test x"$1" = x"--help"; then
echo "usage: ./autogen.sh [OPTIONS] [ARGS]"
echo " Options:"
echo " --silent Silent operation"
echo " --force Pass --force to autoconf"
echo " --find-version Helper for configure.ac"
echo " --git-build Run all commands to build from a Git"
echo " --print-host Print only the host triplet"
echo " --print-build Print only the build platform triplet"
echo " --print-tsdir Print only the dir of this script"
echo " --build-TYPE Configure to cross build for TYPE"
echo ""
echo " ARGS are passed to configure in --build-TYPE mode."
echo " Configuration for this script is expected in autogen.rc"
exit 0
fi
if test x"$1" = x"--silent"; then
SILENT=" --silent"
shift
fi
if test x"$1" = x"--force"; then
FORCE=" --force"
shift
fi
if test x"$1" = x"--print-host"; then
PRINT_HOST=yes
shift
fi
if test x"$1" = x"--print-build"; then
PRINT_BUILD=yes
shift
fi
# Reject unsafe characters in $HOME, $tsdir and cwd. We consider spaces
# as unsafe because it is too easy to get scripts wrong in this regard.
am_lf='
'
case `pwd` in
*[\;\\\"\#\$\&\'\`$am_lf\ \ ]*)
fatal "unsafe working directory name" ;;
esac
case $tsdir in
*[\;\\\"\#\$\&\'\`$am_lf\ \ ]*)
fatal "unsafe source directory: \`$tsdir'" ;;
esac
case $HOME in
*[\;\\\"\#\$\&\'\`$am_lf\ \ ]*)
fatal "unsafe home directory: \`$HOME'" ;;
esac
die_p
# List of variables sourced from autogen.rc. The strings '@SYSROOT@' in
# these variables are replaced by the actual system root.
configure_opts=
extraoptions=
# List of optional variables sourced from autogen.rc and ~/.gnupg-autogen.rc
maintainer_mode_option=
w32_toolprefixes=
w32_extraoptions=
w64_toolprefixes=
w64_extraoptions=
amd64_toolprefixes=
disable_gettext_checks=
# End list of optional variables sourced from ~/.gnupg-autogen.rc
# What follows are variables which are sourced but default to
# environment variables or lacking them hardcoded values.
#w32root=
#w64root=
#amd64root=
# Convenience option to use certain configure options for some hosts.
myhost=""
myhostsub=""
case "$1" in
--find-version)
myhost="find-version"
SILENT=" --silent"
shift
;;
--print-tsdir)
myhost="print-tsdir"
SILENT=" --silent"
shift
;;
--git-build)
myhost="git-build"
shift
;;
--build-w32)
myhost="w32"
shift
;;
--build-w64)
myhost="w32"
myhostsub="64"
shift
;;
--build-amd64)
myhost="amd64"
shift
;;
--build*)
fatal "**Error**: invalid build option $1"
shift
;;
*)
;;
esac
die_p
# **** GIT BUILD ****
# This is a helper to build from git.
if [ "$myhost" = "git-build" ]; then
tmp="$(pwd)"
cd "$tsdir" || fatal "error cd-ing to $tsdir"
./autogen.sh || fatal "error running ./autogen.sh"
cd "$tmp" || fatal "error cd-ing back to $tmp"
die_p
"$tsdir"/configure || fatal "error running $tsdir/configure"
die_p
make || fatal "error running make"
die_p
make check || fatal "error running make check"
die_p
exit 0
fi
# **** end GIT BUILD ****
# Source our configuration
if [ -f "${tsdir}/autogen.rc" ]; then
. "${tsdir}/autogen.rc"
+ [ "$autogen_use_force" = yes ] && FORCE=" --force"
fi
# Source optional site specific configuration
if [ -f "$HOME/.gnupg-autogen.rc" ]; then
info "sourcing extra definitions from $HOME/.gnupg-autogen.rc"
. "$HOME/.gnupg-autogen.rc"
fi
# Disable the --enable-maintainer_mode option.
if [ "${maintainer_mode_option}" = off ]; then
maintainer_mode_option=
elif [ -z "${maintainer_mode_option}" ]; then
maintainer_mode_option=--enable-maintainer-mode
fi
# **** FIND VERSION ****
# This is a helper for the configure.ac M4 magic
# Called
# ./autogen.sh --find-version PACKAGE MAJOR MINOR [MICRO]
# returns a complete version string with automatic beta numbering.
if [ "$myhost" = "find-version" ]; then
package="$1"
major="$2"
minor="$3"
micro="$4"
if [ -z "$package" -o -z "$major" -o -z "$minor" ]; then
echo "usage: ./autogen.sh --find-version PACKAGE MAJOR MINOR [MICRO]" >&2
exit 1
fi
if [ -z "$micro" ]; then
matchstr1="$package-$major.[0-9]*"
matchstr2="$package-$major-base"
matchstr3=""
vers="$major.$minor"
else
matchstr1="$package-$major.$minor.[0-9]*"
matchstr2="$package-$major.[0-9]*-base"
matchstr3="$package-$major-base"
vers="$major.$minor.$micro"
fi
matchexcl="--exclude $package-*beta*"
beta=no
if [ -e .git ]; then
ingit=yes
tmp=$(git describe --match "${matchstr1}" $matchexcl --long 2>/dev/null)
if [ -n "$tmp" ]; then
tmp=$(echo "$tmp" | sed s/^"$package"// \
| awk -F- '$3!=0 && $3 !~ /^beta/ {print"-beta"$3}')
else
# (due tof "-base" in the tag we need to take the 4th field)
tmp=$(git describe --match "${matchstr2}" $matchexcl --long 2>/dev/null)
if [ -n "$tmp" ]; then
tmp=$(echo "$tmp" | sed s/^"$package"// \
| awk -F- '$4!=0 && $4 !~ /^beta/ {print"-beta"$4}')
elif [ -n "${matchstr3}" ]; then
tmp=$(git describe --match "${matchstr3}" $matchexcl --long 2>/dev/null)
if [ -n "$tmp" ]; then
tmp=$(echo "$tmp" | sed s/^"$package"// \
| awk -F- '$4!=0 && $4 !~ /^beta/ {print"-beta"$4}')
fi
fi
fi
[ -n "$tmp" ] && beta=yes
cid=$(git rev-parse --verify HEAD | tr -d '\n\r')
rev=$(git rev-parse --short HEAD | tr -d '\n\r')
rvd=$((0x$(echo ${rev} | dd bs=1 count=4 2>/dev/null)))
else
ingit=no
beta=yes
tmp="-unknown"
cid="0000000"
rev="0000000"
rvd="0"
fi
echo "$package-$vers$tmp:$beta:$ingit:$vers$tmp:$vers:$tmp:$rev:$rvd:$cid:"
exit 0
fi
# **** end FIND VERSION ****
# **** PRINT TSDIR VERSION ****
# This is a helper used by some configure.ac M4 magic
if [ "$myhost" = "print-tsdir" ]; then
echo "$tsdir"
exit 0
fi
# **** end PRINT TSDIR ****
if [ ! -f "$tsdir/build-aux/config.guess" ]; then
fatal "$tsdir/build-aux/config.guess not found"
exit 1
fi
build=`$tsdir/build-aux/config.guess`
if [ $PRINT_BUILD = yes ]; then
echo "$build"
exit 0
fi
# ******************
# W32 build script
# ******************
if [ "$myhost" = "w32" ]; then
case $myhostsub in
64)
w32root="$w64root"
[ -z "$w32root" ] && w32root="$HOME/w64root"
toolprefixes="$w64_toolprefixes x86_64-w64-mingw32"
extraoptions="$extraoptions $w64_extraoptions"
;;
*)
[ -z "$w32root" ] && w32root="$HOME/w32root"
toolprefixes="$w32_toolprefixes i686-w64-mingw32 i586-mingw32msvc"
toolprefixes="$toolprefixes i386-mingw32msvc mingw32"
extraoptions="$extraoptions $w32_extraoptions"
;;
esac
w32root=$(echo "$w32root" | sed s,^//,/,)
info "Using $w32root as standard install directory"
replace_sysroot
# Locate the cross compiler
crossbindir=
for host in $toolprefixes; do
if ${host}-gcc --version >/dev/null 2>&1 ; then
crossbindir=/usr/${host}/bin
conf_CC="CC=${host}-gcc"
break;
fi
done
if [ -z "$crossbindir" ]; then
fatal "cross compiler kit not installed"
if [ -z "$myhostsub" ]; then
info "Under Debian GNU/Linux, you may install it using"
info " apt-get install mingw32 mingw32-runtime mingw32-binutils"
fi
die_p
fi
if [ $PRINT_HOST = yes ]; then
echo "$host"
exit 0
fi
if [ -f "$tsdir/config.log" ]; then
if ! head $tsdir/config.log | grep "$host" >/dev/null; then
fatal "Please run a 'make distclean' first"
die_p
fi
fi
$tsdir/configure "${maintainer_mode_option}" ${SILENT} \
--prefix=${w32root} \
--host=${host} --build=${build} SYSROOT=${w32root} \
PKG_CONFIG_LIBDIR=${w32root}/lib/pkgconfig \
${configure_opts} ${extraoptions} "$@"
rc=$?
exit $rc
fi
# ***** end W32 build script *******
# ***** AMD64 cross build script *******
# Used to cross-compile for AMD64 (for testing)
if [ "$myhost" = "amd64" ]; then
[ -z "$amd64root" ] && amd64root="$HOME/amd64root"
info "Using $amd64root as standard install directory"
replace_sysroot
toolprefixes="$amd64_toolprefixes x86_64-linux-gnu amd64-linux-gnu"
# Locate the cross compiler
crossbindir=
for host in $toolprefixes ; do
if ${host}-gcc --version >/dev/null 2>&1 ; then
crossbindir=/usr/${host}/bin
conf_CC="CC=${host}-gcc"
break;
fi
done
if [ -z "$crossbindir" ]; then
echo "Cross compiler kit not installed" >&2
echo "Stop." >&2
exit 1
fi
if [ $PRINT_HOST = yes ]; then
echo "$host"
exit 0
fi
if [ -f "$tsdir/config.log" ]; then
if ! head $tsdir/config.log | grep "$host" >/dev/null; then
echo "Please run a 'make distclean' first" >&2
exit 1
fi
fi
$tsdir/configure "${maintainer_mode_option}" ${SILENT} \
--prefix=${amd64root} \
--host=${host} --build=${build} \
${configure_opts} ${extraoptions} "$@"
rc=$?
exit $rc
fi
# ***** end AMD64 cross build script *******
# Grep the required versions from configure.ac
autoconf_vers=`sed -n '/^AC_PREREQ(/ {
s/^.*(\(.*\))/\1/p
q
}' ${configure_ac}`
autoconf_vers_num=`echo "$autoconf_vers" | cvtver`
automake_vers=`sed -n '/^min_automake_version=/ {
s/^.*="\(.*\)"/\1/p
q
}' ${configure_ac}`
automake_vers_num=`echo "$automake_vers" | cvtver`
gettext_vers="n/a"
if [ -d "${tsdir}/po" ]; then
gettext_vers=`sed -n '/^AM_GNU_GETTEXT_VERSION(/ {
s/^.*\[\(.*\)])/\1/p
q
}' ${configure_ac}`
gettext_vers_num=`echo "$gettext_vers" | cvtver`
fi
if [ -z "$autoconf_vers" -o -z "$automake_vers" ]
then
echo "**Error**: version information not found in "\`${configure_ac}\'"." >&2
exit 1
fi
if check_version $AUTOCONF $autoconf_vers_num $autoconf_vers ; then
check_version $AUTOHEADER $autoconf_vers_num $autoconf_vers autoconf
fi
if check_version $AUTOMAKE $automake_vers_num $automake_vers; then
check_version $ACLOCAL $automake_vers_num $autoconf_vers automake
fi
if [ "$gettext_vers" != "n/a" ]; then
if check_version $GETTEXT $gettext_vers_num $gettext_vers; then
check_version $MSGMERGE $gettext_vers_num $gettext_vers gettext
fi
fi
if [ "$DIE" = "yes" ]; then
cat <<EOF
Note that you may use alternative versions of the tools by setting
the corresponding environment variables; see README.GIT for details.
EOF
die_p
fi
# Check the git setup.
if [ -d .git ]; then
CP="cp -p"
# If we have a GNU cp we can add -v
if cp --version >/dev/null 2>/dev/null; then
[ -z "${SILENT}" ] && CP="$CP -v"
fi
if [ -f .git/hooks/pre-commit.sample -a ! -f .git/hooks/pre-commit ] ; then
[ -z "${SILENT}" ] && cat <<EOF
*** Activating trailing whitespace git pre-commit hook. ***
For more information see this thread:
https://mail.gnome.org/archives/desktop-devel-list/2009-May/msg00084.html
To deactivate this pre-commit hook again move .git/hooks/pre-commit
and .git/hooks/pre-commit.sample out of the way.
EOF
$CP .git/hooks/pre-commit.sample .git/hooks/pre-commit
chmod +x .git/hooks/pre-commit
fi
if [ "$gettext_vers" != "n/a" ]; then
tmp=$(git config --get filter.cleanpo.clean)
if [ "$tmp" != \
"awk '/^\"POT-Creation-Date:/&&!s{s=1;next};!/^#: /{print}'" ]
then
info "*** Adding GIT filter.cleanpo.clean configuration."
git config --add filter.cleanpo.clean \
"awk '/^\"POT-Creation-Date:/&&!s{s=1;next};!/^#: /{print}'"
fi
fi
if [ -f build-aux/git-hooks/commit-msg -a ! -f .git/hooks/commit-msg ] ; then
[ -z "${SILENT}" ] && cat <<EOF
*** Activating commit log message check hook. ***
EOF
$CP build-aux/git-hooks/commit-msg .git/hooks/commit-msg
chmod +x .git/hooks/commit-msg
if [ x"${display_name}" != x ]; then
git config format.subjectPrefix "PATCH ${display_name}"
git config sendemail.to "${patches_to}"
fi
fi
fi
aclocal_flags="-I m4"
if [ -n "${extra_aclocal_flags}" ]; then
aclocal_flags="${aclocal_flags} ${extra_aclocal_flags}"
fi
if [ -n "${ACLOCAL_FLAGS}" ]; then
aclocal_flags="${aclocal_flags} ${ACLOCAL_FLAGS}"
fi
automake_flags="--gnu"
if [ -n "${extra_automake_flags}" ]; then
automake_flags="${automake_flags} ${extra_automake_flags}"
fi
if [ -n "${AUTOMAKE_FLAGS}" ]; then
automake_flags="${automake_flags} ${AUTOMAKE_FLAGS}"
fi
info "Running $ACLOCAL ${aclocal_flags} ..."
$ACLOCAL ${aclocal_flags}
info "Running autoheader..."
$AUTOHEADER
info "Running $AUTOMAKE ${automake_flags} ..."
$AUTOMAKE ${automake_flags};
info "Running autoconf${FORCE} ..."
$AUTOCONF${FORCE}
info "You may now run:${am_lf} ${final_info}"
diff --git a/build.sh b/build.sh
index a0bfb10a..57615ca7 100755
--- a/build.sh
+++ b/build.sh
@@ -1,815 +1,808 @@
#!/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
+ ./download.sh $quiet --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: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 c1cbaa75..36eec768 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,675 +1,677 @@
# 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
+# (git tag -s gpg4win-z.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.
+# commit and push so that the git magic is able to work. BUILDTYPE
+# defines what to build. It may be "vsd3" for the old VSD versions,
+# "vsd" for the new (4.x) VSD versions, "gpd" for for GnuPG Desktop,
+# or "gpg4win" for Gpg4win. Note that IS_VSD_BUILD is always 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_isvsd3build],[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
+m4_if(mym4_buildtype,[vsd3],[m4_define([mym4_isvsd],[yes])
+ m4_define([mym4_isvsd3build],[yes])],
+ mym4_buildtype,[vsd],[m4_define([mym4_isvsd],[yes])],
+ mym4_buildtype,[gpd],[m4_define([mym4_isvsd],[yes])
+ m4_define([mym4_isgpd],[yes])])
+
+# For VSD with GnuPG 2.2 we use version 3.x
+# For VSD with GnuPG 2.6 we use version 4.x
# For GPD and Gpg4win with GnuPG 2.6 we use version 5.x
-m4_if(mym4_buildtype,vsd,
+# Note that the versions numbers are set for the next release. Right
+# after the replease they are bumped up for the next release.
+m4_if(mym4_buildtype,[vsd3],
+ [m4_define([mym4_major],[3])
+ m4_define([mym4_minor],[4])
+ m4_define([mym4_micro],[0])],
+ 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])])
-
+ m4_define([mym4_micro],[2])])
# 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
+IS_VSD3_BUILD=mym4_isvsd3build
+MSI_VERSIONSTRING=mym4_major.mym4_minor.m4_if(mym4_isbeta,[yes],[90],mym4_micro)
+
# 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(IS_VSD3_BUILD)
+AC_SUBST(MSI_VERSIONSTRING)
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:'])
+# The next two macro proive --enable-gpg4win and --enable-appimage
+# configure options and store them in $build_gpg4win or $build_appimage.
+# These options are used by autogen.rc
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
+posrcdir=/src/po
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_KDEPKG([libqrencode])
# poppler requires tiff >= 4.3
APPIMAGE_KDEPKG([tiff])
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 kguiaddons kwindowsystem])
APPIMAGE_SPKG([gpgme], [libgpg-error libassuan])
APPIMAGE_KDEPKG([gpgmepp], [gpgme])
APPIMAGE_KDEPKG([qgpgme], [gpgmepp qtbase])
APPIMAGE_SPKG([paperkey])
# Qt related stuff.
APPIMAGE_KDEPKG([qtbase], [freetype xcb-util-cursor])
APPIMAGE_KDEPKG([qttools], [qtbase])
APPIMAGE_KDEPKG([qttranslations], [qtsvg qttools])
APPIMAGE_KDEPKG([qtsvg], [qtbase])
APPIMAGE_KDEPKG([qtwayland], [qtbase])
APPIMAGE_KDEPKG([wayland-protocols])
APPIMAGE_KDEPKG([plasma-wayland-protocols], [wayland-protocols extra-cmake-modules])
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 qgpgme breeze-icons kio kxmlgui libkleo kitemmodels qttranslations kdbusaddons kstatusnotifieritem])
# Okular/Poppler
APPIMAGE_KDEPKG([poppler], [gpgmepp kio qtbase freetype tiff])
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
+ MSI version ..: ${MSI_VERSIONSTRING}
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/packages/download.sh b/packages/download.sh
index da15cde4..0827e301 100755
--- a/packages/download.sh
+++ b/packages/download.sh
@@ -1,339 +1,347 @@
#!/bin/sh
# download.sh - Download source and binary packages for GPG4Win.
# Copyright (C) 2005, 2007 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, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
# Syntax of the packages.current file:
#
# If the first non whitespace character of a line is #, the line is
# considered a comment. If the first word of a line is "server", the
# rest of the line will be taken as the base URL for following file
# commands. If the first word of a line is "file" the rest of the
# line will be appended to the current base URL (with a / as
# delimiter). Checksums are sha256 sums.
#
# A simple conditionals mechanism is impleted using the keywords if
# and fi with the operators = and !=.
#
# Example:
#
# # GnuPG stuff.
# server ftp://ftp.gnupg.org/gcrypt
#
# file gnupg/gnupg-1.4.2.tar.gz
# chk 1e92b39ef4f4cdf3b1849b6f824dd8f160276aa5c9718be35f8a7bd190bf6154
#
usage()
{
cat <<EOF
Usage: $0 [OPTIONS]
Options:
[--force] Download packages even if they exist.
[--quiet]
[--ipv4]
[--ipv6]
[--dry-run] Do not download - just check
[--clean] Do not download but remove downloaded files.
[--update] Remove old files with the same name.
- [--gnupg22] Build using GnuPG 2.2
- [--gnupg26] Build using GnuPG 2.6 (default)
EOF
exit $1
}
force=no
quiet=no
ipvx=
clean=no
dryrun=no
update=no
-gnupgtag=gnupg26
+gnupgtag=
#keep_list=no
#sig_check=yes
while [ $# -gt 0 ]; do
case "$1" in
--*=*)
optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'`
;;
*)
optarg=""
;;
esac
case $1 in
--force)
force=yes
;;
--keep-list)
# Now a dummy
# keep_list=yes
;;
--no-sig-check)
# Now a dummy
sig_check=no
;;
--quiet)
quiet=yes
;;
--ipv4)
ipvx="-4"
;;
--ipv6)
ipvx="-6"
;;
--clean)
clean=yes
;;
--dry-run|-n)
dryrun=yes
;;
--update|-u)
update=yes
;;
- --gnupg22)
- gnupgtag=gnupg22
- ;;
- --gnupg26)
- gnupgtag=gnupg26
- ;;
*)
usage 1 1>&2
;;
esac
shift
done
WGET="wget $ipvx"
# We used to download the packages.current list but it turned out that
# this is too problematic: As there is no history of these files it is
# not possible to build and older version of gpg4win using the online
# version of the list. Thus we keep the list now with the installer
# and in case a package update is required we will post an updated
# list to the mailing list.
#
#url="http://www.gpg4win.org"
#if [ "$keep_list" = "no" ]; then
# echo "downloading packages list from \`$url'."
# if ! ${WGET} -N -q $url/packages.current{,.sig} ; then
# echo "download of packages list failed." >&2
# exit 1
# fi
#fi
#
#if [ "$sig_ckeck" = yes ]; then
# if ! gpgv --keyring ./packages.keys packages.current.sig packages.current
# then
# echo "list of packages is not usable." >&2
# exit 1
# fi
#fi
packages="packages.list"
+buildtype="$(head -1 ./BUILDTYPE 2>/dev/null|| echo default)"
+[ "$buildtype" = default ] && buildtype=gpg4win
+case "$buildtype" in
+ vsd3) gnupgtag=gnupg22 ;;
+ vsd) gnupgtag=gnupg26 ;;
+ gpd) gnupgtag=gnupg26 ;;
+ gpg4win|default) gnupgtag=gnupg26 ;;
+ *)
+ echo "No valid BUILDTYPE file" >&2
+ echo "Put vsd3, vsd, gpd or gpg4win into ./BUILDTYPE" >&2
+ exit 1
+ ;;
+esac
+echo "configured for \"$buildtype\"" >&2
+
+
actually_downloaded=
lnr=0
name=
condfalse=
[ $clean = yes ] && rm -f '.#download.v*'
[ -f '.#download.failed' ] && rm '.#download.failed'
[ -f '.#download.worked' ] && rm '.#download.worked'
[ -f '.#download.current_packages' ] && rm '.#download.current_packages'
[ -f '.#download.stale_packages' ] && rm '.#download.stale_packages'
cat $packages | \
while read key value valuetwo valuethree; do
: $(( lnr = lnr + 1 ))/read
[ -z "$key" ] && continue
if [ "$key" = "fi" ]; then
condfalse=
key="#"
fi
[ -n "$condfalse" ] && continue
case "$key" in
\#*)
;;
"if")
if [ "$value" = "gnupg" -a "$valuetwo" = "=" ]; then
if [ "$valuethree" != "$gnupgtag" ]; then
condfalse=yes
fi
elif [ "$value" = "gnupg" -a "$valuetwo" = "!=" ]; then
if [ "$valuethree" = "$gnupgtag" ]; then
condfalse=yes
fi
fi
;;
server)
server="$value"
name=
;;
name)
if [ -z "$value" ]; then
echo "syntax error in name statement, line $lnr" >&2
exit 1
fi
name="$value"
[ $quiet = no ] && echo "using name \`$name'"
;;
file)
if [ -z "$value" ]; then
echo "syntax error in file statement, line $lnr" >&2
exit 1
fi
if [ -z "$server" ]; then
echo "no server location for file \`$value', line $lnr" >&2
exit 1
fi
url="$server/$value"
if [ -z "$name" ]; then
name=`basename "$value"`
fi
echo "$name" >> '.#download.current_packages'
if [ "$clean" = "yes" ]; then
[ $quiet = no ] && echo "Removing: $name"
rm -f $name
elif [ -s "$name" -a "$force" = "no" ]; then
[ $quiet = no ] && echo "package \`$url' ... already exists"
elif [ $dryrun = yes ]; then
echo "skipping download of \`$url' ... --dry-run active"
else
if [ "$update" = "yes" ]; then
pkg=$(echo "$name" | cut -d- -f1)
pkg2=$(echo "$name" | cut -d- -f2)
if [ "$pkg2" = "w32" -o "$pkg2" = "msi" -o "$pkg2" = "icons" ]; then
pkg=$(echo $pkg-$pkg2);
fi
pkgsuffix=$(echo "$name" | rev | cut -d. -f1 | rev)
if [ -n "$pkg" -a -n "$pkgsuffix" ]; then
if ls ${pkg}*.$pkgsuffix > /dev/null 2>&1; then
[ $quiet = no ] && echo "Removing "${pkg}*.$pkgsuffix";"
rm ${pkg}*.$pkgsuffix;
fi
fi
fi
echo -n "downloading \`$url' ..."
if ${WGET} -c -q "$url" -O "$name" ; then
if [ $(stat -c'%s' "$name" 2>/dev/null || echo 0) -eq 0 ]; then
echo " FAILED (line $lnr)"
echo "line $lnr: $url has zero length" >> '.#download.failed'
else
echo " okay"
echo "$url" >> '.#download.worked'
fi
else
echo " FAILED (line $lnr)"
echo "line $lnr: downloading $url failed" >> '.#download.failed'
fi
fi
;;
link)
if [ -z "$value" ]; then
echo "syntax error in file statement, line $lnr" >&2
exit 1
fi
if [ -z "$name" ]; then
echo "no name for link in line $lnr" >&2
exit 1
fi
echo "$value" >> '.#download.current_packages'
if [ $clean = yes ]; then
[ $quiet = no ] && echo "Removing link: $value"
rm -f $value
elif [ -f "$value" -a "$force" = "no" ]; then
[ $quiet = no ] && echo "package \`$value' ... already exists"
else
if [ "$update" = "yes" ]; then
pkg=$(echo "$value" | cut -d- -f1)
pkg2=$(echo "$value" | cut -d- -f2)
if [ "$pkg2" = "w32" -o "$pkg2" = "msi" -o "$pkg2" = "icons" ]; then
pkg=$(echo $pkg-$pkg2);
fi
pkgsuffix=$(echo "$name" | rev | cut -d. -f1 | rev)
if [ -n "$pkg" -a -n "$pkgsuffix" ]; then
if ls ${pkg}*.$pkgsuffix > /dev/null 2>&1; then
[ $quiet = no ] && echo "Removing link "${pkg}*.$pkgsuffix";"
rm ${pkg}*.$pkgsuffix;
fi
fi
fi
echo -n "linking \`$value' to \`$name' ..."
if ln -f "$name" "$value"; then
echo " okay"
else
echo " FAILED (line $lnr)"
echo "line $lnr: linking $value failed" >> '.#download.failed'
fi
fi
;;
chk)
if [ $clean = yes ]; then
name=
continue
fi
if [ -z "$value" ]; then
echo "syntax error in chk statement, line $lnr" >&2
exit 1
fi
if [ -z "$name" ]; then
echo "no file name for chk statement, line $lnr" >&2
exit 1
fi
[ $quiet = no ] && echo -n "checking \`$name' ..."
if echo "$value *$name" | sha256sum -c --status ; then
[ $quiet = no ] && echo " okay"
else
[ $quiet = no ] && echo " FAILED (line $lnr)"
[ $quiet = no ] || echo "checking \`$name' FAILED (line $lnr)"
echo "line $lnr: checking $name failed" >> '.#download.failed'
fi
name=
;;
*)
echo "syntax error in \`$packages', line $lnr." >&2
exit 1
esac
done
[ $dryrun = yes ] && echo "Note: option --dry-run was used" >&2
if [ -f '.#download.worked' ]; then
echo "Actually downloaded files:" >&2
cat '.#download.worked' >&2
fi
if [ -f '.#download.failed' ]; then
cat '.#download.failed' >&2
rm '.#download.failed'
echo "some files failed to download or checksums are not matching" >&2
exit 1
fi
# check for stale packages
for p in $(ls *.xz *.gz *.bz2 *.wixlib *.exe *.zip); do
if ! grep -q $p '.#download.current_packages'; then
echo "rm $p" >> '.#download.stale_packages'
fi
done
if [ -f '.#download.stale_packages' ]; then
echo "Warning: Stale packages were found. Remove them with" >&2
cat '.#download.stale_packages' >&2
fi

File Metadata

Mime Type
text/x-diff
Expires
Thu, Feb 26, 7:06 PM (16 h, 34 m)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
89/9c/eecef9c9b2e4da4c37d365bbdd01

Event Timeline