diff --git a/doc/languages-frameworks/beam.section.md b/doc/languages-frameworks/beam.section.md index b246da3a81ab1..0ef0c830ef8cf 100644 --- a/doc/languages-frameworks/beam.section.md +++ b/doc/languages-frameworks/beam.section.md @@ -14,7 +14,7 @@ nixpkgs follows the [official elixir deprecation schedule](https://hexdocs.pm/el All BEAM-related expressions are available via the top-level `beam` attribute, which includes: -- `interpreters`: a set of compilers running on the BEAM, including multiple Erlang/OTP versions (`beam.interpreters.erlangR22`, etc), Elixir (`beam.interpreters.elixir`) and LFE (Lisp Flavoured Erlang) (`beam.interpreters.lfe`). +- `interpreters`: a set of compilers running on the BEAM, including multiple Erlang/OTP versions (`beam.interpreters.erlang_22`, etc), Elixir (`beam.interpreters.elixir`) and LFE (Lisp Flavoured Erlang) (`beam.interpreters.lfe`). - `packages`: a set of package builders (Mix and rebar3), each compiled with a specific Erlang/OTP version, e.g. `beam.packages.erlang22`. @@ -22,7 +22,7 @@ The default Erlang compiler, defined by `beam.interpreters.erlang`, is aliased a To create a package builder built with a custom Erlang version, use the lambda, `beam.packagesWith`, which accepts an Erlang/OTP derivation and produces a package builder similar to `beam.packages.erlang`. -Many Erlang/OTP distributions available in `beam.interpreters` have versions with ODBC and/or Java enabled or without wx (no observer support). For example, there's `beam.interpreters.erlangR22_odbc_javac`, which corresponds to `beam.interpreters.erlangR22` and `beam.interpreters.erlangR22_nox`, which corresponds to `beam.interpreters.erlangR22`. +Many Erlang/OTP distributions available in `beam.interpreters` have versions with ODBC and/or Java enabled or without wx (no observer support). For example, there's `beam.interpreters.erlang_22_odbc_javac`, which corresponds to `beam.interpreters.erlang_22` and `beam.interpreters.erlang_22_nox`, which corresponds to `beam.interpreters.erlang_22`. ## Build Tools {#build-tools} @@ -154,7 +154,7 @@ Here is how your `default.nix` file would look for a phoenix project. with import { }; let - # beam.interpreters.erlangR23 is available if you need a particular version + # beam.interpreters.erlang_23 is available if you need a particular version packages = beam.packagesWith beam.interpreters.erlang; pname = "your_project"; @@ -274,7 +274,7 @@ Usually, we need to create a `shell.nix` file and do our development inside of t with pkgs; let - elixir = beam.packages.erlangR24.elixir_1_12; + elixir = beam.packages.erlang_24.elixir_1_12; in mkShell { buildInputs = [ elixir ]; diff --git a/pkgs/development/interpreters/erlang/R21.nix b/pkgs/development/interpreters/erlang/21.nix similarity index 100% rename from pkgs/development/interpreters/erlang/R21.nix rename to pkgs/development/interpreters/erlang/21.nix diff --git a/pkgs/development/interpreters/erlang/R22.nix b/pkgs/development/interpreters/erlang/22.nix similarity index 100% rename from pkgs/development/interpreters/erlang/R22.nix rename to pkgs/development/interpreters/erlang/22.nix diff --git a/pkgs/development/interpreters/erlang/R23.nix b/pkgs/development/interpreters/erlang/23.nix similarity index 100% rename from pkgs/development/interpreters/erlang/R23.nix rename to pkgs/development/interpreters/erlang/23.nix diff --git a/pkgs/development/interpreters/erlang/R24.nix b/pkgs/development/interpreters/erlang/24.nix similarity index 100% rename from pkgs/development/interpreters/erlang/R24.nix rename to pkgs/development/interpreters/erlang/24.nix diff --git a/pkgs/development/interpreters/erlang/R25.nix b/pkgs/development/interpreters/erlang/25.nix similarity index 100% rename from pkgs/development/interpreters/erlang/R25.nix rename to pkgs/development/interpreters/erlang/25.nix diff --git a/pkgs/development/interpreters/erlang/generic-builder.nix b/pkgs/development/interpreters/erlang/generic-builder.nix index 59e2286f84ee5..0c6eec868fa0f 100644 --- a/pkgs/development/interpreters/erlang/generic-builder.nix +++ b/pkgs/development/interpreters/erlang/generic-builder.nix @@ -158,7 +158,7 @@ stdenv.mkDerivation ({ latest=$(list-git-tags --url=https://github.com/erlang/otp.git | sed -n 's/^OTP-${major}/${major}/p' | sort -V | tail -1) if [ "$latest" != "${version}" ]; then nixpkgs="$(git rev-parse --show-toplevel)" - nix_file="$nixpkgs/pkgs/development/interpreters/erlang/R${major}.nix" + nix_file="$nixpkgs/pkgs/development/interpreters/erlang/${major}.nix" update-source-version ${baseName}R${major} "$latest" --version-key=version --print-changes --file="$nix_file" else echo "${baseName}R${major} is already up-to-date" diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index acb7fd40058cc..55f59aa8c8b10 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -439,6 +439,7 @@ mapAliases ({ enyo-doom = enyo-launcher; # Added 2022-09-09 epoxy = libepoxy; # Added 2021-11-11 epsxe = throw "epsxe has been removed from nixpkgs, as it was unmaintained."; # added 2021-12-15 + inherit (beam.interpreters) erlangR25 erlangR24 erlangR23 erlangR22 erlangR21; # added 2023-03-21 esniper = throw "esniper has been removed because upstream no longer maintains it (and it no longer works)"; # Added 2021-04-12 etcdctl = throw "'etcdctl' has been renamed to/replaced by 'etcd'"; # Converted to throw 2022-02-22 eteroj.lv2 = throw "'eteroj.lv2' has been renamed to/replaced by 'open-music-kontrollers.eteroj'"; # Added 2022-03-09 diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 1d8a457f77864..6814849d058ef 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -16576,7 +16576,7 @@ with pkgs; }; inherit (beam.interpreters) - erlang erlangR25 erlangR24 erlangR23 erlangR22 erlangR21 + erlang erlang_25 erlang_24 erlang_23 erlang_22 erlang_21 erlang_odbc erlang_javac erlang_odbc_javac elixir elixir_1_14 elixir_1_13 elixir_1_12 elixir_1_11 elixir_1_10 elixir-ls; @@ -16588,7 +16588,7 @@ with pkgs; rebar rebar3 rebar3WithPlugins fetchHex beamPackages; - inherit (beam.packages.erlangR21) lfe lfe_1_3; + inherit (beam.packages.erlang_21) lfe lfe_1_3; gnudatalanguage = callPackage ../development/interpreters/gnudatalanguage { inherit (llvmPackages) openmp; @@ -24745,7 +24745,7 @@ with pkgs; etcd_3_4 = callPackage ../servers/etcd/3.4.nix { }; etcd_3_5 = callPackage ../servers/etcd/3.5.nix { }; - ejabberd = callPackage ../servers/xmpp/ejabberd { erlang = erlangR24; }; + ejabberd = callPackage ../servers/xmpp/ejabberd { erlang = erlang_24; }; exhibitor = callPackage ../servers/exhibitor { }; diff --git a/pkgs/top-level/beam-packages.nix b/pkgs/top-level/beam-packages.nix index 06987c456445a..8b40783baed16 100644 --- a/pkgs/top-level/beam-packages.nix +++ b/pkgs/top-level/beam-packages.nix @@ -12,12 +12,25 @@ let self = beam; + + # Aliases added 2023-03-21 + versionLoop = f: lib.lists.foldr (version: acc: (f version) // acc) { } [ "25" "24" "23" "22" "21" ]; + + interpretersAliases = versionLoop (version: { + "erlangR${version}" = self.interpreters."erlang_${version}"; + "erlangR${version}_odbc" = self.interpreters."erlang_${version}_odbc"; + "erlangR${version}_javac" = self.interpreters."erlang_${version}_javac"; + "erlangR${version}_odbc_javac" = self.interpreters."erlang_${version}_odbc_javac"; + }); + + packagesAliases = versionLoop (version: { "erlangR${version}" = self.packages."erlang_${version}"; }); + in { beamLib = callPackage ../development/beam-modules/lib.nix { }; - latestVersion = "erlangR25"; + latestVersion = "erlang_25"; # Each interpreters = { @@ -29,37 +42,34 @@ in # Standard Erlang versions, using the generic builder. - # R25 - erlangR25 = self.beamLib.callErlang ../development/interpreters/erlang/R25.nix { + erlang_25 = self.beamLib.callErlang ../development/interpreters/erlang/25.nix { wxGTK = wxGTK32; parallelBuild = true; autoconf = buildPackages.autoconf269; inherit wxSupport systemdSupport; }; - erlangR25_odbc = self.interpreters.erlangR25.override { odbcSupport = true; }; - erlangR25_javac = self.interpreters.erlangR25.override { javacSupport = true; }; - erlangR25_odbc_javac = self.interpreters.erlangR25.override { + erlang_25_odbc = self.interpreters.erlang_25.override { odbcSupport = true; }; + erlang_25_javac = self.interpreters.erlang_25.override { javacSupport = true; }; + erlang_25_odbc_javac = self.interpreters.erlang_25.override { javacSupport = true; odbcSupport = true; }; - # R24 - erlangR24 = self.beamLib.callErlang ../development/interpreters/erlang/R24.nix { + erlang_24 = self.beamLib.callErlang ../development/interpreters/erlang/24.nix { wxGTK = wxGTK32; # Can be enabled since the bug has been fixed in https://github.com/erlang/otp/pull/2508 parallelBuild = true; autoconf = buildPackages.autoconf269; inherit wxSupport systemdSupport; }; - erlangR24_odbc = self.interpreters.erlangR24.override { odbcSupport = true; }; - erlangR24_javac = self.interpreters.erlangR24.override { javacSupport = true; }; - erlangR24_odbc_javac = self.interpreters.erlangR24.override { + erlang_24_odbc = self.interpreters.erlang_24.override { odbcSupport = true; }; + erlang_24_javac = self.interpreters.erlang_24.override { javacSupport = true; }; + erlang_24_odbc_javac = self.interpreters.erlang_24.override { javacSupport = true; odbcSupport = true; }; - # R23 - erlangR23 = self.beamLib.callErlang ../development/interpreters/erlang/R23.nix { + erlang_23 = self.beamLib.callErlang ../development/interpreters/erlang/23.nix { openssl = openssl_1_1; wxGTK = wxGTK32; # Can be enabled since the bug has been fixed in https://github.com/erlang/otp/pull/2508 @@ -67,15 +77,14 @@ in autoconf = buildPackages.autoconf269; inherit wxSupport systemdSupport; }; - erlangR23_odbc = self.interpreters.erlangR23.override { odbcSupport = true; }; - erlangR23_javac = self.interpreters.erlangR23.override { javacSupport = true; }; - erlangR23_odbc_javac = self.interpreters.erlangR23.override { + erlang_23_odbc = self.interpreters.erlang_23.override { odbcSupport = true; }; + erlang_23_javac = self.interpreters.erlang_23.override { javacSupport = true; }; + erlang_23_odbc_javac = self.interpreters.erlang_23.override { javacSupport = true; odbcSupport = true; }; - # R22 - erlangR22 = self.beamLib.callErlang ../development/interpreters/erlang/R22.nix { + erlang_22 = self.beamLib.callErlang ../development/interpreters/erlang/22.nix { openssl = openssl_1_1; wxGTK = wxGTK32; # Can be enabled since the bug has been fixed in https://github.com/erlang/otp/pull/2508 @@ -83,35 +92,34 @@ in autoconf = buildPackages.autoconf269; inherit wxSupport systemdSupport; }; - erlangR22_odbc = self.interpreters.erlangR22.override { odbcSupport = true; }; - erlangR22_javac = self.interpreters.erlangR22.override { javacSupport = true; }; - erlangR22_odbc_javac = self.interpreters.erlangR22.override { + erlang_22_odbc = self.interpreters.erlang_22.override { odbcSupport = true; }; + erlang_22_javac = self.interpreters.erlang_22.override { javacSupport = true; }; + erlang_22_odbc_javac = self.interpreters.erlang_22.override { javacSupport = true; odbcSupport = true; }; - # R21 - erlangR21 = self.beamLib.callErlang ../development/interpreters/erlang/R21.nix { + erlang_21 = self.beamLib.callErlang ../development/interpreters/erlang/21.nix { openssl = openssl_1_1; wxGTK = wxGTK32; autoconf = buildPackages.autoconf269; inherit wxSupport systemdSupport; }; - erlangR21_odbc = self.interpreters.erlangR21.override { odbcSupport = true; }; - erlangR21_javac = self.interpreters.erlangR21.override { javacSupport = true; }; - erlangR21_odbc_javac = self.interpreters.erlangR21.override { + erlang_21_odbc = self.interpreters.erlang_21.override { odbcSupport = true; }; + erlang_21_javac = self.interpreters.erlang_21.override { javacSupport = true; }; + erlang_21_odbc_javac = self.interpreters.erlang_21.override { javacSupport = true; odbcSupport = true; }; # Other Beam languages. These are built with `beam.interpreters.erlang`. To # access for example elixir built with different version of Erlang, use - # `beam.packages.erlangR24.elixir`. + # `beam.packages.erlang_24.elixir`. inherit (self.packages.erlang) elixir elixir_1_14 elixir_1_13 elixir_1_12 elixir_1_11 elixir_1_10 elixir-ls; inherit (self.packages.erlang) lfe lfe_1_3; - }; + } // interpretersAliases; # Helper function to generate package set with a specific Erlang version. packagesWith = erlang: @@ -122,10 +130,10 @@ in packages = { erlang = self.packages.${self.latestVersion}; - erlangR25 = self.packagesWith self.interpreters.erlangR25; - erlangR24 = self.packagesWith self.interpreters.erlangR24; - erlangR23 = self.packagesWith self.interpreters.erlangR23; - erlangR22 = self.packagesWith self.interpreters.erlangR22; - erlangR21 = self.packagesWith self.interpreters.erlangR21; - }; + erlang_25 = self.packagesWith self.interpreters.erlang_25; + erlang_24 = self.packagesWith self.interpreters.erlang_24; + erlang_23 = self.packagesWith self.interpreters.erlang_23; + erlang_22 = self.packagesWith self.interpreters.erlang_22; + erlang_21 = self.packagesWith self.interpreters.erlang_21; + } // packagesAliases; }