Gentoo Archives: gentoo-commits

From: Mark Wright <gienah@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sci-mathematics/sha1-polyml/, sci-mathematics/sha1-polyml/files/
Date: Mon, 02 Jan 2017 23:02:27
Message-Id: 1483398122.1772772b7973e844b580481f4912f949b75890f4.gienah@gentoo
1 commit: 1772772b7973e844b580481f4912f949b75890f4
2 Author: Mark Wright <gienah <AT> gentoo <DOT> org>
3 AuthorDate: Mon Jan 2 23:00:36 2017 +0000
4 Commit: Mark Wright <gienah <AT> gentoo <DOT> org>
5 CommitDate: Mon Jan 2 23:02:02 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1772772b
7
8 sci-mathematics/sha1-polyml: Bump to 5.6-1. Fix
9 get_libdir called in global scope, thanks to mgorny for reporting.
10
11 Gentoo-bug: 593380
12
13 Package-Manager: portage-2.3.3
14
15 sci-mathematics/sha1-polyml/Manifest | 1 +
16 .../files/sha1-polyml-5.6_p1-build.patch | 60 +++++++++++++++++++++
17 .../sha1-polyml/sha1-polyml-5.6_p1.ebuild | 62 ++++++++++++++++++++++
18 3 files changed, 123 insertions(+)
19
20 diff --git a/sci-mathematics/sha1-polyml/Manifest b/sci-mathematics/sha1-polyml/Manifest
21 index 480d96f..11d31b3 100644
22 --- a/sci-mathematics/sha1-polyml/Manifest
23 +++ b/sci-mathematics/sha1-polyml/Manifest
24 @@ -1 +1,2 @@
25 DIST polyml-5.5.0.tar.gz 12776783 SHA256 1ada41fba3f3cd5bb9b3e3dd1585e8576284e9a74ad7c4ddf88c020f716ec7dc SHA512 4d8accc7083e12a0117fb4e34367e9b22c500d31094d8f0e381b91e91a3e8122cb5ca760ecc86bdcf7ff50a460848a181747bafc068b4a300b01de54e55fbad7 WHIRLPOOL 2bc658af92f0b85ae8ba63d3f07caced91a335a3d5541e3988fa78147ef6f6c8713e479cde0ed41077621ead4b3d6eaca466a05d6d87d2f27d427299513d7033
26 +DIST polyml-5.6-1.tar.gz 22041657 SHA256 6091bbdbad437b6a0293e8091642bf204ff1d71f8d262de46ae200357d98f113 SHA512 3107f4a5b17283dc3873b0ecf7eb1c607c42e14e859b50345b666f19412a2592e359ea29f03e56d390491e9104a71e0bf80eb39884f51d8724b37f8f935fa7d2 WHIRLPOOL 13e8d61c0271855b8034426b6e41aacb1ff694f3fa0ce5c5b4806487567bded7230c5ff64390f163e07da8d78a08f19780ac84d3931e033e8496079a9f18f523
27
28 diff --git a/sci-mathematics/sha1-polyml/files/sha1-polyml-5.6_p1-build.patch b/sci-mathematics/sha1-polyml/files/sha1-polyml-5.6_p1-build.patch
29 new file mode 100644
30 index 00000000..86645b9
31 --- /dev/null
32 +++ b/sci-mathematics/sha1-polyml/files/sha1-polyml-5.6_p1-build.patch
33 @@ -0,0 +1,60 @@
34 +--- polyml-5.6-1-orig/sha1/build 2015-09-09 03:05:54.000000000 +1000
35 ++++ polyml-5.6-1/sha1/build 2016-12-28 19:10:36.148579115 +1100
36 +@@ -32,34 +32,34 @@
37 +
38 + case "$target" in
39 + x86-linux)
40 +- CFLAGS="-fPIC -I. -m32"
41 +- LDFLAGS="-fPIC -m32 -shared"
42 ++ CFLAGS="-O2 -march=native -ggdb -fvar-tracking-assignments -fvar-tracking -pipe -fPIC -I. -m32"
43 ++ LDFLAGS="-Wl,-O1 -Wl,--as-needed -fPIC -m32 -shared"
44 + library="$target/libsha1.so"
45 + test_sha1="test_sha1"
46 + ;;
47 + x86_64-linux)
48 +- CFLAGS="-fPIC -I. -m64"
49 +- LDFLAGS="-fPIC -m64 -shared"
50 ++ CFLAGS="-O2 -march=native -ggdb -fvar-tracking-assignments -fvar-tracking -pipe -fPIC -I. -m64"
51 ++ LDFLAGS="-Wl,-O1 -Wl,--as-needed -fPIC -m64 -shared"
52 + library="$target/libsha1.so"
53 + test_sha1="test_sha1"
54 + ;;
55 + x86-darwin)
56 + LD=libtool
57 +- CFLAGS="-fPIC -I. -m32"
58 +- LDFLAGS="-dynamic -lc"
59 ++ CFLAGS="-O2 -march=native -ggdb -fvar-tracking-assignments -fvar-tracking -pipe -fPIC -I. -m32"
60 ++ LDFLAGS="-Wl,-O1 -Wl,--as-needed -dynamic -lc"
61 + library="$target/libsha1.so"
62 + test_sha1="test_sha1"
63 + ;;
64 + x86_64-darwin)
65 + LD=libtool
66 +- CFLAGS="-fPIC -I. -m64"
67 +- LDFLAGS="-dynamic -lc"
68 ++ CFLAGS="-O2 -march=native -ggdb -fvar-tracking-assignments -fvar-tracking -pipe -fPIC -I. -m64"
69 ++ LDFLAGS="-Wl,-O1 -Wl,--as-needed -dynamic -lc"
70 + library="$target/libsha1.so"
71 + test_sha1="test_sha1"
72 + ;;
73 + x86-cygwin)
74 +- CFLAGS="-I. -m32"
75 +- LDFLAGS="-shared"
76 ++ CFLAGS="-O2 -march=native -ggdb -fvar-tracking-assignments -fvar-tracking -pipe -I. -m32"
77 ++ LDFLAGS="-Wl,-O1 -Wl,--as-needed -shared"
78 + library="$target/sha1.dll"
79 + test_sha1="test_sha1.exe"
80 + ;;
81 +@@ -105,10 +105,6 @@
82 + $CC $CFLAGS -o $test_sha1 test_sha1.c -ldl
83 + [ "$?" -ne 0 ] && { exit 1; }
84 +
85 +-echo "Running tests ..."
86 +-./$test_sha1 $library
87 +-[ "$?" -ne 0 ] && { exit 1; }
88 +-
89 +-rm test_sha1 sha1.o
90 ++exit 0
91 +
92 + fi
93 +\ No newline at end of file
94
95 diff --git a/sci-mathematics/sha1-polyml/sha1-polyml-5.6_p1.ebuild b/sci-mathematics/sha1-polyml/sha1-polyml-5.6_p1.ebuild
96 new file mode 100644
97 index 00000000..7349cf9
98 --- /dev/null
99 +++ b/sci-mathematics/sha1-polyml/sha1-polyml-5.6_p1.ebuild
100 @@ -0,0 +1,62 @@
101 +# Copyright 1999-2017 Gentoo Foundation
102 +# Distributed under the terms of the GNU General Public License v2
103 +# $Id$
104 +
105 +EAPI="6"
106 +
107 +inherit multilib toolchain-funcs
108 +
109 +MY_PN="polyml"
110 +MY_PV="5.6-1"
111 +MY_P="${MY_PN}-${MY_PV}"
112 +
113 +DESCRIPTION="implementation of SHA1 is taken from the GNU coreutils package"
114 +HOMEPAGE="http://isabelle.in.tum.de/"
115 +SRC_URI="http://isabelle.in.tum.de/components/${MY_P}.tar.gz"
116 +
117 +LICENSE="GPL-3"
118 +SLOT="0"
119 +KEYWORDS="~x86 ~amd64"
120 +IUSE=""
121 +
122 +RDEPEND=""
123 +DEPEND="${RDEPEND}"
124 +
125 +S="${WORKDIR}/${MY_P}/sha1"
126 +
127 +# sci-mathematics/isabelle requires sci-mathematics/sha1-polyml, to avoid
128 +# this warning:
129 +# ### load_lib </usr/bin/libsha1.so> : /usr/bin/libsha1.so: cannot open shared
130 +# object file: No such file or directory
131 +# ### Using slow ML implementation of SHA1.digest
132 +# sci-mathematics/sha1-polyml supplies the library libsha1.so. Which
133 +# is the implementation of SHA1 taken from the GNU coreutils package
134 +# as described in the sci-mathematics/sha1-polyml README. Isabelle
135 +# builds libsha1.so in the contrib/polyml/$ML_PLATFORM directory.
136 +# isabelle dynamically loads libsha1.so as a plugin. The Isabelle-2012
137 +# linux binary bundle places libsha1.so in the contrib/polyml directory, which
138 +# is referred to as ML_HOME in the Isabelle Pure/General/sha1_polyml.ML source file.
139 +# ML_HOME is /usr/bin on Gentoo, and we want isabelle to depend o sha1-polyml.
140 +# For these reasons isabelle is patched to load it from
141 +# /usr/$(get_libdir)/sha1-polyml/libsha1.so
142 +
143 +src_compile() {
144 + $(tc-getCC) \
145 + ${CPPFLAGS} ${CFLAGS} ${LDFLAGS} -I. -fPIC -shared \
146 + -o libsha1.so sha1.c || die "compile libsha1.so failed"
147 + $(tc-getCC) \
148 + ${CPPFLAGS} ${CFLAGS} ${LDFLAGS} -I. \
149 + -o test_sha1 test_sha1.c -ldl || die "compile test_sha1 failed"
150 +}
151 +
152 +src_test() {
153 + ./test_sha1 ./libsha1.so || die "tests failed"
154 +}
155 +
156 +src_install() {
157 + dodoc README
158 + local ld="${ROOT}usr/"$(get_libdir)"/${PN}"
159 + dodir ${ld}
160 + exeinto ${ld}
161 + doexe libsha1.so
162 +}