-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
30,569 changed files
with
47 additions
and
9,534,483 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ ... }: { | ||
perSystem = { pkgs, self', crane, rust, system, ensureAtRepositoryRoot, srcWithVendoredSources, ... }: | ||
perSystem = { pkgs, self', crane, rust, system, ensureAtRepositoryRoot, srcWithVendoredSources, dbg, ... }: | ||
let | ||
throwBadSystem = throw "libwasmvm cannot be built on system `${system}`"; | ||
|
||
|
@@ -12,13 +12,20 @@ | |
|
||
rustToolchain = rust.mkNightly { target = CARGO_BUILD_TARGET; }; | ||
|
||
wasmvm_1_3_0 = pkgs.fetchFromGitHub { | ||
owner = "CosmWasm"; | ||
repo = "wasmvm"; | ||
rev = "v1.3.0"; # wasmd 0.41.0 | ||
hash = "sha256-rsTYvbkYpDkUE4IvILdSL3hXMgAWxz5ltGotJB2t1e4="; | ||
# wasmvm_1_3_0 = builtins.fetchGit { | ||
# owner = "CosmWasm"; | ||
# repo = "wasmvm"; | ||
# # hash = "sha256-rsTYvbkYpDkUE4IvILdSL3hXMgAWxz5ltGotJB2t1e4="; | ||
# }; | ||
wasmvm_1_3_0 = builtins.fetchGit { | ||
name = "wasmvm_1_3_0"; | ||
url = "[email protected]:CosmWasm/wasmvm"; | ||
# ref = "v1.3.0"; # wasmd 0.41.0 | ||
rev = "71a9c0dc0ecf9623148e82facb3564fbbf0a896f"; # wasmd 0.41.0 | ||
allRefs = true; | ||
}; | ||
wasmvm_1_5_0 = pkgs.fetchFromGitHub { | ||
name = "wasmvm_1_5_0"; | ||
owner = "CosmWasm"; | ||
repo = "wasmvm"; | ||
rev = "v1.5.0"; | ||
|
@@ -33,42 +40,60 @@ | |
inherit CARGO_BUILD_TARGET; | ||
|
||
pname = "libwasmvm"; | ||
version = wasmvm.rev; | ||
version = (dbg wasmvm).rev; | ||
|
||
# cargoArtifacts = null; | ||
|
||
buildInputs = [ rustToolchain ]; | ||
|
||
src = "${wasmvm}/libwasmvm"; | ||
|
||
# dummySrc = crane.lib.mkDummySrc "${wasmvm}/libwasmvm"; | ||
|
||
# cargoVendorDir = crane.lib.vendorMultipleCargoDeps { | ||
# inherit (crane.lib.findCargoFiles wasmvm) cargoConfigs; | ||
# cargoLockList = [ | ||
# workspaceCargoLockPath | ||
# ] ++ (lib.optionals (buildStdTarget != null) ([ | ||
# ./rust-std-Cargo.lock | ||
# ])); | ||
# }; | ||
|
||
|
||
# cargoLock = "${wasmvm}/libwasmvm/Cargo.lock"; | ||
# # cargoVendorDir = vendorDir; | ||
# doCheck = false; | ||
# doInstallCargoArtifacts = false; | ||
# buildPhaseCargoCommand = ""; | ||
} // (if pkgs.stdenv.isLinux then { | ||
cargoExtraArgs = "--release --locked --offline --example=wasmvmstatic"; | ||
# installPhase = '' | ||
# mkdir -p $out/lib | ||
# mv target/${CARGO_BUILD_TARGET}/release/examples/libwasmvmstatic.a $out/lib/libwasmvm.${builtins.head (pkgs.lib.strings.splitString "-" system)}.a | ||
# ''; | ||
cargoExtraArgs = "--locked --offline --example=wasmvmstatic"; | ||
installPhase = '' | ||
mkdir -p $out/lib | ||
mv target/${CARGO_BUILD_TARGET}/release/examples/libwasmvmstatic.a $out/lib/libwasmvm.${builtins.head (pkgs.lib.strings.splitString "-" system)}.a | ||
''; | ||
} else if pkgs.stdenv.isDarwin then { | ||
# non-static dylib build on macOS | ||
cargoExtraArgs = "cargo build --release --locked --offline"; | ||
# installPhase = '' | ||
# mkdir -p $out/lib | ||
# mv target/${CARGO_BUILD_TARGET}/release/deps/libwasmvm.dylib $out/lib/libwasmvm.dylib | ||
# ''; | ||
cargoExtraArgs = "--locked --offline"; | ||
installPhase = '' | ||
mkdir -p $out/lib | ||
mv target/${CARGO_BUILD_TARGET}/release/deps/libwasmvm.dylib $out/lib/libwasmvm.dylib | ||
''; | ||
} else throwBadSystem); | ||
|
||
craneLib = crane.lib.overrideToolchain (rust.mkNightly { target = CARGO_BUILD_TARGET; }); | ||
in | ||
crane.lib.buildPackage (attrs // { | ||
cargoArtifacts = crane.lib.buildDepsOnly attrs; | ||
craneLib.buildPackage (attrs // { | ||
cargoArtifacts = craneLib.buildDepsOnly attrs; | ||
}); | ||
in | ||
{ | ||
_module.args.libwasmvmCargoToml_1_3_0 = "${wasmvm_1_3_0}/libwasmvm/Cargo.toml"; | ||
_module.args.libwasmvmCargoToml_1_5_0 = "${wasmvm_1_5_0}/libwasmvm/Cargo.toml"; | ||
# _module.args.libwasmvmCargoToml_1_3_0 = "${wasmvm_1_3_0}/libwasmvm/Cargo.toml"; | ||
# _module.args.libwasmvmCargoToml_1_5_0 = "${wasmvm_1_5_0}/libwasmvm/Cargo.toml"; | ||
|
||
packages.libwasmvm = mkLibwasmvm wasmvm_1_3_0; | ||
packages.libwasmvm_1_5_0 = mkLibwasmvm wasmvm_1_5_0; | ||
|
||
packages.test = dbg (pkgs.lib.trivial.importTOML ("${wasmvm_1_3_0}/libwasmvm/Cargo.toml")); | ||
|
||
}; | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.