From 8b3e98d3a36c73d2891959256b719a730d2a49fa Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Fri, 9 Aug 2013 18:05:03 +0200 Subject: [PATCH] scons: convert 2.2.0 recipe to an actual recipe --- ...scons-2.2.0.patch => scons-2.2.0.patchset} | 73 +++++++++++++------ dev-util/scons/scons-2.2.0.recipe | 43 +++++++---- 2 files changed, 80 insertions(+), 36 deletions(-) rename dev-util/scons/patches/{scons-2.2.0.patch => scons-2.2.0.patchset} (54%) diff --git a/dev-util/scons/patches/scons-2.2.0.patch b/dev-util/scons/patches/scons-2.2.0.patchset similarity index 54% rename from dev-util/scons/patches/scons-2.2.0.patch rename to dev-util/scons/patches/scons-2.2.0.patchset index 233c252b3..1ecca99d2 100644 --- a/dev-util/scons/patches/scons-2.2.0.patch +++ b/dev-util/scons/patches/scons-2.2.0.patchset @@ -1,7 +1,14 @@ -diff -Naur scons-2.2.0/engine/SCons/Platform/__init__.py scons-2.2.0-haiku/engine/SCons/Platform/__init__.py ---- scons-2.2.0/engine/SCons/Platform/__init__.py 2012-08-05 15:38:31.009961472 +0000 -+++ scons-2.2.0-haiku/engine/SCons/Platform/__init__.py 2012-09-30 13:28:21.978583552 +0000 -@@ -78,6 +78,8 @@ +From 8f1968371d3426d08cba8dafa44eaaa0cb59b13f Mon Sep 17 00:00:00 2001 +From: Ingo Weinhold +Date: Fri, 9 Aug 2013 17:46:35 +0200 +Subject: Add support for the Haiku platform + + +diff --git a/engine/SCons/Platform/__init__.py b/engine/SCons/Platform/__init__.py +index 2cab3c8..373938d 100644 +--- a/engine/SCons/Platform/__init__.py ++++ b/engine/SCons/Platform/__init__.py +@@ -78,6 +78,8 @@ def platform_default(): return 'aix' elif sys.platform.find('darwin') != -1: return 'darwin' @@ -10,10 +17,12 @@ diff -Naur scons-2.2.0/engine/SCons/Platform/__init__.py scons-2.2.0-haiku/engin else: return 'posix' elif os.name == 'os2': -diff -Naur scons-2.2.0/engine/SCons/Platform/haiku.py scons-2.2.0-haiku/engine/SCons/Platform/haiku.py ---- scons-2.2.0/engine/SCons/Platform/haiku.py 1970-01-01 00:00:00.000000000 +0000 -+++ scons-2.2.0-haiku/engine/SCons/Platform/haiku.py 2012-09-30 13:30:07.109051904 +0000 -@@ -0,0 +1,54 @@ +diff --git a/engine/SCons/Platform/haiku.py b/engine/SCons/Platform/haiku.py +new file mode 100644 +index 0000000..5c802dd +--- /dev/null ++++ b/engine/SCons/Platform/haiku.py +@@ -0,0 +1,69 @@ +"""SCons.Platform.haiku + +Platform-specific initialization for Haiku systems. @@ -48,23 +57,41 @@ diff -Naur scons-2.2.0/engine/SCons/Platform/haiku.py scons-2.2.0-haiku/engine/S + +__revision__ = "" + -+import posix +import commands ++import os ++import posix + -+def findDir( identifier ): -+ return commands.getoutput( 'finddir %s' % identifier ) ++def findDir(identifier): ++ return commands.getoutput('finddir %s' % identifier) + +def generate(env): + posix.generate(env) -+ -+ # path list -+ listPath = [ '.' ] -+ listPath.append( '%s/bin' % findDir( 'B_USER_CONFIG_DIRECTORY' ) ) -+ listPath.append( findDir( 'B_COMMON_BIN_DIRECTORY' ) ) -+ listPath.append( findDir( 'B_SYSTEM_BIN_DIRECTORY' ) ) -+ listPath.append( findDir( 'B_BEOS_BIN_DIRECTORY' ) ) -+ listPath.append( '%s/tools/gnupro/bin' % findDir( 'B_COMMON_DEVELOP_DIRECTORY' ) ) -+ env['ENV']['PATH'] = ':'.join( listPath ) -+ -+ # help the linker find the startfiles -+ env['ENV']['BELIBRARIES'] = ':%s/lib/x86' % findDir( 'B_COMMON_DEVELOP_DIRECTORY' ) ++ ++ # determine, if building for the secondary architecture ++ secondaryArch = os.environ.get('HAIKU_SECONDARY_ARCH') ++ archSubDir = '/' + secondaryArch if secondaryArch else '' ++ ++ # PATH ++ pathDescriptions = [ ++ ('B_USER_NONPACKAGED_BIN_DIRECTORY', None), ++ ('B_USER_CONFIG_DIRECTORY', 'bin'), ++ ('B_COMMON_NONPACKAGED_BIN_DIRECTORY', None), ++ ('B_COMMON_BIN_DIRECTORY', None), ++ ('B_SYSTEM_BIN_DIRECTORY', None) ++ ] ++ ++ paths = [] ++ for pathConstant, subDir in pathDescriptions: ++ path = findDir(pathConstant) ++ if subDir: ++ path += '/' + subDir ++ paths.append(path) ++ ++ if secondaryArch: ++ # prepend the secondary arch subdirectories ++ paths = [path + archSubDir for path in paths] + paths ++ ++ env['ENV']['PATH'] = ':'.join(paths) +-- +1.7.10.2 + diff --git a/dev-util/scons/scons-2.2.0.recipe b/dev-util/scons/scons-2.2.0.recipe index 007f389a7..75e48e55e 100644 --- a/dev-util/scons/scons-2.2.0.recipe +++ b/dev-util/scons/scons-2.2.0.recipe @@ -1,15 +1,36 @@ -DESCRIPTION="Open Source next-generation build tool." +SUMMARY="Open Source software construction tool" +DESCRIPTION="SCons is an Open Source software construction tool—that is, a next-generation build tool. Think of SCons as an improved, cross-platform substitute for the classic Make utility with integrated functionality similar to autoconf/automake and compiler caches such as ccache. In short, SCons is an easier, more reliable and faster way to build software." HOMEPAGE="http://www.scons.org/" LICENSE="MIT" COPYRIGHT="2001-2012 The SCons Foundation" SRC_URI="http://superb-dca3.dl.sourceforge.net/project/scons/scons/2.2.0/scons-2.2.0.tar.gz" CHECKSUM_MD5="f737f474a02d08156c821bd2d4d4b632" -REVISION="2" -STATUS_HAIKU="stable" -DEPEND="dev-lang/python >= 2.5.4" +REVISION="1" +ARCHITECTURES="x86_gcc2 ?x86" + +PATCHES="scons-2.2.0.patchset" + +PROVIDES=" + scons = $portVersion compat >= 2 + cmd:scons = $portVersion compat >= 2 + cmd:scons_2.2.0 = $portVersion compat >= 2 + cmd:scons_time = $portVersion compat >= 2 + cmd:scons_time_2.2.0 = $portVersion compat >= 2 + cmd:sconsign = $portVersion compat >= 2 + cmd:sconsign_2.2.0 = $portVersion compat >= 2 + " +REQUIRES=" + haiku >= $haikuVersion + cmd:python + " +BUILD_REQUIRES=" + " +BUILD_PREREQUIRES=" + cmd:python + " + BUILD() { - cd scons-2.2.0 for f in "script/scons script/scons-time script/sconsign"; do sed -i -e "s@#! /usr/bin/env python@#! /bin/env python@" $f done @@ -18,13 +39,9 @@ BUILD() INSTALL() { - if [ ! -z ${DESTDIR} ]; then - options="${options} --root=${DESTDIR}" - fi - options="${options} --prefix=`finddir B_COMMON_DIRECTORY`" - options="${options} --install-data=`finddir B_COMMON_DOCUMENTATION_DIRECTORY`" - options="${options} --symlink-scons" - options="${options} --standard-lib" - cd scons-2.2.0 + options="$options --prefix=$prefix" + options="$options --install-data=$documentationDir" + options="$options --symlink-scons" + options="$options --standard-lib" python setup.py install $options }