2022-02-05 23:51:58 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchurl
|
|
|
|
, fetchpatch
|
|
|
|
, getopt
|
|
|
|
, libcap
|
|
|
|
, gnused
|
|
|
|
, nixosTests
|
|
|
|
}:
|
2011-01-06 10:43:32 +00:00
|
|
|
|
2012-09-19 09:48:27 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2022-02-05 23:51:58 +00:00
|
|
|
version = "1.27";
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "fakeroot";
|
2011-01-06 10:43:32 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2022-02-05 23:51:58 +00:00
|
|
|
url = "http://http.debian.net/debian/pool/main/f/fakeroot/fakeroot_${version}.orig.tar.gz";
|
|
|
|
sha256 = "1p5d3jq6l1pzk96agkf05dck7dbgvldx5sg2d4h7d8h230nyni9w";
|
2011-01-06 10:43:32 +00:00
|
|
|
};
|
|
|
|
|
2021-05-28 11:13:35 +00:00
|
|
|
patches = lib.optionals stdenv.isLinux [
|
|
|
|
./einval.patch
|
2017-03-02 03:33:33 +00:00
|
|
|
(fetchpatch {
|
2022-02-05 23:51:58 +00:00
|
|
|
name = "also-wrap-stat-library-call.patch";
|
|
|
|
url = "https://sources.debian.org/data/main/f/fakeroot/1.27-1/debian/patches/also-wrap-stat-library-call.patch";
|
|
|
|
sha256 = "0p7lq6m31k3rqsnjbi06a8ykdqa3cp4y5ngsjyk3q1269gx59x8b";
|
2017-03-02 03:33:33 +00:00
|
|
|
})
|
2017-06-17 09:36:39 +00:00
|
|
|
];
|
2017-03-02 03:33:33 +00:00
|
|
|
|
2018-12-25 16:45:43 +00:00
|
|
|
buildInputs = [ getopt gnused ]
|
2021-01-15 09:19:50 +00:00
|
|
|
++ lib.optional (!stdenv.isDarwin) libcap
|
2017-03-02 03:33:33 +00:00
|
|
|
;
|
2012-09-19 09:48:27 +00:00
|
|
|
|
|
|
|
postUnpack = ''
|
2019-08-15 12:41:18 +00:00
|
|
|
sed -i -e "s@getopt@$(type -p getopt)@g" -e "s@sed@$(type -p sed)@g" ${pname}-${version}/scripts/fakeroot.in
|
2012-09-19 09:48:27 +00:00
|
|
|
'';
|
|
|
|
|
2022-01-20 14:36:53 +00:00
|
|
|
passthru = {
|
|
|
|
tests = {
|
|
|
|
# A lightweight *unit* test that exercises fakeroot and fakechroot together:
|
|
|
|
nixos-etc = nixosTests.etc.test-etc-fakeroot;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2011-01-06 10:43:32 +00:00
|
|
|
meta = {
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://salsa.debian.org/clint/fakeroot";
|
2011-01-06 10:43:32 +00:00
|
|
|
description = "Give a fake root environment through LD_PRELOAD";
|
2021-01-15 09:19:50 +00:00
|
|
|
license = lib.licenses.gpl2Plus;
|
|
|
|
maintainers = with lib.maintainers; [viric];
|
|
|
|
platforms = lib.platforms.unix;
|
2011-01-06 10:43:32 +00:00
|
|
|
};
|
|
|
|
}
|