From 43e468cefbe0458018758c5c1ee9a6e8768bb096 Mon Sep 17 00:00:00 2001 From: Erwin Boskma Date: Mon, 15 Jul 2024 20:20:15 +0200 Subject: [PATCH] overlay: Add temporary hack until Python on nixos-unstable is unfucked --- overlays/default.nix | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/overlays/default.nix b/overlays/default.nix index a70f4d5..95477dc 100644 --- a/overlays/default.nix +++ b/overlays/default.nix @@ -1,4 +1,4 @@ -_final: prev: { +final: prev: { backscrub = prev.pkgs.callPackage ../pkgs/backscrub { inherit (prev.pkgs) gcc @@ -19,4 +19,38 @@ _final: prev: { ); git-repo-go = prev.pkgs.callPackage ../pkgs/git-repo-go { }; + + # Temporary until nixos-unstable is fixed for Python 3.12 + python312 = prev.python312.override { + packageOverrides = _finalPkgs: prevPkgs: { + nose = prevPkgs.nose.overrideAttrs { + patches = [ + (final.fetchpatch2 { + url = "https://github.com/NixOS/nixpkgs/raw/599e471d78801f95ccd2c424a37e76ce177e50b9/pkgs/development/python-modules/nose/0001-nose-python-3.12-fixes.patch"; + hash = "sha256-aePOvO5+TJL4JzXywc7rEiYRzfdObSI9fg9Cfrp+e2o="; + }) + ]; + }; + wxpython = prevPkgs.wxpython.overrideAttrs { + disabled = false; + postPatch = + let + waf_2_0_25 = prev.fetchurl { + url = "https://waf.io/waf-2.0.25"; + hash = "sha256-IRmc0iDM9gQ0Ez4f0quMjlIXw3mRmcgnIlQ5cNyOONU="; + }; + in + '' + cp ${waf_2_0_25} bin/waf-2.0.25 + chmod +x bin/waf-2.0.25 + substituteInPlace build.py \ + --replace-fail "wafCurrentVersion = '2.0.24'" "wafCurrentVersion = '2.0.25'" \ + --replace-fail "wafMD5 = '698f382cca34a08323670f34830325c4'" "wafMD5 = 'a4b1c34a03d594e5744f9e42f80d969d'" \ + --replace-fail "distutils.dep_util" "setuptools.modified" + ''; + }; + python-hglib = prevPkgs.python-hglib.overrideAttrs { dontUseSetuptoolsCheck = "1"; }; + }; + }; + python312Packages = final.python312.pkgs; }