Add <PKG>_STRIP_COMPONENTS for packages with non-standard tarballs
PATCH 1/7 Add <PKG>_STRIP_COMPONENTS for packages with non-standard tarballs
Usually package tarballs contain only a directory named "<pkg-name>-<pkg-version>" which contains the actual source tree. To properly extract the source files in $(BUILD_DIR), Buildroot passes the --strip-components=1 option to tar.
Unfortunately a few packages ship in a non-standard way, with no root directory or with more than one. In Buildroot these packages must be handled by overriding the <PKG>_DOWNLOAD_CMDS.
As the number of such packages is growing, introduce a <PKG>_STRIP_COMPONENTS variable for packages to request a number of components to strip different from 1.
--- package/pkg-generic.mk | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
package/pkg-generic.mk +9 -1
@@ -322,6 +322,14 @@ ifndef $(2)_SUBDIR endif endif +ifndef $(2)_STRIP_COMPONENTS + ifdef $(3)_STRIP_COMPONENTS + $(2)_STRIP_COMPONENTS = $$($(3)_STRIP_COMPONENTS) + else + $(2)_STRIP_COMPONENTS ?= 1 + endif +endif + $(2)_SRCDIR = $$($(2)_DIR)/$$($(2)_SUBDIR) $(2)_BUILDDIR ?= $$($(2)_SRCDIR)
@@ -431,7 +439,7 @@ $(2)_TARGET_DIRCLEAN = $$($(2)_DIR)/.stamp_dircleaned # default extract command $(2)_EXTRACT_CMDS ?= \ $$(if $$($(2)_SOURCE),$$(INFLATE$$(suffix $$($(2)_SOURCE))) $$(DL_DIR)/$$($(2)_SOURCE) | \ - $$(TAR) $$(TAR_STRIP_COMPONENTS)=1 -C $$($(2)_DIR) $$(TAR_OPTIONS) -) + $$(TAR) $$(TAR_STRIP_COMPONENTS)=$$($(2)_STRIP_COMPONENTS) -C $$($(2)_DIR) $$(TAR_OPTIONS) -) # pre/post-steps hooks $(2)_PRE_DOWNLOAD_HOOKS ?=
Signature · 1 line
1.9.1
PATCH 2/7 docs/manual: document <PKG>_STRIP_COMPONENTS
--- docs/manual/adding-packages-generic.txt | 9 +++++++++ 1 file changed, 9 insertions(+)
docs/manual/adding-packages-generic.txt +9 -0
@@ -303,6 +303,15 @@ information is (assuming the package name is +libfoo+) : the package source code. Buildroot copies the contents of the source directory into the package's build directory. +* +LIBFOO_STRIP_COMPONENTS+ is the number of leading components + (directories) that tar must strip from file names on extraction. + The tarball for most packages has one leading component named + "<pkg-name>-<pkg-version>", thus Buildroot passes + --strip-components=1 to tar to remove it. + For non-standard packages that don't have this component, or + that have more than one leading component to strip, set this + variable with the value to be passed to tar. Default: 1. + * +LIBFOO_DEPENDENCIES+ lists the dependencies (in terms of package name) that are required for the current target package to compile. These dependencies are guaranteed to be compiled and
Signature · 1 line
1.9.1
PATCH 2/7 docs/manual: document <PKG>_STRIP_COMPONENTS
Quoted 2 lines · Luca Ceresoli
Signed-off-by Luca Ceresoli <[email protected]>Cc Arnout Vandecappelle <[email protected]>
Although perhaps I shouldn't be doing this at this hour :-)
Regards,
Arnout
Quoted 25 lines
--- docs/manual/adding-packages-generic.txt | 9 +++++++++ 1 file changed, 9 insertions(+)docs/manual/adding-packages-generic.txt +9
-0@@ -303,6 +303,15 @@ information is (assuming the package name is +libfoo+) : the package source code. Buildroot copies the contents of the source directory into the package's build directory. +* +LIBFOO_STRIP_COMPONENTS+ is the number of leading components + (directories) that tar must strip from file names on extraction. + The tarball for most packages has one leading component named + "<pkg-name>-<pkg-version>", thus Buildroot passes + --strip-components=1 to tar to remove it. + For non-standard packages that don't have this component, or + that have more than one leading component to strip, set this + variable with the value to be passed to tar. Default: 1. + * +LIBFOO_DEPENDENCIES+ lists the dependencies (in terms of package name) that are required for the current target package to compile. These dependencies are guaranteed to be compiled and
Signature · 6 lines
Arnout Vandecappelle arnout at mind be Senior Embedded Software Architect +32-16-286500 Essensium/Mind http://www.mind.be G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle GPG fingerprint: 7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
PATCH 3/7 intel-microcode: use <PKG>_STRIP_COMPONENTS
In reply to Luca Ceresoli--- package/intel-microcode/intel-microcode.mk | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
package/intel-microcode/intel-microcode.mk +4 -4
@@ -7,17 +7,17 @@ INTEL_MICROCODE_VERSION = 20150107 INTEL_MICROCODE_SOURCE = microcode-$(INTEL_MICROCODE_VERSION).tgz INTEL_MICROCODE_SITE = http://downloadmirror.intel.com/24616/eng +INTEL_MICROCODE_STRIP_COMPONENTS = 0 INTEL_MICROCODE_LICENSE = PROPRIETARY INTEL_MICROCODE_LICENSE_FILES = license.txt INTEL_MICROCODE_REDISTRIBUTE = NO -# N.B. Don't strip any path components during extraction. -define INTEL_MICROCODE_EXTRACT_CMDS - gzip -d -c $(DL_DIR)/$(INTEL_MICROCODE_SOURCE) | \ - tar --strip-components=0 -C $(@D) -xf - +define INTEL_MICROCODE_EXTRACT_LICENSE head -n 33 $(@D)/microcode.dat > $(@D)/license.txt endef +INTEL_MICROCODE_POST_EXTRACT_HOOKS += INTEL_MICROCODE_EXTRACT_LICENSE + define INTEL_MICROCODE_INSTALL_TARGET_CMDS $(INSTALL) -D -m 0644 $(@D)/microcode.dat \ $(TARGET_DIR)/usr/share/misc/intel-microcode.dat
Signature · 1 line
1.9.1
PATCH 3/7 intel-microcode: use <PKG>_STRIP_COMPONENTS
Quoted 1 line · Luca Ceresoli
Signed-off-by Luca Ceresoli <[email protected]>
Regards,
Arnout
Quoted 31 lines
--- package/intel-microcode/intel-microcode.mk | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)package/intel-microcode/intel-microcode.mk +4
-4@@ -7,17 +7,17 @@ INTEL_MICROCODE_VERSION = 20150107 INTEL_MICROCODE_SOURCE = microcode-$(INTEL_MICROCODE_VERSION).tgz INTEL_MICROCODE_SITE = http://downloadmirror.intel.com/24616/eng +INTEL_MICROCODE_STRIP_COMPONENTS = 0 INTEL_MICROCODE_LICENSE = PROPRIETARY INTEL_MICROCODE_LICENSE_FILES = license.txt INTEL_MICROCODE_REDISTRIBUTE = NO -# N.B. Don't strip any path components during extraction. -define INTEL_MICROCODE_EXTRACT_CMDS - gzip -d -c $(DL_DIR)/$(INTEL_MICROCODE_SOURCE) | \ - tar --strip-components=0 -C $(@D) -xf - +define INTEL_MICROCODE_EXTRACT_LICENSE head -n 33 $(@D)/microcode.dat > $(@D)/license.txt endef +INTEL_MICROCODE_POST_EXTRACT_HOOKS += INTEL_MICROCODE_EXTRACT_LICENSE + define INTEL_MICROCODE_INSTALL_TARGET_CMDS $(INSTALL) -D -m 0644 $(@D)/microcode.dat \ $(TARGET_DIR)/usr/share/misc/intel-microcode.dat
Signature · 6 lines
Arnout Vandecappelle arnout at mind be Senior Embedded Software Architect +32-16-286500 Essensium/Mind http://www.mind.be G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle GPG fingerprint: 7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
PATCH 4/7 nanocom: use <PKG>_STRIP_COMPONENTS
In reply to Luca Ceresoli--- package/nanocom/nanocom.mk | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
package/nanocom/nanocom.mk +1 -5
@@ -7,14 +7,10 @@ NANOCOM_VERSION = 1.0 NANOCOM_SOURCE = nanocom.tar.gz NANOCOM_SITE = http://downloads.sourceforge.net/project/nanocom/nanocom/v$(NANOCOM_VERSION) +NANOCOM_STRIP_COMPONENTS = 0 NANOCOM_LICENSE = GPLv2+ NANOCOM_LICENSE_FILES = COPYING -# N.B. Don't strip any path components during extraction. -define NANOCOM_EXTRACT_CMDS - gzip -d -c $(DL_DIR)/$(NANOCOM_SOURCE) | tar --strip-components=0 -C $(NANOCOM_DIR) -xf - -endef - define NANOCOM_BUILD_CMDS $(MAKE) CC="$(TARGET_CC) $(TARGET_CFLAGS) $(TARGET_LDFLAGS)" -C $(@D) endef
Signature · 1 line
1.9.1
PATCH 4/7 nanocom: use <PKG>_STRIP_COMPONENTS
Quoted 1 line · Luca Ceresoli
Signed-off-by Luca Ceresoli <[email protected]>
Regards,
Arnout
Quoted 25 lines
--- package/nanocom/nanocom.mk | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)package/nanocom/nanocom.mk +1
-5@@ -7,14 +7,10 @@ NANOCOM_VERSION = 1.0 NANOCOM_SOURCE = nanocom.tar.gz NANOCOM_SITE = http://downloads.sourceforge.net/project/nanocom/nanocom/v$(NANOCOM_VERSION) +NANOCOM_STRIP_COMPONENTS = 0 NANOCOM_LICENSE = GPLv2+ NANOCOM_LICENSE_FILES = COPYING -# N.B. Don't strip any path components during extraction. -define NANOCOM_EXTRACT_CMDS - gzip -d -c $(DL_DIR)/$(NANOCOM_SOURCE) | tar --strip-components=0 -C $(NANOCOM_DIR) -xf - -endef - define NANOCOM_BUILD_CMDS $(MAKE) CC="$(TARGET_CC) $(TARGET_CFLAGS) $(TARGET_LDFLAGS)" -C $(@D) endef
Signature · 6 lines
Arnout Vandecappelle arnout at mind be Senior Embedded Software Architect +32-16-286500 Essensium/Mind http://www.mind.be G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle GPG fingerprint: 7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
PATCH 5/7 tzdata: use <PKG>_STRIP_COMPONENTS
In reply to Luca Ceresoli--- package/tzdata/tzdata.mk | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
package/tzdata/tzdata.mk +1 -5
@@ -7,6 +7,7 @@ TZDATA_VERSION = 2015e TZDATA_SOURCE = tzdata$(TZDATA_VERSION).tar.gz TZDATA_SITE = ftp://ftp.iana.org/tz/releases +TZDATA_STRIP_COMPONENTS = 0 TZDATA_DEPENDENCIES = host-tzdata HOST_TZDATA_DEPENDENCIES = host-zic TZDATA_LICENSE = Public domain
@@ -45,11 +46,6 @@ define TZDATA_INSTALL_TARGET_CMDS fi endef -define HOST_TZDATA_EXTRACT_CMDS - gzip -d -c $(DL_DIR)/$(TZDATA_SOURCE) \ - | $(TAR) --strip-components=0 -C $(@D) -xf - -endef - define HOST_TZDATA_BUILD_CMDS (cd $(@D); \ for zone in $(TZDATA_ZONELIST); do \
Signature · 1 line
1.9.1
PATCH 5/7 tzdata: use <PKG>_STRIP_COMPONENTS
Quoted 1 line · Luca Ceresoli
Signed-off-by Luca Ceresoli <[email protected]>
Regards,
Arnout
Quoted 29 lines
--- package/tzdata/tzdata.mk | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)package/tzdata/tzdata.mk +1
-5@@ -7,6 +7,7 @@ TZDATA_VERSION = 2015e TZDATA_SOURCE = tzdata$(TZDATA_VERSION).tar.gz TZDATA_SITE = ftp://ftp.iana.org/tz/releases +TZDATA_STRIP_COMPONENTS = 0 TZDATA_DEPENDENCIES = host-tzdata HOST_TZDATA_DEPENDENCIES = host-zic TZDATA_LICENSE = Public domain@@ -45,11 +46,6 @@ define TZDATA_INSTALL_TARGET_CMDS fi endef -define HOST_TZDATA_EXTRACT_CMDS - gzip -d -c $(DL_DIR)/$(TZDATA_SOURCE) \ - | $(TAR) --strip-components=0 -C $(@D) -xf - -endef - define HOST_TZDATA_BUILD_CMDS (cd $(@D); \ for zone in $(TZDATA_ZONELIST); do \
Signature · 6 lines
Arnout Vandecappelle arnout at mind be Senior Embedded Software Architect +32-16-286500 Essensium/Mind http://www.mind.be G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle GPG fingerprint: 7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
PATCH 5/7 tzdata: use <PKG>_STRIP_COMPONENTS
In reply to Luca CeresoliQuoted 1 line · Luca Ceresoli
Signed-off-by Luca Ceresoli <[email protected]>
Regards,
Arnout
Quoted 29 lines
--- package/tzdata/tzdata.mk | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)package/tzdata/tzdata.mk +1
-5@@ -7,6 +7,7 @@ TZDATA_VERSION = 2015e TZDATA_SOURCE = tzdata$(TZDATA_VERSION).tar.gz TZDATA_SITE = ftp://ftp.iana.org/tz/releases +TZDATA_STRIP_COMPONENTS = 0 TZDATA_DEPENDENCIES = host-tzdata HOST_TZDATA_DEPENDENCIES = host-zic TZDATA_LICENSE = Public domain@@ -45,11 +46,6 @@ define TZDATA_INSTALL_TARGET_CMDS fi endef -define HOST_TZDATA_EXTRACT_CMDS - gzip -d -c $(DL_DIR)/$(TZDATA_SOURCE) \ - | $(TAR) --strip-components=0 -C $(@D) -xf - -endef - define HOST_TZDATA_BUILD_CMDS (cd $(@D); \ for zone in $(TZDATA_ZONELIST); do \
Signature · 6 lines
Arnout Vandecappelle arnout at mind be Senior Embedded Software Architect +32-16-286500 Essensium/Mind http://www.mind.be G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle GPG fingerprint: 7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
PATCH 6/7 zic: use <PKG>_STRIP_COMPONENTS
In reply to Luca Ceresoli--- package/zic/zic.mk | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-)
package/zic/zic.mk +1 -6
@@ -7,14 +7,9 @@ ZIC_VERSION = 2015e ZIC_SOURCE = tzcode$(ZIC_VERSION).tar.gz ZIC_SITE = ftp://ftp.iana.org/tz/releases +ZIC_STRIP_COMPONENTS = 0 ZIC_LICENSE = Public domain -# Don't strip any path components during extraction. -define HOST_ZIC_EXTRACT_CMDS - gzip -d -c $(DL_DIR)/$(ZIC_SOURCE) \ - | $(TAR) --strip-components=0 -C $(@D) -xf - -endef - define HOST_ZIC_BUILD_CMDS $(HOST_MAKE_ENV) $(MAKE) -C $(@D) zic endef
Signature · 1 line
1.9.1
PATCH 6/7 zic: use <PKG>_STRIP_COMPONENTS
Quoted 1 line · Luca Ceresoli
Signed-off-by Luca Ceresoli <[email protected]>
Regards,
Arnout
Quoted 25 lines
--- package/zic/zic.mk | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-)package/zic/zic.mk +1
-6@@ -7,14 +7,9 @@ ZIC_VERSION = 2015e ZIC_SOURCE = tzcode$(ZIC_VERSION).tar.gz ZIC_SITE = ftp://ftp.iana.org/tz/releases +ZIC_STRIP_COMPONENTS = 0 ZIC_LICENSE = Public domain -# Don't strip any path components during extraction. -define HOST_ZIC_EXTRACT_CMDS - gzip -d -c $(DL_DIR)/$(ZIC_SOURCE) \ - | $(TAR) --strip-components=0 -C $(@D) -xf - -endef - define HOST_ZIC_BUILD_CMDS $(HOST_MAKE_ENV) $(MAKE) -C $(@D) zic endef
Signature · 6 lines
Arnout Vandecappelle arnout at mind be Senior Embedded Software Architect +32-16-286500 Essensium/Mind http://www.mind.be G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle GPG fingerprint: 7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
PATCH 7/7 qpid-proton: new package
In reply to Luca Ceresoli--- package/Config.in | 1 + ...fix-C-compiler-detection-with-_ARG1-_ARG2.patch | 52 ++++++++++++++++++++++ package/qpid-proton/Config.in | 17 +++++++ package/qpid-proton/qpid-proton.hash | 2 + package/qpid-proton/qpid-proton.mk | 28 ++++++++++++ 5 files changed, 100 insertions(+) create mode 100644 package/qpid-proton/0001-proton-c-fix-C-compiler-detection-with-_ARG1-_ARG2.patch create mode 100644 package/qpid-proton/Config.in create mode 100644 package/qpid-proton/qpid-proton.hash create mode 100644 package/qpid-proton/qpid-proton.mk
package/Config.in +1 -0
@@ -995,6 +995,7 @@ menu "Networking" source "package/openpgm/Config.in" source "package/ortp/Config.in" source "package/qdecoder/Config.in" + source "package/qpid-proton/Config.in" source "package/rtmpdump/Config.in" source "package/slirp/Config.in" source "package/snmppp/Config.in"
package/qpid-proton/0001-proton-c-fix-C-compiler-detection-with-_ARG1-_ARG2.patch new file +52 -0
52 lines not on this page · raw message
package/qpid-proton/Config.in new file +17 -0
@@ -0,0 +1,17 @@ +config BR2_PACKAGE_QPID_PROTON + bool "qpid-proton" + depends on BR2_USE_WCHAR # util-linux + select BR2_PACKAGE_UTIL_LINUX + select BR2_PACKAGE_UTIL_LINUX_LIBUUID + help + The AMQP messaging toolkit + + Qpid Proton is a high-performance, lightweight messaging library. + It can be used in the widest range of messaging applications, + including brokers, client libraries, routers, bridges, proxies, and + more. + + https://qpid.apache.org/proton/ + +comment "qpid-proton needs a toolchain w/ wchar" + depends on !BR2_USE_WCHAR
package/qpid-proton/qpid-proton.hash new file +2 -0
@@ -0,0 +1,2 @@ +# Hash from: http://www.apache.org/dist/qpid/proton/0.9.1/qpid-proton-0.9.1.tar.gz.sha +sha1 98008d90acd0d47cbd7ac1572a2bb50b452338ed qpid-proton-0.9.1.tar.gz
package/qpid-proton/qpid-proton.mk new file +28 -0
@@ -0,0 +1,28 @@ +################################################################################ +# +# qpid-proton +# +################################################################################ + +QPID_PROTON_VERSION_MAJOR = 0.9 +QPID_PROTON_VERSION = $(QPID_PROTON_VERSION_MAJOR).1 +QPID_PROTON_SITE = http://apache.panu.it/qpid/proton/0.9.1 +QPID_PROTON_STRIP_COMPONENTS = 2 +QPID_PROTON_LICENSE = Apache-2.0 +QPID_PROTON_LICENSE_FILES = LICENSE +QPID_PROTON_INSTALL_STAGING = YES +QPID_PROTON_DEPENDENCIES = \ + util-linux \ + $(if $(BR2_PACKAGE_OPENSSL),openssl,) +QPID_PROTON_CONF_OPTS = \ + -DBUILD_JAVA=OFF \ + -DENABLE_VALGRIND=OFF \ + -DENABLE_WARNING_ERROR=OFF + +define QPID_PROTON_REMOVE_EXAMPLES + rm -fr $(TARGET_DIR)/usr/share/proton-$(QPID_PROTON_VERSION_MAJOR)/examples +endef + +QPID_PROTON_POST_INSTALL_TARGET_HOOKS += QPID_PROTON_REMOVE_EXAMPLES + +$(eval $(cmake-package))
Signature · 1 line
1.9.1
PATCH 7/7 qpid-proton: new package
Hi,
sorry for having noticed only after sending, but this is a v2.
The rest of the series is brand new, so I forgot to mark only this patch as v2...
BTW, I just marked the previously-sent patch as Superseded in patchwork.
Quoted 149 lines · Luca Ceresoli
Signed-off-by Luca Ceresoli <[email protected]>--- package/Config.in | 1 + ...fix-C-compiler-detection-with-_ARG1-_ARG2.patch | 52 ++++++++++++++++++++++ package/qpid-proton/Config.in | 17 +++++++ package/qpid-proton/qpid-proton.hash | 2 + package/qpid-proton/qpid-proton.mk | 28 ++++++++++++ 5 files changed, 100 insertions(+)create mode 100644
package/qpid-proton/0001-proton-c-fix-C-compiler-detection-with-_ARG1-_ARG2.patchcreate mode 100644 package/qpid-proton/Config.in
create mode 100644 package/qpid-proton/qpid-proton.hash
create mode 100644package/qpid-proton/qpid-proton.mkpackage/Config.in +1
-0@@ -995,6 +995,7 @@ menu "Networking" source "package/openpgm/Config.in" source "package/ortp/Config.in" source "package/qdecoder/Config.in" + source "package/qpid-proton/Config.in" source "package/rtmpdump/Config.in" source "package/slirp/Config.in" source "package/snmppp/Config.in"package/qpid-proton/0001-proton-c-fix-C-compiler-detection-with-_ARG1-_ARG2.patch new file +52
-0@@ -0,0 +1,52 @@ +From f24be9ae9ab01c7507a366e9d5529c444f0b7edd Mon Sep 17 00:00:00 2001 +From: Luca Ceresoli <[email protected]> +Date: Fri, 10 Jul 2015 10:13:47 +0200 +Subject: [PATCH] proton-c: fix C compiler detection with _ARG1/_ARG2 + +The C compiler commandline in CMake is composed by the concatenation of +CMAKE_C_COMPILER + CMAKE_C_COMPILER_ARG1 + CMAKE_C_COMPILER_ARG2. + +In most use cases the two additional argument variables are empty, thus +CMAKE_C_COMPILER can be used without any noticeable difference. + +The Buildroot embedded Linux build system [0], however, optionally exploits the +CMAKE_C_COMPILER_ARG1 variable to speed up the cross-compilation of CMake-based +packages using ccache. It does so by setting [1]: + + CMAKE_C_COMPILER = /path/to/ccache + CMAKE_C_COMPILER_ARG1 = /path/to/cross-gcc + +This works fine with other CMake-based packages, but proton-c's CMakeLists.txt +calls gcc to extract the compiler version. It does so by calling +"${CMAKE_C_COMPILER} -dumpversion", without honoring the two extra arguments. +Within Buildroot with ccache enabled, this means calling +"/path/to/ccache -dumpversion", which fails with the error: + + ccache: invalid option -- 'd' + +Fix the compiler check by adding the two arguments. + +[0] http://buildroot.net/ +[1] http://git.buildroot.net/buildroot/tree/support/misc/toolchainfile.cmake.in?id=2015.05 + +Signed-off-by: Luca Ceresoli <[email protected]> +--- + proton-c/CMakeLists.txt | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/proton-c/CMakeLists.txt b/proton-c/CMakeLists.txt +index 93449a9..8c31a89 100644 +--- a/proton-c/CMakeLists.txt ++++ b/proton-c/CMakeLists.txt +@@ -218,7 +218,7 @@ if (CMAKE_COMPILER_IS_GNUCC) + set (COMPILE_LANGUAGE_FLAGS "-std=c99") + set (COMPILE_PLATFORM_FLAGS "-std=gnu99") + +- execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION ++ execute_process(COMMAND ${CMAKE_C_COMPILER} ${CMAKE_C_COMPILER_ARG1} ${CMAKE_C_COMPILER_ARG2} -dumpversion OUTPUT_VARIABLE GCC_VERSION + OUTPUT_STRIP_TRAILING_WHITESPACE) + if (${GCC_VERSION} VERSION_LESS "4.3.0") + # Only a concern if contibuting code back. +-- +1.9.1 +package/qpid-proton/Config.in new file +17
-0@@ -0,0 +1,17 @@ +config BR2_PACKAGE_QPID_PROTON + bool "qpid-proton" + depends on BR2_USE_WCHAR # util-linux + select BR2_PACKAGE_UTIL_LINUX + select BR2_PACKAGE_UTIL_LINUX_LIBUUID + help + The AMQP messaging toolkit + + Qpid Proton is a high-performance, lightweight messaging library. + It can be used in the widest range of messaging applications, + including brokers, client libraries, routers, bridges, proxies, and + more. + + https://qpid.apache.org/proton/ + +comment "qpid-proton needs a toolchain w/ wchar" + depends on !BR2_USE_WCHARpackage/qpid-proton/qpid-proton.hash new file +2
-0@@ -0,0 +1,2 @@ +# Hash from: http://www.apache.org/dist/qpid/proton/0.9.1/qpid-proton-0.9.1.tar.gz.sha +sha1 98008d90acd0d47cbd7ac1572a2bb50b452338ed qpid-proton-0.9.1.tar.gzpackage/qpid-proton/qpid-proton.mk new file +28
-0@@ -0,0 +1,28 @@ +################################################################################ +# +# qpid-proton +# +################################################################################ + +QPID_PROTON_VERSION_MAJOR = 0.9 +QPID_PROTON_VERSION = $(QPID_PROTON_VERSION_MAJOR).1 +QPID_PROTON_SITE = http://apache.panu.it/qpid/proton/0.9.1 +QPID_PROTON_STRIP_COMPONENTS = 2 +QPID_PROTON_LICENSE = Apache-2.0 +QPID_PROTON_LICENSE_FILES = LICENSE +QPID_PROTON_INSTALL_STAGING = YES +QPID_PROTON_DEPENDENCIES = \ + util-linux \ + $(if $(BR2_PACKAGE_OPENSSL),openssl,) +QPID_PROTON_CONF_OPTS = \ + -DBUILD_JAVA=OFF \ + -DENABLE_VALGRIND=OFF \ + -DENABLE_WARNING_ERROR=OFF + +define QPID_PROTON_REMOVE_EXAMPLES + rm -fr $(TARGET_DIR)/usr/share/proton-$(QPID_PROTON_VERSION_MAJOR)/examples +endef + +QPID_PROTON_POST_INSTALL_TARGET_HOOKS += QPID_PROTON_REMOVE_EXAMPLES + +$(eval $(cmake-package))
Signature · 1 line
Luca
PATCH 7/7 qpid-proton: new package
In reply to Luca CeresoliQuoted 1 line · Luca Ceresoli
Signed-off-by Luca Ceresoli <[email protected]>
What's the upstream status of the patch?
One more comment below:
[snip]
Quoted 14 lines
package/qpid-proton/qpid-proton.hash new file +2
-0@@ -0,0 +1,2 @@ +# Hash from: http://www.apache.org/dist/qpid/proton/0.9.1/qpid-proton-0.9.1.tar.gz.sha +sha1 98008d90acd0d47cbd7ac1572a2bb50b452338ed qpid-proton-0.9.1.tar.gzpackage/qpid-proton/qpid-proton.mk new file +0
-0
package/qpid-proton/qpid-proton.mk line 9
Quoted 9 lines
package/qpid-proton/qpid-proton.mk new file +9
-0@@ -0,0 +1,28 @@ +################################################################################ +# +# qpid-proton +# +################################################################################ + +QPID_PROTON_VERSION_MAJOR = 0.9 +QPID_PROTON_VERSION = $(QPID_PROTON_VERSION_MAJOR).1 +QPID_PROTON_SITE = http://apache.panu.it/qpid/proton/0.9.1
Use _VERSION here.
package/qpid-proton/qpid-proton.mk line 16
Quoted 7 lines
package/qpid-proton/qpid-proton.mk new file +7
-0+QPID_PROTON_STRIP_COMPONENTS = 2 +QPID_PROTON_LICENSE = Apache-2.0 +QPID_PROTON_LICENSE_FILES = LICENSE +QPID_PROTON_INSTALL_STAGING = YES +QPID_PROTON_DEPENDENCIES = \ + util-linux \ + $(if $(BR2_PACKAGE_OPENSSL),openssl,)
The final , is not needed.
package/qpid-proton/qpid-proton.mk line 23
Quoted 7 lines
package/qpid-proton/qpid-proton.mk new file +7
-0+QPID_PROTON_CONF_OPTS = \ + -DBUILD_JAVA=OFF \ + -DENABLE_VALGRIND=OFF \ + -DENABLE_WARNING_ERROR=OFF + +define QPID_PROTON_REMOVE_EXAMPLES + rm -fr $(TARGET_DIR)/usr/share/proton-$(QPID_PROTON_VERSION_MAJOR)/examples
To avoid the need for defining _MAJOR (which is a pain IMHO), you could just do
proton-*/examples.
Regards,
Arnout
Quoted 6 lines
package/qpid-proton/qpid-proton.mk new file +5
-0+endef + +QPID_PROTON_POST_INSTALL_TARGET_HOOKS += QPID_PROTON_REMOVE_EXAMPLES + +$(eval $(cmake-package))
Signature · 6 lines
Arnout Vandecappelle arnout at mind be Senior Embedded Software Architect +32-16-286500 Essensium/Mind http://www.mind.be G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle GPG fingerprint: 7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
PATCH 7/7 qpid-proton: new package
Dear Arnout, Thomas,
Quoted 4 lines · Arnout Vandecappelle
Quoted 1 line · Luca Ceresoli
Signed-off-by Luca Ceresoli <[email protected]>What's the upstream status of the patch?
It's upstream [0], sorry for not having mentioned it in the patch submission.
The rest of your comments have already been taken into account by Thomas while committing. Thanks, Thomas.
[0]
https://github.com/apache/qpid-proton/commit/ed8e0144a4fccec6d5270198d2dc3aa3e9b22b4b
Signature · 1 line
Luca
PATCH 7/7 qpid-proton: new package
In reply to Luca CeresoliDear Luca Ceresoli,
Quoted 12 lines · Luca Ceresoli
Signed-off-by Luca Ceresoli <[email protected]>--- package/Config.in | 1 + ...fix-C-compiler-detection-with-_ARG1-_ARG2.patch | 52 ++++++++++++++++++++++ package/qpid-proton/Config.in | 17 +++++++ package/qpid-proton/qpid-proton.hash | 2 + package/qpid-proton/qpid-proton.mk | 28 ++++++++++++ 5 files changed, 100 insertions(+) create mode 100644 package/qpid-proton/0001-proton-c-fix-C-compiler-detection-with-_ARG1-_ARG2.patch create mode 100644 package/qpid-proton/Config.in create mode 100644 package/qpid-proton/qpid-proton.hash create mode 100644 package/qpid-proton/qpid-proton.mk
Applied after doing a bunch of fixes:
[Thomas:
- Do not define QPID_PROTON_VERSION_MAJOR, and use proto-* instead, as suggested by Arnout.
- Use QPID_PROTO_VERSION in QPID_PROTON_SITE, as suggested by Arnout
- Remove useless comma in the openssl test, as suggested by Arnout
- Change the post install target hook to remove the /usr/share/proton-*/ directory entirely, and not just the examples, since it only contains some license and documentation files.]
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
PATCH 1/7 Add <PKG>_STRIP_COMPONENTS for packages with non-standard tarballs
In reply to Luca CeresoliQuoted 9 lines · Luca Ceresoli
Usually package tarballs contain only a directory named "<pkg-name>-<pkg-version>" which contains the actual source tree. To properly extract the source files in $(BUILD_DIR), Buildroot passes the --strip-components=1 option to tar.
Unfortunately a few packages ship in a non-standard way, with no root directory or with more than one. In Buildroot these packages must be handled by overriding the <PKG>_DOWNLOAD_CMDS.
Quoted 6 lines
As the number of such packages is growing, introduce a <PKG>_STRIP_COMPONENTS variable for packages to request a number of components to strip different from 1.
Signed-off-by Luca Ceresoli <[email protected]>Cc Arnout Vandecappelle <[email protected]>
Regards,
Arnout
Quoted 33 lines
--- package/pkg-generic.mk | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)package/pkg-generic.mk +9
-1@@ -322,6 +322,14 @@ ifndef $(2)_SUBDIR endif endif +ifndef $(2)_STRIP_COMPONENTS + ifdef $(3)_STRIP_COMPONENTS + $(2)_STRIP_COMPONENTS = $$($(3)_STRIP_COMPONENTS) + else + $(2)_STRIP_COMPONENTS ?= 1 + endif +endif + $(2)_SRCDIR = $$($(2)_DIR)/$$($(2)_SUBDIR) $(2)_BUILDDIR ?= $$($(2)_SRCDIR)@@ -431,7 +439,7 @@ $(2)_TARGET_DIRCLEAN = $$($(2)_DIR)/.stamp_dircleaned # default extract command $(2)_EXTRACT_CMDS ?= \ $$(if $$($(2)_SOURCE),$$(INFLATE$$(suffix $$($(2)_SOURCE))) $$(DL_DIR)/$$($(2)_SOURCE) | \ - $$(TAR) $$(TAR_STRIP_COMPONENTS)=1 -C $$($(2)_DIR) $$(TAR_OPTIONS) -) + $$(TAR) $$(TAR_STRIP_COMPONENTS)=$$($(2)_STRIP_COMPONENTS) -C $$($(2)_DIR) $$(TAR_OPTIONS) -) # pre/post-steps hooks $(2)_PRE_DOWNLOAD_HOOKS ?=
Signature · 6 lines
Arnout Vandecappelle arnout at mind be Senior Embedded Software Architect +32-16-286500 Essensium/Mind http://www.mind.be G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle GPG fingerprint: 7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
PATCH 1/7 Add <PKG>_STRIP_COMPONENTS for packages with non-standard tarballs
In reply to Luca CeresoliDear Luca Ceresoli,
Quoted 13 lines · Luca Ceresoli
Usually package tarballs contain only a directory named "<pkg-name>-<pkg-version>" which contains the actual source tree. To properly extract the source files in $(BUILD_DIR), Buildroot passes the --strip-components=1 option to tar.
Unfortunately a few packages ship in a non-standard way, with no root directory or with more than one. In Buildroot these packages must be handled by overriding the <PKG>_DOWNLOAD_CMDS.
As the number of such packages is growing, introduce a <PKG>_STRIP_COMPONENTS variable for packages to request a number of components to strip different from 1.
Quoted 5 lines
Signed-off-by Luca Ceresoli <[email protected]>Cc Arnout Vandecappelle <[email protected]>--- package/pkg-generic.mk | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
Patches 1 to 6 applied.
Best regards,
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
PATCH 1/7 Add <PKG>_STRIP_COMPONENTS for packages with non-standard tarballs
In reply to Luca CeresoliSince the cover letter is missing, I'll reply to this one...
Quoted 4 lines · Luca Ceresoli
Usually package tarballs contain only a directory named "<pkg-name>-<pkg-version>" which contains the actual source tree. To properly extract the source files in $(BUILD_DIR), Buildroot passes the --strip-components=1 option to tar.
Great work.
I think the following packages could also be converted:
flite
nvidia-tegra23-codecs
but admittedly, they look a little more complicated.
Regards,
Arnout
Signature · 6 lines
Arnout Vandecappelle arnout at mind be Senior Embedded Software Architect +32-16-286500 Essensium/Mind http://www.mind.be G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle GPG fingerprint: 7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
PATCH 1/7 Add <PKG>_STRIP_COMPONENTS for packages with non-standard tarballs
Dear Arnout,
Quoted 8 lines · Arnout Vandecappelle
Since the cover letter is missing, I'll reply to this one...
Quoted 4 lines · Luca Ceresoli
Usually package tarballs contain only a directory named "<pkg-name>-<pkg-version>" which contains the actual source tree. To properly extract the source files in $(BUILD_DIR), Buildroot passes the --strip-components=1 option to tar.
Quoted 5 lines
Great work.
I think the following packages could also be converted:
flite
I gave it a try. Here it is, http://patchwork.ozlabs.org/patch/494116/
but I'm not sure it's exactly a lovely patch...
Signature · 1 line
Luca
PATCH 1/7 Add <PKG>_STRIP_COMPONENTS for packages with non-standard tarballs
In reply to Luca CeresoliDear Luca Ceresoli,
Quoted 13 lines · Luca Ceresoli
Usually package tarballs contain only a directory named "<pkg-name>-<pkg-version>" which contains the actual source tree. To properly extract the source files in $(BUILD_DIR), Buildroot passes the --strip-components=1 option to tar.
Unfortunately a few packages ship in a non-standard way, with no root directory or with more than one. In Buildroot these packages must be handled by overriding the <PKG>_DOWNLOAD_CMDS.
As the number of such packages is growing, introduce a <PKG>_STRIP_COMPONENTS variable for packages to request a number of components to strip different from 1.
Quoted 5 lines
Signed-off-by Luca Ceresoli <[email protected]>Cc Arnout Vandecappelle <[email protected]>--- package/pkg-generic.mk | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
This actually triggered a failure in the build of the tar package:
http://autobuild.buildroot.org/results/ae2/ae20df67f99f75b1ba5d5b7316ad265d66f3aa66/build-end.log
We have already fixed it, it was quite interesting:
http://git.buildroot.net/buildroot/commit/?id=ef7cc99c7a432aa3929015183f7c7476b7cd1b68
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
PATCH 1/7 Add <PKG>_STRIP_COMPONENTS for packages with non-standard tarballs
Dear Thomas,
Quoted 22 lines · Thomas Petazzoni
Dear Luca Ceresoli,
Quoted 13 lines · Luca Ceresoli
Usually package tarballs contain only a directory named "<pkg-name>-<pkg-version>" which contains the actual source tree. To properly extract the source files in $(BUILD_DIR), Buildroot passes the --strip-components=1 option to tar.
Unfortunately a few packages ship in a non-standard way, with no root directory or with more than one. In Buildroot these packages must be handled by overriding the <PKG>_DOWNLOAD_CMDS.
As the number of such packages is growing, introduce a <PKG>_STRIP_COMPONENTS variable for packages to request a number of components to strip different from 1.
Quoted 5 lines
Signed-off-by Luca Ceresoli <[email protected]>Cc Arnout Vandecappelle <[email protected]>--- package/pkg-generic.mk | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
Quoted 7 lines
This actually triggered a failure in the build of the tar package:
http://autobuild.buildroot.org/results/ae2/ae20df67f99f75b1ba5d5b7316ad265d66f3aa66/build-end.logWe have already fixed it, it was quite interesting:
http://git.buildroot.net/buildroot/commit/?id=ef7cc99c7a432aa3929015183f7c7476b7cd1b68
Ouch. O:-)
Thanks for fixing it so quickly!
Signature · 1 line
Luca