Skip to content

Commit

Permalink
Add override for ex_secp256k1
Browse files Browse the repository at this point in the history
  • Loading branch information
camelpunch committed Jan 12, 2025
1 parent 08ade6d commit f4b81aa
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 16 deletions.
38 changes: 30 additions & 8 deletions fixtures/example/deps.nix
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ let
name = "rustlerPrecompiled";
}
];
ex_secp256k1 = [
{
name = "rustlerPrecompiled";
}
];
tokenizers = [
{
name = "rustlerPrecompiled";
Expand All @@ -38,14 +43,10 @@ let
elixirConfig = pkgs.writeTextDir "config/config.exs" ''
import Config
config :explorer, Explorer.PolarsBackend.Native,
skip_compilation?: true
config :ex_keccak, ExKeccak,
skip_compilation?: true
config :tokenizers, Tokenizers.Native,
skip_compilation?: true
config :ex_keccak, ExKeccak, skip_compilation?: true
config :explorer, Explorer.PolarsBackend.Native, skip_compilation?: true
config :ex_secp256k1, ExSecp256k1.Impl, skip_compilation?: true
config :tokenizers, Tokenizers.Native, skip_compilation?: true
'';

buildNativeDir = src: "${src}/native/${with builtins; head (attrNames (readDir "${src}/native"))}";
Expand Down Expand Up @@ -464,6 +465,27 @@ let
];
};

ex_secp256k1 =
let
version = "0.7.3";
in
buildMix {
inherit version;
name = "ex_secp256k1";
appConfigPath = ./config;

src = fetchHex {
inherit version;
pkg = "ex_secp256k1";
sha256 = "ea63159442f4d8143166cd1507da03edc43216d6e7c6bac4b416bdce04f0daa8";
};

beamDeps = [
rustler
rustler_precompiled
];
};

explorer =
let
version = "0.9.2";
Expand Down
1 change: 1 addition & 0 deletions fixtures/example/mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ defmodule Example.MixProject do
{:bandit, github: "mtrudel/bandit", ref: "1.4.2"},
{:deps_nix, path: "../..", only: [:dev]},
{:eventstore, "~> 1.4"},
{:ex_secp256k1, "~> 0.7.3"},
{:ex_cldr, "~> 2.38"},
{:ex_cldr_dates_times, "~> 2.17"},
{:ex_cldr_numbers, "~> 2.33"},
Expand Down
1 change: 1 addition & 0 deletions fixtures/example/mix.lock
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"ex_cldr_dates_times": {:hex, :ex_cldr_dates_times, "2.20.3", "153cf527f9f7e524ccee8511c2279e39bec589e652d3b0daf5ab018e2364bf86", [:mix], [{:calendar_interval, "~> 0.2", [hex: :calendar_interval, repo: "hexpm", optional: true]}, {:ex_cldr, "~> 2.40", [hex: :ex_cldr, repo: "hexpm", optional: false]}, {:ex_cldr_calendars, "~> 1.25", [hex: :ex_cldr_calendars, repo: "hexpm", optional: false]}, {:ex_cldr_units, "~> 3.17", [hex: :ex_cldr_units, repo: "hexpm", optional: true]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:tz, "~> 0.26", [hex: :tz, repo: "hexpm", optional: true]}], "hexpm", "52fe1493f44d2420d4af80dbafb65c89bfd17f0758a98c4ad61182518bb6e5a1"},
"ex_cldr_numbers": {:hex, :ex_cldr_numbers, "2.33.4", "ecb06f40fc63f484a53d4ea80e1bdd6860ec44d3032f2b10b17340d34c0a13d5", [:mix], [{:decimal, "~> 1.6 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:digital_token, "~> 0.3 or ~> 1.0", [hex: :digital_token, repo: "hexpm", optional: false]}, {:ex_cldr, "~> 2.38", [hex: :ex_cldr, repo: "hexpm", optional: false]}, {:ex_cldr_currencies, "~> 2.16", [hex: :ex_cldr_currencies, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}], "hexpm", "d15b7e217e9e60c328e73045e51dc67d7ac5d2997247b833efab2c69b2ed06f5"},
"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.9.2", "a9598eeff8d36d88f643d14818bea1869ca70c4def61bfba22f040ee315b84b6", [: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]}, {: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", "63057e318d613c1819bd8bee2d8ed4f7061c3136edc6832ad18243d28e6344eb"},
"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"},
Expand Down
17 changes: 9 additions & 8 deletions priv/default-overrides.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ let
name = "rustlerPrecompiled";
}
];
ex_secp256k1 = [
{
name = "rustlerPrecompiled";
}
];
tokenizers = [
{
name = "rustlerPrecompiled";
Expand All @@ -26,14 +31,10 @@ let
elixirConfig = pkgs.writeTextDir "config/config.exs" ''
import Config
config :explorer, Explorer.PolarsBackend.Native,
skip_compilation?: true
config :ex_keccak, ExKeccak,
skip_compilation?: true
config :tokenizers, Tokenizers.Native,
skip_compilation?: true
config :ex_keccak, ExKeccak, skip_compilation?: true
config :explorer, Explorer.PolarsBackend.Native, skip_compilation?: true
config :ex_secp256k1, ExSecp256k1.Impl, skip_compilation?: true
config :tokenizers, Tokenizers.Native, skip_compilation?: true
'';

buildNativeDir = src: "${src}/native/${with builtins; head (attrNames (readDir "${src}/native"))}";
Expand Down

0 comments on commit f4b81aa

Please sign in to comment.