Commit f62db777 authored by Jana Lemke's avatar Jana Lemke
Browse files

EmptyEpsilon 2021.06.23 -> 2023.06.17

Changelog: https://github.com/daid/EmptyEpsilon/releases/tag/EE-2023.06.17

Notable changes:
- updated SeriousProton and EmptyEpsilon to 2023.06.17
- dropped patches that (I think?) are no longer needed
- added basis_universal, SDL2 as build input to both SeriousProton and EmptyEpsilon
- added meshoptimizer as build input to EmptyEpsilon
- switched to Ninja since the newer build instructions in the wiki use it (probably optional)

Closes NixOS/nixpkgs#253183
parent 3ed98aeb
Loading
Loading
Loading
Loading
+0 −34
Original line number Diff line number Diff line
From 9718cdb4bdaf7203d07789b2dc5eec4060538889 Mon Sep 17 00:00:00 2001
From: Maximilian Bosch <maximilian@mbosch.me>
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::glm
         "$<$<BOOL:${WIN32}>:wsock32>"
         # LTO flag must be on the linker's list as well.
         "$<$<AND:$<BOOL:${CMAKE_COMPILER_IS_GNUCC}>,$<OR:$<CONFIG:RelWithDebInfo>,$<CONFIG:Release>>>:-flto>"
-- 
2.31.1
+29 −41
Original line number Diff line number Diff line
{ lib, stdenv, fetchFromGitHub, cmake, sfml, libX11, glew, python3, fetchpatch, applyPatches, glm}:
{ lib, stdenv, fetchFromGitHub, cmake, sfml, libX11, glew, python3, fetchpatch, applyPatches, glm, meshoptimizer, SDL2, ninja}:

let

  major = "2021";
  major = "2023";
  minor = "06";
  patch.seriousproton = "23";
  patch.emptyepsilon = "23";
  patch.seriousproton = "17";
  patch.emptyepsilon = "17";

  version.seriousproton = "${major}.${minor}.${patch.seriousproton}";
  version.emptyepsilon = "${major}.${minor}.${patch.emptyepsilon}";
  version.basis-universal = "v1_15_update2";

  basis-universal = fetchFromGitHub {
    owner = "BinomialLLC";
    repo = "basis_universal";
    rev = version.basis-universal;
    sha256 = "sha256-2snzq/SnhWHIgSbUUgh24B6tka7EfkGO+nwKEObRkU4=";
  };

  serious-proton = stdenv.mkDerivation {
    pname = "serious-proton";
    version = version.seriousproton;

    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
      ];
      sha256 = "sha256-5ifYb5dX8ihQmJB1RHyzMsZJeXZ+m27JmA+W+XA/XwI=";
    };

    nativeBuildInputs = [ cmake ];
    buildInputs = [ sfml libX11 glm ];
    buildInputs = [ sfml libX11 glm SDL2 ];

    cmakeFlags = [
      "-DFETCHCONTENT_SOURCE_DIR_BASIS=${basis-universal}"
    ];

    meta = with lib; {
      description = "C++ game engine coded on top of SFML used for EmptyEpsilon";
@@ -61,23 +56,11 @@ stdenv.mkDerivation {
    owner = "daid";
    repo = "EmptyEpsilon";
    rev = "EE-${version.emptyepsilon}";
    sha256 = "sha256-dc/Ic1/DULTQO6y9xSop2HxFvUh4kN57oSF/HBmbmF4=";
    sha256 = "sha256-zuXbCBlv6URndbB0aA+3bli0cSeUBf3LT/7/jcPITnc=";
  };

  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 glm ];
  buildInputs = [ serious-proton sfml glew libX11 python3 glm SDL2 ninja ];

  cmakeFlags = [
    "-DSERIOUS_PROTON_DIR=${serious-proton.src}"
@@ -85,6 +68,11 @@ stdenv.mkDerivation {
    "-DCPACK_PACKAGE_VERSION_MAJOR=${major}"
    "-DCPACK_PACKAGE_VERSION_MINOR=${minor}"
    "-DCPACK_PACKAGE_VERSION_PATCH=${patch.emptyepsilon}"
    "-DFETCHCONTENT_SOURCE_DIR_BASIS=${basis-universal}"
    "-DFETCHCONTENT_SOURCE_DIR_MESHOPTIMIZER=${meshoptimizer.src}"
    "-DCMAKE_AR=${stdenv.cc.cc}/bin/gcc-ar"
    "-DCMAKE_RANLIB=${stdenv.cc.cc}/bin/gcc-ranlib"
    "-G Ninja"
  ];

  meta = with lib; {