Skip to contentSkip to conversation

soci: Add recipe

PATCH Superseded Khem Raj 3 participants 5 messages Mar 8, 2015 – Mar 12, 2015

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH v3 1/2 soci: Add recipe

Define PACKAGECONFIG to enable a given backend of choice by default its 'empty'

Change-Id Ie1123af658ca94d2fe22a3ca1a32dfb47d58979e
---
 .../recipes-support/soci/soci/soci_libdir.patch    | 28 +++++++++++++
 meta-oe/recipes-support/soci/soci_3.2.2.bb         | 48 ++++++++++++++++++++++
 2 files changed, 76 insertions(+)
 create mode 100644 meta-oe/recipes-support/soci/soci/soci_libdir.patch
 create mode 100644 meta-oe/recipes-support/soci/soci_3.2.2.bb
meta-oe/recipes-support/soci/soci/soci_libdir.patch new file +28 -0
new file mode 100644
index 0000000..8da57ce
@@ -0,0 +1,28 @@
+Define SOCI_LIBDIR only if its not passed via environemnt. In OE we
+want to set it per our choice since we use 'lib' for 64bit unless we
+are using multilib
+
+-Khem
+
+Index: soci-3.2.2/CMakeLists.txt
+===================================================================
+--- soci-3.2.2.orig/CMakeLists.txt
++++ soci-3.2.2/CMakeLists.txt
+@@ -69,11 +69,12 @@ include(SociDependencies)
+ ###############################################################################
+ # Installation
+ ###############################################################################
+-
+-if(APPLE OR CMAKE_SIZEOF_VOID_P EQUAL 4)
+-  set(SOCI_LIBDIR "lib")
+-else()
+-  set(SOCI_LIBDIR "lib")
++if(NOT DEFINED SOCI_LIBDIR)
++  if(APPLE OR CMAKE_SIZEOF_VOID_P EQUAL 4)
++    set(SOCI_LIBDIR "lib")
++  else()
++    set(SOCI_LIBDIR "lib")
++  endif()
+ endif()
+ 
+ set(BINDIR "bin" CACHE PATH "The directory to install binaries into.")
meta-oe/recipes-support/soci/soci_3.2.2.bb new file +48 -0

48 lines not on this page · raw message

Signature · 1 line
2.1.4
author
#1 lore raw

PATCH v3 2/2 nodejs: Upgrade to 0.12.0

Tested on mips1

Change-Id I54211c2c323dbec1d38eb526ae183775ba3241f1
---
 meta-oe/recipes-devtools/nodejs/nodejs_0.12.0.bb | 83 ++++++++++++++++++++++++
 meta-oe/recipes-devtools/nodejs/nodejs_0.8.18.bb | 44 -------------
 2 files changed, 83 insertions(+), 44 deletions(-)
 create mode 100644 meta-oe/recipes-devtools/nodejs/nodejs_0.12.0.bb
 delete mode 100644 meta-oe/recipes-devtools/nodejs/nodejs_0.8.18.bb
