Gentoo Archives: gentoo-commits

From: Fabian Groffen <grobian@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-devel/binutils-apple/
Date: Thu, 31 Dec 2020 12:17:12
Message-Id: 1609417025.91c8a5258869485e8562ca3474b90b72d0e41404.grobian@gentoo
1 commit: 91c8a5258869485e8562ca3474b90b72d0e41404
2 Author: Fabian Groffen <grobian <AT> gentoo <DOT> org>
3 AuthorDate: Thu Dec 31 12:16:59 2020 +0000
4 Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org>
5 CommitDate: Thu Dec 31 12:17:05 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=91c8a525
7
8 sys-devel/binutils-apple-8.2.1-r101: bump for tapilite
9
10 With built-in tapilite, we can now read .tbd archives, thus performing a
11 link on platforms without dylibs available in their SDKs, such as
12 Catalina and Big Sur.
13
14 This release of binutils-apple is fully functional on macOS Big Sur.
15
16 Package-Manager: Portage-3.0.9, Repoman-3.0.2
17 Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>
18
19 sys-devel/binutils-apple/Manifest | 1 +
20 .../binutils-apple-8.2.1-r101.ebuild | 120 +++++++++++++++++++++
21 2 files changed, 121 insertions(+)
22
23 diff --git a/sys-devel/binutils-apple/Manifest b/sys-devel/binutils-apple/Manifest
24 index 647103f352b..f84592c72d4 100644
25 --- a/sys-devel/binutils-apple/Manifest
26 +++ b/sys-devel/binutils-apple/Manifest
27 @@ -8,6 +8,7 @@ DIST cctools-795.tar.gz 1993795 BLAKE2B dc0915f8647eecba5352e34dfc5752b679df39ea
28 DIST cctools-895.tar.gz 1716126 BLAKE2B 9706a6b243518693888e5e21dfe8d83b217380b47db621a7f1b35105eb72fb8997353ff85133224b0856f6b6ec710f54a4fe79076d9e228f89c98b6f517de309 SHA512 4ef9db870385cc2c4263bcbe42ff0de80386771f5acbc7082a1818ecd6b8d7bb1bfa02a7fcfecd3e7281481aeaaac4c331359aca3564bfe7a4c7dea1e0d06126
29 DIST cctools-949.0.1.tar.gz 1968671 BLAKE2B b38fbae5d2ec011a94c2e4ec299c1ecd173f2c2516664cf925b06aaa078e234b59068158ea29dfcbf763ca98c73bc1806a507fbbe49a8d4d0a2fd4e602f401ce SHA512 13c493a48852c980d2829d28616c18640ad5ebfe6acd55143c4c948665e0b65377a459560667074fdac5e69bb6360fea13d988303c49fd3dd4a58e9b5c54ebcb
30 DIST darwin-xtools-8.2.1-r100.tar.gz 2934997 BLAKE2B d0324d47d3aa0afd0007fbbd16c74e046c643c645744cc7ef0535eeed275c2d61763a1c6708b3a0a796f0fc83e62b5e5fe907c62553b439bea750353cfac2f73 SHA512 7000bca61b1dc63d1d08a9bcf104dace4376c2656af0faddc28a7d6c3718dbe54713da96136091a2024a644eaf90758714d1e4eb3cfeec2df0e412d847f59c30
31 +DIST darwin-xtools-8.2.1-r101.tar.gz 3105898 BLAKE2B 3516cd252d4880b1e80c76365efef6f96830578bb5512befe33f86decdeb026fbad17fd3b27e9c3cf20d100897002e86ec08822041baa0291bb53e0b0ecf4d10 SHA512 f84cbde0853c14f03af40a124133d71d3e1710da021a593336eb4351c60edbca5753af0780f269ed4716cd194973f5437d428c5ff9615d9ce025dba3b7daef77
32 DIST dyld-132.13.tar.gz 342690 BLAKE2B 011418ba5b91a28bb7c5f8188af2fac5478bad53581396b7c1c4623a854a8f0d5ecb92d023246157830ed2db83bbf28e23225a255188e2d07eeb6c933814bda6 SHA512 2c9d50fc32868b696d88730eb6ea6afa9bb9f56883cc2ea4f1d41f370f311b7487a29ce0eff6761e1eeb086a18e2513953989d8d5d3ef1043bb662e86baadd3f
33 DIST dyld-421.2.tar.gz 625173 BLAKE2B 8f8325314861ae2ea10fbe78c74c7199b547973ac61a8e9cb76fb874a0e53395ea31c04e489f85ac7cfdb5715ae5051679453de75eb195e313113e7bbbc70340 SHA512 75f2fb840da980d44649aa3e045f50c4e37d4403fbdb1e2e5f1a85bf6d8859e1130053c3806f7ef992fdfc6573f7f18146263c690144bdd3df31452c6bdd8bd8
34 DIST dyld-551.4.tar.gz 832297 BLAKE2B e65c5b2ed90af6ec94f1295efc984404af99f0e5dc666bfc854379f13fd2e98b8048fae84b7bc8864fe27112abf12f741a33cc404b18ae7c88b7abd6a1d9e3c6 SHA512 896281c4b2330c92ed538af58f1b60906ed0a9ffa3099a5e8ef9a15b7ed974259bf546fd2ab7562739f2c8cf1fdfb44ea0ea7567092c77f2ea2cab377da064b0
35
36 diff --git a/sys-devel/binutils-apple/binutils-apple-8.2.1-r101.ebuild b/sys-devel/binutils-apple/binutils-apple-8.2.1-r101.ebuild
37 new file mode 100644
38 index 00000000000..3e02d9be4c8
39 --- /dev/null
40 +++ b/sys-devel/binutils-apple/binutils-apple-8.2.1-r101.ebuild
41 @@ -0,0 +1,120 @@
42 +# Copyright 2020 Gentoo Authors
43 +# Distributed under the terms of the GNU General Public License v2
44 +
45 +EAPI=7
46 +
47 +CMAKE_MAKEFILE_GENERATOR=emake # keep dependencies down
48 +
49 +inherit cmake toolchain-funcs
50 +
51 +DESCRIPTION="Darwin Xtools matching Xcode Tools ${PN}"
52 +HOMEPAGE="https://github.com/iains/darwin-xtools"
53 +SRC_URI="https://github.com/grobian/darwin-xtools/archive/gentoo-${PVR}.tar.gz -> darwin-xtools-${PVR}.tar.gz"
54 +
55 +LICENSE="APSL-2"
56 +SLOT="8"
57 +KEYWORDS="~ppc-macos ~x64-macos ~x86-macos"
58 +IUSE="tapi"
59 +
60 +# xtools uses c++11 features, not available in gcc-apple, hence gcc/clang dep
61 +DEPEND="sys-devel/binutils-config
62 + || ( sys-devel/gcc:* sys-devel/clang:* )
63 + app-arch/xar
64 + tapi? ( sys-libs/tapi )
65 + !tapi? ( dev-libs/libyaml )"
66 +RDEPEND="${DEPEND}"
67 +BDEPEND=""
68 +
69 +S="${WORKDIR}/darwin-xtools-gentoo-${PVR}"
70 +
71 +src_configure() {
72 + CTARGET=${CTARGET:-${CHOST}}
73 + if [[ ${CTARGET} == ${CHOST} ]] ; then
74 + if [[ ${CATEGORY} == cross-* ]] ; then
75 + export CTARGET=${CATEGORY#cross-}
76 + fi
77 + fi
78 +
79 + LIBPATH=/usr/$(get_libdir)/binutils/${CTARGET}/xtools-${PV}
80 + DATAPATH=/usr/share/binutils-data/${CTARGET}/xtools-${PV}
81 + if [[ ${CHOST} != ${CTARGET} ]] ; then
82 + BINPATH=/usr/${CHOST}/${CTARGET}/binutils-bin/xtools-${PV}
83 + else
84 + BINPATH=/usr/${CTARGET}/binutils-bin/xtools-${PV}
85 + fi
86 +
87 + is-host-64bit() {
88 + case ${CTARGET} in
89 + x86_64-*|powerpc64-*|arm64-*) echo YES ;;
90 + *) echo NO ;;
91 + esac
92 + }
93 +
94 + local mycmakeargs=(
95 + -DCMAKE_OSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET}
96 + -DPACKAGE_VERSION="Gentoo ${PN}-${PVR}"
97 + -DCMAKE_INSTALL_PREFIX="${EPREFIX}${BINPATH%/*}" # cmake insists on /bin
98 + -DCCTOOLS_LD_CLASSIC=NO # fails to link, and is useless anyway
99 + -DXTOOLS_AS_USE_CLANG=YES # default to host as for unsupported targets
100 + -DXTOOLS_AS_CLANG_USE_HOST=YES # search for arch/as-host iso clang
101 + -DXTOOLS_AS_SUBDIR="${EPREFIX}${LIBPATH}/"
102 + -DXTOOLS_LTO_SUPPORT=NO
103 + -DXTOOLS_HAS_LIBPRUNETRIE=YES
104 + -DXTOOLS_TAPI_SUPPORT=ON
105 + -DXTOOLS_USE_TAPILITE=$(use tapi && echo OFF || echo ON)
106 + -DXTOOLS_HOST_IS_64B=$(is-host-64bit)
107 + -DXTOOLS_BUGURL="https://bugs.gentoo.org/"
108 + )
109 +
110 + cmake_src_configure
111 +}
112 +
113 +src_install() {
114 + cmake_src_install
115 +
116 + # cmake insists on installing in /bin, so move bins to the place we
117 + # want them
118 + mv "${ED}${BINPATH%/*}/bin" "${ED}${BINPATH}" || die
119 +
120 + # move as impls into LIBPATH, such that binutils-config doesn't
121 + # create links for this
122 + dodir "${LIBPATH}"
123 + local as
124 + for as in "${ED}${BINPATH}"/*/as ; do
125 + as=${as%/as}
126 + mv "${as}" "${ED}${LIBPATH}"/ || die
127 + done
128 +
129 + # provide as-host wrappers, used on "unsupported" platforms: x86,
130 + # x64, arm, arm64, the main reason here is missing support for
131 + # instructions, e.g. the as works fine, until newer instruction sets
132 + # are used like SSE4.1, AVX, etc.
133 + local arch
134 + for arch in i386 x86_64 arm arm64 ; do
135 + mkdir -p "${ED}${LIBPATH}"/${arch}
136 + as="${ED}${LIBPATH}"/${arch}/as-host
137 + rm -f "${as}"
138 + cat <<-EOF > "${as}"
139 + #!/usr/bin/env bash
140 + exec /usr/bin/as "\$@"
141 + EOF
142 + chmod 755 "${as}"
143 + done
144 +
145 + doman ld64/doc/man/man*/* cctools/man/*.[135]
146 + dodir "${DATAPATH}"
147 + mv "${ED}"/usr/share/man "${ED}/${DATAPATH}/" || die
148 +
149 + cd "${S}"
150 + insinto /etc/env.d/binutils
151 + cat <<-EOF > env.d
152 + TARGET="${CHOST}"
153 + VER="xtools-${PV}"
154 + FAKE_TARGETS="${CHOST}"
155 + EOF
156 + newins env.d ${CHOST}-xtools-${PV}
157 +}
158 +
159 +pkg_postinst() {
160 + binutils-config ${CHOST}-xtools-${PV}
161 +}