Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at release-18.03 101 lines 3.5 kB view raw
1{ stdenv, pkgs, erlang }: 2 3let 4 inherit (stdenv.lib) getVersion versionAtLeast makeExtensible; 5 6 lib = pkgs.callPackage ./lib.nix {}; 7 8 # FIXME: add support for overrideScope 9 callPackageWithScope = scope: drv: args: stdenv.lib.callPackageWith scope drv args; 10 mkScope = scope: pkgs // scope; 11 12 packages = self: 13 let 14 defaultScope = mkScope self; 15 callPackage = drv: args: callPackageWithScope defaultScope drv args; 16 in 17 import ./hex-packages.nix { 18 inherit pkgs stdenv callPackage; 19 } // rec { 20 inherit callPackage erlang; 21 beamPackages = self; 22 23 hexRegistrySnapshot = callPackage ./hex-registry-snapshot.nix { }; 24 25 rebar = callPackage ../tools/build-managers/rebar { }; 26 rebar3-open = callPackage ../tools/build-managers/rebar3 { 27 hermeticRebar3 = false; 28 }; 29 rebar3 = callPackage ../tools/build-managers/rebar3 { 30 hermeticRebar3 = true; 31 }; 32 33 # rebar3 port compiler plugin is required by buildRebar3 34 pc_1_6_0 = callPackage ./pc {}; 35 pc = pc_1_6_0; 36 37 fetchHex = callPackage ./fetch-hex.nix { }; 38 39 buildRebar3 = callPackage ./build-rebar3.nix {}; 40 buildHex = callPackage ./build-hex.nix {}; 41 buildErlangMk = callPackage ./build-erlang-mk.nix {}; 42 buildMix = callPackage ./build-mix.nix {}; 43 44 # BEAM-based languages. 45 elixir = elixir_1_6; 46 47 elixir_1_6 = lib.callElixir ../interpreters/elixir/1.6.nix { 48 inherit rebar erlang; 49 debugInfo = true; 50 }; 51 52 elixir_1_5 = lib.callElixir ../interpreters/elixir/1.5.nix { 53 inherit rebar erlang; 54 debugInfo = true; 55 }; 56 57 elixir_1_4 = lib.callElixir ../interpreters/elixir/1.4.nix { 58 inherit rebar erlang; 59 debugInfo = true; 60 }; 61 62 elixir_1_3 = lib.callElixir ../interpreters/elixir/1.3.nix { 63 inherit rebar erlang; 64 debugInfo = true; 65 }; 66 67 lfe = lfe_1_2; 68 lfe_1_2 = lib.callLFE ../interpreters/lfe/1.2.nix { inherit erlang buildRebar3 buildHex; }; 69 70 # We list all base hex packages for beam tooling explicitly to ensure 71 # tha the tooling does not break during hex-packages.nix updates. 72 erlware_commons_1_0_0 = buildHex { 73 name = "erlware_commons"; 74 version = "1.0.0"; 75 sha256 = "0wkphbrjk19lxdwndy92v058qwcaz13bcgdzp33h21aa7vminzx7"; 76 beamDeps = [ cf_0_2_2 ]; 77 }; 78 cf_0_2_2 = buildHex { 79 name = "cf"; 80 version = "0.2.2"; 81 sha256 = "08cvy7skn5d2k4manlx5k3anqgjdvajjhc5jwxbaszxw34q3na28"; 82 }; 83 getopt_0_8_2 = buildHex { 84 name = "getopt"; 85 version = "0.8.2"; 86 sha256 = "1xw30h59zbw957cyjd8n50hf9y09jnv9dyry6x3avfwzcyrnsvkk"; 87 }; 88 89 # Non hex packages. Examples how to build Rebar/Mix packages with and 90 # without helper functions buildRebar3 and buildMix. 91 hex = callPackage ./hex {}; 92 webdriver = callPackage ./webdriver {}; 93 relxExe = callPackage ../tools/erlang/relx-exe {}; 94 95 # The tool used to upgrade hex-packages.nix. 96 hex2nix = callPackage ../tools/erlang/hex2nix {}; 97 98 # An example of Erlang/C++ package. 99 cuter = callPackage ../tools/erlang/cuter {}; 100 }; 101in makeExtensible packages