Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ lib, mkCoqDerivation, coq, coq-elpi, version ? null }: 2 3let hb = mkCoqDerivation { 4 pname = "hierarchy-builder"; 5 owner = "math-comp"; 6 inherit version; 7 defaultVersion = with lib.versions; lib.switch coq.coq-version [ 8 { case = range "8.15" "8.17"; out = "1.4.0"; } 9 { case = range "8.13" "8.14"; out = "1.2.0"; } 10 { case = range "8.12" "8.13"; out = "1.1.0"; } 11 { case = isEq "8.11"; out = "0.10.0"; } 12 ] null; 13 release."1.4.0".sha256 = "sha256-tOed9UU3kMw6KWHJ5LVLUFEmzHx1ImutXQvZ0ldW9rw="; 14 release."1.3.0".sha256 = "17k7rlxdx43qda6i1yafpgc64na8br285cb0mbxy5wryafcdrkrc"; 15 release."1.2.1".sha256 = "sha256-pQYZJ34YzvdlRSGLwsrYgPdz3p/l5f+KhJjkYT08Mj0="; 16 release."1.2.0".sha256 = "0sk01rvvk652d86aibc8rik2m8iz7jn6mw9hh6xkbxlsvh50719d"; 17 release."1.1.0".sha256 = "sha256-spno5ty4kU4WWiOfzoqbXF8lWlNSlySWcRReR3zE/4Q="; 18 release."1.0.0".sha256 = "0yykygs0z6fby6vkiaiv3azy1i9yx4rqg8xdlgkwnf2284hffzpp"; 19 release."0.10.0".sha256 = "1a3vry9nzavrlrdlq3cys3f8kpq3bz447q8c4c7lh2qal61wb32h"; 20 releaseRev = v: "v${v}"; 21 22 propagatedBuildInputs = [ coq-elpi ]; 23 24 mlPlugin = true; 25 26 extraInstallFlags = [ "VFILES=structures.v" ]; 27 28 meta = with lib; { 29 description = "High level commands to declare a hierarchy based on packed classes"; 30 maintainers = with maintainers; [ cohencyril siraben ]; 31 license = licenses.mit; 32 }; 33}; in 34hb.overrideAttrs (o: 35 lib.optionalAttrs (lib.versions.isGe "1.2.0" o.version || o.version == "dev") 36 { buildPhase = "make build"; } 37 // 38 lib.optionalAttrs (lib.versions.isGe "1.1.0" o.version || o.version == "dev") 39 { installFlags = [ "DESTDIR=$(out)" ] ++ o.installFlags; } 40)