Gentoo Archives: gentoo-commits

From: Lars Wendler <polynomial-c@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: media-sound/mpg123/
Date: Fri, 02 Jul 2021 16:00:09
Message-Id: 1625241598.7c420b37e34e0871406be446b7d1f60307b57465.polynomial-c@gentoo
1 commit: 7c420b37e34e0871406be446b7d1f60307b57465
2 Author: David Michael <fedora.dm0 <AT> gmail <DOT> com>
3 AuthorDate: Sun Jun 13 23:45:43 2021 +0000
4 Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
5 CommitDate: Fri Jul 2 15:59:58 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7c420b37
7
8 media-sound/mpg123: EAPI 8
9
10 Closes: https://bugs.gentoo.org/795870
11 Package-Manager: Portage-3.0.20, Repoman-3.0.2
12 Signed-off-by: David Michael <fedora.dm0 <AT> gmail.com>
13 Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>
14
15 media-sound/mpg123/mpg123-1.28.0-r1.ebuild | 105 +++++++++++++++++++++++++++++
16 1 file changed, 105 insertions(+)
17
18 diff --git a/media-sound/mpg123/mpg123-1.28.0-r1.ebuild b/media-sound/mpg123/mpg123-1.28.0-r1.ebuild
19 new file mode 100644
20 index 00000000000..9d14cfb3dbb
21 --- /dev/null
22 +++ b/media-sound/mpg123/mpg123-1.28.0-r1.ebuild
23 @@ -0,0 +1,105 @@
24 +# Copyright 1999-2021 Gentoo Authors
25 +# Distributed under the terms of the GNU General Public License v2
26 +
27 +EAPI=8
28 +
29 +inherit flag-o-matic toolchain-funcs libtool multilib-minimal
30 +
31 +DESCRIPTION="a realtime MPEG 1.0/2.0/2.5 audio player for layers 1, 2 and 3"
32 +HOMEPAGE="https://www.mpg123.org/"
33 +SRC_URI="https://www.mpg123.org/download/${P}.tar.bz2"
34 +
35 +LICENSE="GPL-2 LGPL-2.1"
36 +SLOT="0"
37 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~x86-solaris"
38 +IUSE="cpu_flags_x86_3dnow cpu_flags_x86_3dnowext cpu_flags_ppc_altivec alsa coreaudio int-quality ipv6 jack cpu_flags_x86_mmx nas oss portaudio pulseaudio sdl cpu_flags_x86_sse"
39 +
40 +# No MULTILIB_USEDEP here since we only build libmpg123 for non native ABIs.
41 +RDEPEND="
42 + dev-libs/libltdl:0
43 + alsa? ( media-libs/alsa-lib )
44 + jack? ( virtual/jack )
45 + nas? ( media-libs/nas )
46 + portaudio? ( media-libs/portaudio )
47 + pulseaudio? ( media-sound/pulseaudio )
48 + sdl? ( media-libs/libsdl )"
49 +DEPEND="${RDEPEND}"
50 +BDEPEND="
51 + sys-devel/libtool
52 + virtual/pkgconfig
53 +"
54 +IDEPEND="app-eselect/eselect-mpg123"
55 +
56 +DOCS=( AUTHORS ChangeLog NEWS NEWS.libmpg123 README )
57 +
58 +src_prepare() {
59 + default
60 + elibtoolize # for Darwin bundles
61 +}
62 +
63 +multilib_src_configure() {
64 + local _audio=dummy
65 + local _output=dummy
66 + local _cpu=generic_fpu
67 +
68 + # Build fails without -D_GNU_SOURCE like this:
69 + # error: ‘struct hostent’ has no member named ‘h_addr’
70 + append-cflags -D_GNU_SOURCE
71 +
72 + if $(multilib_is_native_abi) ; then
73 + local flag
74 + for flag in nas portaudio sdl oss jack alsa pulseaudio coreaudio; do
75 + if use ${flag}; then
76 + _audio+=" ${flag/pulseaudio/pulse}"
77 + _output=${flag/pulseaudio/pulse}
78 + fi
79 + done
80 + fi
81 +
82 + use cpu_flags_ppc_altivec && _cpu=altivec
83 +
84 + if [[ $(tc-arch) == amd64 || ${ARCH} == x64-* ]]; then
85 + use cpu_flags_x86_sse && _cpu=x86-64
86 + elif use x86 && gcc-specs-pie ; then
87 + # Don't use any mmx, 3dnow, sse and 3dnowext
88 + # bug #164504
89 + _cpu=generic_fpu
90 + else
91 + use cpu_flags_x86_mmx && _cpu=mmx
92 + use cpu_flags_x86_3dnow && _cpu=3dnow
93 + use cpu_flags_x86_sse && _cpu=x86
94 + use cpu_flags_x86_3dnowext && _cpu=x86
95 + fi
96 +
97 + local myconf=(
98 + --with-optimization=0
99 + --with-audio="${_audio}"
100 + --with-default-audio=${_output}
101 + --with-cpu=${_cpu}
102 + --enable-network
103 + $(use_enable ipv6)
104 + --enable-int-quality=$(usex int-quality)
105 + )
106 +
107 + multilib_is_native_abi || myconf+=( --disable-modules )
108 +
109 + ECONF_SOURCE="${S}" econf "${myconf[@]}"
110 +
111 + if ! $(multilib_is_native_abi) ; then
112 + sed -i -e 's:src doc:src/libmpg123:' Makefile || die
113 + fi
114 +}
115 +
116 +multilib_src_install_all() {
117 + einstalldocs
118 + mv "${ED}"/usr/bin/mpg123{,-mpg123}
119 + find "${ED}" -type f -name '*.la' -delete || die
120 +}
121 +
122 +pkg_postinst() {
123 + eselect mpg123 update ifunset
124 +}
125 +
126 +pkg_postrm() {
127 + eselect mpg123 update ifunset
128 +}