Merge pull request #825 from TheBrokenRail/better-deb

Use elfdep To get shlibdeps for DEB
This commit is contained in:
Ariel Abreu 2021-04-30 23:47:28 -04:00 committed by GitHub
commit 2880f15a5d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 37 additions and 17 deletions

View File

@ -37,8 +37,7 @@ jobs:
name: Build DSCs
no_output_timeout: 30m
command: |
export DEB_DISTRO=$(lsb_release -cs)
tools/makedeb --dsc
tools/debian/make-deb --dsc
- run:
name: Move DSCs
command: mkdir source && mv ../*~$(lsb_release -cs).* source
@ -46,8 +45,7 @@ jobs:
name: Build DEBs
no_output_timeout: 30m
command: |
export DEB_DISTRO=$(lsb_release -cs)
tools/makedeb
tools/debian/make-deb
- run:
name: Move DEBs
command: mkdir dist && mv ../*.deb dist

2
debian/control vendored
View File

@ -7,7 +7,7 @@ Build-Depends: cmake, clang | clang-9, bison, flex, libfuse-dev, libudev-dev, pk
Package: darling
Architecture: amd64
Depends: ${shlibs:Depends}, ${misc:Depends}, fuse, darling-dkms
Depends: ${shlibs:Depends}, ${misc:Depends}, ${macho:Depends}, fuse, darling-dkms
Description: Darling
macOS emulation layer for Linux

View File

@ -1,3 +0,0 @@
package-contains-vcs-control-file usr/src/darling-mach-0.1/lkm/.gitignore
executable-not-elf-or-script usr/src/darling-mach-0.1/lkm*
extended-description-is-empty

2
debian/rules vendored
View File

@ -11,7 +11,7 @@ override_dh_auto_build:
override_dh_makeshlibs:
dh_makeshlibs
# TODO: append ELF files referenced from Mach-Os into debian/darling.shlibs
tools/debian/make-shlibdeps
override_dh_clean:
dh_clean -X.orig -X.bak -X~

View File

@ -1,6 +0,0 @@
darling source: configure-generated-file-in-source *
darling source: autotools-pkg-config-macro-not-cross-compilation-safe *
darling source: source-contains-prebuilt-windows-binary *
darling source: maintainer-script-lacks-debhelper-token debian/*
darling source: debhelper-but-no-misc-depends darling-dkms
darling source: package-needs-versioned-debhelper-build-depends 10

View File

@ -3,7 +3,7 @@ set -e
DATE=$(date +%Y%m%d)
rm -f debian/changelog
DISTRO=${DEB_DISTRO:-testing}
DISTRO=${DEB_DISTRO:-"$(lsb_release -cs)"}
VERSION=0.1.${DATE}~${DISTRO}
EDITOR=true NAME="Darling build server" EMAIL=${DEB_EMAIL:-noreply@darlinghq.org} dch -u low -v ${VERSION} --create --distribution ${DISTRO} --package darling "Daily build"
@ -17,4 +17,4 @@ else
ARG='-b'
fi
debuild -us -uc ${ARG}
debuild --no-lintian -us -uc ${ARG}

16
tools/debian/make-shlibdeps Executable file
View File

@ -0,0 +1,16 @@
#!/bin/sh
set -e
DEB_PACKAGE='darling'
ARGS_FILE="$(mktemp)"
find "debian/${DEB_PACKAGE}" -type f -exec tools/debian/make-shlibdeps-file "${ARGS_FILE}" {} \;
OUT="$(mktemp)"
clang -shared -o "${OUT}"$(cat ${ARGS_FILE})
dpkg-shlibdeps -T"debian/${DEB_PACKAGE}.substvars" -p"macho" -e"${OUT}" > /dev/null 2>&1
rm -f "${ARGS_FILE}"
rm -f "${OUT}"

View File

@ -0,0 +1,15 @@
#!/bin/sh
set -e
PATH="$(pwd)/debbuild/src/buildtools:${PATH}"
if ! LIBS="$(elfdep "$2" 2>&1)"; then
exit
fi
ARGS=''
for lib in ${LIBS}; do
printf " -l:${lib}" >> "$1"
done