Use arx instead of makeself.

This commit is contained in:
Matthew Bauer 2016-06-17 17:37:23 +00:00
parent 36ebf90e18
commit 8be15d73f2
5 changed files with 36 additions and 31 deletions

15
arx.nix Normal file
View File

@ -0,0 +1,15 @@
{ stdenv, arx }:
{ name
, archive
, startup
}:
stdenv.mkDerivation {
inherit name;
nativeBuildInputs = [ arx ];
buildCommand = ''
${arx}/bin/arx tmpx ${archive} -o $out -e ${startup}
chmod +x $out
'';
}

View File

@ -4,12 +4,17 @@ with nixpkgs;
let
makeself = callPackage ./makeself.nix {};
makedir = callPackage ./makedir.nix {};
arx = callPackage ./arx.nix {
inherit (haskellPackages) arx;
};
maketar = callPackage ./maketar.nix {
};
nix-installer = callPackage ./nix-installer.nix {};
makebootstrap = callPackage ./makebootstrap.nix {
inherit makedir makeself;
inherit arx maketar;
};
nix-user-chroot = callPackage ./nix-user-chroot.nix {};

View File

@ -1,11 +1,10 @@
{makeself, makedir}:
{ arx, maketar }:
{ name, target, run }:
makeself {
arx {
inherit name;
startup = ".${target}${run}";
archive = makedir {
name = "${name}-dir";
toplevel = target;
startup = "${target}${run}";
archive = maketar {
inherit name target;
};
}

View File

@ -1,14 +0,0 @@
{ stdenv, makeself }:
{ name
, archive
, startup
}:
stdenv.mkDerivation {
inherit name archive startup;
nativeBuildInputs = [ makeself ];
buildCommand = ''
${makeself}/bin/makeself --xz $archive $out $name $startup
'';
}

View File

@ -1,17 +1,17 @@
{ stdenv, perl, pathsFromGraph }:
{ name, toplevel }:
{ name, target }:
stdenv.mkDerivation {
inherit toplevel name;
exportReferencesGraph = [ "closure" toplevel ];
inherit name;
exportReferencesGraph = [ "closure" target ];
nativeBuildInputs = [ perl ];
buildCommand = ''
mkdir -p $out
storePaths=$(${perl}/bin/perl ${pathsFromGraph} ./closure)
printRegistration=1 ${perl}/bin/perl ${pathsFromGraph} ./closure > $out/.reginfo
for path in $storePaths; do
cp --parents -rp $path $out/
done
printRegistration=1 ${perl}/bin/perl ${pathsFromGraph} ./closure > .reginfo
tar cvfj $out \
--owner=0 --group=0 --mode=u+rw,uga+r \
--hard-dereference \
.reginfo $storePaths
'';
}