rev 16496 - in trunk/packages/automoc/debian: . patches source
Modestas Vainius
modax at alioth.debian.org
Tue Dec 29 19:23:17 UTC 2009
Author: modax
Date: 2009-12-29 19:23:17 +0000 (Tue, 29 Dec 2009)
New Revision: 16496
Added:
trunk/packages/automoc/debian/patches/
trunk/packages/automoc/debian/patches/01_patch_out_qprocess_bug561203.diff
trunk/packages/automoc/debian/patches/series
trunk/packages/automoc/debian/source/
trunk/packages/automoc/debian/source/format
Modified:
trunk/packages/automoc/debian/changelog
trunk/packages/automoc/debian/control
trunk/packages/automoc/debian/rules
Log:
* Use dh v7 and minimal rules file:
- build depend on debhelper 7.3 for cmake support;
* Switch package to dpkg-source format 3.0 (quilt).
* Replace QProcess with standard POSIX calls. This should work around
toolchain problems on hppa and allow kde4libs and other KDE packages to
build (patch 01_patch_out_qprocess_bug561203.diff). See bug#561203.
* Urgency=high because it should fix kde4libs FTBFS on hppa.
Modified: trunk/packages/automoc/debian/changelog
===================================================================
--- trunk/packages/automoc/debian/changelog 2009-12-29 00:25:36 UTC (rev 16495)
+++ trunk/packages/automoc/debian/changelog 2009-12-29 19:23:17 UTC (rev 16496)
@@ -1,4 +1,4 @@
-automoc (1.0~version-0.9.88-3) UNRELEASED; urgency=low
+automoc (1.0~version-0.9.88-3) unstable; urgency=high
[ Karl Ferdinand Ebert ]
* Bumped standard version to 3.8.3:
@@ -9,8 +9,15 @@
[ Modestas Vainius ]
* Change my email address to modax at debian.org in Uploaders field.
+ * Use dh v7 and minimal rules file:
+ - build depend on debhelper 7.3 for cmake support;
+ * Switch package to dpkg-source format 3.0 (quilt).
+ * Replace QProcess with standard POSIX calls. This should work around
+ toolchain problems on hppa and allow kde4libs and other KDE packages to
+ build (patch 01_patch_out_qprocess_bug561203.diff). See bug#561203.
+ * Urgency=high because it should fix kde4libs FTBFS on hppa.
- -- Debian Qt/KDE Maintainers <debian-qt-kde at lists.debian.org> Sat, 14 Nov 2009 15:27:52 +0100
+ -- Debian Qt/KDE Maintainers <debian-qt-kde at lists.debian.org> Tue, 29 Dec 2009 21:17:54 +0200
automoc (1.0~version-0.9.88-2) unstable; urgency=low
Modified: trunk/packages/automoc/debian/control
===================================================================
--- trunk/packages/automoc/debian/control 2009-12-29 00:25:36 UTC (rev 16495)
+++ trunk/packages/automoc/debian/control 2009-12-29 19:23:17 UTC (rev 16496)
@@ -3,7 +3,7 @@
Priority: extra
Maintainer: Debian Qt/KDE Maintainers <debian-qt-kde at lists.debian.org>
Uploaders: Sune Vuorela <debian at pusling.com>, Fathi Boudra <fabo at debian.org>, Modestas Vainius <modax at debian.org>
-Build-Depends: debhelper (>= 7), libqt4-dev, cmake
+Build-Depends: debhelper (>= 7.3), libqt4-dev, cmake
Standards-Version: 3.8.3
Homepage: http://cia.vc/stats/project/kde/automoc
Added: trunk/packages/automoc/debian/patches/01_patch_out_qprocess_bug561203.diff
===================================================================
--- trunk/packages/automoc/debian/patches/01_patch_out_qprocess_bug561203.diff (rev 0)
+++ trunk/packages/automoc/debian/patches/01_patch_out_qprocess_bug561203.diff 2009-12-29 19:23:17 UTC (rev 16496)
@@ -0,0 +1,116 @@
+From: Modestas Vainius <modax at debian.org>
+Subject: Replace QProcess with standard POSIX calls
+ This works around pthreads+fork() segfaults and hangs on hppa. See Bug
+ #561203.
+Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=561203
+Forwarded: not-needed
+
+--- b/kde4automoc.cpp
++++ b/kde4automoc.cpp
+@@ -29,7 +29,6 @@
+ #include <QtCore/QFile>
+ #include <QtCore/QFileInfo>
+ #include <QtCore/QHash>
+-#include <QtCore/QProcess>
+ #include <QtCore/QQueue>
+ #include <QtCore/QRegExp>
+ #include <QtCore/QStringList>
+@@ -39,6 +38,7 @@
+ #include <sys/types.h>
+ #include <time.h>
+ #include <errno.h>
++#include <sys/wait.h>
+
+ #ifdef Q_OS_WIN
+ #include <windows.h>
+@@ -64,14 +64,12 @@
+ bool generateMoc(const QString &sourceFile, const QString &mocFileName);
+ void printUsage(const QString &);
+ void printVersion();
++ int executeCommand(const QString& command, const QStringList& args);
+ void echoColor(const QString &msg)
+ {
+- QProcess cmakeEcho;
+- cmakeEcho.setProcessChannelMode(QProcess::ForwardedChannels);
+ QStringList args(cmakeEchoColorArgs);
+ args << msg;
+- cmakeEcho.start(cmakeExecutable, args, QIODevice::NotOpen);
+- cmakeEcho.waitForFinished(-1);
++ executeCommand(cmakeExecutable, args);
+ }
+
+ QString builddir;
+@@ -108,6 +106,38 @@
+ }
+ }
+
++int AutoMoc::executeCommand(const QString& command, const QStringList& args)
++{
++ pid_t pid = fork();
++ if (pid == -1) {
++ perror("automoc4: unable to fork");
++ return -1;
++ } else if (pid == 0) {
++ /* Child. Execute command. */
++ char** argv = (char**) ::malloc((args.count()+2) * sizeof(char*));
++ char* cmd = ::strdup(command.toLocal8Bit().constData());
++
++ argv[0] = cmd;
++ int i = 0;
++ foreach (QString arg, args) {
++ i++;
++ argv[i] = ::strdup(arg.toLocal8Bit().constData());
++ }
++ argv[i+1] = static_cast<char*>(0);
++ ::execvp(cmd, argv);
++ ::perror(QString("automoc4: unable to execute command %1").arg(cmd).toLocal8Bit().constData());
++ ::exit(-1);
++ } else {
++ /* Parent */
++ int status;
++ pid_t ret = ::waitpid(pid, &status, 0);
++ if (ret == pid && WIFEXITED(status)) {
++ return WEXITSTATUS(status);
++ }
++ return -1;
++ }
++}
++
+ int main(int argc, char **argv)
+ {
+ QCoreApplication app(argc, argv);
+@@ -569,8 +599,6 @@
+ echoColor("Generating " + mocFileName);
+ }
+
+- QProcess mocProc;
+- mocProc.setProcessChannelMode(QProcess::ForwardedChannels);
+ QStringList args(mocIncludes + mocDefinitions);
+ #ifdef Q_OS_WIN
+ args << "-DWIN32";
+@@ -580,21 +608,11 @@
+ if (verbose) {
+ cout << mocExe << " " << args.join(QLatin1String(" ")) << endl;
+ }
+- mocProc.start(mocExe, args, QIODevice::NotOpen);
+- if (mocProc.waitForStarted()) {
+- const bool result = mocProc.waitForFinished(-1);
+- if (!result || mocProc.exitCode()) {
+- cerr << "automoc4: process for " << mocFilePath
+- << " failed: " << mocProc.errorString() << endl;
+- cerr << "pid to wait for: " << mocProc.pid() << endl;
+- failed = true;
+- QFile::remove(mocFilePath);
+- }
+- return true;
+- } else {
+- cerr << "automoc4: process for " << mocFilePath << "failed to start: "
+- << mocProc.errorString() << endl;
++ if (int ret = executeCommand(mocExe, args)) {
++ cerr << "automoc4: process for " << mocFilePath << " failed with " << ret << endl;
+ failed = true;
++ QFile::remove(mocFilePath);
++ return true;
+ }
+ }
+ return false;
Added: trunk/packages/automoc/debian/patches/series
===================================================================
--- trunk/packages/automoc/debian/patches/series (rev 0)
+++ trunk/packages/automoc/debian/patches/series 2009-12-29 19:23:17 UTC (rev 16496)
@@ -0,0 +1 @@
+01_patch_out_qprocess_bug561203.diff
Modified: trunk/packages/automoc/debian/rules
===================================================================
--- trunk/packages/automoc/debian/rules 2009-12-29 00:25:36 UTC (rev 16495)
+++ trunk/packages/automoc/debian/rules 2009-12-29 19:23:17 UTC (rev 16496)
@@ -1,72 +1,9 @@
#!/usr/bin/make -f
-# -*- makefile -*-
-# Sample debian/rules that uses debhelper.
-# This file was originally written by Joey Hess and Craig Small.
-# As a special exception, when this file is copied by dh-make into a
-# dh-make output file, you may use that output file without restriction.
-# This special exception was added by Craig Small in version 0.37 of dh-make.
-# Uncomment this to turn on verbose mode.
-#export DH_VERBOSE=1
+override_dh_auto_configure:
+ dh_auto_configure -- -DCMAKE_SHARED_LINKER_FLAGS="-Wl,--no-undefined -Wl,--as-needed" \
+ -DCMAKE_MODULE_LINKER_FLAGS="-Wl,--no-undefined -Wl,--as-needed" \
+ -DCMAKE_EXE_LINKER_FLAGS="-Wl,--no-undefined -Wl,--as-needed"
-builddir/CMakeCache.txt:
- dh_testdir
- mkdir -p builddir
- cd builddir && cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_C_FLAGS="$(CFLAGS)" -DCMAKE_CXX_FLAGS="$(CFLAGS)" \
- -DCMAKE_SHARED_LINKER_FLAGS="-Wl,--no-undefined -Wl,--as-needed" \
- -DCMAKE_MODULE_LINKER_FLAGS="-Wl,--no-undefined -Wl,--as-needed" \
- -DCMAKE_EXE_LINKER_FLAGS="-Wl,--no-undefined -Wl,--as-needed"
-
-build: build-stamp
-
-build-stamp: builddir/CMakeCache.txt
- dh_testdir
-
- # Add here commands to compile the package.
- cd builddir && $(MAKE)
- #docbook-to-man debian/automoc.sgml > automoc.1
-
- touch $@
-
-clean:
- dh_testdir
- dh_testroot
- rm -f build-stamp configure-stamp
-
- # Add here commands to clean up after the build process.
- rm -rf builddir
-
- dh_clean
-
-install: build
- dh_testdir
- dh_testroot
- dh_prep
- dh_installdirs
-
- # Add here commands to install the package into debian/automoc.
- cd builddir && $(MAKE) DESTDIR=$(CURDIR)/debian/automoc install
-
-
-# Build architecture-independent files here.
-binary-indep: build install
-# We have nothing to do by default.
-
-# Build architecture-dependent files here.
-binary-arch: build install
- dh_testdir
- dh_testroot
- dh_installchangelogs
- dh_installdocs
- dh_link
- dh_strip
- dh_compress
- dh_fixperms
- dh_installdeb
- dh_shlibdeps
- dh_gencontrol
- dh_md5sums
- dh_builddeb
-
-binary: binary-indep binary-arch
-.PHONY: build clean binary-indep binary-arch binary install configure
+%:
+ dh --buildsystem=cmake --builddirectory=builddir $@
Added: trunk/packages/automoc/debian/source/format
===================================================================
--- trunk/packages/automoc/debian/source/format (rev 0)
+++ trunk/packages/automoc/debian/source/format 2009-12-29 19:23:17 UTC (rev 16496)
@@ -0,0 +1 @@
+3.0 (quilt)
More information about the pkg-kde-commits
mailing list