Patchwork nspr: Compile nspr with tests 1. Compile package tests suite 2. Add patch for removing rpath from binaries 3. Add tests to -dev rpm as it needs dev libraries

login
register
mail settings
Submitter Andrei Gherzan
Date Feb. 12, 2012, 6:42 p.m.
Message ID <1329072178-18881-1-git-send-email-andrei@gherzan.ro>
Download mbox | patch
Permalink /patch/21179/
State New
Headers show

Comments

Andrei Gherzan - Feb. 12, 2012, 6:42 p.m.
Signed-off-by: Andrei Gherzan <andrei@gherzan.ro>
---
 .../nspr/files/remove-rpath-from-tests.patch       |   21 +++
 meta/recipes-support/nspr/nspr_4.8.9.bb            |  134 +++++++++++++++++++-
 2 files changed, 151 insertions(+), 4 deletions(-)
 create mode 100644 meta/recipes-support/nspr/files/remove-rpath-from-tests.patch
Paul Menzel - Feb. 12, 2012, 7:19 p.m.
Dear Andrei,


Am Sonntag, den 12.02.2012, 20:42 +0200 schrieb Andrei Gherzan:

Thank you for your patch. Unfortunately all the commit message went in
the subject line so there seem to be some line breaks missing.

Additionally I think 2. is unrelated and could be a separate patch?

> Signed-off-by: Andrei Gherzan <andrei@gherzan.ro>
> ---

If you send updated patches please add that to the tag PATCH like for
example [PATCH v3] [1].

Also please add what changed to the previous iterations.

>  .../nspr/files/remove-rpath-from-tests.patch       |   21 +++
>  meta/recipes-support/nspr/nspr_4.8.9.bb            |  134 +++++++++++++++++++-
>  2 files changed, 151 insertions(+), 4 deletions(-)
>  create mode 100644 meta/recipes-support/nspr/files/remove-rpath-from-tests.patch
> 
> diff --git a/meta/recipes-support/nspr/files/remove-rpath-from-tests.patch b/meta/recipes-support/nspr/files/remove-rpath-from-tests.patch
> new file mode 100644
> index 0000000..819c784
> --- /dev/null
> +++ b/meta/recipes-support/nspr/files/remove-rpath-from-tests.patch
> @@ -0,0 +1,21 @@
> +Author: Andrei Gherzan <andrei@gherzan.ro>
> +Date:   Thu Feb 9 00:03:38 2012 +0200
> +
> +Avoid QA warnings by removing hardcoded rpath from binaries.

Could you paste that warning here please.

> +
> +Signed-off-by: Andrei Gherzan <andrei@gherzan.ro>
> +Upstream-Status: Pending
> +
> +Index: nspr-4.8.9/mozilla/nsprpub/pr/tests/Makefile.in
> +===================================================================
> +--- nsprpub.orig/pr/tests/Makefile.in	2012-02-11 00:01:10.476220505 +0200
> ++++ nsprpub/pr/tests/Makefile.in	2012-02-10 23:57:40.000000000 +0200
> +@@ -379,7 +379,7 @@
> + endif
> + 
> + ifeq (,$(filter-out Linux GNU GNU_%,$(OS_ARCH)))
> +-    LDOPTS += -Xlinker -rpath $(ABSOLUTE_LIB_DIR)
> ++    LDOPTS += -Xlinker
> +     ifeq ($(USE_PTHREADS),1)
> +         EXTRA_LIBS = -lpthread
> +     endif
> diff --git a/meta/recipes-support/nspr/nspr_4.8.9.bb b/meta/recipes-support/nspr/nspr_4.8.9.bb
> index da324fc..c68599c 100644
> --- a/meta/recipes-support/nspr/nspr_4.8.9.bb
> +++ b/meta/recipes-support/nspr/nspr_4.8.9.bb
> @@ -5,17 +5,135 @@ LIC_FILES_CHKSUM = "file://configure.in;beginline=3;endline=40;md5=99d4d7d68bbc4
>                      file://Makefile.in;beginline=4;endline=38;md5=c2b512182a334e1bfa1edc4d1c84a298 "
>  SECTION = "libs/network"
>  
> -PR = "r0"
> +PR = "r1"
>  
> -SRC_URI = "ftp://ftp.mozilla.org/pub/mozilla.org/nspr/releases/v${PV}/src/nspr-${PV}.tar.gz"
> +SRC_URI = "ftp://ftp.mozilla.org/pub/mozilla.org/nspr/releases/v${PV}/src/nspr-${PV}.tar.gz \
> +           file://remove-rpath-from-tests.patch"