meta-oe/recipes-devtools/nodejs/nodejs_0.12.0.bb new file +83 -0
new file mode 100644
index 0000000..b514837
@@ -0,0 +1,83 @@
+DESCRIPTION = "nodeJS Evented I/O for V8 JavaScript"
+HOMEPAGE = "http://nodejs.org"
+LICENSE = "MIT & BSD & Artistic-2.0"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=14115ff11211df04b031ec7d40b6d31b"
+
+DEPENDS = "openssl"
+
+SRC_URI = "http://nodejs.org/dist/v${PV}/node-v${PV}.tar.gz"
+SRC_URI[md5sum] = "62c8d9c74c8f68193f60e4cba020eb48"
+SRC_URI[sha256sum] = "9700e23af4e9b3643af48cef5f2ad20a1331ff531a12154eef2bfb0bb1682e32"
+
+S = "${WORKDIR}/node-v${PV}"
+
+# v8 errors out if you have set CCACHE
+CCACHE = ""
+
+def map_nodejs_arch(a, d):
+    import re
+
+    if   re.match('p(pc|owerpc)(|64)', a): return 'ppc'
+    elif re.match('i.86$', a): return 'ia32'
+    elif re.match('x86_64$', a): return 'x64'
+    elif re.match('arm64$', a): return 'arm'
+    return a
+
+ARCHFLAGS_arm = "${@bb.utils.contains('TUNE_FEATURES', 'callconvention-hard', '--with-arm-float-abi=hard', '--with-arm-float-abi=softfp', d)}"
+GYP_DEFINES_append_mipsel = " mips_arch_variant='r1' "
+ARCHFLAGS ?= ""
+
+# Node is way too cool to use proper autotools, so we install two wrappers to forcefully inject proper arch cflags to workaround gypi
+do_configure () {
+    export LD="${CXX}"
+    GYP_DEFINES="${GYP_DEFINES}" export GYP_DEFINES
+    # $TARGET_ARCH settings don't match --dest-cpu settings
+   ./configure --prefix=${prefix} --without-snapshot --shared-openssl \
+               --dest-cpu="${@map_nodejs_arch(d.getVar('TARGET_ARCH', True), d)}" \
+               --dest-os=linux \
+               ${ARCHFLAGS}
+}
+
+do_compile () {
+    export LD="${CXX}"
+    make BUILDTYPE=Release
+}
+
+do_install () {
+    oe_runmake install DESTDIR=${D}
+}
+
+do_install_append_class-native() {
+    # use node from PATH instead of absolute path to sysroot
+    # node-v0.10.25/tools/install.py is using:
+    # shebang = os.path.join(node_prefix, 'bin/node')
+    # update_shebang(link_path, shebang)
+    # and node_prefix can be very long path to bindir in native sysroot and
+    # when it exceeds 128 character shebang limit it's stripped to incorrect path
+    # and npm fails to execute like in this case with 133 characters show in log.do_install:
+    # updating shebang of /home/jenkins/workspace/build-webos-nightly/device/qemux86/label/open-webos-builder/BUILD-qemux86/work/x86_64-linux/nodejs-native/0.10.15-r0/image/home/jenkins/workspace/build-webos-nightly/device/qemux86/label/open-webos-builder/BUILD-qemux86/sysroots/x86_64-linux/usr/bin/npm to /home/jenkins/workspace/build-webos-nightly/device/qemux86/label/open-webos-builder/BUILD-qemux86/sysroots/x86_64-linux/usr/bin/node
+    # /usr/bin/npm is symlink to /usr/lib/node_modules/npm/bin/npm-cli.js
+    # use sed on npm-cli.js because otherwise symlink is replaced with normal file and
+    # npm-cli.js continues to use old shebang
+    sed "1s^.*^#\!/usr/bin/env node^g" -i ${D}${libdir}/node_modules/npm/bin/npm-cli.js
+}
+
+do_install_append_class-target() {
+    sed "1s^.*^#\!${bindir}/env node^g" -i ${D}${libdir}/node_modules/npm/bin/npm-cli.js
+}
+
+RDEPENDS_${PN} = "curl"
+RDEPENDS_${PN}_class-native = ""
+
+PACKAGES =+ "${PN}-npm"
+FILES_${PN}-npm = "${libdir}/node_modules ${bindir}/npm"
+RDEPENDS_${PN}-npm = "bash python-shell python-datetime python-subprocess python-textutils"
+
+PACKAGES =+ "${PN}-dtrace"
+FILES_${PN}-dtrace = "${libdir}/dtrace"
+
+PACKAGES =+ "${PN}-systemtap"
+FILES_${PN}-systemtap = "${datadir}/systemtap"
+
+
+BBCLASSEXTEND = "native"
meta-oe/recipes-devtools/nodejs/nodejs_0.8.18.bb deleted +0 -44

44 lines not on this page · raw message

Signature · 1 line
2.1.4
#2 lore raw

Re: [PATCHv3 2/2] nodejs: Upgrade to 0.12.0

