Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use OpenSSL 1.0.x for old Python #48

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 8 additions & 3 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11";
nixpkgs-1809.url = "github:NixOS/nixpkgs/nixos-18.09";
nixpkgs-1809.flake = false;
flake-compat.url = "github:edolstra/flake-compat";
flake-compat.flake = false;
};
Expand All @@ -12,21 +14,22 @@
extra-trusted-public-keys = "nixpkgs-python.cachix.org-1:hxjI7pFxTyuTHn2NkvWCrAUcNZLNS3ZAvfYNuYifcEU=";
};

outputs = { self, nixpkgs, ... }:
outputs = { self, nixpkgs, nixpkgs-1809, ... }:
let
systems = [ "x86_64-linux" "i686-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ];
forAllSystems = f: builtins.listToAttrs (map (name: { inherit name; value = f name; }) systems);
lib = nixpkgs.lib;
versionInBetween = version: lower: upper:
lib.versionOlder version lower && lib.versionAtLeast version upper;
in {
in builtins.trace "nixpkgs-python" {
lib.applyOverrides = overrides: pkg:
let
matching = builtins.filter ({ condition, ... }: condition pkg.version) overrides;
apply = pkg: { override, ... }: override pkg;
in lib.foldl apply pkg matching;
lib.mkPython =
{ pkgs
, pkgs-1809
, version
, hash
, url
Expand Down Expand Up @@ -168,6 +171,7 @@
hash = null;
self = packages.${version};
passthruFun = callPackage "${pkgs.path}/pkgs/development/interpreters/python/passthrufun.nix" { };
openssl_legacy = pkgs-1809.openssl_1_0_2;
} // lib.optionalAttrs (sourceVersion.major == "3") {
noldconfigPatch = ./patches + "/${sourceVersion.major}.${sourceVersion.minor}-no-ldconfig.patch";
}))).overrideAttrs (old: {
Expand All @@ -186,8 +190,9 @@
checks = forAllSystems (system:
let
pkgs = nixpkgs.legacyPackages.${system};
pkgs-1809 = (import nixpkgs-1809) { system = system; };
getRelease = version: source: self.lib.mkPython {
inherit pkgs version packages;
inherit pkgs pkgs-1809 version packages;
inherit (source) hash url;
};
getLatest = version: latest:
Expand Down