commit 13eba15bec6178c87f303f0f1b099f8d312367af
Author: Michal Schorm <mschorm(a)redhat.com>
Date: Sat Jun 26 17:24:28 2021 +0200
Rebase to version 2021.06.23
- Unbundle GLM
- Unbundle json11
.gitignore | 19 +++----------------
EmptyEpsilon.spec | 34 ++++++++++++++++++++++++++++++----
Findjson11.cmake | 39 +++++++++++++++++++++++++++++++++++++++
glm_debundle.patch | 23 +++++++++++++++++++++++
json.patch | 14 ++++++++++++++
json_SeriousProton.patch | 14 ++++++++++++++
sources | 4 ++--
7 files changed, 125 insertions(+), 22 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 52bdde6..a7a5bbf 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,16 +1,3 @@
-/EmptyEpsilon-EE-2017.05.06.zip
-/SeriousProton-EE-2017.05.06.zip
-/EmptyEpsilon-EE-2017.11.03.zip
-/SeriousProton-EE-2017.11.03.zip
-/EmptyEpsilon-EE-2018.02.15.zip
-/SeriousProton-EE-2018.02.15.zip
-/SeriousProton-EE-2019.05.21.zip
-/EmptyEpsilon-EE-2019.05.21.zip
-/EmptyEpsilon-EE-2020.08.25.zip
-/SeriousProton-EE-2020.08.25.zip
-/EmptyEpsilon-EE-2020.11.23.zip
-/SeriousProton-EE-2020.11.23.zip
-/EmptyEpsilon-EE-2021.03.16.zip
-/SeriousProton-EE-2021.03.16.zip
-/EmptyEpsilon-EE-2021.03.31.zip
-/SeriousProton-EE-2021.03.31.zip
+/*.src.rpm
+/*.zip
+/*/
diff --git a/EmptyEpsilon.spec b/EmptyEpsilon.spec
index d6b0868..6658c82 100644
--- a/EmptyEpsilon.spec
+++ b/EmptyEpsilon.spec
@@ -1,6 +1,6 @@
%global version_major 2021
-%global version_minor 03
-%global version_patch 31
+%global version_minor 06
+%global version_patch 23
%undefine __cmake_in_source_build
@@ -9,17 +9,34 @@ Summary: Spaceship bridge simulator game
Version: %{version_major}.%{version_minor}.%{version_patch}
Release: 1%{?dist}
License: GPLv2
-Recommends: xclip
+
BuildRequires: cmake3
BuildRequires: gcc-c++
-BuildRequires: SFML-devel >= 2.3.2
+BuildRequires: SFML-devel >= 2.5.1
BuildRequires: mesa-libGLU-devel >= 9.0.0
BuildRequires: desktop-file-utils
+# The following version of "glm-devel" is not currently available for Fedora 33
and older
+BuildRequires: glm-devel >= 0.9.9.8
+BuildRequires: json11-devel
+
ExcludeArch: ppc64 ppc64le
+
URL:
http://emptyepsilon.org/
Source0:
https://github.com/daid/EmptyEpsilon/archive/EE-%{version}.zip#/EmptyEpsi...
Source1:
https://github.com/daid/SeriousProton/archive/EE-%{version}.zip#/SeriousP...
+# The "FindJson11.cmake" file has been taken from the following project:
+#
https://github.com/MASKOR/mapit/blob/master/cmake/Findjson11.cmake
+# which is licensed under LGPL-3.0 License
+Source2: Findjson11.cmake
+
+Source3: json_SeriousProton.patch
+
+Patch1: glm_debundle.patch
+Patch2: json.patch
+
+Recommends: xclip
+
%description
EmptyEpsilon places you in the roles of a spaceship's bridge officers, like
those seen in Star Trek. While you can play EmptyEpsilon alone or with friends,
@@ -35,6 +52,12 @@ Note: Network play require port 35666 UDP and TCP allowed in firewall.
%prep
%autosetup -b 1 -n EmptyEpsilon-EE-%{version}
+# Patch SeriousProton, instead of the EmptyEpsilon
+patch ../SeriousProton-EE-%{version}/CMakeLists.txt %{SOURCE3}
+
+# Copy CMake module for finding "json11" to the project
+cp %{SOURCE2} cmake/
+
%build
%cmake3 \
-DSERIOUS_PROTON_DIR=%{_builddir}/SeriousProton-EE-%{version}/ \
@@ -75,6 +98,9 @@ desktop-file-validate
%{buildroot}%{_datadir}/applications/%{name}.desktop
%{_datadir}/applications/%{name}.desktop
%changelog
+* Sat Jun 26 2021 Michal Schorm <mschorm(a)redhat.com> - 2021.06.23-1
+- Rebase to version 2021.06.23
+
* Sat Apr 10 2021 Michal Schorm <mschorm(a)redhat.com> - 2021.03.31-1
- Rebase to version 2021.03.31
diff --git a/Findjson11.cmake b/Findjson11.cmake
new file mode 100644
index 0000000..633a942
--- /dev/null
+++ b/Findjson11.cmake
@@ -0,0 +1,39 @@
+# Locate json11
+#
+# This module defines
+# JSON11_FOUND, if false, do not try to link to json11
+# JSON11_LIBRARY, where to find json11
+# JSON11_INCLUDE_DIR, where to find json11.hpp
+#
+# If json11 is not installed in a standard path, you can use the JSON11_DIR CMake
variable
+# to tell CMake where json11 is.
+
+find_path(JSON11_INCLUDE_DIR json11.hpp
+ PATHS
+ /usr/local/include/
+ /usr/include/
+ /sw/json11/ # Fink
+ /opt/local/json11/ # DarwinPorts
+ /opt/csw/json11/ # Blastwave
+ /opt/json11/
+ /include/)
+
+if(NOT WIN32)
+ SET(CMAKE_FIND_LIBRARY_SUFFIXES ".so" ".a")
+endif(NOT WIN32)
+
+find_library(JSON11_LIBRARY
+ NAMES json11
+ PATH_SUFFIXES lib64 lib
+ PATHS /usr/local
+ /usr
+ /sw
+ /opt/local
+ /opt/csw
+ /opt
+ /lib)
+
+# handle the QUIETLY and REQUIRED arguments and set JSON11_FOUND to TRUE if all listed
variables are TRUE
+include(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(JSON11 DEFAULT_MSG JSON11_INCLUDE_DIR JSON11_LIBRARY)
+mark_as_advanced(JSON11_INCLUDE_DIR JSON11_LIBRARY)
diff --git a/glm_debundle.patch b/glm_debundle.patch
new file mode 100644
index 0000000..d354ee2
--- /dev/null
+++ b/glm_debundle.patch
@@ -0,0 +1,23 @@
+The GLM library is already packed for Fedora; let's use it
+
+--- EmptyEpsilon-EE-2021.06.23/CMakeLists.txt 2021-06-23 14:12:02.000000000 +0200
++++ EmptyEpsilon-EE-2021.06.23/CMakeLists.txt_patched 2021-06-26 04:54:53.932415114
+0200
+@@ -106,17 +106,7 @@ if(WITH_DISCORD)
+ endif()
+
+ # GLM
+-set(GLM_BASE_PATH "${EXTERNALS_DIR}")
+-
+-if(NOT EXISTS "${GLM_BASE_PATH}/glm/CMakeLists.txt")
+- set(GLM_ZIP "${DOWNLOADS_DIR}/glm.zip")
+- file(DOWNLOAD
"https://github.com/g-truc/glm/releases/download/0.9.9.8/glm-0.9.9.8.zip"
"${GLM_ZIP}" TIMEOUT 60 TLS_VERIFY ON)
+-
+- file(MAKE_DIRECTORY "${GLM_BASE_PATH}/glm")
+- execute_process(COMMAND ${CMAKE_COMMAND} -E tar -xf "${GLM_ZIP}"
WORKING_DIRECTORY "${GLM_BASE_PATH}")
+-endif()
+-
+-add_subdirectory("${GLM_BASE_PATH}/glm" "${PROJECT_BINARY_DIR}/glm"
EXCLUDE_FROM_ALL)
++find_package( glm REQUIRED )
+
+ set(SOURCES
+ src/main.cpp
diff --git a/json.patch b/json.patch
new file mode 100644
index 0000000..d4d9e08
--- /dev/null
+++ b/json.patch
@@ -0,0 +1,14 @@
+Unbundle JSON11
+Offer the system version of the "JSON11" intead of the bundled one
+
+--- EmptyEpsilon-EE-2021.06.23/CMakeLists.txt 2021-06-26 14:34:28.208302135 +0200
++++ EmptyEpsilon-EE-2021.06.23/CMakeLists.txt_patched 2021-06-26 17:43:14.645447225
+0200
+@@ -59,6 +59,8 @@ endif()
+ # SeriousProton
+ # Use SP provided json library.
+ set(SERIOUSPROTON_WITH_JSON ON CACHE BOOL "" FORCE)
++find_package(json11 REQUIRED)
++
+ add_subdirectory("${SERIOUS_PROTON_DIR}"
"${PROJECT_BINARY_DIR}/SeriousProton" EXCLUDE_FROM_ALL)
+
+ message(STATUS "Crash Logger is: ${ENABLE_CRASH_LOGGER}")
diff --git a/json_SeriousProton.patch b/json_SeriousProton.patch
new file mode 100644
index 0000000..742c1a4
--- /dev/null
+++ b/json_SeriousProton.patch
@@ -0,0 +1,14 @@
+Unbundle JSON11
+Prevent the project to use the bundled sources; use system version instead
+
+--- SeriousProton-EE-2021.06.23/CMakeLists.txt 2021-06-09 08:01:37.000000000 +0200
++++ SeriousProton-EE-2021.06.23/CMakeLists.txt_patched 2021-06-26 17:40:59.168219386
+0200
+@@ -87,7 +87,7 @@ add_subdirectory(src/GL)
+ add_subdirectory(src/libopus)
+
+ if(SERIOUSPROTON_WITH_JSON)
+- add_subdirectory(src/json11)
++# add_subdirectory(src/json11)
+ endif()
+
+ #---------------------------------File lists-----------------------------------
diff --git a/sources b/sources
index 6c508fd..c543d6a 100644
--- a/sources
+++ b/sources
@@ -1,2 +1,2 @@
-SHA512 (EmptyEpsilon-EE-2021.03.31.zip) =
0f8898737cf10abe89defd87ba1f814a934894eaef45673f0b58e79ac4fdccb0e5dd59870eaab01d1c0c4dad076f70a7cb1f086cd391971f0947169d02f5e507
-SHA512 (SeriousProton-EE-2021.03.31.zip) =
74560728738cfa162d825dbc33f0b4ab06acfb6f4184594a76074392d397998a9c1d4ebcd70275a3a3f7f797c8d2fcaabc709246127d0ac58543656b62ee5db4
+SHA512 (EmptyEpsilon-EE-2021.06.23.zip) =
40efed8eb7433323e1d554f66e5ec1a75c4dab23e42664a46e4758dfcb518f51f1d28e1ff76117b319f963bfc2d810d06bbd25d4c0d1f652adf4990332cd43ce
+SHA512 (SeriousProton-EE-2021.06.23.zip) =
63a7fa7022f58fb1b87de509bd4ab122cd17ce3360d1ff48d50c0a7ad1fa55f1a18c512c3e0910a56ff814540983d62edf44b1a45b4a0054e0a01ce81aa4bea2