This commit is contained in:
tofuliang 2020-02-20 19:20:51 +00:00
commit 0c96e8e1e0
14 changed files with 384 additions and 54 deletions

61
devel/scons/Makefile Normal file
View File

@ -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))

View File

@ -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':

23
devel/scons/scons.mk Normal file
View File

@ -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

View File

@ -9,14 +9,14 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=iotivity PKG_NAME:=iotivity
PKG_VERSION:=1.2.1 PKG_VERSION:=1.2.1
PKG_RELEASE=2 PKG_RELEASE:=2
PKG_SOURCE:=${PKG_NAME}-${PKG_VERSION}.tar.gz PKG_SOURCE:=${PKG_NAME}-${PKG_VERSION}.tar.gz
PKG_SOURCE_URL:=http://mirrors.kernel.org/${PKG_NAME}/${PKG_VERSION}/ PKG_SOURCE_URL:=http://mirrors.kernel.org/${PKG_NAME}/${PKG_VERSION}/
PKG_HASH:=7dcd9f0f48263c6b27a2c3d085dd7278b5c0feed1dfec8872a04899707fa23d8 PKG_HASH:=7dcd9f0f48263c6b27a2c3d085dd7278b5c0feed1dfec8872a04899707fa23d8
PKG_USE_MIPS16:=0 PKG_USE_MIPS16:=0
PKG_BUILD_DEPENDS:=boost PKG_BUILD_DEPENDS:=boost python/host scons/host
PKG_MAINTAINER:=Hauke Mehrtens <hauke.mehrtens@intel.com> PKG_MAINTAINER:=Hauke Mehrtens <hauke.mehrtens@intel.com>
@ -37,7 +37,7 @@ PKG_CONFIG_DEPENDS := \
CONFIG_PACKAGE_iotivity_SECURE CONFIG_PACKAGE_iotivity_SECURE
include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/scons.mk include ../../devel/scons/scons.mk
define Package/iotivity define Package/iotivity
@ -227,7 +227,7 @@ endef
define Build/Configure define Build/Configure
(cd $(PKG_BUILD_DIR); \ (cd $(PKG_BUILD_DIR); \
$(SCONS_VARS) \ $(SCONS_VARS) \
scons \ python2.7 $(STAGING_DIR_HOSTPKG)/bin/scons \
$(SCONS_OPTIONS) \ $(SCONS_OPTIONS) \
) )
endef endef

View File

@ -0,0 +1,58 @@
From 26c2798188497da22e0a70efebc47991dd755db2 Mon Sep 17 00:00:00 2001
From: Philippe Coval <philippe.coval@osg.samsung.com>
Date: Wed, 28 Jun 2017 04:54:05 +0200
Subject: [PATCH] resource: Include functional header for g++-7.1.0
It was tested on yocto poky master on iotivity-1.2.1 (and later):
resource/include/OCUtilities.h: \
In function 'OCStackResult OC::nil_guard(PtrT&&, FnT&&, ParamTs&& ...)':
resource/include/OCUtilities.h:85:21: \
error: 'bind' is not a member of 'std'
return std::bind(fn, p, std::ref(params)...)();
resource/include/OCApi.h: At global scope:
resource/include/OCApi.h:362:18: \
error: 'function' in namespace 'std' does not name a template type
typedef std::function<void(std::shared_ptr<OCResource>)> FindCallback;
Change-Id: Ie1cab497c33fde394f77490a1d636eb36a563396
Origin: https://gerrit.iotivity.org/gerrit/#/c/21069/
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/21067
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
---
resource/include/OCApi.h | 2 --
resource/include/OCUtilities.h | 1 +
2 files changed, 1 insertion(+), 2 deletions(-)
diff --git a/resource/include/OCApi.h b/resource/include/OCApi.h
index 4e14f29cc..af9721554 100644
--- a/resource/include/OCApi.h
+++ b/resource/include/OCApi.h
@@ -27,9 +27,7 @@
#include <map>
#include <memory>
#include <iterator>
-#if defined(_MSC_VER)
#include <functional>
-#endif
#include "octypes.h"
#include "OCHeaderOption.h"
diff --git a/resource/include/OCUtilities.h b/resource/include/OCUtilities.h
index 85039d0c1..f1c93045f 100644
--- a/resource/include/OCUtilities.h
+++ b/resource/include/OCUtilities.h
@@ -26,6 +26,7 @@
#include <memory>
#include <utility>
#include <exception>
+#include <functional>
#include <OCException.h>
#include <StringConstants.h>
--
2.17.1

