{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 [
|
cmakeFlags = lib.optionals stdenv.hostPlatform.isDarwin [
|
||||||
"-DOPENGL_INCLUDE_DIR=${libGLX.dev}/include"
|
"-DOPENGL_INCLUDE_DIR=${lib.getInclude libGLX}/include"
|
||||||
"-DOPENGL_gl_LIBRARY:FILEPATH=${libGLX}/lib/libGL.dylib"
|
"-DOPENGL_gl_LIBRARY:FILEPATH=${lib.getLib libGLX}/lib/libGL.dylib"
|
||||||
"-DOPENGL_glu_LIBRARY:FILEPATH=${libGLU}/lib/libGLU.dylib"
|
|
||||||
"-DFREEGLUT_BUILD_DEMOS:BOOL=OFF"
|
"-DFREEGLUT_BUILD_DEMOS:BOOL=OFF"
|
||||||
"-DFREEGLUT_BUILD_STATIC:BOOL=OFF"
|
|
||||||
];
|
];
|
||||||
|
|
||||||
passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
|
passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
|
||||||
|
|||||||
@ -65,20 +65,6 @@ stdenv.mkDerivation (finalAttrs: {
|
|||||||
tkinter
|
tkinter
|
||||||
]);
|
]);
|
||||||
|
|
||||||
RENPY_DEPS_INSTALL = lib.concatStringsSep "::" [
|
|
||||||
ffmpeg.lib
|
|
||||||
freetype
|
|
||||||
fribidi
|
|
||||||
glew.dev
|
|
||||||
harfbuzz.dev
|
|
||||||
libGL
|
|
||||||
libGLU
|
|
||||||
libpng
|
|
||||||
SDL2
|
|
||||||
(lib.getDev SDL2)
|
|
||||||
zlib
|
|
||||||
];
|
|
||||||
|
|
||||||
enableParallelBuilding = true;
|
enableParallelBuilding = true;
|
||||||
|
|
||||||
patches = [
|
patches = [
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
cmake,
|
cmake,
|
||||||
fetchFromGitHub,
|
fetchFromGitHub,
|
||||||
gtkmm3,
|
gtkmm3,
|
||||||
libGL,
|
libGLX,
|
||||||
libX11,
|
libX11,
|
||||||
libXdmcp,
|
libXdmcp,
|
||||||
libXext,
|
libXext,
|
||||||
@ -91,11 +91,11 @@ stdenv.mkDerivation (finalAttrs: {
|
|||||||
"--enable-avx2"
|
"--enable-avx2"
|
||||||
];
|
];
|
||||||
|
|
||||||
postPatch = ''
|
postPatch = lib.optionalString withGtk ''
|
||||||
substituteInPlace external/glad/src/egl.c \
|
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 \
|
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 = ''
|
preConfigure = ''
|
||||||
|
|||||||
@ -110,6 +110,7 @@ buildPythonPackage rec {
|
|||||||
homepage = "http://www.pyglet.org/";
|
homepage = "http://www.pyglet.org/";
|
||||||
description = "Cross-platform windowing and multimedia library";
|
description = "Cross-platform windowing and multimedia library";
|
||||||
license = licenses.bsd3;
|
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=";
|
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 = [
|
nativeBuildInputs = [
|
||||||
cmake
|
cmake
|
||||||
swig
|
swig
|
||||||
|
|||||||
@ -98,7 +98,9 @@ let
|
|||||||
attrName: attrValue:
|
attrName: attrValue:
|
||||||
let
|
let
|
||||||
pretty = lib.generators.toPretty { };
|
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
|
in
|
||||||
if duplicates != [ ] then
|
if duplicates != [ ] then
|
||||||
lib.warn "Duplicate dependencies in ${attrName} of package ${pname}: ${pretty duplicates}"
|
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.
|
# Android NDK provides an OpenGL implementation, we can just use that.
|
||||||
#
|
#
|
||||||
# On macOS, we use the OpenGL framework. Packages that still need GLX
|
# On macOS, the SDK provides the OpenGL framework in `stdenv`.
|
||||||
# specifically can pull in libGLX instead. If you have a package that
|
# Packages that still need GLX specifically can pull in `libGLX`
|
||||||
# should work without X11 but it can’t find the library, it may help
|
# instead. If you have a package that should work without X11 but it
|
||||||
# to add the path to `NIX_CFLAGS_COMPILE`:
|
# 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
|
# 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.
|
# @NixOS/darwin-maintainers to ask an expert to take a look.
|
||||||
@ -9649,25 +9652,26 @@ with pkgs;
|
|||||||
if stdenv.hostPlatform.useAndroidPrebuilt then
|
if stdenv.hostPlatform.useAndroidPrebuilt then
|
||||||
stdenv
|
stdenv
|
||||||
else if stdenv.hostPlatform.isDarwin then
|
else if stdenv.hostPlatform.isDarwin then
|
||||||
darwin.apple_sdk.frameworks.OpenGL
|
null
|
||||||
else
|
else
|
||||||
libglvnd;
|
libglvnd;
|
||||||
|
|
||||||
# On macOS, we use the OpenGL framework. Packages that use libGLX on
|
# On macOS, the SDK provides the OpenGL framework in `stdenv`.
|
||||||
# macOS may need to depend on mesa_glu directly if this doesn’t work.
|
# Packages that use `libGLX` on macOS may need to depend on
|
||||||
libGLU = if stdenv.hostPlatform.isDarwin then darwin.apple_sdk.frameworks.OpenGL else mesa_glu;
|
# `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;
|
libGLX = if stdenv.hostPlatform.isDarwin then mesa else libglvnd;
|
||||||
|
|
||||||
# On macOS, we use the GLUT framework. Packages that use libGLX on
|
# On macOS, the SDK provides the GLUT framework in `stdenv`. Packages
|
||||||
# macOS may need to depend on freeglut directly if this doesn’t work.
|
# that use `libGLX` on macOS may need to depend on `freeglut`
|
||||||
libglut = if stdenv.hostPlatform.isDarwin then darwin.apple_sdk.frameworks.GLUT else freeglut;
|
# directly if this doesn’t work.
|
||||||
|
libglut = if stdenv.hostPlatform.isDarwin then null else freeglut;
|
||||||
|
|
||||||
mesa =
|
mesa =
|
||||||
if stdenv.hostPlatform.isDarwin then
|
if stdenv.hostPlatform.isDarwin then
|
||||||
callPackage ../development/libraries/mesa/darwin.nix {
|
callPackage ../development/libraries/mesa/darwin.nix { }
|
||||||
}
|
|
||||||
else
|
else
|
||||||
callPackage ../development/libraries/mesa { };
|
callPackage ../development/libraries/mesa { };
|
||||||
|
|
||||||
|
|||||||
@ -26609,6 +26609,7 @@ with self;
|
|||||||
artistic1
|
artistic1
|
||||||
gpl1Plus
|
gpl1Plus
|
||||||
]; # taken from EPEL
|
]; # taken from EPEL
|
||||||
|
badPlatforms = lib.platforms.darwin;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user