From 2f99c0d63f7c801c8f92234547ddf3b38c2e1fd1 Mon Sep 17 00:00:00 2001 From: K900 Date: Mon, 1 Jul 2024 13:09:12 +0300 Subject: [PATCH] python312Packages.libfdt: fix build, reorganize patches 3.11 is still broken due to extreme build system weirdness. --- pkgs/development/compilers/dtc/default.nix | 46 ++++++++++++++-------- 1 file changed, 30 insertions(+), 16 deletions(-) diff --git a/pkgs/development/compilers/dtc/default.nix b/pkgs/development/compilers/dtc/default.nix index 9548f8fe06f8..3bf938b75903 100644 --- a/pkgs/development/compilers/dtc/default.nix +++ b/pkgs/development/compilers/dtc/default.nix @@ -23,36 +23,50 @@ stdenv.mkDerivation (finalAttrs: { sha256 = "sha256-FMh3VvlY3fUK8fbd0M+aCmlUrmG9YegiOOQ7MOByffc="; }; - patches = [ + # Big pile of backports. + # FIXME: remove all of these after next upstream release. + patches = let + fetchUpstreamPatch = { rev, hash }: fetchpatch { + name = "dtc-${rev}.patch"; + url = "https://git.kernel.org/pub/scm/utils/dtc/dtc.git/patch/?id=${rev}"; + inherit hash; + }; + in [ # meson: Fix cell overflow tests when running from meson - (fetchpatch { - url = "https://github.com/dgibson/dtc/commit/32174a66efa4ad19fc6a2a6422e4af2ae4f055cb.patch"; - sha256 = "sha256-C7OzwY0zq+2CV3SB5unI7Ill2M3deF7FXeQE3B/Kx2s="; + (fetchUpstreamPatch { + rev = "32174a66efa4ad19fc6a2a6422e4af2ae4f055cb"; + hash = "sha256-C7OzwY0zq+2CV3SB5unI7Ill2M3deF7FXeQE3B/Kx2s="; }) # Use #ifdef NO_VALGRIND - (fetchpatch { - url = "https://github.com/dgibson/dtc/commit/41821821101ad8a9f83746b96b163e5bcbdbe804.patch"; - sha256 = "sha256-7QEFDtap2DWbUGqtyT/RgJZJFldKB8oSubKiCtLZ0w4="; + (fetchUpstreamPatch { + rev = "41821821101ad8a9f83746b96b163e5bcbdbe804"; + hash = "sha256-7QEFDtap2DWbUGqtyT/RgJZJFldKB8oSubKiCtLZ0w4="; }) # dtc: Fix linker options so it also works in Darwin - (fetchpatch { - url = "https://github.com/dgibson/dtc/commit/3acde70714df3623e112cf3ec99fc9b5524220b8.patch"; - sha256 = "sha256-uLXL0Sjcn+bnMuF+A6PjUW1Rq6uNg1dQl58zbeYpP/U="; + (fetchUpstreamPatch { + rev = "71a8b8ef0adf01af4c78c739e04533a35c1dc89c"; + hash = "sha256-uLXL0Sjcn+bnMuF+A6PjUW1Rq6uNg1dQl58zbeYpP/U="; }) # meson: allow disabling tests - (fetchpatch { - url = "https://github.com/dgibson/dtc/commit/35f26d2921b68d97fefbd5a2b6e821a2f02ff65d.patch"; - sha256 = "sha256-cO4f/jJX/pQL7kk4jpKUhsCVESW2ZuWaTr7z3BuvVkw="; + (fetchUpstreamPatch { + rev = "bdc5c8793a13abb8846d115b7923df87605d05bd"; + hash = "sha256-cO4f/jJX/pQL7kk4jpKUhsCVESW2ZuWaTr7z3BuvVkw="; }) - (fetchpatch { - name = "static.patch"; - url = "https://git.kernel.org/pub/scm/utils/dtc/dtc.git/patch/?id=3fbfdd08afd2a7a25b27433f6f5678c0fe694721"; + # meson: fix installation with meson-python + (fetchUpstreamPatch { + rev = "3fbfdd08afd2a7a25b27433f6f5678c0fe694721"; hash = "sha256-skK8m1s4xkK6x9AqzxiEK+1uMEmS27dBI1CdEXNFTfU="; }) + + # pylibfdt: fix get_mem_rsv for newer Python versions + (fetchUpstreamPatch { + rev = "822123856980f84562406cc7bd1d4d6c2b8bc184"; + hash = "sha256-IJpRgP3pP8Eewx2PNKxhXZdsnomz2AR6oOsun50qAms="; + }) ]; env.SETUPTOOLS_SCM_PRETEND_VERSION = finalAttrs.version;