diff --git a/pkgs/by-name/qs/qsv/package.nix b/pkgs/by-name/qs/qsv/package.nix index 1e0f3a043df7..849f86fb4704 100644 --- a/pkgs/by-name/qs/qsv/package.nix +++ b/pkgs/by-name/qs/qsv/package.nix @@ -1,4 +1,5 @@ { + stdenv, fetchFromGitHub, file, lib, @@ -7,6 +8,27 @@ sqlite, zstd, cmake, + python3, + wayland, + withPolars ? true, + withPython ? stdenv.buildPlatform == stdenv.hostPlatform, + withUi ? true, + buildFeatures ? + # enable all features except self_update by default + # https://github.com/dathere/qsv/blob/7.1.0/Cargo.toml#L370 + [ + "apply" + "feature_capable" + "fetch" + "foreach" + "geocode" + "luau" + "to" + ] + ++ lib.optional withPolars "polars" + ++ lib.optional withPython "python" + ++ lib.optional withUi "ui", + mainProgram ? "qsv", }: let @@ -14,7 +36,7 @@ let version = "7.1.0"; in rustPlatform.buildRustPackage { - inherit pname version; + inherit pname version buildFeatures; src = fetchFromGitHub { owner = "dathere"; @@ -29,30 +51,15 @@ rustPlatform.buildRustPackage { file sqlite zstd - ]; + ] + ++ lib.optional (lib.elem "ui" buildFeatures && stdenv.hostPlatform.isLinux) wayland; nativeBuildInputs = [ pkg-config rustPlatform.bindgenHook cmake - ]; - - buildFeatures = [ - "apply" - "feature_capable" - "fetch" - "foreach" - "geocode" - "to" - ]; - - checkFeatures = [ - "apply" - "feature_capable" - "fetch" - "foreach" - "geocode" - ]; + ] + ++ lib.optional (lib.elem "python" buildFeatures) python3; doCheck = false; @@ -69,8 +76,10 @@ rustPlatform.buildRustPackage { # or unlicense ]; + inherit mainProgram; maintainers = with lib.maintainers; [ detroyejr + misuzu ]; }; }