Use cmake macros

OBS-URL: https://build.opensuse.org/package/show/games/emptyepsilon?expand=0&rev=9
This commit is contained in:
Dominik Heidler 2023-12-11 00:14:45 +00:00 committed by Git OBS Bridge
parent 51a601466c
commit d6b8fb5b90

View File

@ -41,7 +41,8 @@ BuildRequires: sfml2-devel
BuildRequires: xorg-x11 BuildRequires: xorg-x11
%if 0%{?sle_version:1} %if 0%{?sle_version:1}
# if sle_version is defined, this is not tumbleweed # if sle_version is defined, this is not tumbleweed
BuildRequires: gcc10 gcc10-c++ BuildRequires: gcc10
BuildRequires: gcc10-c++
%endif %endif
%description %description
@ -56,30 +57,38 @@ pushd SeriousProton-EE-%{version}
%patch0 -p1 %patch0 -p1
popd popd
%patch1 -p1 %patch1 -p1
# extract bundled dependencies # extract bundled dependencies
mkdir -p SeriousProton/externals/basis mkdir -p SeriousProton/externals/basis
bsdtar xvf $RPM_SOURCE_DIR/basis_universal.zip --strip-components=1 -C SeriousProton/externals/basis bsdtar xvf $RPM_SOURCE_DIR/basis_universal.zip --strip-components=1 -C SeriousProton/externals/basis
mkdir -p externals/meshoptimizer mkdir -p externals/meshoptimizer
bsdtar xvf $RPM_SOURCE_DIR/meshoptimizer.zip --strip-components=1 -C externals/meshoptimizer bsdtar xvf $RPM_SOURCE_DIR/meshoptimizer.zip --strip-components=1 -C externals/meshoptimizer
# symlink dependencies into build dir
mkdir -p build
pushd build
ln -s ../SeriousProton-EE-%{version}
ln -s ../SeriousProton
ln -s ../externals
popd
%build %build
%if 0%{?sle_version:1} %if 0%{?sle_version:1}
# if sle_version is defined, this is not tumbleweed # if sle_version is defined, this is not tumbleweed
export CC=gcc-10 export CC=gcc-10
export CXX=g++-10 export CXX=g++-10
%endif %endif
cmake -DSERIOUS_PROTON_DIR="SeriousProton-EE-%{version}" \ %cmake -DSERIOUS_PROTON_DIR="SeriousProton-EE-%{version}" \
-DCMAKE_INSTALL_PREFIX=%{_prefix} \ -DCMAKE_INSTALL_PREFIX=%{_prefix} \
-DCMAKE_BUILD_TYPE=Release \ -DCMAKE_BUILD_TYPE=Release \
-DCPACK_PACKAGE_VERSION_MAJOR="$(echo %{version} | cut -d. -f1)" \ -DCPACK_PACKAGE_VERSION_MAJOR="$(echo %{version} | cut -d. -f1)" \
-DCPACK_PACKAGE_VERSION_MINOR="$(echo %{version} | cut -d. -f2)" \ -DCPACK_PACKAGE_VERSION_MINOR="$(echo %{version} | cut -d. -f2)" \
-DCPACK_PACKAGE_VERSION_PATCH="$(echo %{version} | cut -d. -f3)" \ -DCPACK_PACKAGE_VERSION_PATCH="$(echo %{version} | cut -d. -f3)" \
-DOpenGL_GL_PREFERENCE=GLVND \ -DOpenGL_GL_PREFERENCE=GLVND
. %cmake_build -j 8
%make_build -j 8
%install %install
%make_install %cmake_install
%files %files
%doc README.md %doc README.md