diff options
Diffstat (limited to 'Swift/Packaging')
34 files changed, 1018 insertions, 158 deletions
diff --git a/Swift/Packaging/Debian/.dockerignore b/Swift/Packaging/Debian/.dockerignore new file mode 100644 index 0000000..5d238e7 --- /dev/null +++ b/Swift/Packaging/Debian/.dockerignore @@ -0,0 +1 @@ +**/out diff --git a/Swift/Packaging/Debian/.gitignore b/Swift/Packaging/Debian/.gitignore index 5401ae0..9c8f275 100644 --- a/Swift/Packaging/Debian/.gitignore +++ b/Swift/Packaging/Debian/.gitignore @@ -1,3 +1,7 @@ /swift-* /swift_* /libswiften* +/out/ +/swift-src/ +swift-im*.orig.tar.gz +*.tmp.package diff --git a/Swift/Packaging/Debian/Dockerfile.package.in b/Swift/Packaging/Debian/Dockerfile.package.in new file mode 100644 index 0000000..b53d477 --- /dev/null +++ b/Swift/Packaging/Debian/Dockerfile.package.in @@ -0,0 +1,30 @@ +FROM __DISTRO__ +MAINTAINER packages@swift.im + +ENV DEBIAN_VERSION=__DEBIAN_VERSION__ + +# Make sure nothing needs an interactive prompt +ARG DEBIAN_FRONTEND=noninteractive + +RUN \ + apt-get -qq update && \ + apt-get install -y lintian devscripts scons build-essential dh-make pkg-config libssl-dev qt5-default libqt5x11extras5-dev libqt5webkit5-dev qtmultimedia5-dev qttools5-dev-tools qt5-image-formats-plugins libqt5svg5-dev libminiupnpc-dev libnatpmp-dev libhunspell-dev libxml2-dev libxss-dev libboost-dev libboost-filesystem-dev libboost-program-options-dev libboost-regex-dev libboost-signals-dev libboost-system-dev libboost-thread-dev libboost-date-time-dev libidn11-dev docbook-xsl docbook-xml xsltproc libxml2-utils libsqlite3-dev zlib1g-dev help2man && \ + apt-get clean + +RUN mkdir /swift-packages +COPY * /swift-packages/ + +CMD \ + gpg --allow-secret-key-import --import /gpg-keys/*.asc && \ + cd /swift-packages && \ + tar xf swift-im_${DEBIAN_VERSION}*.orig.tar.gz && \ + tar xf swift-im_${DEBIAN_VERSION}*.debian.tar.xz -C /swift-packages/swift-im-${DEBIAN_VERSION}/ && \ + cd swift-im-${DEBIAN_VERSION} && \ + debuild -i -I -b --lintian-opts --profile debian --pedantic && \ + cd /swift-packages/ && \ + rm -rf /swift-packages/swift-im-${DEBIAN_VERSION}/ && \ + rm -f /swift-packages/swift-im_${DEBIAN_VERSION}*.orig.tar.gz && \ + rm -f /swift-packages/swift-im_${DEBIAN_VERSION}*.debian.tar.xz && \ + rm -f /swift-packages/swift-im_${DEBIAN_VERSION}*.dsc && \ + rm -f /swift-packages/swift-im_${DEBIAN_VERSION}*_source.* && \ + mv * /out/ diff --git a/Swift/Packaging/Debian/Dockerfile.source b/Swift/Packaging/Debian/Dockerfile.source new file mode 100644 index 0000000..3c23b2c --- /dev/null +++ b/Swift/Packaging/Debian/Dockerfile.source @@ -0,0 +1,17 @@ +FROM debian:stretch +VOLUME ["/gpg-keys"] +MAINTAINER packages@swift.im + +RUN \ + apt-get -qq update && \ + apt-get install -y lintian devscripts scons build-essential pkg-config libssl-dev qt5-default libqt5x11extras5-dev libqt5webkit5-dev qtmultimedia5-dev qttools5-dev-tools qt5-image-formats-plugins libqt5svg5-dev libminiupnpc-dev libnatpmp-dev libhunspell-dev libxml2-dev libxss-dev libboost-dev libboost-filesystem-dev libboost-program-options-dev libboost-regex-dev libboost-signals-dev libboost-system-dev libboost-thread-dev libboost-date-time-dev libidn11-dev docbook-xsl docbook-xml xsltproc libxml2-utils libsqlite3-dev zlib1g-dev help2man && \ + apt-get clean + +COPY swift-src /swift-src + +CMD \ + gpg --allow-secret-key-import --import /gpg-keys/*.asc && \ + cd /swift-src && \ + mv swift-im_*.orig.tar.gz ../ && \ + debuild -i -I -S --lintian-opts --pedantic && \ + mv /swift-im* /out/ diff --git a/Swift/Packaging/Debian/Testing/swift-distr-tests.sh b/Swift/Packaging/Debian/Testing/swift-distr-tests.sh new file mode 100755 index 0000000..e817974 --- /dev/null +++ b/Swift/Packaging/Debian/Testing/swift-distr-tests.sh @@ -0,0 +1,103 @@ +#!/usr/bin/env bash + +# Returns 0 if all releases are valid. Needs to be run with sudo +# release_level is the level of the release to test. +# 2 will test development stream only +# 1 will test development and beta +# 0 will test all three development, beta and release + +function finish { + if [ "$?" -eq 0 ] && [ "$CLEAN_INSTALL" = True ]; then + echo "No errors found, removing base systems." + rm -rf "Debian-Tests/" + fi +} +trap finish EXIT + +if [ "$#" -lt 2 ] || [ "$#" -gt 3 ]; then + echo "Usage $0 <release_tag> <release_level> [-c]" + echo "The -c flag will recreate all base systems." + exit 1 +fi +RELEASE_LEVEL="$2" +re='^[0-9]+$' +if ! [[ "$RELEASE_LEVEL" =~ $re ]]; then + echo "error: release level is not a number" >&2; exit 1 +fi +if [ "$RELEASE_LEVEL" -gt 2 ] || [ "$RELEASE_LEVEL" -lt 0 ]; then + echo "error: release level should be between 0 and 2" >&2; exit 1 +fi +if [ "$3" == "-c" ]; then + echo "The script will create all base systems from scratch." + CLEAN_INSTALL=True +else + CLEAN_INSTALL=False +fi + +declare -A arr +#Ubuntu xenial +arr[0,0]="ubuntu" +arr[0,1]="http://archive.ubuntu.com/ubuntu" +arr[0,2]="xenial" + +#Ubuntu artful +arr[1,0]="ubuntu" +arr[1,1]="http://archive.ubuntu.com/ubuntu" +arr[1,2]="artful" + +#Debian jessie +arr[2,0]="debian" +arr[2,1]="http://deb.debian.org/debian/" +arr[2,2]="jessie" + +#Debian stretch +arr[3,0]="debian" +arr[3,1]="http://deb.debian.org/debian/" +arr[3,2]="stretch" + +#Debian sid +arr[4,0]="debian" +arr[4,1]="http://deb.debian.org/debian/" +arr[4,2]="sid" + + +DIST="$1" +RETURN_VALUE=0 + +for counter in {0..4} +do +# for ARCH in "amd64" "i386" + for ARCH in "amd64" + do + echo "========================================" + echo "Testing ${arr[${counter},0]} ${arr[${counter},2]} $ARCH" + echo "========================================" + DIST_FOLDER="Debian-Tests/${arr[${counter},0]}_${arr[${counter},2]}_$ARCH" + if [ "$CLEAN_INSTALL" = True ] ; then + rm -rf "$DIST_FOLDER" + echo "Removing $DIST_FOLDER" + fi + if [ ! -d "$DIST_FOLDER" ]; then + echo "$DIST_FOLDER was not present. Creating Base system from scratch." + { + mkdir -p "$DIST_FOLDER" + debootstrap --arch=$ARCH ${arr[${counter},2]} $DIST_FOLDER ${arr[${counter},1]} + } &>/dev/null + echo "Setup complete." + fi + cp test-distr.sh "$DIST_FOLDER" + + RELEASES_COUNT=0 + for RELEASE in "development" "beta" "release" + do + if [[ "$RELEASES_COUNT" -le "$RELEASE_LEVEL" ]]; then + chroot $DIST_FOLDER bash test-distr.sh https://swift.im/packages/${arr[${counter},0]}/${arr[${counter},2]} ${arr[${counter},2]} $DIST $RELEASE + RETURN_VALUE=$((RETURN_VALUE + $?)) + else + echo "Skipping stream: $RELEASE" + fi + RELEASES_COUNT=$((RELEASES_COUNT + 1)) + done + done +done +exit $RETURN_VALUE diff --git a/Swift/Packaging/Debian/Testing/test-distr.sh b/Swift/Packaging/Debian/Testing/test-distr.sh new file mode 100644 index 0000000..82d31ee --- /dev/null +++ b/Swift/Packaging/Debian/Testing/test-distr.sh @@ -0,0 +1,88 @@ +#!/usr/bin/env bash + +# Return values +# 0 if the package, source and installation were successful +# 1 if the source packages are missing +# 2 if the binary is not present in the repository +# 3 if the binary and source packages are not present in the repository +# 4 if the binary failed to install +# 5 if the binary failed to install and the source package is not available. + +function finish { + rm /etc/apt/sources.list.d/swift-distr.list + if [[ "$1" != "*ubuntu*" ]]; then + rm /etc/apt/sources.list.d/ubuntu-universe.list + fi + { + rm -rf swift-im* packages.key* + apt-get remove -y swift-im + apt-get autoremove -y + } &>/dev/null +} +trap finish EXIT + +if [ "$#" -ne 4 ]; then + echo "Usage $0 <remote_repository> <dist_code_name> <swift_version> <release> " + exit 1 +fi +RELEASE="$4" +echo "Repository $1 build $RELEASE contents:" +echo "------------------------" + +#Adding the swift repository +echo deb $1 $RELEASE main >/etc/apt/sources.list.d/swift-distr.list +echo deb-src $1 $RELEASE main >>/etc/apt/sources.list.d/swift-distr.list + +#Adding the ubuntu universe repository if it is not present. +if [[ "$1" != "*ubuntu*" ]]; then + if ! grep -q '^deb http://archive.ubuntu.com/ubuntu '"$2"' universe' /etc/apt/sources.list /etc/apt/sources.list.d/*.list; then + echo deb http://archive.ubuntu.com/ubuntu $2 universe >/etc/apt/sources.list.d/ubuntu-universe.list + fi +fi + +{ + apt-get remove -y swift-im + apt-get autoremove -y + apt-get update + apt-get upgrade -y + apt-get install -y apt-transport-https wget + apt-get install -y dpkg-dev + wget http://swift.im/keys/packages.key + apt-key add packages.key + apt-get update +} &>/dev/null + +RETURN_VALUE=0 +echo "Sources:" +{ + rm -rf swift-im* + apt-get source swift-im=$3 +} &>/dev/null +if [ "$?" -eq 0 ]; then + echo "Sources files downloaded." +else + echo "Sources files not present" + RETURN_VALUE=$((RETURN_VALUE + ((1 << 0)))) +fi + +echo "Binary:" +{ + apt-cache show swift-im=$3* +} &>/dev/null +if [ "$?" -ne 0 ]; then + echo "Swift package was not found in the repository." + RETURN_VALUE=$((RETURN_VALUE + ((1 << 1)))) + exit $RETURN_VALUE +fi +echo "Installing binaries" +{ + apt-get install -y swift-im=$3* +} &>/dev/null +if [ "$?" -eq 0 ]; then + echo "Installation was successful." +else + echo "Installation failed" + RETURN_VALUE=$((RETURN_VALUE + ((1 << 2)))) +fi +echo "------------------------" +exit $RETURN_VALUE diff --git a/Swift/Packaging/Debian/build_for_debian.sh b/Swift/Packaging/Debian/build_for_debian.sh index 3d79177..0f0691f 100755 --- a/Swift/Packaging/Debian/build_for_debian.sh +++ b/Swift/Packaging/Debian/build_for_debian.sh @@ -6,6 +6,6 @@ export SWIFT_DEBUILD_FLAGS="-S" ./package.sh -for arch in i386 amd64; do +for arch in amd64; do pbuilder-dist sid $arch build *.dsc done diff --git a/Swift/Packaging/Debian/changelog.debian-unstable b/Swift/Packaging/Debian/changelog.debian-unstable index d5cbd3d..f2bf2c5 100644 --- a/Swift/Packaging/Debian/changelog.debian-unstable +++ b/Swift/Packaging/Debian/changelog.debian-unstable @@ -1,7 +1,56 @@ -swift-im (2.0~beta1+dev46-1) unstable; urgency=low +swift-im (4.0.3-1) UNRELEASED; urgency=medium + + * New chat theme including a new font + * Support for message carbons (XEP-0280) + * Enabled trellis mode as a default feature, allowing several tiled chats windows to be shown at once + * Redesigned keyword highlighting + * Improve date formatting + * Fix Last Message Correction in multi client scenarios + * Fix UI layout issue for translations that require right-to-left (RTL) layout + * Fix UX issues in trellis mode + * Improvements to font size handling in the chat theme + * Add AppImage for Linux 64-bit as a supported platform + * Improved spell checker support on Linux + * Allow setting vCard on servers that do not return an empty vCard on fresh accounts + * And assorted smaller features and usability enhancements. Closes: 840151, 889062 + + -- Kevin Smith <kevin@kismith.co.uk> Thu, 03 Jan 2019 13:59:07 +0100 + +swift-im (3.0.4-1) unstable; urgency=low + + * New upstream release + * Allow compiling with newer boosts. Closes: 810839, 822131 + * Switch to Qt5 instead of Qt4. Closes: 784532, 745807 + * Fix some platform detection in build system. Closes: 757554 + * Rewrite rules file with dh sequencer. + * Drop -dbg package. + + -- Kevin Smith <kevin@kismith.co.uk> Fri, 03 Jun 2016 15:56:20 +0100 + +swift-im (2.0+dev6-1) unstable; urgency=low + + * Update from upstream. + * Don't conflict with libswiften2 overrides. Closes: 726289 + * Don't conflict with swift-im-dbg overrides. Closes: 726290 + * Don't conflict with libswiften-dev overrides. Closes: 726291 + + + -- Kevin Smith <kevin@kismith.co.uk> Mon, 14 Oct 2013 16:42:12 -0000 + +swift-im (2.0+dev5-1) unstable; urgency=low + + * Update from upstream. + * Compiles with boost >= 1.50.0; will build on sid again. Closes: #713725 + * Include dependencies for libswiften so that other packages + can depend on it. Closes: #714902 + + -- Kevin Smith <kevin@kismith.co.uk> Mon, 12 Aug 2013 16:18:09 -0000 + +swift-im (2.0~beta1+dev47-1) unstable; urgency=low * Update from upstream. - * Rename /usr/bin/swift binary to not conflict with other package. Closes: #674504 + * Rename /usr/bin/swift binary to not conflict with + other package. Closes: #674504 -- Kevin Smith <kevin@kismith.co.uk> Tue, 12 Jun 2012 19:25:12 -0000 @@ -11,4 +60,3 @@ swift-im (2.0~beta1+dev26-1) unstable; urgency=low * Thanks to Olly Betts <olly@survex.com> -- Kevin Smith <kevin@kismith.co.uk> Wed, 25 Apr 2012 09:55:52 -0000 - diff --git a/Swift/Packaging/Debian/debian/compat b/Swift/Packaging/Debian/debian/compat index 7f8f011..ec63514 100644 --- a/Swift/Packaging/Debian/debian/compat +++ b/Swift/Packaging/Debian/debian/compat @@ -1 +1 @@ -7 +9 diff --git a/Swift/Packaging/Debian/debian/control.in b/Swift/Packaging/Debian/debian/control.in index dd7be88..e779f21 100644 --- a/Swift/Packaging/Debian/debian/control.in +++ b/Swift/Packaging/Debian/debian/control.in @@ -3,16 +3,15 @@ Section: net Priority: optional Maintainer: Swift Package Maintainer <packages@swift.im> Uploaders: Remko Tronçon <dev@el-tramo.be>, Kevin Smith <kevin@kismith.co.uk> -Build-Depends: debhelper (>= 7), scons (>= 1.2.0), libssl-dev (>= 0.9.8g), libqt4-dev (>= 4.5.0), libxml2-dev (>= 2.7.6), libxss-dev (>= 1.2.0), libboost-dev (>= 1.34.1), libboost-filesystem-dev (>= 1.34.1), libboost-program-options-dev (>= 1.34.1), libboost-regex-dev (>= 1.34.1), libboost-signals-dev (>= 1.34.1), libboost-system-dev (>= 1.34.1), libboost-thread-dev (>= 1.34.1), libboost-date-time-dev (>= 1.34.1), libidn11-dev (>= 1.10), docbook-xsl (>= 1.75.0), docbook-xml (>= 4.5), xsltproc, libxml2-utils, libhunspell-dev, libnatpmp-dev, libminiupnpc-dev, libsqlite3-dev %WEBKIT_DEPENDENCY% -Standards-Version: 3.9.3 +Build-Depends: debhelper (>= 9), scons (>= 1.2.0), libssl-dev (>= 0.9.8g), qtbase5-dev (>= 5.0.0), qtchooser, qtbase5-dev-tools (>= 5.0.0), libqt5x11extras5-dev (>= 5.0.0), libqt5webkit5-dev (>= 5.0.0), qtmultimedia5-dev (>=5.0.0), qttools5-dev-tools (>=5.0.0), qt5-image-formats-plugins (>=5.0.0), libqt5svg5-dev (>=5.0.0), libxml2-dev (>= 2.7.6), libxss-dev (>= 1.2.0), libboost-dev (>= 1.34.1), libboost-filesystem-dev (>= 1.34.1), libboost-program-options-dev (>= 1.34.1), libboost-regex-dev (>= 1.34.1), libboost-signals-dev (>= 1.34.1), libboost-system-dev (>= 1.34.1), libboost-thread-dev (>= 1.34.1), libboost-date-time-dev (>= 1.34.1), libidn11-dev (>= 1.10), docbook-xsl (>= 1.75.0), docbook-xml (>= 4.5), xsltproc, libxml2-utils, libnatpmp-dev, libminiupnpc-dev, libsqlite3-dev, libhunspell-dev, zlib1g-dev, help2man +Standards-Version: 3.9.8 Vcs-Git: git://swift.im/swift Vcs-Browser: http://swift.im/git/swift Homepage: http://swift.im Package: libswiften%SWIFTEN_SOVERSION% Architecture: any -Section: net -Priority: optional +Section: libs Depends: ${shlibs:Depends}, ${misc:Depends} Description: XMPP library Swiften is a robust, high-quality, standards-compliant, cross-platform, @@ -22,20 +21,17 @@ Description: XMPP library Package: libswiften-dev Architecture: any Section: libdevel -Priority: optional -Depends: libswiften%SWIFTEN_SOVERSION% (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends} +Depends: libswiften%SWIFTEN_SOVERSION% (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends}, libboost-dev (>= 1.34.1), libboost-filesystem-dev (>= 1.34.1), libboost-regex-dev (>= 1.34.1), libboost-signals-dev (>= 1.34.1), libboost-thread-dev (>= 1.34.1), libboost-date-time-dev (>= 1.34.1) Description: XMPP library (development files) Swiften is a robust, high-quality, standards-compliant, cross-platform, and performant C++ library for implementing XMPP applications. Swiften is used as the back-end library for the Swift Instant Messaging client. . - This package contains the header development files and programs for + This package contains the header development files and programs for developing with Swiften. Package: swift-im Architecture: any -Section: net -Priority: optional Depends: libswiften%SWIFTEN_SOVERSION% (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends} Description: easy to use Jabber/XMPP chat client Swift is a free instant messaging client. It concentrates on making @@ -46,12 +42,3 @@ Description: easy to use Jabber/XMPP chat client Swift uses the XMPP protocol and so supports both the public Jabber network and closed XMPP services, such as those found in many organisations. - -Package: swift-im-dbg -Architecture: any -Section: debug -Priority: extra -Depends: swift-im (= ${binary:Version}), ${misc:Depends} -Description: XMPP client/library (debugging symbols) - This package contains the debugging symbols for debugging Swift - and Swiften applications. diff --git a/Swift/Packaging/Debian/debian/copyright b/Swift/Packaging/Debian/debian/copyright index 99eb7cc..9219930 100644 --- a/Swift/Packaging/Debian/debian/copyright +++ b/Swift/Packaging/Debian/debian/copyright @@ -3,7 +3,7 @@ with help from Olly Betts <olly@survex.com>. The upstream sources were obtained from http://swift.im. -Copyright (C) 2010-2012 Kevin Smith and Remko Tronçon +Copyright (C) 2010-2019 Isode Limited. Licensed under the GNU General Public License. See /usr/share/common-licenses/GPL-3 for the full license. diff --git a/Swift/Packaging/Debian/debian/rules b/Swift/Packaging/Debian/debian/rules index e16465d..ed432bb 100755 --- a/Swift/Packaging/Debian/debian/rules +++ b/Swift/Packaging/Debian/debian/rules @@ -2,50 +2,26 @@ #export DH_VERBOSE=1 export PYTHONDONTWRITEBYTECODE=1 +export QT_SELECT=qt5 -SCONS_FLAGS=V=1 optimize=1 debug=1 allow_warnings=1 swiften_dll=1 qt=/usr/share/qt4 docbook_xsl=/usr/share/xml/docbook/stylesheet/docbook-xsl docbook_xml=/usr/share/xml/docbook/schema/dtd/4.5 linkflags="$(shell dpkg-buildflags --get LDFLAGS)" ccflags="$(shell dpkg-buildflags --get CPPFLAGS) $(shell dpkg-buildflags --get CFLAGS)" +SCONS_FLAGS=V=1 qt5=1 optimize=1 debug=1 allow_warnings=1 swiften_dll=1 help2man=1 docbook_xsl=/usr/share/xml/docbook/stylesheet/docbook-xsl docbook_xml=/usr/share/xml/docbook/schema/dtd/4.5 linkflags="$(shell dpkg-buildflags --get LDFLAGS)" ccflags="$(shell dpkg-buildflags --get CPPFLAGS) $(shell dpkg-buildflags --get CFLAGS)" +SCONS_INSTALL_BASE=$(CURDIR)/debian/tmp +SCONS_INSTALL_FLAGS=SWIFT_INSTALLDIR=$(SCONS_INSTALL_BASE)/usr SWIFTEN_INSTALLDIR=$(SCONS_INSTALL_BASE)/usr +SWIFT_INSTALLDIR=$(SCONS_INSTALL_BASE)/usr SWIFTEN_INSTALLDIR=$(SCONS_INSTALL_BASE)/usr -clean: - dh_testdir +%: + dh $@ + +override_dh_clean: dh_clean - scons $(SCONS_FLAGS) $(SCONS_EXTRA_FLAGS) SWIFT_INSTALLDIR=$(CURDIR)/debian/tmp/usr SWIFTEN_INSTALLDIR=$(CURDIR)/debian/tmp/usr -c + scons $(SCONS_FLAGS) $(SCONS_EXTRA_FLAGS) $(SCONS_INSTALL_FLAGS) -c -rm -rf .scon* -rm -rf config.log -configure: - -build: configure - dh_testdir - scons $(SCONS_FLAGS) $(SCONS_EXTRA_FLAGS) Swift Swiften - -install: build - dh_testroot - dh_prep - dh_installdirs - scons $(SCONS_FLAGS) $(SCONS_EXTRA_FLAGS) SWIFT_INSTALLDIR=$(CURDIR)/debian/tmp/usr SWIFTEN_INSTALLDIR=$(CURDIR)/debian/tmp/usr $(CURDIR)/debian/tmp - -binary-indep: install -binary-arch: install - dh_testdir - dh_testroot - dh_install --sourcedir=debian/tmp - dh_installchangelogs - dh_installdocs - dh_installmenu - dh_installman -a - dh_link - dh_strip --dbg-package=swift-im-dbg - dh_compress - dh_fixperms - dh_makeshlibs - dh_installdeb - dh_shlibdeps - dh_gencontrol - dh_md5sums - dh_builddeb +override_dh_configure: -binary: binary-indep binary-arch +override_dh_auto_build: + scons $(SCONS_FLAGS) $(SCONS_EXTRA_FLAGS) Swift Swiften debian/swift-im.1 debian/swiften-config.1 -build-arch: build -build-indep: build -.PHONY: build clean binary-indep binary-arch binary install configure build-arch build-indep +override_dh_auto_install: + scons $(SCONS_FLAGS) $(SCONS_EXTRA_FLAGS) $(SCONS_INSTALL_FLAGS) $(SCONS_INSTALL_BASE) diff --git a/Swift/Packaging/Debian/debian/swift-im.1 b/Swift/Packaging/Debian/debian/swift-im.1 deleted file mode 100644 index b7262bf..0000000 --- a/Swift/Packaging/Debian/debian/swift-im.1 +++ /dev/null @@ -1,33 +0,0 @@ -.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.38.4. -.TH SWIFT "1" "June 2011" "Swift" "Swift Manual" -.SH NAME -swift-im \- Swift -.SH SYNOPSIS -.B swift-im -[\fIOPTIONS\fR]... -.SH DESCRIPTION -Swift is an instant messaging client for the XMPP network. -.SH OPTIONS -.TP -\fB\-\-debug\fR -Turn on debug logging -.TP -\fB\-\-help\fR -Show this help message -.TP -\fB\-\-version\fR -Show version information -.TP -\fB\-\-netbook\-mode\fR -Use netbook mode display (unsupported) -.TP -\fB\-\-no\-tabs\fR -Don't manage chat windows in tabs (unsupported) -.TP -\fB\-\-latency\-debug\fR -Use latency debugging (unsupported) -.HP -\fB\-\-multi\-account\fR arg (=1) Number of accounts to open windows for (unsupported) -.TP -\fB\-\-start\-minimized\fR -Don't show the login/roster window at startup diff --git a/Swift/Packaging/Debian/debian/swift-im.install b/Swift/Packaging/Debian/debian/swift-im.install index 9e09ac7..82242ff 100644 --- a/Swift/Packaging/Debian/debian/swift-im.install +++ b/Swift/Packaging/Debian/debian/swift-im.install @@ -1,2 +1,5 @@ usr/bin/swift-im -usr/share +usr/share/icons +usr/share/pixmaps +usr/share/swift +usr/share/applications diff --git a/Swift/Packaging/Debian/debian/swift-im.menu b/Swift/Packaging/Debian/debian/swift-im.menu deleted file mode 100644 index 68b621d..0000000 --- a/Swift/Packaging/Debian/debian/swift-im.menu +++ /dev/null @@ -1,3 +0,0 @@ -?package(swift-im):needs="X11" section="Applications/Network/Communication"\ - title="Swift IM" command="/usr/bin/swift-im"\ - icon="/usr/share/pixmaps/swift.xpm" diff --git a/Swift/Packaging/Debian/debian/swiften-config.1 b/Swift/Packaging/Debian/debian/swiften-config.1 deleted file mode 100644 index 3717df6..0000000 --- a/Swift/Packaging/Debian/debian/swiften-config.1 +++ /dev/null @@ -1,21 +0,0 @@ -.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.38.4. -.TH SWIFTEN-CONFIG "1" "June 2011" "swiften-config" "Swift Manual" -.SH NAME -swiften-config \- swiften-config -.SH SYNOPSIS -.B swiften-config -[\fIOPTIONS\fR]... -.SH DESCRIPTION -swiften\-config outputs the Swiften build options. -.TP -\fB\-\-help\fR -Show this help message -.TP -\fB\-\-version\fR -Show version information -.TP -\fB\-\-libs\fR -List the library flags -.TP -\fB\-\-cflags\fR -List the compiler & preprocessor flags diff --git a/Swift/Packaging/Debian/package.sh b/Swift/Packaging/Debian/package.sh index 8c7c89f..62dfff0 100755 --- a/Swift/Packaging/Debian/package.sh +++ b/Swift/Packaging/Debian/package.sh @@ -50,13 +50,15 @@ else rm -rf $DIRNAME/.git find $DIRNAME -name .gitignore | xargs rm -f if [ -z "$SWIFT_COPY_UUID" ]; then - find $DIRNAME/3rdParty -type f | grep -v SConscript | grep -v miniupnp | grep -v natpmp |xargs rm -f + find $DIRNAME/3rdParty -type f | grep -v SConscript | xargs rm -f else find $DIRNAME/3rdParty -type f | grep -v uuid | grep -v SConscript | grep -v miniupnp | grep -v natpmp || xargs rm -f fi find $DIRNAME/3rdParty -depth -empty -type d -exec rmdir {} \; rm -rf $DIRNAME/3rdParty/SCons rm -rf $DIRNAME/Swift/Packaging/Debian + rm -rf $DIRNAME/BuildTools/DocBook/Fonts + rm -rf $DIRNAME/BuildTools/Git/Hooks/commit-msg # Initialize the build version echo $VERSION > $DIRNAME/VERSION.swift diff --git a/Swift/Packaging/Debian/package_all_platforms.sh b/Swift/Packaging/Debian/package_all_platforms.sh index 47c6b82..afd0621 100755 --- a/Swift/Packaging/Debian/package_all_platforms.sh +++ b/Swift/Packaging/Debian/package_all_platforms.sh @@ -1,8 +1,11 @@ #!/bin/bash +# Quit immediately if any part fails +set -e + ## To get to this stage you need to already have the pbuilder-dist stuff installed, and have already run: -# for distro in squeeze sid lucid maverick; do -# for arch in i386 amd64; do +# for distro in xenial yakkety jessie sid; do +# for arch in amd64; do # pbuilder-dist $distro $arch create # done # done @@ -10,20 +13,26 @@ export SWIFT_DEBUILD_FLAGS="-S" export SWIFT_FORCE_LUCID="yep" -./package.sh +#./package.sh -for distro in lucid squeeze; do - for arch in i386 amd64; do - pbuilder-dist $distro $arch build *.dsc - done -done +#for distro in lucid squeeze; do +# for arch in i386 amd64; do +# pbuilder-dist $distro $arch build *.dsc +# done +#done unset SWIFT_FORCE_LUCID ./package.sh -for distro in maverick sid; do - for arch in i386 amd64; do +if [ -z ${SWIFT_PACKAGE_PLATFORMS+x} ]; +then + platformsarray=( xenial artful jessie stretch sid ) +else + platformsarray=( $SWIFT_PACKAGE_PLATFORMS ) +fi + +for distro in "${platformsarray[@]}"; do + for arch in amd64; do pbuilder-dist $distro $arch build *.dsc done done - diff --git a/Swift/Packaging/Debian/package_docker.sh b/Swift/Packaging/Debian/package_docker.sh new file mode 100755 index 0000000..7fd1a3e --- /dev/null +++ b/Swift/Packaging/Debian/package_docker.sh @@ -0,0 +1,70 @@ +#!/bin/bash + +set -e + +cd $(dirname $(readlink -f $0 || realpath $0)) +export PYTHONPATH=../../../BuildTools/SCons +VERSION=${VERSION:=`../../../BuildTools/GetBuildVersion.py swift`} +DEBIAN_VERSION=`../../../BuildTools/DebianizeVersion.py $VERSION` +SWIFTEN_SOVERSION=`../../../BuildTools/GetBuildVersion.py swift --major` +SWIFT_SOURCE_DIR=swift-im-$DEBIAN_VERSION +TARBALLBARE="swift-im_$DEBIAN_VERSION.orig.tar.gz" +TARBALL="${SHARED_DIR}${TARBALLBARE}" +# DEVATTN there is an issue with some versions of Qt(5.11.1) and docker see https://bugreports.qt.io/browse/QTBUG-64490. Workaround is to add privileged flag +if [ -z ${DOCKERRUNEXTRAFLAGS+x} ]; +then + DOCKERRUNEXTRAFLAGS="--privileged" +fi + +rm -rf $SWIFT_SOURCE_DIR +git clone ../../../.git $SWIFT_SOURCE_DIR + +rm -rf $SWIFT_SOURCE_DIR/.git +find $SWIFT_SOURCE_DIR -name .gitignore | xargs rm -f +find $SWIFT_SOURCE_DIR/3rdParty -type f | grep -v uuid | grep -v SConscript | grep -v miniupnp | grep -v natpmp || xargs rm -f +find $SWIFT_SOURCE_DIR/3rdParty -depth -empty -type d -exec rmdir {} \; +rm -rf $SWIFT_SOURCE_DIR/3rdParty/SCons +rm -rf $SWIFT_SOURCE_DIR/Swift/Packaging/Debian +rm -rf $SWIFT_SOURCE_DIR/BuildTools/DocBook/Fonts +rm -rf $SWIFT_SOURCE_DIR/BuildTools/Git/Hooks/commit-msg +echo $VERSION > $SWIFT_SOURCE_DIR/VERSION.swift + +tar czf $TARBALLBARE $SWIFT_SOURCE_DIR +cp $TARBALLBARE $SWIFT_SOURCE_DIR + +cp -r debian $SWIFT_SOURCE_DIR/debian +../../../BuildTools/UpdateDebianChangelog.py $SWIFT_SOURCE_DIR/debian/changelog $DEBIAN_VERSION + +cat $SWIFT_SOURCE_DIR/debian/control.in | sed -e "s/%SWIFTEN_SOVERSION%/$SWIFTEN_SOVERSION/g" | sed -e "s/%WEBKIT_DEPENDENCY%/$WEBKIT_DEPENDENCY/g" > $SWIFT_SOURCE_DIR/debian/control +rm $SWIFT_SOURCE_DIR/debian/control.in +mv $SWIFT_SOURCE_DIR/debian/libswiften.install $SWIFT_SOURCE_DIR/debian/libswiften$SWIFTEN_SOVERSION.install +cat ../../../COPYING.thirdparty | tail -n +3 >> $SWIFT_SOURCE_DIR/debian/copyright + +rm -rf swift-src +mv $SWIFT_SOURCE_DIR swift-src +docker build -t swift/swiftsourcebuilder -f Dockerfile.source . +mkdir -p out/source +docker run --rm -v`pwd`/gpg-keys:/gpg-keys -v`pwd`/out/source:/out swift/swiftsourcebuilder + +TMP_DOCKERFILE=Dockerfile.tmp.package + +if [ -z ${SWIFT_PACKAGE_PLATFORMS+x} ]; +then + platformsarray=( ubuntu:bionic ubuntu:cosmic debian:stretch debian:sid ) +else + platformsarray=( $SWIFT_PACKAGE_PLATFORMS ) +fi + +for distro in "${platformsarray[@]}"; +do + if [ -f $TMP_DOCKERFILE ]; + then + rm $TMP_DOCKERFILE + fi + cat Dockerfile.package.in | sed -e "s/__DISTRO__/$distro/" -e "s/__DEBIAN_VERSION__/$DEBIAN_VERSION/" > $TMP_DOCKERFILE + docker build -t swift/packager -f $TMP_DOCKERFILE out/source + OUT_DIR="out/${distro//\://}" + echo $OUT_DIR + mkdir -p $OUT_DIR + docker run --rm $DOCKERRUNEXTRAFLAGS -v`pwd`/gpg-keys:/gpg-keys -v`pwd`/$OUT_DIR:/out swift/packager +done diff --git a/Swift/Packaging/Debian/update_debian_repo.sh b/Swift/Packaging/Debian/update_debian_repo.sh new file mode 100644 index 0000000..fc736ed --- /dev/null +++ b/Swift/Packaging/Debian/update_debian_repo.sh @@ -0,0 +1,114 @@ +#!/usr/bin/env bash + +# This script uses reprepro to create or update an apt repository with new packages +# from an incoming directory for multiple distributions and update channels. +# +# Release Channels: stable (apt name release), testing (apt name beta), development (apt name development) +# Packages: swift-im, libswiften, libswiften-dev + +# fail on error +set -e +shopt -s nullglob + +# configuration via environment variables +INCOMING_FOLDER="${SWIFT_APT_INCOMING_FOLDER:-error}" +if [ "$INCOMING_FOLDER" = "error" ]; +then + { echo >&2 "Please set SWIFT_APT_INCOMING_FOLDER to the folder where new packages are read from."; exit 1; } +fi + +APT_REPO_ROOT="${SWIFT_APT_REPO_ROOT:-error}" +if [ "$APT_REPO_ROOT" = "error" ]; +then + { echo >&2 "Please set SWIFT_APT_REPO_ROOT to the folder where the root of the apt repository should be created."; exit 1; } +fi + +# Prepare temporary directory used by reprepro +APT_TEMP_DIR=/tmp/swift_reprepro_tmp +rm -rfd $APT_TEMP_DIR +mkdir -p $APT_TEMP_DIR + +function write_reprepo_conf_distributions_to_file { +cat <<EOM >$1 +Codename: beta +Components: main +Architectures: i386 amd64 source +SignWith: packages@swift.im +Contents: . .gz .bz2 +DebIndices: Packages Release . .gz .bz2 +DscIndices: Sources Release . .gz .bz2 + +Codename: development +Components: main +Architectures: i386 amd64 source +SignWith: packages@swift.im +Contents: . .gz .bz2 +DebIndices: Packages Release . .gz .bz2 +DscIndices: Sources Release . .gz .bz2 + +Codename: release +Components: main +Architectures: i386 amd64 source +SignWith: packages@swift.im +Contents: . .gz .bz2 +DebIndices: Packages Release . .gz .bz2 +DscIndices: Sources Release . .gz .bz2 +EOM +} + +function write_reprepo_conf_incoming_to_file { +cat <<EOM >$1 +Name: swift +IncomingDir: $2 +TempDir: $APT_TEMP_DIR +Allow: beta development release +Multiple: Yes +Cleanup: unused_files on_error +Permit: unused_files older_version +EOM +} + +# check for existence of reprepro command +command -v reprepro >/dev/null 2>&1 || { echo >&2 "This script requires aptly but it's not installed. See https://www.aptly.info/ for further information. Aborting."; exit 1; } + +mkdir -p $APT_REPO_ROOT + +if [ -z ${SWIFT_PACKAGE_PLATFORMS+x} ]; then + platformsarray=( bionic cosmic stretch sid ) +else + platformsarray=( $SWIFT_PACKAGE_PLATFORMS ) +fi + +# distros +for full_distribution_path in $INCOMING_FOLDER/{debian,ubuntu}/*; do + distro_version=`basename $full_distribution_path` + distro_name=$(basename `dirname $full_distribution_path`) + distro_reprepro_root=${APT_REPO_ROOT}/${distro_name}/${distro_version} + + if ! [[ ${platformsarray[@]} == *"$distro_version"* ]]; then + echo "$distro_version was not found in SWIFT_PACKAGE_PLATFORMS. Skipping..." + continue + fi + + # ensure reprepro directory for this distribution version is present + if [ ! -d "$distro_reprepro_root" ]; then + echo "Create distribution repository for $distro_name/$distro_version" + mkdir -p $distro_reprepro_root + mkdir -p ${distro_reprepro_root}/conf + + write_reprepo_conf_distributions_to_file "${distro_reprepro_root}/conf/distributions" + write_reprepo_conf_incoming_to_file "${distro_reprepro_root}/conf/incoming" "$full_distribution_path" + fi + + # This is workaround for https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=808558 + # and https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=843402 + if [ "$distro_name/$distro_version" = "debian/sid" ]; then + sed -i '/dbgsym/ d' $full_distribution_path/*.changes + fi + + echo "Process incoming packages for $distro_name/$distro_version" + #set +e + reprepro -V -b ${distro_reprepro_root} processincoming swift + #set -e +done +echo "Successfully finished updating apt repository." diff --git a/Swift/Packaging/MacOSX/Swift.dmg.gz b/Swift/Packaging/MacOSX/Swift.dmg.gz Binary files differindex 0451101..ca2b520 100644 --- a/Swift/Packaging/MacOSX/Swift.dmg.gz +++ b/Swift/Packaging/MacOSX/Swift.dmg.gz diff --git a/Swift/Packaging/MacOSX/package.sh b/Swift/Packaging/MacOSX/package.sh index d7a31d2..7a63237 100755 --- a/Swift/Packaging/MacOSX/package.sh +++ b/Swift/Packaging/MacOSX/package.sh @@ -4,6 +4,7 @@ APP=$1 TEMPLATE=$2 TARGET=$3 QTDIR=$4 +CODESIGN_IDENTITY=$5 if [[ ! -f "$TEMPLATE" || ! -d "$APP" || ! -d "$QTDIR" || -z "$TARGET" ]]; then echo "Error" @@ -21,6 +22,20 @@ mkdir -p $WC_DIR hdiutil attach "$WC_DMG" -noautoopen -quiet -mountpoint "$WC_DIR" ditto -rsrc "$APP" "$WC_DIR"/`basename $APP` $QTDIR/bin/macdeployqt "$WC_DIR"/`basename $APP` -no-strip + +# The bearer plugins of Qt5 cannot be disabled by an application. +# They will constantly ask the OS to scan for available wireless networks, unrelated to actual API calls. +# This results in unnessecary resource load, so we remove the plugins from our packages. +rm "$WC_DIR"/`basename $APP`/Contents/PlugIns/bearer/*.dylib + +# Remove debugging symbols from the application bundle +rm -rf "$WC_DIR"/`basename $APP`/Contents/MacOS/*.dSYM + +# Codesign the app bundle if requested by caller +if [ ! -z "$CODESIGN_IDENTITY" ]; then + codesign --verbose --force --deep --sign "$CODESIGN_IDENTITY" "$WC_DIR"/`basename $APP` +fi + hdiutil detach "$WC_DIR" -quiet -force rm -f $TARGET hdiutil convert "$WC_DMG" -quiet -format UDZO -imagekey zlib-level=9 -o "$TARGET" diff --git a/Swift/Packaging/SConscript b/Swift/Packaging/SConscript new file mode 100644 index 0000000..fda5182 --- /dev/null +++ b/Swift/Packaging/SConscript @@ -0,0 +1,29 @@ +Import("env") +import os + +################################################################################ +# Build +################################################################################ + +if env["SCONS_STAGE"] == "build" : + help2man = env.WhereIs('help2man', os.environ['PATH']) + if help2man: + env['HELP2MAN'] = help2man + env['HELP2MANSTR'] = "HELP2MAN $TARGET" + + if Dir("#/debian").exists(): + # This is needed for debian packaging using pbuilder which expects + # generated man pages in this location. + env['HELP2MAN_DEBIAN_DIR'] = "#/debian" + else: + env['HELP2MAN_DEBIAN_DIR'] = "Debian/debian" + + swiftenConfigHelp = env.Command( + target='$HELP2MAN_DEBIAN_DIR/swiften-config.1', source='#/Swiften/Config/swiften-config', + action = Action('$HELP2MAN --no-discard-stderr -m "Swift Manual" -S "swiften-config" -n "swiften-config" -N $SOURCE > $TARGET', cmdstr = "$HELP2MANSTR")) + swiftHelp = env.Command( + target='$HELP2MAN_DEBIAN_DIR/swift-im.1', source='#/Swift/QtUI/swift-im', + action = Action('$HELP2MAN --no-discard-stderr -m "Swift Manual" -S "Swift" -n "swift-im" -N "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:./Swiften $SOURCE" > $TARGET', cmdstr = "$HELP2MANSTR")) + else: + print("Enabled help2man but help2man is not in the PATH of the current environment.") + Exit(1) diff --git a/Swift/Packaging/Source/package.sh b/Swift/Packaging/Source/package.sh index 4d229a6..3872b35 100755 --- a/Swift/Packaging/Source/package.sh +++ b/Swift/Packaging/Source/package.sh @@ -1,17 +1,31 @@ #!/bin/sh ## For a Swiften-only tarball, try -## EXCLUDE_FOLDERS="Swift Sluift Swiftob Limber Slimber" ./package.sh +## EXCLUDE_FOLDERS="Swift Sluift Limber Slimber" ./package.sh + +## This script will require GPG and a suitable signing key by default. +## To disable tarball signature generation, pass the --nosign parameter to package.sh. export PYTHONPATH=../../../BuildTools/SCons VERSION=`../../../BuildTools/GetBuildVersion.py swift` DIRNAME=swift-$VERSION +FIRST_ARGUMENT=$1 if [ -z "$VERSION" ]; then echo "Unable to determine version" exit -1 fi +if [ "`uname -s`" = "Darwin" ]; then + TAR=gtar + if ! $TAR --version >/dev/null 2>&1; then + echo "Unable to find GNU tar (coulnd't find $TAR)" + exit 1 + fi +else + TAR=tar +fi + echo "Cleaning up old sources ..." rm -rf swift-* @@ -29,4 +43,21 @@ do done echo "Creating tarball ..." -tar czf $DIRNAME.tar.gz $DIRNAME +$TAR -czf $DIRNAME.tar.gz --owner=swift --group=swift $DIRNAME + +if [ "$FIRST_ARGUMENT" != "--nosign" ]; then + echo "Creating armored GPG signature ..." + which gpg + if [ $? -eq 0 ]; then + gpg --list-keys packages@swift.im + if [ $? -eq 0 ]; then + gpg --armor --default-key packages@swift.im --detach-sign $DIRNAME.tar.gz + else + echo "Key for packages@swift.im missing. Not signing tar archive." + exit 1 + fi + else + echo "GPG not found. Not signing tar archive." + exit 1 + fi +fi
\ No newline at end of file diff --git a/Swift/Packaging/WiX/Swift.wxs b/Swift/Packaging/WiX/Swift.wxs index 4215679..a2e8dd6 100644 --- a/Swift/Packaging/WiX/Swift.wxs +++ b/Swift/Packaging/WiX/Swift.wxs @@ -3,14 +3,32 @@ <!-- For a sensible tutorial on WiX, see http://wix.tramontana.co.hu/tutorial --> <Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'> - <?include variables.wxs ?> <Product Name='Swift' Id='*' UpgradeCode='D7F276D5-BA67-421E-817B-9E7AB4B7D2BF' Language='1033' Codepage='1252' Version='$(var.Version)' Manufacturer='Swift.im'> - <Package Id='*' Keywords='Installer' Description="Swift Installer" Comments="Swift is available under the GPL version 3" Manufacturer="Swift.im" InstallerVersion='300' Languages='1033' Compressed='yes' SummaryCodepage='1252' InstallScope="perMachine"/> + <Package Id='*' Keywords='Installer' Description="Swift Installer" Comments="Swift is available under the GPL version 3" Manufacturer="Swift.im" InstallerVersion='500' Languages='1033' Compressed='yes' SummaryCodepage='1252' /> + <Property Id="ALLUSERS" Value="2" /> + <Property Id="MSIINSTALLPERUSER" Value="1" /> + <Property Id="WIXUIVCREDISTINSTALL" Value="0" /> + + <Property Id="VCREDISTINSTALLED"> + <RegistrySearch Id="VCREDISTINSTALLED" + Root="HKLM" + Key="SOFTWARE\Wow6432Node\Microsoft\VisualStudio\$(var.MsvcDotVersion)\VC\Runtimes\$(sys.BUILDARCH)" + Name="Installed" + Type="raw" /> + + </Property> <Media Id='1' Cabinet='Swift.cab' EmbedCab='yes'/> - <MajorUpgrade DowngradeErrorMessage="A newer version is already installed. Remove this version if you wish to downgrade." /> + <!-- Schedule the upgrade to afterInstallExecute means that MSI will first install the new version + over the existing version and run the uninstall of the old version afterwards. This way shortcuts + are not recreated on every new installation and pinned shortcuts stay alive. + However this requires that the components for installed files with the same filename will always + have the same GUID (do not run heat.exe with -gg flag) or else when MSI removes the components + of the old version with the same filename as components of the new version it will delete the + files that belong to components of the new version.--> + <MajorUpgrade Schedule="afterInstallExecute" DowngradeErrorMessage="A newer version is already installed. Remove this version if you wish to downgrade." /> <Directory Id='TARGETDIR' Name='SourceDir'> <!-- Disabling CRT merge module, because it's not working @@ -18,6 +36,9 @@ --> <Directory Id='ProgramFilesFolder' Name='PFiles'> + <Directory Id="APPLICATIONFOLDER" Name="Swift"> + </Directory> + <!--<Directory Id='INSTALLDIR' Name='Swift'> </Directory>--> </Directory> @@ -35,8 +56,11 @@ <Directory Id="DesktopFolder" Name="Desktop" /> </Directory> + <Property Id="WixAppFolder" Value="WixPerUserFolder" /> + <Feature Id='Core' Level='1' Title='Swift' Description='All necessary Swift files' Display='expand' ConfigurableDirectory='INSTALLDIR' AllowAdvertise='no' Absent='disallow'> <ComponentGroupRef Id='Files' /> + <ComponentGroupRef Id='VCFiles' /> <!--<ComponentRef Id='Manual' />--> </Feature> @@ -46,33 +70,133 @@ <!--<UIRef Id='WixUI_Advanced'/>--> <!--<UIRef Id="WixUI_Minimal"/>--> - <UIRef Id="WixUI_Mondo"/> + <!--UIRef Id="WixUI_Mondo"/--> + <UIRef Id="WixUI_Swift"/> + <WixVariable Id='WixUILicenseRtf' Value='COPYING.rtf'/> <Icon Id="Swift.exe" SourceFile="Swift.exe" /> <Property Id="ARPPRODUCTICON" Value="Swift.exe"/> <!-- The icon in the "Programs" dialog --> - <!-- - VC Redistributable - --> - <!-- Disabling CRT merge module, because it's not working - <Feature Id='CRT' Title='Visual C++ Runtime' AllowAdvertise='no' Display='hidden' Level='1'> - <MergeRef Id="CRT"/> - </Feature> - --> - <Binary Id="CRT.exe" SourceFile="$(var.VCCRTFile)"/> - <CustomAction Id="InstallCRT" Impersonate="yes" Return="ignore" Execute="immediate" BinaryKey="CRT.exe" ExeCommand="/qb"/> - <Property Id="CRT_INSTALLED" Secure="yes"> - <RegistrySearch Id="VC2008SP1REDIST_X86Value" Root="HKLM" Key="SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{9A25302D-30C0-39D9-BD6F-21E6EC160475}" Name="Publisher" Type="raw" Win64="no" /> - </Property> - <!-- The following snippet should work for VC 2010 - <Upgrade Id='{1F4F1D2A-D9DA-32CF-9909-48485DA06DD5}'> - <UpgradeVersion OnlyDetect='yes' Property='CRT_INSTALLED' Minimum='10.0.40219' IncludeMinimum='yes'/> - </Upgrade> + <!-- + VC Redistributable --> + + <Binary Id="CRTBinary" SourceFile="$(var.VCCRTFile)"/> + + <CustomAction Id="CRTAction" Impersonate="no" Return="asyncNoWait" Execute="deferred" BinaryKey="CRTBinary" ExeCommand="/passive"/> <InstallUISequence> - <Custom Action="InstallCRT" After="ProgressDlg">Not Installed And Not CRT_INSTALLED</Custom> + <!-- Suppress FindRelatedProducts untill the user selects the scope of the install --> + <FindRelatedProducts Suppress="yes" /> </InstallUISequence> + <InstallExecuteSequence> + <Custom Action='CRTAction' After='InstallInitialize'>(NOT VCREDISTINSTALLED AND ALLUSERS = 1) OR WIXUIVCREDISTINSTALL = 1</Custom> + </InstallExecuteSequence> </Product> + <Fragment> + <DirectoryRef Id="INSTALLDIR"> + <Component Id="msvcp.dll" Guid="*"> + <Condition>(NOT (VCREDISTINSTALLED OR ALLUSERS = 1)) AND WIXUIVCREDISTINSTALL = 0 </Condition> + <File Id="msvcp$(var.MsvcVersion).dll" KeyPath="yes" Source="$(var.VCCRTPath)\msvcp$(var.MsvcVersion).dll" /> + </Component> + <Component Id="vcruntime.dll" Guid="*"> + <Condition>(NOT (VCREDISTINSTALLED OR ALLUSERS = 1)) AND WIXUIVCREDISTINSTALL = 0 </Condition> + <?if $(var.MsvcVersion) > "120"?> + <File Id="vcruntime$(var.MsvcVersion).dll" KeyPath="yes" Source="$(var.VCCRTPath)\vcruntime$(var.MsvcVersion).dll" /> + <?else?> + <File Id="msvcr$(var.MsvcVersion).dll" KeyPath="yes" Source="$(var.VCCRTPath)\msvcr$(var.MsvcVersion).dll" /> + <?endif?> + </Component> + </DirectoryRef> + </Fragment> + <Fragment> + <ComponentGroup Id="VCFiles"> + <ComponentRef Id="msvcp.dll" /> + <ComponentRef Id="vcruntime.dll" /> + </ComponentGroup> + </Fragment> + <Fragment> + + <WixVariable Id="WixUISupportPerUser" Value="1" Overridable="yes" /> + <WixVariable Id="WixUISupportPerMachine" Value="1" Overridable="yes" /> + + <!-- This is Based on WixUI_Mondo, but it adds an InstallScopeDlg dialog --> + <UI Id="WixUI_Swift"> + <TextStyle Id="WixUI_Font_Normal" FaceName="Tahoma" Size="8" /> + <TextStyle Id="WixUI_Font_Bigger" FaceName="Tahoma" Size="12" /> + <TextStyle Id="WixUI_Font_Title" FaceName="Tahoma" Size="9" Bold="yes" /> + + <Property Id="DefaultUIFont" Value="WixUI_Font_Normal" /> + <Property Id="WixUI_Mode" Value="Mondo" /> + + <DialogRef Id="ErrorDlg" /> + <DialogRef Id="FatalError" /> + <DialogRef Id="FilesInUse" /> + <DialogRef Id="MsiRMFilesInUse" /> + <DialogRef Id="PrepareDlg" /> + <DialogRef Id="ProgressDlg" /> + <DialogRef Id="ResumeDlg" /> + <DialogRef Id="UserExit" /> + + <Publish Dialog="ExitDialog" Control="Finish" Event="EndDialog" Value="Return" Order="999">1</Publish> + + <Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="LicenseAgreementDlg">NOT Installed AND NOT PATCH</Publish> + <Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg">Installed AND PATCH</Publish> + + <Publish Dialog="LicenseAgreementDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg">1</Publish> + <Publish Dialog="LicenseAgreementDlg" Control="Next" Event="NewDialog" Value="InstallScopeDlg" Order="2">LicenseAccepted = "1"</Publish> + + <Publish Dialog="InstallScopeDlg" Control="Back" Event="NewDialog" Value="LicenseAgreementDlg">1</Publish> + <!-- override default WixAppFolder of WixPerMachineFolder as standard user won't be shown the radio group to set WixAppFolder --> + <Publish Dialog="InstallScopeDlg" Control="Next" Property="WixAppFolder" Value="WixPerUserFolder" Order="1">!(wix.WixUISupportPerUser) AND NOT Privileged</Publish> + <Publish Dialog="InstallScopeDlg" Control="Next" Property="ALLUSERS" Value="{}" Order="2">WixAppFolder = "WixPerUserFolder"</Publish> + <Publish Dialog="InstallScopeDlg" Control="Next" Property="ALLUSERS" Value="1" Order="3">WixAppFolder = "WixPerMachineFolder"</Publish> + <Publish Dialog="InstallScopeDlg" Control="Next" Property="APPLICATIONFOLDER" Value="[WixPerUserFolder]" Order="4">WixAppFolder = "WixPerUserFolder"</Publish> + <Publish Dialog="InstallScopeDlg" Control="Next" Property="APPLICATIONFOLDER" Value="[WixPerMachineFolder]" Order="5">WixAppFolder = "WixPerMachineFolder"</Publish> + <Publish Dialog="InstallScopeDlg" Control="Next" Event="NewDialog" Value="SetupTypeDlg">1</Publish> + <!-- After selecting the scope of the installation, run FindRelatedProducts to find previous versions that needs upgrading --> + <Publish Dialog="InstallScopeDlg" Control="Next" Event="DoAction" Value="FindRelatedProducts" Order="6">1</Publish> + + <Publish Dialog="SetupTypeDlg" Control="Back" Event="NewDialog" Value="InstallScopeDlg">1</Publish> + <Publish Dialog="SetupTypeDlg" Control="TypicalButton" Event="NewDialog" Value="VCResdistDialog">NOT VCREDISTINSTALLED AND NOT ALLUSERS </Publish> + <Publish Dialog="SetupTypeDlg" Control="CustomButton" Event="NewDialog" Value="CustomizeDlg">NOT VCREDISTINSTALLED AND NOT ALLUSERS </Publish> + <Publish Dialog="SetupTypeDlg" Control="CompleteButton" Event="NewDialog" Value="VCResdistDialog">NOT VCREDISTINSTALLED AND NOT ALLUSERS </Publish> + <Publish Dialog="SetupTypeDlg" Control="TypicalButton" Event="NewDialog" Value="VerifyReadyDlg">VCREDISTINSTALLED OR ALLUSERS = 1</Publish> + <Publish Dialog="SetupTypeDlg" Control="CustomButton" Event="NewDialog" Value="CustomizeDlg">VCREDISTINSTALLED OR ALLUSERS = 1</Publish> + <Publish Dialog="SetupTypeDlg" Control="CompleteButton" Event="NewDialog" Value="VerifyReadyDlg">VCREDISTINSTALLED OR ALLUSERS = 1</Publish> + + <Dialog Id="VCResdistDialog" Width="260" Height="85" Title="[ProductName] Setup"> + <Control Id="VcRredistNo" Type="PushButton" X="132" Y="57" Width="56" Height="17" Default="yes" Cancel="yes" Text="!(loc.WixUINo)"> + <Publish Property="WIXUIVCREDISTINSTALL" Value="0">1</Publish> + <Publish Event="NewDialog" Value="VerifyReadyDlg">1</Publish> + </Control> + <Control Id="VcRredistYes" Type="PushButton" X="72" Y="57" Width="56" Height="17" Text="!(loc.WixUIYes)"> + <Publish Property="WIXUIVCREDISTINSTALL" Value="1">1</Publish> + <Publish Event="NewDialog" Value="VerifyReadyDlg">1</Publish> + </Control> + <Control Id="Text" Type="Text" X="48" Y="15" Width="194" Height="30" NoPrefix="yes" Text="Visual Studio redistributables installation was not found on your computer. Would you like Swift to install them?" /> + <Control Id="Icon" Type="Icon" X="15" Y="15" Width="24" Height="24" ToolTip="!(loc.CancelDlgIconTooltip)" FixedSize="yes" IconSize="32" Text="!(loc.CancelDlgIcon)" /> + </Dialog> + + <Publish Dialog="CustomizeDlg" Control="Back" Event="NewDialog" Value="MaintenanceTypeDlg" Order="1">WixUI_InstallMode = "Change"</Publish> + <Publish Dialog="CustomizeDlg" Control="Back" Event="NewDialog" Value="SetupTypeDlg" Order="2">WixUI_InstallMode = "InstallCustom"</Publish> + <Publish Dialog="CustomizeDlg" Control="Next" Event="NewDialog" Value="VCResdistDialog" Order="1">NOT VCREDISTINSTALLED AND NOT ALLUSERS</Publish> + <Publish Dialog="CustomizeDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg" Order="2">VCREDISTINSTALLED OR ALLUSERS = 1</Publish> + + <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="CustomizeDlg" Order="1">WixUI_InstallMode = "InstallCustom"</Publish> + <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="SetupTypeDlg" Order="2">WixUI_InstallMode = "InstallTypical" OR WixUI_InstallMode = "InstallComplete"</Publish> + <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="CustomizeDlg" Order="3">WixUI_InstallMode = "Change"</Publish> + <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="MaintenanceTypeDlg" Order="4">WixUI_InstallMode = "Repair" OR WixUI_InstallMode = "Remove"</Publish> + <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg" Order="2">WixUI_InstallMode = "Update"</Publish> + + <Publish Dialog="MaintenanceWelcomeDlg" Control="Next" Event="NewDialog" Value="MaintenanceTypeDlg">1</Publish> + + <Publish Dialog="MaintenanceTypeDlg" Control="ChangeButton" Event="NewDialog" Value="CustomizeDlg">1</Publish> + <Publish Dialog="MaintenanceTypeDlg" Control="RepairButton" Event="NewDialog" Value="VerifyReadyDlg">1</Publish> + <Publish Dialog="MaintenanceTypeDlg" Control="RemoveButton" Event="NewDialog" Value="VerifyReadyDlg">1</Publish> + <Publish Dialog="MaintenanceTypeDlg" Control="Back" Event="NewDialog" Value="MaintenanceWelcomeDlg">1</Publish> + </UI> + <UIRef Id="WixUI_Common" /> + </Fragment> </Wix> diff --git a/Swift/Packaging/WiX/Swift_en-us.wxl b/Swift/Packaging/WiX/Swift_en-us.wxl new file mode 100644 index 0000000..780b290 --- /dev/null +++ b/Swift/Packaging/WiX/Swift_en-us.wxl @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8"?> +<WixLocalization Culture="en-us" xmlns="http://schemas.microsoft.com/wix/2006/localization"> + <String Id="InstallScopeDlgPerUserDescription">[ProductName] will be installed in a user folder and auto-updates will be enabled. The application be installed only for your user and you do not need to be an Administrator. </String> +</WixLocalization> diff --git a/Swift/Packaging/WiX/include.xslt b/Swift/Packaging/WiX/include.xslt index ec1ad50..df86446 100644 --- a/Swift/Packaging/WiX/include.xslt +++ b/Swift/Packaging/WiX/include.xslt @@ -1,6 +1,6 @@ <?xml version="1.0"?> -<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:wix="http://schemas.microsoft.com/wix/2006/wi"> +<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:wix="http://schemas.microsoft.com/wix/2006/wi" xmlns="http://schemas.microsoft.com/wix/2006/wi" exclude-result-prefixes="xsl wix"> <xsl:template match='wix:Directory[@Id="Swift"]/@Id'> <xsl:attribute name='Id'>INSTALLDIR</xsl:attribute> @@ -11,4 +11,14 @@ <xsl:apply-templates select="@*|node()"/> </xsl:copy> </xsl:template> + + <xsl:template match="wix:Component"> + <xsl:copy> + <xsl:apply-templates select="@*"/> + <xsl:value-of select="concat(preceding-sibling::text(), ' ')" /> + <RemoveFile Id="remove_{@Id}" Name="{@Id}" On="install" /> + <xsl:apply-templates select="node()"/> + </xsl:copy> + </xsl:template> + </xsl:stylesheet> diff --git a/Swift/Packaging/appimage/Dockerfile b/Swift/Packaging/appimage/Dockerfile new file mode 100644 index 0000000..37530d1 --- /dev/null +++ b/Swift/Packaging/appimage/Dockerfile @@ -0,0 +1,19 @@ +FROM centos:6 + +RUN yum -y install epel-release wget +RUN wget http://people.centos.org/tru/devtools-2/devtools-2.repo -O /etc/yum.repos.d/devtools-2.repo && yum -y upgrade +RUN yum -y install devtoolset-2-gcc devtoolset-2-binutils devtoolset-2-gcc-c++ openssl-devel qt5-qtbase-devel qt5-qttools-libs-designercomponents qt5-qttools-devel qt5-qtwebkit-devel qt5-qtsvg-devel qt5-qttools-devel qt5-qttools-static qt5-qtmultimedia-devel qt5-qtwebchannel-devel qt5-qtimageformats-devel git patch qt5-qtmultimedia-devel qt5-qtx11extras-devel libtool +RUN cd / && git clone https://github.com/swift/swift +#RUN cd / && git clone --depth 1 https://github.com/probonopd/AppImageKit.git +#RUN cd /AppImageKit && scl enable devtoolset-2 ./build.sh +RUN cd / && wget https://github.com/probonopd/AppImageKit/releases/download/continuous/appimaged-x86_64.AppImage && chmod u+rx /appimaged-x86_64.AppImage +RUN yum -y install fuse-libs libarchive +RUN ln -s /usr/lib64/libarchive.so.2 /usr/lib64/libarchive.so.13 +RUN cd / && wget https://github.com/probonopd/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage && chmod u+x appimagetool-x86_64.AppImage +RUN cd / && wget https://raw.githubusercontent.com/probonopd/AppImages/master/recipes/meta/Recipe +RUN yum -y install desktop-file-utils +ADD build.sh /build.sh +RUN chmod u+x /build.sh +#RUN cd /swift && scl enable devtoolset-2 './scons max_jobs=1' +ADD swift.yml /swift.yml +ADD config.py /swift/config.py diff --git a/Swift/Packaging/appimage/build.sh b/Swift/Packaging/appimage/build.sh new file mode 100644 index 0000000..53264fc --- /dev/null +++ b/Swift/Packaging/appimage/build.sh @@ -0,0 +1,26 @@ +#!/bin/bash +SIXTYFOUR='' +cd /swift +git pull --rebase +mkdir -p /build +#scl enable devtoolset-2 './scons max_jobs=1 SWIFT_INSTALLDIR=/build /build' +./scons max_jobs=1 SWIFT_INSTALLDIR=/build /build +cd /build +ldd bin/swift-im | grep '=>' | awk '{print $3}' | xargs -I '{}' cp -v -L '{}' ./lib/ || true +mkdir -p lib/qt5 +cp -r /usr/lib${SIXTYFOUR}/qt5/plugins ./lib/qt5/plugins +cp -L /lib${SIXTYFOUR}/libudev.so.0 ./lib/ +cp /usr/lib${SIXTYFOUR}/libQt5XcbQpa.so* ./lib/ +cp -L /usr/local/gcc-4.9.4/lib/libstdc++.so.6 ./lib/ +mkdir -p /appstuff +cd /appstuff +bash -ex /Recipe /swift.yml +cd /appstuff/Swift/Swift.AppDir +rm AppRun +wget -c https://github.com/probonopd/AppImageKit/releases/download/6/AppRun_6-i686 -O AppRun +chmod +x AppRun +cd .. +rm appimagetool +wget -c https://github.com/probonopd/AppImageKit/releases/download/continuous/appimagetool-i686.AppImage -O appimagetool +chmod +x appimagetool +./appimagetool Swift.AppDir Swift-i686.AppImage diff --git a/Swift/Packaging/appimage/build_appimage.py b/Swift/Packaging/appimage/build_appimage.py new file mode 100644 index 0000000..b49ef7f --- /dev/null +++ b/Swift/Packaging/appimage/build_appimage.py @@ -0,0 +1,167 @@ +#!/usr/bin/env python2 +# +# This Python script builds self-contained Linux packages, i.e. AppImages ( http://appimage.org/ ), of Swift. +# It downloads required appimage tool that is executed at the end and an exculde list from the internet. +# +# Non-standard dependencies: +# * plumbum ( https://plumbum.readthedocs.io/en/latest/ ) +# * click ( http://click.pocoo.org/5/ ) +# +# They can be installed via `pip install plumbum click`. +# +# The script requires git, wget, readelf and objcopy to work and will fail if +# they are not present. +# +# Just run ./Swift/Packaging/appimage/build_appimage.py and after it executed +# there should be .appimage and .debug files in Packages/Swift. +# +# The appimage will be for the same architecture as the host architecture. +# Pass `--qt5=False` to the tool to build against legacy Qt4. +# +# To include newer libstdc++.so or similar libs in an AppImage, use -li parameters. + +from plumbum import local, FG, BG, RETCODE, colors, commands +import click +import os +import re +import time +import sys + +git = local['git'] + +def git_working_dir(): + working_dir = git('rev-parse', '--show-toplevel').strip() + if not os.path.exists(working_dir): + working_dir = os.path.dirname(os.path.abspath(git('rev-parse', '--git-dir').strip())) + return working_dir + +git_working_dir = git_working_dir() +resources_dir = os.path.join(git_working_dir, "Swift/resources/") + +@click.command() +@click.option('--qt5', default=True, type=bool, help='Build with Qt5.') +@click.option('--includelib', '-il', type=click.Path(), multiple=True, help='Copy extra library into AppImage.') +def build_appimage(qt5, includelib): + print(colors.bold & colors.info | "Switch to git working directory root " + git_working_dir) + with local.cwd(git_working_dir): + + def copy_dependencies_into_appdir(excludelist, binary_path, lib_path): + chain = local['ldd'][binary_path] | local['grep']["=> /"] | local['awk']['{print $3}'] + for dynamic_lib in chain().strip().split('\n'): + if os.path.basename(dynamic_lib) in excludelist: + #print(colors.info | "Not including " + dynamic_lib + " as it is blacklisted.") + pass + else: + local['cp']('-v', '-L', dynamic_lib, lib_path) + + scons = local['./scons'] + print(colors.bold & colors.info | "Building Swift") + scons['qt5={0}'.format("1" if qt5 else "0"), 'Swift'] & FG + + swift = local['./Swift/QtUI/swift-im'] + swift_version = swift('--version').strip() + print(colors.bold & colors.info | "Successfully built " + swift_version) + + swift_architecture_string = "" + try: + readelf_on_swift_im_output = local['readelf']('-h', './Swift/QtUI/swift-im').strip() + swift_architecture = re.search(r'Class:\s+([^\s]+)', readelf_on_swift_im_output, flags=re.I).group(1) + if swift_architecture == "ELF32": + swift_architecture_string = ".i386" + elif swift_architecture == "ELF64": + swift_architecture_string = ".amd64" + except: + pass + + appdir_path = os.path.join(git_working_dir, 'Swift/Packaging/AppImage/Swift.AppDir') + print(colors.bold & colors.info | "Prepare AppDir structure at " + appdir_path) + local['mkdir']('-p', appdir_path) + + swift_install_dir = os.path.join(appdir_path, 'usr') + print(colors.bold & colors.info | "Install Swift to AppDir") + scons['qt5={0}'.format("1" if qt5 else "0"), 'Swift', 'SWIFT_INSTALLDIR=' + swift_install_dir , swift_install_dir] & FG + + print(colors.bold & colors.info | "Download dynamic lib exclude list from https://raw.githubusercontent.com/AppImage/AppImages/master/excludelist") + local['wget']['--no-check-certificate', '-O', '/tmp/excludelist', 'https://raw.githubusercontent.com/AppImage/AppImages/master/excludelist'] & FG + + print(colors.bold & colors.info | "Load dynamic library exclude list") + excludelist = set() + with open('/tmp/excludelist') as f: + for line in f: + if line and "#" not in line: + excludelist.add(line.strip()) + + print(colors.bold & colors.info | "Copy dynamic library dependencies into AppDir") + local['mkdir']('-p', os.path.join(appdir_path, 'usr/lib')) + appdir_swift_im_binary = os.path.join(swift_install_dir, 'bin/swift-im') + copy_dependencies_into_appdir(excludelist, appdir_swift_im_binary, os.path.join(swift_install_dir, "lib")) + + if qt5: + print(colors.bold & colors.info | "Analyze binary for Qt plugin paths") + # Run Swift binary and parse debug output to find plugin paths to copy. + swift_plugin_debug_output = "" + try: + process = local["env"]["QT_DEBUG_PLUGINS=1", './Swift/QtUI/swift-im'].popen() + time.sleep(2) + process.kill() + stdout, stderr = process.communicate() + swift_plugin_debug_output = stderr + except: + pass + if swift_plugin_debug_output: + matches = re.search(r"/.*/qt5/plugins", swift_plugin_debug_output) + if matches: + qt5_plugin_path = matches.group(0) + appdir_qt5_plugin_path = os.path.join(appdir_path, 'usr/lib/qt5') + local['mkdir']('-p', appdir_qt5_plugin_path) + local['cp']('-r', '-L', qt5_plugin_path, appdir_qt5_plugin_path) + + print(colors.bold & colors.info | "Copy plugin dependencies into AppDir") + for plugin_path in local.path(appdir_qt5_plugin_path) // "plugins/*/*.so": + copy_dependencies_into_appdir(excludelist, plugin_path, os.path.join(swift_install_dir, "lib")) + + if includelib: + for includelib_path in includelib: + print(colors.bold & colors.info | "Copy " + includelib_path + " to AppDir.") + local['cp']('-v', '-L', includelib_path, os.path.join(swift_install_dir, "lib")) + + print(colors.bold & colors.info | "Download https://github.com/AppImage/AppImageKit/raw/appimagetool/master/resources/AppRun to " + os.path.join(appdir_path, 'AppRun')) + local['wget']('--no-check-certificate', '-O', os.path.join(appdir_path, 'AppRun'), "https://github.com/AppImage/AppImageKit/raw/appimagetool/master/resources/AppRun") + local['chmod']('+x', os.path.join(appdir_path, 'AppRun')) + + print(colors.bold & colors.info | "Copy swift.desktop file") + source_desktop_file = os.path.join(resources_dir, "swift.desktop") + target_desktop_file = os.path.join(appdir_path, 'swift.desktop') + local['cp']('-v', '-L', source_desktop_file, target_desktop_file) + + print(colors.bold & colors.info | "Copy logos to Swift.AppDir") + local['cp']('-v', '-L', os.path.join(resources_dir, "logo/logo-icon-512.png"), os.path.join(appdir_path, "swift.png")) + local['cp']('-v', '-L', os.path.join(resources_dir, "logo/logo-icon.svg"), os.path.join(appdir_path, "swift.svg")) + local['cp']('-v', '-L', os.path.join(resources_dir, "logo/logo-icon-32.xpm"), os.path.join(appdir_path, "swift.xpm")) + + print(colors.bold & colors.info | "Download appimagetool to /tmp/appimagetool and make it executable") + appimage_url_suffix = "" + if swift_architecture_string == ".amd64": + appimage_url_suffix = "x86_64.AppImage" + else: + appimage_url_suffix = "i686.AppImage" + local['wget']['-O', '/tmp/appimagetool', 'https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-' + appimage_url_suffix] & FG + local['chmod']['a+x', '/tmp/appimagetool']() + + local['mkdir']('-p', os.path.join(git_working_dir, "Packages/Swift")) + appimage_path = os.path.join(git_working_dir, "Packages/Swift/" + swift_version.replace(" ", "-") + swift_architecture_string + ".appimage") + debug_symbol_path = os.path.join(git_working_dir, "Packages/Swift/" + swift_version.replace(" ", "-") + swift_architecture_string + ".debug") + + print(colors.bold & colors.info | "Extract debug information from swift-im") + local['objcopy']('--only-keep-debug', appdir_swift_im_binary, debug_symbol_path) + local['strip']('-g', appdir_swift_im_binary) + debuglink_retcode = local['objcopy']['--add-gnu-debuglink', debug_symbol_path, os.path.join(swift_install_dir, 'bin/swift-im')] & RETCODE + if debuglink_retcode != 0: + print(colors.bold & colors.warn | "Failed to create debuglink in binary.") + + print(colors.bold & colors.info | "Generate AppImage from Swift.AppDir") + local['/tmp/appimagetool'][appdir_path, appimage_path] & FG + + +if __name__ == '__main__': + build_appimage()
\ No newline at end of file diff --git a/Swift/Packaging/appimage/centos6.sh b/Swift/Packaging/appimage/centos6.sh new file mode 100644 index 0000000..0f27819 --- /dev/null +++ b/Swift/Packaging/appimage/centos6.sh @@ -0,0 +1,25 @@ +#!/bin/bash +yum -y install epel-release wget +# devtools turns out not to work, but it's a step I did so I'm recording it. +wget http://people.centos.org/tru/devtools-2/devtools-2.repo -O /etc/yum.repos.d/devtools-2.repo && yum -y upgrade +yum -y install devtoolset-2-gcc devtoolset-2-binutils devtoolset-2-gcc-c++ openssl-devel qt5-qtbase-devel qt5-qttools-libs-designercomponents qt5-qttools-devel qt5-qtwebkit-devel qt5-qtsvg-devel qt5-qttools-devel qt5-qttools-static qt5-qtmultimedia-devel qt5-qtwebchannel-devel qt5-qtimageformats-devel git patch qt5-qtmultimedia-devel qt5-qtx11extras-devel libtool fuse-libs libarchive desktop-file-utils gcc-c++ +cd / +wget https://github.com/probonopd/AppImageKit/releases/download/continuous/appimagetool-i686.AppImage +chmod u+rx /appimagetool-i686.AppImage +wget https://raw.githubusercontent.com/probonopd/AppImages/master/recipes/meta/Recipe +yum -y install svn texinfo-tex flex zip libgcc.i686 glibc-devel.i686 +mkdir -p /usr/local/src +cd /usr/local/src +svn co svn://gcc.gnu.org/svn/gcc/tags/gcc_4_9_4_release/ +cd gcc_4_9_4_release +./contrib/download_prerequisites +mkdir release_build +cd release_build +../configure --prefix=/usr/local/gcc-4.9.4 +make +make install +echo "/usr/local/gcc-4.9.4/lib" > /etc/ld.so.conf.d/newgcc.conf +echo 'export PATH=/usr/local/gcc-4.9.4/bin:$PATH' >> /etc/profile +cd / +git clone https://github.com/swift/swift +# Run build.sh diff --git a/Swift/Packaging/appimage/config.py b/Swift/Packaging/appimage/config.py new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/Swift/Packaging/appimage/config.py @@ -0,0 +1 @@ + diff --git a/Swift/Packaging/appimage/run.sh b/Swift/Packaging/appimage/run.sh new file mode 100755 index 0000000..2d90490 --- /dev/null +++ b/Swift/Packaging/appimage/run.sh @@ -0,0 +1,2 @@ +#!/bin/bash +docker build -t swiftbuild . diff --git a/Swift/Packaging/appimage/swift.yml b/Swift/Packaging/appimage/swift.yml new file mode 100644 index 0000000..b873baf --- /dev/null +++ b/Swift/Packaging/appimage/swift.yml @@ -0,0 +1,12 @@ +app: Swift + +# ingredients: +# script: +# - cp -r /build/* usr/ +script: + - cp -r /build/* usr/ + - strip usr/bin/* + - cp /build/share/applications/swift.desktop . + - cp /build/share/pixmaps/swift.xpm . +# post: +# - cp -r /build/lib/* usr/lib/ |