From patchwork Tue Jul 24 19:46:25 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Petazzoni X-Patchwork-Id: 173046 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from hemlock.osuosl.org (hemlock.osuosl.org [140.211.166.133]) by ozlabs.org (Postfix) with ESMTP id 1DD962C007C for ; Wed, 25 Jul 2012 05:46:56 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 66C74A0398; Tue, 24 Jul 2012 19:46:53 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Jb7+MCRpPeeK; Tue, 24 Jul 2012 19:46:43 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 93CEFA0390; Tue, 24 Jul 2012 19:46:43 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (fraxinus.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 8255F8F753 for ; Tue, 24 Jul 2012 19:46:42 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 78C70101D13 for ; Tue, 24 Jul 2012 19:46:42 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 7MYCE2jU7xA0 for ; Tue, 24 Jul 2012 19:46:39 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail.free-electrons.com (mail.free-electrons.com [88.190.12.23]) by fraxinus.osuosl.org (Postfix) with ESMTP id 1961C10176D for ; Tue, 24 Jul 2012 19:46:39 +0000 (UTC) Received: by mail.free-electrons.com (Postfix, from userid 106) id 6660016D; Tue, 24 Jul 2012 21:46:31 +0200 (CEST) Received: from localhost (humanoidz.org [82.247.183.72]) by mail.free-electrons.com (Postfix) with ESMTPSA id 198BA35 for ; Tue, 24 Jul 2012 21:46:22 +0200 (CEST) From: Thomas Petazzoni To: buildroot@uclibc.org Date: Tue, 24 Jul 2012 21:46:25 +0200 Message-Id: <1343159185-31449-1-git-send-email-thomas.petazzoni@free-electrons.com> X-Mailer: git-send-email 1.7.9.5 Subject: [Buildroot] [PATCH] gpsd: fix build issues X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: buildroot-bounces@busybox.net The first patch gpsd-01-sconstruct-python-2.5-compat.patch is aimed at fixing Python 2.5 compatibility issues such as: http://autobuild.buildroot.org/results/844a7f8698567688eba094f64dd2bf5157efd994/build-end.log The second patch gpsd-02-sconstruct-ncurses-config-path.patch implements a proper mechanism to specify the path to ncurse5-config. It obsoletes the previous gpsd-fix-acs_map-compile-errors patch, and solves build problems such as: http://autobuild.buildroot.org/results/92ae3d53e8aa68d8b1a2eccad68c98f577cb6437/build-end.log Signed-off-by: Thomas Petazzoni Acked-by: Simon Dawson --- .../gpsd-01-sconstruct-python-2.5-compat.patch | 79 ++++++++++++++++++++ .../gpsd-02-sconstruct-ncurses-config-path.patch | 44 +++++++++++ package/gpsd/gpsd-fix-acs_map-compile-errors.patch | 29 ------- package/gpsd/gpsd.mk | 1 + 4 files changed, 124 insertions(+), 29 deletions(-) create mode 100644 package/gpsd/gpsd-01-sconstruct-python-2.5-compat.patch create mode 100644 package/gpsd/gpsd-02-sconstruct-ncurses-config-path.patch delete mode 100644 package/gpsd/gpsd-fix-acs_map-compile-errors.patch diff --git a/package/gpsd/gpsd-01-sconstruct-python-2.5-compat.patch b/package/gpsd/gpsd-01-sconstruct-python-2.5-compat.patch new file mode 100644 index 0000000..4306af2 --- /dev/null +++ b/package/gpsd/gpsd-01-sconstruct-python-2.5-compat.patch @@ -0,0 +1,79 @@ +Remove all the with ... as foo constructs + +Those constructs have been introduced in Python 2.6, and some of our +autobuilders still use Python 2.5, so replace them with constructs +that are compatible with Python 2.5. + +Signed-off-by: Thomas Petazzoni + +Index: b/SConstruct +=================================================================== +--- a/SConstruct ++++ b/SConstruct +@@ -366,8 +366,8 @@ + + def CheckXsltproc(context): + context.Message('Checking that xsltproc can make man pages... ') +- with open("xmltest.xml", "w") as ofp: +- ofp.write(''' ++ ofp = open("xmltest.xml", "w") ++ ofp.write(''' + + + foo +@@ -380,6 +380,7 @@ + + + ''') ++ ofp.close() + probe = "xsltproc --nonet --noout '%s' xmltest.xml" % (docbook_man_uri,) + ret = context.TryAction(probe)[0] + os.remove("xmltest.xml") +@@ -1042,8 +1043,9 @@ + # build timebase.h + def timebase_h(target, source, env): + from leapsecond import make_leapsecond_include +- with open(target[0].abspath, 'w') as f: +- f.write(make_leapsecond_include(source[0].abspath)) ++ f = open(target[0].abspath, 'w') ++ f.write(make_leapsecond_include(source[0].abspath)) ++ f.close() + env.Command(target="timebase.h", source="leapseconds.cache", + action=timebase_h) + +@@ -1116,15 +1118,17 @@ + ('@DEVMAIL@', devmail), + ('@LIBGPSVERSION@', libgps_version), + ) +- with open(str(source[0])) as sfp: +- content = sfp.read() ++ sfp = open(str(source[0])) ++ content = sfp.read() ++ sfp.close() + for (s, t) in substmap: + content = content.replace(s, t) + m = re.search("@[A-Z]+@", content) + if m and m.group(0) not in map(lambda x: x[0], substmap): + print >>sys.stderr, "Unknown subst token %s in %s." % (m.group(0), sfp.name) +- with open(str(target[0]), "w") as tfp: +- tfp.write(content) ++ tfp = open(str(target[0]), "w") ++ tfp.write(content) ++ tfp.close() + + templated = glob.glob("*.in") + glob.glob("*/*.in") + glob.glob("*/*/*.in") + +@@ -1560,9 +1564,10 @@ + def validation_list(target, source, env): + for page in glob.glob("www/*.html"): + if not '-head' in page: +- with open(page) as fp: +- if "Valid HTML" in fp.read(): +- print os.path.join(website, os.path.basename(page)) ++ fp = open(page) ++ if "Valid HTML" in fp.read(): ++ print os.path.join(website, os.path.basename(page)) ++ fp.close() + Utility("validation-list", [www], validation_list) + + # How to update the website diff --git a/package/gpsd/gpsd-02-sconstruct-ncurses-config-path.patch b/package/gpsd/gpsd-02-sconstruct-ncurses-config-path.patch new file mode 100644 index 0000000..5c440bf --- /dev/null +++ b/package/gpsd/gpsd-02-sconstruct-ncurses-config-path.patch @@ -0,0 +1,44 @@ +Add option to specify the path to ncurses5-config + +By default, gpsd's SConstruct looks in the PATH to find +ncurses5-config, which means that it finds our HOST_DIR +ncurses5-config. We add an option that allows to specify a custom path +to the ncurses5-config script. + +Signed-off-by: Thomas Petazzoni + +Index: b/SConstruct +=================================================================== +--- a/SConstruct ++++ b/SConstruct +@@ -172,6 +172,7 @@ + ("fixed_stop_bits", 0, "fixed serial port stop bits"), + ("target", "", "cross-development target"), + ("sysroot", "", "cross-development system root"), ++ ("ncurses_config", "", "ncurses5-config path"), + ) + for (name, default, help) in nonboolopts: + opts.Add(name, help, default) +@@ -447,6 +448,11 @@ + else: + pkg_config = lambda pkg: ['!%s --cflags --libs --static %s' %(env['PKG_CONFIG'], pkg, )] + ++if env['ncurses_config']: ++ ncurses_config = env['ncurses_config'] ++else: ++ ncurses_config = "ncurses5-config" ++ + # The actual distinction here is whether the platform has ncurses in the + # base system or not. If it does, pkg-config is not likely to tell us + # anything useful. FreeBSD does, Linux doesn't. Most likely other BSDs +@@ -455,8 +461,8 @@ + if env['ncurses']: + if config.CheckPKG('ncurses'): + ncurseslibs = pkg_config('ncurses') +- elif config.CheckExecutable('ncurses5-config --version', 'ncurses5-config'): +- ncurseslibs = ['!ncurses5-config --libs --cflags'] ++ elif config.CheckExecutable('%s --version' % ncurses_config, 'ncurses5-config'): ++ ncurseslibs = ['!%s --libs --cflags' % ncurses_config] + elif sys.platform.startswith('freebsd'): + ncurseslibs= [ '-lncurses' ] + elif sys.platform.startswith('openbsd'): diff --git a/package/gpsd/gpsd-fix-acs_map-compile-errors.patch b/package/gpsd/gpsd-fix-acs_map-compile-errors.patch deleted file mode 100644 index 14d9287..0000000 --- a/package/gpsd/gpsd-fix-acs_map-compile-errors.patch +++ /dev/null @@ -1,29 +0,0 @@ -Hack gpsd to prevent undefined references to acs_map from ncurses. - -Signed-off-by: Simon Dawson -diff -Nurp a/gpsmon.c b/gpsmon.c ---- a/gpsmon.c 2012-05-18 09:45:37.000000000 +0100 -+++ b/gpsmon.c 2012-06-07 12:41:31.257807969 +0100 -@@ -24,6 +24,9 @@ - #include - #endif /* S_SPLINT_S */ - -+/* Ugly hack to prevent undefined reference to acs_map */ -+unsigned long acs_map[128]; -+ - #include "gpsd_config.h" - #ifdef HAVE_BLUEZ - #include -diff -Nurp a/monitor_nmea.c b/monitor_nmea.c ---- a/monitor_nmea.c 2011-11-22 08:49:33.000000000 +0000 -+++ b/monitor_nmea.c 2012-06-07 12:41:37.081807709 +0100 -@@ -15,6 +15,9 @@ - #include - #endif /* S_SPLINT_S */ - -+/* Ugly hack to prevent undefined reference to acs_map */ -+unsigned long acs_map[128]; -+ - #include "gpsd.h" - #include "gpsmon.h" - #include "gpsdclient.h" diff --git a/package/gpsd/gpsd.mk b/package/gpsd/gpsd.mk index dd15386..7d1dbcd 100644 --- a/package/gpsd/gpsd.mk +++ b/package/gpsd/gpsd.mk @@ -23,6 +23,7 @@ GPSD_SCONS_OPTS = \ ifeq ($(BR2_PACKAGE_NCURSES),y) GPSD_DEPENDENCIES += ncurses + GPSD_SCONS_OPTS += ncurses_config=$(STAGING_DIR)/usr/bin/ncurses5-config else GPSD_SCONS_OPTS += ncurses=no endif