diff --git a/pkgs/games/empty-epsilon/0001-bundle-system-glm-in-seriousproton.patch b/pkgs/games/empty-epsilon/0001-bundle-system-glm-in-seriousproton.patch new file mode 100644 index 000000000000..d59d548a4a46 --- /dev/null +++ b/pkgs/games/empty-epsilon/0001-bundle-system-glm-in-seriousproton.patch @@ -0,0 +1,34 @@ +From 9718cdb4bdaf7203d07789b2dc5eec4060538889 Mon Sep 17 00:00:00 2001 +From: Maximilian Bosch +Date: Fri, 9 Jul 2021 11:37:22 +0200 +Subject: [PATCH] bundle system-glm in seriousproton + +--- + CMakeLists.txt | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index cbd68ca..730df82 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -81,6 +81,9 @@ if(NOT ${SFML_FOUND}) + ) + endif() + ++ ++find_package(glm) ++ + add_subdirectory(src/Box2D) + add_subdirectory(src/lua) + add_subdirectory(src/GL) +@@ -205,7 +208,7 @@ target_compile_options(seriousproton_deps + + target_link_libraries(seriousproton_deps + INTERFACE +- box2d lua glew ${SFML_LIBRARIES} ++ box2d lua glew ${SFML_LIBRARIES} glm + "$<$:wsock32>" + # LTO flag must be on the linker's list as well. + "$<$,$,$>>:-flto>" +-- +2.31.1 diff --git a/pkgs/games/empty-epsilon/default.nix b/pkgs/games/empty-epsilon/default.nix index d444c50d976d..bee806fcdd5b 100644 --- a/pkgs/games/empty-epsilon/default.nix +++ b/pkgs/games/empty-epsilon/default.nix @@ -1,11 +1,11 @@ -{ lib, stdenv, fetchFromGitHub, cmake, sfml, libX11, glew, python3 }: +{ lib, stdenv, fetchFromGitHub, cmake, sfml, libX11, glew, python3, fetchpatch, applyPatches, glm}: let major = "2021"; - minor = "03"; - patch.seriousproton = "30"; - patch.emptyepsilon = "31"; + minor = "06"; + patch.seriousproton = "23"; + patch.emptyepsilon = "23"; version.seriousproton = "${major}.${minor}.${patch.seriousproton}"; version.emptyepsilon = "${major}.${minor}.${patch.emptyepsilon}"; @@ -14,15 +14,32 @@ let pname = "serious-proton"; version = version.seriousproton; - src = fetchFromGitHub { - owner = "daid"; - repo = "SeriousProton"; - rev = "EE-${version.seriousproton}"; - sha256 = "sha256-wxb/CxJ/HKsVngeahjygZFPMMxitkHdVD0EQ3svxgIU="; + src = applyPatches { + src = fetchFromGitHub { + owner = "daid"; + repo = "SeriousProton"; + rev = "EE-${version.seriousproton}"; + sha256 = "sha256-02cHHWKoe99257qLgxtMjeXnhi0UYajh4v87B57felM="; + }; + + patches = [ + # Various CMake fixes for `json11`. Can be removed on the next release. + (fetchpatch { + url = "https://github.com/daid/SeriousProton/commit/adbba45fd9ae5e020e43e5d7f9326f1355391209.patch"; + sha256 = "sha256-gMTpIGPGCREmZ/ZxvEc7RVsVUxWXbu2BPUCE3A62sCI="; + }) + + # Simplified variant of + # * https://github.com/daid/SeriousProton/commit/0d1ac45b738195db5e2785531db713328f547e60 + # * https://github.com/daid/SeriousProton/commit/32509f2db91a58b9528aeb1bb505e9426b52b825 + # + # To fix configure errors when building EmptyEpsilon, can be removed on the next release. + ./0001-bundle-system-glm-in-seriousproton.patch + ]; }; nativeBuildInputs = [ cmake ]; - buildInputs = [ sfml libX11 ]; + buildInputs = [ sfml libX11 glm ]; meta = with lib; { description = "C++ game engine coded on top of SFML used for EmptyEpsilon"; @@ -44,11 +61,23 @@ stdenv.mkDerivation { owner = "daid"; repo = "EmptyEpsilon"; rev = "EE-${version.emptyepsilon}"; - sha256 = "sha256-x0XJPMU0prubTb4ti/W/dH5P9abNwbjqkeUhKQpct9o="; + sha256 = "sha256-dc/Ic1/DULTQO6y9xSop2HxFvUh4kN57oSF/HBmbmF4="; }; + patches = [ + # Various CMake fixes that can be removed when upgrading to the next release. + (fetchpatch { + url = "https://github.com/daid/EmptyEpsilon/commit/ee0cd42bfe5fd20b8339e8e02eb7f69766168d57.patch"; + sha256 = "sha256-8dXtl/izfzqbwHtjuugjH34vYP+d4AobqZhxL2GXTzw="; + }) + (fetchpatch { + url = "https://github.com/daid/EmptyEpsilon/commit/69d93e6acdae3259755924f9d35e7e5ae949d377.patch"; + sha256 = "sha256-30AGo4mi73GrW9GNS3vF3mTOS7J5/41LvjOzNjeFhOg="; + }) + ]; + nativeBuildInputs = [ cmake ]; - buildInputs = [ serious-proton sfml glew libX11 python3 ]; + buildInputs = [ serious-proton sfml glew libX11 python3 glm ]; cmakeFlags = [ "-DSERIOUS_PROTON_DIR=${serious-proton.src}"