diff options
Diffstat (limited to 'pkgs/development/compilers/elm/packages/elm-json')
-rw-r--r-- | pkgs/development/compilers/elm/packages/elm-json/default.nix | 41 | ||||
-rw-r--r-- | pkgs/development/compilers/elm/packages/elm-json/use-system-ssl.patch | 43 |
2 files changed, 84 insertions, 0 deletions
diff --git a/pkgs/development/compilers/elm/packages/elm-json/default.nix b/pkgs/development/compilers/elm/packages/elm-json/default.nix new file mode 100644 index 000000000000..16cd7f972ce4 --- /dev/null +++ b/pkgs/development/compilers/elm/packages/elm-json/default.nix @@ -0,0 +1,41 @@ +{ lib +, curl +, rustPlatform +, fetchurl +, openssl +, stdenv +, pkg-config +, darwin +}: + +rustPlatform.buildRustPackage rec { + pname = "elm-json"; + version = "0.2.12"; + + src = fetchurl { + url = "https://github.com/zwilias/elm-json/archive/v${version}.tar.gz"; + sha256 = "sha256:nlpxlPzWk3wwDgczuMI9T6DFY1YtQpQ1R4BhdPbzZBs="; + }; + + cargoPatches = [ ./use-system-ssl.patch ]; + + nativeBuildInputs = [ pkg-config ]; + + buildInputs = [ + curl + openssl + ] ++ lib.optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks.Security ]; + + cargoSha256 = "sha256:8SOpL8nfhYen9vza0LYpB/5fgVmBwG7vGMmFOaJskIc="; + + # Tests perform networking and therefore can't work in sandbox + doCheck = false; + + meta = with lib; { + description = "Install, upgrade and uninstall Elm dependencies"; + mainProgram = "elm-json"; + homepage = "https://github.com/zwilias/elm-json"; + license = licenses.mit; + maintainers = [ maintainers.turbomack ]; + }; +} diff --git a/pkgs/development/compilers/elm/packages/elm-json/use-system-ssl.patch b/pkgs/development/compilers/elm/packages/elm-json/use-system-ssl.patch new file mode 100644 index 000000000000..54df03019231 --- /dev/null +++ b/pkgs/development/compilers/elm/packages/elm-json/use-system-ssl.patch @@ -0,0 +1,43 @@ +diff --git a/Cargo.lock b/Cargo.lock +index b9bf434..58cfe81 100644 +--- a/Cargo.lock ++++ b/Cargo.lock +@@ -685,15 +685,6 @@ version = "0.1.4" + source = "registry+https://github.com/rust-lang/crates.io-index" + checksum = "28988d872ab76095a6e6ac88d99b54fd267702734fd7ffe610ca27f533ddb95a" + +-[[package]] +-name = "openssl-src" +-version = "111.17.0+1.1.1m" +-source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "05d6a336abd10814198f66e2a91ccd7336611f30334119ca8ce300536666fcf4" +-dependencies = [ +- "cc", +-] +- + [[package]] + name = "openssl-sys" + version = "0.9.72" +@@ -703,7 +694,6 @@ dependencies = [ + "autocfg", + "cc", + "libc", +- "openssl-src", + "pkg-config", + "vcpkg", + ] +diff --git a/Cargo.toml b/Cargo.toml +index bc97f20..54d3b14 100644 +--- a/Cargo.toml ++++ b/Cargo.toml +@@ -17,8 +17,8 @@ colored = "2.0" + dialoguer = "0.6" + dirs = "3.0" + fs2 = "0.4" +-isahc = { version = "1.6.0", default-features = false, features = ["static-ssl", "static-curl"] } +-curl = {version = "0.4.42", default-features = false, features = ["ssl", "static-curl", "static-ssl", "force-system-lib-on-osx"]} ++isahc = { version = "1.6.0", default-features = false } ++curl = {version = "0.4.42", default-features = false, features = ["ssl", "force-system-lib-on-osx"]} + ctrlc = "3.1" + console = "0.12" + anyhow = "1.0" |