1 |
commit: 011921ef714adf03acb30a5be54c3dd7b8b9e208 |
2 |
Author: Denis Pronin <dannftk <AT> yandex <DOT> ru> |
3 |
AuthorDate: Thu Jan 23 06:30:29 2020 +0000 |
4 |
Commit: Matthew Thode <prometheanfire <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Jan 23 17:09:29 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=011921ef |
7 |
|
8 |
app-arch/p7zip: it is now possible to compile with clang and c++17 |
9 |
|
10 |
Signed-off-by: Denis Pronin <dannftk <AT> yandex.ru> |
11 |
Package-Manager: Portage-2.3.84, Repoman-2.3.20 |
12 |
Signed-off-by: Matthew Thode <prometheanfire <AT> gentoo.org> |
13 |
|
14 |
app-arch/p7zip/files/WimHandler.cpp.patch | 11 ++ |
15 |
app-arch/p7zip/p7zip-16.02-r5.ebuild | 167 ++++++++++++++++++++++++++++++ |
16 |
2 files changed, 178 insertions(+) |
17 |
|
18 |
diff --git a/app-arch/p7zip/files/WimHandler.cpp.patch b/app-arch/p7zip/files/WimHandler.cpp.patch |
19 |
new file mode 100644 |
20 |
index 00000000000..db7d73a2b94 |
21 |
--- /dev/null |
22 |
+++ b/app-arch/p7zip/files/WimHandler.cpp.patch |
23 |
@@ -0,0 +1,11 @@ |
24 |
+--- ./CPP/7zip/Archive/Wim/WimHandler.cpp 2016-06-11 11:08:06.000000000 +0300 |
25 |
++++ ./CPP/7zip/Archive/Wim/WimHandler.cpp.new 2020-01-22 09:36:59.671803569 +0300 |
26 |
+@@ -298,7 +298,7 @@ STDMETHODIMP CHandler::GetArchivePropert |
27 |
+ |
28 |
+ AString res; |
29 |
+ |
30 |
+- bool numMethods = 0; |
31 |
++ int numMethods = 0; |
32 |
+ for (unsigned i = 0; i < ARRAY_SIZE(k_Methods); i++) |
33 |
+ { |
34 |
+ if (methodMask & ((UInt32)1 << i)) |
35 |
|
36 |
diff --git a/app-arch/p7zip/p7zip-16.02-r5.ebuild b/app-arch/p7zip/p7zip-16.02-r5.ebuild |
37 |
new file mode 100644 |
38 |
index 00000000000..4c56f6b4da6 |
39 |
--- /dev/null |
40 |
+++ b/app-arch/p7zip/p7zip-16.02-r5.ebuild |
41 |
@@ -0,0 +1,167 @@ |
42 |
+# Copyright 1999-2020 Gentoo Authors |
43 |
+# Distributed under the terms of the GNU General Public License v2 |
44 |
+ |
45 |
+EAPI=6 |
46 |
+ |
47 |
+WX_GTK_VER="3.0" |
48 |
+ |
49 |
+inherit toolchain-funcs wxwidgets |
50 |
+ |
51 |
+DESCRIPTION="Port of 7-Zip archiver for Unix" |
52 |
+HOMEPAGE="http://p7zip.sourceforge.net/" |
53 |
+SRC_URI="mirror://sourceforge/${PN}/${PN}_${PV}_src_all.tar.bz2" |
54 |
+ |
55 |
+LICENSE="LGPL-2.1 rar? ( unRAR )" |
56 |
+SLOT="0" |
57 |
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris" |
58 |
+IUSE="abi_x86_x32 doc kde +pch rar static wxwidgets" |
59 |
+ |
60 |
+REQUIRED_USE="kde? ( wxwidgets )" |
61 |
+ |
62 |
+RDEPEND="wxwidgets? ( x11-libs/wxGTK:${WX_GTK_VER}[X] )" |
63 |
+DEPEND="${RDEPEND} |
64 |
+ abi_x86_x32? ( >=dev-lang/yasm-1.2.0-r1 ) |
65 |
+ amd64? ( dev-lang/yasm ) |
66 |
+ x86? ( dev-lang/nasm )" |
67 |
+ |
68 |
+S=${WORKDIR}/${PN}_${PV} |
69 |
+ |
70 |
+DOCS=( ChangeLog README TODO ) |
71 |
+ |
72 |
+PATCHES=( |
73 |
+ "${FILESDIR}"/${P}-darwin.patch |
74 |
+ "${FILESDIR}"/CVE-2016-9296.patch |
75 |
+ "${FILESDIR}"/CVE-2017-17969.patch |
76 |
+ "${FILESDIR}"/CVE-2018-5996.patch |
77 |
+ "${FILESDIR}"/CVE-2018-10115.patch |
78 |
+ "${FILESDIR}"/WimHandler.cpp.patch |
79 |
+) |
80 |
+ |
81 |
+src_prepare() { |
82 |
+ default |
83 |
+ |
84 |
+ if ! use pch; then |
85 |
+ sed "s:PRE_COMPILED_HEADER=StdAfx.h.gch:PRE_COMPILED_HEADER=:g" -i makefile.* || die |
86 |
+ fi |
87 |
+ |
88 |
+ sed \ |
89 |
+ -e 's|-m32 ||g' \ |
90 |
+ -e 's|-m64 ||g' \ |
91 |
+ -e 's|-pipe||g' \ |
92 |
+ -e "/[ALL|OPT]FLAGS/s|-s||;/OPTIMIZE/s|-s||" \ |
93 |
+ -e "/CFLAGS=/s|=|+=|" \ |
94 |
+ -e "/CXXFLAGS=/s|=|+=|" \ |
95 |
+ -i makefile* || die |
96 |
+ |
97 |
+ # remove non-free RAR codec |
98 |
+ if use rar; then |
99 |
+ ewarn "Enabling nonfree RAR decompressor" |
100 |
+ else |
101 |
+ sed \ |
102 |
+ -e '/Rar/d' \ |
103 |
+ -e '/RAR/d' \ |
104 |
+ -i makefile* CPP/7zip/Bundles/Format7zFree/makefile || die |
105 |
+ rm -rf CPP/7zip/Compress/Rar || die |
106 |
+ fi |
107 |
+ |
108 |
+ if use abi_x86_x32; then |
109 |
+ sed -i -e "/^ASM=/s:amd64:x32:" makefile* || die |
110 |
+ cp -f makefile.linux_amd64_asm makefile.machine || die |
111 |
+ elif use amd64; then |
112 |
+ cp -f makefile.linux_amd64_asm makefile.machine || die |
113 |
+ elif use x86; then |
114 |
+ cp -f makefile.linux_x86_asm_gcc_4.X makefile.machine || die |
115 |
+ elif [[ ${CHOST} == *-darwin* ]] ; then |
116 |
+ # Mac OS X needs this special makefile, because it has a non-GNU |
117 |
+ # linker, it doesn't matter so much for bitwidth, for it doesn't |
118 |
+ # do anything with it |
119 |
+ cp -f makefile.macosx_llvm_64bits makefile.machine |
120 |
+ # bundles have extension .bundle but don't die because USE=-rar |
121 |
+ # removes the Rar directory |
122 |
+ sed -i -e '/strcpy(name/s/\.so/.bundle/' \ |
123 |
+ CPP/Windows/DLL.cpp || die |
124 |
+ sed -i -e '/^PROG=/s/\.so/.bundle/' \ |
125 |
+ CPP/7zip/Bundles/Format7zFree/makefile.list \ |
126 |
+ $(use rar && echo CPP/7zip/Compress/Rar/makefile.list) || die |
127 |
+ elif use x86-fbsd; then |
128 |
+ # FreeBSD needs this special makefile, because it hasn't -ldl |
129 |
+ sed -e 's/-lc_r/-pthread/' makefile.freebsd > makefile.machine |
130 |
+ fi |
131 |
+ |
132 |
+ if use static; then |
133 |
+ sed -i -e '/^LOCAL_LIBS=/s/LOCAL_LIBS=/&-static /' makefile.machine || die |
134 |
+ fi |
135 |
+ |
136 |
+ if use kde || use wxwidgets; then |
137 |
+ need-wxwidgets unicode |
138 |
+ einfo "Preparing dependency list" |
139 |
+ emake CC=$(tc-getCC) CXX=$(tc-getCXX) depend |
140 |
+ fi |
141 |
+} |
142 |
+ |
143 |
+src_compile() { |
144 |
+ emake CC=$(tc-getCC) CXX=$(tc-getCXX) all3 |
145 |
+ if use kde || use wxwidgets; then |
146 |
+ emake CC=$(tc-getCC) CXX=$(tc-getCXX) -- 7zG |
147 |
+# emake CC=$(tc-getCC) CXX=$(tc-getCXX) -- 7zFM |
148 |
+ fi |
149 |
+} |
150 |
+ |
151 |
+src_test() { |
152 |
+ emake test test_7z test_7zr |
153 |
+} |
154 |
+ |
155 |
+src_install() { |
156 |
+ # this wrappers can not be symlinks, p7zip should be called with full path |
157 |
+ make_wrapper 7zr "/usr/$(get_libdir)/${PN}/7zr" |
158 |
+ make_wrapper 7za "/usr/$(get_libdir)/${PN}/7za" |
159 |
+ make_wrapper 7z "/usr/$(get_libdir)/${PN}/7z" |
160 |
+ |
161 |
+ if use kde || use wxwidgets; then |
162 |
+ make_wrapper 7zG "/usr/$(get_libdir)/${PN}/7zG" |
163 |
+# make_wrapper 7zFM "/usr/$(get_libdir)/${PN}/7zFM" |
164 |
+ |
165 |
+# make_desktop_entry 7zFM "${PN} FM" ${PN} "GTK;Utility;Archiving;Compression" |
166 |
+ |
167 |
+ dobin GUI/p7zipForFilemanager |
168 |
+ exeinto /usr/$(get_libdir)/${PN} |
169 |
+# doexe bin/7z{G,FM} |
170 |
+ doexe bin/7zG |
171 |
+ |
172 |
+ insinto /usr/$(get_libdir)/${PN} |
173 |
+ doins -r GUI/Lang |
174 |
+ doins -r DOC/MANUAL |
175 |
+ |
176 |
+ insinto /usr/share/icons/hicolor/16x16/apps/ |
177 |
+ newins GUI/p7zip_16_ok.png p7zip.png |
178 |
+ |
179 |
+ if use kde; then |
180 |
+ rm GUI/kde4/p7zip_compress.desktop || die |
181 |
+ insinto /usr/share/kservices5/ServiceMenus |
182 |
+ doins GUI/kde4/*.desktop |
183 |
+ dodir /usr/share/kde4/services/ServiceMenus # drop these lines after konqueror:4/krusader:4 are gone |
184 |
+ for item in "${ED}"usr/share/kservices5/ServiceMenus/*.desktop; do |
185 |
+ item="$(basename ${item})" |
186 |
+ dosym "/usr/share/kservices5/ServiceMenus/${item}" "/usr/share/kde4/services/ServiceMenus/${item}" |
187 |
+ done |
188 |
+ fi |
189 |
+ fi |
190 |
+ |
191 |
+ dobin contrib/gzip-like_CLI_wrapper_for_7z/p7zip |
192 |
+ doman contrib/gzip-like_CLI_wrapper_for_7z/man1/p7zip.1 |
193 |
+ |
194 |
+ exeinto /usr/$(get_libdir)/${PN} |
195 |
+ doexe bin/7z bin/7za bin/7zr bin/7zCon.sfx |
196 |
+ doexe bin/*$(get_modname) |
197 |
+ if use rar; then |
198 |
+ exeinto /usr/$(get_libdir)/${PN}/Codecs/ |
199 |
+ doexe bin/Codecs/*$(get_modname) |
200 |
+ fi |
201 |
+ |
202 |
+ doman man1/7z.1 man1/7za.1 man1/7zr.1 |
203 |
+ |
204 |
+ if use doc; then |
205 |
+ dodoc DOC/*.txt |
206 |
+ dohtml -r DOC/MANUAL/* |
207 |
+ fi |
208 |
+} |