Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ 2 lib, 3 fetchFromGitHub, 4 rustPlatform, 5 cargo-expand, 6 stdenv, 7}: 8rustPlatform.buildRustPackage rec { 9 pname = "flutter_rust_bridge_codegen"; 10 version = "2.11.1"; 11 12 src = fetchFromGitHub { 13 owner = "fzyzcjy"; 14 repo = "flutter_rust_bridge"; 15 rev = "v${version}"; 16 hash = "sha256-Us+LwT6tjBcTl2xclVsiLauSlIO8w+PiokpiDB+h1fI="; 17 fetchSubmodules = true; 18 }; 19 20 cargoHash = "sha256-pxEwcLiRB95UBfXb+JgS8duEXiZUApH/C8Exus5TkfU="; 21 cargoBuildFlags = "--package flutter_rust_bridge_codegen"; 22 cargoTestFlags = "--package flutter_rust_bridge_codegen"; 23 24 # needed to get tests running 25 nativeBuildInputs = [ cargo-expand ]; 26 27 # needed to run text (see https://github.com/fzyzcjy/flutter_rust_bridge/blob/ae970bfafdf80b9eb283a2167b972fb2e6504511/frb_codegen/src/library/utils/logs.rs#L43) 28 logLevel = "debug"; 29 checkFlags = [ 30 # Disabled because these tests need a different version of anyhow than the package itself 31 "--skip=tests::test_execute_generate_on_frb_example_dart_minimal" 32 "--skip=tests::test_execute_generate_on_frb_example_pure_dart" 33 ] 34 ++ lib.optionals stdenv.hostPlatform.isDarwin [ 35 # Timeout on darwin, not related to networking in sandbox 36 "--skip=library::codegen::controller::tests::test_run_with_watch" 37 "--skip=library::codegen::generator::api_dart::tests::test_functions" 38 ]; 39 40 meta = { 41 mainProgram = "flutter_rust_bridge_codegen"; 42 description = "Flutter/Dart <-> Rust binding generator, feature-rich, but seamless and simple"; 43 homepage = "https://fzyzcjy.github.io/flutter_rust_bridge"; 44 license = lib.licenses.mit; 45 maintainers = [ lib.maintainers.eymeric ]; 46 }; 47}