Skip to content

Commit

Permalink
nix/glistix: move away from regex for src filter
Browse files Browse the repository at this point in the history
macOS doesn't like it
  • Loading branch information
PgBiel committed Apr 24, 2024
1 parent 3a40a52 commit aba2cf1
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions nix/glistix.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,30 @@
, SystemConfiguration ? darwin.apple_sdk.frameworks.SystemConfiguration
}:

let
sourcePaths = [
"test"
"test-package-compiler"
"test-community-packages"
"compiler-cli"
"compiler-core"
"compiler-wasm"
"Cargo.toml"
"Cargo.lock"
];

filterPaths = path: type:
builtins.any (accepted: lib.path.hasPrefix (./../. + "/${accepted}") (/. + path)) sourcePaths;
in

rustPlatform.buildRustPackage {
pname = "glistix";
version = "0.1.0";

src = lib.sourceByRegex ./.. [
''(bin|test(|-community-packages|-package-compiler)|compiler-(cli|core|wasm))(/.*)?''
''Cargo\.(toml|lock)''
];
src = lib.cleanSourceWith {
filter = filterPaths;
src = ./..;
};

nativeBuildInputs = [ git pkg-config ];

Expand Down

0 comments on commit aba2cf1

Please sign in to comment.