**Fix Nix bootstrap installation by shipping init script and libraries together**
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

* 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
This commit is contained in:
Kevin Veen-Birkenbach
2025-12-12 21:02:26 +01:00
parent b9b4c3fa59
commit fb0b81954d
3 changed files with 13 additions and 10 deletions

View File

@@ -50,9 +50,10 @@ package() {
install -Dm0755 "scripts/pkgmgr-wrapper.sh" \ install -Dm0755 "scripts/pkgmgr-wrapper.sh" \
"$pkgdir/usr/bin/pkgmgr" "$pkgdir/usr/bin/pkgmgr"
# Install Nix init helper # Install Nix bootstrap (init + lib)
install -Dm0755 "scripts/nix/init.sh" \ install -d "$pkgdir/usr/lib/package-manager/nix"
"$pkgdir/usr/lib/package-manager/nix/init.sh" cp -a scripts/nix/* "$pkgdir/usr/lib/package-manager/nix/"
chmod 0755 "$pkgdir/usr/lib/package-manager/nix/init.sh"
# Install the full repository into /usr/lib/package-manager # Install the full repository into /usr/lib/package-manager
mkdir -p "$pkgdir/usr/lib/package-manager" mkdir -p "$pkgdir/usr/lib/package-manager"

View File

@@ -20,7 +20,7 @@ override_dh_auto_test:
: :
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
# Install phase: copy wrapper + init script + full project source # Install phase: copy wrapper + Nix bootstrap (init + lib) + full project source
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
override_dh_auto_install: override_dh_auto_install:
# Create target directories # Create target directories
@@ -31,10 +31,11 @@ override_dh_auto_install:
install -m0755 scripts/pkgmgr-wrapper.sh \ install -m0755 scripts/pkgmgr-wrapper.sh \
debian/package-manager/usr/bin/pkgmgr debian/package-manager/usr/bin/pkgmgr
# Install shared Nix init script # Install Nix bootstrap (init + lib)
install -d debian/package-manager/usr/lib/package-manager/nix install -d debian/package-manager/usr/lib/package-manager/nix
install -m0755 scripts/nix/init.sh \ cp -a scripts/nix/* \
debian/package-manager/usr/lib/package-manager/nix/init.sh 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, # Copy full project source into /usr/lib/package-manager,
# but do not include the debian/ directory itself. # but do not include the debian/ directory itself.

View File

@@ -34,8 +34,8 @@ available on the system.
%install %install
rm -rf %{buildroot} rm -rf %{buildroot}
install -d %{buildroot}%{_bindir} install -d %{buildroot}%{_bindir}
# Install project tree into a fixed, architecture-independent location.
install -d %{buildroot}/usr/lib/package-manager install -d %{buildroot}/usr/lib/package-manager
# Copy full project source into /usr/lib/package-manager # Copy full project source into /usr/lib/package-manager
@@ -44,9 +44,10 @@ cp -a . %{buildroot}/usr/lib/package-manager/
# Wrapper # Wrapper
install -m0755 scripts/pkgmgr-wrapper.sh %{buildroot}%{_bindir}/pkgmgr install -m0755 scripts/pkgmgr-wrapper.sh %{buildroot}%{_bindir}/pkgmgr
# Shared Nix init script (ensure it is executable in the installed tree) # Nix bootstrap (init + lib)
install -d %{buildroot}/usr/lib/package-manager/nix install -d %{buildroot}/usr/lib/package-manager/nix
install -m0755 scripts/nix/init.sh %{buildroot}/usr/lib/package-manager/nix/init.sh cp -a scripts/nix/* %{buildroot}/usr/lib/package-manager/nix/
chmod 0755 %{buildroot}/usr/lib/package-manager/nix/init.sh
# Remove packaging-only and development artefacts from the installed tree # Remove packaging-only and development artefacts from the installed tree
rm -rf \ rm -rf \