diff mbox

gnupg: added new recipe

Message ID 87ehdkp8gp.fsf@arh128.prevas.dk
State Accepted
Delegated to: Esben Haabendal
Headers show

Commit Message

Esben Haabendal May 6, 2013, 1:02 p.m. UTC
Jacob Barsoe <jabk@prevas.dk> writes:

> From: Jacob Kjaergaard <jacob.kjaergaard@prevas.dk>
>
> ---
>  recipes/gnupg/gnupg-1.4.10/long-long-thumb.patch |   12 +++++++
>  recipes/gnupg/gnupg-1.4.10/mips_gcc4.4.patch     |   42 ++++++++++++++++++++++
>  recipes/gnupg/gnupg.inc                          |   38 ++++++++++++++++++++
>  recipes/gnupg/gnupg_1.4.10.oe                    |   11 ++++++
>  recipes/gnupg/gnupg_1.4.10.oe.sig                |    1 +
>  5 files changed, 104 insertions(+)
>  create mode 100644 recipes/gnupg/gnupg-1.4.10/long-long-thumb.patch
>  create mode 100644 recipes/gnupg/gnupg-1.4.10/mips_gcc4.4.patch
>  create mode 100644 recipes/gnupg/gnupg.inc
>  create mode 100644 recipes/gnupg/gnupg_1.4.10.oe
>  create mode 100644 recipes/gnupg/gnupg_1.4.10.oe.sig
>
> diff --git a/recipes/gnupg/gnupg-1.4.10/long-long-thumb.patch b/recipes/gnupg/gnupg-1.4.10/long-long-thumb.patch
> new file mode 100644
> index 0000000..dd4ec73
> --- /dev/null
> +++ b/recipes/gnupg/gnupg-1.4.10/long-long-thumb.patch
> @@ -0,0 +1,12 @@
> +--- gnupg/mpi/longlong.h~      2006-02-14 10:09:55.000000000 +0000
> ++++ gnupg/mpi/longlong.h       2008-10-27 13:11:09.000000000 +0000
> +@@ -181,7 +181,7 @@
> + /***************************************
> +  **************  ARM  ******************
> +  ***************************************/
> +-#if defined (__arm__) && W_TYPE_SIZE == 32
> ++#if defined (__arm__) && W_TYPE_SIZE == 32 && !defined(__thumb__)
> + #define add_ssaaaa(sh, sl, ah, al, bh, bl) \
> +   __asm__ ("adds %1, %4, %5\n"                                          \
> +          "adc  %0, %2, %3"                                            \
> +
> diff --git a/recipes/gnupg/gnupg-1.4.10/mips_gcc4.4.patch b/recipes/gnupg/gnupg-1.4.10/mips_gcc4.4.patch
> new file mode 100644
> index 0000000..b101a5b
> --- /dev/null
> +++ b/recipes/gnupg/gnupg-1.4.10/mips_gcc4.4.patch
> @@ -0,0 +1,42 @@
> +Index: gnupg-1.4.10/mpi/longlong.h
> +===================================================================
> +--- gnupg-1.4.10.orig/mpi/longlong.h	2008-12-11 17:39:43.000000000 +0100
> ++++ gnupg-1.4.10/mpi/longlong.h	2010-03-27 14:27:53.000000000 +0100
> +@@ -706,18 +706,35 @@
> + #endif /* __m88110__ */
> + #endif /* __m88000__ */
> + 
> ++/* Test for gcc >= maj.min, as per __GNUC_PREREQ in glibc */
> ++#if defined (__GNUC__) && defined (__GNUC_MINOR__)
> ++#define __GNUC_PREREQ(maj, min) \
> ++	((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
> ++#else
> ++#define __GNUC_PREREQ(maj, min)  0
> ++#endif
> ++
> + /***************************************
> +  **************  MIPS  *****************
> +  ***************************************/
> + #if defined (__mips__) && W_TYPE_SIZE == 32
> +-#if __GNUC__ > 2 || __GNUC_MINOR__ >= 7
> ++#if __GNUC_PREREQ (4,4)
> ++#define umul_ppmm(w1, w0, u, v) \
> ++  do {                                                                 \
> ++	UDItype __ll = (UDItype)(u) * (v);                                 \
> ++	w1 = __ll >> 32;                                                   \
> ++	w0 = __ll;                                                         \
> ++  } while (0)
> ++#endif
> ++#if !defined (umul_ppmm) && __GNUC_PREREQ (2,7)
> + #define umul_ppmm(w1, w0, u, v) \
> +   __asm__ ("multu %2,%3"                                                \
> + 	   : "=l" ((USItype)(w0)),                                      \
> + 	     "=h" ((USItype)(w1))                                       \
> + 	   : "d" ((USItype)(u)),                                        \
> + 	     "d" ((USItype)(v)))
> +-#else
> ++#endif
> ++#if !defined (umul_ppmm)
> + #define umul_ppmm(w1, w0, u, v) \
> +   __asm__ ("multu %2,%3 \n" \
> + 	   "mflo %0 \n"     \
> diff --git a/recipes/gnupg/gnupg.inc b/recipes/gnupg/gnupg.inc
> new file mode 100644
> index 0000000..31cc74d
> --- /dev/null
> +++ b/recipes/gnupg/gnupg.inc
> @@ -0,0 +1,38 @@
> +DESCRIPTION = "gnupg - GNU privacy guard"
> +HOMEPAGE = "http://www.gnupg.org/"
> +LICENSE = "GPLv2"
> +
> +inherit autotools gettext
> +
> +DEPENDS = "zlib bzip2"
> +
> +MIRRORS ="""
> +ftp://ftp.gnupg.org/gcrypt
> +http://mirrors.rootmode.com/ftp.gnupg.org
> +"""
> +
> +SRC_URI = "ftp://ftp.gnupg.org/gcrypt/gnupg/gnupg-${PV}.tar.bz2"
> +
> +S = "${SRCDIR}/gnupg-${PV}"
> +
> +EXTRA_OECONF = "--disable-ldap \
> +		--with-zlib \
> +		--with-bzip2 \
> +		--disable-selinux-support"
> +
> +do_install[postfuncs] =+ "do_install_post"
> +
> +do_install_post() {
> +	install -d ${D}${docdir}/${PN}
> +	mv ${D}${datadir}/${PN}/* ${D}/${docdir}/${PN}/ || :
> +	mv ${D}${prefix}/doc/* ${D}/${docdir}/${PN}/ || :
> +}
> +
> +# split out gpgv from main package
> +RDEPENDS_gnupg = "gpgv"
> +PACKAGES =+ "gpgv"
> +FILES_gpgv = "${bindir}/gpgv"
> +
> +# Exclude debug files from the main packages
> +FILES_${PN} = "${bindir}/* ${datadir}/${PN} ${libexecdir}/${PN}/*"
> +FILES_${PN}-dbg += "${libexecdir}/${PN}/.debug"
> diff --git a/recipes/gnupg/gnupg_1.4.10.oe b/recipes/gnupg/gnupg_1.4.10.oe
> new file mode 100644
> index 0000000..5a36cf0
> --- /dev/null
> +++ b/recipes/gnupg/gnupg_1.4.10.oe
> @@ -0,0 +1,11 @@
> +require gnupg.inc
> +
> +DEPENDS += "readline"
> +EXTRA_OECONF += "--with-readline ac_cv_sys_symbol_underscore=yes --without-libusb"
> +#   --without-readline      do not support fancy command line editing
> +
> +SRC_URI += "file://long-long-thumb.patch"
> +SRC_URI += "file://mips_gcc4.4.patch"
> +
> +
> +
> diff --git a/recipes/gnupg/gnupg_1.4.10.oe.sig b/recipes/gnupg/gnupg_1.4.10.oe.sig
> new file mode 100644
> index 0000000..a5de7d6
> --- /dev/null
> +++ b/recipes/gnupg/gnupg_1.4.10.oe.sig
> @@ -0,0 +1 @@
> +fd1b6a5f3b2dd836b598a1123ac257b8f105615d  gnupg-1.4.10.tar.bz2

Merged to master.

I had to apply the following change to make it work:

commit fb9182ed784cb6f4738fcae21de31ef921c9a876
Author: Esben Haabendal <esben.haabendal@prevas.dk>
Date:   Mon Apr 29 22:54:08 2013 +0200

    gnupg: Fix mpi link problem in do_compile
    
    Fix problem with linking in tools/, with lots of error messages like:
    
    ../mpi/libmpi.a(mpi-add.o): In function `mpi_add':
    mpi-add.c:(.text+0x358): undefined reference to `mpihelp_sub_n'
    mpi-add.c:(.text+0x49c): undefined reference to `mpihelp_add_n'
    mpi-add.c:(.text+0x580): undefined reference to `mpihelp_sub_n'
    mpi-add.c:(.text+0x5e8): undefined reference to `mpihelp_sub_n'
    ../mpi/libmpi.a(mpi-bit.o): In function `mpi_rshift':
    mpi-bit.c:(.text+0x3ac): undefined reference to `mpihelp_rshift'
    
    Signed-off-by: Esben Haabendal <esben.haabendal@prevas.dk>

Notes:
    Target version: 3.2



/Esben
diff mbox

Patch

diff --git a/recipes/gnupg/gnupg_1.4.10.oe b/recipes/gnupg/gnupg_1.4.10.oe
index 5a36cf0..41d6d1c 100644
--- a/recipes/gnupg/gnupg_1.4.10.oe
+++ b/recipes/gnupg/gnupg_1.4.10.oe
@@ -1,9 +1,11 @@ 
 require gnupg.inc
 
 DEPENDS += "readline"
-EXTRA_OECONF += "--with-readline ac_cv_sys_symbol_underscore=yes --without-libusb"
+EXTRA_OECONF += "--with-readline"
 #   --without-readline      do not support fancy command line editing
 
+EXTRA_OECONF += "ac_cv_sys_symbol_underscore=no --without-libusb"
+
 SRC_URI += "file://long-long-thumb.patch"
 SRC_URI += "file://mips_gcc4.4.patch"