View File

@ -8,24 +8,22 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=smartsnmpd PKG_NAME:=smartsnmpd
PKG_VERSION:=2014-08-13 PKG_VERSION:=2015-02-22
PKG_RELEASE=$(PKG_SOURCE_VERSION) PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/credosemi/smartsnmp.git PKG_SOURCE_URL:=https://github.com/credosemi/smartsnmp
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) PKG_SOURCE_VERSION:=ca1d455fd06748caa629fe7ad16a47cec8877b93
PKG_SOURCE_VERSION:=fb93473d895f058b2d8975d3cfa280ae2a8ae98d PKG_MIRROR_HASH:=fda89ec37944b4f800eb3c0147678745b57f08c87f10d246d3c9d165a43418b4
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=fc7f3eef8341163e21aecf6abf2492fa90362877093baef9987af3c703baa6ea
PKG_MAINTAINER:=Xiongfei Guo <xfguo@credosemi.com> PKG_MAINTAINER:=Xiongfei Guo <xfguo@credosemi.com>
PKG_LICENSE:=GPL-2.0 PKG_LICENSE:=GPL-2.0-or-later
PKG_LICENSE_FILES:=LICENSE PKG_LICENSE_FILES:=LICENSE
PKG_BUILD_DEPENDS:=scons/host
include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/scons.mk include ../../devel/scons/scons.mk
define Package/smartsnmpd define Package/smartsnmpd
SECTION:=net SECTION:=net
@ -42,6 +40,12 @@ for OpenWrt. Include using ubus and uci to get system info/status.
And, it use libubox/uloop as low level event-driven library. And, it use libubox/uloop as low level event-driven library.
endef endef
ifeq ($(CONFIG_BIG_ENDIAN),y)
TARGET_CFLAGS += -DBIG_ENDIAN
else
TARGET_CFLAGS += -DLITTLE_ENDIAN
endif
SCONS_OPTIONS += --transport=uloop SCONS_OPTIONS += --transport=uloop
define Build/Configure define Build/Configure

View File

@ -26,22 +26,24 @@ start_service() {
procd_close_instance procd_close_instance
# before we can call xappend # before we can call xappend
mkdir -p $(dirname $CONFIGFILE) mkdir -p "$(dirname $CONFIGFILE)"
echo "-- auto-generated config file from /etc/config/smartsnmpd" > $CONFIGFILE echo "-- auto-generated config file from /etc/config/smartsnmpd" > $CONFIGFILE
config_get PORT smartsnmpd port 161 {
echo "port = $PORT" >> $CONFIGFILE config_get PORT smartsnmpd port 161
echo "port = $PORT"
config_get RO_COMMUNITY smartsnmpd ro_community 'public' config_get RO_COMMUNITY smartsnmpd ro_community 'public'
config_get RW_COMMUNITY smartsnmpd rw_community 'private' config_get RW_COMMUNITY smartsnmpd rw_community 'private'
echo "ro_community = '$RO_COMMUNITY'" >> $CONFIGFILE echo "ro_community = '$RO_COMMUNITY'"
echo "rw_community = '$RW_COMMUNITY'" >> $CONFIGFILE echo "rw_community = '$RW_COMMUNITY'"
config_get MIB_MODULE_PATH smartsnmpd mib_module_path '/usr/lib/lua/smartsnmp/mibs/' config_get MIB_MODULE_PATH smartsnmpd mib_module_path '/usr/lib/lua/smartsnmp/mibs/'
echo "mib_module_path = '$MIB_MODULE_PATH'" >> $CONFIGFILE echo "mib_module_path = '$MIB_MODULE_PATH'"
echo "mib_modules = {" >> $CONFIGFILE echo "mib_modules = {"
config_foreach smartsnmpd_mib_module smartsnmpd_module config_foreach smartsnmpd_mib_module smartsnmpd_module
echo "}" >> $CONFIGFILE echo "}"
} >> $CONFIGFILE
} }

