nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchurl,
5 autoreconfHook,
6
7 # for passthru.tests
8 git,
9 libguestfs,
10 nixosTests,
11 rpm,
12}:
13
14stdenv.mkDerivation (finalAttrs: {
15 pname = "cpio";
16 version = "2.15";
17
18 src = fetchurl {
19 url = "mirror://gnu/cpio/cpio-${finalAttrs.version}.tar.bz2";
20 hash = "sha256-k3YQuXwymh7JJoVT+3gAN7z/8Nz/6XJevE/ZwaqQdds=";
21 };
22
23 nativeBuildInputs = [ autoreconfHook ];
24
25 separateDebugInfo = true;
26
27 # The code won't compile in c23 mode.
28 # https://gcc.gnu.org/gcc-15/porting_to.html#c23-fn-decls-without-parameters
29 configureFlags = [
30 "CFLAGS=-std=gnu17"
31 ];
32
33 preConfigure = lib.optionalString stdenv.hostPlatform.isCygwin ''
34 sed -i gnu/fpending.h -e 's,include <stdio_ext.h>,,'
35 '';
36
37 enableParallelBuilding = true;
38
39 passthru.tests = {
40 inherit libguestfs rpm;
41 git = git.tests.withInstallCheck;
42 initrd = nixosTests.systemd-initrd-simple;
43 };
44
45 meta = {
46 homepage = "https://www.gnu.org/software/cpio/";
47 description = "Program to create or extract from cpio archives";
48 license = lib.licenses.gpl3;
49 platforms = lib.platforms.all;
50 priority = 6; # resolves collision with gnutar's "libexec/rmt"
51 mainProgram = "cpio";
52 };
53})