* [PATCH 1/9] oe.classutils: add module
2011-06-17 14:51 [PATCH 0/9] Patches pending on O.S. Systems tree Otavio Salvador
@ 2011-06-17 14:51 ` Otavio Salvador
2011-06-17 14:51 ` [PATCH 2/9] Rework how the devshell functions Otavio Salvador
` (7 subsequent siblings)
8 siblings, 0 replies; 11+ messages in thread
From: Otavio Salvador @ 2011-06-17 14:51 UTC (permalink / raw)
To: openembedded-core; +Cc: Chris Larson
From: Chris Larson <chris_larson@mentor.com>
This adds a ClassRegistry utility metaclass, as maintaining a class registry
is a fairly common thing to do.
Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
---
meta/lib/oe/classutils.py | 24 ++++++++++++++++++++++++
1 files changed, 24 insertions(+), 0 deletions(-)
create mode 100644 meta/lib/oe/classutils.py
diff --git a/meta/lib/oe/classutils.py b/meta/lib/oe/classutils.py
new file mode 100644
index 0000000..855d2fa
--- /dev/null
+++ b/meta/lib/oe/classutils.py
@@ -0,0 +1,24 @@
+class ClassRegistry(type):
+ """Maintain a registry of classes, indexed by name.
+
+ The name in the registry can be overridden via the 'name' attribute of the
+ class, and the 'priority' attribute controls priority. The prioritized()
+ method returns the registered classes in priority order."""
+ registry = {}
+ priority = 0
+
+ def __init__(cls, name, bases, attrs):
+ super(ClassRegistry, cls).__init__(name, bases, attrs)
+ if not hasattr(cls, name):
+ cls.name = name
+ cls.registry[cls.name] = cls
+
+ @classmethod
+ def prioritized(tcls):
+ return sorted(tcls.registry.values(),
+ key=lambda v: v.priority, reverse=True)
+
+ def unregister(cls):
+ for key in cls.registry.keys():
+ if cls.registry[key] is cls:
+ del cls.registry[key]
--
1.7.2.5
^ permalink raw reply related [flat|nested] 11+ messages in thread* [PATCH 2/9] Rework how the devshell functions
2011-06-17 14:51 [PATCH 0/9] Patches pending on O.S. Systems tree Otavio Salvador
2011-06-17 14:51 ` [PATCH 1/9] oe.classutils: add module Otavio Salvador
@ 2011-06-17 14:51 ` Otavio Salvador
2011-06-17 14:51 ` [PATCH 3/9] oe.terminal: improve how we spawn screen Otavio Salvador
` (6 subsequent siblings)
8 siblings, 0 replies; 11+ messages in thread
From: Otavio Salvador @ 2011-06-17 14:51 UTC (permalink / raw)
To: openembedded-core; +Cc: Chris Larson
From: Chris Larson <chris_larson@mentor.com>
In the new implementation, each known terminal is defined as a class in
oe.terminal, as a subclass of bb.process.Popen. terminal.bbclass wraps this
functionality, providing the metadata pieces. It obeys the OE_TERMINAL
variable, which is a 'choice' typed variable. This variable may be 'auto',
'none', or any of the names of the defined terminals.
When using 'auto', or requesting an unsupported terminal, we attempt to spawn
them in priority order until we get one that's available on this system (and
in the case of the X terminals, has DISPLAY defined). The 'none' value is
used when we're doing things like automated builds, and want to ensure that no
terminal is *ever* spawned, under any circumstances.
Current available terminals:
gnome
konsole
xterm
rxvt
screen
Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
---
meta/classes/devshell.bbclass | 26 ++++-------
meta/classes/terminal.bbclass | 30 ++++++++++++
meta/lib/oe/classutils.py | 33 +++++++++++--
meta/lib/oe/terminal.py | 102 +++++++++++++++++++++++++++++++++++++++++
4 files changed, 168 insertions(+), 23 deletions(-)
create mode 100644 meta/classes/terminal.bbclass
create mode 100644 meta/lib/oe/terminal.py
diff --git a/meta/classes/devshell.bbclass b/meta/classes/devshell.bbclass
index 5f262f4..7317d64 100644
--- a/meta/classes/devshell.bbclass
+++ b/meta/classes/devshell.bbclass
@@ -1,22 +1,14 @@
-do_devshell[dirs] = "${S}"
-do_devshell[nostamp] = "1"
+inherit terminal
-XAUTHORITY ?= "${HOME}/.Xauthority"
-devshell_do_devshell() {
- export DISPLAY='${DISPLAY}'
- export DBUS_SESSION_BUS_ADDRESS='${DBUS_SESSION_BUS_ADDRESS}'
- export XAUTHORITY='${XAUTHORITY}'
- export TERMWINDOWTITLE="Bitbake Developer Shell"
- export EXTRA_OEMAKE='${EXTRA_OEMAKE}'
- export SHELLCMDS="bash"
- ${TERMCMDRUN}
- if [ $? -ne 0 ]; then
- echo "Fatal: '${TERMCMD}' not found. Check TERMCMD variable."
- exit 1
- fi
+export XAUTHORITY ?= "${HOME}/.Xauthority"
+export SHELL ?= 'bash'
+
+python do_devshell () {
+ oe_terminal(d.getVar('SHELL', True), 'OpenEmbedded Developer Shell', d)
}
-addtask devshell after do_patch
-EXPORT_FUNCTIONS do_devshell
+addtask devshell after do_patch
+do_devshell[dirs] = "${S}"
+do_devshell[nostamp] = "1"
diff --git a/meta/classes/terminal.bbclass b/meta/classes/terminal.bbclass
new file mode 100644
index 0000000..93646f7
--- /dev/null
+++ b/meta/classes/terminal.bbclass
@@ -0,0 +1,30 @@
+OE_TERMINAL ?= 'auto'
+OE_TERMINAL[type] = 'choice'
+OE_TERMINAL[choices] = 'auto none \
+ ${@" ".join(o.name \
+ for o in oe.terminal.prioritized())}'
+
+
+def oe_terminal(command, title, d):
+ import oe.data
+ import oe.terminal
+
+ terminal = oe.data.typed_value('OE_TERMINAL', d).lower()
+ if terminal == 'none':
+ bb.fatal('Devshell usage disabled with OE_TERMINAL')
+ elif terminal != 'auto':
+ try:
+ oe.terminal.spawn(terminal, command, title)
+ return
+ except oe.terminal.UnsupportedTerminal:
+ bb.warn('Unsupported terminal "%s", defaulting to "auto"' %
+ terminal)
+ except oe.terminal.ExecutionError as exc:
+ bb.fatal('Unable to spawn terminal %s: %s' % (terminal, exc))
+
+ try:
+ oe.terminal.spawn_preferred(command, title)
+ except oe.terminal.NoSupportedTerminals:
+ bb.fatal('No valid terminal found, unable to open devshell')
+ except oe.terminal.ExecutionError as exc:
+ bb.fatal('Unable to spawn terminal %s: %s' % (terminal, exc))
diff --git a/meta/lib/oe/classutils.py b/meta/lib/oe/classutils.py
index 855d2fa..922d304 100644
--- a/meta/lib/oe/classutils.py
+++ b/meta/lib/oe/classutils.py
@@ -1,15 +1,36 @@
+__author__ = 'kergoth'
+
class ClassRegistry(type):
"""Maintain a registry of classes, indexed by name.
- The name in the registry can be overridden via the 'name' attribute of the
- class, and the 'priority' attribute controls priority. The prioritized()
- method returns the registered classes in priority order."""
- registry = {}
+Note that this implementation requires that the names be unique, as it uses
+a dictionary to hold the classes by name.
+
+The name in the registry can be overridden via the 'name' attribute of the
+class, and the 'priority' attribute controls priority. The prioritized()
+method returns the registered classes in priority order.
+
+Subclasses of ClassRegistry may define an 'implemented' property to exert
+control over whether the class will be added to the registry (e.g. to keep
+abstract base classes out of the registry)."""
priority = 0
+ class __metaclass__(type):
+ """Give each ClassRegistry their own registry"""
+ def __init__(cls, name, bases, attrs):
+ cls.registry = {}
+ type.__init__(cls, name, bases, attrs)
def __init__(cls, name, bases, attrs):
super(ClassRegistry, cls).__init__(name, bases, attrs)
- if not hasattr(cls, name):
+ try:
+ if not cls.implemented:
+ return
+ except AttributeError:
+ pass
+
+ try:
+ cls.name
+ except AttributeError:
cls.name = name
cls.registry[cls.name] = cls
@@ -21,4 +42,4 @@ class ClassRegistry(type):
def unregister(cls):
for key in cls.registry.keys():
if cls.registry[key] is cls:
- del cls.registry[key]
+ del cls.registry[key]
\ No newline at end of file
diff --git a/meta/lib/oe/terminal.py b/meta/lib/oe/terminal.py
new file mode 100644
index 0000000..5336167
--- /dev/null
+++ b/meta/lib/oe/terminal.py
@@ -0,0 +1,102 @@
+import logging
+import os
+import oe.classutils
+import shlex
+from bb.process import Popen, ExecutionError
+
+logger = logging.getLogger('BitBake.OE.Terminal')
+
+
+class UnsupportedTerminal(StandardError):
+ pass
+
+class NoSupportedTerminals(StandardError):
+ pass
+
+
+class Registry(oe.classutils.ClassRegistry):
+ command = None
+
+ def __init__(cls, name, bases, attrs):
+ super(Registry, cls).__init__(name.lower(), bases, attrs)
+
+ @property
+ def implemented(cls):
+ return bool(cls.command)
+
+
+class Terminal(Popen):
+ __metaclass__ = Registry
+
+ def __init__(self, command, title=None):
+ self.format_command(command, title)
+ logger.debug(1, "%s: running %s", self.name, self.command)
+
+ try:
+ Popen.__init__(self, self.command, shell=False)
+ except OSError as exc:
+ import errno
+ if exc.errno == errno.ENOENT:
+ raise UnsupportedTerminal(self.name)
+ else:
+ raise
+
+ def format_command(self, command, title):
+ fmt = {'title': title or 'Terminal', 'command': command}
+ if isinstance(self.command, basestring):
+ self.command = shlex.split(self.command.format(**fmt))
+ else:
+ self.command = [element.format(**fmt) for element in self.command]
+
+class XTerminal(Terminal):
+ def __init__(self, command, title=None):
+ Terminal.__init__(self, command, title)
+ if not os.environ.get('DISPLAY'):
+ raise UnsupportedTerminal(self.name)
+
+class Gnome(XTerminal):
+ command = 'gnome-terminal --disable-factory -t "{title}" -x {command}'
+ priority = 2
+
+class Konsole(XTerminal):
+ command = 'konsole -T "{title}" -e {command}'
+ priority = 2
+
+class XTerm(XTerminal):
+ command = 'xterm -T "{title}" -e {command}'
+ priority = 1
+
+class Rxvt(XTerminal):
+ command = 'rxvt -T "{title}" -e {command}'
+ priority = 1
+
+class Screen(Terminal):
+ command = 'screen -D -m -t "{title}" {command}'
+
+
+def prioritized():
+ return Registry.prioritized()
+
+def spawn_preferred(command, title=None):
+ """Spawn the first supported terminal, by priority"""
+ for terminal in prioritized():
+ try:
+ spawn(terminal.name, command, title)
+ break
+ except UnsupportedTerminal:
+ continue
+ else:
+ raise NoSupportedTerminals()
+
+def spawn(name, command, title=None):
+ """Spawn the specified terminal, by name"""
+ logger.debug(1, 'Attempting to spawn terminal "%s"', name)
+ try:
+ terminal = Registry.registry[name]
+ except KeyError:
+ raise UnsupportedTerminal(name)
+
+ pipe = terminal(command, title)
+ output = pipe.communicate()[0]
+ if pipe.returncode != 0:
+ raise ExecutionError(pipe.command, pipe.returncode, output)
--
1.7.2.5
^ permalink raw reply related [flat|nested] 11+ messages in thread* [PATCH 3/9] oe.terminal: improve how we spawn screen
2011-06-17 14:51 [PATCH 0/9] Patches pending on O.S. Systems tree Otavio Salvador
2011-06-17 14:51 ` [PATCH 1/9] oe.classutils: add module Otavio Salvador
2011-06-17 14:51 ` [PATCH 2/9] Rework how the devshell functions Otavio Salvador
@ 2011-06-17 14:51 ` Otavio Salvador
2011-06-17 14:51 ` [PATCH 4/9] cmake.bbclass: use CPPFLAGS and CXXFLAGS Otavio Salvador
` (5 subsequent siblings)
8 siblings, 0 replies; 11+ messages in thread
From: Otavio Salvador @ 2011-06-17 14:51 UTC (permalink / raw)
To: openembedded-core; +Cc: Chris Larson
From: Chris Larson <chris_larson@mentor.com>
- Name the screen session 'devshell', to avoid confusion if running bitbake
itself under a screen session.
- Display a warning message when spawning screen, so it's clear to the user
that screen has been run (otherwise do_devshell just appears to hang).
Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
---
meta/lib/oe/terminal.py | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/meta/lib/oe/terminal.py b/meta/lib/oe/terminal.py
index 5336167..bbff8d0 100644
--- a/meta/lib/oe/terminal.py
+++ b/meta/lib/oe/terminal.py
@@ -71,7 +71,12 @@ class Rxvt(XTerminal):
priority = 1
class Screen(Terminal):
- command = 'screen -D -m -t "{title}" {command}'
+ command = 'screen -D -m -t "{title}" -S devshell {command}'
+
+ def __init__(self, command, title=None):
+ Terminal.__init__(self, command, title)
+ logger.warn('Screen started. Please connect in another terminal with '
+ '"screen -r devshell"')
def prioritized():
--
1.7.2.5
^ permalink raw reply related [flat|nested] 11+ messages in thread* [PATCH 4/9] cmake.bbclass: use CPPFLAGS and CXXFLAGS
2011-06-17 14:51 [PATCH 0/9] Patches pending on O.S. Systems tree Otavio Salvador
` (2 preceding siblings ...)
2011-06-17 14:51 ` [PATCH 3/9] oe.terminal: improve how we spawn screen Otavio Salvador
@ 2011-06-17 14:51 ` Otavio Salvador
2011-06-17 14:51 ` [PATCH 5/9] cmake: refactor recipe Otavio Salvador
` (4 subsequent siblings)
8 siblings, 0 replies; 11+ messages in thread
From: Otavio Salvador @ 2011-06-17 14:51 UTC (permalink / raw)
To: openembedded-core
Some classes, as for example nativesdk, defines CPPFLAGS and CXXFLAGS
to be passed to compiler. Using those makes more sense and avoid some
hacks on packages using CMake.
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
---
meta/classes/cmake.bbclass | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/meta/classes/cmake.bbclass b/meta/classes/cmake.bbclass
index 011c232..672325e 100644
--- a/meta/classes/cmake.bbclass
+++ b/meta/classes/cmake.bbclass
@@ -19,10 +19,10 @@ OECMAKE_C_COMPILER ?= "`echo ${CC} | sed 's/^\([^ ]*\).*/\1/'`"
OECMAKE_CXX_COMPILER ?= "`echo ${CXX} | sed 's/^\([^ ]*\).*/\1/'`"
# Compiler flags
-OECMAKE_C_FLAGS ?= "${HOST_CC_ARCH} ${TOOLCHAIN_OPTIONS} ${TARGET_CPPFLAGS}"
-OECMAKE_CXX_FLAGS ?= "${HOST_CC_ARCH} ${TOOLCHAIN_OPTIONS} ${TARGET_CPPFLAGS} -fpermissive"
-OECMAKE_C_FLAGS_RELEASE ?= "${SELECTED_OPTIMIZATION} -DNDEBUG"
-OECMAKE_CXX_FLAGS_RELEASE ?= "${SELECTED_OPTIMIZATION} -DNDEBUG"
+OECMAKE_C_FLAGS ?= "${HOST_CC_ARCH} ${TOOLCHAIN_OPTIONS} ${CPPFLAGS}"
+OECMAKE_CXX_FLAGS ?= "${HOST_CC_ARCH} ${TOOLCHAIN_OPTIONS} ${CXXFLAGS} -fpermissive"
+OECMAKE_C_FLAGS_RELEASE ?= "${SELECTED_OPTIMIZATION} ${CPPFLAGS} -DNDEBUG"
+OECMAKE_CXX_FLAGS_RELEASE ?= "${SELECTED_OPTIMIZATION} ${CXXFLAGS} -DNDEBUG"
OECMAKE_RPATH ?= ""
--
1.7.2.5
^ permalink raw reply related [flat|nested] 11+ messages in thread* [PATCH 5/9] cmake: refactor recipe
2011-06-17 14:51 [PATCH 0/9] Patches pending on O.S. Systems tree Otavio Salvador
` (3 preceding siblings ...)
2011-06-17 14:51 ` [PATCH 4/9] cmake.bbclass: use CPPFLAGS and CXXFLAGS Otavio Salvador
@ 2011-06-17 14:51 ` Otavio Salvador
2011-06-17 14:51 ` [PATCH 6/9] lib_package.bbclass: move static libraries to ${PN}-staticdev Otavio Salvador
` (3 subsequent siblings)
8 siblings, 0 replies; 11+ messages in thread
From: Otavio Salvador @ 2011-06-17 14:51 UTC (permalink / raw)
To: openembedded-core
* use INC_PR;
* show configure's failure on error;
* gather major version from PV;
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
---
meta/recipes-devtools/cmake/cmake-native_2.8.3.bb | 4 ++--
meta/recipes-devtools/cmake/cmake.inc | 6 +++++-
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/meta/recipes-devtools/cmake/cmake-native_2.8.3.bb b/meta/recipes-devtools/cmake/cmake-native_2.8.3.bb
index 29b3d87..a68a25f 100644
--- a/meta/recipes-devtools/cmake/cmake-native_2.8.3.bb
+++ b/meta/recipes-devtools/cmake/cmake-native_2.8.3.bb
@@ -1,7 +1,7 @@
-CMAKE_MAJOR_VERSION="2.8"
require cmake.inc
inherit native
-PR = "r1"
+
+PR = "${INC_PR}.1"
SRC_URI[md5sum] = "a76a44b93acf5e3badda9de111385921"
SRC_URI[sha256sum] = "689ed02786b5cefa5515c7716784ee82a82e8ece6be5a3d629ac3cc0c05fc288"
diff --git a/meta/recipes-devtools/cmake/cmake.inc b/meta/recipes-devtools/cmake/cmake.inc
index eed9346..ec37a10 100644
--- a/meta/recipes-devtools/cmake/cmake.inc
+++ b/meta/recipes-devtools/cmake/cmake.inc
@@ -9,11 +9,15 @@ LICENSE = "BSD"
LIC_FILES_CHKSUM = "file://Copyright.txt;md5=f372516292ff7c33337bf16a74a5f9a8 \
file://Source/cmake.h;beginline=1;endline=10;md5=341736dae83c9e344b53eeb1bc7d7bc2"
+INC_PR = "r1"
+
+CMAKE_MAJOR_VERSION = "${@'.'.join(bb.data.getVar('PV',d,1).split('.')[0:2])}"
+
SRC_URI = "http://www.cmake.org/files/v${CMAKE_MAJOR_VERSION}/cmake-${PV}.tar.gz \
file://support-oe-qt4-tools-names.patch"
inherit autotools
do_configure () {
- ./configure --prefix=${prefix} || die "./bootstrap failed"
+ ./configure --prefix=${prefix}
}
--
1.7.2.5
^ permalink raw reply related [flat|nested] 11+ messages in thread* [PATCH 6/9] lib_package.bbclass: move static libraries to ${PN}-staticdev
2011-06-17 14:51 [PATCH 0/9] Patches pending on O.S. Systems tree Otavio Salvador
` (4 preceding siblings ...)
2011-06-17 14:51 ` [PATCH 5/9] cmake: refactor recipe Otavio Salvador
@ 2011-06-17 14:51 ` Otavio Salvador
2011-06-17 14:51 ` [PATCH 7/9] libxml: extend nativesdk class Otavio Salvador
` (2 subsequent siblings)
8 siblings, 0 replies; 11+ messages in thread
From: Otavio Salvador @ 2011-06-17 14:51 UTC (permalink / raw)
To: openembedded-core
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
---
meta/classes/lib_package.bbclass | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/meta/classes/lib_package.bbclass b/meta/classes/lib_package.bbclass
index 82c9370..5ce8727 100644
--- a/meta/classes/lib_package.bbclass
+++ b/meta/classes/lib_package.bbclass
@@ -5,6 +5,6 @@ FILES_${PN} = "${libexecdir} ${libdir}/lib*${SOLIBS} \
${base_libdir}/*${SOLIBS} \
${datadir}/${PN} ${libdir}/${PN}"
FILES_${PN}-dev = "${includedir} ${libdir}/lib*${SOLIBSDEV} ${libdir}/*.la \
- ${libdir}/*.a ${libdir}/pkgconfig /lib/*.a /lib/*.o \
+ ${libdir}/*.o ${libdir}/pkgconfig /lib/*.o \
${datadir}/aclocal ${bindir}/*-config"
FILES_${PN}-bin = "${bindir}/* ${sbindir}/* /bin/* /sbin/*"
--
1.7.2.5
^ permalink raw reply related [flat|nested] 11+ messages in thread* [PATCH 7/9] libxml: extend nativesdk class
2011-06-17 14:51 [PATCH 0/9] Patches pending on O.S. Systems tree Otavio Salvador
` (5 preceding siblings ...)
2011-06-17 14:51 ` [PATCH 6/9] lib_package.bbclass: move static libraries to ${PN}-staticdev Otavio Salvador
@ 2011-06-17 14:51 ` Otavio Salvador
2011-06-17 14:51 ` [PATCH 8/9] libarchive: add 2.8.4 version Otavio Salvador
2011-06-17 14:51 ` [PATCH 9/9] cmake: add nativesdk and target versions Otavio Salvador
8 siblings, 0 replies; 11+ messages in thread
From: Otavio Salvador @ 2011-06-17 14:51 UTC (permalink / raw)
To: openembedded-core
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
---
meta/recipes-core/libxml/libxml2.inc | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/meta/recipes-core/libxml/libxml2.inc b/meta/recipes-core/libxml/libxml2.inc
index d9ea816..1187644 100644
--- a/meta/recipes-core/libxml/libxml2.inc
+++ b/meta/recipes-core/libxml/libxml2.inc
@@ -21,6 +21,7 @@ inherit autotools pkgconfig binconfig
EXTRA_OECONF = "--without-python --without-debug --without-legacy --without-catalog --without-docbook --with-c14n"
EXTRA_OECONF_virtclass-native = "--with-python=${STAGING_BINDIR}/python --without-legacy --with-catalog --without-docbook --with-c14n"
+EXTRA_OECONF_virtclass-nativesdk = "--with-python=${STAGING_BINDIR}/python --without-legacy --with-catalog --without-docbook --with-c14n"
EXTRA_OECONF_linuxstdbase = "--without-python --with-debug --with-legacy --with-catalog --with-docbook --with-c14n"
# required for pythong binding
@@ -42,4 +43,4 @@ PACKAGES = "${PN}-dbg ${PN}-dev ${PN}-utils ${PN} ${PN}-doc ${PN}-locale"
FILES_${PN}-dev += "${bindir}/*-config ${libdir}/xml2Conf.sh"
FILES_${PN}-utils += "${bindir}/*"
-BBCLASSEXTEND = "native"
+BBCLASSEXTEND = "native nativesdk"
--
1.7.2.5
^ permalink raw reply related [flat|nested] 11+ messages in thread* [PATCH 8/9] libarchive: add 2.8.4 version
2011-06-17 14:51 [PATCH 0/9] Patches pending on O.S. Systems tree Otavio Salvador
` (6 preceding siblings ...)
2011-06-17 14:51 ` [PATCH 7/9] libxml: extend nativesdk class Otavio Salvador
@ 2011-06-17 14:51 ` Otavio Salvador
2011-06-17 14:51 ` [PATCH 9/9] cmake: add nativesdk and target versions Otavio Salvador
8 siblings, 0 replies; 11+ messages in thread
From: Otavio Salvador @ 2011-06-17 14:51 UTC (permalink / raw)
To: openembedded-core
This recipe has been imported from OpenEmbedded (rev
6db4b9050e0e8b963e2a6b63790e48e3042ea99e).
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
---
.../0001-Patch-from-upstream-revision-1990.patch | 42 +++++++++++++
.../0002-Patch-from-upstream-revision-1991.patch | 31 ++++++++++
.../0003-Patch-from-upstream-rev-2516.patch | 63 ++++++++++++++++++++
.../0004-Patch-from-upstream-rev-2514.patch | 33 ++++++++++
.../0005-Patch-from-upstream-rev-2520.patch | 31 ++++++++++
.../0006-Patch-from-upstream-rev-2521.patch | 28 +++++++++
...YS-error-when-setting-up-xattrs.-Closes-5.patch | 31 ++++++++++
.../libarchive/libarchive_2.8.4.bb | 25 ++++++++
8 files changed, 284 insertions(+), 0 deletions(-)
create mode 100644 meta/recipes-extended/libarchive/libarchive/0001-Patch-from-upstream-revision-1990.patch
create mode 100644 meta/recipes-extended/libarchive/libarchive/0002-Patch-from-upstream-revision-1991.patch
create mode 100644 meta/recipes-extended/libarchive/libarchive/0003-Patch-from-upstream-rev-2516.patch
create mode 100644 meta/recipes-extended/libarchive/libarchive/0004-Patch-from-upstream-rev-2514.patch
create mode 100644 meta/recipes-extended/libarchive/libarchive/0005-Patch-from-upstream-rev-2520.patch
create mode 100644 meta/recipes-extended/libarchive/libarchive/0006-Patch-from-upstream-rev-2521.patch
create mode 100644 meta/recipes-extended/libarchive/libarchive/0007-Ignore-ENOSYS-error-when-setting-up-xattrs.-Closes-5.patch
create mode 100644 meta/recipes-extended/libarchive/libarchive_2.8.4.bb
diff --git a/meta/recipes-extended/libarchive/libarchive/0001-Patch-from-upstream-revision-1990.patch b/meta/recipes-extended/libarchive/libarchive/0001-Patch-from-upstream-revision-1990.patch
new file mode 100644
index 0000000..f65f89f
--- /dev/null
+++ b/meta/recipes-extended/libarchive/libarchive/0001-Patch-from-upstream-revision-1990.patch
@@ -0,0 +1,42 @@
+libarchive: Backport patch from upstream (revision 1990)
+
+Upstream-Status: Backport
+
+Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
+
+diff --git a/libarchive/archive_read_disk_entry_from_file.c b/libarchive/archive_read_disk_entry_from_file.c
+index 7473c50..27671df 100644
+--- a/libarchive/archive_read_disk_entry_from_file.c
++++ b/libarchive/archive_read_disk_entry_from_file.c
+@@ -163,15 +163,26 @@ archive_read_disk_entry_from_file(struct archive *_a,
+
+ #ifdef HAVE_READLINK
+ if (S_ISLNK(st->st_mode)) {
+- char linkbuffer[PATH_MAX + 1];
+- int lnklen = readlink(path, linkbuffer, PATH_MAX);
++ size_t linkbuffer_len = st->st_size + 1;
++ char *linkbuffer;
++ int lnklen;
++
++ linkbuffer = malloc(linkbuffer_len);
++ if (linkbuffer == NULL) {
++ archive_set_error(&a->archive, ENOMEM,
++ "Couldn't read link data");
++ return (ARCHIVE_FAILED);
++ }
++ lnklen = readlink(path, linkbuffer, linkbuffer_len);
+ if (lnklen < 0) {
+ archive_set_error(&a->archive, errno,
+ "Couldn't read link data");
++ free(linkbuffer);
+ return (ARCHIVE_FAILED);
+ }
+ linkbuffer[lnklen] = 0;
+ archive_entry_set_symlink(entry, linkbuffer);
++ free(linkbuffer);
+ }
+ #endif
+
+--
+1.7.1
+
diff --git a/meta/recipes-extended/libarchive/libarchive/0002-Patch-from-upstream-revision-1991.patch b/meta/recipes-extended/libarchive/libarchive/0002-Patch-from-upstream-revision-1991.patch
new file mode 100644
index 0000000..6ece7f3
--- /dev/null
+++ b/meta/recipes-extended/libarchive/libarchive/0002-Patch-from-upstream-revision-1991.patch
@@ -0,0 +1,31 @@
+libarchive: Backport patch from upstream (revision 1991)
+
+Upstream-Status: Backport
+
+Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
+
+diff --git a/libarchive/archive_write_disk.c b/libarchive/archive_write_disk.c
+index caf958e..60699e0 100644
+--- a/libarchive/archive_write_disk.c
++++ b/libarchive/archive_write_disk.c
+@@ -434,7 +434,7 @@ _archive_write_header(struct archive *_a, struct archive_entry *entry)
+ if (ret != ARCHIVE_OK)
+ goto done;
+ }
+-#ifdef HAVE_FCHDIR
++#if defined(HAVE_FCHDIR) && defined(PATH_MAX)
+ /* If path exceeds PATH_MAX, shorten the path. */
+ edit_deep_directories(a);
+ #endif
+@@ -866,7 +866,7 @@ archive_write_disk_new(void)
+ * object creation is likely to fail, but any error will get handled
+ * at that time.
+ */
+-#ifdef HAVE_FCHDIR
++#if defined(HAVE_FCHDIR) && defined(PATH_MAX)
+ static void
+ edit_deep_directories(struct archive_write_disk *a)
+ {
+--
+1.7.1
+
diff --git a/meta/recipes-extended/libarchive/libarchive/0003-Patch-from-upstream-rev-2516.patch b/meta/recipes-extended/libarchive/libarchive/0003-Patch-from-upstream-rev-2516.patch
new file mode 100644
index 0000000..0193a07
--- /dev/null
+++ b/meta/recipes-extended/libarchive/libarchive/0003-Patch-from-upstream-rev-2516.patch
@@ -0,0 +1,63 @@
+libarchive: Backport patch from upstream (rev 2516)
+
+Fix Issue 100: Allow a zero for the Type M Path Table Location, since
+WinISO (and probably other programs) set it this way.
+
+http://code.google.com/p/libarchive/source/detail?r=2516
+
+Upstream-Status: Backport
+
+Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
+
+diff --git a/libarchive/archive_read_support_format_iso9660.c b/libarchive/archive_read_support_format_iso9660.c
+index 0c640c8..fdef3fb 100644
+--- a/libarchive/archive_read_support_format_iso9660.c
++++ b/libarchive/archive_read_support_format_iso9660.c
+@@ -714,11 +714,13 @@ isSVD(struct iso9660 *iso9660, const unsigned char *h)
+ if (location <= SYSTEM_AREA_BLOCK+2 || location >= volume_block)
+ return (0);
+
+- /* Location of Occurrence of Type M Path Table must be
+- * available location,
++ /* The Type M Path Table must be at a valid location (WinISO
++ * and probably other programs omit this, so we allow zero)
++ *
+ * > SYSTEM_AREA_BLOCK(16) + 2 and < Volume Space Size. */
+ location = archive_be32dec(h+SVD_type_M_path_table_offset);
+- if (location <= SYSTEM_AREA_BLOCK+2 || location >= volume_block)
++ if ((location > 0 && location <= SYSTEM_AREA_BLOCK+2)
++ || location >= volume_block)
+ return (0);
+
+ /* Read Root Directory Record in Volume Descriptor. */
+@@ -790,7 +792,8 @@ isEVD(struct iso9660 *iso9660, const unsigned char *h)
+ * available location,
+ * > SYSTEM_AREA_BLOCK(16) + 2 and < Volume Space Size. */
+ location = archive_be32dec(h+PVD_type_m_path_table_offset);
+- if (location <= SYSTEM_AREA_BLOCK+2 || location >= volume_block)
++ if ((location > 0 && location <= SYSTEM_AREA_BLOCK+2)
++ || location >= volume_block)
+ return (0);
+
+ /* Reserved field must be 0. */
+@@ -865,11 +868,14 @@ isPVD(struct iso9660 *iso9660, const unsigned char *h)
+ if (location <= SYSTEM_AREA_BLOCK+2 || location >= volume_block)
+ return (0);
+
+- /* Location of Occurrence of Type M Path Table must be
+- * available location,
++ /* The Type M Path Table must also be at a valid location
++ * (although ECMA 119 requires a Type M Path Table, WinISO and
++ * probably other programs omit it, so we permit a zero here)
++ *
+ * > SYSTEM_AREA_BLOCK(16) + 2 and < Volume Space Size. */
+ location = archive_be32dec(h+PVD_type_m_path_table_offset);
+- if (location <= SYSTEM_AREA_BLOCK+2 || location >= volume_block)
++ if ((location > 0 && location <= SYSTEM_AREA_BLOCK+2)
++ || location >= volume_block)
+ return (0);
+
+ /* Reserved field must be 0. */
+--
+1.7.1
+
diff --git a/meta/recipes-extended/libarchive/libarchive/0004-Patch-from-upstream-rev-2514.patch b/meta/recipes-extended/libarchive/libarchive/0004-Patch-from-upstream-rev-2514.patch
new file mode 100644
index 0000000..eaa9ad0
--- /dev/null
+++ b/meta/recipes-extended/libarchive/libarchive/0004-Patch-from-upstream-rev-2514.patch
@@ -0,0 +1,33 @@
+libarchive: Backport patch from upstream (rev 2514)
+
+Enable version stripping code in joliet extension support for iso9660.
+
+http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=587316
+
+Upstream-Status: Backport
+
+Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
+
+diff --git a/libarchive/archive_read_support_format_iso9660.c b/libarchive/archive_read_support_format_iso9660.c
+index fdef3fb..8dcfeb4 100644
+--- a/libarchive/archive_read_support_format_iso9660.c
++++ b/libarchive/archive_read_support_format_iso9660.c
+@@ -1755,7 +1755,6 @@ parse_file_info(struct archive_read *a, struct file_info *parent,
+ }
+ *wp = L'\0';
+
+-#if 0 /* untested code, is it at all useful on Joliet? */
+ /* trim trailing first version and dot from filename.
+ *
+ * Remember we where in UTF-16BE land!
+@@ -1775,7 +1774,6 @@ parse_file_info(struct archive_read *a, struct file_info *parent,
+ /* Chop off trailing '.' from filenames. */
+ if (*(wp-1) == '.')
+ *(--wp) = L'\0';
+-#endif
+
+ /* store the result in the file name field. */
+ archive_strappend_w_utf8(&file->name, wbuff);
+--
+1.7.1
+
diff --git a/meta/recipes-extended/libarchive/libarchive/0005-Patch-from-upstream-rev-2520.patch b/meta/recipes-extended/libarchive/libarchive/0005-Patch-from-upstream-rev-2520.patch
new file mode 100644
index 0000000..dd8ac6a
--- /dev/null
+++ b/meta/recipes-extended/libarchive/libarchive/0005-Patch-from-upstream-rev-2520.patch
@@ -0,0 +1,31 @@
+libarchive: Backport patch from upstream (rev 2520)
+
+Fix version/dot stripping code in joliet extension of iso9660.
+
+Upstream-Status: Backport
+
+Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
+
+diff --git a/libarchive/archive_read_support_format_iso9660.c b/libarchive/archive_read_support_format_iso9660.c
+index 8dcfeb4..2d3a855 100644
+--- a/libarchive/archive_read_support_format_iso9660.c
++++ b/libarchive/archive_read_support_format_iso9660.c
+@@ -1766,13 +1766,13 @@ parse_file_info(struct archive_read *a, struct file_info *parent,
+ * *, /, :, ;, ? and \.
+ */
+ /* Chop off trailing ';1' from files. */
+- if (*(wp-2) == ';' && *(wp-1) == '1') {
++ if (*(wp-2) == L';' && *(wp-1) == L'1') {
+ wp-=2;
+ *wp = L'\0';
+ }
+
+ /* Chop off trailing '.' from filenames. */
+- if (*(wp-1) == '.')
++ if (*(wp-1) == L'.')
+ *(--wp) = L'\0';
+
+ /* store the result in the file name field. */
+--
+1.7.1
+
diff --git a/meta/recipes-extended/libarchive/libarchive/0006-Patch-from-upstream-rev-2521.patch b/meta/recipes-extended/libarchive/libarchive/0006-Patch-from-upstream-rev-2521.patch
new file mode 100644
index 0000000..b55ae17
--- /dev/null
+++ b/meta/recipes-extended/libarchive/libarchive/0006-Patch-from-upstream-rev-2521.patch
@@ -0,0 +1,28 @@
+libarchive: Backport patch from upstream (rev 2521).
+
+Disable dot stripping code since it's still broken
+and noone has been able to figure it out (yet).
+
+Upstream-Status: Backport
+
+Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
+
+diff --git a/libarchive/archive_read_support_format_iso9660.c b/libarchive/archive_read_support_format_iso9660.c
+index 2d3a855..8661532 100644
+--- a/libarchive/archive_read_support_format_iso9660.c
++++ b/libarchive/archive_read_support_format_iso9660.c
+@@ -1771,9 +1771,11 @@ parse_file_info(struct archive_read *a, struct file_info *parent,
+ *wp = L'\0';
+ }
+
++#if 0 /* XXX: this somehow manages to strip of single-character file extensions, like '.c'. */
+ /* Chop off trailing '.' from filenames. */
+ if (*(wp-1) == L'.')
+ *(--wp) = L'\0';
++#endif
+
+ /* store the result in the file name field. */
+ archive_strappend_w_utf8(&file->name, wbuff);
+--
+1.7.1
+
diff --git a/meta/recipes-extended/libarchive/libarchive/0007-Ignore-ENOSYS-error-when-setting-up-xattrs.-Closes-5.patch b/meta/recipes-extended/libarchive/libarchive/0007-Ignore-ENOSYS-error-when-setting-up-xattrs.-Closes-5.patch
new file mode 100644
index 0000000..b5465a3
--- /dev/null
+++ b/meta/recipes-extended/libarchive/libarchive/0007-Ignore-ENOSYS-error-when-setting-up-xattrs.-Closes-5.patch
@@ -0,0 +1,31 @@
+libarchive: Ignore ENOSYS error when setting up xattrs. (Closes: #588925)
+
+Modestas Vainius found out that HPPA returns errno ENOSYS
+on listxattrs. Currently, ENOTSUP is ignored so we'll do the
+same for ENOSYS as well.
+
+For full debug info about this see Modestas Vainius awesome
+report at:
+
+http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=588925#10
+
+Upstream-Status: Pending
+
+Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
+
+diff --git a/libarchive/archive_read_disk_entry_from_file.c b/libarchive/archive_read_disk_entry_from_file.c
+index 27671df..c49e755 100644
+--- a/libarchive/archive_read_disk_entry_from_file.c
++++ b/libarchive/archive_read_disk_entry_from_file.c
+@@ -398,7 +398,7 @@ setup_xattrs(struct archive_read_disk *a,
+ list_size = listxattr(path, NULL, 0);
+
+ if (list_size == -1) {
+- if (errno == ENOTSUP)
++ if (errno == ENOTSUP || errno == ENOSYS)
+ return (ARCHIVE_OK);
+ archive_set_error(&a->archive, errno,
+ "Couldn't list extended attributes");
+--
+1.7.1
+
diff --git a/meta/recipes-extended/libarchive/libarchive_2.8.4.bb b/meta/recipes-extended/libarchive/libarchive_2.8.4.bb
new file mode 100644
index 0000000..6d4fb39
--- /dev/null
+++ b/meta/recipes-extended/libarchive/libarchive_2.8.4.bb
@@ -0,0 +1,25 @@
+DESCRIPTION = "C library and command-line tools for reading and writing tar, cpio, zip, ISO, and other archive formats"
+HOMEPAGE = "http://code.google.com/p/libarchive/"
+SECTION = "devel"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=4255e2e6f0349a4ac8fbd68459296e46"
+PR = "r0"
+
+DEPENDS = "libxml2"
+
+SRC_URI = "http://libarchive.googlecode.com/files/libarchive-${PV}.tar.gz \
+ file://0001-Patch-from-upstream-revision-1990.patch \
+ file://0002-Patch-from-upstream-revision-1991.patch \
+ file://0003-Patch-from-upstream-rev-2516.patch \
+ file://0004-Patch-from-upstream-rev-2514.patch \
+ file://0005-Patch-from-upstream-rev-2520.patch \
+ file://0006-Patch-from-upstream-rev-2521.patch \
+ file://0007-Ignore-ENOSYS-error-when-setting-up-xattrs.-Closes-5.patch \
+ "
+
+SRC_URI[md5sum] = "83b237a542f27969a8d68ac217dc3796"
+SRC_URI[sha256sum] = "86cffa3eaa28d3116f5d0b20284026c3762cf4a2b52b9844df2b494d4a89f688"
+
+inherit autotools lib_package
+
+BBCLASSEXTEND = "nativesdk"
--
1.7.2.5
^ permalink raw reply related [flat|nested] 11+ messages in thread* [PATCH 9/9] cmake: add nativesdk and target versions
2011-06-17 14:51 [PATCH 0/9] Patches pending on O.S. Systems tree Otavio Salvador
` (7 preceding siblings ...)
2011-06-17 14:51 ` [PATCH 8/9] libarchive: add 2.8.4 version Otavio Salvador
@ 2011-06-17 14:51 ` Otavio Salvador
2011-06-30 3:36 ` Saul Wold
8 siblings, 1 reply; 11+ messages in thread
From: Otavio Salvador @ 2011-06-17 14:51 UTC (permalink / raw)
To: openembedded-core
Adds a recipe that provides the nativesdk and target versions of
CMake.
This recipe is based on code from OpenEmbeeded (rev
b1f2e1501c19540617a829b37415c0616101c7ad).
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
---
.../cmake/cmake/dont-run-cross-binaries.patch | 22 +++++++++
meta/recipes-devtools/cmake/cmake_2.8.3.bb | 48 ++++++++++++++++++++
2 files changed, 70 insertions(+), 0 deletions(-)
create mode 100644 meta/recipes-devtools/cmake/cmake/dont-run-cross-binaries.patch
create mode 100644 meta/recipes-devtools/cmake/cmake_2.8.3.bb
diff --git a/meta/recipes-devtools/cmake/cmake/dont-run-cross-binaries.patch b/meta/recipes-devtools/cmake/cmake/dont-run-cross-binaries.patch
new file mode 100644
index 0000000..4eb1794
--- /dev/null
+++ b/meta/recipes-devtools/cmake/cmake/dont-run-cross-binaries.patch
@@ -0,0 +1,22 @@
+cmake: don't run cross-binaries on host machine
+
+When doing the cross build we obviously cannot run those binaries on
+host since they can be binary incompatible.
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
+
+diff -ru cmake-2.8.2.orig/CMakeLists.txt cmake-2.8.2/CMakeLists.txt
+--- cmake-2.8.2.orig/CMakeLists.txt 2010-07-28 00:48:42.000000000 +0200
++++ cmake-2.8.2/CMakeLists.txt 2010-07-28 01:05:17.000000000 +0200
+@@ -518,7 +518,8 @@
+
+ # build the remaining subdirectories
+ ADD_SUBDIRECTORY(Source)
+-ADD_SUBDIRECTORY(Utilities)
++# Come on! Running the cross-binaries on host is not a good idea.
++#ADD_SUBDIRECTORY(Utilities)
+ ADD_SUBDIRECTORY(Tests)
+
+ # add a test
diff --git a/meta/recipes-devtools/cmake/cmake_2.8.3.bb b/meta/recipes-devtools/cmake/cmake_2.8.3.bb
new file mode 100644
index 0000000..93c98c3
--- /dev/null
+++ b/meta/recipes-devtools/cmake/cmake_2.8.3.bb
@@ -0,0 +1,48 @@
+require cmake.inc
+
+inherit cmake
+
+DEPENDS += "curl expat zlib libarchive ncurses"
+
+PR = "${INC_PR}.0"
+
+SRC_URI += "file://dont-run-cross-binaries.patch"
+
+SRC_URI[md5sum] = "a76a44b93acf5e3badda9de111385921"
+SRC_URI[sha256sum] = "689ed02786b5cefa5515c7716784ee82a82e8ece6be5a3d629ac3cc0c05fc288"
+
+# Strip ${prefix} from ${docdir}, set result into docdir_stripped
+python () {
+ prefix=bb.data.getVar("prefix", d, 1)
+ docdir=bb.data.getVar("docdir", d, 1)
+
+ if not docdir.startswith(prefix):
+ raise bb.build.FuncFailed('docdir must contain prefix as its prefix')
+
+ docdir_stripped = docdir[len(prefix):]
+ if len(docdir_stripped) > 0 and docdir_stripped[0] == '/':
+ docdir_stripped = docdir_stripped[1:]
+
+ bb.data.setVar("docdir_stripped", docdir_stripped, d)
+}
+
+EXTRA_OECMAKE=" \
+ -DCMAKE_DOC_DIR=${docdir_stripped}/cmake-${CMAKE_MAJOR_VERSION} \
+ -DCMAKE_USE_SYSTEM_LIBRARIES=1 \
+# This is compiler & target dependant, but it seems cmake does not in fact use this value.
+ -DKWSYS_CHAR_IS_SIGNED=1 \
+# This disables large file support. Hopefully nobody processes >2G files on the target.
+# If you want to enable this, add -DWKSYS_LFS_WORKS=1
+ -DKWSYS_LFS_DISABLE=1 \
+"
+
+# FIXME: Hack due gcc-crosssdk not being able to detect those automatically
+CXXFLAGS_virtclass-nativesdk += " \
+ -I${STAGING_DIR_HOST}${SDKPATHNATIVE}/usr/include/c++ \
+ -I${STAGING_DIR_HOST}${SDKPATHNATIVE}/usr/include/c++/${TARGET_SYS} \
+ "
+
+FILES_${PN} += "${datadir}/cmake-${CMAKE_MAJOR_VERSION}"
+FILES_${PN}-doc += "${docdir}/cmake-${CMAKE_MAJOR_VERSION}"
+
+BBCLASSEXTEND = "nativesdk"
--
1.7.2.5
^ permalink raw reply related [flat|nested] 11+ messages in thread* Re: [PATCH 9/9] cmake: add nativesdk and target versions
2011-06-17 14:51 ` [PATCH 9/9] cmake: add nativesdk and target versions Otavio Salvador
@ 2011-06-30 3:36 ` Saul Wold
0 siblings, 0 replies; 11+ messages in thread
From: Saul Wold @ 2011-06-30 3:36 UTC (permalink / raw)
To: Patches and discussions about the oe-core layer
On 06/17/2011 07:51 AM, Otavio Salvador wrote:
> Adds a recipe that provides the nativesdk and target versions of
> CMake.
>
> This recipe is based on code from OpenEmbeeded (rev
> b1f2e1501c19540617a829b37415c0616101c7ad).
>
> Signed-off-by: Otavio Salvador<otavio@ossystems.com.br>
> ---
> .../cmake/cmake/dont-run-cross-binaries.patch | 22 +++++++++
> meta/recipes-devtools/cmake/cmake_2.8.3.bb | 48 ++++++++++++++++++++
> 2 files changed, 70 insertions(+), 0 deletions(-)
> create mode 100644 meta/recipes-devtools/cmake/cmake/dont-run-cross-binaries.patch
> create mode 100644 meta/recipes-devtools/cmake/cmake_2.8.3.bb
>
> diff --git a/meta/recipes-devtools/cmake/cmake/dont-run-cross-binaries.patch b/meta/recipes-devtools/cmake/cmake/dont-run-cross-binaries.patch
> new file mode 100644
> index 0000000..4eb1794
> --- /dev/null
> +++ b/meta/recipes-devtools/cmake/cmake/dont-run-cross-binaries.patch
> @@ -0,0 +1,22 @@
> +cmake: don't run cross-binaries on host machine
> +
> +When doing the cross build we obviously cannot run those binaries on
> +host since they can be binary incompatible.
> +
> +Upstream-Status: Inappropriate [embedded specific]
> +
> +Signed-off-by: Otavio Salvador<otavio@ossystems.com.br>
> +
> +diff -ru cmake-2.8.2.orig/CMakeLists.txt cmake-2.8.2/CMakeLists.txt
> +--- cmake-2.8.2.orig/CMakeLists.txt 2010-07-28 00:48:42.000000000 +0200
> ++++ cmake-2.8.2/CMakeLists.txt 2010-07-28 01:05:17.000000000 +0200
> +@@ -518,7 +518,8 @@
> +
> + # build the remaining subdirectories
> + ADD_SUBDIRECTORY(Source)
> +-ADD_SUBDIRECTORY(Utilities)
> ++# Come on! Running the cross-binaries on host is not a good idea.
> ++#ADD_SUBDIRECTORY(Utilities)
> + ADD_SUBDIRECTORY(Tests)
> +
> + # add a test
> diff --git a/meta/recipes-devtools/cmake/cmake_2.8.3.bb b/meta/recipes-devtools/cmake/cmake_2.8.3.bb
> new file mode 100644
> index 0000000..93c98c3
> --- /dev/null
> +++ b/meta/recipes-devtools/cmake/cmake_2.8.3.bb
> @@ -0,0 +1,48 @@
> +require cmake.inc
> +
> +inherit cmake
> +
> +DEPENDS += "curl expat zlib libarchive ncurses"
> +
> +PR = "${INC_PR}.0"
> +
> +SRC_URI += "file://dont-run-cross-binaries.patch"
> +
> +SRC_URI[md5sum] = "a76a44b93acf5e3badda9de111385921"
> +SRC_URI[sha256sum] = "689ed02786b5cefa5515c7716784ee82a82e8ece6be5a3d629ac3cc0c05fc288"
> +
> +# Strip ${prefix} from ${docdir}, set result into docdir_stripped
> +python () {
> + prefix=bb.data.getVar("prefix", d, 1)
> + docdir=bb.data.getVar("docdir", d, 1)
> +
> + if not docdir.startswith(prefix):
> + raise bb.build.FuncFailed('docdir must contain prefix as its prefix')
> +
> + docdir_stripped = docdir[len(prefix):]
> + if len(docdir_stripped)> 0 and docdir_stripped[0] == '/':
> + docdir_stripped = docdir_stripped[1:]
> +
> + bb.data.setVar("docdir_stripped", docdir_stripped, d)
> +}
> +
> +EXTRA_OECMAKE=" \
> + -DCMAKE_DOC_DIR=${docdir_stripped}/cmake-${CMAKE_MAJOR_VERSION} \
> + -DCMAKE_USE_SYSTEM_LIBRARIES=1 \
> +# This is compiler& target dependant, but it seems cmake does not in fact use this value.
> + -DKWSYS_CHAR_IS_SIGNED=1 \
> +# This disables large file support. Hopefully nobody processes>2G files on the target.
> +# If you want to enable this, add -DWKSYS_LFS_WORKS=1
> + -DKWSYS_LFS_DISABLE=1 \
> +"
Otavio,
You can't embedded comments into variable setting like the above anymore.
Sau!
> +
> +# FIXME: Hack due gcc-crosssdk not being able to detect those automatically
> +CXXFLAGS_virtclass-nativesdk += " \
> + -I${STAGING_DIR_HOST}${SDKPATHNATIVE}/usr/include/c++ \
> + -I${STAGING_DIR_HOST}${SDKPATHNATIVE}/usr/include/c++/${TARGET_SYS} \
> + "
> +
> +FILES_${PN} += "${datadir}/cmake-${CMAKE_MAJOR_VERSION}"
> +FILES_${PN}-doc += "${docdir}/cmake-${CMAKE_MAJOR_VERSION}"
> +
> +BBCLASSEXTEND = "nativesdk"
^ permalink raw reply [flat|nested] 11+ messages in thread