summaryrefslogtreecommitdiff
path: root/sys-apps/baselayout/baselayout-9999.ebuild
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2021-06-15 14:57:03 +0100
committerV3n3RiX <venerix@redcorelinux.org>2021-06-15 14:57:03 +0100
commitd18bf1e01b65ee4bf0c804e2843b282d3d4e5d7c (patch)
tree4a95cbc6ffdf13bad6ecbc7f8d5af99631984123 /sys-apps/baselayout/baselayout-9999.ebuild
parente748ba9741f6540f4675c23e3e37b73e822c13a4 (diff)
gentoo resync : 15.06.2021
Diffstat (limited to 'sys-apps/baselayout/baselayout-9999.ebuild')
-rw-r--r--sys-apps/baselayout/baselayout-9999.ebuild41
1 files changed, 41 insertions, 0 deletions
diff --git a/sys-apps/baselayout/baselayout-9999.ebuild b/sys-apps/baselayout/baselayout-9999.ebuild
index 9f4a53a1c184..c83d1da82dc4 100644
--- a/sys-apps/baselayout/baselayout-9999.ebuild
+++ b/sys-apps/baselayout/baselayout-9999.ebuild
@@ -23,6 +23,34 @@ pkg_setup() {
multilib_layout
}
+riscv_compat_symlink() {
+ # Here we apply some special sauce for riscv.
+ # Two multilib layouts exist for now:
+ # 1) one level libdirs, (32bit) "lib" and (64bit) "lib64"
+ # these are chosen by us to closely resemble other arches
+ # 2) two level libdirs, "lib64/lp64d" "lib64/lp64" "lib32/ilp32d" ...
+ # this is the glibc/gcc default
+ # Unfortunately, the default has only one fallback, which is "lib"
+ # for both 32bit and 64bit. So things do not break in 1), we need
+ # to provide compatibility symlinks...
+
+ # This function has exactly two parameters:
+ # - the default libdir, to determine if 1) or 2) applies
+ # - the location of the symlink (which points to ".")
+
+ # Note: we call this only in the ${SYMLINK_LIB} = no codepath, since
+ # there never was a ${SYMLINK_LIB} = yes riscv profile.
+
+ case ${CHOST} in
+ riscv*)
+ # are we on a one level libdir profile? is there no symlink yet?
+ if [[ ${1} != */* && ! -L ${2} ]] ; then
+ ln -s . $2 || die "Unable to make $2 riscv compatibility symlink"
+ fi
+ ;;
+ esac
+}
+
# Create our multilib dirs - the Makefile has no knowledge of this
multilib_layout() {
local dir def_libdir libdir libdirs
@@ -52,6 +80,7 @@ multilib_layout() {
die "Unable to create ${dir} directory"
fi
done
+ riscv_compat_symlink "${def_libdir}" "${prefix}${def_libdir}/${DEFAULT_ABI}"
done
return 0
fi
@@ -282,6 +311,18 @@ pkg_postinst() {
fi
fi
+ # https://bugs.gentoo.org/361349
+ if use kernel_linux; then
+ mkdir -p "${EROOT}"/run || die
+
+ local found fstype mountpoint
+ while read -r _ mountpoint fstype _; do
+ [[ ${mountpoint} = /run ]] && [[ ${fstype} = tmpfs ]] && found=1
+ done < "${ROOT}"/proc/mounts
+ [[ -z ${found} ]] &&
+ ewarn "You should reboot now to get /run mounted with tmpfs!"
+ fi
+
for x in ${REPLACING_VERSIONS}; do
if ver_test 2.4 -lt ${x}; then
ewarn "After updating ${EROOT}/etc/profile, please run"