* [Buildroot] [PATCH 1/8] matchbox-lib: fix license info
2012-12-30 21:33 [Buildroot] [pull request] Pull request for branch for-master/misc-fixes Samuel Martin
@ 2012-12-30 21:33 ` Samuel Martin
2012-12-30 22:09 ` Thomas Petazzoni
2012-12-30 21:33 ` [Buildroot] [PATCH 2/8] fluxbox: fix build against imlib2 Samuel Martin
` (7 subsequent siblings)
8 siblings, 1 reply; 17+ messages in thread
From: Samuel Martin @ 2012-12-30 21:33 UTC (permalink / raw)
To: buildroot
---
package/matchbox/matchbox-lib/matchbox-lib.mk | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package/matchbox/matchbox-lib/matchbox-lib.mk b/package/matchbox/matchbox-lib/matchbox-lib.mk
index 7730d94..d18df6b 100644
--- a/package/matchbox/matchbox-lib/matchbox-lib.mk
+++ b/package/matchbox/matchbox-lib/matchbox-lib.mk
@@ -7,7 +7,7 @@
MATCHBOX_LIB_VERSION = 1.9
MATCHBOX_LIB_SOURCE = libmatchbox-$(MATCHBOX_LIB_VERSION).tar.bz2
MATCHBOX_LIB_SITE = http://downloads.yoctoproject.org/releases/matchbox/libmatchbox/$(MATCHBOX_LIB_VERSION)
-MATCHBOX_LIB_LICENSE = LGPLv2.1
+MATCHBOX_LIB_LICENSE = LGPLv2.1+
MATCHBOX_LIB_LICENSE_FILES = COPYING
MATCHBOX_LIB_INSTALL_STAGING = YES
MATCHBOX_LIB_DEPENDENCIES = host-pkgconf expat xlib_libXext
--
1.8.0.3
^ permalink raw reply related [flat|nested] 17+ messages in thread* [Buildroot] [PATCH 1/8] matchbox-lib: fix license info
2012-12-30 21:33 ` [Buildroot] [PATCH 1/8] matchbox-lib: fix license info Samuel Martin
@ 2012-12-30 22:09 ` Thomas Petazzoni
0 siblings, 0 replies; 17+ messages in thread
From: Thomas Petazzoni @ 2012-12-30 22:09 UTC (permalink / raw)
To: buildroot
Dear Samuel Martin,
On Sun, 30 Dec 2012 22:33:25 +0100, Samuel Martin wrote:
> ---
> package/matchbox/matchbox-lib/matchbox-lib.mk | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Acked-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
--
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Buildroot] [PATCH 2/8] fluxbox: fix build against imlib2
2012-12-30 21:33 [Buildroot] [pull request] Pull request for branch for-master/misc-fixes Samuel Martin
2012-12-30 21:33 ` [Buildroot] [PATCH 1/8] matchbox-lib: fix license info Samuel Martin
@ 2012-12-30 21:33 ` Samuel Martin
2012-12-30 21:33 ` [Buildroot] [PATCH 3/8] package/Makefile.in: update/fix HOST_PATH variable Samuel Martin
` (6 subsequent siblings)
8 siblings, 0 replies; 17+ messages in thread
From: Samuel Martin @ 2012-12-30 21:33 UTC (permalink / raw)
To: buildroot
* fix configure.in to take care of the given imlib2-prefix
* disable imlib2 support if imlib2 is not part of the selection
---
package/fluxbox/fluxbox-1.3.2-fix-configure.patch | 19 +++++++++++++++++++
package/fluxbox/fluxbox.mk | 10 +++++++++-
2 files changed, 28 insertions(+), 1 deletion(-)
create mode 100644 package/fluxbox/fluxbox-1.3.2-fix-configure.patch
diff --git a/package/fluxbox/fluxbox-1.3.2-fix-configure.patch b/package/fluxbox/fluxbox-1.3.2-fix-configure.patch
new file mode 100644
index 0000000..2cb8273
--- /dev/null
+++ b/package/fluxbox/fluxbox-1.3.2-fix-configure.patch
@@ -0,0 +1,19 @@
+Avoid to call the imlib2-config that may be installed on the host system
+(even when --with-imlib2-prefix or --with-imlib2-exec-prefix is passed to
+the configure script), which totally screws up the resulting linker flags.
+
+Inspired by: http://git.fluxbox.org/fluxbox.git/commit/?id=b178bed60b5bd8b2c9ed0cbc67fd729ff3820589
+
+Signed-off-by: Samuel Martin <s.martin49@gmail.com>
+
+--- fluxbox-1.3.2.orig/configure.in 2012-10-21 16:11:59.445749396 +0200
++++ fluxbox-1.3.2/configure.in 2012-10-21 16:35:27.658390856 +0200
+@@ -443,8 +443,6 @@ if test x$enable_imlib2 = "xyes"; then
+ [
+ IMLIB2=true
+ AC_DEFINE(HAVE_IMLIB2, [], [Imlib2 support])
+- IMLIB2_LIBS=`imlib2-config --libs`
+- IMLIB2_CFLAGS=`imlib2-config --cflags`
+ LIBS="$LIBS $IMLIB2_LIBS"
+ CXXFLAGS="$CXXFLAGS $IMLIB2_CFLAGS"
+ ], [ AC_MSG_RESULT(no)]
diff --git a/package/fluxbox/fluxbox.mk b/package/fluxbox/fluxbox.mk
index 356c5a2..04ffb91 100644
--- a/package/fluxbox/fluxbox.mk
+++ b/package/fluxbox/fluxbox.mk
@@ -10,11 +10,19 @@ FLUXBOX_SITE = http://downloads.sourceforge.net/project/fluxbox/fluxbox/$(FLUXBO
FLUXBOX_LICENSE = MIT
FLUXBOX_LICENSE_FILES = COPYING
+FLUXBOX_AUTORECONF = YES
+
FLUXBOX_CONF_OPT = --x-includes=$(STAGING_DIR)/usr/include/X11 \
--x-libraries=$(STAGING_DIR)/usr/lib
-
FLUXBOX_DEPENDENCIES = xlib_libX11 $(if $(BR2_PACKAGE_LIBICONV),libiconv)
+ifeq ($(BR2_PACKAGE_IMLIB2),y)
+FLUXBOX_CONF_OPT += --enable-imlib2 --with-imlib2-prefix=$(STAGING_DIR)/usr
+FLUXBOX_DEPENDENCIES += imlib2
+else
+FLUXBOX_CONF_OPT += --disable-imlib2
+endif
+
define FLUXBOX_INSTALL_XSESSION_FILE
[ -f $(TARGET_DIR)/root/.xsession ] || $(INSTALL) -m 0755 -D \
package/fluxbox/xsession $(TARGET_DIR)/root/.xsession
--
1.8.0.3
^ permalink raw reply related [flat|nested] 17+ messages in thread* [Buildroot] [PATCH 3/8] package/Makefile.in: update/fix HOST_PATH variable
2012-12-30 21:33 [Buildroot] [pull request] Pull request for branch for-master/misc-fixes Samuel Martin
2012-12-30 21:33 ` [Buildroot] [PATCH 1/8] matchbox-lib: fix license info Samuel Martin
2012-12-30 21:33 ` [Buildroot] [PATCH 2/8] fluxbox: fix build against imlib2 Samuel Martin
@ 2012-12-30 21:33 ` Samuel Martin
2012-12-30 22:11 ` Thomas Petazzoni
2012-12-30 21:33 ` [Buildroot] [PATCH 4/8] package/pkg-cmake.mk: make sure $(HOST_PATH) is in the PATH at configure time Samuel Martin
` (5 subsequent siblings)
8 siblings, 1 reply; 17+ messages in thread
From: Samuel Martin @ 2012-12-30 21:33 UTC (permalink / raw)
To: buildroot
---
package/Makefile.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package/Makefile.in b/package/Makefile.in
index cc8f320..dd04e25 100644
--- a/package/Makefile.in
+++ b/package/Makefile.in
@@ -165,7 +165,7 @@ HOST_CFLAGS ?= -O2
HOST_CFLAGS += $(HOST_CPPFLAGS)
HOST_CXXFLAGS += $(HOST_CFLAGS)
HOST_LDFLAGS += -L$(HOST_DIR)/lib -L$(HOST_DIR)/usr/lib -Wl,-rpath,$(HOST_DIR)/usr/lib
-HOST_PATH=$(HOST_DIR)/bin:$(HOST_DIR)/usr/bin:$(PATH)
+HOST_PATH="$(HOST_DIR)/bin:$(HOST_DIR)/usr/bin:$(HOST_DIR)/usr/sbin/:$(PATH)"
# hostcc version as an integer - E.G. 4.3.2 => 432
HOSTCC_VERSION:=$(shell $(HOSTCC_NOCCACHE) --version | \
--
1.8.0.3
^ permalink raw reply related [flat|nested] 17+ messages in thread* [Buildroot] [PATCH 3/8] package/Makefile.in: update/fix HOST_PATH variable
2012-12-30 21:33 ` [Buildroot] [PATCH 3/8] package/Makefile.in: update/fix HOST_PATH variable Samuel Martin
@ 2012-12-30 22:11 ` Thomas Petazzoni
2012-12-30 22:41 ` Samuel Martin
0 siblings, 1 reply; 17+ messages in thread
From: Thomas Petazzoni @ 2012-12-30 22:11 UTC (permalink / raw)
To: buildroot
Dear Samuel Martin,
On Sun, 30 Dec 2012 22:33:27 +0100, Samuel Martin wrote:
> ---
> package/Makefile.in | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/package/Makefile.in b/package/Makefile.in
> index cc8f320..dd04e25 100644
> --- a/package/Makefile.in
> +++ b/package/Makefile.in
> @@ -165,7 +165,7 @@ HOST_CFLAGS ?= -O2
> HOST_CFLAGS += $(HOST_CPPFLAGS)
> HOST_CXXFLAGS += $(HOST_CFLAGS)
> HOST_LDFLAGS += -L$(HOST_DIR)/lib -L$(HOST_DIR)/usr/lib -Wl,-rpath,$(HOST_DIR)/usr/lib
> -HOST_PATH=$(HOST_DIR)/bin:$(HOST_DIR)/usr/bin:$(PATH)
> +HOST_PATH="$(HOST_DIR)/bin:$(HOST_DIR)/usr/bin:$(HOST_DIR)/usr/sbin/:$(PATH)"
Why?
For such core changes, a commit message of "update/fix something" is
definitely not enough. A detailed explanation is needed.
Thanks!
Thomas
--
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Buildroot] [PATCH 3/8] package/Makefile.in: update/fix HOST_PATH variable
2012-12-30 22:11 ` Thomas Petazzoni
@ 2012-12-30 22:41 ` Samuel Martin
0 siblings, 0 replies; 17+ messages in thread
From: Samuel Martin @ 2012-12-30 22:41 UTC (permalink / raw)
To: buildroot
Hi Thomas, all,
2012/12/30 Thomas Petazzoni <thomas.petazzoni@free-electrons.com>:
> Dear Samuel Martin,
>
> On Sun, 30 Dec 2012 22:33:27 +0100, Samuel Martin wrote:
>> ---
>> package/Makefile.in | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/package/Makefile.in b/package/Makefile.in
>> index cc8f320..dd04e25 100644
>> --- a/package/Makefile.in
>> +++ b/package/Makefile.in
>> @@ -165,7 +165,7 @@ HOST_CFLAGS ?= -O2
>> HOST_CFLAGS += $(HOST_CPPFLAGS)
>> HOST_CXXFLAGS += $(HOST_CFLAGS)
>> HOST_LDFLAGS += -L$(HOST_DIR)/lib -L$(HOST_DIR)/usr/lib -Wl,-rpath,$(HOST_DIR)/usr/lib
>> -HOST_PATH=$(HOST_DIR)/bin:$(HOST_DIR)/usr/bin:$(PATH)
>> +HOST_PATH="$(HOST_DIR)/bin:$(HOST_DIR)/usr/bin:$(HOST_DIR)/usr/sbin/:$(PATH)"
>
> Why?
Well, honestly, to keep things consistent with TARGET_PATH...
We can also wonder why TARGET_PATH contains $(HOST_DIR)/usr/sbin? or
whether it is needed/used in TARGET_PATH?
I can do the other way, removing $(HOST_DIR)/usr/sbin from both
TARGET_PATH and HOST_PATH.
Also, TARGET_PATH and HOST_PATH store pretty much the same things...
do we need 2 distincts variables?
BTW, AFAICS nothing is installed in $(HOST_DIR)/bin...
And some binaries from $(HOST_DIR)/usr/sbin which could be used by
some post-build scripts, but I doubt HOST_PATH or TARGET_PATH are
correctly exported when post-build scripts are executed.
>
> For such core changes, a commit message of "update/fix something" is
> definitely not enough. A detailed explanation is needed.
Agreed.
Regards,
--
Samuel
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Buildroot] [PATCH 4/8] package/pkg-cmake.mk: make sure $(HOST_PATH) is in the PATH at configure time
2012-12-30 21:33 [Buildroot] [pull request] Pull request for branch for-master/misc-fixes Samuel Martin
` (2 preceding siblings ...)
2012-12-30 21:33 ` [Buildroot] [PATCH 3/8] package/Makefile.in: update/fix HOST_PATH variable Samuel Martin
@ 2012-12-30 21:33 ` Samuel Martin
2012-12-30 22:14 ` Thomas Petazzoni
2012-12-30 21:33 ` [Buildroot] [PATCH 5/8] dependencies: build a host python2 if no suitable one can be found Samuel Martin
` (4 subsequent siblings)
8 siblings, 1 reply; 17+ messages in thread
From: Samuel Martin @ 2012-12-30 21:33 UTC (permalink / raw)
To: buildroot
---
package/pkg-cmake.mk | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/package/pkg-cmake.mk b/package/pkg-cmake.mk
index 626a0b0..1e8302f 100644
--- a/package/pkg-cmake.mk
+++ b/package/pkg-cmake.mk
@@ -62,7 +62,8 @@ ifeq ($(5),target)
define $(2)_CONFIGURE_CMDS
(cd $$($$(PKG)_BUILDDIR) && \
rm -f CMakeCache.txt && \
- $$($$(PKG)_CONF_ENV) $(HOST_DIR)/usr/bin/cmake $$($$(PKG)_SRCDIR) \
+ PATH="$(TARGET_PATH)" $$($$(PKG)_CONF_ENV) \
+ $(HOST_DIR)/usr/bin/cmake $$($$(PKG)_SRCDIR) \
-DCMAKE_TOOLCHAIN_FILE="$$(HOST_DIR)/usr/share/buildroot/toolchainfile.cmake" \
-DCMAKE_INSTALL_PREFIX="/usr" \
$$($$(PKG)_CONF_OPT) \
@@ -74,7 +75,7 @@ else
define $(2)_CONFIGURE_CMDS
(cd $$($$(PKG)_BUILDDIR) && \
rm -f CMakeCache.txt && \
- $(HOST_DIR)/usr/bin/cmake $$($$(PKG)_SRCDIR) \
+ PATH="$(HOST_PATH)" $(HOST_DIR)/usr/bin/cmake $$($$(PKG)_SRCDIR) \
-DCMAKE_INSTALL_SO_NO_EXE=0 \
-DCMAKE_FIND_ROOT_PATH="$$(HOST_DIR)" \
-DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM="BOTH" \
--
1.8.0.3
^ permalink raw reply related [flat|nested] 17+ messages in thread* [Buildroot] [PATCH 4/8] package/pkg-cmake.mk: make sure $(HOST_PATH) is in the PATH at configure time
2012-12-30 21:33 ` [Buildroot] [PATCH 4/8] package/pkg-cmake.mk: make sure $(HOST_PATH) is in the PATH at configure time Samuel Martin
@ 2012-12-30 22:14 ` Thomas Petazzoni
2012-12-30 22:42 ` Samuel Martin
0 siblings, 1 reply; 17+ messages in thread
From: Thomas Petazzoni @ 2012-12-30 22:14 UTC (permalink / raw)
To: buildroot
Dear Samuel Martin,
On Sun, 30 Dec 2012 22:33:28 +0100, Samuel Martin wrote:
> ---
> package/pkg-cmake.mk | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/package/pkg-cmake.mk b/package/pkg-cmake.mk
> index 626a0b0..1e8302f 100644
> --- a/package/pkg-cmake.mk
> +++ b/package/pkg-cmake.mk
> @@ -62,7 +62,8 @@ ifeq ($(5),target)
> define $(2)_CONFIGURE_CMDS
> (cd $$($$(PKG)_BUILDDIR) && \
> rm -f CMakeCache.txt && \
> - $$($$(PKG)_CONF_ENV) $(HOST_DIR)/usr/bin/cmake $$($$(PKG)_SRCDIR) \
> + PATH="$(TARGET_PATH)" $$($$(PKG)_CONF_ENV) \
> + $(HOST_DIR)/usr/bin/cmake $$($$(PKG)_SRCDIR) \
> -DCMAKE_TOOLCHAIN_FILE="$$(HOST_DIR)/usr/share/buildroot/toolchainfile.cmake" \
> -DCMAKE_INSTALL_PREFIX="/usr" \
> $$($$(PKG)_CONF_OPT) \
> @@ -74,7 +75,7 @@ else
> define $(2)_CONFIGURE_CMDS
> (cd $$($$(PKG)_BUILDDIR) && \
> rm -f CMakeCache.txt && \
> - $(HOST_DIR)/usr/bin/cmake $$($$(PKG)_SRCDIR) \
> + PATH="$(HOST_PATH)" $(HOST_DIR)/usr/bin/cmake $$($$(PKG)_SRCDIR) \
> -DCMAKE_INSTALL_SO_NO_EXE=0 \
> -DCMAKE_FIND_ROOT_PATH="$$(HOST_DIR)" \
> -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM="BOTH" \
In fact, with your previous patch TARGET_PATH becomes equal to
HOST_PATH. And I find the name TARGET_PATH to be misleading. Maybe we
should just refactor that in a single variable instead?
Thomas
--
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Buildroot] [PATCH 4/8] package/pkg-cmake.mk: make sure $(HOST_PATH) is in the PATH at configure time
2012-12-30 22:14 ` Thomas Petazzoni
@ 2012-12-30 22:42 ` Samuel Martin
0 siblings, 0 replies; 17+ messages in thread
From: Samuel Martin @ 2012-12-30 22:42 UTC (permalink / raw)
To: buildroot
Hi Thomas, all,
2012/12/30 Thomas Petazzoni <thomas.petazzoni@free-electrons.com>:
> Dear Samuel Martin,
>
> On Sun, 30 Dec 2012 22:33:28 +0100, Samuel Martin wrote:
>> ---
>> package/pkg-cmake.mk | 5 +++--
>> 1 file changed, 3 insertions(+), 2 deletions(-)
>>
>> diff --git a/package/pkg-cmake.mk b/package/pkg-cmake.mk
>> index 626a0b0..1e8302f 100644
>> --- a/package/pkg-cmake.mk
>> +++ b/package/pkg-cmake.mk
>> @@ -62,7 +62,8 @@ ifeq ($(5),target)
>> define $(2)_CONFIGURE_CMDS
>> (cd $$($$(PKG)_BUILDDIR) && \
>> rm -f CMakeCache.txt && \
>> - $$($$(PKG)_CONF_ENV) $(HOST_DIR)/usr/bin/cmake $$($$(PKG)_SRCDIR) \
>> + PATH="$(TARGET_PATH)" $$($$(PKG)_CONF_ENV) \
>> + $(HOST_DIR)/usr/bin/cmake $$($$(PKG)_SRCDIR) \
>> -DCMAKE_TOOLCHAIN_FILE="$$(HOST_DIR)/usr/share/buildroot/toolchainfile.cmake" \
>> -DCMAKE_INSTALL_PREFIX="/usr" \
>> $$($$(PKG)_CONF_OPT) \
>> @@ -74,7 +75,7 @@ else
>> define $(2)_CONFIGURE_CMDS
>> (cd $$($$(PKG)_BUILDDIR) && \
>> rm -f CMakeCache.txt && \
>> - $(HOST_DIR)/usr/bin/cmake $$($$(PKG)_SRCDIR) \
>> + PATH="$(HOST_PATH)" $(HOST_DIR)/usr/bin/cmake $$($$(PKG)_SRCDIR) \
>> -DCMAKE_INSTALL_SO_NO_EXE=0 \
>> -DCMAKE_FIND_ROOT_PATH="$$(HOST_DIR)" \
>> -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM="BOTH" \
>
> In fact, with your previous patch TARGET_PATH becomes equal to
> HOST_PATH. And I find the name TARGET_PATH to be misleading. Maybe we
> should just refactor that in a single variable instead?
Just post the same comment ;-)
Regards,
--
Samuel
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Buildroot] [PATCH 5/8] dependencies: build a host python2 if no suitable one can be found
2012-12-30 21:33 [Buildroot] [pull request] Pull request for branch for-master/misc-fixes Samuel Martin
` (3 preceding siblings ...)
2012-12-30 21:33 ` [Buildroot] [PATCH 4/8] package/pkg-cmake.mk: make sure $(HOST_PATH) is in the PATH at configure time Samuel Martin
@ 2012-12-30 21:33 ` Samuel Martin
2012-12-30 21:33 ` [Buildroot] [PATCH 6/8] scons: add host-python2-if-needed dependency Samuel Martin
` (3 subsequent siblings)
8 siblings, 0 replies; 17+ messages in thread
From: Samuel Martin @ 2012-12-30 21:33 UTC (permalink / raw)
To: buildroot
Some distros now comes with only python3 installed, with or without a
/usr/bin/python pointing to python3.
So, /usr/bin/python may refer to either python2 or python3.
This may have some bad consequences for packages that uses some
non python{2,3}-friendly scripts in their build system (eg. in install
or post-install scripts).
This patch checks for a suitable python2 version (2.6 or 2.7) on the host
system, and:
* if a valid python2 interperter is found on the host system, then:
- a symlink pointing to the found python2 interpreter is created in the
buildroot host tree at the beginning of the build;
- a make target host-python2-if-needed is set to '$(HOST_DIR)/usr/bin/python'.
This way, if the host-python package is built later, the symlink will be
automatically overriden by the host-python install rules.
* if no valid python2 interperter is found on the host system, then:
- a make target host-python2-if-needed is set to 'host-python'.
Note 1: The symlink is checked and created if necessary at the beginning of
each build.
Note 2: Since there is no target named '$(HOST_DIR)/usr/bin/python' in the
python makefiles, there is no need for removing the symlink before
installing the host-pyhton package.
Note 3: The host-python is only built when necessary.
This also means that in the case there is no python2 interperter
available on the host system, there won't any host python2 interperter
until the host-python package is built.
Note 4: Any package containing some non python{2,3}-friendly scripts should:
- have 'host-python2-if-needed' in its *_DEPENDENCIES list;
- set and add to their build/install environment, either
PATH="$(HOST_PATH)" or PATH="$(TARGET_PATH)".
A (good) side effect of this patch is getting rid of any host python dependency.
Buildroot can run on a host without python, or with a too old python2 version,
or with only python3.
In any case where a host python2 interpreter is expected to run some build or
install scripts, 'host-python2-if-needed' should be added to the dependency
list.
With this patch, the host python2 interpreter is either found in the host
system, or build by Buildroot. So, we can drop the python dependency check.
Signed-off-by: Samuel Martin <s.martin49@gmail.com>
---
support/dependencies/check-host-python2.mk | 18 ++++++++++++++++++
support/dependencies/check-host-python2.sh | 13 +++++++++++++
support/dependencies/dependencies.sh | 2 +-
3 files changed, 32 insertions(+), 1 deletion(-)
create mode 100644 support/dependencies/check-host-python2.mk
create mode 100755 support/dependencies/check-host-python2.sh
diff --git a/support/dependencies/check-host-python2.mk b/support/dependencies/check-host-python2.mk
new file mode 100644
index 0000000..5bc2986
--- /dev/null
+++ b/support/dependencies/check-host-python2.mk
@@ -0,0 +1,18 @@
+PYTHON2 = $(call suitable-host-package,python2,$(HOST_DIR)/usr/bin/python)
+
+ifeq ($(PYTHON2),)
+host-python2-if-needed: host-python
+else
+host-python2-if-needed: $(HOST_DIR)/usr/bin/python
+# Create the python symlink once for all at the beginning of the build.
+DEPENDENCIES_HOST_PREREQ += host-python2-symlink
+endif
+
+# host-python install rules override the symlink created here.
+# So, there is no need to patch the python package to remove the symlink
+# before installing itself.
+host-python2-symlink:
+ @mkdir -p $(HOST_DIR)/usr/bin
+ test -x "$(HOST_DIR)/usr/bin/python" -a \
+ "$(PYTHON2)" = "$(HOST_DIR)/usr/bin/python" || \
+ $(HOSTLN) -sf "$(PYTHON2)" "$(HOST_DIR)/usr/bin/python"
diff --git a/support/dependencies/check-host-python2.sh b/support/dependencies/check-host-python2.sh
new file mode 100755
index 0000000..a340674
--- /dev/null
+++ b/support/dependencies/check-host-python2.sh
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+candidates="${@} python python2"
+
+for candidate in ${candidates} ; do
+ which "${candidate}" &>/dev/null || continue
+ # restrict version of python2 to 2.6 or 2.7
+ if "${candidate}" --version 2>&1 | grep -q 'Python 2\.[6-7]\..*' ; then
+ # found a valid candidate, so quit now
+ echo $(which "${candidate}")
+ exit
+ fi
+done
diff --git a/support/dependencies/dependencies.sh b/support/dependencies/dependencies.sh
index 7a02512..0a5cf8b 100755
--- a/support/dependencies/dependencies.sh
+++ b/support/dependencies/dependencies.sh
@@ -131,7 +131,7 @@ if ! $SHELL --version 2>&1 | grep -q '^GNU bash'; then
fi;
# Check that a few mandatory programs are installed
-for prog in awk bison flex msgfmt makeinfo patch gzip bzip2 perl tar wget cpio python unzip rsync ${DL_TOOLS} ; do
+for prog in awk bison flex msgfmt makeinfo patch gzip bzip2 perl tar wget cpio unzip rsync ${DL_TOOLS} ; do
if ! which $prog > /dev/null ; then
/bin/echo -e "\nYou must install '$prog' on your build machine";
if test $prog = "makeinfo" ; then
--
1.8.0.3
^ permalink raw reply related [flat|nested] 17+ messages in thread* [Buildroot] [PATCH 6/8] scons: add host-python2-if-needed dependency
2012-12-30 21:33 [Buildroot] [pull request] Pull request for branch for-master/misc-fixes Samuel Martin
` (4 preceding siblings ...)
2012-12-30 21:33 ` [Buildroot] [PATCH 5/8] dependencies: build a host python2 if no suitable one can be found Samuel Martin
@ 2012-12-30 21:33 ` Samuel Martin
2012-12-30 21:33 ` [Buildroot] [PATCH 7/8] scons: ensure $(HOST_DIR)/usr/bin is in the PATH when invoking $(SCONS) Samuel Martin
` (2 subsequent siblings)
8 siblings, 0 replies; 17+ messages in thread
From: Samuel Martin @ 2012-12-30 21:33 UTC (permalink / raw)
To: buildroot
Also, ensure $(HOST_DIR)/usr/bin is in the PATH during the configure phase.
---
package/scons/scons.mk | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/package/scons/scons.mk b/package/scons/scons.mk
index 79fd6b1..e3ada92 100644
--- a/package/scons/scons.mk
+++ b/package/scons/scons.mk
@@ -4,12 +4,16 @@ SCONS_SITE = http://downloads.sourceforge.net/project/scons/scons/$(SCONS_VERSIO
SCONS_LICENSE = MIT
SCONS_LICENSE_FILES = LICENSE.txt
+# Because Scons is not python3-friendly, we have to ensure that
+HOST_SCONS_DEPENDENCIES = host-python2-if-needed
+
define HOST_SCONS_BUILD_CMDS
- (cd $(@D); python setup.py build)
+ (cd $(@D); $(HOST_CONFIGURE_OPTS) python setup.py build)
endef
define HOST_SCONS_INSTALL_CMDS
- (cd $(@D); python setup.py install --prefix=$(HOST_DIR)/usr \
+ (cd $(@D) ; $(HOST_CONFIGURE_OPTS) python setup.py install \
+ --prefix=$(HOST_DIR)/usr \
--install-lib=$(HOST_DIR)/usr/lib/scons-$(SCONS_VERSION))
endef
--
1.8.0.3
^ permalink raw reply related [flat|nested] 17+ messages in thread* [Buildroot] [PATCH 7/8] scons: ensure $(HOST_DIR)/usr/bin is in the PATH when invoking $(SCONS)
2012-12-30 21:33 [Buildroot] [pull request] Pull request for branch for-master/misc-fixes Samuel Martin
` (5 preceding siblings ...)
2012-12-30 21:33 ` [Buildroot] [PATCH 6/8] scons: add host-python2-if-needed dependency Samuel Martin
@ 2012-12-30 21:33 ` Samuel Martin
2012-12-30 21:33 ` [Buildroot] [PATCH 8/8] manual: add host python2 dependency section Samuel Martin
2012-12-30 22:46 ` [Buildroot] [pull request] Pull request for branch for-master/misc-fixes Samuel Martin
8 siblings, 0 replies; 17+ messages in thread
From: Samuel Martin @ 2012-12-30 21:33 UTC (permalink / raw)
To: buildroot
---
package/scons/scons.mk | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package/scons/scons.mk b/package/scons/scons.mk
index e3ada92..e828588 100644
--- a/package/scons/scons.mk
+++ b/package/scons/scons.mk
@@ -20,4 +20,4 @@ endef
$(eval $(host-generic-package))
# variables used by other packages
-SCONS = $(HOST_DIR)/usr/bin/scons
+SCONS = PATH=$(HOST_PATH) $(HOST_DIR)/usr/bin/scons
--
1.8.0.3
^ permalink raw reply related [flat|nested] 17+ messages in thread* [Buildroot] [PATCH 8/8] manual: add host python2 dependency section
2012-12-30 21:33 [Buildroot] [pull request] Pull request for branch for-master/misc-fixes Samuel Martin
` (6 preceding siblings ...)
2012-12-30 21:33 ` [Buildroot] [PATCH 7/8] scons: ensure $(HOST_DIR)/usr/bin is in the PATH when invoking $(SCONS) Samuel Martin
@ 2012-12-30 21:33 ` Samuel Martin
2012-12-30 22:46 ` [Buildroot] [pull request] Pull request for branch for-master/misc-fixes Samuel Martin
8 siblings, 0 replies; 17+ messages in thread
From: Samuel Martin @ 2012-12-30 21:33 UTC (permalink / raw)
To: buildroot
---
docs/manual/adding-packages-tips.txt | 38 ++++++++++++++++++++++++++++++++++++
1 file changed, 38 insertions(+)
diff --git a/docs/manual/adding-packages-tips.txt b/docs/manual/adding-packages-tips.txt
index acdee40..4a971cb 100644
--- a/docs/manual/adding-packages-tips.txt
+++ b/docs/manual/adding-packages-tips.txt
@@ -62,3 +62,41 @@ FOO_SITE = http://github.com/<user>/<package>/tarball/<branch>
Note that the name of the tarball is the default +foo-1234567.tar.gz+
so it is not necessary to specify it in the +.mk+ file.
+
+[[python2-and-package-build-env]]
+Host python2 dependency and package environment
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Some packages provide some python scripts as part of their
+build/install system.
+
+Unfortunately, those python scripts are not always python3-friendly.
+So, a python2 interpreter on the host system is a prerequisite for
+those packages. Besides, their build system may call them invoking
++python <some script> ...+ which have bad consequences if the +python+
+command does not exist or if it call a python3 interperter instead of
+a python2 one.
+
+Buildroot provides a way to handle this case, without requiring to
+patch anything in the package sources.
+
+* add +host-python2-if-needed+ to the +*_DEPENDENCIES+ list;
+* make sure the +PATH+ environment variable contains
+ +$(HOST_DIR)/usr/bin+.
+
+.Notes
+- This is automatic if the package relies on the _autotools_ or
+ _cmake_ infrastructure and does not need to override some of the
+ configure, build or install commands.
+- Otherwise (i.e. the package uses the _generic_ infrastructure or
+ overrides some of the configure, build or install commands), you
+ should ensure +PATH=$(HOST_PATH)+ or +PATH=$(TARGET_PATH)+ to
+ overridden commands.
+- The +PATH+ environment variable is correctly set in the variables
+ +TARGET_CONFIGURE_OPTS+ or +TARGET_MAKE_ENV+ as well as in their
+ +HOST+ variants.
+- For package relying on http://www.scons.org[Scons] build system,
+ it should depend on +host-scons+ and use the +$(SCONS)+ variable.
+ This will automatically take care of the host python2 dependency
+ since http://www.scons.org[Scons] does not support python3 yet
+ (see http://www.scons.org/doc/production/HTML/scons-user/c95.html#AEN102).
--
1.8.0.3
^ permalink raw reply related [flat|nested] 17+ messages in thread* [Buildroot] [pull request] Pull request for branch for-master/misc-fixes
2012-12-30 21:33 [Buildroot] [pull request] Pull request for branch for-master/misc-fixes Samuel Martin
` (7 preceding siblings ...)
2012-12-30 21:33 ` [Buildroot] [PATCH 8/8] manual: add host python2 dependency section Samuel Martin
@ 2012-12-30 22:46 ` Samuel Martin
8 siblings, 0 replies; 17+ messages in thread
From: Samuel Martin @ 2012-12-30 22:46 UTC (permalink / raw)
To: buildroot
2012/12/30 Samuel Martin <s.martin49@gmail.com>:
> Hello,
>
> Here are few random fixes, some of them are related to python handling
> from the host system.
Ooopss... !
Just realized I forgot to add the sob line to this series.
I'll repost the series.
Apologize for the spam.
Regards,
--
Samuel
^ permalink raw reply [flat|nested] 17+ messages in thread