View File

@ -0,0 +1,82 @@
--- a/SConstruct
+++ b/SConstruct
@@ -133,21 +133,21 @@ env = Environment(
)
# handle options/environment varibles.
-if os.environ.has_key('CC'):
+if 'CC' in os.environ:
env.Replace(CC = os.environ['CC'])
# CFLAGS
if GetOption("cflags") != "":
env.Append(CFLAGS = GetOption("cflags"))
-elif os.environ.has_key('CFLAGS'):
+elif 'CFLAGS' in os.environ:
env.Append(CFLAGS = os.environ['CFLAGS'])
# LDFLAGS
if GetOption("ldflags") != "":
env.Replace(LINKFLAGS = GetOption("ldflags"))
-elif os.environ.has_key('LDFLAGS'):
+elif 'LDFLAGS' in os.environ:
env.Replace(LINKFLAGS = os.environ['LDFLAGS'])
-elif os.environ.has_key('LINKFLAGS'):
+elif 'LINKFLAGS' in os.environ:
env.Replace(LINKFLAGS = os.environ['LINKFLAGS'])
# LIBS
@@ -183,10 +183,10 @@ elif GetOption("transport") == 'built-in' or GetOption("transport") == '':
elif GetOption("evloop") == 'select' or GetOption("evloop") == '':
pass
else:
- print "Error: Not the right event driving type"
+ print("Error: Not the right event driving type")
Exit(1)
else:
- print "Error: Transport not found!"
+ print("Error: Transport not found!")
Exit(1)
# autoconf
@@ -205,18 +205,18 @@ else:
if GetOption("transport") == 'built-in' or GetOption("transport") == '':
if GetOption("evloop") == 'epoll':
if not conf.CheckEpoll():
- print "Error: epoll failed"
+ print("Error: epoll failed")
Exit(1)
elif GetOption("evloop") == 'kqueue':
if not conf.CheckKqueue():
- print "Error: Kqueue failed"
+ print("Error: Kqueue failed")
Exit(1)
elif GetOption("evloop") == 'select' or GetOption("evloop") == '':
if not conf.CheckSelect():
- print "Error: select failed"
+ print("Error: select failed")
Exit(1)
else:
- print "Error: Not the right event driving type"
+ print("Error: Not the right event driving type")
Exit(1)
# CFLAGS
@@ -232,7 +232,7 @@ if conf.CheckLib('lua'):
elif conf.CheckLib('lua5.1'):
env.Append(LIBS = ['lua5.1'])
else:
- print "Error: liblua or liblua5.1 not found!"
+ print("Error: liblua or liblua5.1 not found!")
Exit(1)
# find lua header files
@@ -241,7 +241,7 @@ if conf.CheckCHeader('lua.h'):
elif conf.CheckCHeader('lua5.1/lua.h'):
env.Append(CFLAGS = ['-I/usr/include/lua5.1'])
else:
- print "Error: lua.h not found"
+ print("Error: lua.h not found")
Exit(1)
env = conf.Finish()

View File

