This repository has been archived on 2025-09-06. You can view files and clone it, but cannot push or open issues or pull requests.
Files
home-assistant-yellow/prepare.sh
Dustin C. Hatch f3b63a1dc2 prepare: Fix binpkg build for libcap
Since we have to build *sys-libs/libcap* with the default Portage
configuration in order to avoid the circular dependency with PAM,
our configuration for binary package builds is not yet in place.  We
need to explicitly specify where to put the built packages and enable
multi-instance packages.
2023-03-06 15:02:46 -06:00

62 lines
1.9 KiB
Bash
Executable File

#!/bin/sh
# vim: set sw=4 ts=4 sts=4 et :
set -e
. ./config
# Ensure we have a Portage repo
if [ ! -f /var/db/repos/gentoo/metadata/timestamp ]; then
emerge-webrsync
fi
chown portage: "$(portageq envvar DISTDIR)"
ARCH=$(PORTAGE_CONFIGROOT=/usr/${target} portageq envvar ARCH)
if [ -f /usr/${target}/etc/portage/make.conf ]; then
sed -i '/PKGDIR=/d' /usr/${target}/etc/portage/make.conf
fi
# For some reason, libcap installs its pkg-config files in the wrong
# place. More strangely, even though `PKG_CONFIG_PATH` contains that
# directory, `pkg-config` does not find the `.pc` files for libcap.
# We work around this by merging /usr/lib64/pkgconfig and
# /usr/lib/pkgconfig.
FEATURES="${FEATURES} binpkg-multi-instance" \
${target}-emerge -kb1vnj sys-libs/libcap
if [ -d /usr/${target}/usr/lib/pkgconfig ] \
&& [ ! -d /usr/${target}/usr/lib64/pkgconfig ]; then
mv /usr/${target}/usr/lib/pkgconfig /usr/${target}/usr/lib64
ln -snf ../lib64/pkgconfig /usr/${target}/usr/lib/pkgconfig
fi
if [ ! -d /usr/${target}/etc/portage/make.conf ]; then
mv /usr/${target}/etc/portage/make.conf \
/usr/${target}/etc/portage/make.conf.orig
sed -ri 's: ?-pam::' /usr/${target}/etc/portage/make.conf.orig
ls -l /usr/${target}/etc/portage
mkdir /usr/${target}/etc/portage/make.conf
mv /usr/${target}/etc/portage/make.conf.orig \
/usr/${target}/etc/portage/make.conf/10-base.conf
fi
if [ ! -d /etc/portage/make.conf ]; then
mv /etc/portage/make.conf \
/etc/portage/make.conf.orig
mkdir /etc/portage/make.conf
mv /etc/portage/make.conf.orig \
/etc/portage/make.conf/10-base.conf
fi
ln -snf /var/db/repos/gentoo/profiles/default/linux/${ARCH}/17.0 \
/usr/${target}/etc/portage/make.profile
${target}-emerge -bk1nvj sys-libs/glibc
${target}-emerge -bknvj sys-apps/util-linux
# Migrate to the merged-usr layout
mkdir -p /usr/${target}/bin
emerge -bknv --quiet-build=y merge-usr
merge-usr --root=/usr/${target}