[Gpg4win-commits] [git] Gpg4win - branch, KDE/4.10-update, updated. gpg4win-2.1.0-129-gbf86cd6
by Andre Heinecke
cvs at cvs.gnupg.org
Mon Apr 22 17:42:30 CEST 2013
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GnuPG for Windows".
The branch, KDE/4.10-update has been updated
via bf86cd6d810babe772c758619289f58feed7003d (commit)
from 6255937901e1ef2204223689bd4e010ccc4c7604 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit bf86cd6d810babe772c758619289f58feed7003d
Author: Andre Heinecke <aheinecke at intevation.de>
Date: Mon Apr 22 17:20:30 2013 +0200
Add KDE build scripts for gpg4win
Those scripts were originally developed in the KDE svn
for the history see:
http://websvn.kde.org/branches/work/gpg4win/scripts/
Authors are credited in the README file.
* KDE/00-root-setup.sh, KDE/01-user-setup.sh,
KDE/02-update-gpg4win.sh, KDE/02-update-kde.sh, KDE/02-update-qt.sh
KDE/10-build-installer-stage1.sh, KDE/10-build-qt.sh,
KDE/12-build-kdelibs.sh, KDE/13-build-kdepim.sh, KDE/20-package-kdelibs.sh
KDE/21-package-kdepim.sh, KDE/30-build-installer-stage2.sh,
KDE/README, KDE/Toolchain-mingw32.cmake, KDE/config, KDE/functions,
KDE/make-all.sh, KDE/mingw32-kdelibs.cmake, KDE/pc-tools: New.
diff --git a/build-aux/KDE/00-root-setup.sh b/build-aux/KDE/00-root-setup.sh
new file mode 100755
index 0000000..3a82e5c
--- /dev/null
+++ b/build-aux/KDE/00-root-setup.sh
@@ -0,0 +1,77 @@
+#!/bin/bash
+
+[ "$USER" = root ] || die "Please run $0 as root (or with sudo)."
+
+if [ -f "$(dirname "$0")/functions" ] ; then
+ source "$(dirname "$0")/functions"
+else
+ echo "Couldn't find function library (expected in $(dirname "$0")/functions)" 1>&2
+ exit 1
+fi
+
+load config "configuration file"
+
+# my apt-get doesn't work with these...
+unset http_proxy
+unset ftp_proxy
+
+if [ -n "$APT_RELEASE" ]; then
+ if ! grep -q $APT_RELEASE $APT_SOURCES_LIST ; then
+ ask "Required $APT_RELEASE is not in $APT_SOURCES_LIST. Add?" \
+ || die "Ok, add it yourself, then re-run this script."
+ msg -n "Adding $APT_RELEASE to your ${APT_SOURCES_LIST}..."
+ echo "deb http://www.backports.org/debian $APT_RELEASE main contrib non-free" >> "$APT_SOURCES_LIST" \
+ || die "Couldn't write to $APT_SOURCES_LIST"
+ msg done
+ fi
+fi
+
+UNPINNED_PKGS=
+for pkg in $BACKPORTED_TOOLCHAIN ; do
+ if ! grep -qE "^Package:\\s*$pkg" $APT_PREFERENCES ; then
+ UNPINNED_PKGS="$UNPINNED_PKGS $pkg"
+ fi
+done
+APT_GET_INSTALL_ARGS=
+if [ -n "$UNPINNED_PKGS" ] ; then
+ if ask "The following required packages from $APT_RELEASE are not pinned in $APT_PREFERENCES:
+ $UNPINNED_PKGS
+This is perfectly fine, but pinning is recommended, lest old versions overwrite new ones.
+Pin above packages?" ; then
+ for pkg in $UNPINNED_PKGS ; do
+ cat >> "$APT_PREFERENCES" <<EOF
+
+Package: $pkg
+Pin: release a=$APT_RELEASE
+Pin-Priority: 999
+EOF
+ done
+ else
+ APT_GET_INSTALL_ARGS="-t $APT_RELEASE"
+ msg "Ok, no problem. Will only install them with apt-get install -t, then."
+ fi
+fi
+
+run "Running apt-get update" apt-get update --yes
+run "Installing installer toolchain: $INSTALLER_TOOLCHAIN" apt-get install --yes $INSTALLER_TOOLCHAIN
+if [ -n "$INSTALLER_TOOLCHAIN2" ] ; then
+ run "Installing additional toolchain packages: $INSTALLER_TOOLCHAIN2" apt-get install --yes $APT_GET_INSTALL_ARGS $INSTALLER_TOOLCHAIN2
+fi
+if [ -n "$BACKPORTED_TOOLCHAIN" ] ; then
+ run "Installing additional packages from $APT_RELEASE: $BACKPORTED_TOOLCHAIN" apt-get install --yes $APT_GET_INSTALL_ARGS $BACKPORTED_TOOLCHAIN
+fi
+if $USE_SQUID ; then
+ run "Installing squid" apt-get install --yes squid
+ msg "Adjusting the maximum cached object size..."
+ [ -f /etc/squid/squid.conf ] || die "/etc/squid/squid.conf not found"
+ echo "maximum_object_size $((256*1024)) KB" >> /etc/squid/squid.conf
+ echo "cache_dir ufs /var/spool/squid ${SQUID_MAX_DISK_USAGE} 16 256" >> /etc/squid/squid.conf
+ msg done
+ run "Restarting squid" /etc/init.d/squid restart
+fi
+
+cd "$(dirname "$ICECREAM_LOCAL")" || die "Failed to change into $(dirname "$ICECREAM_LOCAL")"
+run "Downloading icecream environment: $ICECREAM_WEB -> $ICECREAM_LOCAL" wget -N "$ICECREAM_WEB"
+cd - >/dev/null 2>&1 || die "Failed to change back from $(dirname "$ICECREAM_LOCAL")"
+msg "
+Ok, your build environment has been successfully created."
diff --git a/build-aux/KDE/01-user-setup.sh b/build-aux/KDE/01-user-setup.sh
new file mode 100755
index 0000000..e54d545
--- /dev/null
+++ b/build-aux/KDE/01-user-setup.sh
@@ -0,0 +1,30 @@
+#!/bin/bash
+
+if [ -f "$(dirname "$0")/functions" ] ; then
+ source "$(dirname "$0")/functions"
+else
+ echo "Couldn't find function library (expected in $(dirname "$0")/functions)" 1>&2
+ exit 1
+fi
+
+load config "configuration file"
+
+if [ -x /usr/lib/icecc/bin/gcc -a -x /usr/lib/icecc/bin/g++ -a -r "$ICECREAM_LOCAL" ] ; then
+ msg -n "Found usable icecream, hooking up..."
+ cd_mk_or_die "$TOOLSDIR/bin"
+ for cc in gcc g++ ; do
+ rm -f i586-mingw32msvc-$cc
+ cat > i586-mingw32msvc-$cc <<EOF || die "Cannot create bin/i586-mingw32msvc-$cc"
+#!/bin/bash
+ICECC_CC=i586-mingw32msvc-gcc
+ICECC_CXX=i586-mingw32msvc-g++
+ICECC_VERSION="i386:$ICECREAM_LOCAL,x86_64:$ICECREAM_LOCAL"
+export ICECC_CC
+export ICECC_CXX
+export ICECC_VERSION
+exec /usr/lib/icecc/bin/$cc "\$@"
+EOF
+ chmod a+x i586-mingw32msvc-$cc || die "Cannot chmod bin/i586-mingw32msvc-$cc"
+ done
+ msg done
+fi
diff --git a/build-aux/KDE/02-update-gpg4win.sh b/build-aux/KDE/02-update-gpg4win.sh
new file mode 100755
index 0000000..128dab2
--- /dev/null
+++ b/build-aux/KDE/02-update-gpg4win.sh
@@ -0,0 +1,33 @@
+#!/bin/bash
+
+if [ -f "$(dirname "$0")/functions" ] ; then
+ source "$(dirname "$0")/functions"
+else
+ echo "Couldn't find function library (expected in $(dirname "$0")/functions)" 1>&2
+ exit 1
+fi
+
+load config "configuration file"
+
+cs
+
+check_git gpg4win-src "$GPG4WIN_GIT" KDE/4.10-update
+
+[ -d gpg4win-src ] || die "Expected checkout directory (gpg4win-src) does not exist"
+[ -d gpg4win-src/packages ] || die "Expected packages directory (gpg4win-src/packages) does not exist"
+cd gpg4win-src/packages || die "Cannot change into gpg4win-src/packages"
+[ -f download.sh ] || die "Expected download script (gpg4win-src/packages/download.sh) does not exist"
+
+#if $USE_SQUID ; then
+# run "Removing all downloaded packages (you're using squid)" rm -rf *.zip *.tar.gz *.tar.bz2
+#fi
+
+# massage packages.current so download.sh skips the kdelibs stuff (which we're going to create in the first place)
+[ -f packages.current.saved ] && die "A temporary file (gpg4win-src/packages/packages.current.saved) is left from on unfinished job. Please remove this first"
+[ -f packages.current ] || die "Expected packages listing (gpg4win-src/packages/packages.current) does not exist"
+N=$(grep -Enm1 "^# kdelibs" packages.current | cut -d: -f1) || die "Package listing (gpg4win-src/packages/packages.current) does not contain expected line \"# kdelibs\""
+mv packages.current{,.saved} || die "Couldn't move packages.current -> packages.current.saved"
+head -$((N-1)) packages.current.saved > packages.current || die "Couldn't extract the first $((N-1)) lines from packages.current.saved -> packages.current"
+run "Downloading packages (without kdelibs and up) -> gpg4win-src/packages
+ this might take a while" bash ./download.sh
+mv packages.current{.saved,}
diff --git a/build-aux/KDE/02-update-kde.sh b/build-aux/KDE/02-update-kde.sh
new file mode 100755
index 0000000..359d336
--- /dev/null
+++ b/build-aux/KDE/02-update-kde.sh
@@ -0,0 +1,224 @@
+#!/bin/bash
+
+if [ -f "$(dirname "$0")/functions" ] ; then
+ source "$(dirname "$0")/functions"
+else
+ echo "Couldn't find function library (expected in $(dirname "$0")/functions)" 1>&2
+ exit 1
+fi
+
+load config "configuration file"
+
+cs
+
+#
+# kdewin32
+#
+
+if $KDEWIN32_CROSSCOMPILE || $KDEWIN32_PNG2ICO_ONLY ; then
+ if $KDEWIN32_USE_SVN ; then
+ if [ -z $KDEWIN32_REVISION ] ; then
+ run "Checking out kdewin32" svn co "$KDESVN/trunk/kdesupport/kdewin32"
+ else
+ run "Checking out kdewin32" svn co "$KDESVN/trunk/kdesupport/kdewin32" -r$KDEWIN32_REVISION
+ fi
+ else
+ run "Downloading kdewin32 source" wget -N "$KDEWIN32_SRC_URL"
+ rm -rf kdewin32 >/dev/null 2>&1
+ run "Extracing" extract kdewin32*
+ for i in $(ls -d1 kdewin32*|tac) ; do
+ if [ -d "$i" ] ; then
+ mv "$i" kdewin32
+ break;
+ fi
+ done
+ rm -rf kdewin32?* >/dev/null 2>&1
+ fi
+else
+ die "Sorry, binary kdewin32 package download is not yet implemented"
+fi
+
+[ -d kdewin32 ] || die "Cannot find directory kdewin32 after unpacking"
+
+
+#
+# automoc
+#
+
+#if $AUTOMOC_CROSSCOMPILE ; then
+ if $AUTOMOC_USE_SVN ; then
+ check_git automoc "$AUTOMOC_GIT_URL" "$AUTOMOC_GIT_BRANCH"
+ if [ -z $AUTOMOC_REVISION ] ; then
+ cd automoc && git checkout $AUTOMOC_REVISION && cd ..
+ fi
+ else
+ run "Downloading automoc source" wget -N "$AUTOMOC_SRC_URL"
+ rm -rf automoc >/dev/null 2>&1
+ run "Extracing" extract automoc*
+ for i in $(ls -d1 automoc*|tac) ; do
+ if [ -d "$i" ] ; then
+ mv "$i" automoc
+ break;
+ fi
+ done
+ rm -rf automoc?* >/dev/null 2>&1
+ fi
+#else
+# die "Sorry, binary automoc package download is not yet implemented"
+#fi
+
+[ -d automoc ] || die "Cannot find directory automoc after unpacking"
+
+#
+# kdelibs
+#
+
+if $KDELIBS_CROSSCOMPILE ; then
+ if $KDELIBS_USE_GIT ; then
+ if [ -z $KDELIBS_REVISION ] ; then
+ check_git kdelibs "$KDELIBS_GIT_URL" "$KDELIBS_GIT_BRANCH"
+ else
+ cd kdepimlibs && git checkout $KDELIBS_REVISION && cd ..
+ fi
+ else
+ run "Downloading kdelibs source" wget -N "$KDELIBS_SRC_URL"
+ rm -rf kdelibs >/dev/null 2>&1
+ run "Extracing" extract kdelibs*
+ for i in $(ls -d1 kdelibs*|tac) ; do
+ if [ -d "$i" ] ; then
+ mv "$i" kdelibs
+ break;
+ fi
+ done
+ rm -rf kdelibs?* >/dev/null 2>&1
+ fi
+else
+ die "Sorry, binary kdelibs package download is not yet implemented"
+fi
+
+[ -d kdelibs ] || die "Cannot find directory kdelibs after unpacking"
+
+#
+# kdepimlibs
+#
+
+if $KDEPIMLIBS_CROSSCOMPILE ; then
+ if $KDEPIMLIBS_USE_GIT ; then
+ if [ -z $KDEPIMLIBS_REVISION ] ; then
+ check_git kdepimlibs "$KDEPIMLIBS_GIT_URL" "$KDEPIMLIBS_GIT_BRANCH"
+ else
+ cd kdepimlibs && git checkout $KDEPIMLIBS_REVISION && cd ..
+ fi
+ else
+ run "Downloading kdepimlibs source" wget -N "$KDEPIMLIBS_SRC_URL"
+ rm -rf kdepimlibs >/dev/null 2>&1
+ run "Extracing" extract kdepimlibs*
+ for i in $(ls -d1 kdepimlibs*|tac) ; do
+ if [ -d "$i" ] ; then
+ mv "$i" kdepimlibs
+ break;
+ fi
+ done
+ rm -rf kdepimlibs?* >/dev/null 2>&1
+ fi
+else
+ die "Sorry, binary kdepimlibs package download is not yet implemented"
+fi
+
+[ -d kdepimlibs ] || die "Cannot find directory kdepimlibs after unpacking"
+
+#
+# kde-runtime
+#
+
+if $KDE_RUNTIME_CROSSCOMPILE ; then
+ if $KDE_RUNTIME_USE_SVN ; then
+ if [ -z $KDE_RUNTIME_REVISION ] ; then
+ check_git kde-runtime "$KDE_RUNTIME_GIT_URL" "$KDE_RUNTIME_GIT_BRANCH"
+ else
+ cd kde-runtime && git checkout $KDEPIMLIBS_REVISION && cd ..
+ fi
+ else
+ run "Downloading kdebase-runtime source" wget -N "$KDE_RUNTIME_SRC_URL"
+ rm -rf kdebase-runtime >/dev/null 2>&1
+ run "Extracing" extract kdebase-runtime*
+ for i in $(ls -d1 kdebase-runtime*|tac) ; do
+ if [ -d "$i" ] ; then
+ mv "$i" kdebase-runtime
+ break;
+ fi
+ done
+ rm -rf kdebase-runtime?* >/dev/null 2>&1
+ fi
+else
+ die "Sorry, binary kde-runtime package download is not yet implemented"
+fi
+
+[ -d kde-runtime ] || die "Cannot find directory kdebase-runtime after unpacking"
+
+#
+# kdepim
+#
+
+if $KDEPIM_CROSSCOMPILE ; then
+ if $KDEPIM_USE_GIT; then
+ if [ -z $KDEPIM_REVISION ] ; then
+ check_git kdepim "$KDEPIM_GIT_URL" "$KDEPIM_GIT_BRANCH"
+ else
+ cd kdepim && git checkout $KDEPIM_REVISION && cd ..
+ fi
+ else
+ run "Downloading kdepim source" wget -N "$KDEPIM_SRC_URL"
+ rm -rf kdepim >/dev/null 2>&1
+ run "Extracing" extract kdepim*
+ for i in $(ls -d1 kdepim*|tac) ; do
+ if [ -d "$i" ] ; then
+ mv "$i" kdepim
+ break;
+ fi
+ done
+ rm -rf kdepim?* >/dev/null 2>&1
+ fi
+else
+ die "Sorry, binary kdepim package download is not yet implemented"
+fi
+
+[ -d kdepim ] || die "Cannot find directory kdepim after unpacking"
+
+#
+# l10n-kde4
+#
+if $L10N_KDE4_USE_SVN ; then
+ if [ -z $L10N_KDE4_REVISION ] ; then
+ SVN_ARGS=
+ else
+ SVN_ARGS=-r$L10N_KDE4_REVISION
+ fi
+ if [ -d l10n-kde4 ] ; then
+ OP=up
+ else
+ OP=co
+ fi
+ run "Checking out l10n-kde4" svn $OP $SVN_ARGS $SVN_NON_RECURSIVE "$L10N_KDE4_SVN_URL" l10n-kde4
+ cd_or_die l10n-kde4
+ run "Checking out l10n-kde4 subdirs, pt.1" svn up $SVN_ARGS $SVN_NON_RECURSIVE "${L10N_KDE4_SVN_URL_SUB_N[@]}"
+ run "Checking out l10n-kde4 subdirs, pt.2" svn up $SVN_ARGS "${L10N_KDE4_SVN_URL_SUB[@]}"
+ [ -d scripts -a -x scripts/autogen.sh ] || die "Cannot find directory l10n-kde4/scripts/autogen.sh after unpacking"
+ run "Creating subdir build files" ./scripts/autogen.sh
+ cs
+else
+ run "Downloading l10n-kde4 source" wget -N "$L10N_KDE4_SRC_URL"
+ rm -rf l10n-kde4 >/dev/null 2>&1
+ run "Extracing" extract l10n-kde4*
+ for i in $(ls -d1 l10n-kde4*|tac) ; do
+ if [ -d "$i" ] ; then
+ mv "$i" l10n-kde4
+ break;
+ fi
+ done
+ rm -rf l10n-kde4?* >/dev/null 2>&1
+fi
+
+[ -d l10n-kde4 ] || die "Cannot find directory l10n-kde4 after unpacking"
+[ -f l10n-kde4/subdirs ] || die "Cannot find file l10n-kde4/subdirs after unpacking"
+
diff --git a/build-aux/KDE/02-update-qt.sh b/build-aux/KDE/02-update-qt.sh
new file mode 100755
index 0000000..e6a58d0
--- /dev/null
+++ b/build-aux/KDE/02-update-qt.sh
@@ -0,0 +1,28 @@
+#!/bin/bash
+
+if [ -f "$(dirname "$0")/functions" ] ; then
+ source "$(dirname "$0")/functions"
+else
+ echo "Couldn't find function library (expected in $(dirname "$0")/functions)" 1>&2
+ exit 1
+fi
+
+load config "configuration file"
+
+cs
+
+if [ ! -d "$QT_SRC" ] ; then
+ DIR="$(dirname "$QT_SRC")"
+ cd "$DIR" || die "Cannot change into $DIR"
+ run "Downloading Qt (250M+, might take a while)" wget -N "$QT_WEB"
+ case "$QT_LOCAL" in
+ *.bz2) UNZIP=j;;
+ *.gz) UNZIP=z ;;
+ *) die "Cannot detect compression used to pack $QT_LOCAL" ;;
+ esac
+ checksha1 $QT_LOCAL $QT_SHA1
+ run "Unpacking $QT_LOCAL -> $QT_BASENAME" tar xf${UNZIP}v "$QT_LOCAL"
+ cd - >/dev/null 2>&1 || die "Cannot change back from $SRCDIR to $OLDPWD"
+fi
+
+[ -d "$QT_SRC" ] || die "Expected Qt source directory $QT_SRC not found"
diff --git a/build-aux/KDE/10-build-installer-stage1.sh b/build-aux/KDE/10-build-installer-stage1.sh
new file mode 100755
index 0000000..b3fde24
--- /dev/null
+++ b/build-aux/KDE/10-build-installer-stage1.sh
@@ -0,0 +1,54 @@
+#!/bin/bash
+
+if [ -f "$(dirname "$0")/functions" ] ; then
+ source "$(dirname "$0")/functions"
+else
+ echo "Couldn't find function library (expected in $(dirname "$0")/functions)" 1>&2
+ exit 1
+fi
+
+load config "configuration file"
+
+[ -d "$GPG4WIN_SRC" ] || die "Did not find gpg4win source code in $GPG4WIN_SRC"
+cd_or_die "$GPG4WIN_SRC"
+run "Running autogen.sh --force" ./autogen.sh --force
+[ -d "$STAGE1_BUILD" ] || mkdir -p -- "$STAGE1_BUILD" || die "Failed to make directory $STAGE1_BUILD"
+rm -rf "$STAGE1_BUILD" || die "Failed to remove stale build dir $STAGE1_BUILD"
+
+if $INSTALLER_OUT_OF_SRC_BUILD ; then
+ msg -n "Setting up out-of-source build..."
+ cd_mk_or_die "$STAGE1_BUILD"
+ ln -s "$GPG4WIN_SRC/packages" . || die "Failed to link $GPG4WIN_SRC/packages -> $STAGE1_BUILD/packages"
+ CONFIGURE="$GPG4WIN_SRC/configure"
+ msg done
+else
+ msg -n "Setting up in-source build..."
+ cp -la "$GPG4WIN_SRC" "$STAGE1_BUILD" || die "Failed to hard-link-copy $GPG4WIN_SRC -> $STAGE1_BUILD"
+ cd_or_die "$STAGE1_BUILD"
+ CONFIGURE="./configure"
+ msg done
+fi
+
+[ -f Makefile ] && run "Found Makefile, trying distclean'ing" make -j1 distclean
+
+STAGE1_OMIT_FLAGS="--disable-source-installer --disable-light-installer --enable-fast-nsis"
+for pkg in $STAGE1_OMIT ; do
+ STAGE1_OMIT_FLAGS="$STAGE1_OMIT_FLAGS --disable-pkg-$pkg"
+done
+
+SAVED_PATH="$PATH"
+export PATH="${TOOLSDIR}/bin:$PATH"
+run "stage 1: configuring" "$CONFIGURE" --enable-maintainer-mode \
+ --host=i586-mingw32msvc $STAGE1_OMIT_FLAGS
+export GPG4WIN_PARALLEL="$MAKEFLAGS"
+unset MAKEFLAGS
+run "stage 1: compiling" $NICENESS make
+export MAKEFLAGS="$GPG4WIN_PARALLEL"
+export PATH="$SAVED_PATH"
+
+cd_or_die src/playground/install
+run "stage 1: extracting kdesupport-dev into stage-1 install" extract "$GPG4WIN_SRC"/packages/kdesupport-*-dev.*
+
+msg "Congratulations, stage-1 build completed successfully.
+Next steps:
+ - cross-compile KDE"
diff --git a/build-aux/KDE/10-build-qt.sh b/build-aux/KDE/10-build-qt.sh
new file mode 100755
index 0000000..7ee27d0
--- /dev/null
+++ b/build-aux/KDE/10-build-qt.sh
@@ -0,0 +1,36 @@
+#!/bin/bash
+
+if [ -f "$(dirname "$0")/functions" ] ; then
+ source "$(dirname "$0")/functions"
+else
+ echo "Couldn't find function library (expected in $(dirname "$0")/functions)" 1>&2
+ exit 1
+fi
+
+load config "configuration file"
+
+[ -d "$QT_SRC" ] || die "Expected Qt source directory $QT_SRC not found"
+
+rm -rf "$QT_NATIVE_BUILD"
+
+cd_mk_or_die "$QT_NATIVE_BUILD"
+
+QT_FLAGS_ACTUAL="$QT_NATIVE_FLAGS -make libs -make tools -prefix $PWD -no-pch"
+
+if [ "`dpkg-architecture -qDEB_HOST_ARCH`" = "i386" ]; then
+ QT_FLAGS_ACTUAL="$QT_FLAGS_ACTUAL -platform linux-g++-32"
+fi
+
+for i in $QT_NATIVE_EXCLUDE ; do
+ QT_FLAGS_ACTUAL="$QT_FLAGS_ACTUAL -no-$i"
+done
+for i in $QT_NATIVE_SYSTEM ; do
+ QT_FLAGS_ACTUAL="$QT_FLAGS_ACTUAL -system-$i"
+done
+
+cd $QT_SRC
+
+echo yes | run "Configuring native Qt build" "./configure" $QT_FLAGS_ACTUAL
+
+run "Building minimal native Qt" $NICENESS make -j$MAKE_JOBS
+cd $(dirname "$0")
diff --git a/build-aux/KDE/12-build-kdelibs.sh b/build-aux/KDE/12-build-kdelibs.sh
new file mode 100755
index 0000000..654b317
--- /dev/null
+++ b/build-aux/KDE/12-build-kdelibs.sh
@@ -0,0 +1,163 @@
+#!/bin/bash
+
+if [ -f "$(dirname "$0")/functions" ] ; then
+ source "$(dirname "$0")/functions"
+else
+ echo "Couldn't find function library (expected in $(dirname "$0")/functions)" 1>&2
+ exit 1
+fi
+
+load config "configuration file"
+
+export LD_LIBRARY_PATH="$QT_NATIVE_BUILD/lib:$LD_LIBRARY_PATH"
+
+readonly INST="$BUILDDIR/kdelibs-install"
+
+cs
+
+cd_or_die l10n-kde4
+
+declare -a LANGS
+for lang in $(cat subdirs) ; do
+ if [ -d $lang ] ; then
+ LANGS=("${LANGS[@]}" "$lang")
+ fi
+done
+[ ${#LANGS[*]} -gt 0 ] || die "No languages found in l10n-kde4"
+
+cb
+
+run "Preparing clean build" rm -rf kdewin32 kdewin32-tools kdelibs-install/* automoc/* kdelibs/* kdelibs-native/* l10n-kde4/*
+
+# kdewin32 (cross)
+if $KDEWIN32_CROSSCOMPILE && ! $KDEWIN32_PNG2ICO_ONLY ; then
+(
+ cd_mk_or_die kdewin32
+
+ export PATH="$TOOLSDIR/bin:$PATH"
+
+ # need to run this twice, for some reason
+ msg -n "Configuring kdewin32, 1st try..."
+ ( xcmake \
+ -DCMAKE_INSTALL_PREFIX="$STAGE1_BUILD/src/playground/install" "$SRCDIR/kdewin32" ) >/dev/null 2>&1
+ msg done
+ run "Configuring kdewin32, 2nd try" xcmake \
+ -DCMAKE_INSTALL_PREFIX="$STAGE1_BUILD/src/playground/install" "$SRCDIR/kdewin32"
+
+ run "Building kdewin32" $NICENESS make -j$MAKE_JOBS
+ run "Installing kdewin32" $NICENESS make install
+) || exit 1
+fi
+
+
+# build png2ico, svg2ico, ... (native)
+(
+ cd_mk_or_die kdewin32-tools
+
+ export PATH="$QT_NATIVE_BUILD/bin:$PATH"
+
+ run "Configuring kdewin32 for native compilation tools build" cmake \
+ -DCMAKE_INSTALL_PREFIX="$TOOLSDIR" "$SRCDIR/kdewin32/tools"
+
+ run "Building kdewin32 native compilation tools" $NICENESS make -j$MAKE_JOBS
+ run "Installing kdewin32 native compilation tools" make install
+) || exit 1
+
+
+# build automoc (native)
+(
+ cd_mk_or_die automoc
+
+ export PATH="$QT_NATIVE_BUILD/bin:$PATH"
+
+ run "Configuring automoc" cmake \
+ -DCMAKE_INSTALL_PREFIX="$INST" "$SRCDIR/automoc"
+
+ run "Building automoc" $NICENESS make -j$MAKE_JOBS
+ run "Installing automoc" $NICENESS make install
+) || exit 1
+
+# build kdelibs (cross)
+(
+ cd_mk_or_die kdelibs
+
+ export PATH="$TOOLSDIR/bin:$PATH"
+
+ run "Configuring kdelibs (win32)" xcmake -DCMAKE_BUILD_TYPE=$KDE_BUILD_TYPE \
+ -DCMAKE_INSTALL_PREFIX="$INST" -C "$TOOLSDIR/mingw32-kdelibs.cmake" \
+ -DONLY_KLEO=ON -DKDEWIN_DIR="$STAGE1_BUILD/src/playground/install" \
+ -DBoost_INCLUDE_DIR="$STAGE1_BUILD/src/playground/install/include/boost-1_34" \
+ -DKDE4_ENABLE_HTMLHANDBOOK=ON "$SRCDIR/kdelibs"
+
+ run "Building kdelibs (win32)" $NICENESS make -j$MAKE_JOBS
+ run "Installing kdelibs (win32)" $NICENESS make install
+) || exit 1
+
+# build kdelibs build tools (native)
+(
+ cd_mk_or_die kdelibs-native
+
+ export PATH="$QT_NATIVE_BUILD/bin:$PATH"
+
+ run "Configuring kdelibs for native compilation tools build" cmake \
+ -DCMAKE_INSTALL_PREFIX="$INST" -DCROSS_COMPILATION_TOOLS_ONLY=ON \
+ -DONLY_KLEO=ON \
+ "$SRCDIR/kdelibs"
+
+ run "Building kdelibs native compilation tools" $NICENESS make -j$MAKE_JOBS
+ run "Installing kdelibs native compilation tools" $NICENESS make install
+) || exit 1
+
+# build kdepimlibs (cross)
+(
+ cd_mk_or_die kdepimlibs
+
+ export PATH="$TOOLSDIR/bin:$PATH"
+
+ run "Configuring kdepimlibs (win32)" xcmake -DCMAKE_BUILD_TYPE=$KDE_BUILD_TYPE \
+ -DCMAKE_INSTALL_PREFIX="$INST" -C "$TOOLSDIR/mingw32-kdelibs.cmake" \
+ -DONLY_KLEO=ON -DKDEWIN_DIR="$STAGE1_BUILD/src/playground/install" \
+ -DBoost_INCLUDE_DIR="$STAGE1_BUILD/src/playground/install/include/boost-1_34" \
+ -DKDE4_BUILD_TESTS=ON \
+ -DKDE4_ENABLE_HTMLHANDBOOK=ON "$SRCDIR/kdepimlibs"
+
+ run "Building kdepimlibs (win32)" $NICENESS make -j$MAKE_JOBS
+ run "Installing kdepimlibs (win32)" $NICENESS make install
+) || exit 1
+
+# build kdebase-runtime (cross)
+(
+ cd_mk_or_die kdebase-runtime
+
+ export PATH="$TOOLSDIR/bin:$PATH"
+
+ run "Configuring kdebase-runtime (win32)" xcmake -DCMAKE_BUILD_TYPE=$KDE_BUILD_TYPE \
+ -DCMAKE_INSTALL_PREFIX="$INST" -C "$TOOLSDIR/mingw32-kdelibs.cmake" \
+ -DONLY_KLEO=ON -DKDEWIN_DIR="$STAGE1_BUILD/src/playground/install" \
+ -DBoost_INCLUDE_DIR="$STAGE1_BUILD/src/playground/install/include/boost-1_34" \
+ -DKDE4_ENABLE_HTMLHANDBOOK=ON "$SRCDIR/kdebase-runtime"
+
+ run "Building kdebase-runtime (win32)" $NICENESS make -j$MAKE_JOBS
+ run "Installing kdebase-runtime (win32)" $NICENESS make install
+) || exit 1
+
+# build l10n-kde4
+#
+# (needs to be cross-compiled even though it just needs gettext, since
+# $lang/CMakeLists.txt looks for a fscking whole KDE4 install)
+
+for lang in "${LANGS[@]}" ; do
+(
+ cd_mk_or_die l10n-kde4/$lang
+
+ export PATH="$TOOLSDIR/bin:$PATH"
+
+ run "Configuring l10n-kde4 for language $lang" xcmake \
+ -DCMAKE_INSTALL_PREFIX="$INST" -C "$TOOLSDIR/mingw32-kdelibs.cmake" \
+ -DONLY_KLEO=ON -DKDEWIN_DIR="$STAGE1_BUILD/src/playground/install" \
+ -DKDE4_ENABLE_HTMLHANDBOOK=ON "$SRCDIR/l10n-kde4/$lang"
+
+ run "Building l10n-kde4/$lang" make -j$MAKE_JOBS
+ run "Installing l10n-kde4/$lang" make install
+) || exit 1
+done
diff --git a/build-aux/KDE/13-build-kdepim.sh b/build-aux/KDE/13-build-kdepim.sh
new file mode 100755
index 0000000..de95e73
--- /dev/null
+++ b/build-aux/KDE/13-build-kdepim.sh
@@ -0,0 +1,58 @@
+#!/bin/bash
+
+if [ -f "$(dirname "$0")/functions" ] ; then
+ source "$(dirname "$0")/functions"
+else
+ echo "Couldn't find function library (expected in $(dirname "$0")/functions)" 1>&2
+ exit 1
+fi
+
+load config "configuration file"
+
+readonly INST="$BUILDDIR/kdepim-install"
+
+export LD_LIBRARY_PATH="$QT_NATIVE_BUILD/lib:$LD_LIBRARY_PATH"
+
+cb
+
+run "Preparing clean build" rm -rf kdepim-install/* kdepim/*
+
+# build kdepim (cross)
+(
+ cd_mk_or_die kdepim
+
+ export PATH="$TOOLSDIR/bin:$PATH"
+
+ run "Configuring kdepim (win32)" xcmake -DCMAKE_BUILD_TYPE=$KDE_BUILD_TYPE \
+ -DCMAKE_INSTALL_PREFIX="$INST" -C "$TOOLSDIR/mingw32-kdelibs.cmake" \
+ -DONLY_KLEO=ON -DKDEWIN_DIR="$STAGE1_BUILD/src/playground/install" \
+ -DBoost_INCLUDE_DIR="$STAGE1_BUILD/src/playground/install/include/boost-1_34" \
+ "$SRCDIR/kdepim"
+
+ run "Building kdepim (win32)" make
+ run "Installing kdepim (win32)" make install
+
+ # kleopatra handbook en
+ cd "$INST/share/doc/HTML/en/kleopatra/"
+ run "Create Kleopatra handbook EN" "$BUILDDIR/kdelibs-install/bin/meinproc4" index.docbook
+ rm "$INST/share/doc/HTML/en/kleopatra/index.cache.bz2"
+ rm "$INST/share/doc/HTML/en/kleopatra/index.docbook"
+
+ # kleopatra handbook de
+ cd_mk_or_die "$INST/share/doc/HTML/de/kleopatra/"
+ cp "$SRCDIR/l10n-kde4/de/docs/kdepim/kleopatra/index.docbook" "$INST/share/doc/HTML/de/kleopatra/"
+ run "Create Kleopatra handbook DE" "$BUILDDIR/kdelibs-install/bin/meinproc4" index.docbook
+ rm "$INST/share/doc/HTML/de/kleopatra/index.docbook"
+
+ # Install Common files to HTML/common for handbook
+ cd_or_die "$INST/share/doc/HTML"
+ check_svn common $KDELIBS_DOC_COMMON_SVN_URL
+ rm -rf "common/.svn"
+ f=$(find . -maxdepth 3 -name "*.html")
+ for i in $f; do
+ cp $i $i.bkp
+ cat $i.bkp | sed 's/help:\//..\/..\//g' > $i
+ rm $i.bkp
+ done
+) || exit 1
+
diff --git a/build-aux/KDE/20-package-kdelibs.sh b/build-aux/KDE/20-package-kdelibs.sh
new file mode 100755
index 0000000..9732e7e
--- /dev/null
+++ b/build-aux/KDE/20-package-kdelibs.sh
@@ -0,0 +1,59 @@
+#!/bin/bash
+
+if [ -f "$(dirname "$0")/functions" ] ; then
+ source "$(dirname "$0")/functions"
+else
+ echo "Couldn't find function library (expected in $(dirname "$0")/functions)" 1>&2
+ exit 1
+fi
+
+load config "configuration file"
+load pc-tools "packages.current patching tools"
+
+[ -x "$TOOLSDIR/../makepkg-kdelibs-for-kleo.sh" ] || die "Cannot find helper script $TOOLSDIR/../makepkg-kdelibs-for-kleo.sh"
+
+cpkg
+
+run "Removing stale packages" rm -rf kdelibs*.* pkgtmp
+
+
+cb
+cd_or_die kdelibs-install
+
+run "Packing kdelibs build" zip -r "$PKGDIR/kdelibs.zip" *
+
+cs
+
+rm -rf kdelibs-$TODAY >/dev/null 2>&1
+
+if [ -d kdelibs/.svn ] ; then
+ run "Exporting kdelibs source" svn --non-interactive export kdelibs kdelibs-$TODAY
+else
+ run "Exporting kdelibs source" cp -la kdelibs kdelibs-$TODAY
+fi
+if [ -d kdepimlibs/.svn ] ; then
+ run "Exporting kdepimlibs source" svn --non-interactive export kdepimlibs kdepimlibs-$TODAY
+else
+ run "Exporting kdepimlibs source" cp -la kdepimlibs kdepimlibs-$TODAY
+fi
+run "Packing kdelibs and kdepimlibs source" $KDE_SRC_ZIP "$PKGDIR/kdelibs-$TODAY$KDE_SRC_SUFFIX" kdelibs-$TODAY kdepimlibs-$TODAY
+run "Cleaning up" rm -r kdelibs-$TODAY kdepimlibs-$TODAY
+
+cpkg
+
+run "Splitting kdelibs build into packages" "$TOOLSDIR/../makepkg-kdelibs-for-kleo.sh" kdelibs.zip
+
+rm -rf kdelibs.zip pkgtmp >/dev/null 2>&1
+
+for i in kdelibs-for-kleo* ; do
+ mv -f "$i" "${i/-for-kleo/}" || die "Cannot move \"$i\" -> \"${i/-for-kleo/}\""
+done
+
+[ -f kdelibs-*-dev.zip -a -f kdelibs-*-bin.zip ] || die "Expected packages not found."
+
+for i in kdelibs-*-dev.zip ; do
+ mv -f "$i" "${i%-dev.zip}-lib.zip" || die "Cannot move \"$i\" -> \"${i%-dev.zip}-lib.zip\""
+done
+
+msg "Updating packages.current"
+pc-update kdelibs -lib.zip -bin.zip $KDE_SRC_SUFFIX || die
diff --git a/build-aux/KDE/21-package-kdepim.sh b/build-aux/KDE/21-package-kdepim.sh
new file mode 100755
index 0000000..504eb28
--- /dev/null
+++ b/build-aux/KDE/21-package-kdepim.sh
@@ -0,0 +1,52 @@
+#!/bin/bash
+
+if [ -f "$(dirname "$0")/functions" ] ; then
+ source "$(dirname "$0")/functions"
+else
+ echo "Couldn't find function library (expected in $(dirname "$0")/functions)" 1>&2
+ exit 1
+fi
+
+load config "configuration file"
+load pc-tools "packages.current patching tools"
+
+[ -x "$TOOLSDIR/../makepkg-kleopatra.sh" ] || die "Cannot find helper script $TOOLSDIR/../makepkg-kleopatra.sh"
+
+cpkg
+
+run "Removing stale packages" rm -rf kleopatra*.* pkgtmp
+
+
+cb
+cd_or_die kdepim-install
+
+run "Packing kleopatra build" zip -r "$PKGDIR/kleopatra.zip" *
+
+cs
+
+rm -rf kleopatra-$TODAY >/dev/null 2>&1
+
+if [ -d kdepim/.svn ] ; then
+ run "Exporting kdepim source" svn --non-interactive export kdepim kleopatra-$TODAY
+elif [ -d kdepim/.git ] ; then
+ cd kdepim
+ run "Exporting kdepim source" git checkout-index --prefix=../kleopatra-$TODAY/ -a
+ cd -
+else
+ run "Exporting kdepim source" cp -la kdepim kleopatra-$TODAY
+fi
+run "Packing kleopatra source" $KDE_SRC_ZIP "$PKGDIR/kleopatra-$TODAY$KDE_SRC_SUFFIX" kleopatra-$TODAY
+run "Cleaning up" rm -r kleopatra-$TODAY
+
+cpkg
+
+run "Splitting kdepim build into packages" "$TOOLSDIR/../makepkg-kleopatra.sh" kleopatra.zip
+
+rm -rf kleopatra.zip pkgtmp >/dev/null 2>&1
+
+[ -f kleopatra-*-bin.zip ] || die "Expected packages not found."
+
+rm -rf kleopatra-*-dev.zip >/dev/null 2>&1
+
+msg "Updating packages.current"
+pc-update kleopatra -bin.zip $KDE_SRC_SUFFIX || die
diff --git a/build-aux/KDE/30-build-installer-stage2.sh b/build-aux/KDE/30-build-installer-stage2.sh
new file mode 100755
index 0000000..3c676ec
--- /dev/null
+++ b/build-aux/KDE/30-build-installer-stage2.sh
@@ -0,0 +1,42 @@
+#!/bin/bash
+
+if [ -f "$(dirname "$0")/functions" ] ; then
+ source "$(dirname "$0")/functions"
+else
+ echo "Couldn't find function library (expected in $(dirname "$0")/functions)" 1>&2
+ exit 1
+fi
+
+load config "configuration file"
+
+[ -d "$GPG4WIN_SRC" ] || die "Did not find gpg4win source code in $GPG4WIN_SRC"
+cd_or_die "$GPG4WIN_SRC"
+run "Running autogen.sh --force" ./autogen.sh --force
+[ -d "$STAGE2_BUILD" ] || mkdir -p -- "$STAGE2_BUILD" || die "Failed to make directory $STAGE2_BUILD"
+rm -rf "$STAGE2_BUILD" || die "Failed to remove stale build dir $STAGE2_BUILD"
+
+if $INSTALLER_OUT_OF_SRC_BUILD ; then
+ msg -n "Setting up out-of-source build..."
+ cd_mk_or_die "$STAGE2_BUILD"
+ ln -s "$GPG4WIN_SRC/packages" . || die "Failed to link $GPG4WIN_SRC/packages -> $STAGE2_BUILD/packages"
+ CONFIGURE="$GPG4WIN_SRC/configure"
+ msg done
+else
+ msg -n "Setting up in-source build..."
+ cp -la "$GPG4WIN_SRC" "$STAGE2_BUILD" || die "Failed to hard-link-copy $GPG4WIN_SRC -> $STAGE2_BUILD"
+ cd_or_die "$STAGE2_BUILD"
+ CONFIGURE="./configure"
+ msg done
+fi
+
+[ -f Makefile ] && run "Found Makefile, trying distclean'ing" make -j1 distclean
+
+SAVED_PATH="$PATH"
+export PATH="${TOOLSDIR}/bin:$PATH"
+run "stage 2: configuring" "$CONFIGURE" --enable-maintainer-mode \
+ --host=i586-mingw32msvc --disable-source-installer --disable-light-installer --enable-fast-nsis
+export GPG4WIN_PARALLEL="$MAKEFLAGS"
+unset MAKEFLAGS
+run "stage 2: compiling" make
+export MAKEFLAGS="$GPG4WIN_PARALLEL"
+export PATH="$SAVED_PATH"
diff --git a/build-aux/KDE/README b/build-aux/KDE/README
new file mode 100644
index 0000000..d6f8ff9
--- /dev/null
+++ b/build-aux/KDE/README
@@ -0,0 +1,21 @@
+KDE-Build
+---------
+
+These scripts are used for building the KDE libraries and
+Kleopatra for the gpg4win installer. They are intended to be
+run in a pbuilder environment.
+
+If you want to use them for development do not use the root
+setup script but make sure that you have the required dependencies
+for your platform installed (see config).
+
+
+Authors:
+Marc Mutz <marc.mutz at kdab.com>
+Bernhard Herzog <bh at intevation.de>
+Frank Osterfeld <frank.osterfeld at kdab.com>
+Emanuel Schütze <eschuetze at intevation.de>
+Andre Heinecke <aheinecke at intevation.de>
+
+For the History of the scripts in the KDE repositories please
+refer to: http://websvn.kde.org/branches/work/gpg4win/scripts
diff --git a/build-aux/KDE/Toolchain-mingw32.cmake b/build-aux/KDE/Toolchain-mingw32.cmake
new file mode 100644
index 0000000..5e3b70c
--- /dev/null
+++ b/build-aux/KDE/Toolchain-mingw32.cmake
@@ -0,0 +1,36 @@
+#
+# This file needs the following variables set:
+#
+# - QT4_INSTALL_DIR host Qt installation
+# - KDELIBS_INSTALL_DIR host/target kdelibs installation
+# - GPG4WIN_INSTALL_DIR target gpg4win installer build
+#
+
+# the name of the target operating system
+SET(CMAKE_SYSTEM_NAME Windows)
+
+# which compilers to use for C and C++
+SET(CMAKE_C_COMPILER i586-mingw32msvc-gcc)
+SET(CMAKE_CXX_COMPILER i586-mingw32msvc-g++)
+
+# here is the target environment located
+SET(CMAKE_FIND_ROOT_PATH /usr/i586-mingw32msvc ${GPG4WIN_INSTALL_DIR} ${KDELIBS_INSTALL_DIR} )
+
+# adjust the default behaviour of the FIND_XXX() commands:
+# search headers and libraries in the target environment, search
+# programs in the host environment
+set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
+set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
+set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
+
+# FindQt4.cmake querys qmake to get information, this doesn't work when crosscompiling
+set(KDE_PREFIX ${GPG4WIN_INSTALL_DIR})
+set(QT_BINARY_DIR ${QT4_INSTALL_DIR}/bin)
+set(QT_LIBRARY_DIR ${KDE_PREFIX}/lib)
+set(WIN32LIBS_DIR ${GPG4WIN_INSTALL_DIR}/lib)
+set(QT_QTCORE_LIBRARY ${KDE_PREFIX}/lib/libQtCore4.a)
+set(QT_QTCORE_INCLUDE_DIR ${KDE_PREFIX}/include/QtCore)
+set(QT_MKSPECS_DIR ${KDE_PREFIX}/mkspecs)
+set(QT_MOC_EXECUTABLE ${QT_BINARY_DIR}/moc)
+set(QT_QMAKE_EXECUTABLE ${QT_BINARY_DIR}/qmake)
+set(QT_UIC_EXECUTABLE ${QT_BINARY_DIR}/uic)
diff --git a/build-aux/KDE/config b/build-aux/KDE/config
new file mode 100644
index 0000000..bc890d9
--- /dev/null
+++ b/build-aux/KDE/config
@@ -0,0 +1,163 @@
+#!/bin/bash
+
+# Configure here if the build should be nice
+readonly NICENESS="ionice -c 3 nice "
+
+# Configure here the amount of jobs to use
+readonly MAKE_JOBS="$((`grep vendor_id /proc/cpuinfo | wc -l` + 1))"
+
+# A Logfile for the command output generated
+readonly LOGFILE="$(absolute "$(dirname "$0")")"/build.log
+
+if [ "$USER" != root ] ; then
+ readonly BUILDDIR="$PWD/build"
+ readonly SRCDIR="$PWD/src"
+ readonly PKGDIR="$PWD/pkg"
+fi
+readonly TOOLSDIR="$(absolute "$(dirname "$0")")"
+
+readonly USE_SQUID=true
+readonly SQUID_MAX_DISK_USAGE=1000 #in MB
+if $USE_SQUID && [ -x /usr/sbin/squid ] ; then
+ if [ -z "$ftp_proxy" ] ; then
+ export ftp_proxy=localhost:3128
+ fi
+ if [ -z "$http_proxy" ] ; then
+ export http_proxy=localhost:3128
+ fi
+fi
+
+readonly TODAY=$(date +%Y%m%d)
+
+readonly debian_version="$(cat /etc/debian_version)" || die "Cannot read /etc/debian_version"
+case "$debian_version" in
+ 7.0*) # Wheezy
+ ;;
+ *)
+ die "Found unsupported Debian version $debian_version"
+ ;;
+esac
+
+# apt-get stuff
+readonly APT_SOURCES_LIST=/etc/apt/sources.list
+readonly APT_PREFERENCES=/etc/apt/preferences
+
+# packages needed
+readonly INSTALLER_TOOLCHAIN="gcc-mingw32 nsis stow zip unzip bzip2 texinfo imagemagick \
+libglib2.0-dev latex-xcolor subversion icecc wget libjpeg8-dev \
+libpng12-dev zlib1g-dev libdbus-1-dev libdbus-glib-1-dev libssl-dev \
+libx11-dev libxext-dev autoconf automake gettext shared-mime-info libsm-dev \
+libxml2-dev libxml2-utils libxslt1-dev libbz2-dev"
+
+# TODO: Icecream is untested on wheezy
+readonly ICECREAM_WEB=ftp://ftp.kdab.net/pub/gpg4win/devtools/debian-lenny-mingw32-icecream-env.tar.gz
+readonly ICECREAM_LOCAL=/opt/debian-lenny-mingw32-icecream-env.tar.gz
+
+# gpg4win git
+readonly GPG4WIN_GIT=git://git.gnupg.org/gpg4win.git
+
+readonly GPG4WIN_SRC="$SRCDIR/gpg4win-src"
+
+# installer build settings
+readonly INSTALLER_OUT_OF_SRC_BUILD=false
+readonly STAGE1_OMIT="kleopatra kdelibs oxygen-icons gpa paperkey gpgex gpgol claws-mail attachwarner gtkhtml2_viewer notification_plugin rssyl tnef_parse vcalendar libxml2 curl libetpan gnutls libtasn1 libgsasl compendium_de man_novice_en bsfilter bsfilter_plugin"
+#readonly STAGE2_OMIT="gpa paperkey claws-mail attachwarner gtkhtml2_viewer notification_plugin rssyl tnef_parse vcalendar libxml2 curl libetpan gnutls libtasn1 libgsasl compendium_de man_novice_en"
+
+readonly STAGE1_BUILD="$BUILDDIR/gpg4win-stage1"
+readonly STAGE2_BUILD="$BUILDDIR/gpg4win-final"
+
+# Qt settings
+readonly QT_VERSION=4.8.4
+readonly QT_SHA1=f5880f11c139d7d8d01ecb8d874535f7d9553198
+readonly QT_BASENAME=qt-everywhere-opensource-src-$QT_VERSION
+readonly QT_LOCAL=$QT_BASENAME.tar.gz
+readonly QT_WEB=http://releases.qt-project.org/qt4/source/$QT_LOCAL
+readonly QT_NATIVE_FLAGS="-fast -shared -release -opensource"
+readonly QT_NATIVE_EXCLUDE="exceptions accessibility stl sql-ibase sql-mysql sql-odbc sql-psql sql-sqlite sql-sqlite2 qt3support xmlpatterns phonon phonon-backend webkit gif libtiff libmng nis cups iconv separate-debug-info nas-sound opengl xinerama xcursor xfixes xrandr xrender fontconfig xkb glib"
+readonly QT_NATIVE_SYSTEM="libjpeg zlib libpng"
+
+readonly QT_SRC="$SRCDIR/$QT_BASENAME"
+readonly QT_NATIVE_BUILD="$BUILDDIR/qt-native"
+
+# KDE stuff
+readonly KDESVN=svn://anonsvn.kde.org/home/kde
+#readonly KDESVN=svn+ssh://svn.kde.org/home/kde
+
+readonly KDEGIT=git at git.kde.org
+
+readonly KDE_BUILD_TYPE=Release #debugfull # Debug Release
+
+readonly KDE_SRC_ZIP="zip -r"
+readonly KDE_SRC_SUFFIX=-src.zip
+
+# alternatively:
+#readonly KDE_SRC_ZIP="tar cfj"
+#readonly KDE_SRC_SUFFIX=-src.tar.bz2
+
+readonly KDEWIN32_PNG2ICO_ONLY=true
+readonly KDEWIN32_CROSSCOMPILE=true
+readonly KDEWIN32_USE_SVN=false
+readonly KDEWIN32_REVISION=
+readonly KDEWIN32_SVN_URL=$KDESVN/trunk/kdesupport/kdewin32
+readonly KDEWIN32_SRC_URL=ftp://ftp.kdab.net/gpg4win/kdewin32-20080828-src.zip
+readonly KDEWIN32_BIN_URL=ftp://ftp.kdab.net/gpg4win/kdewin32-20080828-src.zip
+
+readonly AUTOMOC_USE_GIT=true
+readonly AUTOMOC_GIT_URL=$KDEGIT:automoc
+readonly AUTOMOC_REVISION=
+#readonly AUTOMOC_SRC_URL=ftp://ftp.kdab.net/pub/gpg4win/automoc-20080828-src.zip
+#readonly AUTOMOC_BIN_URL=ftp://ftp.kdab.net/pub/gpg4win/automoc-20080828-src.zip
+
+readonly KDESUPPORT_CROSSCOMPILE=false
+#readonly KDESUPPORT_DEV_URL=ftp://ftp.kdab.net/pub/gpg4win/kdesupport-20080828-dev.zip
+
+readonly KDELIBS_CROSSCOMPILE=true
+readonly KDELIBS_USE_GIT=true
+readonly KDELIBS_REVISION=
+readonly KDELIBS_GIT_URL=$KDEGIT:kdelibs
+readonly KDELIBS_GIT_BRANCH=KDE/4.10
+readonly KDELIBS_SRC_URL=ftp://ftp.kdab.net/gpg4win/kdelibs-20080828-src.zip
+readonly KDELIBS_BIN_URL=ftp://ftp.kdab.net/gpg4win/kdelibs-20080828-src.zip
+
+readonly KDEPIMLIBS_CROSSCOMPILE=true
+readonly KDEPIMLIBS_USE_GIT=true
+readonly KDEPIMLIBS_REVISION=
+readonly KDEPIMLIBS_GIT_URL=$KDEGIT:kdepimlibs
+readonly KDEPIMLIBS_GIT_BRANCH=KDE/4.10
+readonly KDEPIMLIBS_SRC_URL=ftp://ftp.kdab.net/gpg4win/kdepimlibs-20080828-src.zip
+readonly KDEPIMLIBS_BIN_URL=ftp://ftp.kdab.net/gpg4win/kdepimlibs-20080828-src.zip
+
+readonly KDE_RUNTIME_CROSSCOMPILE=true
+readonly KDE_RUNTIME_USE_GIT=true
+readonly KDE_RUNTIME_REVISION=
+readonly KDE_RUNTIME_GIT_URL=$KDEGIT:kde-runtime
+readonly KDE_RUNTIME_GIT_BRANCH=KDE/4.10
+readonly KDE_RUNTIME_SRC_URL=ftp://ftp.kdab.net/gpg4win/kdebase-runtime-20080828-src.zip
+readonly KDE_RUNTIME_BIN_URL=ftp://ftp.kdab.net/gpg4win/kdebase-runtime-20080828-src.zip
+
+readonly KDEPIM_CROSSCOMPILE=true
+readonly KDEPIM_USE_GIT=true
+readonly KDEPIM_REVISION=
+readonly KDEPIM_GIT_URL=$KDEGIT:kdepim
+readonly KDEPIM_GIT_BRANCH=KDE/4.10
+readonly KDEPIM_SRC_URL=ftp://ftp.kdab.net/gpg4win/kdepim-20080828-src.zip
+readonly KDEPIM_BIN_URL=ftp://ftp.kdab.net/gpg4win/kdepim-20080828-src.zip
+
+#readonly L10N_KDE4_CROSSCOMPILE=true
+readonly L10N_KDE4_USE_SVN=true
+readonly L10N_KDE4_REVISION=
+readonly L10N_KDE4_SVN_URL=$KDESVN/trunk/l10n-kde4
+L10N_KDE4_SVN_URL_SUB_N=( de{,/messages,/docs} templates{,/messages} )
+readonly L10N_KDE4_SVN_URL_SUB_N
+L10N_KDE4_SVN_URL_SUB=( scripts {de,templates}/messages/{kde{pim{,libs},libs,base},qt} de/docs/kde{pim{,libs},libs,base} )
+readonly L10N_KDE4_SVN_URL_SUB
+readonly L10N_KDE4_SRC_URL=ftp://ftp.kdab.net/gpg4win/l10n-kde4-20080828-src.zip
+readonly L10N_KDE4_BIN_URL=ftp://ftp.kdab.net/gpg4win/l10n-kde4-20080828-src.zip
+
+readonly KDELIBS_DOC_COMMON_SVN_URL=$KDESVN/branches/KDE/4.1/kdelibs/doc common
+
+if $etch ; then
+ readonly SVN_NON_RECURSIVE=-N
+else
+ readonly SVN_NON_RECURSIVE="--depth=files"
+fi
diff --git a/build-aux/KDE/functions b/build-aux/KDE/functions
new file mode 100644
index 0000000..8fa4c3a
--- /dev/null
+++ b/build-aux/KDE/functions
@@ -0,0 +1,161 @@
+#!/bin/bash
+
+function msg() {
+ echo "$@" 2>&1
+}
+
+function die() {
+ msg "$@"
+ msg "Exiting."
+ exit 1
+}
+
+function run() {
+ msg -n "${1} : "
+ shift
+ msg -n "$@ ..."
+ local OUTPUT
+ if [ -n "$LOGFILE" ]; then
+ set -o pipefail
+ OUTPUT="$("$@" 2>&1 | tee -a $LOGFILE)"
+ else
+ OUTPUT="$("$@" 2>&1)"
+ fi
+
+ if [ $? -ne 0 ] ; then
+ msg failed
+ [ -z "$OUTPUT" ] || msg "$OUTPUT"
+ die
+ fi
+ msg done
+ set +o pipefail
+}
+
+function ask() {
+ local ANSWER
+ read -n1 -s -p "$1 [Y/n]" ANSWER
+ [ -z "$ANSWER" -o "$ANSWER" = y -o "$ANSWER" = Y ]
+}
+
+function load() {
+ local FILE
+ FILE="$(dirname "$0")/$1"
+ if [ -f "$FILE" ] ; then
+ source "$FILE"
+ else
+ die "Couldn't find $2 (expected in $FILE)"
+ fi
+}
+
+function absolute() {
+ case "$1" in
+ /*) echo "$1" ;;
+ *) echo "$PWD/$1" ;;
+ esac
+}
+
+function extract() {
+ for file in "$@" ; do
+ case "$file" in
+ *.tar.bz2|*.tbz2)
+ tar xfjv "$file" ;;
+ *tar.gz|*.tgz)
+ tar xfzv "$file" ;;
+ *.zip)
+ unzip -n "$file" ;;
+ *) die "Cannot determine how to unpack \"$file\""
+ esac
+ done
+}
+
+function xcmake() {
+ [ -f "$TOOLSDIR/Toolchain-mingw32.cmake" ] || die "Expected cmake toolchanin file ($TOOLSDIR/Toolchain-mingw32.cmake) not found."
+ cmake \
+ -DCMAKE_MODULE_PATH="$BUILDDIR/kdelibs-install/share/apps/cmake/modules" \
+ -DGPG4WIN_INSTALL_DIR="$STAGE1_BUILD/src/playground/install" \
+ -DQT4_INSTALL_DIR="$QT_NATIVE_BUILD" \
+ -DKDELIBS_INSTALL_DIR="$BUILDDIR/kdelibs-install" \
+ -DCMAKE_TOOLCHAIN_FILE="$TOOLSDIR/Toolchain-mingw32.cmake" "$@"
+}
+
+function cd_or_die() {
+ cd "$@" || die "Cannot change into $@"
+}
+
+function cd_mk_or_die() {
+ [ -d "$1" ] || mkdir -p -- "$1" || die "Cannot create directory \"$1\""
+ cd_or_die "$1"
+}
+
+function cb() {
+ cd_mk_or_die "$BUILDDIR"
+}
+
+function cs() {
+ cd_mk_or_die "$SRCDIR"
+}
+
+function cpkg() {
+ cd_mk_or_die "$PKGDIR"
+}
+
+function num_cpus() {
+ cat /proc/cpuinfo | grep -cE ^processor || die "Cannot determine number of CPUs in the system"
+}
+
+function check_git() {
+ local DIR="$1" URL="$2" BRANCH="$3"
+
+ if [ -z $BRANCH ]; then
+ BRANCH=master
+ fi
+
+ if [ -d "$DIR" ] ; then
+
+ cd_or_die "$DIR"
+
+ # check that it's the same repository
+ # if not, try svn switch
+ run "Fetching GIT changes" git fetch "$URL"
+ run "Checking out $BRANCH" git checkout "$BRANCH"
+ run "Updating the working copy" git merge --ff-only origin/"$BRANCH"
+
+ cd - || die "Cannot cd back again"
+ else
+ run "Cloning Git repository" git clone "$URL" "$DIR"
+ cd "$DIR"
+ run "Checking out $BRANCH" git checkout "$BRANCH"
+ cd -
+ fi
+}
+
+function check_svn() {
+ local DIR="$1" URL="$2"
+
+ if [ -d "$DIR" ] ; then
+
+ cd_or_die "$DIR"
+
+ # check that it's the same repository
+ local CUR_URL="$(svn info | grep -E ^URL:|cut -c6-)" || die "svn info failed in $PWD"
+ # if not, try svn switch
+ if [ "$CUR_URL" != "$URL" ] ; then
+ run "SVN repository URL seems to have changed, svn switch'ing" svn --non-interactive switch --relocate "$CUR_URL" "$URL"
+ fi
+ run "Updating SVN repository" svn --non-interactive up
+
+ cd - || die "Cannot cd back again"
+ else
+ run "Checking out SVN repository" svn --non-interactive co "$URL" "$DIR"
+ fi
+
+
+}
+
+checksha1() {
+ sha1sum=`openssl sha1 $1 | awk \{'print $2'\}`
+ if [ $sha1sum == $2 ]; then
+ return 0
+ fi;
+ die "Bad SHA1SUM for $1"
+}
diff --git a/build-aux/KDE/make-all.sh b/build-aux/KDE/make-all.sh
new file mode 100755
index 0000000..9fdac09
--- /dev/null
+++ b/build-aux/KDE/make-all.sh
@@ -0,0 +1,46 @@
+#!/bin/bash
+PREFIX="$(dirname "$0")"
+
+# step 1: user setup
+"$PREFIX"/01-user-setup.sh || exit 1
+
+# step 2: download and checkout stuff, and build what we already can:
+"$PREFIX"/02-update-kde.sh &
+p_kde=$!
+"$PREFIX"/02-update-gpg4win.sh && "$PREFIX"/10-build-installer-stage1.sh &
+p_gpg=$!
+"$PREFIX"/02-update-qt.sh && "$PREFIX"/10-build-qt.sh &
+p_qt=$!
+
+if wait $p_qt ; then
+ qt_success=true
+else
+ qt_success=false
+fi
+
+if wait $p_gpg ; then
+ gpg_success=true
+else
+ gpg_success=false
+fi
+
+if wait $p_kde ; then
+ kde_success=true
+else
+ kde_success=false
+fi
+
+$qt_success && $gpg_success && $kde_success || exit 1
+
+# step 3: KDE build
+"$PREFIX"/12-build-kdelibs.sh || exit 1
+"$PREFIX"/13-build-kdepim.sh || exit 1
+
+# step 4: package KDE (better not do this in parallel, they both try
+# to patch packages.current)
+
+"$PREFIX"/20-package-kdelibs.sh || exit 1
+"$PREFIX"/21-package-kdepim.sh || exit 1
+
+# step 5: build final installer
+"$PREFIX"/30-build-installer-stage2.sh || exit 1
diff --git a/build-aux/KDE/mingw32-kdelibs.cmake b/build-aux/KDE/mingw32-kdelibs.cmake
new file mode 100644
index 0000000..50f8763
--- /dev/null
+++ b/build-aux/KDE/mingw32-kdelibs.cmake
@@ -0,0 +1,36 @@
+#
+# This file needs the following variables set:
+#
+# - KDELIBS_INSTALL_DIR host/target kdelibs installation
+# - GPG4WIN_INSTALL_DIR target gpg4win installer build
+#
+
+set(KDE_PREFIX ${KDELIBS_INSTALL_DIR})
+set(KDE4_BIN_DIR ${KDELIBS_INSTALL_DIR}/bin)
+
+# this one is used by FindKDE4.cmake to load FindKDE4Internal.cmake:
+set(KDE4_DATA_DIR ${KDE_PREFIX}/share/apps CACHE PATH /opt/kdewin-buildenv/share/apps )
+
+# not sure about this one:
+#set(KDEWIN_DIR ${KDE_PREFIX} CACHE PATH ${GPG4WIN_INSTALL_DIR} )
+
+# disable some things:
+set(WITH_AVAHI OFF CACHE BOOL "Disabled")
+set(WITH_DNSSD OFF CACHE BOOL "Disabled")
+set(WITH_ENCHANT OFF CACHE BOOL "Disabled")
+set(WITH_FAM OFF CACHE BOOL "Disabled")
+set(WITH_GSSAPI OFF CACHE BOOL "Disabled")
+set(WITH_HSPELL OFF CACHE BOOL "Disabled")
+set(WITH_OpenEXR OFF CACHE BOOL "Disabled")
+
+# use the binaries from native KDE4
+set(KDE4_KDECONFIG_EXECUTABLE ${KDE4_BIN_DIR}/kde4-config CACHE PATH "")
+set(KDE4_KCFGC_EXECUTABLE ${KDE4_BIN_DIR}/kconfig_compiler CACHE PATH "")
+set(KDE4_AUTOMOC_EXECUTABLE ${KDE4_BIN_DIR}/kde4automoc CACHE PATH "")
+set(KDE4_MEINPROC_EXECUTABLE ${KDE4_BIN_DIR}/meinproc4 CACHE PATH "")
+
+# the -fvisibility compiler flag is only relevant for ELF targets, and
+# thus doesn't make sense for a windows cross build. Without this, the
+# kdelibs cmake files will try to run a test program which doesn't work
+# for cross builds
+set(__KDE_HAVE_GCC_VISIBILITY 0 CACHE BOOL "GCC support for hidden visibility")
diff --git a/build-aux/KDE/pc-tools b/build-aux/KDE/pc-tools
new file mode 100644
index 0000000..f3fbd94
--- /dev/null
+++ b/build-aux/KDE/pc-tools
@@ -0,0 +1,85 @@
+#!/bin/bash
+
+function pc-key() {
+ echo "$@" | ( read key value ; echo "$key" )
+}
+
+function pc-value() {
+ echo "$@" | ( read key value ; echo "$value" )
+}
+
+function pc-rewrite() {
+ local base="$1" lnr=0 line name file replaced=false
+ shift
+
+ cat "$GPG4WIN_SRC/packages/packages.current" | \
+ while read line ; do
+ let lnr++
+ local key="$(pc-key "$line")" value="$(pc-value "$line")"
+ if [ -n "$key" ] ; then
+ case "$key" in
+ \#*)
+ ;;
+ server)
+ name=
+ file=
+ ;;
+ name)
+ [ -z "$value" ] && die "packages.current: syntax error in name statement, line $lnr"
+ name="$value"
+ ;;
+ file)
+ [ -z "$value" ] && die "packages.current: syntax error in file statement, line $lnr"
+ replaced=false
+ file="$value"
+ if [ "${value#$base}" != "$value" ] ; then
+ [ -z "$name" ] || die "Sorry, renamed packages are not yet supported by pc-patch, line $lnr"
+ for suffix in "$@" ; do
+ if [ "${value%$suffix}" != "$value" ] ; then
+ local newvalue="$(cd_or_die "$PKGDIR" && ls -1 ${base}*${suffix} | tail -1)" || die "Something went wrong"
+ [ -n "$newvalue" ] || die "Could not find a package matching $base*$suffix"
+ #msg "$value -> $newvalue"
+ line="${line%$value}$newvalue"
+ file="$newvalue"
+ replaced=true
+ break
+ fi
+ done
+ fi
+ ;;
+ chk)
+ if $replaced ; then
+ [ -f "$PKGDIR/$file" ] || die "Cannot find $file in $PKGDIR, packages.current:$lnr"
+ SHA1="$(sha1sum "$PKGDIR/$file" | cut -d' ' -f1)" || die "Failed to compute the sha1sum of $PKGDIR/$file"
+ [ -n "$SHA1" ] || die "empty sha1sum result"
+ line="${line%$value}$SHA1"
+ fi
+ replaced=false
+ ;;
+ esac
+ fi
+ echo "$line"
+ done || exit 1
+
+}
+
+function pc-patch() {
+ cp -f "$GPG4WIN_SRC/packages/packages.current" "$GPG4WIN_SRC/packages/packages.current~"
+ local TMPFILE="$(mktemp "$GPG4WIN_SRC/packages/packages.current.XXXXXX")" || die "Cannot create temporary file"
+ pc-rewrite "$@" >> "$TMPFILE" || die "pc-rewrite failed"
+ mv -f "$TMPFILE" "$GPG4WIN_SRC/packages/packages.current" || die "Couldn't move \"$TMPFILE\" -> \"$GPG4WIN_SRC/packages/packages.current\""
+}
+
+function pc-refresh() {
+ local base="$1"
+ shift
+ for suffix in "$@" ; do
+ rm -f "$GPG4WIN_SRC/packages/$base"*"$suffix" >/dev/null 2>&1 || die "Cannot remove" "$GPG4WIN_SRC/packages/$base"*"$suffix"
+ cp -f "$PKGDIR/$base"*"$suffix" "$GPG4WIN_SRC/packages" >/dev/null 2>&1 || die "Couldn't copy" "$PKGDIR/$base"*"$suffix" "-> $GPG4WIN_SRC/packages"
+ done
+}
+
+function pc-update() {
+ pc-patch "$@" || die
+ pc-refresh "$@" || die
+}
-----------------------------------------------------------------------
Summary of changes:
build-aux/KDE/00-root-setup.sh | 77 ++++++++++
build-aux/KDE/01-user-setup.sh | 30 ++++
build-aux/KDE/02-update-gpg4win.sh | 33 ++++
build-aux/KDE/02-update-kde.sh | 224 ++++++++++++++++++++++++++++
build-aux/KDE/02-update-qt.sh | 28 ++++
build-aux/KDE/10-build-installer-stage1.sh | 54 +++++++
build-aux/KDE/10-build-qt.sh | 36 +++++
build-aux/KDE/12-build-kdelibs.sh | 163 ++++++++++++++++++++
build-aux/KDE/13-build-kdepim.sh | 58 +++++++
build-aux/KDE/20-package-kdelibs.sh | 59 ++++++++
build-aux/KDE/21-package-kdepim.sh | 52 +++++++
build-aux/KDE/30-build-installer-stage2.sh | 42 +++++
build-aux/KDE/README | 21 +++
build-aux/KDE/Toolchain-mingw32.cmake | 36 +++++
build-aux/KDE/config | 163 ++++++++++++++++++++
build-aux/KDE/functions | 161 ++++++++++++++++++++
build-aux/KDE/make-all.sh | 46 ++++++
build-aux/KDE/mingw32-kdelibs.cmake | 36 +++++
build-aux/KDE/pc-tools | 85 +++++++++++
19 files changed, 1404 insertions(+), 0 deletions(-)
create mode 100755 build-aux/KDE/00-root-setup.sh
create mode 100755 build-aux/KDE/01-user-setup.sh
create mode 100755 build-aux/KDE/02-update-gpg4win.sh
create mode 100755 build-aux/KDE/02-update-kde.sh
create mode 100755 build-aux/KDE/02-update-qt.sh
create mode 100755 build-aux/KDE/10-build-installer-stage1.sh
create mode 100755 build-aux/KDE/10-build-qt.sh
create mode 100755 build-aux/KDE/12-build-kdelibs.sh
create mode 100755 build-aux/KDE/13-build-kdepim.sh
create mode 100755 build-aux/KDE/20-package-kdelibs.sh
create mode 100755 build-aux/KDE/21-package-kdepim.sh
create mode 100755 build-aux/KDE/30-build-installer-stage2.sh
create mode 100644 build-aux/KDE/README
create mode 100644 build-aux/KDE/Toolchain-mingw32.cmake
create mode 100644 build-aux/KDE/config
create mode 100644 build-aux/KDE/functions
create mode 100755 build-aux/KDE/make-all.sh
create mode 100644 build-aux/KDE/mingw32-kdelibs.cmake
create mode 100644 build-aux/KDE/pc-tools
hooks/post-receive
--
GnuPG for Windows
http://git.gnupg.org
More information about the Gpg4win-commits
mailing list