@ -0,0 +1,44 @@
--- a/SConstruct
+++ b/SConstruct
@@ -134,21 +134,21 @@ env = Environment(
# handle options/environment varibles.
if 'CC' in os.environ:
- env.Replace(CC = os.environ['CC'])
+ env.Replace(CC = Split(os.environ['CC']))
# CFLAGS
if GetOption("cflags") != "":
env.Append(CFLAGS = GetOption("cflags"))
elif 'CFLAGS' in os.environ:
- env.Append(CFLAGS = os.environ['CFLAGS'])
+ env.Append(CFLAGS = Split(os.environ['CFLAGS']))
# LDFLAGS
if GetOption("ldflags") != "":
env.Replace(LINKFLAGS = GetOption("ldflags"))
elif 'LDFLAGS' in os.environ:
- env.Replace(LINKFLAGS = os.environ['LDFLAGS'])
+ env.Replace(LINKFLAGS = Split(os.environ['LDFLAGS']))
elif 'LINKFLAGS' in os.environ:
- env.Replace(LINKFLAGS = os.environ['LINKFLAGS'])
+ env.Replace(LINKFLAGS = Split(os.environ['LINKFLAGS']))
# LIBS
if GetOption("libs") != "":
@@ -192,15 +192,6 @@ else:
# autoconf
conf = Configure(env, custom_tests = {'CheckEpoll' : CheckEpoll, 'CheckSelect' : CheckSelect, 'CheckKqueue' : CheckKqueue, 'CheckEndian' : CheckEndian})
-# Endian check
-endian = conf.CheckEndian()
-if endian == 'Big':
- env.Append(CFLAGS = ["-DBIG_ENDIAN"])
-elif endian == 'Little':
- env.Append(CFLAGS = ["-DLITTLE_ENDIAN"])
-else:
- raise SConfError("Error when testing the endian.")
-
# built-in event loop check
if GetOption("transport") == 'built-in' or GetOption("transport") == '':
if GetOption("evloop") == 'epoll':

View File

@ -8,23 +8,26 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=gpsd PKG_NAME:=gpsd
PKG_VERSION:=3.17 PKG_VERSION:=3.20
PKG_RELEASE:=1 PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@SAVANNAH/$(PKG_NAME) PKG_SOURCE_URL:=@SAVANNAH/$(PKG_NAME)
PKG_HASH:=68e0dbecfb5831997f8b3d6ba48aed812eb465d8c0089420ab68f9ce4d85e77a PKG_HASH:=3998a5cbb728e97f896f46c3c83301b1e6c5d859393e58c2fad8c5426774d571
PKG_MAINTAINER:=Pushpal Sidhu <psidhu.devel@gmail.com> PKG_MAINTAINER:=Pushpal Sidhu <psidhu.devel@gmail.com>
PKG_LICENSE:=BSD-3-Clause PKG_LICENSE:=BSD-3-Clause
PKG_LICENSE_FILES:=COPYING PKG_LICENSE_FILES:=COPYING
PKG_CPE_ID:=cpe:/a:berlios:gps_daemon
PKG_BUILD_DEPENDS:=scons/host
include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/scons.mk include ../../devel/scons/scons.mk
define Package/gpsd/Default define Package/gpsd/Default
DEPENDS+= +libusb-1.0 DEPENDS+= +libusb-1.0
URL:=http://catb.org/gpsd/ URL:=https://gpsd.gitlab.io/gpsd/
endef endef
define Package/gpsd/Default/description define Package/gpsd/Default/description
@ -109,9 +112,9 @@ define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/lib $(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libgps*.so* $(1)/usr/lib/ $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgps*.so* $(1)/usr/lib/
$(INSTALL_DIR) $(1)/usr/lib/pkgconfig $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
$(CP) \ $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libgps.pc $(1)/usr/lib/pkgconfig
$(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libgps*.pc \ $(SED) 's,/usr/include,$$$${prefix}/include,g' $(1)/usr/lib/pkgconfig/libgps.pc
$(1)/usr/lib/pkgconfig/ $(SED) 's,/usr/lib,$$$${exec_prefix}/lib,g' $(1)/usr/lib/pkgconfig/libgps.pc
endef endef
define Package/gpsd/install define Package/gpsd/install

View File

@ -8,7 +8,7 @@ NAME=gpsd
validate_section_gpsd() validate_section_gpsd()
{ {
uci_validate_section gpsd gpsd "${1}" \ uci_load_validate gpsd gpsd "$1" "$2" \
'enabled:bool:1' \ 'enabled:bool:1' \
'device:string' \ 'device:string' \
'listen_globally:bool:0' \ 'listen_globally:bool:0' \
@ -17,21 +17,19 @@ validate_section_gpsd()
gpsd_instance() gpsd_instance()
{ {
local device enabled listen_globally port [ "$2" = 0 ] || {
validate_section_gpsd "${1}" || {
echo "validation failed" echo "validation failed"
return 1 return 1
} }
[ "${enabled}" = "0" ] && return 1 [ "$enabled" = "0" ] && return 1
procd_open_instance procd_open_instance
procd_set_param command "$PROG" -N -n procd_set_param command "$PROG" -N -n
[ "${listen_globally}" -ne 0 ] && procd_append_param command -G [ "$listen_globally" -ne 0 ] && procd_append_param command -G
procd_append_param command -S "${port}" procd_append_param command -S "$port"
procd_append_param command "${device}" procd_append_param command "$device"
procd_set_param respawn procd_set_param respawn
procd_close_instance procd_close_instance
@ -39,6 +37,11 @@ gpsd_instance()
start_service() start_service()
{ {
config_load "${NAME}" config_load "$NAME"
config_foreach gpsd_instance gpsd config_foreach validate_section_gpsd gpsd gpsd_instance
}
service_triggers() {
procd_add_reload_trigger "$NAME"
procd_add_validation validate_section_gpsd
} }

View File

@ -0,0 +1,26 @@
--- a/SConstruct
+++ b/SConstruct
@@ -42,7 +42,6 @@ import re
import subprocess
import sys
import time
-from distutils import sysconfig
import SCons
@@ -669,6 +668,7 @@ def GetPythonValue(context, name, imp, e
context.Message('Obtaining Python %s... ' % name)
context.sconf.cached = 0 # Avoid bogus "(cached)"
if not env['target_python']:
+ from distutils import sysconfig
status, value = 0, str(eval(expr))
else:
command = [target_python_path, '-c', '%s; print(%s)' % (imp, expr)]
@@ -1218,6 +1218,7 @@ if helping:
# If helping just get usable config info from the local Python
target_python_path = ''
+ from distutils import sysconfig
py_config_text = str(eval(PYTHON_CONFIG_CALL))
python_libdir = str(eval(PYTHON_LIBDIR_CALL))

View File

@ -1,8 +1,6 @@
Index: gpsd-3.16/SConstruct --- a/SConstruct
=================================================================== +++ b/SConstruct
--- gpsd-3.16.orig/SConstruct @@ -874,6 +874,10 @@ else:
+++ gpsd-3.16/SConstruct
@@ -672,6 +672,10 @@ else:
ncurseslibs += pkg_config('tinfo', rpath_hack=True) ncurseslibs += pkg_config('tinfo', rpath_hack=True)
# It's not yet known whether rpath_hack is appropriate for # It's not yet known whether rpath_hack is appropriate for
# ncurses5-config. # ncurses5-config.

View File

@ -0,0 +1,15 @@
--- a/SConstruct
+++ b/SConstruct
@@ -1047,12 +1047,6 @@ else:
confdefs.append("/* #undef HAVE_%s_H */\n"
% hdr.replace("/", "_").upper())
- sizeof_time_t = config.CheckSizeOf("time_t")
- confdefs.append("#define SIZEOF_TIME_T %s\n" % sizeof_time_t)
- announce("sizeof(time_t) is %s" % sizeof_time_t)
- if 4 >= int(sizeof_time_t):
- announce("WARNING: time_t is too small. It will fail in 2038")
-
# check function after libraries, because some function require libraries
# for example clock_gettime() require librt on Linux glibc < 2.17
for f in ("cfmakeraw", "clock_gettime", "daemon", "fcntl", "fork",