diff options
author | Michael Weber <xmw@gentoo.org> | 2013-06-08 14:23:15 +0000 |
---|---|---|
committer | Michael Weber <xmw@gentoo.org> | 2013-06-08 14:23:15 +0000 |
commit | 0045681d4d0f8175a7aab80f73688a1a5638c4ef (patch) | |
tree | e7b00b64b69f79f3575fd8c78566be68f4d87199 /app-text/llpp | |
parent | Stable for HPPA (bug #472564). (diff) | |
download | gentoo-2-0045681d4d0f8175a7aab80f73688a1a5638c4ef.tar.gz gentoo-2-0045681d4d0f8175a7aab80f73688a1a5638c4ef.tar.bz2 gentoo-2-0045681d4d0f8175a7aab80f73688a1a5638c4ef.zip |
USE=static and USE=ocamlopt
(Portage version: 2.2.0_alpha177/cvs/Linux x86_64, signed Manifest commit with key 62EEF090)
Diffstat (limited to 'app-text/llpp')
-rw-r--r-- | app-text/llpp/files/llpp-9999-mupdf_trailer.patch (renamed from app-text/llpp/files/llpp-9999-mupdf-trailer.patch) | 0 | ||||
-rw-r--r-- | app-text/llpp/llpp-15.ebuild | 72 | ||||
-rw-r--r-- | app-text/llpp/llpp-9999.ebuild | 77 |
3 files changed, 87 insertions, 62 deletions
diff --git a/app-text/llpp/files/llpp-9999-mupdf-trailer.patch b/app-text/llpp/files/llpp-9999-mupdf_trailer.patch index b119aa437f15..b119aa437f15 100644 --- a/app-text/llpp/files/llpp-9999-mupdf-trailer.patch +++ b/app-text/llpp/files/llpp-9999-mupdf_trailer.patch diff --git a/app-text/llpp/llpp-15.ebuild b/app-text/llpp/llpp-15.ebuild index f3c41c8eb452..f2512d81dad1 100644 --- a/app-text/llpp/llpp-15.ebuild +++ b/app-text/llpp/llpp-15.ebuild @@ -1,8 +1,8 @@ # Copyright 1999-2013 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/app-text/llpp/llpp-15.ebuild,v 1.3 2013/06/07 00:14:24 xmw Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-text/llpp/llpp-15.ebuild,v 1.4 2013/06/08 14:23:15 xmw Exp $ -EAPI=4 +EAPI=5 inherit eutils toolchain-funcs vcs-snapshot @@ -13,40 +13,54 @@ SRC_URI="mirror://gentoo/${P}.tar.gz" LICENSE="GPL-3" SLOT="0" KEYWORDS="~amd64 ~ppc ~x86" -IUSE="" - -RDEPEND="media-libs/freetype - media-libs/jbig2dec - media-libs/openjpeg:0 - virtual/jpeg - x11-libs/libX11 - x11-misc/xsel" +IUSE="+ocamlopt static" + +LIB_DEPEND=">=app-text/mupdf-1.2:=[static-libs] + <=app-text/mupdf-9999[static-libs] + media-libs/openjpeg:0[static-libs] + media-libs/freetype:2[static-libs] + media-libs/jbig2dec[static-libs] + sys-libs/zlib[static-libs] + virtual/jpeg:0[static-libs] + x11-libs/libX11[static-libs]" +RDEPEND="x11-misc/xsel + !static? ( ${LIB_DEPEND//\[static-libs]} )" DEPEND="${RDEPEND} - >=app-text/mupdf-1.2 - dev-lang/ocaml[ocamlopt] - dev-ml/lablgl[glut]" + static? ( ${LIB_DEPEND} ) + dev-lang/ocaml[ocamlopt?] + dev-ml/lablgl[glut,ocamlopt?]" + +RESTRICT="!ocamlopt? ( strip )" src_prepare() { epatch "${FILESDIR}"/${PN}-11-WM_CLASS.patch } src_compile() { - ocaml str.cma keystoml.ml KEYS > help.ml || die - printf 'let version ="%s";;\n' ${PV} >> help.ml || die - - local myccopt="$(freetype-config --cflags) -O -include ft2build.h -D_GNU_SOURCE" - local mycclib="-lfitz -lz -ljpeg -lopenjpeg -ljbig2dec -lfreetype -lX11 -lpthread" - ocamlopt.opt -c -o link.o -ccopt "${myccopt}" link.c || die - ocamlopt.opt -c -o help.cmx help.ml || die - ocamlopt.opt -c -o utils.cmx utils.ml || die - ocamlopt.opt -c -o wsi.cmi wsi.mli || die - ocamlopt.opt -c -o wsi.cmx wsi.ml || die - ocamlopt.opt -c -o parser.cmx parser.ml || die - ocamlopt.opt -c -o main.cmx -I +lablGL main.ml || die - ocamlopt.opt -o llpp -I +lablGL \ - str.cmxa unix.cmxa lablgl.cmxa link.o \ - -cclib "${mycclib}" help.cmx utils.cmx parser.cmx wsi.cmx main.cmx \ - || die + local ocaml=$(usex ocamlopt ocamlopt.opt ocamlc.opt) + local cmo=$(usex ocamlopt cmx cmo) + local cma=$(usex ocamlopt cmxa cma) + local ccopt="$(freetype-config --cflags ) -O -include ft2build.h -D_GNU_SOURCE" + if use static ; then + local cclib="-Wl,-Bstatic $($(tc-getPKG_CONFIG) --libs --static mupdf x11 | sed 's: -l\(m\|pthread\) : :g') -Wl,-Bdynamic -lm -lpthread" + else + local cclib="$($(tc-getPKG_CONFIG) --libs mupdf x11 freetype2 libopenjpeg1) -ljbig2dec -ljpeg" + fi + + verbose() { echo "$@" >&2 ; "$@" || die ; } + verbose ocaml str.cma keystoml.ml KEYS > help.ml + verbose printf 'let version ="%s";;\n' ${PV} >> help.ml + verbose ${ocaml} -c -o link.o -ccopt "${ccopt}" link.c + verbose ${ocaml} -c -o help.${cmo} help.ml + verbose ${ocaml} -c -o utils.${cmo} utils.ml + verbose ${ocaml} -c -o wsi.cmi wsi.mli + verbose ${ocaml} -c -o wsi.${cmo} wsi.ml + verbose ${ocaml} -c -o parser.${cmo} parser.ml + verbose ${ocaml} -c -o main.${cmo} -I +lablGL main.ml + verbose ${ocaml} $(usex ocamlopt "" -custom) -o llpp -I +lablGL\ + str.${cma} unix.${cma} lablgl.${cma} link.o \ + -cclib "${cclib}" \ + help.${cmo} utils.${cmo} parser.${cmo} wsi.${cmo} main.${cmo} } src_install() { diff --git a/app-text/llpp/llpp-9999.ebuild b/app-text/llpp/llpp-9999.ebuild index 24505face132..023e81407e07 100644 --- a/app-text/llpp/llpp-9999.ebuild +++ b/app-text/llpp/llpp-9999.ebuild @@ -1,55 +1,66 @@ # Copyright 1999-2013 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/app-text/llpp/llpp-9999.ebuild,v 1.18 2013/06/06 23:08:04 xmw Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-text/llpp/llpp-9999.ebuild,v 1.19 2013/06/08 14:23:15 xmw Exp $ -EAPI=4 - -EGIT_REPO_URI="git://repo.or.cz/llpp.git" +EAPI=5 inherit eutils git-2 toolchain-funcs DESCRIPTION="a graphical PDF viewer which aims to superficially resemble less(1)" HOMEPAGE="http://repo.or.cz/w/llpp.git" -SRC_URI="" +EGIT_REPO_URI="git://repo.or.cz/llpp.git" LICENSE="GPL-3" SLOT="0" KEYWORDS="" -IUSE="" - -RDEPEND="media-libs/freetype - media-libs/jbig2dec - media-libs/openjpeg:2 - virtual/jpeg - x11-libs/libX11 - x11-misc/xsel" +IUSE="+ocamlopt static" + +LIB_DEPEND=">=app-text/mupdf-9999:=[static-libs] + media-libs/openjpeg:0[static-libs] + media-libs/freetype:2[static-libs] + media-libs/jbig2dec[static-libs] + sys-libs/zlib[static-libs] + virtual/jpeg:0[static-libs] + x11-libs/libX11[static-libs]" +RDEPEND="x11-misc/xsel + !static? ( ${LIB_DEPEND//\[static-libs]} )" DEPEND="${RDEPEND} - =app-text/mupdf-9999 - dev-lang/ocaml[ocamlopt] - dev-ml/lablgl[glut]" + static? ( ${LIB_DEPEND} ) + dev-lang/ocaml[ocamlopt?] + dev-ml/lablgl[glut,ocamlopt?]" + +RESTRICT="!ocamlopt? ( strip )" src_prepare() { epatch "${FILESDIR}"/${PN}-11-WM_CLASS.patch \ - "${FILESDIR}"/${P}-mupdf-trailer.patch + "${FILESDIR}"/${P}-mupdf_trailer.patch } src_compile() { - ocaml str.cma keystoml.ml KEYS > help.ml || die - printf 'let version ="%s";;\n' $(git describe --tags --dirty) >> help.ml || die - - local myccopt="$(freetype-config --cflags) -O -include ft2build.h -D_GNU_SOURCE" - local mycclib="-lfitz -lz -ljpeg -lopenjp2 -ljbig2dec -lfreetype -lX11 -lpthread" - ocamlopt.opt -c -o link.o -ccopt "${myccopt}" link.c || die - ocamlopt.opt -c -o help.cmx help.ml || die - ocamlopt.opt -c -o utils.cmx utils.ml || die - ocamlopt.opt -c -o wsi.cmi wsi.mli || die - ocamlopt.opt -c -o wsi.cmx wsi.ml || die - ocamlopt.opt -c -o parser.cmx parser.ml || die - ocamlopt.opt -c -o main.cmx -I +lablGL main.ml || die - ocamlopt.opt -o llpp -I +lablGL \ - str.cmxa unix.cmxa lablgl.cmxa link.o \ - -cclib "${mycclib}" help.cmx utils.cmx parser.cmx wsi.cmx main.cmx \ - || die + local ocaml=$(usex ocamlopt ocamlopt.opt ocamlc.opt) + local cmo=$(usex ocamlopt cmx cmo) + local cma=$(usex ocamlopt cmxa cma) + local ccopt="$(freetype-config --cflags ) -O -include ft2build.h -D_GNU_SOURCE" + if use static ; then + local cclib="-Wl,-Bstatic $($(tc-getPKG_CONFIG) --libs --static mupdf x11 | sed 's: -l\(m\|pthread\) : :g') -Wl,-Bdynamic -lm -lpthread" + else + local cclib="$($(tc-getPKG_CONFIG) --libs mupdf x11 freetype2 libopenjpeg1) -ljbig2dec -ljpeg" + fi + + verbose() { echo "$@" >&2 ; "$@" || die ; } + verbose ocaml str.cma keystoml.ml KEYS > help.ml + verbose printf 'let version ="%s";;\n' ${PV} >> help.ml + verbose ${ocaml} -c -o link.o -ccopt "${ccopt}" link.c + verbose ${ocaml} -c -o help.${cmo} help.ml + verbose ${ocaml} -c -o utils.${cmo} utils.ml + verbose ${ocaml} -c -o wsi.cmi wsi.mli + verbose ${ocaml} -c -o wsi.${cmo} wsi.ml + verbose ${ocaml} -c -o parser.${cmo} parser.ml + verbose ${ocaml} -c -o main.${cmo} -I +lablGL main.ml + verbose ${ocaml} $(usex ocamlopt "" -custom) -o llpp -I +lablGL\ + str.${cma} unix.${cma} lablgl.${cma} link.o \ + -cclib "${cclib}" \ + help.${cmo} utils.${cmo} parser.${cmo} wsi.${cmo} main.${cmo} } src_install() { |