nixpkgs/pkgs/tools/virtualization/udocker/default.nix
Profpatsch 4a7f99d55d treewide: with stdenv.lib; in meta -> with lib;
Part of: https://github.com/NixOS/nixpkgs/issues/108938

meta = with stdenv.lib;

is a widely used pattern. We want to slowly remove
the `stdenv.lib` indirection and encourage people
to use `lib` directly. Thus let’s start with the meta
field.

This used a rewriting script to mostly automatically
replace all occurances of this pattern, and add the
`lib` argument to the package header if it doesn’t
exist yet.

The script in its current form is available at
https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
2021-01-11 10:38:22 +01:00

43 lines
1.3 KiB
Nix

{ lib, stdenv, fetchFromGitHub, proot, patchelf, fakechroot, runc, simplejson, pycurl, coreutils, nose, mock, buildPythonApplication }:
buildPythonApplication rec {
version = "1.1.3";
pname = "udocker";
src = fetchFromGitHub {
owner = "indigo-dc";
repo = "udocker" ;
rev = "v${version}";
sha256 = "1c8y1p3brj987drikwrby8m1hdr40ja4anx0p4xsij3ll2h62w6z";
};
buildInputs = [ proot patchelf fakechroot runc simplejson pycurl coreutils ];
postPatch = ''
substituteInPlace udocker.py --replace /usr/sbin:/sbin:/usr/bin:/bin $PATH
substituteInPlace udocker.py --replace /bin/chmod ${coreutils}/bin/chmod
substituteInPlace udocker.py --replace /bin/rm ${coreutils}/bin/rm
substituteInPlace tests/unit_tests.py --replace /bin/rm ${coreutils}/bin/rm
substituteInPlace udocker.py --replace "autoinstall = True" "autoinstall = False"
'';
checkInputs = [
nose
mock
];
checkPhase = ''
NOSE_EXCLUDE=test_03_create_repo,test_04_is_repo,test_02__get_group_from_host nosetests -v tests/unit_tests.py
'';
meta = with lib; {
description = "basic user tool to execute simple docker containers in user space without root privileges";
homepage = "https://indigo-dc.gitbooks.io/udocker";
license = licenses.asl20;
maintainers = [ maintainers.bzizou ];
platforms = platforms.linux;
};
}