Hi Khem,

meta-oe/recipes-devtools/nodejs/nodejs_0.12.0.bb line 70

Quoted 2 lines · Khem Raj
meta-oe/recipes-devtools/nodejs/nodejs_0.12.0.bb new file +2 -0
+RDEPENDS_${PN} = "curl"
+RDEPENDS_${PN}_class-native = ""

Does using node actually depend on curl at runtime?
I haven't noticed any runtime dependency on curl when using the node executable.

Regards,
Jonathan

author
#3 lore raw

Re: [PATCHv3 2/2] nodejs: Upgrade to 0.12.0

Quoted 11 lines · Jonathan Liu

Hi Khem,

meta-oe/recipes-devtools/nodejs/nodejs_0.12.0.bb line 70

Quoted 2 lines · Khem Raj
meta-oe/recipes-devtools/nodejs/nodejs_0.12.0.bb new file +2 -0
+RDEPENDS_${PN} = "curl"
+RDEPENDS_${PN}_class-native = ""

Does using node actually depend on curl at runtime?
I haven't noticed any runtime dependency on curl when using the node executable.

its cruft from past. at best it could be RSUGGESTS for nodejs-nmp package send a followup if you can.

#4 lore raw
In reply to Khem Raj
Quoted 11 lines · Khem Raj

Define PACKAGECONFIG to enable a given backend of choice by default its 'empty'

Change-Id Ie1123af658ca94d2fe22a3ca1a32dfb47d58979e
---
 .../recipes-support/soci/soci/soci_libdir.patch    | 28 +++++++++++++
 meta-oe/recipes-support/soci/soci_3.2.2.bb         | 48 ++++++++++++++++++++++
 2 files changed, 76 insertions(+)
 create mode 100644 meta-oe/recipes-support/soci/soci/soci_libdir.patch
 create mode 100644 meta-oe/recipes-support/soci/soci_3.2.2.bb

The patch fails to apply:
ERROR: Command Error: exit status: 1 Output:
Applying patch soci_libdir.patch
patching file CMakeLists.txt
Hunk #1 FAILED at 69.
1 out of 1 hunk FAILED -- rejects in file CMakeLists.txt
Patch soci_libdir.patch does not apply (enforce with -f)
ERROR: Function failed: patch_do_patch
ERROR: Logfile of failure stored in: /home/jenkins/oe/world/shr-core/tmp-glibc/work/armv5e-oe-linux-gnueabi/soci/3.2.2-r0/temp/log.do_patch.26404
NOTE: recipe soci-3.2.2-r0: task do_patch: Failed
ERROR: Task 21069 (/home/jenkins/oe/world/shr-core/meta-openembedded/meta-oe/recipes-support/soci/soci_3.2.2.bb, do_patch) failed with exit code '1'

Can you push it to contrib repo to exclude possible patchwork breakage of it?

