aboutsummaryrefslogtreecommitdiffstats
path: root/tools/scons
diff options
context:
space:
mode:
Diffstat (limited to 'tools/scons')
-rw-r--r--tools/scons/Makefile35
-rwxr-xr-xtools/scons/files/pywrap.sh15
-rw-r--r--tools/scons/patches/001-platform_env.patch11
3 files changed, 61 insertions, 0 deletions
diff --git a/tools/scons/Makefile b/tools/scons/Makefile
new file mode 100644
index 0000000..bf7559b
--- /dev/null
+++ b/tools/scons/Makefile
@@ -0,0 +1,35 @@
+#
+# Copyright (C) 2011-2014 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=scons
+PKG_VERSION:=2.3.5
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=@SF/scons \
+ http://ftp.osuosl.org/pub/blfs/conglomeration/scons/
+PKG_MD5SUM:=8b0d1041266f89b18e47f26d943f8aa5
+
+include $(INCLUDE_DIR)/host-build.mk
+
+define Host/Configure
+endef
+
+define Host/Compile
+endef
+
+define Host/Install
+ ./files/pywrap.sh $(HOST_BUILD_DIR)/setup.py install --prefix=$(STAGING_DIR_HOST)
+ rm -f $(STAGING_DIR_HOST)/bin/scons*.py
+ for bin in $(STAGING_DIR_HOST)/bin/scons*; do \
+ mv "$$$$bin" "$$$$bin.py"; \
+ cp ./files/pywrap.sh "$$$$bin"; \
+ done
+endef
+
+$(eval $(call HostBuild))
diff --git a/tools/scons/files/pywrap.sh b/tools/scons/files/pywrap.sh
new file mode 100755
index 0000000..f62f590
--- /dev/null
+++ b/tools/scons/files/pywrap.sh
@@ -0,0 +1,15 @@
+#!/usr/bin/env bash
+
+case "${0##*/}" in
+ pywrap.sh) arg1="";;
+ *) arg1="$0.py" ;;
+esac
+
+for bin in python python2 python2.7 python2.6 python2.5 python2.4; do
+ case "$($bin -V 2>&1)" in
+ "Python 2"*) exec $bin $arg1 "$@" ;;
+ esac
+done
+
+echo "Unable to find a Python 2.x interpreter for executing ${arg1:+$arg1 }$@ !" >&2
+exit 1
diff --git a/tools/scons/patches/001-platform_env.patch b/tools/scons/patches/001-platform_env.patch
new file mode 100644
index 0000000..8aab904
--- /dev/null
+++ b/tools/scons/patches/001-platform_env.patch
@@ -0,0 +1,11 @@
+--- a/engine/SCons/Platform/__init__.py
++++ b/engine/SCons/Platform/__init__.py
+@@ -63,6 +63,8 @@ def platform_default():
+ care about the machine architecture.
+ """
+ osname = os.name
++ if 'PLATFORM' in os.environ:
++ return os.environ['PLATFORM']
+ if osname == 'java':
+ osname = os._osType
+ if osname == 'posix':