{libGL,libGLU,libglut}: don’t use deprecated stubs on Darwin (#400427)

Emily 882f8af3 dd36c9b0

Changed files
+31 -45
pkgs
by-name
fr
freeglut
re
renpy
sn
snes9x
development
python-modules
pyglet
pythonocc-core
kde
top-level
+2 -4
pkgs/by-name/fr/freeglut/package.nix
···
];
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;
-14
pkgs/by-name/re/renpy/package.nix
···
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 = [
+4 -4
pkgs/by-name/sn/snes9x/package.nix
···
cmake,
fetchFromGitHub,
gtkmm3,
-
libGL,
+
libGLX,
libX11,
libXdmcp,
libXext,
···
"--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 = ''
+2 -1
pkgs/development/python-modules/pyglet/default.nix
···
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;
};
}
-6
pkgs/development/python-modules/pythonocc-core/default.nix
···
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
+3 -1
pkgs/kde/lib/mk-kde-derivation.nix
···
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}"
+19 -15
pkgs/top-level/all-packages.nix
···
# 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.
···
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 { };
+1
pkgs/top-level/perl-packages.nix
···
artistic1
gpl1Plus
]; # taken from EPEL
+
badPlatforms = lib.platforms.darwin;