Loading pkgs/by-name/pl/plib/darwin-ssgloadflt-uint.patch 0 → 100644 +14 −0 Original line number Diff line number Diff line diff --git a/src/ssg/ssgLoadFLT.cxx b/src/ssg/ssgLoadFLT.cxx --- a/src/ssg/ssgLoadFLT.cxx +++ b/src/ssg/ssgLoadFLT.cxx @@ -112,6 +112,10 @@ # include <sys/stat.h> # include <sys/mman.h> #endif +#if defined(__APPLE__) +typedef unsigned int uint; +typedef unsigned short ushort; +#endif #ifdef UL_MSVC # include <io.h> #endif pkgs/by-name/pl/plib/package.nix +8 −2 Original line number Diff line number Diff line Loading @@ -37,9 +37,15 @@ stdenv.mkDerivation rec { url = "https://sources.debian.org/data/main/p/plib/1.8.5-13/debian/patches/08_CVE-2021-38714.patch"; sha256 = "sha256-3f1wZn0QqK/hPWCg1KEzbB95IGoxBjLZoCOFlW98t5w="; }) ./darwin-ssgloadflt-uint.patch ]; propagatedBuildInputs = [ configureFlags = lib.optionals stdenv.hostPlatform.isDarwin [ "--disable-sl" "--disable-pw" ]; propagatedBuildInputs = lib.optionals stdenv.hostPlatform.isLinux [ libGLU libGL libglut Loading Loading @@ -70,6 +76,6 @@ stdenv.mkDerivation rec { license = lib.licenses.lgpl2Plus; homepage = "https://plib.sourceforge.net/"; platforms = lib.platforms.linux; platforms = lib.platforms.unix; }; } pkgs/by-name/sp/speed-dreams/darwin-gl-compat.patch 0 → 100644 +16 −0 Original line number Diff line number Diff line diff --git a/src/libs/tgfclient/guiscreen.cpp b/src/libs/tgfclient/guiscreen.cpp --- a/src/libs/tgfclient/guiscreen.cpp +++ b/src/libs/tgfclient/guiscreen.cpp @@ -426,9 +426,9 @@ bool GfScrInitSDL2(int nWinWidth, int nWinHeight, int nFullScreen) #ifdef __APPLE__ // Version d'OpenGL - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE); + SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); + SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); + SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_COMPATIBILITY); #else // Version d'OpenGL SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); pkgs/by-name/sp/speed-dreams/package.nix +66 −55 Original line number Diff line number Diff line Loading @@ -29,37 +29,22 @@ cmake, pkg-config, libvorbis, runtimeShell, curl, fetchgit, cjson, minizip, rhash, copyDesktopItems, makeWrapper, }: stdenv.mkDerivation rec { version = "2.4.2"; pname = "speed-dreams"; src = fetchgit { url = "https://forge.a-lec.org/speed-dreams/speed-dreams-code.git"; rev = "v${version}"; sha256 = "sha256-ZY/0tf0wFbepEUNqpaBA4qgkWDij/joqPtbiF/48oN4="; fetchSubmodules = true; }; NIX_CFLAGS_COMPILE = "-I${src}/src/libs/tgf -I${src}/src/libs/tgfdata -I${src}/src/interfaces -I${src}/src/libs/math -I${src}/src/libs/portability"; postInstall = '' mkdir -p "$out/bin" # Wrapper for main executable cat > "$out/bin/speed-dreams" <<EOF #!${runtimeShell} export LD_LIBRARY_PATH="$out/lib/games/speed-dreams-2/lib:$out/lib:${ lib.makeLibraryPath [ let glLibs = lib.optionals stdenv.isLinux [ libGL libGLU libglut ]; runtimeLibs = glLibs ++ [ libX11 plib openal Loading @@ -86,22 +71,45 @@ stdenv.mkDerivation rec { minizip rhash stdenv.cc.cc.lib ] }" if [ -e "${libGL}/lib/libGL.so.1" ]; then export LD_PRELOAD="${libGL}/lib/libGL.so.1''${LD_PRELOAD:+:$LD_PRELOAD}" fi export SDL_VIDEODRIVER="x11" exec "$out/games/speed-dreams-2" "$@" EOF chmod a+x "$out/bin/speed-dreams" ]; runtimeLibPath = lib.makeLibraryPath runtimeLibs; libPathVar = if stdenv.isDarwin then "DYLD_LIBRARY_PATH" else "LD_LIBRARY_PATH"; in stdenv.mkDerivation rec { version = "2.4.2"; pname = "speed-dreams"; src = fetchgit { url = "https://forge.a-lec.org/speed-dreams/speed-dreams-code.git"; rev = "v${version}"; sha256 = "sha256-ZY/0tf0wFbepEUNqpaBA4qgkWDij/joqPtbiF/48oN4="; fetchSubmodules = true; }; NIX_CFLAGS_COMPILE = "-I${src}/src/libs/tgf -I${src}/src/libs/tgfdata -I${src}/src/interfaces -I${src}/src/libs/math -I${src}/src/libs/portability"; patches = [ ./darwin-gl-compat.patch ]; postInstall = '' substituteInPlace "$out/share/applications/speed-dreams.desktop" \ --replace-fail "Exec=$out/games/speed-dreams-2" "Exec=$out/bin/speed-dreams" ${lib.optionalString stdenv.isLinux '' # Symlink for desktop icon mkdir -p $out/share/pixmaps/ ln -s "$out/share/games/speed-dreams-2/data/icons/icon.png" "$out/share/pixmaps/speed-dreams-2.png" substituteInPlace "$out/share/applications/speed-dreams.desktop" \ --replace-fail "Exec=$out/games/speed-dreams-2" "Exec=$out/bin/speed-dreams" \ --replace-fail "Icon=/build/speed-dreams-code/speed-dreams-data/data/data/icons/icon.png" "Icon=$out/share/pixmaps/speed-dreams-2.png" ''} ''; postFixup = '' mkdir -p "$out/bin" makeWrapperArgs=( --prefix ${libPathVar} : "$out/lib/games/speed-dreams-2/lib:$out/lib:${runtimeLibPath}" ) ${lib.optionalString stdenv.isLinux "makeWrapperArgs+=(--set SDL_VIDEODRIVER x11)"} makeWrapper "$out/games/speed-dreams-2" "$out/bin/speed-dreams" "''${makeWrapperArgs[@]}" ''; # RPATH of binary /nix/store/.../lib64/games/speed-dreams-2/drivers/shadow_sc/shadow_sc.so contains a forbidden reference to /build/ Loading @@ -113,13 +121,11 @@ stdenv.mkDerivation rec { pkg-config cmake copyDesktopItems makeWrapper ]; buildInputs = [ libpng12 libGLU libGL libglut libX11 plib openal Loading @@ -146,6 +152,11 @@ stdenv.mkDerivation rec { cjson minizip rhash ] ++ lib.optionals stdenv.isLinux [ libGL libGLU libglut ]; meta = { Loading @@ -156,7 +167,7 @@ stdenv.mkDerivation rec { raskin mio ]; platforms = lib.platforms.linux; platforms = lib.platforms.linux ++ lib.platforms.darwin; mainProgram = "speed-dreams"; }; } Loading
pkgs/by-name/pl/plib/darwin-ssgloadflt-uint.patch 0 → 100644 +14 −0 Original line number Diff line number Diff line diff --git a/src/ssg/ssgLoadFLT.cxx b/src/ssg/ssgLoadFLT.cxx --- a/src/ssg/ssgLoadFLT.cxx +++ b/src/ssg/ssgLoadFLT.cxx @@ -112,6 +112,10 @@ # include <sys/stat.h> # include <sys/mman.h> #endif +#if defined(__APPLE__) +typedef unsigned int uint; +typedef unsigned short ushort; +#endif #ifdef UL_MSVC # include <io.h> #endif
pkgs/by-name/pl/plib/package.nix +8 −2 Original line number Diff line number Diff line Loading @@ -37,9 +37,15 @@ stdenv.mkDerivation rec { url = "https://sources.debian.org/data/main/p/plib/1.8.5-13/debian/patches/08_CVE-2021-38714.patch"; sha256 = "sha256-3f1wZn0QqK/hPWCg1KEzbB95IGoxBjLZoCOFlW98t5w="; }) ./darwin-ssgloadflt-uint.patch ]; propagatedBuildInputs = [ configureFlags = lib.optionals stdenv.hostPlatform.isDarwin [ "--disable-sl" "--disable-pw" ]; propagatedBuildInputs = lib.optionals stdenv.hostPlatform.isLinux [ libGLU libGL libglut Loading Loading @@ -70,6 +76,6 @@ stdenv.mkDerivation rec { license = lib.licenses.lgpl2Plus; homepage = "https://plib.sourceforge.net/"; platforms = lib.platforms.linux; platforms = lib.platforms.unix; }; }
pkgs/by-name/sp/speed-dreams/darwin-gl-compat.patch 0 → 100644 +16 −0 Original line number Diff line number Diff line diff --git a/src/libs/tgfclient/guiscreen.cpp b/src/libs/tgfclient/guiscreen.cpp --- a/src/libs/tgfclient/guiscreen.cpp +++ b/src/libs/tgfclient/guiscreen.cpp @@ -426,9 +426,9 @@ bool GfScrInitSDL2(int nWinWidth, int nWinHeight, int nFullScreen) #ifdef __APPLE__ // Version d'OpenGL - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 2); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE); + SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); + SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); + SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_COMPATIBILITY); #else // Version d'OpenGL SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2);
pkgs/by-name/sp/speed-dreams/package.nix +66 −55 Original line number Diff line number Diff line Loading @@ -29,37 +29,22 @@ cmake, pkg-config, libvorbis, runtimeShell, curl, fetchgit, cjson, minizip, rhash, copyDesktopItems, makeWrapper, }: stdenv.mkDerivation rec { version = "2.4.2"; pname = "speed-dreams"; src = fetchgit { url = "https://forge.a-lec.org/speed-dreams/speed-dreams-code.git"; rev = "v${version}"; sha256 = "sha256-ZY/0tf0wFbepEUNqpaBA4qgkWDij/joqPtbiF/48oN4="; fetchSubmodules = true; }; NIX_CFLAGS_COMPILE = "-I${src}/src/libs/tgf -I${src}/src/libs/tgfdata -I${src}/src/interfaces -I${src}/src/libs/math -I${src}/src/libs/portability"; postInstall = '' mkdir -p "$out/bin" # Wrapper for main executable cat > "$out/bin/speed-dreams" <<EOF #!${runtimeShell} export LD_LIBRARY_PATH="$out/lib/games/speed-dreams-2/lib:$out/lib:${ lib.makeLibraryPath [ let glLibs = lib.optionals stdenv.isLinux [ libGL libGLU libglut ]; runtimeLibs = glLibs ++ [ libX11 plib openal Loading @@ -86,22 +71,45 @@ stdenv.mkDerivation rec { minizip rhash stdenv.cc.cc.lib ] }" if [ -e "${libGL}/lib/libGL.so.1" ]; then export LD_PRELOAD="${libGL}/lib/libGL.so.1''${LD_PRELOAD:+:$LD_PRELOAD}" fi export SDL_VIDEODRIVER="x11" exec "$out/games/speed-dreams-2" "$@" EOF chmod a+x "$out/bin/speed-dreams" ]; runtimeLibPath = lib.makeLibraryPath runtimeLibs; libPathVar = if stdenv.isDarwin then "DYLD_LIBRARY_PATH" else "LD_LIBRARY_PATH"; in stdenv.mkDerivation rec { version = "2.4.2"; pname = "speed-dreams"; src = fetchgit { url = "https://forge.a-lec.org/speed-dreams/speed-dreams-code.git"; rev = "v${version}"; sha256 = "sha256-ZY/0tf0wFbepEUNqpaBA4qgkWDij/joqPtbiF/48oN4="; fetchSubmodules = true; }; NIX_CFLAGS_COMPILE = "-I${src}/src/libs/tgf -I${src}/src/libs/tgfdata -I${src}/src/interfaces -I${src}/src/libs/math -I${src}/src/libs/portability"; patches = [ ./darwin-gl-compat.patch ]; postInstall = '' substituteInPlace "$out/share/applications/speed-dreams.desktop" \ --replace-fail "Exec=$out/games/speed-dreams-2" "Exec=$out/bin/speed-dreams" ${lib.optionalString stdenv.isLinux '' # Symlink for desktop icon mkdir -p $out/share/pixmaps/ ln -s "$out/share/games/speed-dreams-2/data/icons/icon.png" "$out/share/pixmaps/speed-dreams-2.png" substituteInPlace "$out/share/applications/speed-dreams.desktop" \ --replace-fail "Exec=$out/games/speed-dreams-2" "Exec=$out/bin/speed-dreams" \ --replace-fail "Icon=/build/speed-dreams-code/speed-dreams-data/data/data/icons/icon.png" "Icon=$out/share/pixmaps/speed-dreams-2.png" ''} ''; postFixup = '' mkdir -p "$out/bin" makeWrapperArgs=( --prefix ${libPathVar} : "$out/lib/games/speed-dreams-2/lib:$out/lib:${runtimeLibPath}" ) ${lib.optionalString stdenv.isLinux "makeWrapperArgs+=(--set SDL_VIDEODRIVER x11)"} makeWrapper "$out/games/speed-dreams-2" "$out/bin/speed-dreams" "''${makeWrapperArgs[@]}" ''; # RPATH of binary /nix/store/.../lib64/games/speed-dreams-2/drivers/shadow_sc/shadow_sc.so contains a forbidden reference to /build/ Loading @@ -113,13 +121,11 @@ stdenv.mkDerivation rec { pkg-config cmake copyDesktopItems makeWrapper ]; buildInputs = [ libpng12 libGLU libGL libglut libX11 plib openal Loading @@ -146,6 +152,11 @@ stdenv.mkDerivation rec { cjson minizip rhash ] ++ lib.optionals stdenv.isLinux [ libGL libGLU libglut ]; meta = { Loading @@ -156,7 +167,7 @@ stdenv.mkDerivation rec { raskin mio ]; platforms = lib.platforms.linux; platforms = lib.platforms.linux ++ lib.platforms.darwin; mainProgram = "speed-dreams"; }; }