From 2e7c3920a07136c9b7321ba7b24dbdf5528d533f Mon Sep 17 00:00:00 2001 From: rnhmjoj Date: Sun, 21 Aug 2022 16:27:25 +0200 Subject: [PATCH 1/3] pythonPackages: fix cross compilation This fixes, again, the issue with the wrong headers being used when cross compiling python packages with extensions. For context, see https://github.com/NixOS/nixpkgs/pull/173435. --- pkgs/development/python-modules/setuptools/default.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkgs/development/python-modules/setuptools/default.nix b/pkgs/development/python-modules/setuptools/default.nix index 883ca18e93e4..2d3c06d602f1 100644 --- a/pkgs/development/python-modules/setuptools/default.nix +++ b/pkgs/development/python-modules/setuptools/default.nix @@ -1,6 +1,7 @@ { stdenv , buildPythonPackage , fetchFromGitHub +, fetchpatch , python , bootstrapped-pip , lib @@ -27,6 +28,14 @@ let patches = [ ./tag-date.patch ./setuptools-distutils-C++.patch + # Fix cross compilation of extension modules + # https://github.com/pypa/distutils/pull/173 + (fetchpatch { + url = "https://github.com/pypa/distutils/commit/22b9bcf2e2d2a66f7dc96661312972e2f6bd9e01.patch"; + hash = "sha256-IVb1LLgLIHO6HPn2911uksrLB1jG0MyQetdxkq5wcG4="; + stripLen = 2; + extraPrefix = "setuptools/_distutils/"; + }) ]; buildPhase = '' From 0b3ec7fbc83637a33d004f296c1b743ea4fafdcb Mon Sep 17 00:00:00 2001 From: rnhmjoj Date: Sun, 21 Aug 2022 12:07:34 +0200 Subject: [PATCH 2/3] mpv: fix cross compilation --- pkgs/applications/video/mpv/default.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkgs/applications/video/mpv/default.nix b/pkgs/applications/video/mpv/default.nix index cf81c0e0446c..e67f6d117a65 100644 --- a/pkgs/applications/video/mpv/default.nix +++ b/pkgs/applications/video/mpv/default.nix @@ -100,6 +100,10 @@ in stdenv.mkDerivation rec { NIX_LDFLAGS = lib.optionalString x11Support "-lX11 -lXext " + lib.optionalString stdenv.isDarwin "-framework CoreFoundation"; + # These flags are not supported and cause the build + # to fail, even when cross compilation itself works. + dontAddWafCrossFlags = true; + wafConfigureFlags = [ "--enable-libmpv-shared" "--enable-manpage-build" From 5e04a1fd5d803a1e533be51e2273d6d4d140dbaa Mon Sep 17 00:00:00 2001 From: rnhmjoj Date: Sat, 27 Aug 2022 19:16:55 +0200 Subject: [PATCH 3/3] mpv: fix build with wayland support --- pkgs/applications/video/mpv/default.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkgs/applications/video/mpv/default.nix b/pkgs/applications/video/mpv/default.nix index e67f6d117a65..beb6c70f4eea 100644 --- a/pkgs/applications/video/mpv/default.nix +++ b/pkgs/applications/video/mpv/default.nix @@ -24,6 +24,7 @@ , waylandSupport ? stdenv.isLinux , wayland , wayland-protocols + , wayland-scanner , libxkbcommon , x11Support ? stdenv.isLinux @@ -131,7 +132,8 @@ in stdenv.mkDerivation rec { python3 wafHook which - ] ++ lib.optionals swiftSupport [ swift ]; + ] ++ lib.optionals swiftSupport [ swift ] + ++ lib.optionals waylandSupport [ wayland-scanner ]; buildInputs = [ ffmpeg