summaryrefslogtreecommitdiff
path: root/flake.nix
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2020-11-26 21:53:37 +0100
committerEelco Dolstra <edolstra@gmail.com>2020-11-26 22:02:03 +0100
commitb46859e65b66171cf89ebe8fc059deb5cba075bc (patch)
treeaf9dec9b1254d5d92aa75cd054fd237cf2b6f962 /flake.nix
parenta05752fa0c16d8d64bb35e78da3ebb9192031a87 (diff)
downloadpatchelf-b46859e65b66171cf89ebe8fc059deb5cba075bc.tar.gz
Merge release.nix into flake.nix
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix57
1 files changed, 50 insertions, 7 deletions
diff --git a/flake.nix b/flake.nix
index 5ba87db..c6b2734 100644
--- a/flake.nix
+++ b/flake.nix
@@ -8,26 +8,69 @@
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
- rec {
+ {
overlay = final: prev: {
patchelf-new = final.stdenv.mkDerivation {
- name = "patchelf-${hydraJobs.tarball.version}";
- src = "${hydraJobs.tarball}/tarballs/*.tar.bz2";
+ name = "patchelf-${self.hydraJobs.tarball.version}";
+ src = "${self.hydraJobs.tarball}/tarballs/*.tar.bz2";
};
};
- hydraJobs = import ./release.nix {
- patchelfSrc = self;
- nixpkgs = nixpkgs;
+ 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 = hydraJobs.build.${system};
+ build = self.hydraJobs.build.${system};
});
defaultPackage = forAllSystems (system: