/[gentoo-x86]/app-arch/p7zip/p7zip-9.20.1-r3.ebuild
Gentoo

Contents of /app-arch/p7zip/p7zip-9.20.1-r3.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Sat Jun 9 14:43:20 2012 UTC (2 years, 3 months ago) by jlec
Branch: MAIN
app-arch/p7zip: Drop -O -pipe from buildsystem, add -- to emake so that -l doesn't get confused by 7z* make targets, #420393

(Portage version: 2.2.0_alpha110/cvs/Linux x86_64)

1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/app-arch/p7zip/p7zip-9.20.1-r2.ebuild,v 1.2 2012/06/07 16:29:50 hasufell Exp $
4
5 EAPI=4
6
7 WX_GTK_VER="2.8"
8
9 inherit eutils multilib toolchain-funcs wxwidgets
10
11 DESCRIPTION="Port of 7-Zip archiver for Unix"
12 HOMEPAGE="http://p7zip.sourceforge.net/"
13 SRC_URI="mirror://sourceforge/${PN}/${PN}_${PV}_src_all.tar.bz2"
14
15 LICENSE="LGPL-2.1 rar? ( unRAR )"
16 SLOT="0"
17 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd ~x86-freebsd ~x86-interix ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris"
18 IUSE="doc kde rar +pch static wxwidgets"
19
20 REQUIRED_USE="kde? ( wxwidgets )"
21
22 RDEPEND="
23 kde? ( x11-libs/wxGTK:2.8[X,-odbc] kde-base/kdelibs )
24 wxwidgets? ( x11-libs/wxGTK:2.8[X,-odbc] )"
25 DEPEND="${RDEPEND}
26 amd64? ( dev-lang/yasm )
27 x86? ( dev-lang/nasm )"
28
29 S=${WORKDIR}/${PN}_${PV}
30
31 pkg_setup() {
32 use wxwidgets && wxwidgets_pkg_setup
33 }
34
35 src_prepare() {
36 epatch \
37 "${FILESDIR}"/${P}-execstack.patch \
38 "${FILESDIR}"/${P}-QA.patch
39
40 if ! use pch; then
41 sed "s:PRE_COMPILED_HEADER=StdAfx.h.gch:PRE_COMPILED_HEADER=:g" -i makefile.* || die
42 fi
43
44 sed \
45 -e 's:-m32 ::g' \
46 -e 's:-m64 ::g' \
47 -e 's:-O::g' \
48 -e 's:-pipe::g' \
49 -e "/^CC/s:\$(ALLFLAGS):${CFLAGS} \$(ALLFLAGS):g" \
50 -e "/^CXX/s:\$(ALLFLAGS):${CXXFLAGS} \$(ALLFLAGS):g" \
51 -i makefile* || die
52
53 # remove non-free RAR codec
54 if use rar; then
55 ewarn "Enabling nonfree RAR decompressor"
56 else
57 sed -e '/Rar/d' -i makefile* || die
58 rm -rf CPP/7zip/Compress/Rar || die
59 epatch "${FILESDIR}"/9.04-makefile.patch
60 fi
61
62 sed -i \
63 -e "/^CXX=/s:g++:$(tc-getCXX):" \
64 -e "/^CC=/s:gcc:$(tc-getCC):" \
65 -e '/ALLFLAGS/s:-s ::' \
66 makefile* || die "changing makefiles"
67
68 if use amd64; then
69 cp -f makefile.linux_amd64_asm makefile.machine || die
70 elif use x86; then
71 cp -f makefile.linux_x86_asm_gcc_4.X makefile.machine || die
72 elif [[ ${CHOST} == *-darwin* ]] ; then
73 # Mac OS X needs this special makefile, because it has a non-GNU linker
74 [[ ${CHOST} == *64-* ]] \
75 && cp -f makefile.macosx_64bits makefile.machine \
76 || cp -f makefile.macosx_32bits makefile.machine
77 # bundles have extension .bundle but don't die because USE=-rar
78 # removes the Rar directory
79 sed -i -e '/strcpy(name/s/\.so/.bundle/' \
80 CPP/Windows/DLL.cpp || die
81 sed -i -e '/^PROG=/s/\.so/.bundle/' \
82 CPP/7zip/Bundles/Format7zFree/makefile \
83 $(use rar && echo CPP/7zip/Compress/Rar/makefile) || die
84 elif use x86-fbsd; then
85 # FreeBSD needs this special makefile, because it hasn't -ldl
86 sed -e 's/-lc_r/-pthread/' makefile.freebsd > makefile.machine
87 fi
88
89 use static && sed -i -e '/^LOCAL_LIBS=/s/LOCAL_LIBS=/&-static /' makefile.machine
90
91 if use kde || use wxwidgets; then
92 einfo "Preparing dependency list"
93 emake depend
94 fi
95 }
96
97 src_compile() {
98 emake all3
99 if use kde || use wxwidgets; then
100 emake -- 7zG
101 emake -- 7zFM
102 fi
103 }
104
105 src_test() {
106 emake test test_7z test_7zr
107 }
108
109 src_install() {
110 # this wrappers can not be symlinks, p7zip should be called with full path
111 make_wrapper 7zr "/usr/$(get_libdir)/${PN}/7zr"
112 make_wrapper 7za "/usr/$(get_libdir)/${PN}/7za"
113 make_wrapper 7z "/usr/$(get_libdir)/${PN}/7z"
114
115 if use kde || use wxwidgets; then
116 make_wrapper 7zG "/usr/$(get_libdir)/${PN}/7zG"
117 make_wrapper 7zFM "/usr/$(get_libdir)/${PN}/7zFM"
118
119 make_desktop_entry 7zFM "${PN} FM" "GTK;Utility;Archiving;Compression"
120 make_desktop_entry 7zG "${PN} GUI" "GTK;Utility;Archiving;Compression"
121
122 dobin GUI/p7zipForFilemanager
123 exeinto /usr/$(get_libdir)/${PN}
124 doexe bin/7z{G,FM}
125
126 insinto /usr/$(get_libdir)/${PN}
127 doins -r GUI/{Lang,help}
128
129 insinto /usr/share/icons/hicolor/16x16/apps/
130 newins GUI/p7zip_16_ok.png p7zip.png
131
132 if use kde; then
133
134 rm GUI/kde4/p7zip_compress.desktop
135 insinto /usr/share/kde4/services/ServiceMenus
136 doins GUI/kde4/*.desktop
137 fi
138 fi
139
140 dobin contrib/gzip-like_CLI_wrapper_for_7z/p7zip
141 doman contrib/gzip-like_CLI_wrapper_for_7z/man1/p7zip.1
142
143 exeinto /usr/$(get_libdir)/${PN}
144 doexe bin/7z bin/7za bin/7zr bin/7zCon.sfx
145 doexe bin/*$(get_modname)
146 if use rar; then
147 exeinto /usr/$(get_libdir)/${PN}/Codecs/
148 doexe bin/Codecs/*$(get_modname)
149 fi
150
151 doman man1/7z.1 man1/7za.1 man1/7zr.1
152 dodoc ChangeLog README TODO
153
154 if use doc; then
155 dodoc DOCS/*.txt
156 dohtml -r DOCS/MANUAL/*
157 fi
158 }

  ViewVC Help
Powered by ViewVC 1.1.20