From ff42f801b72e3563918d56c4dd3b2c7e78122348 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20W=C3=A4ckerlin?= Date: Thu, 5 Nov 2015 09:53:22 +0000 Subject: [PATCH] updated build system --- ChangeLog | 9 ++++++++ ax_init_standard_project.m4 | 33 +++++++++++++++++++++-------- bootstrap.sh | 41 +++++++++++++++++++++++++++++-------- build-in-docker.sh | 15 ++++++++++++++ resolve-debbuilddeps.sh | 12 +++++++++-- 5 files changed, 91 insertions(+), 19 deletions(-) create mode 100755 build-in-docker.sh diff --git a/ChangeLog b/ChangeLog index 32b7262..e5d44af 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2015-11-03 21:48 marc + + * debian/control.in: updated dependencies + +2015-11-03 11:45 marc + + * ChangeLog, ax_check_qt.m4, bootstrap.sh, resolve-debbuilddeps.sh: + prepared for build in a docker instance on jenkins + 2015-11-01 23:53 marc * AUTHORS, ChangeLog, ax_init_standard_project.m4, bootstrap.sh, diff --git a/ax_init_standard_project.m4 b/ax_init_standard_project.m4 index b49e82e..e9f31eb 100644 --- a/ax_init_standard_project.m4 +++ b/ax_init_standard_project.m4 @@ -265,14 +265,8 @@ maintainer-clean-cxx-targets: EOF ]) -# use this in configure.ac to support CppUnit for C++ unit tests -AC_DEFUN([AX_USE_CPPUNIT], [ - AM_PATH_CPPUNIT([1.0.0], [have_cppunit="yes"], [have_cppunit="no"]) - # infos and warnings - if test "$have_cppunit" = "no"; then - AC_MSG_WARN([Missing cppunit development library! - - you cannot check the library using "make check" - - everything else works perfectly]); fi +# use this in configure.ac to support tests without CppUnit +AC_DEFUN([AX_BUILD_TEST], [ AC_CONFIG_FILES([test/makefile]) AX_ADD_MAKEFILE_TARGET_DEP([maintainer-clean-am], [maintainer-clean-test-targets], [test/makefile.in]) test -f test/makefile.in && cat >> test/makefile.in < /dev/null)"; then + DEB_DEPEND_IFEXISTS+=", ${pkg}" + fi + AC_SUBST(DEB_DEPEND_IFEXISTS) +]) diff --git a/bootstrap.sh b/bootstrap.sh index 2c7c4c3..9a76cde 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -19,6 +19,7 @@ PROJECT_PATH=$(pwd) DEFAULT_PROJECT_NAME=${PROJECT_PATH##*/} configure=0 build=0 +docker=0 buildtarget="distcheck" overwrite=0 rebuild=0 @@ -26,6 +27,7 @@ rebuildfiles=() while test $# -gt 0; do case "$1" in (--configure|-c) configure=1;; + (--docker|-d) docker=1;; (--build|-b) configure=1; build=1;; (--target|-t) shift; configure=1; build=1; buildtarget="$1";; (--overwrite|-o) overwrite=1;; @@ -42,6 +44,7 @@ SYNOPSIS OPTIONS --configure, -c call ./configure after initialization + --docker, -d build and run tests in a docker instance --build, -b build, also call ./configure && make distcheck --target, -t same as -b, but specify target instead of distcheck --overwrite, -o overwrite all basic files (bootstrap.sh, m4-macros) @@ -105,6 +108,7 @@ GENERATED FILES * ax_check_qt.m4 - auxiliary macro definition file * resolve-debbuilddeps.sh - script to install debian package dependencies * resolve-rpmbuilddeps.sh - script to install RPM package dependencies + * build-in-docker.sh - script to build the project encapsulated in a docker container * build-resource-file.sh - build resource.qrc file from a resource directory * mac-create-app-bundle.sh - script to create apple mac os-x app-bundle * AUTHORS - replace your name in AUTHORS before first run @@ -119,7 +123,7 @@ GENERATED FILES * scripts/makefile.in - if you enabled AX_USE_SCRIPTS * doc/makefile.am - if you enabled AX_USE_DOXYGEN * doc/doxyfile.in - if you enabled AX_USE_DOXYGEN - * test/makefile.am - if you enabled AX_USE_CPPUNIT + * test/makefile.am - if you enabled AX_BUILD_TEST or AX_USE_CPPUNIT * examples/makefile.am - if you enabled AX_BUILD_EXAMPLES * debian/changelog.in - if you enabled AX_USE_DEBIAN_PACKAGING * debian/control.in - if you enabled AX_USE_DEBIAN_PACKAGING @@ -170,7 +174,7 @@ FILE DEPENDENCIES * test/makefile.am depends on AX_USE_LIBTOOL * html/makefile.am depends on AX_BUILD_HTML * doc/doxyfile.in depends on AX_BUILD_EXAMPLES - * debian/control.in depends on AX_USE_DOXYGEN, AX_USE_CPPUNIT, + * debian/control.in depends on AX_USE_DOXYGEN, AX_USE_CPPUNIT AX_CXX_QT, AX_CHECK_QT, AX_REQUIRE_QT, AX_USE_LIBTOOL * debian/${DEFAULT_PROJECT_NAME}.install depends on AX_USE_LIBTOOL * debian/${DEFAULT_PROJECT_NAME}.dirs depends on AX_USE_LIBTOOL @@ -207,6 +211,7 @@ FILES * Enable Debian packaging by calling "make deb": AX_USE_DEBIAN_PACKAGING * Enable RPM packaging by calling "make rpm": AX_USE_RPM_PACKAGING * Enable C++ testing using CppUnit: AX_USE_CPPUNIT + * Enable other tests: AX_BUILD_TEST * Enable C++ examples, i.e. for libraries: AX_BUILD_EXAMPLES * Check for C++11 support: AX_CXX_COMPILE_STDCXX_11 (see ax_cxx_compile_stdcxx_11.m4) * Require a QT module: AX_REQUIRE_QT (see ax_check_qt.m4) @@ -404,6 +409,7 @@ copy ax_cxx_compile_stdcxx_11.m4 copy ax_check_qt.m4 copy resolve-debbuilddeps.sh copy resolve-rpmbuilddeps.sh +copy build-in-docker.sh copy build-resource-file.sh copy mac-create-app-bundle.sh AUTHOR=$(gpg -K | sed -n 's,uid *,,p' | sort | head -1) @@ -439,6 +445,7 @@ AX_INIT_STANDARD_PROJECT #AX_USE_DEBIAN_PACKAGING #AX_USE_RPM_PACKAGING #AX_USE_CPPUNIT +#AX_BUILD_TEST #AX_BUILD_EXAMPLES #AX_BUILD_HTML @@ -458,8 +465,8 @@ IFS="$SAVEIFS" PackageName=${PackageName[*]^} PackageName=${PackageName// /} -if ! testtag "AX_CHECK_QT" configure.ac && \ - ! testtag "AX_REQUIRE_QT" configure.ac; then +if ! testtag AX_CHECK_QT && \ + ! testtag AX_REQUIRE_QT; then echo "${HEADER}MAINTAINERCLEANFILES = makefile.in" | \ to --condition AX_USE_CXX src/makefile.am elif ! test -e src/makefile.am; then @@ -695,10 +702,20 @@ namespace NAMESPACE { EOF echo "${HEADER}MAINTAINERCLEANFILES = makefile.in" | to --condition AX_USE_SCRIPTS scripts/makefile.am echo "${HEADER}MAINTAINERCLEANFILES = makefile.in" | to --condition AX_USE_DOXYGEN doc/makefile.am -to --condition AX_USE_CPPUNIT test/makefile.am < debian/control + for f in $(sed -n 's, *AX_DEB_DEPEND_IFEXISTS(\([^)]*\)).*,\1,p' configure.ac); do + if test -n "$(apt-cache policy -q ${f})" && ! dpkg -l "${f}"; then + TO_INSTALL+=" ${f}" + fi + done trap "rm debian/control" INT TERM EXIT + sed 's,@DEB_DEPEND_IFEXISTS@,,g' debian/control.in | \ + sed 's,@[^@]*@, dummytext,g' > debian/control fi if test -n "${SCHROOTNAME}"; then @@ -38,7 +47,6 @@ else fi DEPS=$(echo "$DEPS" | sed -n '/Unmet build dependencies/ { s,.*Unmet build dependencies: ,,g; s, ([^)]*),,g; s, *| *,|,g; p}') -TO_INSTALL= for pa in ${DEPS}; do if test ${pa//|/} = ${pa}; then TO_INSTALL+=" ${pa}"