nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at devShellTools-shell 43 lines 1.4 kB view raw
1{ 2 lib, 3 coq, 4 mkCoqPackages, 5 runCommand, 6}: 7 8let 9 10 # This is just coq, but with dontFilter set to true. We need to set 11 # dontFilter to true here so that _all_ packages are visible in coqPackages. 12 # There may be some versions of the top-level coq and coqPackages that don't 13 # build QuickChick, which is what we are using for this test below. 14 coqWithAllPackages = coq // { 15 dontFilter = true; 16 }; 17 18 coqPackages = mkCoqPackages coqWithAllPackages; 19 20 # This is the main test. This uses overrideCoqDerivation to 21 # override arguments to mkCoqDerivation. 22 # 23 # Here, we override the defaultVersion and release arguments to 24 # mkCoqDerivation. 25 overriddenQuickChick = coqPackages.lib.overrideCoqDerivation { 26 defaultVersion = "9999"; 27 release."9999".sha256 = lib.fakeSha256; 28 } coqPackages.QuickChick; 29in 30 31runCommand "coq-overrideCoqDerivation-test-0.1" 32 { meta.maintainers = with lib.maintainers; [ cdepillabout ]; } 33 '' 34 # Confirm that the computed version number for the overridden QuickChick does 35 # actually become 9999, as set above. 36 if [ "${overriddenQuickChick.version}" -eq "9999" ]; then 37 echo "overriddenQuickChick version was successfully set to 9999" 38 touch $out 39 else 40 echo "ERROR: overriddenQuickChick version was supposed to be 9999, but was actually: ${overriddenQuickChick.version}" 41 exit 1 42 fi 43 ''