Files
pkgmgr/packaging/debian/rules
Kevin Veen-Birkenbach fb0b81954d
Some checks failed
Mark stable commit / test-unit (push) Has been cancelled
Mark stable commit / test-integration (push) Has been cancelled
Mark stable commit / test-env-virtual (push) Has been cancelled
Mark stable commit / test-env-nix (push) Has been cancelled
Mark stable commit / test-e2e (push) Has been cancelled
Mark stable commit / test-virgin-user (push) Has been cancelled
Mark stable commit / test-virgin-root (push) Has been cancelled
Mark stable commit / mark-stable (push) Has been cancelled
**Fix Nix bootstrap installation by shipping init script and libraries together**
* Install the complete Nix bootstrap (*init.sh* and *lib/*) into */usr/lib/package-manager/nix/* for Arch, Debian, and Fedora
* Align packaging paths with the expectations of the modularized *nix/init.sh*
* Prevent runtime failures caused by missing sourced library scripts

https://chatgpt.com/share/693c7159-b340-800f-929e-2515eeb0dd03
2025-12-12 21:02:26 +01:00

58 lines
2.3 KiB
Makefile
Executable File

#!/usr/bin/make -f
%:
dh $@
# ---------------------------------------------------------------------------
# Disable automatic build + tests for Debian package
#
# The package is effectively a wrapper around the project source and the
# Nix flake. We do not need dh_auto_build to invoke the top-level Makefile,
# because that Makefile is meant for developer workflows (venv, setup, etc.)
# and would fail in the minimal build environment.
# ---------------------------------------------------------------------------
override_dh_auto_build:
# No build step required for this package; skip calling the top-level Makefile.
:
override_dh_auto_test:
# We do not run tests as part of the Debian package build.
:
# ---------------------------------------------------------------------------
# Install phase: copy wrapper + Nix bootstrap (init + lib) + full project source
# ---------------------------------------------------------------------------
override_dh_auto_install:
# Create target directories
install -d debian/package-manager/usr/bin
install -d debian/package-manager/usr/lib/package-manager
# Install wrapper
install -m0755 scripts/pkgmgr-wrapper.sh \
debian/package-manager/usr/bin/pkgmgr
# Install Nix bootstrap (init + lib)
install -d debian/package-manager/usr/lib/package-manager/nix
cp -a scripts/nix/* \
debian/package-manager/usr/lib/package-manager/nix/
chmod 0755 debian/package-manager/usr/lib/package-manager/nix/init.sh
# Copy full project source into /usr/lib/package-manager,
# but do not include the debian/ directory itself.
find . -mindepth 1 -maxdepth 1 \
! -name debian \
! -name .git \
-exec cp -a {} debian/package-manager/usr/lib/package-manager/ \;
# Remove packaging-only and development artefacts from the installed tree
rm -rf \
debian/package-manager/usr/lib/package-manager/debian \
debian/package-manager/usr/lib/package-manager/PKGBUILD \
debian/package-manager/usr/lib/package-manager/Dockerfile \
debian/package-manager/usr/lib/package-manager/.git \
debian/package-manager/usr/lib/package-manager/.github \
debian/package-manager/usr/lib/package-manager/tests \
debian/package-manager/usr/lib/package-manager/.gitignore \
debian/package-manager/usr/lib/package-manager/__pycache__ \
debian/package-manager/usr/lib/package-manager/.gitkeep || true