summaryrefslogtreecommitdiff
path: root/meta/recipes-devtools/pseudo
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/pseudo')
-rw-r--r--meta/recipes-devtools/pseudo/files/symver.patch26
-rw-r--r--meta/recipes-devtools/pseudo/pseudo.inc82
-rw-r--r--meta/recipes-devtools/pseudo/pseudo_1.3.bb8
-rw-r--r--meta/recipes-devtools/pseudo/pseudo_git.bb12
4 files changed, 128 insertions, 0 deletions
diff --git a/meta/recipes-devtools/pseudo/files/symver.patch b/meta/recipes-devtools/pseudo/files/symver.patch
new file mode 100644
index 000000000..8d1b377ec
--- /dev/null
+++ b/meta/recipes-devtools/pseudo/files/symver.patch
@@ -0,0 +1,26 @@
+When running as pseudo-nativesdk, we might need to run host binaries
+linked against the host libc. Having a 2.14 libc dependency from memcpy is
+problematic so instruct the linker to use older symbols.
+
+Upstream-Status: Pending
+
+RP 2012/4/22
+
+Index: pseudo-1.3/pseudo.h
+===================================================================
+--- pseudo-1.3.orig/pseudo.h 2012-04-22 12:17:59.078909060 +0000
++++ pseudo-1.3/pseudo.h 2012-04-22 12:32:42.954888587 +0000
+@@ -29,6 +29,13 @@
+ int pseudo_set_value(const char *key, const char *value);
+ char *pseudo_get_value(const char *key);
+
++#ifdef __amd64__
++#define GLIBC_COMPAT_SYMBOL(SYM) __asm__(".symver " #SYM "," #SYM "@GLIBC_2.2.5")
++#else
++#define GLIBC_COMPAT_SYMBOL(SYM) __asm__(".symver " #SYM "," #SYM "@GLIBC_2.0")
++#endif
++GLIBC_COMPAT_SYMBOL(memcpy);
++
+ #include "pseudo_tables.h"
+
+ extern void pseudo_debug_verbose(void);
diff --git a/meta/recipes-devtools/pseudo/pseudo.inc b/meta/recipes-devtools/pseudo/pseudo.inc
new file mode 100644
index 000000000..8798018a4
--- /dev/null
+++ b/meta/recipes-devtools/pseudo/pseudo.inc
@@ -0,0 +1,82 @@
+# Note: Due to the bitbake wrapper script, making changes to pseudo can be
+# difficult. To work around the current version of the wrapper use:
+# BBFETCH2=True PSEUDO_BUILD=1 ../bitbake/bin/bitbake pseudo-native [-c CMD]
+
+DESCRIPTION = "Pseudo gives fake root capabilities to a normal user"
+HOMEPAGE = "http://wiki.github.com/wrpseudo/pseudo/"
+LIC_FILES_CHKSUM = "file://COPYING;md5=243b725d71bb5df4a1e5920b344b86ad"
+SECTION = "base"
+LICENSE = "LGPL2.1"
+DEPENDS = "sqlite3"
+
+SRC_URI_append_virtclass-nativesdk = " file://symver.patch"
+
+FILES_${PN} = "${libdir}/pseudo/lib*/libpseudo.so ${bindir}/* ${localstatedir}/pseudo ${prefix}/var/pseudo"
+FILES_${PN}-dbg += "${libdir}/pseudo/lib*/.debug"
+PROVIDES += "virtual/fakeroot"
+
+MAKEOPTS = ""
+
+inherit siteinfo
+
+do_configure () {
+ :
+}
+
+NO32LIBS ??= "1"
+
+# Compile for the local machine arch...
+do_compile () {
+ if [ "${SITEINFO_BITS}" = "64" ]; then
+ ${S}/configure --prefix=${prefix} --libdir=${prefix}/lib/pseudo/lib${SITEINFO_BITS} --with-sqlite=${STAGING_DIR_TARGET}${exec_prefix} --bits=${SITEINFO_BITS} --enable-static-sqlite --without-rpath
+ else
+ ${S}/configure --prefix=${prefix} --libdir=${prefix}/lib/pseudo/lib --with-sqlite=${STAGING_DIR_TARGET}${exec_prefix} --bits=${SITEINFO_BITS} --enable-static-sqlite --without-rpath
+ fi
+ oe_runmake ${MAKEOPTS}
+}
+
+# Two below are the same
+# If necessary compile for the alternative machine arch. This is only
+# necessary in a native build.
+do_compile_prepend_virtclass-native () {
+ if [ "${SITEINFO_BITS}" = "64" -a -e "/usr/include/gnu/stubs-32.h" -a "${PN}" = "pseudo-native" -a "${NO32LIBS}" != "1" ]; then
+ # We need the 32-bit libpseudo on a 64-bit machine...
+ ./configure --prefix=${prefix} --libdir=${prefix}/lib/pseudo/lib --with-sqlite=${STAGING_DIR_TARGET}${exec_prefix} --bits=32 --without-rpath
+ oe_runmake ${MAKEOPTS} libpseudo
+ # prevent it from removing the lib, but remove everything else
+ make 'LIB=foo' ${MAKEOPTS} distclean
+ fi
+}
+
+do_compile_prepend_virtclass-nativesdk () {
+ if [ "${SITEINFO_BITS}" = "64" -a -e "/usr/include/gnu/stubs-32.h" -a "${PN}" = "pseudo-native" -a "${NO32LIBS}" != "1" ]; then
+ # We need the 32-bit libpseudo on a 64-bit machine...
+ ./configure --prefix=${prefix} --libdir=${prefix}/lib/pseudo/lib --with-sqlite=${STAGING_DIR_TARGET}${exec_prefix} --bits=32 --without-rpath
+ oe_runmake ${MAKEOPTS} libpseudo
+ # prevent it from removing the lib, but remove everything else
+ make 'LIB=foo' ${MAKEOPTS} distclean
+ fi
+}
+
+do_install () {
+ oe_runmake 'DESTDIR=${D}' ${MAKEOPTS} 'LIB=lib/pseudo/lib$(MARK64)' install
+}
+
+# Two below are the same
+# If necessary install for the alternative machine arch. This is only
+# necessary in a native build.
+do_install_append_virtclass-native () {
+ if [ "${SITEINFO_BITS}" = "64" -a -e "/usr/include/gnu/stubs-32.h" -a "${PN}" = "pseudo-native" -a "${NO32LIBS}" != "1" ]; then
+ mkdir -p ${D}${prefix}/lib/pseudo/lib
+ cp lib/pseudo/lib/libpseudo.so ${D}${prefix}/lib/pseudo/lib/.
+ fi
+}
+
+do_install_append_virtclass-nativesdk () {
+ if [ "${SITEINFO_BITS}" = "64" -a -e "/usr/include/gnu/stubs-32.h" -a "${PN}" = "pseudo-native" -a "${NO32LIBS}" != "1" ]; then
+ mkdir -p ${D}${prefix}/lib/pseudo/lib
+ cp lib/pseudo/lib/libpseudo.so ${D}${prefix}/lib/pseudo/lib/.
+ fi
+}
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/meta/recipes-devtools/pseudo/pseudo_1.3.bb b/meta/recipes-devtools/pseudo/pseudo_1.3.bb
new file mode 100644
index 000000000..187b46dfa
--- /dev/null
+++ b/meta/recipes-devtools/pseudo/pseudo_1.3.bb
@@ -0,0 +1,8 @@
+require pseudo.inc
+
+PR = "r10"
+
+SRC_URI = "http://www.yoctoproject.org/downloads/${BPN}/${BPN}-${PV}.tar.bz2"
+
+SRC_URI[md5sum] = "5832bb70e6dce1a17b9b33a9c5c4b923"
+SRC_URI[sha256sum] = "2f30e2e9ec966cec3a321fc2ed80408ee77ad6c0cd73aaf36f88b98e008f8508"
diff --git a/meta/recipes-devtools/pseudo/pseudo_git.bb b/meta/recipes-devtools/pseudo/pseudo_git.bb
new file mode 100644
index 000000000..1852fab91
--- /dev/null
+++ b/meta/recipes-devtools/pseudo/pseudo_git.bb
@@ -0,0 +1,12 @@
+require pseudo.inc
+
+SRCREV = "f0375c9aaefbccfd41aebbf6d332bb4d9e8f980c"
+PV = "1.3+git${SRCPV}"
+PR = "r25"
+
+DEFAULT_PREFERENCE = "-1"
+
+SRC_URI = "git://github.com/wrpseudo/pseudo.git;protocol=git"
+
+S = "${WORKDIR}/git"
+