Use https by default
[gentoo.git] / media-libs / libpostproc / libpostproc-9999.ebuild
1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI="5"
6
7 SCM=""
8 if [ "${PV#9999}" != "${PV}" ] ; then
9         SCM="git-2"
10         EGIT_REPO_URI="git://github.com/lu-zero/postproc.git"
11 fi
12
13 inherit eutils flag-o-matic multilib multilib-minimal toolchain-funcs ${SCM}
14
15 DESCRIPTION="Video post processing library"
16 HOMEPAGE="https://github.com/lu-zero/postproc"
17 if [ "${PV#9999}" != "${PV}" ] ; then
18         SRC_URI=""
19 elif [ "${PV%_p*}" != "${PV}" ] ; then # Snapshot
20         SRC_URI="mirror://gentoo/${P}.tar.xz"
21 else # Release
22         SRC_URI="https://dev.gentoo.org/~lu_zero/distfiles/${P}.tar.xz"
23 fi
24
25 LICENSE="GPL-2"
26 SLOT="0"
27 if [ "${PV#9999}" = "${PV}" ] ; then
28         KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux"
29 fi
30 IUSE="pic static-libs"
31
32 # String for CPU features in the useflag[:configure_option] form
33 # if :configure_option isn't set, it will use 'useflag' as configure option
34 CPU_FEATURES="cpu_flags_x86_3dnow:amd3dnow altivec cpu_flags_x86_mmx:mmx cpu_flags_x86_mmxext:mmxext"
35 for i in ${CPU_FEATURES}; do
36         IUSE="${IUSE} ${i%:*}"
37 done
38
39 RDEPEND="
40         >=media-video/libav-0.8.2-r2:0=
41         !media-video/ffmpeg:0
42         abi_x86_32? ( !<=app-emulation/emul-linux-x86-medialibs-20140508-r3
43                 !app-emulation/emul-linux-x86-medialibs[-abi_x86_32(-)] )
44 "
45 DEPEND="${RDEPEND}"
46
47 multilib_src_configure() {
48         local myconf=( ${EXTRA_LIBPOSTPROC_CONF} )
49         for i in $(get-flag march) $(get-flag mcpu) $(get-flag mtune) ; do
50                 [[ "${i}" = "native" ]] && i="host" # bug #273421
51                 myconf+=( --cpu=${i} )
52                 break
53         done
54
55         if use pic ; then
56                 myconf+=( --enable-pic )
57                 # disable asm code if PIC is required
58                 # as the provided asm decidedly is not PIC for x86.
59                 [[ ${ABI} == x86 ]] && myconf+=( --disable-asm )
60         fi
61
62         # cross compile support
63         if tc-is-cross-compiler ; then
64                 myconf+=( --enable-cross-compile --arch=$(tc-arch-kernel) --cross-prefix=${CHOST}- )
65                 case ${CHOST} in
66                         *freebsd*)
67                                 myconf+=( --target-os=freebsd )
68                                 ;;
69                         mingw32*)
70                                 myconf+=( --target-os=mingw32 )
71                                 ;;
72                         *linux*)
73                                 myconf+=( --target-os=linux )
74                                 ;;
75                 esac
76         fi
77
78         "${S}"/configure \
79                 --prefix="${EPREFIX}/usr" \
80                 --libdir="${EPREFIX}/usr/$(get_libdir)" \
81                 --shlibdir="${EPREFIX}/usr/$(get_libdir)" \
82                 --enable-shared \
83                 --cc="$(tc-getCC)" \
84                 --ar="$(tc-getAR)" \
85                 --optflags="${CFLAGS}" \
86                 --extra-cflags="${CFLAGS}" \
87                 $(use_enable static-libs static) \
88                 "${myconf[@]}" || die
89 }