mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-13 09:13:17 +00:00
571c71e6f7
We are migrating packages that meet below requirements: 1. using `callPackage` 2. called path is a directory 3. overriding set is empty (`{ }`) 4. not containing path expressions other than relative path (to makenixpkgs-vet happy) 5. not referenced by nix files outside of the directory, other than`pkgs/top-level/all-packages.nix` 6. not referencing nix files outside of the directory 7. not referencing `default.nix` (since it's changed to `package.nix`) 8. `outPath` doesn't change after migration The tool is here: https://github.com/Aleksanaa/by-name-migrate.
103 lines
2.1 KiB
Nix
103 lines
2.1 KiB
Nix
{ lib
|
|
, stdenv
|
|
, fetchFromGitLab
|
|
, dpkg
|
|
, gawk
|
|
, perl
|
|
, wget
|
|
, binutils
|
|
, bzip2
|
|
, coreutils
|
|
, util-linux
|
|
, gnugrep
|
|
, gnupg1
|
|
, gnutar
|
|
, gnused
|
|
, gzip
|
|
, xz
|
|
, makeWrapper
|
|
, nix-update-script
|
|
, testers
|
|
, debootstrap
|
|
}:
|
|
|
|
# USAGE like this: debootstrap sid /tmp/target-chroot-directory
|
|
# There is also cdebootstrap now. Is that easier to maintain?
|
|
let binPath = lib.makeBinPath [
|
|
binutils
|
|
bzip2
|
|
coreutils
|
|
dpkg
|
|
gawk
|
|
gnugrep
|
|
gnupg1
|
|
gnused
|
|
gnutar
|
|
gzip
|
|
perl
|
|
wget
|
|
xz
|
|
];
|
|
in stdenv.mkDerivation rec {
|
|
pname = "debootstrap";
|
|
version = "1.0.137";
|
|
|
|
src = fetchFromGitLab {
|
|
domain = "salsa.debian.org";
|
|
owner = "installer-team";
|
|
repo = "debootstrap";
|
|
rev = "refs/tags/${version}";
|
|
hash = "sha256-l4vdojsrHAJsa8RwZezH3uI6pWJHK/PBs+YZCtnpXnQ=";
|
|
};
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
dontBuild = true;
|
|
|
|
installPhase = ''
|
|
runHook preInstall
|
|
|
|
substituteInPlace debootstrap \
|
|
--replace 'CHROOT_CMD="chroot ' 'CHROOT_CMD="${coreutils}/bin/chroot ' \
|
|
--replace 'CHROOT_CMD="unshare ' 'CHROOT_CMD="${util-linux}/bin/unshare ' \
|
|
--replace /usr/bin/dpkg ${dpkg}/bin/dpkg \
|
|
--replace '#!/bin/sh' '#!/bin/bash' \
|
|
--subst-var-by VERSION ${version}
|
|
|
|
d=$out/share/debootstrap
|
|
mkdir -p $out/{share/debootstrap,bin}
|
|
|
|
mv debootstrap $out/bin
|
|
|
|
cp -r . $d
|
|
|
|
wrapProgram $out/bin/debootstrap \
|
|
--set PATH ${binPath} \
|
|
--set-default DEBOOTSTRAP_DIR $d
|
|
|
|
mkdir -p $out/man/man8
|
|
mv debootstrap.8 $out/man/man8
|
|
|
|
rm -rf $d/debian
|
|
|
|
runHook postInstall
|
|
'';
|
|
|
|
passthru = {
|
|
updateScript = nix-update-script { };
|
|
tests.version = testers.testVersion {
|
|
package = debootstrap;
|
|
};
|
|
};
|
|
|
|
meta = with lib; {
|
|
changelog = "https://salsa.debian.org/installer-team/debootstrap/-/blob/${version}/debian/changelog";
|
|
description = "Tool to create a Debian system in a chroot";
|
|
homepage = "https://wiki.debian.org/Debootstrap";
|
|
license = licenses.mit;
|
|
maintainers = with maintainers; [ marcweber ];
|
|
platforms = platforms.linux;
|
|
mainProgram = "debootstrap";
|
|
};
|
|
}
|