From 0e8e54a24bcbc0b8c80e2294f4122ebcf419af13 Mon Sep 17 00:00:00 2001 From: Krul Ceter Date: Wed, 11 Jan 2023 07:37:38 +0300 Subject: [PATCH] devilutionX: update to 1.4.1. * External (3rd party) dependencies normally are fetched with git, which is undesirable for packaging; hence they are fetched manually with xbps-src. "-DFETCHCONTENT_FULLY_DISCONNECTED=ON" prevents cmake's FetchContent module from attempting to download or update any external dependencies. * BINARY_RELEASE option is gone. * CharisSILB is absent with TTF_FONT_PATH from the release tarball. * mpqtool is used for building devilutionx.mpq since smpq is not packaged. --- srcpkgs/devilutionX/patches/smpq.patch | 19 ++++++++++++ srcpkgs/devilutionX/template | 42 +++++++++++++++++++++++--- 2 files changed, 56 insertions(+), 5 deletions(-) create mode 100644 srcpkgs/devilutionX/patches/smpq.patch diff --git a/srcpkgs/devilutionX/patches/smpq.patch b/srcpkgs/devilutionX/patches/smpq.patch new file mode 100644 index 000000000000..f14ddf7ea474 --- /dev/null +++ b/srcpkgs/devilutionX/patches/smpq.patch @@ -0,0 +1,19 @@ +If smpq is not present (in our case not packaged for void at all), +cmake --install will not install anything to DESTDIR. + +DEVILUTIONX_MPQ is used during the installation to DESTDIR, but +undefined if smpq is not found (see CMake/Assets.cmake), +thus it is also set in this patch. + +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -405,7 +405,8 @@ + target_compile_definitions(libdevilutionx PRIVATE __UWP__=1) + endif() + +-if(CPACK AND (APPLE OR BUILD_ASSETS_MPQ OR SRC_DIST)) ++if(CPACK) ++ set(DEVILUTIONX_MPQ "${CMAKE_CURRENT_BINARY_DIR}/devilutionx.mpq") + if(WIN32) + if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC") + set(SDL2_WIN32_DLLS_DIR "${CMAKE_BINARY_DIR}") diff --git a/srcpkgs/devilutionX/template b/srcpkgs/devilutionX/template index 829ff248926b..5e5ee93d4baf 100644 --- a/srcpkgs/devilutionX/template +++ b/srcpkgs/devilutionX/template @@ -1,16 +1,48 @@ # Template file for 'devilutionX' pkgname=devilutionX -version=1.2.1 +version=1.4.1 revision=1 +# git revisions can be found in the 3rdParty directory of the +# source code. +_audiolib_gitrev=1a69135313c79817b38a3a99826d4ac28d627fdf +_smackerdec_gitrev=2997ee0e41e91bb723003bc09234be553b190e38 +_libmpq_gitrev=0f10bd1600f406b13932bf5351ba713361262184 +_simpleini_gitrev=56499b5af5d2195c6acfc58c4630b70e0c9c4c21 build_style=cmake -configure_args="-DVERSION_NUM=$version -DBINARY_RELEASE=ON -DTTF_FONT_PATH=\"/usr/share/fonts/truetype/CharisSILB.ttf\"" -makedepends="SDL2-devel SDL2_ttf-devel SDL2_mixer-devel libsodium-devel" +configure_args="-DVERSION_NUM=$version -DFETCHCONTENT_FULLY_DISCONNECTED=ON + -DDISABLE_ZERO_TIER=ON" +hostmakedepends="pkg-config mpqtool gettext" +makedepends="SDL2-devel SDL2_image-devel libpng-devel bzip2-devel + libsodium-devel gtest-devel fmt-devel zlib-devel asio" short_desc="Diablo I engine for modern operating systems" maintainer="MarcoAPC " license="Unlicense" homepage="https://github.com/diasurgical/devilutionX" -distfiles="https://github.com/diasurgical/devilutionX/archive/${version}.tar.gz" -checksum=002dcbd4d4a5bdf8db1a3ec01139e5bfbed46d6a1caa32b17c9f2df161ad3521 +changelog="https://raw.githubusercontent.com/diasurgical/devilutionX/master/docs/CHANGELOG.md" +distfiles="https://github.com/diasurgical/devilutionX/archive/${version}.tar.gz + https://github.com/realnc/SDL_audiolib/archive/${_audiolib_gitrev}.tar.gz + https://github.com/diasurgical/libsmackerdec/archive/${_smackerdec_gitrev}.tar.gz + https://github.com/diasurgical/libmpq/archive/${_libmpq_gitrev}.tar.gz + https://github.com/brofield/simpleini/archive/${_simpleini_gitrev}.tar.gz" +checksum="54b9fd496eba5b82d7e64891ab4de808f539c60b3b94bfa49639e0d9580fb7b8 + 8e013245bf8e676d4e2c61661d7cee6cb9de74f97a475c9e6b35a25d5e7a7715 + 40c0dc21943de22e153d56a7992c621a42a0c56c7cd833f8b84f90e48da753ea + ee173f5edb20f162482658cbc9d4bb84b640f651041d686c0ad7b2af12baf2a1 + dbdb50a33d3edf791fc2622309d9c3d701a2fb7e7e2b403d3fa504e04f0ade0e" + +post_extract() { + mkdir -p build/_deps + mv ${pkgname}-${version}/* . + mv SDL_audiolib-${_audiolib_gitrev} build/_deps/sdl_audiolib-src + mv libsmackerdec-${_smackerdec_gitrev} build/_deps/libsmackerdec-src + mv libmpq-${_libmpq_gitrev} build/_deps/libmpq-src + mv simpleini-${_simpleini_gitrev} build/_deps/simpleini-src +} + +post_build() { + # use mpqtool instead of unpackaged smpq + mpqtool new build/assets build/devilutionx.mpq +} post_install() { vlicense LICENSE