Merge pull request #333707 from flokli/glew-egl

glew: enable both EGL and GLX
This commit is contained in:
Someone 2024-08-11 12:50:05 +00:00 committed by GitHub
commit 78d1fae7d2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 26 additions and 23 deletions

View File

@ -13,7 +13,7 @@
, fftw , fftw
, flann , flann
, gettext , gettext
, glew-egl , glew
, ilmbase , ilmbase
, lcms2 , lcms2
, lensfun , lensfun
@ -51,7 +51,7 @@ stdenv.mkDerivation rec {
fftw fftw
flann flann
gettext gettext
glew-egl glew
ilmbase ilmbase
lcms2 lcms2
lensfun lensfun

View File

@ -1,6 +1,14 @@
{ lib, stdenv, fetchurl, fetchpatch, cmake, libGLU, libXmu, libXi, libXext { lib
, stdenv
, fetchurl
, fetchpatch
, cmake
, libGLU
, libXmu
, libXi
, libXext
, OpenGL , OpenGL
, enableEGL ? false , enableEGL ? (!stdenv.isDarwin)
, testers , testers
}: }:
@ -19,7 +27,14 @@ stdenv.mkDerivation (finalAttrs: {
# https://github.com/nigels-com/glew/pull/342 # https://github.com/nigels-com/glew/pull/342
(fetchpatch { (fetchpatch {
url = "https://github.com/nigels-com/glew/commit/966e53fa153175864e151ec8a8e11f688c3e752d.diff"; url = "https://github.com/nigels-com/glew/commit/966e53fa153175864e151ec8a8e11f688c3e752d.diff";
sha256 = "sha256-xsSwdAbdWZA4KVoQhaLlkYvO711i3QlHGtv6v1Omkhw="; hash = "sha256-xsSwdAbdWZA4KVoQhaLlkYvO711i3QlHGtv6v1Omkhw=";
})
# don't make EGL support disable GLX, use the same patch as ArchLinux
# https://gitlab.archlinux.org/archlinux/packaging/packages/glew/-/blob/ca08ff5d4cd3548a593eb1118d0a84b0c3670349/egl+glx.patch
(fetchpatch {
url = "https://gitlab.archlinux.org/archlinux/packaging/packages/glew/-/raw/ca08ff5d4cd3548a593eb1118d0a84b0c3670349/egl+glx.patch?inline=false";
hash = "sha256-IG3FPhhaor1kshEH3Kr8yzIHqBhczRwCqH7ZeDwlzGE=";
}) })
]; ];

View File

@ -18,7 +18,6 @@
, alsa-lib , alsa-lib
, alsa-plugins , alsa-plugins
, glew , glew
, glew-egl
# for soloud # for soloud
, libpulseaudio ? null , libpulseaudio ? null
@ -45,8 +44,6 @@ let
jdk = jdk17; jdk = jdk17;
selectedGlew = if enableWayland then glew-egl else glew;
Mindustry = fetchFromGitHub { Mindustry = fetchFromGitHub {
owner = "Anuken"; owner = "Anuken";
repo = "Mindustry"; repo = "Mindustry";
@ -146,8 +143,8 @@ stdenv.mkDerivation {
buildInputs = lib.optionals enableClient [ buildInputs = lib.optionals enableClient [
SDL2 SDL2
selectedGlew
alsa-lib alsa-lib
glew
]; ];
nativeBuildInputs = [ nativeBuildInputs = [
pkg-config pkg-config
@ -171,7 +168,7 @@ stdenv.mkDerivation {
pushd ../Arc pushd ../Arc
gradle jnigenBuild gradle jnigenBuild
gradle jnigenJarNativesDesktop gradle jnigenJarNativesDesktop
glewlib=${lib.getLib selectedGlew}/lib/libGLEW.so glewlib=${lib.getLib glew}/lib/libGLEW.so
sdllib=${lib.getLib SDL2}/lib/libSDL2.so sdllib=${lib.getLib SDL2}/lib/libSDL2.so
patchelf backends/backend-sdl/libs/linux64/libsdl-arc*.so \ patchelf backends/backend-sdl/libs/linux64/libsdl-arc*.so \
--add-needed $glewlib \ --add-needed $glewlib \
@ -203,7 +200,7 @@ stdenv.mkDerivation {
# This can cause issues. # This can cause issues.
# See https://github.com/NixOS/nixpkgs/issues/109798. # See https://github.com/NixOS/nixpkgs/issues/109798.
echo "# Retained runtime dependencies: " >> $out/bin/mindustry echo "# Retained runtime dependencies: " >> $out/bin/mindustry
for dep in ${SDL2.out} ${alsa-lib.out} ${selectedGlew.out}; do for dep in ${SDL2.out} ${alsa-lib.out} ${glew.out}; do
echo "# $dep" >> $out/bin/mindustry echo "# $dep" >> $out/bin/mindustry
done done

View File

@ -6,7 +6,7 @@
, wayland-protocols , wayland-protocols
, wayland-scanner , wayland-scanner
, egl-wayland , egl-wayland
, glew-egl , glew
, mpv , mpv
, pkg-config , pkg-config
, fetchFromGitHub , fetchFromGitHub
@ -39,7 +39,7 @@ stdenv.mkDerivation rec {
wayland wayland
wayland-protocols wayland-protocols
egl-wayland egl-wayland
glew-egl glew
mpv mpv
]; ];

View File

@ -518,6 +518,7 @@ mapAliases ({
}; # Added 2021-01-14 }; # Added 2021-01-14
gitter = throw "gitter has been removed since the client has been abandoned by upstream with the backend migration to Matrix"; # Added 2023-09-18 gitter = throw "gitter has been removed since the client has been abandoned by upstream with the backend migration to Matrix"; # Added 2023-09-18
glew-egl = lib.warn "'glew-egl' is now provided by 'glew' directly" glew; # Added 2024-08-11
glide = throw "'glide' has been removed as it is unmaintained, please use Go modules instead"; # Added 2023-12-26 glide = throw "'glide' has been removed as it is unmaintained, please use Go modules instead"; # Added 2023-12-26
glfw-wayland = glfw; # Added 2024-04-19 glfw-wayland = glfw; # Added 2024-04-19
gmailieer = lieer; # Added 2020-04-19 gmailieer = lieer; # Added 2020-04-19

View File

@ -2684,7 +2684,6 @@ with pkgs;
ppsspp-sdl = let ppsspp-sdl = let
argset = { argset = {
ffmpeg = ffmpeg_4; ffmpeg = ffmpeg_4;
glew = glew.override { enableEGL = argset.forceWayland; };
enableQt = false; enableQt = false;
enableVulkan = true; enableVulkan = true;
forceWayland = false; forceWayland = false;
@ -2695,7 +2694,6 @@ with pkgs;
ppsspp-sdl-wayland = let ppsspp-sdl-wayland = let
argset = { argset = {
ffmpeg = ffmpeg_4; ffmpeg = ffmpeg_4;
glew = glew.override { enableEGL = argset.forceWayland; };
enableQt = false; enableQt = false;
enableVulkan = false; # https://github.com/hrydgard/ppsspp/issues/13845 enableVulkan = false; # https://github.com/hrydgard/ppsspp/issues/13845
forceWayland = true; forceWayland = true;
@ -2706,7 +2704,6 @@ with pkgs;
ppsspp-qt = let ppsspp-qt = let
argset = { argset = {
ffmpeg = ffmpeg_4; ffmpeg = ffmpeg_4;
glew = glew.override { enableEGL = argset.forceWayland; };
enableQt = true; enableQt = true;
enableVulkan = false; # https://github.com/hrydgard/ppsspp/issues/11628 enableVulkan = false; # https://github.com/hrydgard/ppsspp/issues/11628
forceWayland = false; forceWayland = false;
@ -20388,11 +20385,6 @@ with pkgs;
glew110 = callPackage ../development/libraries/glew/1.10.nix { glew110 = callPackage ../development/libraries/glew/1.10.nix {
inherit (darwin.apple_sdk.frameworks) AGL OpenGL; inherit (darwin.apple_sdk.frameworks) AGL OpenGL;
}; };
glew-egl = callPackage ../development/libraries/glew {
inherit (darwin.apple_sdk.frameworks) OpenGL;
enableEGL = true;
};
glfw = glfw3; glfw = glfw3;
glfw-wayland-minecraft = callPackage ../development/libraries/glfw/3.x-wayland-minecraft.nix {}; glfw-wayland-minecraft = callPackage ../development/libraries/glfw/3.x-wayland-minecraft.nix {};
glfw2 = callPackage ../development/libraries/glfw/2.x.nix { }; glfw2 = callPackage ../development/libraries/glfw/2.x.nix { };
@ -33626,8 +33618,6 @@ with pkgs;
bambu-studio = callPackage ../applications/misc/bambu-studio { bambu-studio = callPackage ../applications/misc/bambu-studio {
inherit (gst_all_1) gstreamer gst-plugins-base gst-plugins-bad gst-plugins-good; inherit (gst_all_1) gstreamer gst-plugins-base gst-plugins-bad gst-plugins-good;
glew = glew-egl;
wxGTK31 = wxGTK31.override { wxGTK31 = wxGTK31.override {
withCurl = true; withCurl = true;
withPrivateFonts = true; withPrivateFonts = true;