[gegl-qt] Build: make intcheck improvements



commit 7faa0f4032b340541bb15f5f61686e41897c59ec
Author: Jon Nordby <jononor gmail com>
Date:   Tue Sep 27 22:29:18 2011 +0200

    Build: make intcheck improvements
    
    Use git archive instead of ugly git clone hack.
    Use INSTALL_ROOT and INSTALL_PREFIX to ensure that
    everything installed goes into the distcheck-install directory.
    * Components that look up install path from the system/other packages,
    like python module, gegl operations and qml plugins naturally do
    not obey custom prefix, so we need to work-around that a bit.

 .gitignore  |    2 ++
 gegl-qt.pro |   33 ++++++++++++++++++++++++---------
 2 files changed, 26 insertions(+), 9 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index db82dc4..28e95bc 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,6 +4,8 @@ Makefile
 moc_*
 qrc_*
 *.pro.user
+*-build
+*-install
 gegl-qt-build-*
 gegl-qt-*.*
 *~
diff --git a/gegl-qt.pro b/gegl-qt.pro
index ce99b94..1d64b8b 100644
--- a/gegl-qt.pro
+++ b/gegl-qt.pro
@@ -25,15 +25,16 @@ SUBDIRS += examples tests
 
 DIST_NAME = $$GEGLQT_PROJECTNAME-$$GEGLQT_VERSION
 DIST_PATH = $$OUT_PWD/$$DIST_NAME
-TMP_PATH = /tmp/$$GEGLQT_PROJECTNAME-$$GEGLQT_VERSION
+TARBALL_SUFFIX = .tar.bz2
+TARBALL_PATH = $$DIST_PATH$$TARBALL_SUFFIX
+CHECK_INSTALL_ROOT = $$OUT_PWD/distcheck-install
+CHECK_INSTALL_PREFIX = $$CHECK_INSTALL_ROOT/usr
 
 # The 'make dist' target
 # Creates a tarball
 QMAKE_EXTRA_TARGETS += dist
 dist.target = dist
-dist.commands += git clone $$IN_PWD $$DIST_PATH;
-dist.commands += cd $$OUT_PWD;
-dist.commands += tar --bzip2 -cf $$DIST_NAME\\.tar.bz2 $$DIST_NAME;
+dist.commands += git archive HEAD --prefix=$$DIST_NAME/ | bzip2 > $$TARBALL_PATH
 
 # The 'make distcheck' target
 # Creates a tarball release, extracts it, builds, runs tests and installs
@@ -42,12 +43,25 @@ distcheck.target = distcheck
 distcheck.depends += dist;
 distcheck.commands += mkdir -p $$OUT_PWD/distcheck-build;
 distcheck.commands += cd $$OUT_PWD/distcheck-build;
-distcheck.commands += tar -xf $$DIST_PATH\\.tar.bz2;
+distcheck.commands += tar -xf $$TARBALL_PATH;
 distcheck.commands += cd $$DIST_NAME;
-distcheck.commands += qmake -r GEGLQT_INSTALL_PRIVATE_HEADERS=yes GEGLQT_INSTALL_PREFIX=$$OUT_PWD/distcheck-install;
+distcheck.commands += qmake -r \
+    GEGLQT_INSTALL_PRIVATE_HEADERS=yes \
+    GEGLQT_INSTALL_PREFIX=$$CHECK_INSTALL_PREFIX;
 distcheck.commands += make -j4;
 distcheck.commands += make check;
-distcheck.commands += make install;
+distcheck.commands += INSTALL_ROOT=$$CHECK_INSTALL_ROOT make install;
+
+# Transplant the files respecting the install prefix so that
+# the files will reside on disk where the install prefix said they would
+# (since we used INSTALL_ROOT) they did not do that before
+# This is similar to what distribution packaging does, when they transplant
+# files from the install root used during build to /
+distcheck.commands += rsync -ra --remove-source-files --backup \
+    $$CHECK_INSTALL_ROOT$$CHECK_INSTALL_ROOT/usr/* $$CHECK_INSTALL_ROOT/usr/;
+distcheck.commands += find $$CHECK_INSTALL_ROOT$$CHECK_INSTALL_ROOT/* \
+    -depth -exec rmdir \'{}\' \';\' -type d;
+distcheck.commands += rmdir -p $$CHECK_INSTALL_ROOT$$CHECK_INSTALL_ROOT || echo ignored ;
 
 # The 'make intcheck' target
 # Creates a tarball release, extracts it, builds, runs tests and installs,
@@ -57,9 +71,10 @@ intcheck.target = intcheck
 intcheck.depends += distcheck;
 intcheck.commands += mkdir -p $$OUT_PWD/intcheck-build;
 intcheck.commands += cd $$OUT_PWD/intcheck-build;
-intcheck.commands += tar -xf $$DIST_PATH\\.tar.bz2;
+intcheck.commands += tar -xf $$TARBALL_PATH;
 intcheck.commands += cd $$DIST_NAME;
-intcheck.commands += PKG_CONFIG_PATH=$$OUT_PWD/distcheck-install/lib/pkgconfig \
+intcheck.commands += \
+    PKG_CONFIG_PATH=$$CHECK_INSTALL_PREFIX/lib/pkgconfig \
     qmake -r GEGLQT_INTEGRATION_CHECK=yes;
 intcheck.commands += make -j4;
 intcheck.commands += make check;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]