From 226021ea5a3672dda54c6fe1a1e9c9b5704a97c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20W=C3=A4ckerlin?= Date: Tue, 3 Nov 2015 09:29:22 +0000 Subject: [PATCH] faster resolve-bebuilddeps.sh --- ChangeLog | 50 ++++++++++++++++ ax_check_qt.m4 | 32 +++++++++-- bootstrap.sh | 123 ++++++++++++++++++++++++++++++++++++---- resolve-debbuilddeps.sh | 31 ++++++++-- 4 files changed, 215 insertions(+), 21 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5ef73f3..f4ae18d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,53 @@ +2015-11-02 22:43 marc + + * resolve-debbuilddeps.sh: sudo or not sudo shall be the problem of + the caller + +2015-11-01 17:39 marc + + * debian/control.in: build fixes + +2015-11-01 15:30 marc + + * resolve-debbuilddeps.sh: build fixes + +2015-11-01 15:25 marc + + * bootstrap.sh, resolve-debbuilddeps.sh: build fixes + +2015-11-01 14:10 marc + + * AUTHORS: build fixes + +2015-11-01 13:12 marc + + * debian/control.in: build fixes + +2015-11-01 13:05 marc + + * debian/control.in: build fixes + +2015-11-01 12:37 marc + + * bootstrap.sh, resolve-debbuilddeps.sh: build fixes + +2015-11-01 12:23 marc + + * debian/control.in: build fixes + +2015-11-01 11:46 marc + + * resolve-debbuilddeps.sh: build fixes + +2015-11-01 11:42 marc + + * ChangeLog, ax_check_qt.m4, ax_init_standard_project.m4, + bootstrap.sh, resolve-debbuilddeps.sh: build fixes + +2015-11-01 11:25 marc + + * debian/control.in: missing automake in dependencies + 2015-10-20 12:54 marc * doc/doxyfile.in, resolve-rpmbuilddeps.sh: no search engine for diff --git a/ax_check_qt.m4 b/ax_check_qt.m4 index 479f65c..af3a238 100644 --- a/ax_check_qt.m4 +++ b/ax_check_qt.m4 @@ -103,7 +103,12 @@ AC_DEFUN([AX_CHECK_QT], [ HAVE_$1=1 AC_DEFINE([HAVE_$1]) QTDIR=$(${PKG_CONFIG} --variable=prefix Qt5Core) - QT_PLUGIN_PATH=${QTDIR}/share/qt5/plugins + qt_host_bins=$(${PKG_CONFIG} --variable=host_bins Qt5Core) + if test -d "${qt_host_bins}"; then + QT_PLUGIN_PATH=${qt_host_bins}/../plugins + else + QT_PLUGIN_PATH=${QTDIR}/share/qt5/plugins + fi MOC_FLAGS+=" -DHAVE_$1=1 ${[$1]5_CFLAGS}" [$1]_CPPFLAGS="${[$1]5_CFLAGS}" [$1]_CXXFLAGS="${[$1]5_CFLAGS}" @@ -145,7 +150,12 @@ AC_DEFUN([AX_CHECK_QT], [ HAVE_$1=1 AC_DEFINE([HAVE_$1]) QTDIR=$(${PKG_CONFIG} --variable=prefix QtCore) - QT_PLUGIN_PATH=${QTDIR}/share/qt/plugins + qt_host_bins=$(${PKG_CONFIG} --variable=host_bins QtCore) + if test -d "${qt_host_bins}"; then + QT_PLUGIN_PATH=${qt_host_bins}/../plugins + else + QT_PLUGIN_PATH=${QTDIR}/share/qt/plugins + fi MOC_FLAGS+=" -DHAVE_$1=1 ${$1_CFLAGS}" [$1]_CPPFLAGS="${[$1]_CFLAGS}" [$1]_CXXFLAGS="${[$1]_CFLAGS}" @@ -188,6 +198,16 @@ AC_DEFUN([AX_CHECK_QT], [ if test -n "${MINGW}"; then AX_CHECK_VALID_CXX_FLAG([-Wl,-subsystem,windows], [windows console flag]) fi + test "x$prefix" = xNONE && prefix=$ac_default_prefix + if test "${QT_PLUGIN_PATH}" = "${QT_PLUGIN_PATH#${prefix}}"; then + QT_PLUGIN_PATH=${prefix}${QT_PLUGIN_PATH#/usr} + fi + AC_ARG_WITH([qt-plugin-path], + [AS_HELP_STRING([--with-qt-plugin-path=PATH], + [define a different qt plugin path, current @<:@default=check@:>@])], + [QT_PLUGIN_PATH=$with_qt_plugin_path], + []) + AC_MSG_NOTICE([Qt Plugins are installed to ${QT_PLUGIN_PATH}]) AC_SUBST(QTDIR) AC_SUBST(QT_PLUGIN_PATH) AC_SUBST(CPPFLAGS) @@ -214,10 +234,10 @@ qrc_%.cxx: %.qrc %.qm: %.ts ${LRELEASE} $< -qm [$][@] -#%.ts: ${LANGUAGE_FILES:%=%} -# ${LUPDATE} -no-obsolete \ -# -target-language ${@:${LANGUAGE_FILE_BASE}_%.ts=%} \ -# -ts [$][@] $< +%.ts: ${LANGUAGE_FILES:%=%} + ${LUPDATE} -no-obsolete \ + -target-language ${@:${LANGUAGE_FILE_BASE}_%.ts=%} \ + -ts [$][@] $< ']) diff --git a/bootstrap.sh b/bootstrap.sh index 4bc9434..bb90775 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -240,15 +240,29 @@ done HEADER='## @id '"\$Id\$"' -# -# This file has been added by '${MY_NAME}' on '$(LANG= date +"%a, %d %B %Y %H:%M:%S %z")' -# Feel free to change it or even remove and rebuild it, up to your needs -# +## +## This file has been added: +## - by '${MY_NAME}' +## - on '$(LANG= date +"%a, %d %B %Y %H:%M:%S %z")' +## Feel free to change it or even remove and rebuild it, up to your needs +## ## 1 2 3 4 5 6 7 8 ## 45678901234567890123456789012345678901234567890123456789012345678901234567890 ' +CHEADER='/** @id '"\$Id\$"' + + This file has been added: + - by '${MY_NAME}' + - on '$(LANG= date +"%a, %d %B %Y %H:%M:%S %z")' + +*/ +// 1 2 3 4 5 6 7 8 +// 45678901234567890123456789012345678901234567890123456789012345678901234567890 + +' + notice() { echo -e "\e[1;33m$*\e[0m" } @@ -436,12 +450,19 @@ AX_INIT_STANDARD_PROJECT # create output AC_OUTPUT EOF + PACKAGE_NAME=$(sed -n 's/.*m4_define *( *x_package_name *, *\([^ ]*\) *).*/\1/p' configure.ac) +SAVEIFS="$IFS" +IFS="-" PackageName=( $PACKAGE_NAME ) +IFS="$SAVEIFS" +PackageName=${PackageName[*]^} +PackageName=${PackageName// /} + if ! testtag "AX_CHECK_QT" configure.ac && \ ! testtag "AX_REQUIRE_QT" configure.ac; then echo "${HEADER}MAINTAINERCLEANFILES = makefile.in" | \ to --condition AX_USE_CXX src/makefile.am -else +elif ! test -e src/makefile.am; then to --condition AX_USE_CXX src/makefile.am < +#include +#include +#include + +int main(int argc, char *argv[]) try { + QApplication a(argc, argv); + QCommandLineParser parser; + parser.addHelpOption(); + parser.process(a); + QStringList scripts(parser.positionalArguments()); + ${PackageName} w; + w.show(); + return a.exec(); + } catch (std::exception &x) { + std::cerr<<"**** error: "< +#include + +/// Main Window +/** Main window for ${PACKAGE_NAME} */ +class ${PackageName}: public QMainWindow, protected Ui::${PackageName} { + Q_OBJECT; + public: + explicit ${PackageName}(QWidget *parent = 0): QMainWindow(parent) { + setupUi(this); + } + virtual ~${PackageName}() {} +}; + +#endif +EOF + to --condition AX_USE_CXX src/${PACKAGE_NAME}.ui < + + ${PackageName} + + + + 0 + 0 + 800 + 600 + + + + ${PackageName} + + + + + + 0 + 0 + 800 + 22 + + + + + + + + +EOF + to --condition AX_USE_CXX src/languages.qrc < + + ${PACKAGE_NAME}_de.qm + ${PACKAGE_NAME}_fr.qm + ${PACKAGE_NAME}_it.qm + ${PACKAGE_NAME}_en.qm + + EOF fi to --condition AX_USE_CXX src/version.hxx < debian/control +if test -e debian/control.in -a ! -e debian/control; then + sed 's,@[^@]*@, dummytext,g' debian/control.in > debian/control + trap "rm debian/control" INT TERM EXIT +fi if test -n "${SCHROOTNAME}"; then - schroot -c "${SCHROOTNAME}" -u root -d / -- apt-get install -y dpkg-dev DEPS=$(schroot -c "${SCHROOTNAME}" -- dpkg-checkbuilddeps 2>&1 || true) else - apt-get install -y dpkg-dev - apt-get update DEPS=$(dpkg-checkbuilddeps 2>&1 || true) 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}" + continue; + fi success=0 - for p in $(echo "${pa}" | sed 's,|, ,g'); do + for p in ${pa//|/ }; do if test -n "${SCHROOTNAME}"; then if schroot -c "${SCHROOTNAME}" -u root -d / -- apt-get -y install ${p}; then success=1 @@ -41,7 +46,23 @@ for pa in ${DEPS}; do done if test ${success} -eq 0; then echo "**** Error: Installation Failed: ${pa}" + exit 1 fi done +success=0 +if test -n "${SCHROOTNAME}"; then + if schroot -c "${SCHROOTNAME}" -u root -d / -- apt-get -y install ${TO_INSTALL}; then + success=1 + fi +else + if apt-get -y install ${TO_INSTALL}; then + success=1 + fi +fi +if test ${success} -eq 0; then + echo "**** Error: Installation Failed: ${pa}" + exit 1 +fi + echo "**** Success: All Dependencies Resolved"