From 64ed8b564fa21c08e317be7ad407018dc5154b90 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Fri, 21 Feb 2020 01:43:58 +0800 Subject: [PATCH] add scons package --- devel/scons/Makefile | 61 ++++++++++++++++++++++ devel/scons/patches/001-platform_env.patch | 11 ++++ devel/scons/scons.mk | 23 ++++++++ 3 files changed, 95 insertions(+) create mode 100644 devel/scons/Makefile create mode 100644 devel/scons/patches/001-platform_env.patch create mode 100644 devel/scons/scons.mk diff --git a/devel/scons/Makefile b/devel/scons/Makefile new file mode 100644 index 00000000..13e636f0 --- /dev/null +++ b/devel/scons/Makefile @@ -0,0 +1,61 @@ +# +# Copyright (C) 2011-2015 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:=3.1.2 + +PKG_SOURCE:=$(PKG_NAME)-local-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/scons +PKG_HASH:=642e90860b746fa18fac08c7a22de6bfa86110ae7c56d7f136f7e5fb0d8f4f44 + +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=scons-LICENSE +PKG_MAINTAINER:= + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/host-build.mk + +HOST_UNPACK:=$(DECOMPRESS_CMD) $(HOST_TAR) -C $(HOST_BUILD_DIR) $(TAR_OPTIONS) + +define Package/scons + SECTION:=devel + CATEGORY:=Development + TITLE:=scons + HIDDEN:=1 +endef + +define Package/scons/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. +endef + +define Host/Configure +endef + +define Host/Compile +endef + +define Host/Install + $(INSTALL_DIR) $(STAGING_DIR_HOSTPKG)/bin + for py in $(HOST_BUILD_DIR)/*.py; do \ + bin=$$$${py%.py} ; \ + $(CP) $$$$py $$$$bin ; \ + $(SED) '1c#!$(STAGING_DIR_HOST)/bin/python' $$$$bin ; \ + $(INSTALL_BIN) $$$$bin $(STAGING_DIR_HOSTPKG)/bin/ ; \ + done + + $(INSTALL_DIR) $(STAGING_DIR_HOSTPKG)/lib/scons + $(CP) $(HOST_BUILD_DIR)/scons-local-$(PKG_VERSION)/* $(STAGING_DIR_HOSTPKG)/lib/scons/ +endef + +$(eval $(call BuildPackage,scons)) +$(eval $(call HostBuild)) diff --git a/devel/scons/patches/001-platform_env.patch b/devel/scons/patches/001-platform_env.patch new file mode 100644 index 00000000..4e4dc2b8 --- /dev/null +++ b/devel/scons/patches/001-platform_env.patch @@ -0,0 +1,11 @@ +--- a/scons-local-3.1.2/SCons/Platform/__init__.py ++++ b/scons-local-3.1.2/SCons/Platform/__init__.py +@@ -65,6 +65,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': diff --git a/devel/scons/scons.mk b/devel/scons/scons.mk new file mode 100644 index 00000000..2b767105 --- /dev/null +++ b/devel/scons/scons.mk @@ -0,0 +1,23 @@ +export PLATFORM=posix + +SCONS_VARS = \ + CC="$(TARGET_CC_NOCACHE)" \ + CXX="$(TARGET_CXX_NOCACHE)" \ + CFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)" \ + CXXFLAGS="$(TARGET_CXXFLAGS) $(EXTRA_CXXFLAGS)" \ + CPPFLAGS="$(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS)" \ + LDFLAGS="$(TARGET_LDFLAGS) $(EXTRA_LDFLAGS)" \ + DESTDIR="$(PKG_INSTALL_DIR)" + +define Build/Configure/Default + (cd $(PKG_BUILD_DIR); \ + $(SCONS_VARS) \ + scons \ + prefix=/usr \ + $(SCONS_OPTIONS) \ + install \ + ) +endef + +define Build/Compile +endef