Use https by default
[gentoo.git] / media-libs / libpostproc / libpostproc-0.8.0.20121125.ebuild
1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI="4"
6
7 SCM=""
8 if [ "${PV#9999}" != "${PV}" ] ; then
9         SCM="git-2"
10         EGIT_REPO_URI="git://github.com/dwbuiten/postproc.git"
11 fi
12
13 inherit eutils flag-o-matic multilib toolchain-funcs ${SCM}
14
15 DESCRIPTION="Video post processing library"
16 HOMEPAGE="https://github.com/dwbuiten/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 DEPEND=">=virtual/ffmpeg-0.10.2-r1"
40 RDEPEND="${DEPEND}
41         !<media-video/libav-0.8.2-r2
42         !media-video/ffmpeg:0
43 "
44
45 src_configure() {
46         local myconf="${EXTRA_LIBPOSTPROC_CONF}"
47         for i in $(get-flag march) $(get-flag mcpu) $(get-flag mtune) ; do
48                 [ "${i}" = "native" ] && i="host" # bug #273421
49                 myconf="${myconf} --cpu=${i}"
50                 break
51         done
52
53         if use pic ; then
54                 myconf="${myconf} --enable-pic"
55                 # disable asm code if PIC is required
56                 # as the provided asm decidedly is not PIC for x86.
57                 use x86 && myconf="${myconf} --disable-asm"
58         fi
59
60         # cross compile support
61         if tc-is-cross-compiler ; then
62                 myconf="${myconf} --enable-cross-compile --arch=$(tc-arch-kernel) --cross-prefix=${CHOST}-"
63                 case ${CHOST} in
64                         *freebsd*)
65                                 myconf="${myconf} --target-os=freebsd"
66                                 ;;
67                         mingw32*)
68                                 myconf="${myconf} --target-os=mingw32"
69                                 ;;
70                         *linux*)
71                                 myconf="${myconf} --target-os=linux"
72                                 ;;
73                 esac
74         fi
75
76         cd "${S}"
77         ./configure \
78                 --prefix="${EPREFIX}/usr" \
79                 --libdir="${EPREFIX}/usr/$(get_libdir)" \
80                 --shlibdir="${EPREFIX}/usr/$(get_libdir)" \
81                 --enable-shared \
82                 --cc="$(tc-getCC)" \
83                 --ar="$(tc-getAR)" \
84                 --optflags="${CFLAGS}" \
85                 --extra-cflags="${CFLAGS}" \
86                 $(use_enable static-libs static) \
87                 ${myconf} || die
88 }