From aba2cf104bf04c67a04e682a1e51d5cd6c0ba32d Mon Sep 17 00:00:00 2001 From: PgBiel <9021226+PgBiel@users.noreply.github.com> Date: Wed, 24 Apr 2024 18:32:40 -0300 Subject: [PATCH] nix/glistix: move away from regex for src filter macOS doesn't like it --- nix/glistix.nix | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/nix/glistix.nix b/nix/glistix.nix index 3110dea80..d405bfa98 100644 --- a/nix/glistix.nix +++ b/nix/glistix.nix @@ -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 ];