fork
Configure Feed
Select the types of activity you want to include in your feed.
nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
fork
Configure Feed
Select the types of activity you want to include in your feed.
1{ lib
2, stdenv
3, fetchurl
4, fetchpatch
5, getopt
6, libcap
7, gnused
8, nixosTests
9}:
10
11stdenv.mkDerivation rec {
12 version = "1.29";
13 pname = "fakeroot";
14
15 src = fetchurl {
16 url = "http://http.debian.net/debian/pool/main/f/fakeroot/fakeroot_${version}.orig.tar.gz";
17 sha256 = "sha256-j7uvt4DJFz46zkoEr7wdkA8zfzIWiDk59cfbNDG+fCA=";
18 };
19
20 patches = lib.optionals stdenv.isLinux [
21 ./einval.patch
22 (fetchpatch {
23 name = "also-wrap-stat-library-call.patch";
24 url = "https://sources.debian.org/data/main/f/fakeroot/1.29-1/debian/patches/also-wrap-stat-library-call.patch";
25 sha256 = "0p7lq6m31k3rqsnjbi06a8ykdqa3cp4y5ngsjyk3q1269gx59x8b";
26 })
27
28 # patches needed for musl libc, borrowed from alpine packaging.
29 # it is applied regardless of the environment to prevent patchrot
30 (fetchpatch {
31 name = "do-not-redefine-id_t.patch";
32 url = "https://git.alpinelinux.org/aports/plain/main/fakeroot/do-not-redefine-id_t.patch?id=f68c541324ad07cc5b7f5228501b5f2ce4b36158";
33 sha256 = "sha256-i9PoWriSrQ7kLZzbvZT3Kq1oXzK9mTyBqq808BGepOw=";
34 })
35 (fetchpatch {
36 name = "fakeroot-no64.patch";
37 url = "https://git.alpinelinux.org/aports/plain/main/fakeroot/fakeroot-no64.patch?id=f68c541324ad07cc5b7f5228501b5f2ce4b36158";
38 sha256 = "sha256-NCDaB4nK71gvz8iQxlfaQTazsG0SBUQ/RAnN+FqwKkY=";
39 })
40 ];
41
42 buildInputs = [ getopt gnused ]
43 ++ lib.optional (!stdenv.isDarwin) libcap
44 ;
45
46 postUnpack = ''
47 sed -i -e "s@getopt@$(type -p getopt)@g" -e "s@sed@$(type -p sed)@g" ${pname}-${version}/scripts/fakeroot.in
48 '';
49
50 passthru = {
51 tests = {
52 # A lightweight *unit* test that exercises fakeroot and fakechroot together:
53 nixos-etc = nixosTests.etc.test-etc-fakeroot;
54 };
55 };
56
57 meta = {
58 homepage = "https://salsa.debian.org/clint/fakeroot";
59 description = "Give a fake root environment through LD_PRELOAD";
60 license = lib.licenses.gpl2Plus;
61 maintainers = with lib.maintainers; [viric];
62 platforms = lib.platforms.unix;
63 };
64}