mirror of
https://anongit.gentoo.org/git/repo/gentoo.git
synced 2025-07-22 06:57:59 +02:00
Same chroot as before but tree state at 67eeb6e0867dd39abfd50edefd68d20919bba7e6. Of course, couldn't use crossdev, so rebuilt natively in the chroot w/ FEATURES="buildpkg". They are newer versions of each slot because it necessarily upgraded them to rebuild to get the binpkgs, though. This just leaves x86 which has a similar problem (perhaps I should've chosen a nomultilib stage3 to begin with). Signed-off-by: Sam James <sam@gentoo.org>
124 lines
4.4 KiB
Bash
124 lines
4.4 KiB
Bash
# Copyright 2024-2025 Gentoo Authors
|
|
# Distributed under the terms of the GNU General Public License v2
|
|
|
|
EAPI=8
|
|
|
|
# The binaries in SRC_URI are generated by the following (roughly):
|
|
# * taking an amd64 stage3
|
|
# * adding USE=ada to make.conf
|
|
# * running `crossdev ${CHOST} --ex-gcc -S`
|
|
# * running `USE=ada ${CHOST}-emerge -v1 gcc`
|
|
# * copy /usr/${CHOST}/var/cache/binpkgs/sys-devel/gcc* into
|
|
# ada-bootstrap-${PV}-${CHOST}.gpkg.tar
|
|
#
|
|
# The full script is at https://github.com/thesamesam/sam-gentoo-scripts/blob/91558fb51c56a661d6f374507888ff67725ca660/build-ada-bootstraps.
|
|
#
|
|
# Binaries in SRC_URI are regular Gentoo binpkgs in the GPKG format.
|
|
#
|
|
# Note: of course, the used GCC on both CBUILD and CHOST
|
|
# must be the same version, correspond to ${PV} in ada-bootstrap,
|
|
# and be at most the newest stable GCC (ideally older).
|
|
inherit unpacker
|
|
|
|
DESCRIPTION="Binary bootstrap compiler for GNAT (Ada compiler)"
|
|
HOMEPAGE="https://wiki.gentoo.org/wiki/Project:Ada"
|
|
SRC_URI="
|
|
alpha? (
|
|
https://dev.gentoo.org/~sam/distfiles/${CATEGORY}/${PN}/${P}-alpha-unknown-linux-gnu.gpkg.tar
|
|
)
|
|
amd64? (
|
|
https://dev.gentoo.org/~sam/distfiles/${CATEGORY}/${PN}/${P}-x86_64-pc-linux-gnu.gpkg.tar
|
|
)
|
|
arm64? (
|
|
https://dev.gentoo.org/~sam/distfiles/${CATEGORY}/${PN}/${P}-aarch64-unknown-linux-gnu.gpkg.tar
|
|
)
|
|
arm? (
|
|
https://dev.gentoo.org/~sam/distfiles/${CATEGORY}/${PN}/${P}-armv6j-softfp-linux-gnueabi.gpkg.tar
|
|
https://dev.gentoo.org/~sam/distfiles/${CATEGORY}/${PN}/${P}-armv6j-unknown-linux-gnueabihf.gpkg.tar
|
|
https://dev.gentoo.org/~sam/distfiles/${CATEGORY}/${PN}/${P}-armv7a-softfp-linux-gnueabi.gpkg.tar
|
|
https://dev.gentoo.org/~sam/distfiles/${CATEGORY}/${PN}/${P}-armv7a-unknown-linux-gnueabihf.gpkg.tar
|
|
)
|
|
hppa? (
|
|
https://dev.gentoo.org/~sam/distfiles/${CATEGORY}/${PN}/${P}-hppa1.1-unknown-linux-gnu.gpkg.tar
|
|
https://dev.gentoo.org/~sam/distfiles/${CATEGORY}/${PN}/${P}-hppa2.0-unknown-linux-gnu.gpkg.tar
|
|
)
|
|
ppc? (
|
|
https://dev.gentoo.org/~sam/distfiles/${CATEGORY}/${PN}/${P}-powerpc-unknown-linux-gnu.gpkg.tar
|
|
)
|
|
ppc64? (
|
|
https://dev.gentoo.org/~sam/distfiles/${CATEGORY}/${PN}/${P}-powerpc64le-unknown-linux-gnu.gpkg.tar
|
|
https://dev.gentoo.org/~sam/distfiles/${CATEGORY}/${PN}/${P}-powerpc64-unknown-linux-gnu.gpkg.tar
|
|
)
|
|
riscv? (
|
|
https://dev.gentoo.org/~sam/distfiles/${CATEGORY}/${PN}/${P}-riscv64-unknown-linux-gnu.gpkg.tar
|
|
)
|
|
sparc? (
|
|
https://dev.gentoo.org/~sam/distfiles/${CATEGORY}/${PN}/${P}-sparc64-unknown-linux-gnu.gpkg.tar
|
|
)
|
|
s390? (
|
|
https://dev.gentoo.org/~sam/distfiles/${CATEGORY}/${PN}/${P}-s390-ibm-linux-gnu.gpkg.tar
|
|
https://dev.gentoo.org/~sam/distfiles/${CATEGORY}/${PN}/${P}-s390x-ibm-linux-gnu.gpkg.tar
|
|
)
|
|
"
|
|
S=${WORKDIR}
|
|
|
|
LICENSE="GPL-2 GPL-3"
|
|
SLOT="0"
|
|
KEYWORDS="-* amd64 arm arm64 hppa ppc ppc64 ~riscv sparc"
|
|
|
|
RDEPEND="
|
|
>=dev-libs/gmp-4.3.2:0/10.4
|
|
>=dev-libs/mpfr-2.4.2:0/6
|
|
>=dev-libs/mpc-0.8.1:0/3
|
|
sys-libs/zlib
|
|
virtual/libiconv
|
|
"
|
|
|
|
src_unpack() {
|
|
# We want to unpack only the appropriate tarball for CHOST (e.g. on arm).
|
|
TARBALL_TO_UNPACK=
|
|
|
|
local archive
|
|
for archive in ${A} ; do
|
|
local tarball_chost=${archive/${P}-}
|
|
tarball_chost=${tarball_chost%%.gpkg.tar}
|
|
|
|
if [[ ${tarball_chost} == ${CHOST} ]] ; then
|
|
TARBALL_TO_UNPACK=${archive}
|
|
break
|
|
fi
|
|
done
|
|
|
|
if [[ -z ${TARBALL_TO_UNPACK} ]] ; then
|
|
die "No tarball found for CHOST=${CHOST}. Please file a bug at bugs.gentoo.org."
|
|
fi
|
|
|
|
unpack_gpkg "${TARBALL_TO_UNPACK}"
|
|
}
|
|
|
|
src_install() {
|
|
local chost=${TARBALL_TO_UNPACK/${P}-}
|
|
chost=${chost%%.gpkg.tar}
|
|
|
|
BINPKG=$(find "${WORKDIR}"/ -type d -mindepth 1 -maxdepth 1 -iname 'gcc-*')
|
|
BINPKG="${BINPKG#${WORKDIR}}"
|
|
|
|
dodir /usr/lib/ada-bootstrap
|
|
mv "${WORKDIR}"/${BINPKG}/image/usr/ "${ED}"/usr/lib/ada-bootstrap || die
|
|
|
|
# Make `gcc-config`-style symlinks
|
|
insinto /usr/lib/ada-bootstrap/bin
|
|
local tool
|
|
for tool in gcc gnat{,bind,chop,clean,kr,link,ls,make,name,prep} ; do
|
|
dosym -r /usr/lib/ada-bootstrap/usr/${chost}/gcc-bin/${PV}/${tool} /usr/lib/ada-bootstrap/bin/${tool}
|
|
dosym -r /usr/lib/ada-bootstrap/usr/${chost}/gcc-bin/${PV}/${tool} /usr/lib/ada-bootstrap/bin/${chost}-${tool}
|
|
dosym -r /usr/lib/ada-bootstrap/usr/${chost}/gcc-bin/${PV}/${tool} /usr/lib/ada-bootstrap/bin/${chost}-${tool}-${PV}
|
|
done
|
|
|
|
rm -rf "${ED}"/usr/lib/ada-bootstrap/usr/bin || die
|
|
# This gives us the same layout as older dev-lang/ada-bootstrap
|
|
dosym -r /usr/lib/ada-bootstrap/bin /usr/lib/ada-bootstrap/usr/bin
|
|
dosym -r /usr/lib/ada-bootstrap/usr/libexec /usr/lib/ada-bootstrap/libexec
|
|
}
|
|
|
|
# TODO: pkg_postinst warning/log?
|