Could you please change that to the following to make future diffs
smaller.

SRC_URI = "ftp://ftp.mozilla.org/pub/mozilla.org/nspr/releases/v${PV}/src/nspr-${PV}.tar.gz \
           file://remove-rpath-from-tests.patch \
          "

>  
> -SRC_URI += "file://nspr.pc.in "
> +SRC_URI += "file://nspr.pc.in"
>  
>  SRC_URI[md5sum] = "60770d45dc08c0f181b22cdfce5be3e8"
>  SRC_URI[sha256sum] = "ff43c7c819e72f03bb908e7652c5d5f59a5d31ee86c333e692650207103d1cce"
>  
>  S = "${WORKDIR}/nspr-${PV}/mozilla/nsprpub"
>  
> +TESTS = "runtests.pl \
> +    runtests.sh \
> +    accept \
> +    acceptread \
> +    acceptreademu \
> +    affinity \
> +    alarm \
> +    anonfm \
> +    atomic \
> +    attach \
> +    bigfile \
> +    cleanup \
> +    cltsrv  \
> +    concur \
> +    cvar \
> +    cvar2 \
> +    dlltest \
> +    dtoa \
> +    errcodes \
> +    exit \
> +    fdcach \
> +    fileio \
> +    foreign \
> +    formattm \
> +    fsync \
> +    gethost \
> +    getproto \
> +    i2l \
> +    initclk \
> +    inrval \
> +    instrumt \
> +    intrio \
> +    intrupt \
> +    io_timeout \
> +    ioconthr \
> +    join \
> +    joinkk \
> +    joinku \
> +    joinuk \
> +    joinuu \
> +    layer \
> +    lazyinit \
> +    libfilename \
> +    lltest \
> +    lock \
> +    lockfile \
> +    logfile \
> +    logger \
> +    many_cv \
> +    multiwait \
> +    nameshm1 \
> +    nblayer \
> +    nonblock \
> +    ntioto \
> +    ntoh \
> +    op_2long \
> +    op_excl \
> +    op_filnf \
> +    op_filok \
> +    op_nofil \
> +    parent \
> +    parsetm \
> +    peek \
> +    perf \
> +    pipeping \
> +    pipeping2 \
> +    pipeself \
> +    poll_nm \
> +    poll_to \
> +    pollable \
> +    prftest \
> +    primblok \
> +    provider \
> +    prpollml \
> +    ranfile \
> +    randseed \
> +    reinit \
> +    rwlocktest \
> +    sel_spd \
> +    selct_er \
> +    selct_nm \
> +    selct_to \
> +    selintr \
> +    sema \
> +    semaerr \
> +    semaping \
> +    sendzlf \
> +    server_test \
> +    servr_kk \
> +    servr_uk \
> +    servr_ku \
> +    servr_uu \
> +    short_thread \
> +    sigpipe \
> +    socket \
> +    sockopt \
> +    sockping \
> +    sprintf \
> +    stack \
> +    stdio \
> +    str2addr \
> +    strod \
> +    switch \
> +    system \
> +    testbit \
> +    testfile \
> +    threads \
> +    timemac \
> +    timetest \
> +    tpd \
> +    udpsrv \
> +    vercheck \
> +    version \
> +    writev \
> +    xnotify \
> +    zerolen"
> +
>  inherit autotools
>  
>  do_configure() {
> @@ -26,12 +144,20 @@ do_compile_prepend() {
>  	oe_runmake CROSS_COMPILE=1 CFLAGS="-DXP_UNIX" LDFLAGS="" CC=gcc -C config export
>  }
>  
> +do_compile_append() {
> +	oe_runmake -C pr/tests
> +}
> +
>  do_install_append() {
>      install -D ${WORKDIR}/nspr.pc.in ${D}${libdir}/pkgconfig/nspr.pc
>      sed -i s:OEPREFIX:${prefix}:g ${D}${libdir}/pkgconfig/nspr.pc
>      sed -i s:OELIBDIR:${libdir}:g ${D}${libdir}/pkgconfig/nspr.pc
>      sed -i s:OEINCDIR:${includedir}:g ${D}${libdir}/pkgconfig/nspr.pc
>      sed -i s:OEEXECPREFIX:${exec_prefix}:g ${D}${libdir}/pkgconfig/nspr.pc
> +    cd ${S}/pr/tests
> +    mkdir -p ${D}/opt/nspr_tests
> +    install -m 0755 ${TESTS} ${D}/opt/nspr_tests
>  }

I am not sure if `/opt` is a good choice.

>  
> -
> +FILES_${PN}-dev += "/opt/nspr_tests/*"
> +FILES_${PN}-dbg += "/opt/nspr_tests/.debug/*"


Thanks,

Paul


[1] http://www.openembedded.org/wiki/How_to_submit_a_patch_to_OpenEmbedded#Create_and_Commit_your_patch

Patch

diff --git a/meta/recipes-support/nspr/files/remove-rpath-from-tests.patch b/meta/recipes-support/nspr/files/remove-rpath-from-tests.patch
new file mode 100644
index 0000000..819c784
--- /dev/null
+++ b/meta/recipes-support/nspr/files/remove-rpath-from-tests.patch
@@ -0,0 +1,21 @@ 
+Author: Andrei Gherzan <andrei@gherzan.ro>
+Date:   Thu Feb 9 00:03:38 2012 +0200
+
+Avoid QA warnings by removing hardcoded rpath from binaries.
+
+Signed-off-by: Andrei Gherzan <andrei@gherzan.ro>
+Upstream-Status: Pending
+
+Index: nspr-4.8.9/mozilla/nsprpub/pr/tests/Makefile.in
+===================================================================
+--- nsprpub.orig/pr/tests/Makefile.in	2012-02-11 00:01:10.476220505 +0200
++++ nsprpub/pr/tests/Makefile.in	2012-02-10 23:57:40.000000000 +0200
+@@ -379,7 +379,7 @@
+ endif
+ 
+ ifeq (,$(filter-out Linux GNU GNU_%,$(OS_ARCH)))
+-    LDOPTS += -Xlinker -rpath $(ABSOLUTE_LIB_DIR)
++    LDOPTS += -Xlinker
+     ifeq ($(USE_PTHREADS),1)
+         EXTRA_LIBS = -lpthread
+     endif
diff --git a/meta/recipes-support/nspr/nspr_4.8.9.bb b/meta/recipes-support/nspr/nspr_4.8.9.bb
index da324fc..c68599c 100644
--- a/meta/recipes-support/nspr/nspr_4.8.9.bb
+++ b/meta/recipes-support/nspr/nspr_4.8.9.bb
@@ -5,17 +5,135 @@  LIC_FILES_CHKSUM = "file://configure.in;beginline=3;endline=40;md5=99d4d7d68bbc4
                     file://Makefile.in;beginline=4;endline=38;md5=c2b512182a334e1bfa1edc4d1c84a298 "
 SECTION = "libs/network"
 
-PR = "r0"
+PR = "r1"
 
-SRC_URI = "ftp://ftp.mozilla.org/pub/mozilla.org/nspr/releases/v${PV}/src/nspr-${PV}.tar.gz"
+SRC_URI = "ftp://ftp.mozilla.org/pub/mozilla.org/nspr/releases/v${PV}/src/nspr-${PV}.tar.gz \
+           file://remove-rpath-from-tests.patch"
 
-SRC_URI += "file://nspr.pc.in "
+SRC_URI += "file://nspr.pc.in"
 
 SRC_URI[md5sum] = "60770d45dc08c0f181b22cdfce5be3e8"
 SRC_URI[sha256sum] = "ff43c7c819e72f03bb908e7652c5d5f59a5d31ee86c333e692650207103d1cce"
 
 S = "${WORKDIR}/nspr-${PV}/mozilla/nsprpub"
 
+TESTS = "runtests.pl \
+    runtests.sh \
+    accept \
+    acceptread \
+    acceptreademu \
+    affinity \
+    alarm \
+    anonfm \
+    atomic \
+    attach \
+    bigfile \
+    cleanup \
+    cltsrv  \
+    concur \
+    cvar \
+    cvar2 \
+    dlltest \
+    dtoa \
+    errcodes \
+    exit \
+    fdcach \
+    fileio \
+    foreign \
+    formattm \
+    fsync \
+    gethost \
+    getproto \
+    i2l \
+    initclk \
+    inrval \
+    instrumt \
+    intrio \
+    intrupt \
+    io_timeout \
+    ioconthr \
+    join \
+    joinkk \
+    joinku \
+    joinuk \
+    joinuu \
+    layer \
+    lazyinit \
+    libfilename \
+    lltest \
+    lock \
+    lockfile \
+    logfile \
+    logger \
+    many_cv \
+    multiwait \
+    nameshm1 \
+    nblayer \
+    nonblock \
+    ntioto \
+    ntoh \
+    op_2long \
+    op_excl \
+    op_filnf \
+    op_filok \
+    op_nofil \
+    parent \
+    parsetm \
+    peek \
+    perf \
+    pipeping \
+    pipeping2 \
+    pipeself \
+    poll_nm \
+    poll_to \
+    pollable \
+    prftest \
+    primblok \
+    provider \
+    prpollml \
+    ranfile \
+    randseed \
+    reinit \
+    rwlocktest \
+    sel_spd \
+    selct_er \
+    selct_nm \
+    selct_to \
+    selintr \
+    sema \
+    semaerr \
+    semaping \
+    sendzlf \
+    server_test \
+    servr_kk \
+    servr_uk \
+    servr_ku \
+    servr_uu \
+    short_thread \
+    sigpipe \
+    socket \
+    sockopt \
+    sockping \
+    sprintf \
+    stack \
+    stdio \
+    str2addr \
+    strod \
+    switch \
+    system \
+    testbit \
+    testfile \
+    threads \
+    timemac \
+    timetest \
+    tpd \
+    udpsrv \
+    vercheck \
+    version \
+    writev \
+    xnotify \
+    zerolen"
+
 inherit autotools
 
 do_configure() {
@@ -26,12 +144,20 @@  do_compile_prepend() {
 	oe_runmake CROSS_COMPILE=1 CFLAGS="-DXP_UNIX" LDFLAGS="" CC=gcc -C config export
 }
 
+do_compile_append() {
+	oe_runmake -C pr/tests
+}
+
 do_install_append() {
     install -D ${WORKDIR}/nspr.pc.in ${D}${libdir}/pkgconfig/nspr.pc
     sed -i s:OEPREFIX:${prefix}:g ${D}${libdir}/pkgconfig/nspr.pc
     sed -i s:OELIBDIR:${libdir}:g ${D}${libdir}/pkgconfig/nspr.pc
     sed -i s:OEINCDIR:${includedir}:g ${D}${libdir}/pkgconfig/nspr.pc
     sed -i s:OEEXECPREFIX:${exec_prefix}:g ${D}${libdir}/pkgconfig/nspr.pc
+    cd ${S}/pr/tests
+    mkdir -p ${D}/opt/nspr_tests
+    install -m 0755 ${TESTS} ${D}/opt/nspr_tests
 }
 
-
+FILES_${PN}-dev += "/opt/nspr_tests/*"
+FILES_${PN}-dbg += "/opt/nspr_tests/.debug/*"