Gentoo Archives: gentoo-commits

From: Jory Pratt <anarchy@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-libs/musl/
Date: Wed, 26 Feb 2020 03:24:43
Message-Id: 1582687476.62ad29557ba726510fc884313b3d3ebda375b459.anarchy@gentoo
1 commit: 62ad29557ba726510fc884313b3d3ebda375b459
2 Author: Jory Pratt <anarchy <AT> gentoo <DOT> org>
3 AuthorDate: Wed Feb 26 03:20:54 2020 +0000
4 Commit: Jory Pratt <anarchy <AT> gentoo <DOT> org>
5 CommitDate: Wed Feb 26 03:24:36 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=62ad2955
7
8 sys-libs/musl: Version bump 1.2.0
9
10 Package-Manager: Portage-2.3.89, Repoman-2.3.20
11 Signed-off-by: Jory Pratt <anarchy <AT> gentoo.org>
12
13 sys-libs/musl/Manifest | 1 +
14 sys-libs/musl/musl-1.2.0.ebuild | 122 ++++++++++++++++++++++++++++++++++++++++
15 2 files changed, 123 insertions(+)
16
17 diff --git a/sys-libs/musl/Manifest b/sys-libs/musl/Manifest
18 index 17ff09bc4a6..dbf5d17bdfe 100644
19 --- a/sys-libs/musl/Manifest
20 +++ b/sys-libs/musl/Manifest
21 @@ -3,3 +3,4 @@ DIST getent.c 9438 BLAKE2B dc20353583c10a001bd8fe8474f32b70254dc56da186d1cdbaf40
22 DIST iconv.c 2577 BLAKE2B 070ca87b30c90ab98c27d5faf7a2fcb64ff7c67ca212ee6072165b2146979c551f714954dbd465462a171837c59b6ea027e0206458a2df0f977e45f01be3ce48 SHA512 9d42d66fb1facce2b85dad919be5be819ee290bd26ca2db00982b2f8e055a0196290a008711cbe2b18ec9eee8d2270e3b3a4692c5a1b807013baa5c2b70a2bbf
23 DIST musl-1.1.23.tar.gz 1013779 BLAKE2B 0251604697f6e243d173c6a72d0a24ddbbce298f8e3a53d9d3a18d7f5ebf19f4e85584a494639c2470530b61c3189150bfaed3376e31acf4e1b2daa1c30860dc SHA512 a2278de9903852b08352d3e734a39d4616caa602496997ba843e8fea0e1c481761776745faf04536a149d1c4af416b68df681b6fbc9ae2de8794e18c2e853b09
24 DIST musl-1.1.24.tar.gz 1024988 BLAKE2B 5fa26746eed0f2334b740adf94a8400568d56d9b2276bf1fbac828f9b707b4e215d3c16af9ea048b9d771f1d0a58ada3bc6e1bf0ba8f5fa693f5042fc6af30df SHA512 8987f1e194ea616f34f4f21fe9def28fb7f81d7060e38619206c6349f79db3bbb76bae8b711f5f9b8ed038799c9aea1a4cbec69e0bc4131e246203e133149e77
25 +DIST musl-1.2.0.tar.gz 1035265 BLAKE2B 0a47e0f438cca0f3ce31ae024c19358160214842115b560efc48e66228055c9147d9550957a79425322d510ba773f197d0944bb844bf6addbbf698088a3358a9 SHA512 58bd88189a6002356728cea1c6f6605a893fe54f7687595879add4eab283c8692c3b031eb9457ad00d1edd082cfe62fcc0eb5eb1d3bf4f1d749c0efa2a95fec1
26
27 diff --git a/sys-libs/musl/musl-1.2.0.ebuild b/sys-libs/musl/musl-1.2.0.ebuild
28 new file mode 100644
29 index 00000000000..e33c6c80913
30 --- /dev/null
31 +++ b/sys-libs/musl/musl-1.2.0.ebuild
32 @@ -0,0 +1,122 @@
33 +# Copyright 1999-2020 Gentoo Authors
34 +# Distributed under the terms of the GNU General Public License v2
35 +
36 +EAPI=6
37 +
38 +inherit eutils flag-o-matic multilib toolchain-funcs
39 +if [[ ${PV} == "9999" ]] ; then
40 + EGIT_REPO_URI="git://git.musl-libc.org/musl"
41 + inherit git-r3
42 + SRC_URI="
43 + https://dev.gentoo.org/~blueness/musl-misc/getconf.c
44 + https://dev.gentoo.org/~blueness/musl-misc/getent.c
45 + https://dev.gentoo.org/~blueness/musl-misc/iconv.c"
46 + KEYWORDS=""
47 +else
48 + SRC_URI="http://www.musl-libc.org/releases/${P}.tar.gz
49 + https://dev.gentoo.org/~blueness/musl-misc/getconf.c
50 + https://dev.gentoo.org/~blueness/musl-misc/getent.c
51 + https://dev.gentoo.org/~blueness/musl-misc/iconv.c"
52 + KEYWORDS="-* ~amd64 ~arm ~arm64 ~mips ~ppc ~ppc64 ~x86"
53 +fi
54 +
55 +export CBUILD=${CBUILD:-${CHOST}}
56 +export CTARGET=${CTARGET:-${CHOST}}
57 +if [[ ${CTARGET} == ${CHOST} ]] ; then
58 + if [[ ${CATEGORY} == cross-* ]] ; then
59 + export CTARGET=${CATEGORY#cross-}
60 + fi
61 +fi
62 +
63 +DESCRIPTION="Light, fast and simple C library focused on standards-conformance and safety"
64 +HOMEPAGE="http://www.musl-libc.org/"
65 +LICENSE="MIT LGPL-2 GPL-2"
66 +SLOT="0"
67 +IUSE="headers-only"
68 +
69 +QA_SONAME="/usr/lib/libc.so"
70 +QA_DT_NEEDED="/usr/lib/libc.so"
71 +
72 +is_crosscompile() {
73 + [[ ${CHOST} != ${CTARGET} ]]
74 +}
75 +
76 +just_headers() {
77 + use headers-only && is_crosscompile
78 +}
79 +
80 +pkg_setup() {
81 + if [ ${CTARGET} == ${CHOST} ] ; then
82 + case ${CHOST} in
83 + *-musl*) ;;
84 + *) die "Use sys-devel/crossdev to build a musl toolchain" ;;
85 + esac
86 + fi
87 +
88 + # fix for #667126, copied from glibc ebuild
89 + # make sure host make.conf doesn't pollute us
90 + if is_crosscompile || tc-is-cross-compiler ; then
91 + CHOST=${CTARGET} strip-unsupported-flags
92 + fi
93 +}
94 +
95 +src_configure() {
96 + tc-getCC ${CTARGET}
97 + just_headers && export CC=true
98 +
99 + local sysroot
100 + is_crosscompile && sysroot=/usr/${CTARGET}
101 + ./configure \
102 + --target=${CTARGET} \
103 + --prefix=${sysroot}/usr \
104 + --syslibdir=${sysroot}/lib \
105 + --disable-gcc-wrapper || die
106 +}
107 +
108 +src_compile() {
109 + emake obj/include/bits/alltypes.h
110 + just_headers && return 0
111 +
112 + emake
113 + if [[ ${CATEGORY} != cross-* ]] ; then
114 + $(tc-getCC) ${CFLAGS} "${DISTDIR}"/getconf.c -o "${T}"/getconf || die
115 + $(tc-getCC) ${CFLAGS} "${DISTDIR}"/getent.c -o "${T}"/getent || die
116 + $(tc-getCC) ${CFLAGS} "${DISTDIR}"/iconv.c -o "${T}"/iconv || die
117 + fi
118 +}
119 +
120 +src_install() {
121 + local target="install"
122 + just_headers && target="install-headers"
123 + emake DESTDIR="${D}" ${target}
124 + just_headers && return 0
125 +
126 + # musl provides ldd via a sym link to its ld.so
127 + local sysroot
128 + is_crosscompile && sysroot=/usr/${CTARGET}
129 + local ldso=$(basename "${D}"${sysroot}/lib/ld-musl-*)
130 + dosym ${sysroot}/lib/${ldso} ${sysroot}/usr/bin/ldd
131 +
132 + if [[ ${CATEGORY} != cross-* ]] ; then
133 + local arch=$("${D}"usr/lib/libc.so 2>&1 | sed -n '1s/^musl libc (\(.*\))$/\1/p')
134 + [[ -e "${D}"/lib/ld-musl-${arch}.so.1 ]] || die
135 + cp "${FILESDIR}"/ldconfig.in "${T}" || die
136 + sed -e "s|@@ARCH@@|${arch}|" "${T}"/ldconfig.in > "${T}"/ldconfig || die
137 + into /
138 + dosbin "${T}"/ldconfig
139 + into /usr
140 + dobin "${T}"/getconf
141 + dobin "${T}"/getent
142 + dobin "${T}"/iconv
143 + echo 'LDPATH="include ld.so.conf.d/*.conf"' > "${T}"/00musl || die
144 + doenvd "${T}"/00musl
145 + fi
146 +}
147 +
148 +pkg_postinst() {
149 + is_crosscompile && return 0
150 +
151 + [ "${ROOT}" != "/" ] && return 0
152 +
153 + ldconfig || die
154 +}