diff options
author | Artturin <Artturin@artturin.com> | 2022-09-10 01:26:34 +0300 |
---|---|---|
committer | Yt <happysalada@proton.me> | 2022-09-10 21:10:44 -0400 |
commit | d1bc788b0d312c174b68cd396fd32e5bcf5bd45e (patch) | |
tree | 18cd2fbe5c7e778f15629af43bcd9bf45a8cb134 /pkgs/top-level/beam-packages.nix | |
parent | 705476eae4560fed491b8b3c1f6a87adf9c7c035 (diff) |
beam: dont use 'with beam' and 'with beam.interpreters'
makes it clear where attrs are coming from in preparation for trying to splice beam-packages.nix
Diffstat (limited to 'pkgs/top-level/beam-packages.nix')
-rw-r--r-- | pkgs/top-level/beam-packages.nix | 80 |
1 files changed, 44 insertions, 36 deletions
diff --git a/pkgs/top-level/beam-packages.nix b/pkgs/top-level/beam-packages.nix index 89d2342f0c63c..b61b69cad9eab 100644 --- a/pkgs/top-level/beam-packages.nix +++ b/pkgs/top-level/beam-packages.nix @@ -1,93 +1,101 @@ -{ beam, callPackage, wxGTK30, buildPackages, stdenv +{ beam +, callPackage +, wxGTK30 +, buildPackages +, stdenv , wxSupport ? true , systemdSupport ? stdenv.isLinux }: -with beam; { - lib = callPackage ../development/beam-modules/lib.nix { }; +let + self = beam; +in + +{ + beamLib = callPackage ../development/beam-modules/lib.nix { }; # R24 is the default version. # The main switch to change default Erlang version. defaultVersion = "erlangR24"; # Each - interpreters = with beam.interpreters; { + interpreters = { - erlang = beam.interpreters.${defaultVersion}; - erlang_odbc = beam.interpreters."${defaultVersion}_odbc"; - erlang_javac = beam.interpreters."${defaultVersion}_javac"; - erlang_odbc_javac = beam.interpreters."${defaultVersion}_odbc_javac"; + erlang = self.interpreters.${self.defaultVersion}; + erlang_odbc = self.interpreters."${self.defaultVersion}_odbc"; + erlang_javac = self.interpreters."${self.defaultVersion}_javac"; + erlang_odbc_javac = self.interpreters."${self.defaultVersion}_odbc_javac"; # Standard Erlang versions, using the generic builder. # R25 - erlangR25 = lib.callErlang ../development/interpreters/erlang/R25.nix { + erlangR25 = self.beamLib.callErlang ../development/interpreters/erlang/R25.nix { wxGTK = wxGTK30; parallelBuild = true; autoconf = buildPackages.autoconf269; inherit wxSupport systemdSupport; }; - erlangR25_odbc = erlangR25.override { odbcSupport = true; }; - erlangR25_javac = erlangR25.override { javacSupport = true; }; - erlangR25_odbc_javac = erlangR25.override { + erlangR25_odbc = self.interpreters.erlangR25.override { odbcSupport = true; }; + erlangR25_javac = self.interpreters.erlangR25.override { javacSupport = true; }; + erlangR25_odbc_javac = self.interpreters.erlangR25.override { javacSupport = true; odbcSupport = true; }; # R24 - erlangR24 = lib.callErlang ../development/interpreters/erlang/R24.nix { + erlangR24 = self.beamLib.callErlang ../development/interpreters/erlang/R24.nix { wxGTK = wxGTK30; # 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 = erlangR24.override { odbcSupport = true; }; - erlangR24_javac = erlangR24.override { javacSupport = true; }; - erlangR24_odbc_javac = erlangR24.override { + erlangR24_odbc = self.interpreters.erlangR24.override { odbcSupport = true; }; + erlangR24_javac = self.interpreters.erlangR24.override { javacSupport = true; }; + erlangR24_odbc_javac = self.interpreters.erlangR24.override { javacSupport = true; odbcSupport = true; }; # R23 - erlangR23 = lib.callErlang ../development/interpreters/erlang/R23.nix { + erlangR23 = self.beamLib.callErlang ../development/interpreters/erlang/R23.nix { wxGTK = wxGTK30; # 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; }; - erlangR23_odbc = erlangR23.override { odbcSupport = true; }; - erlangR23_javac = erlangR23.override { javacSupport = true; }; - erlangR23_odbc_javac = erlangR23.override { + erlangR23_odbc = self.interpreters.erlangR23.override { odbcSupport = true; }; + erlangR23_javac = self.interpreters.erlangR23.override { javacSupport = true; }; + erlangR23_odbc_javac = self.interpreters.erlangR23.override { javacSupport = true; odbcSupport = true; }; # R22 - erlangR22 = lib.callErlang ../development/interpreters/erlang/R22.nix { + erlangR22 = self.beamLib.callErlang ../development/interpreters/erlang/R22.nix { wxGTK = wxGTK30; # 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; }; - erlangR22_odbc = erlangR22.override { odbcSupport = true; }; - erlangR22_javac = erlangR22.override { javacSupport = true; }; - erlangR22_odbc_javac = erlangR22.override { + erlangR22_odbc = self.interpreters.erlangR22.override { odbcSupport = true; }; + erlangR22_javac = self.interpreters.erlangR22.override { javacSupport = true; }; + erlangR22_odbc_javac = self.interpreters.erlangR22.override { javacSupport = true; odbcSupport = true; }; # R21 - erlangR21 = lib.callErlang ../development/interpreters/erlang/R21.nix { + erlangR21 = self.beamLib.callErlang ../development/interpreters/erlang/R21.nix { wxGTK = wxGTK30; autoconf = buildPackages.autoconf269; inherit wxSupport systemdSupport; }; - erlangR21_odbc = erlangR21.override { odbcSupport = true; }; - erlangR21_javac = erlangR21.override { javacSupport = true; }; - erlangR21_odbc_javac = erlangR21.override { + erlangR21_odbc = self.interpreters.erlangR21.override { odbcSupport = true; }; + erlangR21_javac = self.interpreters.erlangR21.override { javacSupport = true; }; + erlangR21_odbc_javac = self.interpreters.erlangR21.override { javacSupport = true; odbcSupport = true; }; @@ -95,10 +103,10 @@ with beam; { # 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`. - inherit (packages.erlang) + inherit (self.packages.erlang) elixir elixir_1_14 elixir_1_13 elixir_1_12 elixir_1_11 elixir_1_10 elixir_ls; - inherit (packages.erlang) lfe lfe_1_3; + inherit (self.packages.erlang) lfe lfe_1_3; }; # Helper function to generate package set with a specific Erlang version. @@ -109,12 +117,12 @@ with beam; { # appropriate Erlang/OTP version. packages = { # Packages built with default Erlang version. - erlang = packages.${defaultVersion}; + erlang = self.packages.${self.defaultVersion}; - erlangR25 = packagesWith interpreters.erlangR25; - erlangR24 = packagesWith interpreters.erlangR24; - erlangR23 = packagesWith interpreters.erlangR23; - erlangR22 = packagesWith interpreters.erlangR22; - erlangR21 = packagesWith interpreters.erlangR21; + 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; }; } |