1 |
commit: e5779ed450cb40d944b013b1257a385714544d0c |
2 |
Author: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Jun 12 19:40:39 2021 +0000 |
4 |
Commit: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Jun 12 19:42:52 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e5779ed4 |
7 |
|
8 |
sys-apps/baselayout: Add riscv compat symlink for 1-level libdir |
9 |
|
10 |
Approved by williamh |
11 |
|
12 |
Package-Manager: Portage-3.0.18, Repoman-3.0.2 |
13 |
Signed-off-by: Andreas K. Hüttel <dilfridge <AT> gentoo.org> |
14 |
|
15 |
...layout-9999.ebuild => baselayout-2.7-r3.ebuild} | 41 ++++++++++++++++++++++ |
16 |
sys-apps/baselayout/baselayout-9999.ebuild | 41 ++++++++++++++++++++++ |
17 |
2 files changed, 82 insertions(+) |
18 |
|
19 |
diff --git a/sys-apps/baselayout/baselayout-9999.ebuild b/sys-apps/baselayout/baselayout-2.7-r3.ebuild |
20 |
similarity index 87% |
21 |
copy from sys-apps/baselayout/baselayout-9999.ebuild |
22 |
copy to sys-apps/baselayout/baselayout-2.7-r3.ebuild |
23 |
index 9f4a53a1c18..c83d1da82dc 100644 |
24 |
--- a/sys-apps/baselayout/baselayout-9999.ebuild |
25 |
+++ b/sys-apps/baselayout/baselayout-2.7-r3.ebuild |
26 |
@@ -23,6 +23,34 @@ pkg_setup() { |
27 |
multilib_layout |
28 |
} |
29 |
|
30 |
+riscv_compat_symlink() { |
31 |
+ # Here we apply some special sauce for riscv. |
32 |
+ # Two multilib layouts exist for now: |
33 |
+ # 1) one level libdirs, (32bit) "lib" and (64bit) "lib64" |
34 |
+ # these are chosen by us to closely resemble other arches |
35 |
+ # 2) two level libdirs, "lib64/lp64d" "lib64/lp64" "lib32/ilp32d" ... |
36 |
+ # this is the glibc/gcc default |
37 |
+ # Unfortunately, the default has only one fallback, which is "lib" |
38 |
+ # for both 32bit and 64bit. So things do not break in 1), we need |
39 |
+ # to provide compatibility symlinks... |
40 |
+ |
41 |
+ # This function has exactly two parameters: |
42 |
+ # - the default libdir, to determine if 1) or 2) applies |
43 |
+ # - the location of the symlink (which points to ".") |
44 |
+ |
45 |
+ # Note: we call this only in the ${SYMLINK_LIB} = no codepath, since |
46 |
+ # there never was a ${SYMLINK_LIB} = yes riscv profile. |
47 |
+ |
48 |
+ case ${CHOST} in |
49 |
+ riscv*) |
50 |
+ # are we on a one level libdir profile? is there no symlink yet? |
51 |
+ if [[ ${1} != */* && ! -L ${2} ]] ; then |
52 |
+ ln -s . $2 || die "Unable to make $2 riscv compatibility symlink" |
53 |
+ fi |
54 |
+ ;; |
55 |
+ esac |
56 |
+} |
57 |
+ |
58 |
# Create our multilib dirs - the Makefile has no knowledge of this |
59 |
multilib_layout() { |
60 |
local dir def_libdir libdir libdirs |
61 |
@@ -52,6 +80,7 @@ multilib_layout() { |
62 |
die "Unable to create ${dir} directory" |
63 |
fi |
64 |
done |
65 |
+ riscv_compat_symlink "${def_libdir}" "${prefix}${def_libdir}/${DEFAULT_ABI}" |
66 |
done |
67 |
return 0 |
68 |
fi |
69 |
@@ -282,6 +311,18 @@ pkg_postinst() { |
70 |
fi |
71 |
fi |
72 |
|
73 |
+ # https://bugs.gentoo.org/361349 |
74 |
+ if use kernel_linux; then |
75 |
+ mkdir -p "${EROOT}"/run || die |
76 |
+ |
77 |
+ local found fstype mountpoint |
78 |
+ while read -r _ mountpoint fstype _; do |
79 |
+ [[ ${mountpoint} = /run ]] && [[ ${fstype} = tmpfs ]] && found=1 |
80 |
+ done < "${ROOT}"/proc/mounts |
81 |
+ [[ -z ${found} ]] && |
82 |
+ ewarn "You should reboot now to get /run mounted with tmpfs!" |
83 |
+ fi |
84 |
+ |
85 |
for x in ${REPLACING_VERSIONS}; do |
86 |
if ver_test 2.4 -lt ${x}; then |
87 |
ewarn "After updating ${EROOT}/etc/profile, please run" |
88 |
|
89 |
diff --git a/sys-apps/baselayout/baselayout-9999.ebuild b/sys-apps/baselayout/baselayout-9999.ebuild |
90 |
index 9f4a53a1c18..c83d1da82dc 100644 |
91 |
--- a/sys-apps/baselayout/baselayout-9999.ebuild |
92 |
+++ b/sys-apps/baselayout/baselayout-9999.ebuild |
93 |
@@ -23,6 +23,34 @@ pkg_setup() { |
94 |
multilib_layout |
95 |
} |
96 |
|
97 |
+riscv_compat_symlink() { |
98 |
+ # Here we apply some special sauce for riscv. |
99 |
+ # Two multilib layouts exist for now: |
100 |
+ # 1) one level libdirs, (32bit) "lib" and (64bit) "lib64" |
101 |
+ # these are chosen by us to closely resemble other arches |
102 |
+ # 2) two level libdirs, "lib64/lp64d" "lib64/lp64" "lib32/ilp32d" ... |
103 |
+ # this is the glibc/gcc default |
104 |
+ # Unfortunately, the default has only one fallback, which is "lib" |
105 |
+ # for both 32bit and 64bit. So things do not break in 1), we need |
106 |
+ # to provide compatibility symlinks... |
107 |
+ |
108 |
+ # This function has exactly two parameters: |
109 |
+ # - the default libdir, to determine if 1) or 2) applies |
110 |
+ # - the location of the symlink (which points to ".") |
111 |
+ |
112 |
+ # Note: we call this only in the ${SYMLINK_LIB} = no codepath, since |
113 |
+ # there never was a ${SYMLINK_LIB} = yes riscv profile. |
114 |
+ |
115 |
+ case ${CHOST} in |
116 |
+ riscv*) |
117 |
+ # are we on a one level libdir profile? is there no symlink yet? |
118 |
+ if [[ ${1} != */* && ! -L ${2} ]] ; then |
119 |
+ ln -s . $2 || die "Unable to make $2 riscv compatibility symlink" |
120 |
+ fi |
121 |
+ ;; |
122 |
+ esac |
123 |
+} |
124 |
+ |
125 |
# Create our multilib dirs - the Makefile has no knowledge of this |
126 |
multilib_layout() { |
127 |
local dir def_libdir libdir libdirs |
128 |
@@ -52,6 +80,7 @@ multilib_layout() { |
129 |
die "Unable to create ${dir} directory" |
130 |
fi |
131 |
done |
132 |
+ riscv_compat_symlink "${def_libdir}" "${prefix}${def_libdir}/${DEFAULT_ABI}" |
133 |
done |
134 |
return 0 |
135 |
fi |
136 |
@@ -282,6 +311,18 @@ pkg_postinst() { |
137 |
fi |
138 |
fi |
139 |
|
140 |
+ # https://bugs.gentoo.org/361349 |
141 |
+ if use kernel_linux; then |
142 |
+ mkdir -p "${EROOT}"/run || die |
143 |
+ |
144 |
+ local found fstype mountpoint |
145 |
+ while read -r _ mountpoint fstype _; do |
146 |
+ [[ ${mountpoint} = /run ]] && [[ ${fstype} = tmpfs ]] && found=1 |
147 |
+ done < "${ROOT}"/proc/mounts |
148 |
+ [[ -z ${found} ]] && |
149 |
+ ewarn "You should reboot now to get /run mounted with tmpfs!" |
150 |
+ fi |
151 |
+ |
152 |
for x in ${REPLACING_VERSIONS}; do |
153 |
if ver_test 2.4 -lt ${x}; then |
154 |
ewarn "After updating ${EROOT}/etc/profile, please run" |