From 3da89bebf6774f7b1483d6f0ec58fc3ebfb302be Mon Sep 17 00:00:00 2001 From: ologantr Date: Thu, 30 Jun 2022 13:39:06 +0200 Subject: [PATCH] enigma: update to 1.30. Also: - take maintainership - move to SDL2.0 - use system libenet instead of the bundled one --- .../enigma/patches/fix-ifstream_test.patch | 11 -------- srcpkgs/enigma/patches/musl-redirect.patch | 22 +++++----------- .../enigma/patches/remove-SDL_ttf-check.patch | 25 ------------------ srcpkgs/enigma/template | 26 ++++++++----------- 4 files changed, 17 insertions(+), 67 deletions(-) delete mode 100644 srcpkgs/enigma/patches/fix-ifstream_test.patch delete mode 100644 srcpkgs/enigma/patches/remove-SDL_ttf-check.patch diff --git a/srcpkgs/enigma/patches/fix-ifstream_test.patch b/srcpkgs/enigma/patches/fix-ifstream_test.patch deleted file mode 100644 index 3a7723f990e310..00000000000000 --- a/srcpkgs/enigma/patches/fix-ifstream_test.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/src/lev/Proxy.cc 2014-12-19 22:24:37.000000000 +0100 -+++ b/src/lev/Proxy.cc 2017-09-01 16:55:50.009413332 +0200 -@@ -933,7 +933,7 @@ - } else if (haveLocalCopy) { - // plain file - basic_ifstream ifs(absExtPath.c_str(), ios::binary | ios::in); -- if (ifs != NULL) -+ if (ifs) - Readfile(ifs, extCode); - else - haveLocalCopy = false; diff --git a/srcpkgs/enigma/patches/musl-redirect.patch b/srcpkgs/enigma/patches/musl-redirect.patch index ec145fcf99f35b..9e288073f09839 100644 --- a/srcpkgs/enigma/patches/musl-redirect.patch +++ b/srcpkgs/enigma/patches/musl-redirect.patch @@ -1,31 +1,21 @@ We can't assign to *stdout and *stderr with musl libc because both file pointers are const. ---- a/src/main.cc 2014-12-19 22:24:38.000000000 +0100 -+++ b/src/main.cc 2015-11-19 13:53:23.419299858 +0100 -@@ -301,21 +301,25 @@ - if (ap.redirect) { - FILE *newfp; +--- a/src/main.cc 2022-06-30 12:30:19.904327808 +0200 ++++ b/src/main.cc 2022-06-30 12:30:57.351968860 +0200 +@@ -315,2 +315,3 @@ void Application::init(int argc, char ** newfp = std::freopen((userStdPath + "/Output.log").c_str(), "w", stdout); +#if defined(__GLIBC__) if ( newfp == NULL ) { // This happens on NT - newfp = fopen((userStdPath + "/Output.log").c_str(), "w"); - if (newfp) { // in case stdout is a macro - *stdout = *newfp; - } +@@ -321,2 +322,3 @@ void Application::init(int argc, char ** } +#endif setvbuf(stdout, NULL, _IOLBF, BUFSIZ); // Line buffered - +@@ -324,2 +326,3 @@ void Application::init(int argc, char ** newfp = std::freopen((userStdPath + "/Error.log").c_str(), "w", stderr); +#if defined(__GLIBC__) if ( newfp == NULL ) { // This happens on NT - newfp = fopen((userStdPath + "/Error.log").c_str(), "w"); - if (newfp) { // in case stderr is a macro - *stderr = *newfp; - } +@@ -330,2 +333,3 @@ void Application::init(int argc, char ** } +#endif setbuf(stderr, NULL); // No buffering - } - diff --git a/srcpkgs/enigma/patches/remove-SDL_ttf-check.patch b/srcpkgs/enigma/patches/remove-SDL_ttf-check.patch deleted file mode 100644 index 3d1454d61fe286..00000000000000 --- a/srcpkgs/enigma/patches/remove-SDL_ttf-check.patch +++ /dev/null @@ -1,25 +0,0 @@ -Do not check for SDL_ttf version because it fails when -cross compiling. - ---- a/configure.ac 2014-12-19 22:26:06.000000000 +0100 -+++ b/configure.ac 2015-11-19 12:08:46.996789539 +0100 -@@ -176,19 +176,6 @@ - dnl ---------------------------------------- - dnl Check for SDL_ttf library - dnl --------------------------------------- --if test "$MINGW32" = no; then -- AC_MSG_CHECKING([for SDL_ttf >=2.0.6]) -- AC_RUN_IFELSE([AC_LANG_SOURCE( -- [[#include -- int main(int argc, char *argv[]) { -- if (TTF_MAJOR_VERSION < 2) -- return 1; -- else if (TTF_MAJOR_VERSION == 2 && TTF_MINOR_VERSION == 0 && TTF_PATCHLEVEL < 6) -- return 1; -- return 0;}]])], -- [AC_MSG_RESULT([found])], -- [AC_MSG_ERROR([SDL_ttf >= 2.0.6 not found.])]) --fi - AC_CHECK_LIB(SDL_ttf, main,,[AC_MSG_ERROR([SDL_ttf is required to compile Enigma])]) - - SDL_LIBS="$SDL_LIBS -lSDL_ttf" diff --git a/srcpkgs/enigma/template b/srcpkgs/enigma/template index d04fa511249263..7c173c56a363b7 100644 --- a/srcpkgs/enigma/template +++ b/srcpkgs/enigma/template @@ -1,20 +1,21 @@ # Template file for 'enigma' pkgname=enigma -version=1.21 -revision=4 +version=1.30 +revision=1 +wrksrc="Enigma-${version}" build_style=gnu-configure -hostmakedepends="ImageMagick automake libtool gettext-devel SDL-devel pkg-config" -makedepends="libcurl-devel libxerces-c-devel SDL_mixer-devel SDL_image-devel SDL_ttf-devel" +configure_args="--with-system-enet" +hostmakedepends="ImageMagick automake pkg-config texi2html SDL2-devel" +makedepends="libcurl-devel libxerces-c-devel SDL2_mixer-devel + SDL2_image-devel SDL2_ttf-devel libenet-devel" short_desc="Puzzle game inspired by Oxyd on the Atari ST" -maintainer="Orphaned " +maintainer="ologantr " license="GPL-2.0-or-later" -homepage="http://www.nongnu.org/enigma/" -distfiles="${SOURCEFORGE_SITE}/enigma-game/Release%20${version}/${pkgname}-${version}.tar.gz" -checksum=d872cf067d8eb560d3bb1cb17245814bc56ac3953ae1f12e2229c8eb6f82ce01 +homepage="https://www.nongnu.org/enigma/" +distfiles="https://github.com/Enigma-Game/Enigma/archive/refs/tags/${version}.tar.gz" +checksum=99af962feec553dd7e794827494a6a23428a69f83d6915fcaa25f00531357cac replaces="enigma-data>=0" -CXXFLAGS="-I${XBPS_CROSS_BASE}/usr/include/SDL" - pre_configure() { local dir for dir in . lib-src/enet lib-src/zipios++; do @@ -24,11 +25,6 @@ pre_configure() { autoreconf -if } -post_install() { - # remove the libenet headers and static library - rm -r ${DESTDIR}/usr/include ${DESTDIR}/usr/lib/libenet.a -} - enigma-doc_package() { short_desc+=" - documentation" pkg_install() {