forked from NixOS/patchelf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
84 lines (65 loc) · 2.25 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
{
description = "A tool for modifying ELF executables and libraries";
inputs.nixpkgs.url = "nixpkgs/nixos-20.09";
outputs = { self, nixpkgs }:
let
supportedSystems = [ "x86_64-linux" "i686-linux" "aarch64-linux" ];
forAllSystems = f: nixpkgs.lib.genAttrs supportedSystems (system: f system);
nixpkgsFor = forAllSystems (system:
import nixpkgs {
inherit system;
overlays = [ self.overlay ];
}
);
pkgs = nixpkgsFor.${"x86_64-linux"};
in
{
overlay = final: prev: {
patchelf-new = final.stdenv.mkDerivation {
name = "patchelf-${self.hydraJobs.tarball.version}";
src = "${self.hydraJobs.tarball}/tarballs/*.tar.bz2";
};
};
hydraJobs = {
tarball =
pkgs.releaseTools.sourceTarball rec {
name = "patchelf-tarball";
version = builtins.readFile ./version
+ "." + builtins.substring 0 8 self.lastModifiedDate
+ "." + (self.shortRev or "dirty");
versionSuffix = ""; # obsolete
src = self;
preAutoconf = "echo ${version} > version";
postDist = ''
cp README.md $out/
echo "doc readme $out/README.md" >> $out/nix-support/hydra-build-products
'';
};
coverage =
pkgs.releaseTools.coverageAnalysis {
name = "patchelf-coverage";
src = self.hydraJobs.tarball;
lcovFilter = ["*/tests/*"];
};
build = forAllSystems (system: nixpkgsFor.${system}.patchelf-new);
release = pkgs.releaseTools.aggregate
{ name = "patchelf-${self.hydraJobs.tarball.version}";
constituents =
[ self.hydraJobs.tarball
self.hydraJobs.build.x86_64-linux
self.hydraJobs.build.i686-linux
];
meta.description = "Release-critical builds";
};
};
checks = forAllSystems (system: {
build = self.hydraJobs.build.${system};
});
defaultPackage = forAllSystems (system:
(import nixpkgs {
inherit system;
overlays = [ self.overlay ];
}).patchelf-new
);
};
}