Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions pkgs/by-name/di/dioxus-cli/fix-wasm-opt-target-dir.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- a/src/build/bundle.rs
+++ b/src/build/bundle.rs
@@ -334,7 +334,7 @@ impl AppBundle {
// Only run wasm-opt if the feature is enabled
// Wasm-opt has an expensive build script that makes it annoying to keep enabled for iterative dev
// We put it behind the "wasm-opt" feature flag so that it can be disabled when iterating on the cli
- self.run_wasm_opt(&self.build.exe_dir())?;
+ self.run_wasm_opt(&self.build.wasm_bindgen_out_dir())?;

// Write the index.html file with the pre-configured contents we got from pre-rendering
std::fs::write(
23 changes: 19 additions & 4 deletions pkgs/by-name/di/dioxus-cli/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,24 @@

rustPlatform.buildRustPackage rec {
pname = "dioxus-cli";
version = "0.6.0";
version = "0.6.2";

src = fetchCrate {
inherit pname version;
hash = "sha256-0Kg2/+S8EuMYZQaK4Ao+mbS7K48VhVWjPL+LnoVJMSw=";
hash = "sha256-jUS/it2N5o5D7Jon0fKHWEt3f0wdtVgNIkqSNc7u830=";
};

useFetchCargoVendor = true;
cargoHash = "sha256-uD3AHHY3edpqyQ8gnsTtxQsen8UzyVIbArSvpMa+B+8=";
buildFeatures = [ "optimizations" ];
cargoHash = "sha256-izvo092FGZmci1cXLo+qhGlBh8W3A1TeBHrYXcjE6HU=";
cargoPatches = [
# TODO: Remove once https://github.com/DioxusLabs/dioxus/issues/3659 is fixed upstream.
./fix-wasm-opt-target-dir.patch
];

buildFeatures = [
"no-downloads"
"optimizations"
];

nativeBuildInputs = [
pkg-config
Expand All @@ -34,11 +42,18 @@ rustPlatform.buildRustPackage rec {

OPENSSL_NO_VENDOR = 1;

# wasm-opt-sys build.rs tries to verify C++17 support, but the check appears to be faulty.
postPatch = ''
substituteInPlace $cargoDepsCopy/wasm-opt-sys-*/build.rs \
--replace-fail 'check_cxx17_support()?;' '// check_cxx17_support()?;'
'';

nativeCheckInputs = [ rustfmt ];

checkFlags = [
# requires network access
"--skip=serve::proxy::test"
"--skip=wasm_bindgen::test"
];

passthru = {
Expand Down