This commit is contained in:
DavHau 2021-05-22 20:13:42 +07:00
parent 8bbb6f63f2
commit dc9b7d0c2b
7 changed files with 22 additions and 20 deletions

View file

@ -1,14 +1,8 @@
let
nixpkgs_commit = builtins.readFile ../mach_nix/nix/NIXPKGS_COMMIT; # nixpkgs version to use python packages from
nixpkgs_tarball_sha256 = builtins.readFile ../mach_nix/nix/NIXPKGS_SHA256;
pkgs = import (builtins.fetchTarball {
name = "nixpkgs";
url = "https://github.com/nixos/nixpkgs/tarball/${builtins.readFile ../mach_nix/nix/NIXPKGS_COMMIT}";
sha256 = "${builtins.readFile ../mach_nix/nix/NIXPKGS_SHA256}";
}) { config = {}; overlays = []; };
pkgs = import (import ../mach_nix/nix/nixpkgs-src.nix) { config = {}; overlays = []; };
python = pkgs.python37;
manylinux1 = [ pkgs.pythonManylinuxPackages.manylinux1 ];
result = import ./overrides.nix;
result = import ./overrides.nix { inherit pkgs python; };
overrides = result.overrides manylinux1 pkgs.autoPatchelfHook;
py = pkgs.python37.override { packageOverrides = overrides; };
in

View file

@ -3,7 +3,7 @@
description = "Create highly reproducible python environments";
inputs.flake-utils.url = "github:numtide/flake-utils";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/873c294e03c";
inputs.pypi-deps-db = {
url = "github:DavHau/pypi-deps-db";
flake = false;

View file

@ -17,16 +17,16 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1615259932,
"narHash": "sha256-IXecmbqCr+XCtFwzBO3tHEd8PoJ4X4EyPZebKbV2ioE=",
"lastModified": 1621687574,
"narHash": "sha256-d5GSlJC3fJqsq0nfaBrB3vN3Am2+E0AhqC6ZWS2a4qs=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "29b0d4d0b600f8f5dd0b86e3362a33d4181938f9",
"rev": "873c294e03ccefb4ef4693a6a6258a2c75d44b80",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"ref": "873c294e03c",
"repo": "nixpkgs",
"type": "github"
}

View file

@ -264,7 +264,13 @@ class OverridesGenerator(ExpressionGenerator):
url = "{src_url}";
sha256 = "{src_sha256}";
}};
format = "condabin";
format = "other";
nativeBuildInputs = with python.pkgs; [
autoPatchelfHook
condaUnpackHook
condaInstallHook
];
buildInputs = pkgs.pythonCondaPackages.condaPatchelfLibs;
passthru = (get_passthru "{name}" "{nix_name}") // {{
provider = "conda";
allCondaDeps = allCondaDepsRec pSelf;

View file

@ -61,7 +61,6 @@ let
};
py_final = python_pkg.override { packageOverrides = l.mergeOverrides (
overridesPre
++ [ (import ./mk-python-derivation-overlay.nix pkgs python_pkg) ]
++ [ result.overrides ]
++ (l.fixes_to_overrides _fixes)
++ overridesPost ++ (l.simple_overrides _)

View file

@ -27,18 +27,22 @@ pkgs: python: with pkgs.lib;
in
pySelf: pySuper: {
buildPythonPackage = makeOverridablePythonPackage (
makeOverridable (callPackage ./from-nixpkgs/mk-python-derivation.nix {
makeOverridable (callPackage "${pkgs.path}/pkgs/development/interpreters/python/mk-python-derivation.nix" {
inherit namePrefix; # We want Python libraries to be named like e.g. "python3.6-${name}"
inherit toPythonModule; # Libraries provide modules
autoPatchelfHook = callPackage ./auto_patchelf_hook.nix {};
# this prevents infinite recursions when overriding setuptools later
setuptools = python.pkgs.setuptools;
})
);
buildPythonApplication = makeOverridablePythonPackage (
makeOverridable (callPackage ./from-nixpkgs/mk-python-derivation.nix {
makeOverridable (callPackage "${pkgs.path}/pkgs/development/interpreters/python/mk-python-derivation.nix" {
namePrefix = ""; # Python applications should not have any prefix
toPythonModule = x: x; # Application does not provide modules.
autoPatchelfHook = callPackage ./auto_patchelf_hook.nix {};
# this prevents infinite recursions when overriding setuptools later
setuptools = python.pkgs.setuptools;
})
);
}

View file

@ -112,7 +112,6 @@ let
all_overrides = l.mergeOverrides (
overridesPre ++ overrides_pre_extra
++ extra_pkgs_py_overrides
++ [ (import ./mk-python-derivation-overlay.nix pkgs python_pkg) ]
++ [ result.overrides ]
++ (l.fixes_to_overrides _fixes)
++ overrides_post_extra ++ overridesPost