1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-22 13:41:26 +00:00

gns3: Fix python package not being pinned (#77701)

Due to https://github.com/NixOS/nixpkgs/issues/44426 the correct psutils
package is not picked up, this commit changes the code so the correct
version is always picked.
This commit is contained in:
Alan Hollis 2020-01-17 22:25:35 +00:00 committed by Michael Weiss
parent ee3458392b
commit 4f4d792e70
3 changed files with 34 additions and 38 deletions

View file

@ -7,8 +7,19 @@ let
let version = if args.stable then stableVersion else previewVersion;
branch = if args.stable then "stable" else "preview";
in args // { inherit version branch; };
mkGui = args: callPackage (import ./gui.nix (addVersion args)) { };
mkServer = args: callPackage (import ./server.nix (addVersion args)) { };
extraArgs = {
mkOverride = attrname: version: sha256:
self: super: {
${attrname} = super.${attrname}.overridePythonAttrs (oldAttrs: {
inherit version;
src = oldAttrs.src.override {
inherit version sha256;
};
});
};
};
mkGui = args: callPackage (import ./gui.nix (addVersion args // extraArgs)) { };
mkServer = args: callPackage (import ./server.nix (addVersion args // extraArgs)) { };
guiSrcHash = "1yxwbz93x9hn5y6dir8v7bdfsmfgppvjg4z88l8gx82hhf2476fx";
serverSrcHash = "1d3m8qrz82g8ii6q6j015wqwp6j0415fbqbjvw43zhdx5mnn962d";
in {

View file

@ -1,25 +1,18 @@
{ stable, branch, version, sha256Hash }:
{ stable, branch, version, sha256Hash, mkOverride }:
{ stdenv, python3, fetchFromGitHub }:
{ lib, stdenv, python3, fetchFromGitHub }:
let
# TODO: This package requires qt5Full to launch
defaultOverrides = [
(mkOverride "psutil" "5.6.3"
"1wv31zly44qj0rp2acg58xbnc7bf6ffyadasq093l455q30qafl6")
(mkOverride "jsonschema" "2.6.0"
"00kf3zmpp9ya4sydffpifn0j0mzm342a2vzh82p6r0vh10cg7xbg")
];
python = python3.override {
packageOverrides = self: super: {
psutil = super.psutil.overridePythonAttrs (oldAttrs: rec {
version = "5.6.3";
src = oldAttrs.src.override {
inherit version;
sha256 = "1wv31zly44qj0rp2acg58xbnc7bf6ffyadasq093l455q30qafl6";
};
});
jsonschema = super.jsonschema.overridePythonAttrs (oldAttrs: rec {
version = "2.6.0";
src = oldAttrs.src.override {
inherit version;
sha256 = "00kf3zmpp9ya4sydffpifn0j0mzm342a2vzh82p6r0vh10cg7xbg";
};
});
};
packageOverrides = lib.foldr lib.composeExtensions (self: super: { }) defaultOverrides;
};
in python.pkgs.buildPythonPackage rec {
name = "${pname}-${version}";

View file

@ -1,25 +1,17 @@
{ stable, branch, version, sha256Hash }:
{ stable, branch, version, sha256Hash, mkOverride }:
{ stdenv, python3, fetchFromGitHub }:
{ lib, stdenv, python3, fetchFromGitHub }:
let
defaultOverrides = [
(mkOverride "psutil" "5.6.3"
"1wv31zly44qj0rp2acg58xbnc7bf6ffyadasq093l455q30qafl6")
(mkOverride "jsonschema" "2.6.0"
"00kf3zmpp9ya4sydffpifn0j0mzm342a2vzh82p6r0vh10cg7xbg")
];
python = python3.override {
packageOverrides = self: super: {
psutil = super.psutil.overridePythonAttrs (oldAttrs: rec {
version = "5.6.3";
src = oldAttrs.src.override {
inherit version;
sha256 = "1wv31zly44qj0rp2acg58xbnc7bf6ffyadasq093l455q30qafl6";
};
});
jsonschema = super.jsonschema.overridePythonAttrs (oldAttrs: rec {
version = "2.6.0";
src = oldAttrs.src.override {
inherit version;
sha256 = "00kf3zmpp9ya4sydffpifn0j0mzm342a2vzh82p6r0vh10cg7xbg";
};
});
};
packageOverrides = lib.foldr lib.composeExtensions (self: super: { }) defaultOverrides;
};
in python.pkgs.buildPythonPackage {
pname = "gns3-server";