mirror of
https://github.com/morgan9e/systemd
synced 2026-04-14 00:14:32 +09:00
Split out script for musl builds (#39758)
This commit is contained in:
74
.github/workflows/build-test-musl.sh
vendored
74
.github/workflows/build-test-musl.sh
vendored
@@ -20,75 +20,5 @@ cleanup() (
|
||||
|
||||
trap cleanup EXIT ERR INT TERM
|
||||
|
||||
mkdir -p "${TMPDIR}/build"
|
||||
mkdir -p "${TMPDIR}/usr/include"
|
||||
mkdir -p "${TMPDIR}/usr/lib64/pkgconfig"
|
||||
|
||||
CFLAGS="-idirafter ${TMPDIR}/usr/include"
|
||||
export PKG_CONFIG_PATH="${TMPDIR}"/usr/lib64/pkgconfig
|
||||
|
||||
LINKS=(
|
||||
acl
|
||||
archive.h
|
||||
archive_entry.h
|
||||
asm
|
||||
asm-generic
|
||||
audit-records.h
|
||||
audit_logging.h
|
||||
bpf
|
||||
bzlib.h
|
||||
curl
|
||||
dwarf.h
|
||||
elfutils
|
||||
fido.h
|
||||
gcrypt.h
|
||||
gelf.h
|
||||
gnutls
|
||||
gpg-error.h
|
||||
idn2.h
|
||||
libaudit.h
|
||||
libcryptsetup.h
|
||||
libelf.h
|
||||
libkmod.h
|
||||
linux
|
||||
lz4.h
|
||||
lz4frame.h
|
||||
lz4hc.h
|
||||
lzma
|
||||
lzma.h
|
||||
microhttpd.h
|
||||
mtd
|
||||
openssl
|
||||
pcre2.h
|
||||
pwquality.h
|
||||
qrencode.h
|
||||
seccomp-syscalls.h
|
||||
seccomp.h
|
||||
security
|
||||
selinux
|
||||
sys/acl.h
|
||||
sys/capability.h
|
||||
tss2
|
||||
xen
|
||||
xkbcommon
|
||||
zconf.h
|
||||
zlib.h
|
||||
zstd.h
|
||||
zstd_errors.h
|
||||
)
|
||||
|
||||
for t in "${LINKS[@]}"; do
|
||||
[[ -e /usr/include/"$t" ]]
|
||||
link="${TMPDIR}"/usr/include/"${t}"
|
||||
mkdir -p "${link%/*}"
|
||||
ln -s /usr/include/"$t" "$link"
|
||||
done
|
||||
|
||||
env \
|
||||
CC=musl-gcc \
|
||||
CXX=musl-gcc \
|
||||
CFLAGS="$CFLAGS" \
|
||||
CXXFLAGS="$CFLAGS" \
|
||||
meson setup --werror -Ddbus-interfaces-dir=no -Dlibc=musl "${TMPDIR}"/build
|
||||
|
||||
ninja -v -C "${TMPDIR}"/build
|
||||
tools/setup-musl-build.sh "${TMPDIR}/build"
|
||||
ninja -v -C "${TMPDIR}/build"
|
||||
|
||||
2
.github/workflows/unit-tests-musl.sh
vendored
2
.github/workflows/unit-tests-musl.sh
vendored
@@ -37,7 +37,7 @@ for phase in "${PHASES[@]}"; do
|
||||
info "Run phase"
|
||||
|
||||
# Create dummy machine ID.
|
||||
echo '052e58f661f94bd080e258b96aea3f7b' > /etc/machine-id
|
||||
echo '052e58f661f94bd080e258b96aea3f7b' >/etc/machine-id
|
||||
|
||||
# Start dbus for several unit tests.
|
||||
mkdir -p /var/run/dbus
|
||||
|
||||
85
tools/setup-musl-build.sh
Executable file
85
tools/setup-musl-build.sh
Executable file
@@ -0,0 +1,85 @@
|
||||
#!/bin/bash
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
# Usage:
|
||||
# tools/setup-musl-build.sh <build-directory> <options…>
|
||||
# E.g.
|
||||
# tools/setup-musl-build.sh build-musl -Dbuildtype=debugoptimized && ninja -C build-musl
|
||||
|
||||
set -eu
|
||||
|
||||
BUILD_DIR="${1:?}"
|
||||
shift
|
||||
|
||||
SETUP_DIR="${BUILD_DIR}/extra"
|
||||
|
||||
LINKS=(
|
||||
acl
|
||||
archive.h
|
||||
archive_entry.h
|
||||
asm
|
||||
asm-generic
|
||||
audit-records.h
|
||||
audit_logging.h
|
||||
bpf
|
||||
bzlib.h
|
||||
curl
|
||||
dwarf.h
|
||||
elfutils
|
||||
fido.h
|
||||
gcrypt.h
|
||||
gelf.h
|
||||
gnutls
|
||||
gpg-error.h
|
||||
idn2.h
|
||||
libaudit.h
|
||||
libcryptsetup.h
|
||||
libelf.h
|
||||
libkmod.h
|
||||
linux
|
||||
lz4.h
|
||||
lz4frame.h
|
||||
lz4hc.h
|
||||
lzma
|
||||
lzma.h
|
||||
microhttpd.h
|
||||
mtd
|
||||
openssl
|
||||
pcre2.h
|
||||
pwquality.h
|
||||
qrencode.h
|
||||
seccomp-syscalls.h
|
||||
seccomp.h
|
||||
security
|
||||
selinux
|
||||
sys/acl.h
|
||||
sys/capability.h
|
||||
tss2
|
||||
xen
|
||||
xkbcommon
|
||||
zconf.h
|
||||
zlib.h
|
||||
zstd.h
|
||||
zstd_errors.h
|
||||
)
|
||||
|
||||
for t in "${LINKS[@]}"; do
|
||||
[[ -e /usr/include/"$t" ]]
|
||||
link="${SETUP_DIR}/usr/include/${t}"
|
||||
mkdir -p "${link%/*}"
|
||||
ln -s /usr/include/"$t" "$link"
|
||||
done
|
||||
|
||||
# Use an absolute path so that when we chdir into the build directory,
|
||||
# the path still works. This is easier than figuring out the relative path.
|
||||
[[ "${SETUP_DIR}" =~ ^/ ]] || SETUP_DIR="${PWD}/${SETUP_DIR}"
|
||||
|
||||
CFLAGS="-idirafter ${SETUP_DIR}/usr/include"
|
||||
|
||||
set -x
|
||||
env \
|
||||
CC=musl-gcc \
|
||||
CXX=musl-gcc \
|
||||
CFLAGS="$CFLAGS" \
|
||||
CXXFLAGS="$CFLAGS" \
|
||||
meson setup -Ddbus-interfaces-dir=no -Dlibc=musl "${BUILD_DIR}" "${@}"
|
||||
Reference in New Issue
Block a user