Skip to content

Commit

Permalink
Merge pull request #51 from ktosiek/fix-sourceVersion
Browse files Browse the repository at this point in the history
Fix sourceVersion for 4 element versions (like 2.7.18.9)
  • Loading branch information
domenkozar authored Aug 5, 2024
2 parents d476f6e + 70032d1 commit 15f2d34
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,12 @@
}:
let
versionList = builtins.splitVersion version;
versionSuffixList = builtins.concatLists [[""] (lib.drop 3 versionList)];
sourceVersion = {
major = builtins.elemAt versionList 0;
minor = builtins.elemAt versionList 1;
patch = builtins.elemAt versionList 2;
suffix = "";
suffix = builtins.concatStringsSep "." versionSuffixList;
};
infix = if sourceVersion.major == "2" then "2.7/" else "";
overrideLDConfigPatch = path: pkg: pkg.override {
Expand Down Expand Up @@ -187,7 +188,7 @@

lib.versions = builtins.fromJSON (builtins.readFile ./versions.json);

checks = forAllSystems (system:
packages = forAllSystems (system:
let
pkgs = nixpkgs.legacyPackages.${system};
getRelease = version: source: self.lib.mkPython {
Expand All @@ -201,6 +202,19 @@
in packages
);

packages = self.checks;
checks = forAllSystems (system:
let
pkgs = nixpkgs.legacyPackages.${system};
in
pkgs.lib.concatMapAttrs (version: python: {
${version} = python;
} // lib.optionalAttrs (versionInBetween version "3" "2.7.18") {
${version + "-ssl"} = pkgs.runCommand "${version}-test-ssl" { } ''
set -x
mkdir $out
${python}/bin/python -c 'import ssl; print(ssl.OPENSSL_VERSION)' | tee $out/openssl-version
'';
}) self.packages.${system});
};
}

0 comments on commit 15f2d34

Please sign in to comment.