Quoted 96 lines
meta-oe/recipes-support/soci/soci/soci_libdir.patch new file +28 -0
new file mode 100644
index 0000000..8da57ce
@@ -0,0 +1,28 @@
+Define SOCI_LIBDIR only if its not passed via environemnt. In OE we
+want to set it per our choice since we use 'lib' for 64bit unless we
+are using multilib
+
+-Khem
+
+Index: soci-3.2.2/CMakeLists.txt
+===================================================================
+--- soci-3.2.2.orig/CMakeLists.txt
++++ soci-3.2.2/CMakeLists.txt
+@@ -69,11 +69,12 @@ include(SociDependencies)
+ ###############################################################################
+ # Installation
+ ###############################################################################
+-
+-if(APPLE OR CMAKE_SIZEOF_VOID_P EQUAL 4)
+-  set(SOCI_LIBDIR "lib")
+-else()
+-  set(SOCI_LIBDIR "lib")
++if(NOT DEFINED SOCI_LIBDIR)
++  if(APPLE OR CMAKE_SIZEOF_VOID_P EQUAL 4)
++    set(SOCI_LIBDIR "lib")
++  else()
++    set(SOCI_LIBDIR "lib")
++  endif()
+ endif()
+ 
+ set(BINDIR "bin" CACHE PATH "The directory to install binaries into.")
meta-oe/recipes-support/soci/soci_3.2.2.bb new file +48 -0
new file mode 100644
index 0000000..887f5a2
@@ -0,0 +1,48 @@
+# Copyright (C) 2015 Khem Raj <[email protected]>
+# Released under the MIT license (see COPYING.MIT for the terms)
+
+DESCRIPTION = "The C++ Database Access Library"
+HOMEPAGE = "http://soci.sourceforge.net"
+LICENSE = "BSL-1.0"
+LIC_FILES_CHKSUM = "file://LICENSE_1_0.txt;md5=e4224ccaecb14d942c71d31bef20d78c"
+SECTION = "libs"
+DEPENDS = "boost"
+
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/project/${BPN}/${BPN}/${P}/${P}.tar.gz \
+           file://soci_libdir.patch \
+          "
+SRC_URI[md5sum] = "bc3c35f6cd3f80a1be19fe30b3c111bf"
+SRC_URI[sha256sum] = "30ea2f4d26639ef5b5cdc24fb300b3896746243dbb77b743582de2ff443ccb1c"
+
+TESTCONFIG = '-DSOCI_TEST_EMPTY_CONNSTR="dummy" -DSOCI_TEST_SQLITE3_CONNSTR="test.db" \
+              -DSOCI_TEST_POSTGRESQL_CONNSTR:STRING="dbname=soci_test" \
+              -DSOCI_TEST_MYSQL_CONNSTR:STRING="db=soci_test user=oe password=oe"'
+
+OBASEDIR ?= "/opt/oracle"
+OINCDIR = "rdbms/public"
+OLIBDIR = "lib"
+
+PACKAGECONFIG[sqlite3] = "-DSOCI_SQLITE3=ON,-DSOCI_SQLITE3=OFF,sqlite3,"
+PACKAGECONFIG[mysql] = "-DSOCI_MYSQL=ON,-DSOCI_MYSQL=OFF,mariadb,"
+PACKAGECONFIG[postgresql] = "-DSOCI_POSTGRESQL=ON,-DSOCI_POSTGRESQL=OFF,postgresql,"
+PACKAGECONFIG[odbc] = "-DSOCI_ODBC=ON,-DSOCI_ODBC=OFF,,"
+PACKAGECONFIG[empty] = "-DSOCI_EMPTY=ON,-DSOCI_EMPTY=OFF,,"
+PACKAGECONFIG[oracle] = "-DWITH_ORACLE=ON --with-oracle-include=${OINCDIR} --with-oracle-lib=${OLIBDIR},-DWITH_ORACLE=OFF,,"
+PACKAGECONFIG[ptest] = "${TESTCONFIG},,,"
+
+# enable your backend by default we enable 'empty'
+PACKAGECONFIG ??= "empty"
+
+# Take the flags added by PACKAGECONFIG and pass them to cmake.
+EXTRA_OECMAKE = "${EXTRA_OECONF} -DSOCI_LIBDIR=${libdir}"
+
+inherit cmake
+
+PACKAGES += "${PN}-sqlite3 ${PN}-mysql ${PN}-postgresql ${PN}-odbc ${PN}-oracle"
+
+FILES_${PN}-sqlite3 = "${libdir}/lib${BPN}_sqlite3.so.*"
+FILES_${PN}-mysql = "${libdir}/lib${BPN}_mysql.so.*"
+FILES_${PN}-postgresql = "${libdir}/lib${BPN}_postgresql.so.*"
+FILES_${PN}-odbc = "${libdir}/lib${BPN}_odbc.so.*"
+FILES_${PN}-oracle = "${libdir}/lib${BPN}_oracle.so.*"
Signature · 7 lines
2.1.4

-- 
_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-devel
Signature · 1 line
Martin 'JaMa' Jansa     jabber: [email protected]