summaryrefslogtreecommitdiff
blob: 1b591f16c3644bdd79dff4c3f713f3140faa6234 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=7

inherit autotools multilib-minimal

PATCHES=( "${FILESDIR}/${PN}-1.0.2-qtbindir.patch" )

if [[ ${PV} == "9999" ]] ; then
	EGIT_REPO_URI="https://github.com/strukturag/${PN}.git"
	inherit git-r3
else
	SRC_URI="https://github.com/strukturag/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
	KEYWORDS="~amd64 ~arm64 ~ppc64 ~x86"
fi

DESCRIPTION="Open h.265 video codec implementation"
HOMEPAGE="https://github.com/strukturag/libde265"

LICENSE="GPL-3"
SLOT="0"
IUSE="enc265 dec265 sdl tools debug static-libs cpu_flags_x86_sse4_1 cpu_flags_arm_neon cpu_flags_arm_thumb"
# IUSE+=" sherlock265" # Require libvideogfx or libswscale

RDEPEND="
	dec265? (
		sdl? ( media-libs/libsdl )
	)
"
# Sherlock265 require libvideogfx or libswscale
#RDEPEND+="
#	sherlock265? (
#		media-libs/libsdl
#		dev-qt/qtcore:5
#		dev-qt/qtgui:5
#		dev-qt/qtwidgets:5
#		media-libs/libswscale
#	)
#"

DEPEND="${RDEPEND}"

BDEPEND="dec265? ( virtual/pkgconfig )"

# Sherlock265 require libvideogfx or libswscale
#BDEPEND+=" sherlock265? ( virtual/pkgconfig )"

src_prepare() {
	default

	eautoreconf

	# without this, headers would be missing and make would fail
	multilib_copy_sources
}

multilib_src_configure() {
	local myeconfargs=(
		ax_cv_check_cflags___msse4_1=$(usex cpu_flags_x86_sse4_1)
		ax_cv_check_cflags___mfpu_neon=$(usex cpu_flags_arm_neon)
		$(use_enable cpu_flags_arm_thumb thumb)
		$(use_enable static-libs static)
		$(use_enable debug log-info)
		$(use_enable debug log-debug)
		$(use_enable debug log-trace)
		$(multilib_native_use_enable enc265 encoder)
		$(multilib_native_use_enable dec265)
		--enable-log-error
	)

	# myeconfargs+=( $(multilib_native_use_enable sherlock265) ) # Require libvideogfx or libswscale
	myeconfargs+=( --disable-sherlock265 )

	econf "${myeconfargs[@]}"
}

multilib_src_install() {
	default

	if multilib_is_native_abi; then
		# Remove useless, unready and test tools (Why package ever tried to install them??)
		rm -f "${ED}/usr/bin/"{tests,gen-enc-table,yuv-distortion} || die
		if ! use tools; then
			rm -f "${ED}/usr/bin/"{bjoentegaard,block-rate-estim,rd-curves} || die
			rm -f "${ED}/usr/bin/acceleration_speed" || die
		fi
	else
		# Remove all non-native binary tools
		rm -f "${ED}/usr/bin/"* || die
	fi
}

multilib_src_install_all() {
	find "${ED}" -name '*.la' -delete || die
	if ! use static-libs ; then
		find "${ED}" -name "*.a" -delete || die
	fi
}