diff --git a/fixtures/example/deps.nix b/fixtures/example/deps.nix index d6f9832..874a3a0 100644 --- a/fixtures/example/deps.nix +++ b/fixtures/example/deps.nix @@ -15,6 +15,13 @@ let buildPlugins = [ pkgs.beamPackages.pc ]; }; + elixirMake = _unusedArgs: old: { + nativeBuildInputs = [ pkgs.gnumake ]; + preConfigure = '' + export ELIXIR_MAKE_CACHE_DIR="$TEMPDIR/elixir_make_cache" + ''; + }; + rustlerPrecompiled = { toolchain ? null, @@ -260,7 +267,7 @@ let ]; }; in - drv; + drv.override (workarounds.elixirMake { } drv); chatterbox = let @@ -625,6 +632,30 @@ let in drv.override (workarounds.rustlerPrecompiled { } drv); + exqlite = + let + version = "0.33.0"; + drv = buildMix { + inherit version; + name = "exqlite"; + appConfigPath = ./config; + + src = fetchHex { + inherit version; + pkg = "exqlite"; + sha256 = "8a7c2792e567bbebb4dafe96f6397f1c527edd7039d74f508a603817fbad2844"; + }; + + beamDeps = [ + cc_precompiler + db_connection + elixir_make + table + ]; + }; + in + drv.override (workarounds.elixirMake { } drv); + finch = let version = "0.19.0"; @@ -1525,7 +1556,7 @@ let ]; }; in - drv; + drv.override (workarounds.elixirMake { } drv); websock = let diff --git a/fixtures/example/mix.exs b/fixtures/example/mix.exs index 507b17d..9bcf5d9 100644 --- a/fixtures/example/mix.exs +++ b/fixtures/example/mix.exs @@ -31,6 +31,7 @@ defmodule Example.MixProject do {:ex_cldr_numbers, "~> 2.33"}, {:ex_keccak, "~> 0.7.6"}, {:explorer, "~> 0.10.1"}, + {:exqlite, "~> 0.33.0"}, {:fun_with_flags, "~> 1.12.0"}, {:heroicons, github: "tailwindlabs/heroicons", diff --git a/fixtures/example/mix.lock b/fixtures/example/mix.lock index 0827571..58f68d8 100644 --- a/fixtures/example/mix.lock +++ b/fixtures/example/mix.lock @@ -22,6 +22,7 @@ "ex_keccak": {:hex, :ex_keccak, "0.7.6", "110c3ed76b55265975d9ae6628205b8a026f11fe081f3073e00c29aab2e91473", [:mix], [{:rustler, ">= 0.0.0", [hex: :rustler, repo: "hexpm", optional: true]}, {:rustler_precompiled, "~> 0.8", [hex: :rustler_precompiled, repo: "hexpm", optional: false]}], "hexpm", "9d1568424eb7b995e480d1b7f0c1e914226ee625496600abb922bba6f5cdc5e4"}, "ex_secp256k1": {:hex, :ex_secp256k1, "0.7.3", "489b6fd57fab5a7259ace927d8cb5171aad835e9c7279c2a859a0483cb069415", [:mix], [{:rustler, ">= 0.0.0", [hex: :rustler, repo: "hexpm", optional: true]}, {:rustler_precompiled, "~> 0.7", [hex: :rustler_precompiled, repo: "hexpm", optional: false]}], "hexpm", "ea63159442f4d8143166cd1507da03edc43216d6e7c6bac4b416bdce04f0daa8"}, "explorer": {:hex, :explorer, "0.10.1", "ff6e2a7d7a480c86708c3300cc67a3fd6982c7d28b51f4db2f411aa476c9ecdb", [:mix], [{:adbc, "~> 0.1", [hex: :adbc, repo: "hexpm", optional: true]}, {:aws_signature, "~> 0.3", [hex: :aws_signature, repo: "hexpm", optional: false]}, {:castore, "~> 1.0", [hex: :castore, repo: "hexpm", optional: true]}, {:decimal, "~> 2.1", [hex: :decimal, repo: "hexpm", optional: false]}, {:flame, "~> 0.3", [hex: :flame, repo: "hexpm", optional: true]}, {:fss, "~> 0.1", [hex: :fss, repo: "hexpm", optional: false]}, {:nx, "~> 0.4", [hex: :nx, repo: "hexpm", optional: true]}, {:rustler, "~> 0.34.0", [hex: :rustler, repo: "hexpm", optional: true]}, {:rustler_precompiled, "~> 0.7", [hex: :rustler_precompiled, repo: "hexpm", optional: false]}, {:table, "~> 0.1.2", [hex: :table, repo: "hexpm", optional: false]}, {:table_rex, "~> 3.1.1 or ~> 4.0.0", [hex: :table_rex, repo: "hexpm", optional: false]}], "hexpm", "4e3efc45d4981a568405a181ebf206ba208622a5e94048c9d713b27a053c3197"}, + "exqlite": {:hex, :exqlite, "0.33.0", "2cc96c4227fbb2d0864716def736dff18afb9949b1eaa74630822a0865b4b342", [:make, :mix], [{:cc_precompiler, "~> 0.1", [hex: :cc_precompiler, repo: "hexpm", optional: false]}, {:db_connection, "~> 2.1", [hex: :db_connection, repo: "hexpm", optional: false]}, {:elixir_make, "~> 0.8", [hex: :elixir_make, repo: "hexpm", optional: false]}, {:table, "~> 0.1.0", [hex: :table, repo: "hexpm", optional: true]}], "hexpm", "8a7c2792e567bbebb4dafe96f6397f1c527edd7039d74f508a603817fbad2844"}, "finch": {:hex, :finch, "0.19.0", "c644641491ea854fc5c1bbaef36bfc764e3f08e7185e1f084e35e0672241b76d", [:mix], [{:mime, "~> 1.0 or ~> 2.0", [hex: :mime, repo: "hexpm", optional: false]}, {:mint, "~> 1.6.2 or ~> 1.7", [hex: :mint, repo: "hexpm", optional: false]}, {:nimble_options, "~> 0.4 or ~> 1.0", [hex: :nimble_options, repo: "hexpm", optional: false]}, {:nimble_pool, "~> 1.1", [hex: :nimble_pool, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "fc5324ce209125d1e2fa0fcd2634601c52a787aff1cd33ee833664a5af4ea2b6"}, "fsm": {:hex, :fsm, "0.3.1", "087aa9b02779a84320dc7a2d8464452b5308e29877921b2bde81cdba32a12390", [:mix], [], "hexpm", "fbf0d53f89e9082b326b0b5828b94b4c549ff9d1452bbfd00b4d1ac082208e96"}, "fss": {:hex, :fss, "0.1.1", "9db2344dbbb5d555ce442ac7c2f82dd975b605b50d169314a20f08ed21e08642", [:mix], [], "hexpm", "78ad5955c7919c3764065b21144913df7515d52e228c09427a004afe9c1a16b0"}, diff --git a/lib/deps_nix.ex b/lib/deps_nix.ex index 86f39cc..4c4b08f 100644 --- a/lib/deps_nix.ex +++ b/lib/deps_nix.ex @@ -209,6 +209,13 @@ defmodule DepsNix do buildPlugins = [ pkgs.beamPackages.pc ]; }; + elixirMake = _unusedArgs: old: { + nativeBuildInputs = [ pkgs.gnumake ]; + preConfigure = '' + export ELIXIR_MAKE_CACHE_DIR="$TEMPDIR/elixir_make_cache" + ''; + }; + rustlerPrecompiled = { toolchain ? null, diff --git a/lib/deps_nix/derivation.ex b/lib/deps_nix/derivation.ex index 8659fae..fb4bc53 100644 --- a/lib/deps_nix/derivation.ex +++ b/lib/deps_nix/derivation.ex @@ -258,10 +258,15 @@ defmodule DepsNix.Derivation do end defp override(drv) do - if :rustler_precompiled in drv.beam_deps do - ".override (workarounds.rustlerPrecompiled { } drv)" - else - "" + cond do + :rustler_precompiled in drv.beam_deps -> + ".override (workarounds.rustlerPrecompiled { } drv)" + + :elixir_make in drv.beam_deps -> + ".override (workarounds.elixirMake { } drv)" + + true -> + "" end end diff --git a/test/deps_nix/special_treatment_test.exs b/test/deps_nix/special_treatment_test.exs index 5c1e261..0663012 100644 --- a/test/deps_nix/special_treatment_test.exs +++ b/test/deps_nix/special_treatment_test.exs @@ -163,7 +163,7 @@ defmodule DepsNix.SpecialTreatmentTest do ]; }; in - drv; + drv.override (workarounds.elixirMake { } drv); """ end