Gentoo Archives: gentoo-commits

From: Thomas Deutschmann <whissi@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-arch/unrar/, app-arch/unrar/files/
Date: Wed, 21 Jun 2017 11:44:41
Message-Id: 1498045470.dabe9845e2f4b38d214b8cc1e27f0a43680eb39c.whissi@gentoo
1 commit: dabe9845e2f4b38d214b8cc1e27f0a43680eb39c
2 Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
3 AuthorDate: Wed Jun 21 11:44:15 2017 +0000
4 Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
5 CommitDate: Wed Jun 21 11:44:30 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=dabe9845
7
8 app-arch/unrar: Bump to v5.5.5 (bug #622342)
9
10 Contains upstream fix for security related VMSF_DELTA filter
11 signedness error.
12
13 Package-Manager: Portage-2.3.5, Repoman-2.3.2
14
15 app-arch/unrar/Manifest | 1 +
16 app-arch/unrar/files/unrar-5.5.5-build.patch | 44 ++++++++++++++
17 app-arch/unrar/files/unrar-5.5.5-honor-flags.patch | 46 +++++++++++++++
18 app-arch/unrar/metadata.xml | 3 +
19 app-arch/unrar/unrar-5.5.5.ebuild | 68 ++++++++++++++++++++++
20 5 files changed, 162 insertions(+)
21
22 diff --git a/app-arch/unrar/Manifest b/app-arch/unrar/Manifest
23 index d5c2a801d56..fb13df3fb15 100644
24 --- a/app-arch/unrar/Manifest
25 +++ b/app-arch/unrar/Manifest
26 @@ -1 +1,2 @@
27 +DIST unrar-5.5.5.tar.gz 220377 SHA256 a4553839cb2f025d0d9c5633816a83a723e3938209f17620c8c15da06ed061ef SHA512 b0979641737e3ef18f6708cc19e335c312ac5c6e2a13206d5fed9a5564ac99042c45a842da95163e53c6415131a39a91e901aeb186016da2e3781164679a07ff WHIRLPOOL e22399e866fabeb6f0c1617ca6b8852cf1bd406c0e95e5480692fe33bed9a130dd678f93dde6401015928437b99949865a80b21774788fdb1c7a12e3175560f4
28 DIST unrarsrc-5.4.5.tar.gz 226320 SHA256 e470c584332422893fb52e049f2cbd99e24dc6c6da971008b4e2ae4284f8796c SHA512 ba2abf11638b5ee026cb9e0c3576c94376a01ab3c5411b9bd0e8116d64879c81e76df16f98d850f0f0f5387dda046f38be64ddfb4fe57431cc4d97066d6e3c2f WHIRLPOOL c8e035ec183f41d8faf8345b49d2a4d20e21f9c6e27f14d7794389942df4954cd66ab4a5be2fdff6d369b514ae99d5d015f35a36143d686563b2a8efdfc77dce
29
30 diff --git a/app-arch/unrar/files/unrar-5.5.5-build.patch b/app-arch/unrar/files/unrar-5.5.5-build.patch
31 new file mode 100644
32 index 00000000000..5d69a25d65a
33 --- /dev/null
34 +++ b/app-arch/unrar/files/unrar-5.5.5-build.patch
35 @@ -0,0 +1,44 @@
36 +Makefile: Fix parallel build issue
37 +
38 +If clean runs in parallel with $(OBJECTS), it is possible to build some
39 +objects first, then the clean target fires and deletes some, and then we
40 +try to link and fail.
41 +
42 +Gentoo-Bug: https://bugs.gentoo.org/528218
43 +
44 +--- a/makefile
45 ++++ b/makefile
46 +@@ -139,23 +139,23 @@ uninstall: uninstall-unrar
47 +
48 + clean:
49 + @rm -f *.o *.bak *~
50 +-
51 +-unrar: clean $(OBJECTS) $(UNRAR_OBJ)
52 + @rm -f unrar
53 ++ @rm -f default.sfx
54 ++ @rm -f libunrar.so
55 ++ @rm -f libunrar.a
56 ++
57 ++unrar: $(OBJECTS) $(UNRAR_OBJ)
58 + $(LINK) -o unrar $(LDFLAGS) $(OBJECTS) $(UNRAR_OBJ) $(LIBS)
59 + $(STRIP) unrar
60 +
61 + sfx: WHAT=SFX_MODULE
62 +-sfx: clean $(OBJECTS)
63 +- @rm -f default.sfx
64 ++sfx: $(OBJECTS)
65 + $(LINK) -o default.sfx $(LDFLAGS) $(OBJECTS)
66 + $(STRIP) default.sfx
67 +
68 + lib: WHAT=RARDLL
69 + lib: CXXFLAGS+=$(LIBFLAGS)
70 +-lib: clean $(OBJECTS) $(LIB_OBJ)
71 +- @rm -f libunrar.so
72 +- @rm -f libunrar.a
73 ++lib: $(OBJECTS) $(LIB_OBJ)
74 + $(LINK) -shared -o libunrar.so $(LDFLAGS) $(OBJECTS) $(LIB_OBJ)
75 + $(AR) rcs libunrar.a $(OBJECTS) $(LIB_OBJ)
76 +
77 +--
78 +2.13.1
79 +
80
81 diff --git a/app-arch/unrar/files/unrar-5.5.5-honor-flags.patch b/app-arch/unrar/files/unrar-5.5.5-honor-flags.patch
82 new file mode 100644
83 index 00000000000..0237e3d30f0
84 --- /dev/null
85 +++ b/app-arch/unrar/files/unrar-5.5.5-honor-flags.patch
86 @@ -0,0 +1,46 @@
87 +Makefile: Honor {LD,CXX}FLAGS, add LIBFLAGS
88 +
89 + - append -pthread to LDFLAGS instead of replacing them
90 + - use CXXFLAGS when linking
91 + - append LIBFLAGS to the individual targets instead of the final link
92 +
93 +Gentoo-Bug: https://bugs.gentoo.org/461806
94 +
95 +--- a/makefile
96 ++++ b/makefile
97 +@@ -8,7 +8,7 @@ LIBFLAGS=-fPIC
98 + DEFINES=-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -DRAR_SMP
99 + STRIP=strip
100 + AR=ar
101 +-LDFLAGS=-pthread
102 ++LDFLAGS+=-pthread
103 + DESTDIR=/usr
104 +
105 + # Linux using LCC
106 +@@ -145,18 +145,19 @@ clean:
107 + @rm -f libunrar.a
108 +
109 + unrar: $(OBJECTS) $(UNRAR_OBJ)
110 +- $(LINK) -o unrar $(LDFLAGS) $(OBJECTS) $(UNRAR_OBJ) $(LIBS)
111 ++ $(LINK) -o unrar $(CXXFLAGS) $(LDFLAGS) $(OBJECTS) $(UNRAR_OBJ) $(LIBS)
112 + $(STRIP) unrar
113 +
114 + sfx: WHAT=SFX_MODULE
115 + sfx: $(OBJECTS)
116 +- $(LINK) -o default.sfx $(LDFLAGS) $(OBJECTS)
117 ++ $(LINK) -o default.sfx $(CXXFLAGS) $(LDFLAGS) $(OBJECTS)
118 + $(STRIP) default.sfx
119 +
120 ++$(OBJECTS) $(LIB_OBJ): CXXFLAGS+=$(LIBFLAGS)
121 ++
122 + lib: WHAT=RARDLL
123 +-lib: CXXFLAGS+=$(LIBFLAGS)
124 + lib: $(OBJECTS) $(LIB_OBJ)
125 +- $(LINK) -shared -o libunrar.so $(LDFLAGS) $(OBJECTS) $(LIB_OBJ)
126 ++ $(LINK) -shared -o libunrar.so $(CXXFLAGS) $(LDFLAGS) $(OBJECTS) $(LIB_OBJ)
127 + $(AR) rcs libunrar.a $(OBJECTS) $(LIB_OBJ)
128 +
129 + install-unrar:
130 +--
131 +2.13.1
132 +
133
134 diff --git a/app-arch/unrar/metadata.xml b/app-arch/unrar/metadata.xml
135 index 2d6340af03e..08898384e73 100644
136 --- a/app-arch/unrar/metadata.xml
137 +++ b/app-arch/unrar/metadata.xml
138 @@ -9,6 +9,9 @@
139 <email>base-system@g.o</email>
140 <name>Gentoo Base System</name>
141 </maintainer>
142 +<slots>
143 + <subslots>Reflect ABI of libunrar.so.</subslots>
144 +</slots>
145 <upstream>
146 <remote-id type="cpe">cpe:/a:rarlab:unrar</remote-id>
147 </upstream>
148
149 diff --git a/app-arch/unrar/unrar-5.5.5.ebuild b/app-arch/unrar/unrar-5.5.5.ebuild
150 new file mode 100644
151 index 00000000000..1d82f28516a
152 --- /dev/null
153 +++ b/app-arch/unrar/unrar-5.5.5.ebuild
154 @@ -0,0 +1,68 @@
155 +# Copyright 1999-2017 Gentoo Foundation
156 +# Distributed under the terms of the GNU General Public License v2
157 +
158 +EAPI="6"
159 +
160 +inherit flag-o-matic multilib toolchain-funcs
161 +
162 +MY_PN=${PN}src
163 +
164 +DESCRIPTION="Uncompress rar files"
165 +HOMEPAGE="http://www.rarlab.com/rar_add.htm"
166 +SRC_URI="http://www.rarlab.com/rar/${MY_PN}-${PV}.tar.gz -> ${P}.tar.gz"
167 +
168 +LICENSE="unRAR"
169 +# subslot = soname version
170 +SLOT="0/5"
171 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~x86-solaris"
172 +IUSE=""
173 +
174 +RDEPEND="!<=app-arch/unrar-gpl-0.0.1_p20080417"
175 +
176 +S=${WORKDIR}/unrar
177 +
178 +PATCHES=(
179 + "${FILESDIR}"/${PN}-5.5.5-build.patch
180 + "${FILESDIR}"/${PN}-5.5.5-honor-flags.patch
181 +)
182 +
183 +src_prepare() {
184 + default
185 +
186 + local sed_args=( -e "/libunrar/s:.so:$(get_libname ${PV%.*.*}):" )
187 + if [[ ${CHOST} == *-darwin* ]] ; then
188 + sed_args+=( -e "s:-shared:-dynamiclib -install_name ${EPREFIX}/usr/$(get_libdir)/libunrar$(get_libname ${PV%.*.*}):" )
189 + else
190 + sed_args+=( -e "s:-shared:& -Wl,-soname -Wl,libunrar$(get_libname ${PV%.*.*}):" )
191 + fi
192 + sed -i "${sed_args[@]}" makefile || die
193 +}
194 +
195 +src_configure() {
196 + mkdir -p build-{lib,bin}
197 + printf 'VPATH = ..\ninclude ../makefile' > build-lib/Makefile || die
198 + cp build-{lib,bin}/Makefile || die
199 +}
200 +
201 +src_compile() {
202 + unrar_make() {
203 + emake CXX="$(tc-getCXX)" CXXFLAGS="${CXXFLAGS}" STRIP=true "$@"
204 + }
205 +
206 + unrar_make CXXFLAGS+=" -fPIC" -C build-lib lib
207 + ln -s libunrar$(get_libname ${PV%.*.*}) build-lib/libunrar$(get_libname) || die
208 + ln -s libunrar$(get_libname ${PV%.*.*}) build-lib/libunrar$(get_libname ${PV}) || die
209 +
210 + unrar_make -C build-bin
211 +}
212 +
213 +src_install() {
214 + dobin build-bin/unrar
215 + dodoc readme.txt
216 +
217 + dolib.so build-lib/libunrar*
218 +
219 + insinto /usr/include/libunrar${PV%.*.*}
220 + doins *.hpp
221 + dosym libunrar${PV%.*.*} /usr/include/libunrar
222 +}