Merge pull request #62715 from matthewbauer/darwin-gl
Darwin GL Experiments
This commit is contained in:
commit
e44fdaa9c2
@ -1,4 +1,4 @@
|
|||||||
{ stdenv, fetchurl, pkgconfig, libGL }:
|
{ stdenv, fetchurl, pkgconfig, libGL, ApplicationServices }:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
name = "glu-${version}";
|
name = "glu-${version}";
|
||||||
@ -13,7 +13,8 @@ stdenv.mkDerivation rec {
|
|||||||
'';
|
'';
|
||||||
|
|
||||||
nativeBuildInputs = [ pkgconfig ];
|
nativeBuildInputs = [ pkgconfig ];
|
||||||
propagatedBuildInputs = [ libGL ];
|
propagatedBuildInputs = [ libGL ]
|
||||||
|
++ stdenv.lib.optional stdenv.isDarwin ApplicationServices;
|
||||||
|
|
||||||
outputs = [ "out" "dev" ];
|
outputs = [ "out" "dev" ];
|
||||||
|
|
||||||
|
@ -111,7 +111,7 @@ let self = stdenv.mkDerivation {
|
|||||||
"--enable-texture-float"
|
"--enable-texture-float"
|
||||||
(enableFeature stdenv.isLinux "dri3")
|
(enableFeature stdenv.isLinux "dri3")
|
||||||
(enableFeature stdenv.isLinux "nine") # Direct3D in Wine
|
(enableFeature stdenv.isLinux "nine") # Direct3D in Wine
|
||||||
"--enable-libglvnd"
|
(enableFeature stdenv.isLinux "libglvnd")
|
||||||
"--enable-dri"
|
"--enable-dri"
|
||||||
"--enable-driglx-direct"
|
"--enable-driglx-direct"
|
||||||
"--enable-gles1"
|
"--enable-gles1"
|
||||||
@ -233,12 +233,51 @@ let self = stdenv.mkDerivation {
|
|||||||
inherit libdrm version;
|
inherit libdrm version;
|
||||||
inherit (libglvnd) driverLink;
|
inherit (libglvnd) driverLink;
|
||||||
|
|
||||||
|
# Use stub libraries from libglvnd and headers from Mesa.
|
||||||
stubs = stdenv.mkDerivation {
|
stubs = stdenv.mkDerivation {
|
||||||
name = "libGL-${libglvnd.version}";
|
name = "libGL-${libglvnd.version}";
|
||||||
outputs = [ "out" "dev" ];
|
outputs = [ "out" "dev" ];
|
||||||
|
|
||||||
# Use stub libraries from libglvnd and headers from Mesa.
|
# On macOS, libglvnd is not supported, so we just use what mesa
|
||||||
buildCommand = ''
|
# build. We need to also include OpenGL.framework, and some
|
||||||
|
# extra tricks to go along with. We add mesa’s libGLX to support
|
||||||
|
# the X extensions to OpenGL.
|
||||||
|
buildCommand = if stdenv.hostPlatform.isDarwin then ''
|
||||||
|
mkdir -p $out/nix-support $dev
|
||||||
|
echo ${OpenGL} >> $out/nix-support/propagated-build-inputs
|
||||||
|
ln -s ${self.out}/lib $out/lib
|
||||||
|
|
||||||
|
mkdir -p $dev/lib/pkgconfig $dev/nix-support
|
||||||
|
echo "$out" > $dev/nix-support/propagated-build-inputs
|
||||||
|
ln -s ${self.dev}/include $dev/include
|
||||||
|
|
||||||
|
cat <<EOF >$dev/lib/pkgconfig/gl.pc
|
||||||
|
Name: gl
|
||||||
|
Description: gl library
|
||||||
|
Version: ${self.version}
|
||||||
|
Libs: -L${self.out}/lib -lGL
|
||||||
|
Cflags: -I${self.dev}/include
|
||||||
|
EOF
|
||||||
|
|
||||||
|
cat <<EOF >$dev/lib/pkgconfig/glesv1_cm.pc
|
||||||
|
Name: glesv1_cm
|
||||||
|
Description: glesv1_cm library
|
||||||
|
Version: ${self.version}
|
||||||
|
Libs: -L${self.out}/lib -lGLESv1_CM
|
||||||
|
Cflags: -I${self.dev}/include
|
||||||
|
EOF
|
||||||
|
|
||||||
|
cat <<EOF >$dev/lib/pkgconfig/glesv2.pc
|
||||||
|
Name: glesv2
|
||||||
|
Description: glesv2 library
|
||||||
|
Version: ${self.version}
|
||||||
|
Libs: -L${self.out}/lib -lGLESv2
|
||||||
|
Cflags: -I${self.dev}/include
|
||||||
|
EOF
|
||||||
|
''
|
||||||
|
|
||||||
|
# Otherwise, setup gl stubs to use libglvnd.
|
||||||
|
else ''
|
||||||
mkdir -p $out/nix-support
|
mkdir -p $out/nix-support
|
||||||
ln -s ${libglvnd.out}/lib $out/lib
|
ln -s ${libglvnd.out}/lib $out/lib
|
||||||
|
|
||||||
@ -263,8 +302,6 @@ let self = stdenv.mkDerivation {
|
|||||||
genPkgConfig egl EGL
|
genPkgConfig egl EGL
|
||||||
genPkgConfig glesv1_cm GLESv1_CM
|
genPkgConfig glesv1_cm GLESv1_CM
|
||||||
genPkgConfig glesv2 GLESv2
|
genPkgConfig glesv2 GLESv2
|
||||||
'' + lib.optionalString stdenv.isDarwin ''
|
|
||||||
echo ${OpenGL} > $out/nix-support/propagated-build-inputs
|
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -12220,7 +12220,9 @@ in
|
|||||||
};
|
};
|
||||||
mesa = mesa_noglu;
|
mesa = mesa_noglu;
|
||||||
|
|
||||||
mesa_glu = callPackage ../development/libraries/mesa-glu { };
|
mesa_glu = callPackage ../development/libraries/mesa-glu {
|
||||||
|
inherit (darwin.apple_sdk.frameworks) ApplicationServices;
|
||||||
|
};
|
||||||
|
|
||||||
# NOTE: 2018-07-12: legacy alias:
|
# NOTE: 2018-07-12: legacy alias:
|
||||||
# gcsecurity bussiness is done: https://www.theregister.co.uk/2018/02/08/bruce_perens_grsecurity_anti_slapp/
|
# gcsecurity bussiness is done: https://www.theregister.co.uk/2018/02/08/bruce_perens_grsecurity_anti_slapp/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user