summaryrefslogtreecommitdiff
blob: 4e916bbb2f488c4604dc8a72830b1e23ae1c748f (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
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit flag-o-matic toolchain-funcs

DESCRIPTION="mkclean is a command line tool to clean and optimize Matroska files"
HOMEPAGE="https://www.matroska.org/downloads/mkclean.html"
SRC_URI="https://downloads.sourceforge.net/project/matroska/${PN}/${P}.tar.bz2"

LICENSE="BSD"
SLOT="0"
KEYWORDS="~amd64 ~x86"

src_configure() {
	# -Werror=strict-aliasing
	# https://bugs.gentoo.org/861134
	# https://github.com/Matroska-Org/foundation-source/issues/145
	#
	# Do not trust with LTO either.
	append-flags -fno-strict-aliasing
	filter-lto

	tc-export CC CXX

	emake -C corec/tools/coremake
	mv corec/tools/coremake/coremake . || die

	./coremake $(corec/tools/coremake/system_output.sh) || die

	# fixing generated makefiles
	local f
	while IFS="" read -d $'\0' -r f; do
		sed \
			-e 's|^\(LFLAGS.*+=.*\$(LIBS)\)|\1 \$(LDFLAGS)|g' \
			-e 's|^\(STRIP.*=\)|\1 echo|g' \
			-i "${f}" || die
	done < <(find -name "*.mak" -type f -print0)
}

src_compile() {
	emake -f GNUmakefile -j1
	emake -C mkclean -f mkWDclean.mak -j1
	emake -C mkclean/regression -f mkcleanreg.mak -j1
}

src_install() {
	dobin release/*/mk*clean*
	newdoc ChangeLog.txt ChangeLog
	newdoc ReadMe.txt README
}