diff --git a/.circleci/config.yml b/.circleci/config.yml index e9d04cfa1..a49de0d6e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -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 diff --git a/debian/control b/debian/control index 99c2fea8e..c1c12c804 100644 --- a/debian/control +++ b/debian/control @@ -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 diff --git a/debian/darling-dkms.lintian-overrides b/debian/darling-dkms.lintian-overrides deleted file mode 100644 index d2f90a98e..000000000 --- a/debian/darling-dkms.lintian-overrides +++ /dev/null @@ -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 diff --git a/debian/rules b/debian/rules index 93b6707cd..76c6812d9 100755 --- a/debian/rules +++ b/debian/rules @@ -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~ diff --git a/debian/source/lintian-overrides b/debian/source/lintian-overrides deleted file mode 100644 index cbf5567bb..000000000 --- a/debian/source/lintian-overrides +++ /dev/null @@ -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 diff --git a/tools/makedeb b/tools/debian/make-deb similarity index 86% rename from tools/makedeb rename to tools/debian/make-deb index c09125983..acd078b9a 100755 --- a/tools/makedeb +++ b/tools/debian/make-deb @@ -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} diff --git a/tools/debian/make-shlibdeps b/tools/debian/make-shlibdeps new file mode 100755 index 000000000..a72fef20e --- /dev/null +++ b/tools/debian/make-shlibdeps @@ -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}" diff --git a/tools/debian/make-shlibdeps-file b/tools/debian/make-shlibdeps-file new file mode 100755 index 000000000..3622d9018 --- /dev/null +++ b/tools/debian/make-shlibdeps-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