View Issue Details

IDProjectCategoryView StatusLast Update
0000522freesteamlinux-specificpublic2012-08-30 19:20
Assigned To 
PrioritynormalSeverityminorReproducibilityhave not tried
Status newResolutionopen 
Platformi686OSLinuxOS VersionGentoo
Product Version 
Target VersionFixed in Version 
Summary0000522: Various build script issues for Gentoo Linux
DescriptionSCons-related issues on Gentoo, from Michal Górny (via mailing list)

- ignorance of LDFLAGS,

(he wants CFLAGS and LDFLAGS to be picked up from the buildtime env, I think, so that portage is easier. We don't have to do that, but perhaps we need a way that those things can be passed in eg via command-line args)

- broken checking of swig version,

(current scons/ refuses to allow SWIG 2.x. this should be easily fixed. ASCEND doesn't work with SWIG 2.x, but apparently that's not a problem for freesteam)

- creation of invalid (absolute) SONAME symlinks,

(Apparently we should avoid absolute path references in symlinks. Seems easy enough to fix)

- constant reconfiguring (a major flaw of SCons, very hard to hack

(That's not a serious problem, and it's even less of a problem for a packager than it is for a developer...)

Michal wants us to use Autotools, but supporting a flexible Windows environment seems to be quite problematic with Autotools, and I don't really like Autotools, I would rather support a Python-based build system with SCons.

Michal has written a partial Autotools build script set which he has hosted on Github.
TagsNo tags attached.




2011-10-23 02:23

reporter   ~0000776

Ah, one more, very important:
- lack of DESTDIR setting which would mean additional prefix to all installation locations which wouldn't be written to freesteam-config.

IOW, if I run 'scons INSTALL_PREFIX=/usr DESTDIR=/tmp/z', the package will be finally moved to /usr but SCons should install it to /tmp/z/usr instead.


2011-10-23 12:54

administrator   ~0000777

Hi Michal

We have 'INSTALL_ROOT' to provide that functionality.

INSTALL_ROOT = /tmp/install

Files will be installed in /tmp/install/usr/...

But the files themselves will have some internal references to files in locations /usr/....

This usage mode is used by systems such as rpmbuild which collects files installed in a temporary location, packages then, and then installs them in the 'true' location. I guess Portage might use something similar on Gentoo.


2011-10-23 18:51

reporter   ~0000778

Right, sorry, must've missed that.


2011-11-27 09:05

reporter   ~0000796

Eh, that SCons is more shitty than it was when I used it. Is it even possible to pass CFLAGS and LINKFLAGS on the command-line? When I try to do so, it concatenates them into single argument...

I'll attach two patches. The first one will get CFLAGS & LDFLAGS directly from the environment. Omitting Variables() allows them to be parsed and split correctly. The second one will finally fix the symlinks.


2011-11-27 09:06


freesteam-flags.patch (726 bytes)
From 6a68348f4b1fb755724e1df34bff4d6986d07dab Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <>
Date: Sat, 26 Nov 2011 22:30:15 +0100
Subject: [PATCH] Merge CFLAGS and LDFLAGS from the environment.

 SConstruct |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/SConstruct b/SConstruct
index 9dc17f5..e529e88 100644
--- a/SConstruct
+++ b/SConstruct
@@ -194,6 +194,11 @@ SConsEnvironment.InstallLibraryAs = lambda env, dest, files: InstallPermAs(env,
+# Merge environment CFLAGS & LDFLAGS
+env.MergeFlags([os.environ.get('CFLAGS', ''),
+	os.environ.get('LDFLAGS', '')])

freesteam-flags.patch (726 bytes)


2011-11-27 09:19


freesteam-soname-symlinks.patch (1,473 bytes)
From dd03d6b29fd29f9978022291f0c023e4fe5dd345 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <>
Date: Sat, 26 Nov 2011 23:18:37 +0100
Subject: [PATCH] Fix SONAME symlinks - make them relative.

 SConstruct |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/SConstruct b/SConstruct
index 1794691..d84a13a 100644
--- a/SConstruct
+++ b/SConstruct
@@ -5,7 +5,7 @@
 # We don't currently propose to support building freesteam from MSVS but
 # that shouldn't be necessary, as you should be able to use the MinGW-generated
 # DLL even with MSVS, because it only uses C code.
-import platform, sys, distutils.sysconfig, os 
+import platform, sys, distutils.sysconfig, os, os.path
 #version number for this copy of freesteam
 version = "2.1"
@@ -436,11 +436,11 @@ else:
 	install_link1 = None
 	if env.subst(link1) != env.subst(libname):
-		install_link1 = env.Command("${INSTALL_ROOT}"+link1,install_lib,"ln -s %s $TARGET" % libname)
+		install_link1 = env.Command("${INSTALL_ROOT}"+link1,install_lib,"ln -s %s $TARGET" % os.path.basename(libname))
 	install_link2 = None
 	if env.get("SONAME_MINOR"):
-		install_link2 = env.Command("${INSTALL_ROOT}"+link2,install_lib,"ln -s %s $TARGET"%libname)
+		install_link2 = env.Command("${INSTALL_ROOT}"+link2,install_lib,"ln -s %s $TARGET"%os.path.basename(libname))
 	env['installedfiles'] += [install_link1, install_link2]


2011-11-27 13:20

administrator   ~0000797

I have applied the patch for symlinks, thanks for that (changeset 667)

As for the the other one, my preference, in line with 'standard practice' for SCons, would be to have CFLAGS and LDFLAGS coming from the commandline instead of the environment. If I find I way to do that, would that satisfy your needs?


2012-08-30 19:19

reporter   ~0000911

> As for the the other one, my preference, in line with 'standard practice' for SCons, would be to have CFLAGS and LDFLAGS coming from the commandline instead of the environment. If I find I way to do that, would that satisfy your needs?

Better than nothing.

Anyway, I'm cleaning up old forks on github and I will attach the autotools patches here in case you ever are interested in them.


2012-08-30 19:20


autotools-patches.tar.bz2 (56,446 bytes)

Issue History

Date Modified Username Field Change
2011-10-20 23:27 john New Issue
2011-10-20 23:28 john Description Updated View Revisions
2011-10-20 23:31 john Description Updated View Revisions
2011-10-23 02:23 mgorny Note Added: 0000776
2011-10-23 12:54 john Note Added: 0000777
2011-10-23 18:51 mgorny Note Added: 0000778
2011-11-27 09:05 mgorny Note Added: 0000796
2011-11-27 09:06 mgorny File Added: freesteam-flags.patch
2011-11-27 09:19 mgorny File Added: freesteam-soname-symlinks.patch
2011-11-27 13:20 john Note Added: 0000797
2012-08-30 19:19 mgorny Note Added: 0000911
2012-08-30 19:20 mgorny File Added: autotools-patches.tar.bz2