From 80be671cde5be5c6ad00b8e4a36f222fa8339ee8 Mon Sep 17 00:00:00 2001 From: Emily Date: Sun, 20 Apr 2025 16:56:35 +0100 Subject: [PATCH 1/8] python312Packages.pythonocc-core: drop obsolete Darwin patch --- pkgs/development/python-modules/pythonocc-core/default.nix | 6 ------ 1 file changed, 6 deletions(-) diff --git a/pkgs/development/python-modules/pythonocc-core/default.nix b/pkgs/development/python-modules/pythonocc-core/default.nix index dac8bbbfd7b6..8a589a36f726 100644 --- a/pkgs/development/python-modules/pythonocc-core/default.nix +++ b/pkgs/development/python-modules/pythonocc-core/default.nix @@ -29,12 +29,6 @@ stdenv.mkDerivation rec { hash = "sha256-0o2PQEN0/Z7FUPZEo2HxFFa+mN2bZnYI++HVu4ONpNA="; }; - postPatch = '' - substituteInPlace CMakeLists.txt \ - --replace "/usr/X11R6/lib/libGL.dylib" "${libGL}/lib/libGL.dylib" \ - --replace "/usr/X11R6/lib/libGLU.dylib" "${libGLU}/lib/libGLU.dylib" - ''; - nativeBuildInputs = [ cmake swig From 7e6d1f1ea40be680386f18dce66f3d96dbb5b80c Mon Sep 17 00:00:00 2001 From: Emily Date: Sun, 20 Apr 2025 17:59:25 +0100 Subject: [PATCH 2/8] freeglut: remove unnecessary Darwin stuff --- pkgs/by-name/fr/freeglut/package.nix | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/pkgs/by-name/fr/freeglut/package.nix b/pkgs/by-name/fr/freeglut/package.nix index ca0f1923098f..5a1ef392ff06 100644 --- a/pkgs/by-name/fr/freeglut/package.nix +++ b/pkgs/by-name/fr/freeglut/package.nix @@ -38,11 +38,9 @@ stdenv.mkDerivation (finalAttrs: { ]; cmakeFlags = lib.optionals stdenv.hostPlatform.isDarwin [ - "-DOPENGL_INCLUDE_DIR=${libGLX.dev}/include" - "-DOPENGL_gl_LIBRARY:FILEPATH=${libGLX}/lib/libGL.dylib" - "-DOPENGL_glu_LIBRARY:FILEPATH=${libGLU}/lib/libGLU.dylib" + "-DOPENGL_INCLUDE_DIR=${lib.getInclude libGLX}/include" + "-DOPENGL_gl_LIBRARY:FILEPATH=${lib.getLib libGLX}/lib/libGL.dylib" "-DFREEGLUT_BUILD_DEMOS:BOOL=OFF" - "-DFREEGLUT_BUILD_STATIC:BOOL=OFF" ]; passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage; From d151e48c63c36ee9b4ec5eb3d07e1cda9cae9b55 Mon Sep 17 00:00:00 2001 From: Emily Date: Sun, 20 Apr 2025 18:12:28 +0100 Subject: [PATCH 3/8] renpy: drop `RENPY_DEPS_INSTALL` This was removed by upstream in . --- pkgs/by-name/re/renpy/package.nix | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/pkgs/by-name/re/renpy/package.nix b/pkgs/by-name/re/renpy/package.nix index dc72a086f7e0..bdc76102fdc4 100644 --- a/pkgs/by-name/re/renpy/package.nix +++ b/pkgs/by-name/re/renpy/package.nix @@ -65,20 +65,6 @@ stdenv.mkDerivation (finalAttrs: { tkinter ]); - RENPY_DEPS_INSTALL = lib.concatStringsSep "::" [ - ffmpeg.lib - freetype - fribidi - glew.dev - harfbuzz.dev - libGL - libGLU - libpng - SDL2 - (lib.getDev SDL2) - zlib - ]; - enableParallelBuilding = true; patches = [ From 7f1865a5632bb447e787d42a2fe2e0a4a8891679 Mon Sep 17 00:00:00 2001 From: Emily Date: Sun, 20 Apr 2025 18:25:27 +0100 Subject: [PATCH 4/8] snes9x: use `libGLX` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This isn’t used by the X11 backend anyway, which is the only one we build for macOS. Even though it has a native macOS frontend. But I don’t want to spend more time on this. --- pkgs/by-name/sn/snes9x/package.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/by-name/sn/snes9x/package.nix b/pkgs/by-name/sn/snes9x/package.nix index 970f4a48ee26..77fdf7877922 100644 --- a/pkgs/by-name/sn/snes9x/package.nix +++ b/pkgs/by-name/sn/snes9x/package.nix @@ -5,7 +5,7 @@ cmake, fetchFromGitHub, gtkmm3, - libGL, + libGLX, libX11, libXdmcp, libXext, @@ -91,11 +91,11 @@ stdenv.mkDerivation (finalAttrs: { "--enable-avx2" ]; - postPatch = '' + postPatch = lib.optionalString withGtk '' substituteInPlace external/glad/src/egl.c \ - --replace-fail libEGL.so.1 "${lib.getLib libGL}/lib/libEGL.so.1" + --replace-fail libEGL.so.1 "${lib.getLib libGLX}/lib/libEGL.so.1" substituteInPlace external/glad/src/glx.c \ - --replace-fail libGL.so.1 ${lib.getLib libGL}/lib/libGL.so.1 + --replace-fail libGL.so.1 ${lib.getLib libGLX}/lib/libGL.so.1 ''; preConfigure = '' From c97f8bef72c04eecc71dc4f035bde081dffb9c1c Mon Sep 17 00:00:00 2001 From: Emily Date: Sun, 20 Apr 2025 18:31:17 +0100 Subject: [PATCH 5/8] kdePackages.mkKdeDerivation: handle `null` build inputs --- pkgs/kde/lib/mk-kde-derivation.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkgs/kde/lib/mk-kde-derivation.nix b/pkgs/kde/lib/mk-kde-derivation.nix index 510d6f19a722..0f7797e9fdc2 100644 --- a/pkgs/kde/lib/mk-kde-derivation.nix +++ b/pkgs/kde/lib/mk-kde-derivation.nix @@ -98,7 +98,9 @@ let attrName: attrValue: let pretty = lib.generators.toPretty { }; - duplicates = builtins.filter (dep: (builtins.elem (lib.getName dep) filteredDepNames)) attrValue; + duplicates = builtins.filter ( + dep: dep != null && builtins.elem (lib.getName dep) filteredDepNames + ) attrValue; in if duplicates != [ ] then lib.warn "Duplicate dependencies in ${attrName} of package ${pname}: ${pretty duplicates}" From 53b79fa3050a9440fef73d52deb7fde6b5549019 Mon Sep 17 00:00:00 2001 From: Emily Date: Mon, 21 Apr 2025 21:56:57 +0100 Subject: [PATCH 6/8] perlPackages.OpenGL: mark as broken on Darwin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Patch needs adjusting, build process is super messed up, package is out of date and not used in Nixpkgs other than by another unused library… not worth it. --- pkgs/top-level/perl-packages.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/top-level/perl-packages.nix b/pkgs/top-level/perl-packages.nix index 22466fed1a3e..f91fdf4c19f9 100644 --- a/pkgs/top-level/perl-packages.nix +++ b/pkgs/top-level/perl-packages.nix @@ -26609,6 +26609,7 @@ with self; artistic1 gpl1Plus ]; # taken from EPEL + badPlatforms = lib.platforms.darwin; }; }; From 0320d1937ab4ac10b749ec33f19c26974b24c417 Mon Sep 17 00:00:00 2001 From: Emily Date: Sun, 20 Apr 2025 16:46:55 +0100 Subject: [PATCH 7/8] =?UTF-8?q?python312Packages.pyglet:=20mark=20as=20Lin?= =?UTF-8?q?ux=E2=80=90only?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkgs/development/python-modules/pyglet/default.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/pyglet/default.nix b/pkgs/development/python-modules/pyglet/default.nix index 663d6db5fb4d..57456fc256cd 100644 --- a/pkgs/development/python-modules/pyglet/default.nix +++ b/pkgs/development/python-modules/pyglet/default.nix @@ -110,6 +110,7 @@ buildPythonPackage rec { homepage = "http://www.pyglet.org/"; description = "Cross-platform windowing and multimedia library"; license = licenses.bsd3; - inherit (mesa.meta) platforms; + # The patch needs adjusting for non‐Linux platforms. + platforms = platforms.linux; }; } From 4727c8692f2abed91768dce93cc7d54e8c7c03c2 Mon Sep 17 00:00:00 2001 From: Emily Date: Sun, 20 Apr 2025 14:10:58 +0100 Subject: [PATCH 8/8] =?UTF-8?q?{libGL,libGLU,libglut}:=20don=E2=80=99t=20u?= =?UTF-8?q?se=20deprecated=20stubs=20on=20Darwin?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkgs/top-level/all-packages.nix | 34 ++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 707126c1a872..8086718bec1e 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -9785,12 +9785,15 @@ with pkgs; # # Android NDK provides an OpenGL implementation, we can just use that. # - # On macOS, we use the OpenGL framework. Packages that still need GLX - # specifically can pull in libGLX instead. If you have a package that - # should work without X11 but it can’t find the library, it may help - # to add the path to `NIX_CFLAGS_COMPILE`: + # On macOS, the SDK provides the OpenGL framework in `stdenv`. + # Packages that still need GLX specifically can pull in `libGLX` + # instead. If you have a package that should work without X11 but it + # can’t find the library, it may help to add the path to + # `$NIX_CFLAGS_COMPILE`: # - # -L${libGL}/Library/Frameworks/OpenGL.framework/Versions/Current/Libraries + # preConfigure = '' + # export NIX_CFLAGS_COMPILE+=" -L$SDKROOT/System/Library/Frameworks/OpenGL.framework/Versions/Current/Libraries" + # ''; # # If you still can’t get it working, please don’t hesitate to ping # @NixOS/darwin-maintainers to ask an expert to take a look. @@ -9798,25 +9801,26 @@ with pkgs; if stdenv.hostPlatform.useAndroidPrebuilt then stdenv else if stdenv.hostPlatform.isDarwin then - darwin.apple_sdk.frameworks.OpenGL + null else libglvnd; - # On macOS, we use the OpenGL framework. Packages that use libGLX on - # macOS may need to depend on mesa_glu directly if this doesn’t work. - libGLU = if stdenv.hostPlatform.isDarwin then darwin.apple_sdk.frameworks.OpenGL else mesa_glu; + # On macOS, the SDK provides the OpenGL framework in `stdenv`. + # Packages that use `libGLX` on macOS may need to depend on + # `mesa_glu` directly if this doesn’t work. + libGLU = if stdenv.hostPlatform.isDarwin then null else mesa_glu; - # libglvnd does not work (yet?) on macOS. + # `libglvnd` does not work (yet?) on macOS. libGLX = if stdenv.hostPlatform.isDarwin then mesa else libglvnd; - # On macOS, we use the GLUT framework. Packages that use libGLX on - # macOS may need to depend on freeglut directly if this doesn’t work. - libglut = if stdenv.hostPlatform.isDarwin then darwin.apple_sdk.frameworks.GLUT else freeglut; + # On macOS, the SDK provides the GLUT framework in `stdenv`. Packages + # that use `libGLX` on macOS may need to depend on `freeglut` + # directly if this doesn’t work. + libglut = if stdenv.hostPlatform.isDarwin then null else freeglut; mesa = if stdenv.hostPlatform.isDarwin then - callPackage ../development/libraries/mesa/darwin.nix { - } + callPackage ../development/libraries/mesa/darwin.nix { } else callPackage ../development/libraries/mesa { };