blob: c892f383e80a8feb07de6ef665e1bb3ee3733662 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
|
# Copyright 2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit flag-o-matic multiprocessing toolchain-funcs
DESCRIPTION="NetBSD's rumpkernel for the Hurd"
HOMEPAGE="https://salsa.debian.org/hurd-team/rumpkernel https://darnassus.sceen.net/~hurd-web/hurd/rump/ https://rumpkernel.github.io/"
if [[ ${PV} == *9999* ]] ; then
# Actual upstream is NetBSD's monorepo, but Debian is the de facto
# upstream and there's a lot of Hurd-related patches. But it may
# still be useful on occasion to cherry-pick something from NetBSD.
EGIT_REPO_URI="https://salsa.debian.org/hurd-team/rumpkernel.git"
inherit git-r3
elif [[ ${PV} == *_pre*_p* ]] ; then
# These are proper Debian relaeses. rumpkernel isn't currently
# part of the Debian archive, so this is the best we can do (no
# 'orig' tarballs).
RUMPKERNEL_PV=0_$(ver_cut 3)-$(ver_cut 5)
SRC_URI="https://salsa.debian.org/hurd-team/rumpkernel/-/archive/debian/${RUMPKERNEL_PV}/rumpkernel-debian-${RUMPKERNEL_PV}.tar.bz2"
S="${WORKDIR}"/${PN}-debian-${RUMPKERNEL_PV}
else
# Snapshots
RUMPKERNEL_COMMIT="c65c4413295247f3390385fb623215d3bd8d6052"
SRC_URI="https://salsa.debian.org/hurd-team/rumpkernel/-/archive/${RUMPKERNEL_COMMIT}/rumpkernel-${RUMPKERNEL_COMMIT}.tar.bz2"
fi
# A lot from NetBSD, see:
# https://salsa.debian.org/hurd-team/rumpkernel/-/blob/master/debian/copyright
LICENSE="Apache-2.0 Boost-1.0 BSD BSD-2 BSD-4 CDDL GPL-1 GPL-2+ GPL-3+ ISC
LGPL-2.1+ MIT public-domain ZLIB"
SLOT="0"
if [[ ${PV} != *9999* ]] ; then
KEYWORDS="~amd64 ~x86"
fi
RDEPEND="
x11-libs/libpciaccess
virtual/zlib:=
"
DEPEND="
${RDEPEND}
dev-util/mig
sys-kernel/gnumach
"
PATCHES=(
"${FILESDIR}"/${PN}-0_p20250111_p6-bsd-own-mk-no-sysroot.patch
)
src_prepare() {
default
eapply $(sed -e 's:^:debian/patches/:' debian/patches/series || die)
}
src_configure() {
# TODO: conflict with -pg but we might not need -pg to begin with;
# objects get built thrice (regular, -pg, -fPIC).
filter-flags -fomit-frame-pointer
export HOST_CC=$(tc-getBUILD_CC)
export HOST_CPPFLAGS=-D_GNU_SOURCE
export TARGET_AR=${CHOST}-ar
export TARGET_CC=${CHOST}-gcc
export TARGET_CXX=${CHOST}-g++
export TARGET_LD=${CHOST}-ld
export TARGET_MIG=${CHOST}-mig
export TARGET_NM=${CHOST}-nm
export MIG=${CHOST}-mig
export _GCC_CRTENDS= _GCC_CRTEND= _GCC_CRTBEGINS= _GCC_CRTBEGIN= _GCC_CRTI= _GCC_CRTN=
export BSDOBJDIR="${S}"/obj
cd buildrump.sh/src/lib/librumpuser || die "Couldn't change to the build directory"
econf
case ${CHOST} in
i[3-7]86*)
NBARCH=i386
;;
x86_64*)
NBARCH=amd64
;;
*)
die "Unknown NetBSD arch for this CHOST"
;;
esac
NBMAKE="${S}"/buildrump.sh/src/obj/tooldir/bin/nbmake-${NBARCH}
}
src_compile() {
cd buildrump.sh/src || die "Couldn't change to the build directory"
mkdir -p obj || die "Couldn't make obj dir"
local buildrump_cppflags=(
-I"${S}"/buildrump.sh/src/obj/destdir.${NBARCH}/usr/include
-D_FILE_OFFSET_BITS=64
-DRUMP_REGISTER_T=int
-DRUMPUSER_CONFIG=yes
-DNO_PCI_MSI_MSIX=yes
-DNUSB_DMA=1
-DPAE
-DBUFPAGES=16
# Workaround broken open() call
-U_FORTIFY_SOURCE
# libipsec doesn't get CWARNFLAGS, apparently
-Wno-error=unused-but-set-variable
)
local buildrump_warnflags=(
-Wno-error=unused-but-set-variable
-Wno-error=maybe-uninitialized
-Wno-error=address-of-packed-member
-Wno-error=unused-variable
-Wno-error=stack-protector
-Wno-error=array-parameter
-Wno-error=array-bounds
-Wno-error=stringop-overflow
-Wno-error=int-to-pointer-cast
-Wno-error=incompatible-pointer-types
-Wno-error=unterminated-string-initialization
-Wno-error=format-nonliteral
-Wno-error=sign-compare
)
local mybuildshargs=(
-V TOOLS_BUILDRUMP=yes
-V MKBINUTILS=no
-V MKGDB=no
-V MKGROFF=no
-V MKDTRACE=no
-V MKZFS=no
-V TOPRUMP="${S}"/buildrump.sh/src/sys/rump
-V BUILDRUMP_CPPFLAGS="-Wno-error=stringop-overread"
-V RUMPUSER_EXTERNAL_DPLIBS=pthread
-V CPPFLAGS="${buildrump_cppflags[*]}"
-V CWARNFLAGS="${buildrump_warnflags[*]}"
#-V TARGET_LDADD="-Wl,-v -v"
-V _GCC_CRTENDS="" -V _GCC_CRTEND=""
-V _GCC_CRTBEGINS="" -V _GCC_CRTBEGIN=""
-V _GCC_CRTI="" -V _GCC_CRTN=""
-V MIG=${CHOST}-mig
-m ${NBARCH}
-U -u
-j $(get_makeopts_jobs)
-T ./obj/tooldir
)
# The Makefiles scattered across NetBSD use $S everywhere. So we
# will get rid of this. Otherwise, you won't see some things build
# in the correct directory. Thank you sam
(
_S="${S}"
unset S
ebegin "Building tools + rumpkernel"
./build.sh "${mybuildshargs[@]}" tools rump
eend $? || die "rumpkernel's ./build.sh failed"
cd "${_S}"/buildrump.sh/src/lib/librumpuser || die "couldn't cd"
ebegin "Building librumpuser"
RUMPRUN=true ${NBMAKE} -j$(get_makeopts_jobs) MIG=${CHOST}-mig dependall
eend $? || die "librumpuser build failed"
cd "${_S}"/pci-userspace/src-gnu || die "couldn't cd"
ebegin "Building pci-userspace"
${NBMAKE} -j$(get_makeopts_jobs) MIG=${CHOST}-mig dependall
eend $? || die "pci-userspace build failed"
)
}
src_install() {
dodir /usr/include /usr/$(get_libdir)
# Install logic copied from Debian
cp -a "${S}"/buildrump.sh/src/sys/rump/include/rump "${ED}"/usr/include/ || die
# Kept "${S}"/buildrump.sh/src/obj separate here as may change to
# another builddir.
find "${S}"/buildrump.sh/src "${S}"/buildrump.sh/src/obj -type f,l \
-name "librump*.so*" -exec cp -a {} "${ED}"/usr/$(get_libdir)/ \; || die
find "${S}"/buildrump.sh/src "${S}"/buildrump.sh/src/obj -type f \
-name "librump*.a" -exec cp -a {} "${ED}"/usr/$(get_libdir)/ \; || die
# rempve non lib files
rm -f "${ED}"/usr/$(get_libdir)/*.map || die
#
rm -f "${ED}"/usr/$(get_libdir)/librumpkern_z.* || die
}
|