clan-app: filter out unrelated files from build

this should help for faster ci builds.
This commit is contained in:
Jörg Thalheim
2025-05-15 14:13:37 +02:00
parent 3369e56d35
commit 3f7894ef03

View File

@@ -10,9 +10,23 @@
wrapGAppsHook4, wrapGAppsHook4,
gobject-introspection, gobject-introspection,
gtk4, gtk4,
lib,
}: }:
let let
source = ./.; source =
{
withTests ? true,
}:
lib.fileset.toSource {
root = ./.;
fileset = lib.fileset.unions (
[
./clan_app
./pyproject.toml
]
++ lib.optional withTests ./tests
);
};
desktop-file = makeDesktopItem { desktop-file = makeDesktopItem {
name = "org.clan.app"; name = "org.clan.app";
@@ -53,7 +67,7 @@ let
in in
pythonRuntime.pkgs.buildPythonApplication { pythonRuntime.pkgs.buildPythonApplication {
name = "clan-app"; name = "clan-app";
src = source; src = source { };
format = "pyproject"; format = "pyproject";
dontWrapGApps = true; dontWrapGApps = true;
@@ -99,7 +113,7 @@ pythonRuntime.pkgs.buildPythonApplication {
]; ];
} }
'' ''
cp -r ${source} ./src cp -r ${source { withTests = true; }} ./src
chmod +w -R ./src chmod +w -R ./src
cd ./src cd ./src