1 |
commit: 58b01d175d8b6d53450edc000125f84dac96fd5f |
2 |
Author: Anthony G. Basile <blueness <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat May 12 05:14:56 2012 +0000 |
4 |
Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat May 12 05:14:56 2012 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/hardened-dev.git;a=commit;h=58b01d17 |
7 |
|
8 |
dev-libs/nettle: fixes bug #415193 |
9 |
|
10 |
--- |
11 |
.../nettle/files/nettle-2.4-darwin-shlink.patch | 53 ++++++++++++++++++++ |
12 |
dev-libs/nettle/files/nettle-2.4-link-lm.patch | 12 +++++ |
13 |
dev-libs/nettle/metadata.xml | 5 ++ |
14 |
dev-libs/nettle/nettle-2.4-r99.ebuild | 35 +++++++++++++ |
15 |
4 files changed, 105 insertions(+), 0 deletions(-) |
16 |
|
17 |
diff --git a/dev-libs/nettle/files/nettle-2.4-darwin-shlink.patch b/dev-libs/nettle/files/nettle-2.4-darwin-shlink.patch |
18 |
new file mode 100644 |
19 |
index 0000000..da32808 |
20 |
--- /dev/null |
21 |
+++ b/dev-libs/nettle/files/nettle-2.4-darwin-shlink.patch |
22 |
@@ -0,0 +1,53 @@ |
23 |
+From MacPorts: |
24 |
+https://trac.macports.org/browser/trunk/dports/devel/nettle/files/patch-configure.diff |
25 |
+ |
26 |
+nettle: move -L. before $(LDFLAGS) (which will contain -L${prefix}/lib) |
27 |
+so future updates when the new and old libraries are incompatible don't |
28 |
+go awry |
29 |
+ |
30 |
+Reworked by Gentoo for configure.ac |
31 |
+ |
32 |
+Fixes in particular the linking stage on Darwin, using the right |
33 |
+dependency libs, and creating the right names. |
34 |
+ |
35 |
+Fixed incorrect -gmp argument in LIBS (probably typo) |
36 |
+ |
37 |
+ |
38 |
+--- configure.ac |
39 |
++++ configure.ac |
40 |
+@@ -61,9 +61,7 @@ |
41 |
+ [enable_gcov=no]) |
42 |
+ |
43 |
+ LSH_RPATH_INIT([`echo $with_lib_path | sed 's/:/ /g'` \ |
44 |
+- `echo $exec_prefix | sed "s@^NONE@$prefix/lib@g" | sed "s@^NONE@$ac_default_prefix/lib@g"` \ |
45 |
+- /usr/local/lib /sw/local/lib /sw/lib \ |
46 |
+- /usr/gnu/lib /opt/gnu/lib /sw/gnu/lib /usr/freeware/lib /usr/pkg/lib]) |
47 |
++ `echo $exec_prefix | sed "s@^NONE@$prefix/lib@g" | sed "s@^NONE@$ac_default_prefix/lib@g"`]) |
48 |
+ |
49 |
+ # Checks for programs. |
50 |
+ AC_PROG_CC |
51 |
+@@ -281,16 +280,16 @@ |
52 |
+ ;; |
53 |
+ darwin*) |
54 |
+ LIBNETTLE_FORLINK=libnettle.dylib |
55 |
+- LIBNETTLE_SONAME='$(LIBNETTLE_FORLINK).$(LIBNETTLE_MAJOR)' |
56 |
+- LIBNETTLE_FILE='$(LIBNETTLE_SONAME).$(LIBNETTLE_MINOR)' |
57 |
+- LIBNETTLE_LINK='$(CC) -dynamiclib $(LDFLAGS)' |
58 |
+- LIBNETTLE_LIBS='' |
59 |
++ LIBNETTLE_SONAME='libnettle.$(LIBNETTLE_MAJOR).dylib' |
60 |
++ LIBNETTLE_FILE='libnettle.$(LIBNETTLE_MAJOR).$(LIBNETTLE_MINOR).dylib' |
61 |
++ LIBNETTLE_LINK='$(CC) -dynamiclib $(LDFLAGS) -install_name ${libdir}/$(LIBNETTLE_SONAME) -compatibility_version $(LIBNETTLE_MAJOR) -current_version $(LIBNETTLE_MAJOR).$(LIBNETTLE_MINOR)' |
62 |
++ LIBNETTLE_LIBS='$(LIBS)' |
63 |
+ |
64 |
+ LIBHOGWEED_FORLINK=libhogweed.dylib |
65 |
+- LIBHOGWEED_SONAME='$(LIBHOGWEED_FORLINK).$(LIBHOGWEED_MAJOR)' |
66 |
+- LIBHOGWEED_FILE='$(LIBHOGWEED_SONAME).$(LIBHOGWEED_MINOR)' |
67 |
+- LIBHOGWEED_LINK='$(CC) -dynamiclib $(LDFLAGS)' |
68 |
+- LIBHOGWEED_LIBS='' |
69 |
++ LIBHOGWEED_SONAME='libhogweed.$(LIBHOGWEED_MAJOR).dylib' |
70 |
++ LIBHOGWEED_FILE='libhogweed.$(LIBHOGWEED_MAJOR).$(LIBHOGWEED_MINOR).dylib' |
71 |
++ LIBHOGWEED_LINK='$(CC) -dynamiclib -L. $(LDFLAGS) -install_name ${libdir}/$(LIBHOGWEED_SONAME) -compatibility_version $(LIBHOGWEED_MAJOR) -current_version $(LIBHOGWEED_MAJOR).$(LIBHOGWEED_MINOR)' |
72 |
++ LIBHOGWEED_LIBS='$(LIBS) -lnettle' |
73 |
+ ;; |
74 |
+ solaris*) |
75 |
+ # Sun's ld uses -h to set the soname, and this option is passed |
76 |
|
77 |
diff --git a/dev-libs/nettle/files/nettle-2.4-link-lm.patch b/dev-libs/nettle/files/nettle-2.4-link-lm.patch |
78 |
new file mode 100644 |
79 |
index 0000000..3127ad0 |
80 |
--- /dev/null |
81 |
+++ b/dev-libs/nettle/files/nettle-2.4-link-lm.patch |
82 |
@@ -0,0 +1,12 @@ |
83 |
+diff -Naur nettle-2.4.orig//examples/Makefile.in nettle-2.4/examples/Makefile.in |
84 |
+--- nettle-2.4.orig//examples/Makefile.in 2011-09-03 12:51:07.000000000 +0000 |
85 |
++++ nettle-2.4/examples/Makefile.in 2012-05-08 23:49:01.580003605 +0000 |
86 |
+@@ -68,7 +68,7 @@ |
87 |
+ |
88 |
+ nettle-benchmark$(EXEEXT): nettle-benchmark.$(OBJEXT) nettle-openssl.$(OBJEXT) $(GETOPT_OBJS) |
89 |
+ $(LINK) nettle-benchmark.$(OBJEXT) nettle-openssl.$(OBJEXT) io.$(OBJEXT) $(GETOPT_OBJS) \ |
90 |
+- -lnettle $(BENCH_LIBS) $(OPENSSL_LIBFLAGS) -o nettle-benchmark$(EXEEXT) |
91 |
++ -lnettle -lm $(BENCH_LIBS) $(OPENSSL_LIBFLAGS) -o nettle-benchmark$(EXEEXT) |
92 |
+ |
93 |
+ $(TARGETS) : io.$(OBJEXT) ../libnettle.a |
94 |
+ |
95 |
|
96 |
diff --git a/dev-libs/nettle/metadata.xml b/dev-libs/nettle/metadata.xml |
97 |
new file mode 100644 |
98 |
index 0000000..d68fe97 |
99 |
--- /dev/null |
100 |
+++ b/dev-libs/nettle/metadata.xml |
101 |
@@ -0,0 +1,5 @@ |
102 |
+<?xml version="1.0" encoding="UTF-8"?> |
103 |
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> |
104 |
+<pkgmetadata> |
105 |
+<herd>crypto</herd> |
106 |
+</pkgmetadata> |
107 |
|
108 |
diff --git a/dev-libs/nettle/nettle-2.4-r99.ebuild b/dev-libs/nettle/nettle-2.4-r99.ebuild |
109 |
new file mode 100644 |
110 |
index 0000000..80cc67e |
111 |
--- /dev/null |
112 |
+++ b/dev-libs/nettle/nettle-2.4-r99.ebuild |
113 |
@@ -0,0 +1,35 @@ |
114 |
+# Copyright 1999-2012 Gentoo Foundation |
115 |
+# Distributed under the terms of the GNU General Public License v2 |
116 |
+# $Header: /var/cvsroot/gentoo-x86/dev-libs/nettle/nettle-2.4.ebuild,v 1.13 2012/04/26 15:39:22 aballier Exp $ |
117 |
+ |
118 |
+EAPI="4" |
119 |
+ |
120 |
+inherit eutils autotools |
121 |
+ |
122 |
+DESCRIPTION="Low-level cryptographic library" |
123 |
+HOMEPAGE="http://www.lysator.liu.se/~nisse/nettle/" |
124 |
+SRC_URI="http://www.lysator.liu.se/~nisse/archive/${P}.tar.gz" |
125 |
+ |
126 |
+LICENSE="|| ( LGPL-3 LGPL-2.1 )" |
127 |
+SLOT="0" |
128 |
+KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~x86-solaris" |
129 |
+IUSE="+gmp ssl" |
130 |
+ |
131 |
+DEPEND="gmp? ( dev-libs/gmp ) |
132 |
+ ssl? ( dev-libs/openssl )" |
133 |
+RDEPEND="${DEPEND}" |
134 |
+ |
135 |
+src_prepare() { |
136 |
+ sed -e "/CFLAGS=/s: -ggdb3::" -i configure.ac || die "sed failed" |
137 |
+ epatch "${FILESDIR}"/${P}-darwin-shlink.patch |
138 |
+ epatch "${FILESDIR}"/${P}-link-lm.patch |
139 |
+ sed -i -e 's/solaris\*)/sunldsolaris*)/' configure.ac || die |
140 |
+ eautoreconf |
141 |
+} |
142 |
+ |
143 |
+src_configure() { |
144 |
+ econf \ |
145 |
+ --enable-shared \ |
146 |
+ $(use_enable gmp public-key) \ |
147 |
+ $(use_enable ssl openssl) |
148 |
+} |