feat(nix/package): build for multiple Python versions

This commit is contained in:
Xarvex
2026-08-18 14:26:36 -05:00
parent c33455b7a0
commit f89f0a6c7f
2 changed files with 40 additions and 21 deletions
+39 -20
View File
@@ -29,35 +29,54 @@
systems = import inputs.systems;
perSystem =
{ pkgs, ... }:
{ pkgs, self', ... }:
let
python3 = pkgs.python313;
python3 = builtins.head python3Versions;
python3Versions = with pkgs; [
python313
python312
];
in
{
packages =
let
python3Packages = python3.pkgs;
pythonDerivations = lib.genAttrs' python3Versions (
python3:
lib.nameValuePair python3.pythonAttr (
let
python3Packages = python3.pkgs;
pillow-jxl-plugin = python3Packages.callPackage ./nix/package/pillow-jxl-plugin.nix {
inherit (pkgs) cmake;
inherit pyexiv2;
};
pyexiv2 = python3Packages.callPackage ./nix/package/pyexiv2.nix { inherit (pkgs) exiv2; };
tagstudio = pkgs.callPackage ./nix/package {
inherit python3Packages;
inherit pillow-jxl-plugin;
};
pillow-jxl-plugin = python3Packages.callPackage ./nix/package/pillow-jxl-plugin.nix {
inherit (pkgs) cmake;
inherit pyexiv2;
};
pyexiv2 = python3Packages.callPackage ./nix/package/pyexiv2.nix { inherit (pkgs) exiv2; };
in
{
inherit tagstudio;
tagstudio-jxl = tagstudio.override { withJXLSupport = true; };
inherit pillow-jxl-plugin pyexiv2;
}
)
);
in
rec {
default = tagstudio;
tagstudio = pkgs.callPackage ./nix/package {
inherit python3Packages;
inherit pillow-jxl-plugin;
};
tagstudio-jxl = tagstudio.override { withJXLSupport = true; };
inherit pillow-jxl-plugin pyexiv2;
(lib.concatMapAttrs (
pythonAttr: lib.mapAttrs' (name: lib.nameValuePair "${pythonAttr}Packages_${name}")
) pythonDerivations)
// pythonDerivations.${python3.pythonAttr}
// {
default = self'.packages.tagstudio;
};
devShells = rec {
default = tagstudio;
devShells = {
default = self'.devShells.tagstudio;
tagstudio = import ./nix/shell.nix {
inherit
inputs
+1 -1
View File
@@ -96,7 +96,6 @@ python3Packages.buildPythonApplication {
dependencies =
with python3Packages;
[
audioop-lts
chardet_5
ffmpeg-python
humanfriendly
@@ -121,6 +120,7 @@ python3Packages.buildPythonApplication {
ujson
wcmatch
]
++ lib.optional (pythonAtLeast "3.13") audioop-lts
++ lib.optional withJXLSupport pillow-jxl-plugin;
# These tests require modifications to a library, which does not work