From 929a2bf061f1e68017da65f12bc26580da0f7b37 Mon Sep 17 00:00:00 2001 From: Emily Date: Thu, 4 Jul 2024 15:11:56 +0100 Subject: [PATCH 1/2] glfw: use `libGL` on Darwin No need for this conditional any more. --- pkgs/development/libraries/glfw/3.x.nix | 6 ++---- pkgs/top-level/all-packages.nix | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/pkgs/development/libraries/glfw/3.x.nix b/pkgs/development/libraries/glfw/3.x.nix index 67d5a0095148..7ca694827301 100644 --- a/pkgs/development/libraries/glfw/3.x.nix +++ b/pkgs/development/libraries/glfw/3.x.nix @@ -1,6 +1,6 @@ { stdenv, lib, fetchFromGitHub, cmake , libGL, libXrandr, libXinerama, libXcursor, libX11, libXi, libXext -, Carbon, Cocoa, Kernel, OpenGL, fixDarwinDylibNames +, Carbon, Cocoa, Kernel, fixDarwinDylibNames , extra-cmake-modules, wayland , wayland-scanner, wayland-protocols, libxkbcommon }: @@ -19,9 +19,7 @@ stdenv.mkDerivation rec { # Fix linkage issues on X11 (https://github.com/NixOS/nixpkgs/issues/142583) patches = ./x11.patch; - propagatedBuildInputs = - lib.optionals stdenv.isDarwin [ OpenGL ] - ++ lib.optionals stdenv.isLinux [ libGL ]; + propagatedBuildInputs = [ libGL ]; nativeBuildInputs = [ cmake extra-cmake-modules ] ++ lib.optional stdenv.isDarwin fixDarwinDylibNames diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 69de54109269..1219213da346 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -20789,7 +20789,7 @@ with pkgs; glfw-wayland-minecraft = callPackage ../development/libraries/glfw/3.x-wayland-minecraft.nix {}; glfw2 = callPackage ../development/libraries/glfw/2.x.nix { }; glfw3 = callPackage ../development/libraries/glfw/3.x.nix { - inherit (darwin.apple_sdk.frameworks) Carbon Cocoa Kernel OpenGL; + inherit (darwin.apple_sdk.frameworks) Carbon Cocoa Kernel; }; glibc = callPackage ../development/libraries/glibc { From a5b1dedb483820857d19f123ab7573faed44eaf8 Mon Sep 17 00:00:00 2001 From: Emily Date: Thu, 4 Jul 2024 15:11:56 +0100 Subject: [PATCH 2/2] picocrypt: fix evaluation on Darwin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This was referencing `libGL.dev`, which no longer exists on Darwin. Since most of these dependencies are just for its vendored GLFW, and most of them weren’t even needed on Darwin anyway, copy the build inputs from our GLFW package instead. --- pkgs/by-name/pi/picocrypt/package.nix | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/pkgs/by-name/pi/picocrypt/package.nix b/pkgs/by-name/pi/picocrypt/package.nix index bd0fce2518d5..3823fdd1824f 100644 --- a/pkgs/by-name/pi/picocrypt/package.nix +++ b/pkgs/by-name/pi/picocrypt/package.nix @@ -8,7 +8,7 @@ makeDesktopItem, xorg, - libGL, + glfw, gtk3, pkg-config, wrapGAppsHook3, @@ -34,18 +34,14 @@ buildGoModule rec { "-w" ]; - buildInputs = [ - xorg.libX11 - xorg.libXcursor - xorg.libXrandr - xorg.libXi - xorg.libXinerama - xorg.libXxf86vm - libGL.dev - gtk3 - ] ++ lib.optionals stdenv.isDarwin [ - darwin.apple_sdk.frameworks.Kernel - ]; + buildInputs = + # Depends on a vendored, patched GLFW. + glfw.buildInputs or [ ] + ++ glfw.propagatedBuildInputs or [ ] + ++ lib.optionals (!stdenv.isDarwin) [ + gtk3 + xorg.libXxf86vm + ]; nativeBuildInputs = [ copyDesktopItems