/[gentoo-x86]/media-video/projectx/projectx-0.91.0.04.ebuild
Gentoo

Contents of /media-video/projectx/projectx-0.91.0.04.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (hide annotations) (download)
Mon Oct 1 16:31:11 2012 UTC (7 months, 2 weeks ago) by billie
Branch: MAIN
Version bump.

(Portage version: 2.1.11.9/cvs/Linux i686)

1 billie 1.1 # Copyright 1999-2012 Gentoo Foundation
2     # Distributed under the terms of the GNU General Public License v2
3     # $Header: /var/cvsroot/gentoo-x86/media-video/projectx/projectx-0.91.0.03.ebuild,v 1.3 2012/09/23 08:05:06 phajdan.jr Exp $
4    
5     EAPI=4
6    
7     JAVA_PKG_IUSE="doc source"
8    
9     inherit eutils toolchain-funcs java-pkg-2 java-ant-2
10    
11     XDG_P="xdg-20100731"
12    
13     DESCRIPTION="Converts, splits and demuxes DVB and other MPEG recordings"
14     HOMEPAGE="http://project-x.sourceforge.net/"
15     SRC_URI="http://dev.gentoo.org/~billie/distfiles/${P}.tar.xz
16     http://sbriesen.de/gentoo/distfiles/${PN}-idctfast.tar.xz
17     http://sbriesen.de/gentoo/distfiles/${XDG_P}.java.xz
18     http://sbriesen.de/gentoo/distfiles/${PN}-icon.png"
19    
20     LICENSE="GPL-2"
21     SLOT="0"
22     KEYWORDS="~amd64 ~ppc ~ppc64 ~x86"
23     IUSE="X mmx sse"
24    
25     COMMON_DEP="dev-java/commons-net
26     X? ( =dev-java/browserlauncher2-1* )"
27    
28     RDEPEND=">=virtual/jre-1.5
29     ${COMMON_DEP}"
30    
31     DEPEND=">=virtual/jdk-1.5
32     app-arch/xz-utils
33     virtual/libiconv
34     ${COMMON_DEP}"
35    
36     S="${WORKDIR}/Project-X"
37    
38     mainclass() {
39     # read Main-Class from MANIFEST.MF
40     sed -n "s/^Main-Class: \([^ ]\+\).*/\1/p" "${S}/MANIFEST.MF" || die
41     }
42    
43     java_prepare() {
44     local X
45    
46     # apply stdout corruption patch (zzam@gentoo.org)
47     epatch "${FILESDIR}/${PN}-0.90.4.00_p33-stdout-corrupt.patch"
48    
49     # apply BrowserLauncher2 patch
50     use X && epatch "${FILESDIR}/${PN}-0.90.4.00_p33-bl2.patch"
51     rm -rf src/edu || die
52    
53     # apply IDCTFast patch
54     epatch "${FILESDIR}/${PN}-0.90.4.00_p33-idctfast.patch"
55    
56     # apply XDG patch
57     cp -f "${WORKDIR}/${XDG_P}.java" "${S}/src/xdg.java"
58     epatch "${FILESDIR}/${PN}-0.90.4.00_p33-xdg.patch"
59    
60     # copy build.xml
61     cp -f "${FILESDIR}/build-0.90.4.00_p33.xml" build.xml || die
62    
63     # patch executable and icon
64     sed -i -e "s:^\(Exec=\).*:\1${PN}_gui:g" \
65     -e "s:^\(Icon=\).*:\1${PN}:g" *.desktop || die
66    
67     # convert CRLF to LF
68     edos2unix *.txt MANIFEST.MF
69    
70     # convert docs to utf-8
71     if [ -x "$(type -p iconv)" ]; then
72     for X in zutun.txt; do
73     iconv -f LATIN1 -t UTF8 -o "${X}~" "${X}" && mv -f "${X}~" "${X}" || die
74     done
75     fi
76    
77     # merge/remove resources depending on USE="X"
78     if use X; then
79     mv -f htmls resources/ || die
80     else
81     rm -rf src/net/sourceforge/dvb/projectx/gui || die
82     rm resources/*.gif || die
83     fi
84    
85     # update library packages
86     cd lib
87     rm -f {commons-net,jakarta-oro}*.jar || die
88     java-pkg_jar-from commons-net
89     use X && java-pkg_jar-from browserlauncher2-1.0
90     java-pkg_ensure-no-bundled-jars
91     }
92    
93     src_compile() {
94     local IDCT="idct-mjpeg" # default IDCT implementation
95     if use x86 || use amd64; then
96     use mmx && IDCT="idct-mjpeg-mmx"
97     use sse && IDCT="idct-mjpeg-sse"
98     fi
99    
100     eant build $(use_doc) -Dmanifest.mainclass=$(mainclass)
101    
102     cd lib/PORTABLE
103     emake CC=$(tc-getCC) IDCT="${IDCT}" LDFLAGS="${LDFLAGS}" \
104     CPLAT="${CFLAGS} -O3 -ffast-math -fPIC"
105     }
106    
107     src_install() {
108     java-pkg_dojar dist/${PN}.jar
109     java-pkg_doso lib/PORTABLE/libidctfast.so
110    
111     java-pkg_dolauncher ${PN}_cli --main $(mainclass) \
112     --java_args "-Djava.awt.headless=true -Xmx256m"
113    
114     if use X; then
115     java-pkg_dolauncher ${PN}_gui --main $(mainclass) \
116     --java_args "-Xmx256m"
117     dosym ${PN}_gui /usr/bin/${PN}
118     newicon "${DISTDIR}/${PN}-icon.png" "${PN}.png"
119     domenu *.desktop
120     else
121     dosym ${PN}_cli /usr/bin/${PN}
122     fi
123    
124     dodoc *.txt
125     use doc && java-pkg_dojavadoc apidocs
126     use source && java-pkg_dosrc src
127     }
128    
129     pkg_postinst() {
130     elog "Default config file and location has changed!"
131     elog
132     elog "It is now located at \$XDG_CONFIG_HOME/Project-X.ini"
133     elog "You should move your old X.ini into the new location."
134     elog
135     elog "Hint: \$XDG_CONFIG_HOME defaults to ~/.config"
136     }

  ViewVC Help
Powered by ViewVC 1.1.13