Gentoo Archives: gentoo-commits

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