{libGL,libGLU,libglut}: don’t use deprecated stubs on Darwin (#400427)
This commit is contained in:
commit
882f8af3ed
@ -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;
|
||||
|
||||
@ -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 = [
|
||||
|
||||
@ -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 = ''
|
||||
|
||||
@ -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;
|
||||
};
|
||||
}
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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}"
|
||||
|
||||
@ -9636,12 +9636,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.
|
||||
@ -9649,25 +9652,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 { };
|
||||
|
||||
|
||||
@ -26609,6 +26609,7 @@ with self;
|
||||
artistic1
|
||||
gpl1Plus
|
||||
]; # taken from EPEL
|
||||
badPlatforms = lib.platforms.darwin;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user