2023-08-24 21:31:02 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitLab
|
|
|
|
, dpkg
|
|
|
|
, gawk
|
|
|
|
, perl
|
|
|
|
, wget
|
|
|
|
, binutils
|
|
|
|
, bzip2
|
|
|
|
, coreutils
|
|
|
|
, util-linux
|
|
|
|
, gnugrep
|
|
|
|
, gnupg1
|
|
|
|
, gnutar
|
|
|
|
, gnused
|
|
|
|
, gzip
|
|
|
|
, xz
|
|
|
|
, makeWrapper
|
|
|
|
, nix-update-script
|
|
|
|
, testers
|
|
|
|
, debootstrap
|
|
|
|
}:
|
|
|
|
|
2012-09-19 09:48:27 +00:00
|
|
|
# USAGE like this: debootstrap sid /tmp/target-chroot-directory
|
|
|
|
# There is also cdebootstrap now. Is that easier to maintain?
|
2021-01-15 09:19:50 +00:00
|
|
|
let binPath = lib.makeBinPath [
|
2022-12-26 08:03:08 +00:00
|
|
|
binutils
|
|
|
|
bzip2
|
2018-10-19 22:24:21 +00:00
|
|
|
coreutils
|
|
|
|
dpkg
|
|
|
|
gawk
|
|
|
|
gnugrep
|
2021-10-20 19:07:26 +00:00
|
|
|
gnupg1
|
2018-10-19 22:24:21 +00:00
|
|
|
gnused
|
|
|
|
gnutar
|
|
|
|
gzip
|
|
|
|
perl
|
|
|
|
wget
|
2022-12-26 08:01:08 +00:00
|
|
|
xz
|
2018-10-19 22:24:21 +00:00
|
|
|
];
|
|
|
|
in stdenv.mkDerivation rec {
|
2019-07-12 17:12:14 +00:00
|
|
|
pname = "debootstrap";
|
2024-08-05 09:43:48 +00:00
|
|
|
version = "1.0.137";
|
2009-10-08 00:54:31 +00:00
|
|
|
|
2022-03-31 01:52:52 +00:00
|
|
|
src = fetchFromGitLab {
|
|
|
|
domain = "salsa.debian.org";
|
|
|
|
owner = "installer-team";
|
2024-08-05 09:43:48 +00:00
|
|
|
repo = "debootstrap";
|
2023-08-24 21:31:02 +00:00
|
|
|
rev = "refs/tags/${version}";
|
2024-08-05 09:43:48 +00:00
|
|
|
hash = "sha256-l4vdojsrHAJsa8RwZezH3uI6pWJHK/PBs+YZCtnpXnQ=";
|
2009-10-08 00:54:31 +00:00
|
|
|
};
|
2012-09-19 09:48:27 +00:00
|
|
|
|
2018-10-19 22:24:21 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
2009-10-08 00:54:31 +00:00
|
|
|
|
2016-05-04 10:08:35 +00:00
|
|
|
dontBuild = true;
|
2009-10-08 00:54:31 +00:00
|
|
|
|
|
|
|
installPhase = ''
|
2018-10-19 22:24:21 +00:00
|
|
|
runHook preInstall
|
2012-09-19 09:48:27 +00:00
|
|
|
|
2018-10-19 22:24:21 +00:00
|
|
|
substituteInPlace debootstrap \
|
|
|
|
--replace 'CHROOT_CMD="chroot ' 'CHROOT_CMD="${coreutils}/bin/chroot ' \
|
2020-11-24 15:29:28 +00:00
|
|
|
--replace 'CHROOT_CMD="unshare ' 'CHROOT_CMD="${util-linux}/bin/unshare ' \
|
2018-10-19 22:24:21 +00:00
|
|
|
--replace /usr/bin/dpkg ${dpkg}/bin/dpkg \
|
|
|
|
--replace '#!/bin/sh' '#!/bin/bash' \
|
|
|
|
--subst-var-by VERSION ${version}
|
2012-09-19 09:48:27 +00:00
|
|
|
|
|
|
|
d=$out/share/debootstrap
|
2014-06-30 12:56:10 +00:00
|
|
|
mkdir -p $out/{share/debootstrap,bin}
|
2012-09-19 09:48:27 +00:00
|
|
|
|
2018-10-19 22:24:21 +00:00
|
|
|
mv debootstrap $out/bin
|
|
|
|
|
2012-09-19 09:48:27 +00:00
|
|
|
cp -r . $d
|
|
|
|
|
2018-10-19 22:24:21 +00:00
|
|
|
wrapProgram $out/bin/debootstrap \
|
|
|
|
--set PATH ${binPath} \
|
|
|
|
--set-default DEBOOTSTRAP_DIR $d
|
2012-09-19 09:48:27 +00:00
|
|
|
|
2014-06-30 12:56:10 +00:00
|
|
|
mkdir -p $out/man/man8
|
2012-09-19 09:48:27 +00:00
|
|
|
mv debootstrap.8 $out/man/man8
|
2018-10-19 22:24:21 +00:00
|
|
|
|
|
|
|
rm -rf $d/debian
|
|
|
|
|
|
|
|
runHook postInstall
|
2009-10-08 00:54:31 +00:00
|
|
|
'';
|
2012-09-19 09:48:27 +00:00
|
|
|
|
2023-08-24 21:31:02 +00:00
|
|
|
passthru = {
|
|
|
|
updateScript = nix-update-script { };
|
|
|
|
tests.version = testers.testVersion {
|
|
|
|
package = debootstrap;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2023-08-24 21:31:02 +00:00
|
|
|
changelog = "https://salsa.debian.org/installer-team/debootstrap/-/blob/${version}/debian/changelog";
|
2010-07-28 11:55:54 +00:00
|
|
|
description = "Tool to create a Debian system in a chroot";
|
2020-03-04 19:34:32 +00:00
|
|
|
homepage = "https://wiki.debian.org/Debootstrap";
|
2019-07-12 17:12:14 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ marcweber ];
|
|
|
|
platforms = platforms.linux;
|
2023-11-27 01:17:53 +00:00
|
|
|
mainProgram = "debootstrap";
|
2009-10-08 00:54:31 +00:00
|
|
|
};
|
|
|
|
}
|