From cbdf59e7b19eb9cc2c730e755dee1ea619a742fd Mon Sep 17 00:00:00 2001 From: Enno Boland Date: Tue, 15 Mar 2016 15:21:22 +0100 Subject: [PATCH] cdogs-sdl: update to 0.6.0. --- srcpkgs/cdogs-sdl/patches/fix-build.patch | 11 +++++ .../patches/fix-segfault-on-start.patch | 25 +++++++++++ .../cdogs-sdl/patches/use-system-yajl.patch | 22 ++++++++++ srcpkgs/cdogs-sdl/template | 43 +++++-------------- 4 files changed, 68 insertions(+), 33 deletions(-) create mode 100644 srcpkgs/cdogs-sdl/patches/fix-build.patch create mode 100644 srcpkgs/cdogs-sdl/patches/fix-segfault-on-start.patch create mode 100644 srcpkgs/cdogs-sdl/patches/use-system-yajl.patch diff --git a/srcpkgs/cdogs-sdl/patches/fix-build.patch b/srcpkgs/cdogs-sdl/patches/fix-build.patch new file mode 100644 index 00000000000..07dcbaded39 --- /dev/null +++ b/srcpkgs/cdogs-sdl/patches/fix-build.patch @@ -0,0 +1,11 @@ +--- CMakeLists.txt.orig 2016-03-13 20:55:53.906485652 +0100 ++++ CMakeLists.txt 2016-03-13 20:56:22.320483526 +0100 +@@ -177,7 +177,7 @@ if(APPLE) + USE_SOURCE_PERMISSIONS) + else() + install( +- PROGRAMS src/cdogs-sdl${EXE_EXTENSION} src/cdogs-sdl-editor${EXE_EXTENSION} ++ PROGRAMS build/src/cdogs-sdl${EXE_EXTENSION} build/src/cdogs-sdl-editor${EXE_EXTENSION} + DESTINATION ${INSTALL_PREFIX}/bin) + endif() + diff --git a/srcpkgs/cdogs-sdl/patches/fix-segfault-on-start.patch b/srcpkgs/cdogs-sdl/patches/fix-segfault-on-start.patch new file mode 100644 index 00000000000..89669457bb1 --- /dev/null +++ b/srcpkgs/cdogs-sdl/patches/fix-segfault-on-start.patch @@ -0,0 +1,25 @@ +--- src/cdogs/utils.c.orig 2016-03-06 09:56:53.000000000 +0100 ++++ src/cdogs/utils.c 2016-03-15 13:52:14.404949301 +0100 +@@ -308,12 +308,17 @@ void GetDataFilePath(char *buf, const ch + { + char relbuf[CDOGS_PATH_MAX]; + char cwd[CDOGS_PATH_MAX]; +- if (CDogsGetCWD(cwd) == NULL) +- { +- fprintf(stderr, "Error getting CWD; %s\n", strerror(errno)); +- strcpy(cwd, ""); ++ if(CDOGS_DATA_DIR[0] == '/') { ++ sprintf(relbuf, "%s%s", CDOGS_DATA_DIR, path); ++ } ++ else { ++ if (CDogsGetCWD(cwd) == NULL) ++ { ++ fprintf(stderr, "Error getting CWD; %s\n", strerror(errno)); ++ strcpy(cwd, ""); ++ } ++ sprintf(relbuf, "%s/%s%s", cwd, CDOGS_DATA_DIR, path); + } +- sprintf(relbuf, "%s/%s%s", cwd, CDOGS_DATA_DIR, path); + RealPath(relbuf, buf); + } + diff --git a/srcpkgs/cdogs-sdl/patches/use-system-yajl.patch b/srcpkgs/cdogs-sdl/patches/use-system-yajl.patch new file mode 100644 index 00000000000..93dde5f204e --- /dev/null +++ b/srcpkgs/cdogs-sdl/patches/use-system-yajl.patch @@ -0,0 +1,22 @@ +--- src/cdogs/yajl_utils.h.orig 2016-03-15 08:17:24.508938965 +0100 ++++ src/cdogs/yajl_utils.h 2016-03-15 08:18:21.256934718 +0100 +@@ -28,7 +28,7 @@ + #include + + #include "vector.h" +-#include "yajl/api/yajl_tree.h" ++#include + + + yajl_val YAJLReadFile(const char *filename); +--- src/cdogs/CMakeLists.txt 2016-03-15 08:35:00.996859895 +0100 ++++ src/cdogs/CMakeLists.txt.orig 2016-03-15 08:34:55.824860282 +0100 +@@ -210,7 +210,7 @@ add_library(cdogs STATIC + target_link_libraries(cdogs + json + SDL_joystickbuttonnames +- yajl_s ++ yajl + ${SDL2_LIBRARY} + ${SDL2_IMAGE_LIBRARIES} + ${SDL2_MIXER_LIBRARIES} diff --git a/srcpkgs/cdogs-sdl/template b/srcpkgs/cdogs-sdl/template index 32ca84bea10..25f7fabf11d 100644 --- a/srcpkgs/cdogs-sdl/template +++ b/srcpkgs/cdogs-sdl/template @@ -1,49 +1,26 @@ # Template file for 'cdogs' pkgname=cdogs-sdl -version=0.5.8 -revision=2 +version=0.6.0 +revision=1 build_style=cmake _hqxrev=2a8a05854ad2147425d0b55a3c40e81c368c97fd _tinydirrev=53aab97d6a11d70d669ce9c36d0d90ec6937c33d hostmakedepends="cmake" -makedepends="physfs-devel SDL-devel SDL_mixer-devel SDL_image-devel SDL_net-devel" +makedepends="physfs-devel SDL2-devel SDL2_mixer-devel SDL2_image-devel SDL2_net-devel yajl-devel" short_desc="A classic overhead run-and-gun game" maintainer="Enno Boland " homepage="http://cxong.github.io/cdogs-sdl/" license="GPL2" -distfiles="https://github.com/cxong/cdogs-sdl/archive/$version.tar.gz - https://github.com/cxong/tinydir/archive/$_tinydirrev.tar.gz - https://github.com/cxong/hqx/archive/$_hqxrev.tar.gz" -checksum="08e1f47b43c229ce0d20a32c9e287abc9f47cdc658ac38726a414083256401d3 - 2d71972034d570ac506dee5909cfac72c1870734228a61b266e354f2d9acf277 - fca25adefd14af3584dcf0e48c69647aa46a924ddbfcb75ec6053528f1bd80bc" +distfiles="https://github.com/cxong/cdogs-sdl/archive/$version.tar.gz" +checksum="ac7c6ca6275bd4de16078d417b77fcc3bec0ea5555b342d8a3901da397736fa6" lib32disabled=yes - -post_extract() { - rmdir ${XBPS_BUILDDIR}/$pkgname-$version/src/cdogs/hqx - ln -sf ${XBPS_BUILDDIR}/hqx-$_hqxrev \ - ${XBPS_BUILDDIR}/$pkgname-$version/src/cdogs/hqx - - rmdir ${XBPS_BUILDDIR}/$pkgname-$version/src/tinydir - ln -sf ${XBPS_BUILDDIR}/tinydir-$_tinydirrev \ - ${XBPS_BUILDDIR}/$pkgname-$version/src/tinydir -} +configure_args="-DCDOGS_DATA_DIR=/usr/share/cdogs/" pre_configure() { - # disable tests - sed -i "/add_subdirectory(tests)/d" src/CMakeLists.txt - - # fix the broken build system and build - sed -i \ - -e "s/add_definitions(-Winline -Werror)/add_definitions(-Winline)/" \ - -e "/PROGRAMS /s#src/#build/\0#g" \ - -e "/FILES /s#build/linux/#build/\0#g" \ - -e "s#\(SET(CMAKE_INSTALL_PREFIX\) .*#\1 /usr/share/cdogs)#" \ - -e "s#\(set(CDOGS_DATA_DIR\) .*#\1 /usr/share/cdogs/)#" \ - CMakeLists.txt - - # workaround bug - ln -rs build build/build + # Install data to /usr/share/cdogs/ instead of cwd. + sed -i '/^set(INSTALL_PREFIX/ s#.*#set(INSTALL_PREFIX "/usr/share/cdogs/")#' CMakeLists.txt + # Do not build shipped yajl. + sed -i '/add_subdirectory(yajl)/d' src/cdogs/CMakeLists.txt } post_install() {