]> git.donarmstrong.com Git - debhelper.git/commitdiff
qmake: New buildsystem contributed by Kel Modderman. Closes: #566840
authorJoey Hess <joey@gnu.kitenet.net>
Wed, 27 Jan 2010 22:08:15 +0000 (17:08 -0500)
committerJoey Hess <joey@gnu.kitenet.net>
Wed, 27 Jan 2010 22:08:15 +0000 (17:08 -0500)
Debian/Debhelper/Buildsystem/qmake.pm [new file with mode: 0644]
debian/changelog
debian/copyright

diff --git a/Debian/Debhelper/Buildsystem/qmake.pm b/Debian/Debhelper/Buildsystem/qmake.pm
new file mode 100644 (file)
index 0000000..823a70e
--- /dev/null
@@ -0,0 +1,80 @@
+# A debhelper build system class for Qt projects
+# (based on the makefile class).
+#
+# Copyright: © 2010 Kelvin Modderman
+# License: GPL-2+
+
+package Debian::Debhelper::Buildsystem::qmake;
+
+use strict;
+use warnings;
+use Debian::Debhelper::Dh_Lib qw(error);
+use base 'Debian::Debhelper::Buildsystem::makefile';
+
+sub DESCRIPTION {
+       "qmake (*.pro)";
+}
+
+sub check_auto_buildable {
+       my $this=shift;
+       my @projects=glob($this->get_sourcepath('*.pro'));
+       my $ret=0;
+
+       if (@projects > 0 && -e $projects[0]) {
+               $ret=1;
+               # Existence of a Makefile generated by qmake indicates qmake
+               # class has already been used by a prior build step, so should
+               # be used instead of the parent makefile class.
+               my $mf=$this->get_buildpath("Makefile");
+               if (-e $mf) {
+                       $ret = $this->SUPER::check_auto_buildable(@_);
+                       open(my $fh, '<', $mf)
+                               or error("unable to open Makefile: $mf");
+                       while(<$fh>) {
+                               if (m/^# Generated by qmake/i) {
+                                       $ret++;
+                                       last;
+                               }
+                       }
+                       close($fh);
+               }
+       }
+
+       return $ret;
+}
+
+sub configure {
+       my $this=shift;
+       my @options;
+       my @flags;
+
+       push @options, '-makefile';
+       push @options, '-nocache';
+
+       if ($ENV{CFLAGS}) {
+               push @flags, "QMAKE_CFLAGS_RELEASE=$ENV{CFLAGS}";
+               push @flags, "QMAKE_CFLAGS_DEBUG=$ENV{CFLAGS}";
+       }
+       if ($ENV{CXXFLAGS}) {
+               push @flags, "QMAKE_CXXFLAGS_RELEASE=$ENV{CXXFLAGS}";
+               push @flags, "QMAKE_CXXFLAGS_DEBUG=$ENV{CXXFLAGS}";
+       }
+       if ($ENV{LDFLAGS}) {
+               push @flags, "QMAKE_LFLAGS_RELEASE=$ENV{LDFLAGS}";
+               push @flags, "QMAKE_LFLAGS_DEBUG=$ENV{LDFLAGS}";
+       }
+       push @flags, "QMAKE_STRIP=:";
+
+       $this->doit_in_builddir('qmake', @options, @flags, @_);
+}
+
+sub install {
+       my $this=shift;
+       my $destdir=shift;
+
+       # qmake generated Makefiles use INSTALL_ROOT in install target
+       # where one would expect DESTDIR to be used.
+       $this->SUPER::install($destdir, "INSTALL_ROOT=$destdir", @_);
+}
+
+1;
index a7aa1dc1a128a5e923d12d1495c2ba2e64c01753..7858a5d63b96212d0ea17366b733c4196eb6eeae 100644 (file)
@@ -10,6 +10,7 @@ debhelper (7.4.12) UNRELEASED; urgency=low
     This solves the problem with passing "-Bbuild" to dh, where commands
     that do not support -B would see a bogus -u option. Closes: #541773
     (It also ensures that the commands dh prints out can really be run.)
+  * qmake: New buildsystem contributed by Kel Modderman. Closes: #566840
 
  -- Joey Hess <joeyh@debian.org>  Fri, 01 Jan 2010 13:00:22 -0500
 
index 18178a236f833eb4b803b3b75f6847f7bc2e5740..a9f950dab92ef3ad03791d41a1e06c0b77017052 100644 (file)
@@ -55,10 +55,14 @@ Files: dh_bugfiles
 Copyright: Modestas Vainius <modestas@vainius.eu>
 License: GPL-2+
 
-Files: Debian/Debhelper/Buildsystem*, Debian/Debhelper/Dh_Buildsystems.pm
-Copyright: © 2008-2009 Modestas Vainius
-License: GPL-2+
-
 Files: dh_installinit
 Copyright: 1997-2008 Joey Hess <joeyh@debian.org>, 2009 Canonical Ltd.
 License: GPL-3
+
+Files: Debian/Debhelper/Buildsystem/qmake.pm
+Copyright: © 2010 Kel Modderman
+License: GPL-2+
+
+Files: Debian/Debhelper/Buildsystem*, Debian/Debhelper/Dh_Buildsystems.pm
+Copyright: © 2008-2009 Modestas Vainius
+License: GPL-2+