mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-22 03:30:05 +02:00
cdogs-sdl: update to 1.2.0 (#6573)
* cdogs-sdl: update to 1.2.0 * cyberdogs_sdl: purge recipe for newer cdogs_sdl
This commit is contained in:
14
games-arcade/cdogs_sdl/additional-files/cdogs.rdef.in
Normal file
14
games-arcade/cdogs_sdl/additional-files/cdogs.rdef.in
Normal file
@@ -0,0 +1,14 @@
|
||||
|
||||
resource app_flags B_EXCLUSIVE_LAUNCH | B_ARGV_ONLY;
|
||||
|
||||
resource app_version {
|
||||
major = @MAJOR@,
|
||||
middle = @MIDDLE@,
|
||||
minor = @MINOR@,
|
||||
variety = B_APPV_FINAL,
|
||||
internal = 0,
|
||||
short_info = "C-Dogs SDL Arcade Game",
|
||||
long_info = "A classic overhead run-and-gun game"
|
||||
};
|
||||
|
||||
resource app_signature "application/x-vnd.C-Dogs-SDL";
|
||||
87
games-arcade/cdogs_sdl/cdogs_sdl-1.2.0.recipe
Normal file
87
games-arcade/cdogs_sdl/cdogs_sdl-1.2.0.recipe
Normal file
@@ -0,0 +1,87 @@
|
||||
SUMMARY="A classic overhead run-and-gun game"
|
||||
DESCRIPTION="C-Dogs SDL is a classic overhead run-and-gun game, supporting up to 4 players in co-op \
|
||||
and deathmatch modes. Customize your player, choose from many weapons, and blast, slide and slash \
|
||||
your way through over 100 user-created campaigns. Have fun!"
|
||||
HOMEPAGE="https://github.com/cxong/cdogs-sdl"
|
||||
COPYRIGHT="1995 Ronny Wester
|
||||
2003 Jeremy Chin
|
||||
2003-2010 Lucas Martin-King
|
||||
2013-2022 Cong Xu"
|
||||
LICENSE="GNU GPL v2"
|
||||
REVISION="1"
|
||||
SOURCE_URI="https://github.com/cxong/cdogs-sdl/archive/$portVersion.tar.gz"
|
||||
SOURCE_DIR="cdogs-sdl-$portVersion"
|
||||
CHECKSUM_SHA256="20ed6d261dcc1a6c5f197ffa49aeb2b9c30d2ece514745b144c6ebaeada9bcaf"
|
||||
PATCHES="cdogs_sdl-$portVersion.patchset"
|
||||
ADDITIONAL_FILES="cdogs.rdef.in"
|
||||
|
||||
ARCHITECTURES="all !x86_gcc2"
|
||||
SECONDARY_ARCHITECTURES="x86"
|
||||
|
||||
PROVIDES="
|
||||
cdogs_sdl$secondaryArchSuffix = $portVersion
|
||||
app:C_Dogs_SDL
|
||||
"
|
||||
REQUIRES="
|
||||
haiku$secondaryArchSuffix
|
||||
lib:libSDL2_2.0$secondaryArchSuffix
|
||||
lib:libSDL2_image_2.0$secondaryArchSuffix
|
||||
lib:libSDL2_mixer_2.0$secondaryArchSuffix
|
||||
"
|
||||
BUILD_REQUIRES="
|
||||
haiku${secondaryArchSuffix}_devel
|
||||
devel:libSDL2_2.0$secondaryArchSuffix
|
||||
devel:libSDL2_image_2.0$secondaryArchSuffix
|
||||
devel:libSDL2_mixer_2.0$secondaryArchSuffix
|
||||
"
|
||||
BUILD_PREREQUIRES="
|
||||
cmd:ar
|
||||
cmd:cmake
|
||||
cmd:gcc$secondaryArchSuffix
|
||||
cmd:make
|
||||
"
|
||||
|
||||
defineDebugInfoPackage cdogs_sdl$secondaryArchSuffix $appsDir/C-Dogs\ SDL
|
||||
|
||||
BUILD()
|
||||
{
|
||||
# CDOGS_DATA_DIR needs the trailing slash
|
||||
# editor needs GTK, perhaps in a subpackage later
|
||||
cmake \
|
||||
-DCMAKE_BUILD_TYPE="RelWithDebInfo" \
|
||||
-DCMAKE_INSTALL_PREFIX=$prefix \
|
||||
-DCDOGS_BIN_DIR=$appsDir \
|
||||
-DCDOGS_DATA_DIR=$dataDir/cdogs-sdl/ \
|
||||
-DCDOGS_DOC_DIR=$documentationDir/cdogs-sdl \
|
||||
-DBUILD_EDITOR=OFF \
|
||||
.
|
||||
|
||||
make $jobArgs
|
||||
}
|
||||
|
||||
INSTALL()
|
||||
{
|
||||
make install
|
||||
|
||||
# cleanup
|
||||
# TODO move some of this into the cmake logic or patch the code as needed
|
||||
mv $dataDir/cdogs-sdl/README.md $documentationDir/cdogs-sdl/README.md
|
||||
mv $appsDir/cdogs-sdl $appsDir/C-Dogs\ SDL
|
||||
mkdir -p $dataDir/cdogs-sdl/doc
|
||||
ln -s $documentationDir/cdogs-sdl/CREDITS $dataDir/cdogs-sdl/doc/CREDITS
|
||||
|
||||
# add our version and other application resources
|
||||
local MAJOR="`echo "$portVersion" | cut -d. -f1`"
|
||||
local MIDDLE="`echo "$portVersion" | cut -d. -f2`"
|
||||
local MINOR="`echo "$portVersion" | cut -d. -f3`"
|
||||
|
||||
sed \
|
||||
-e "s|@MAJOR@|$MAJOR|" \
|
||||
-e "s|@MIDDLE@|$MIDDLE|" \
|
||||
-e "s|@MINOR@|$MINOR|" \
|
||||
$portDir/additional-files/cdogs.rdef.in > cdogs.rdef
|
||||
|
||||
addResourcesToBinaries cdogs.rdef $appsDir/C-Dogs\ SDL
|
||||
|
||||
addAppDeskbarSymlink $appsDir/C-Dogs\ SDL C-Dogs\ SDL
|
||||
}
|
||||
221
games-arcade/cdogs_sdl/patches/cdogs_sdl-1.2.0.patchset
Normal file
221
games-arcade/cdogs_sdl/patches/cdogs_sdl-1.2.0.patchset
Normal file
@@ -0,0 +1,221 @@
|
||||
From b51fa4f5758ace4d2c758bbbbdfa8207d8e25dea Mon Sep 17 00:00:00 2001
|
||||
From: Chris Roberts <cpr420@gmail.com>
|
||||
Date: Tue, 25 Jan 2022 16:04:18 -0700
|
||||
Subject: Fix SDL2 include paths on Haiku
|
||||
|
||||
|
||||
diff --git a/build/cmake/FindSDL2.cmake b/build/cmake/FindSDL2.cmake
|
||||
index 53ef5ef..fb405d0 100644
|
||||
--- a/build/cmake/FindSDL2.cmake
|
||||
+++ b/build/cmake/FindSDL2.cmake
|
||||
@@ -44,7 +44,7 @@
|
||||
find_path(SDL2_INCLUDE_DIRS SDL.h
|
||||
HINTS
|
||||
ENV SDLDIR
|
||||
- PATH_SUFFIXES include/SDL2 include
|
||||
+ PATH_SUFFIXES include/SDL2 include SDL2
|
||||
)
|
||||
|
||||
find_library(SDL2_LIBRARY_TEMP
|
||||
diff --git a/build/cmake/FindSDL2_image.cmake b/build/cmake/FindSDL2_image.cmake
|
||||
index abf6474..fdcda2e 100644
|
||||
--- a/build/cmake/FindSDL2_image.cmake
|
||||
+++ b/build/cmake/FindSDL2_image.cmake
|
||||
@@ -37,7 +37,7 @@ find_path(SDL2_IMAGE_INCLUDE_DIR SDL_image.h
|
||||
HINTS
|
||||
ENV SDLIMAGEDIR
|
||||
ENV SDLDIR
|
||||
- PATH_SUFFIXES include/SDL2 include
|
||||
+ PATH_SUFFIXES include/SDL2 include SDL2
|
||||
)
|
||||
|
||||
if(NOT SDL2_IMAGE_LIBRARY AND SDL2IMAGE_LIBRARY)
|
||||
diff --git a/build/cmake/FindSDL2_mixer.cmake b/build/cmake/FindSDL2_mixer.cmake
|
||||
index 0cb24f0..0d6b468 100644
|
||||
--- a/build/cmake/FindSDL2_mixer.cmake
|
||||
+++ b/build/cmake/FindSDL2_mixer.cmake
|
||||
@@ -37,7 +37,7 @@ find_path(SDL2_MIXER_INCLUDE_DIR SDL_mixer.h
|
||||
HINTS
|
||||
ENV SDLMIXERDIR
|
||||
ENV SDLDIR
|
||||
- PATH_SUFFIXES include/SDL2 include
|
||||
+ PATH_SUFFIXES include/SDL2 include SDL2
|
||||
)
|
||||
|
||||
if(NOT SDL2_MIXER_LIBRARY AND SDL2MIXER_LIBRARY)
|
||||
--
|
||||
2.30.2
|
||||
|
||||
|
||||
From 0cd65ba265c5769aab26ed3aeb6103649478a1b6 Mon Sep 17 00:00:00 2001
|
||||
From: Chris Roberts <cpr420@gmail.com>
|
||||
Date: Tue, 25 Jan 2022 16:05:23 -0700
|
||||
Subject: use FindDirectory() to get the config path on Haiku
|
||||
|
||||
|
||||
diff --git a/src/cdogs/files.c b/src/cdogs/files.c
|
||||
index 71e742d..55aa11a 100644
|
||||
--- a/src/cdogs/files.c
|
||||
+++ b/src/cdogs/files.c
|
||||
@@ -57,6 +57,10 @@
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
+#if defined(__HAIKU__)
|
||||
+#include <FindDirectory.h>
|
||||
+#endif
|
||||
+
|
||||
#include "door.h"
|
||||
#include "log.h"
|
||||
#include "map_new.h"
|
||||
@@ -611,8 +615,13 @@ const char *GetConfigFilePath(const char *name)
|
||||
|
||||
strcpy(cfpath, homedir);
|
||||
|
||||
-#ifndef __EMSCRIPTEN__
|
||||
+#if !defined(__EMSCRIPTEN__) && !defined(__HAIKU__)
|
||||
strcat(cfpath, CDOGS_CFG_DIR);
|
||||
+#elif defined(__HAIKU__)
|
||||
+ if (find_directory(B_USER_SETTINGS_DIRECTORY, -1, false, cfpath, sizeof(cfpath)) != B_OK)
|
||||
+ return NULL;
|
||||
+
|
||||
+ strcat(cfpath, "/cdogs-sdl/");
|
||||
#endif
|
||||
strcat(cfpath, name);
|
||||
|
||||
@@ -629,7 +638,7 @@ static bool doMkdir(const char *path)
|
||||
(void)e;
|
||||
// Mac OS X 10.4 returns EISDIR instead of EEXIST
|
||||
// if a dir already exists...
|
||||
- return errno == EEXIST || errno == EISDIR || errno == EACCES;
|
||||
+ return errno == EEXIST || errno == EISDIR || errno == EACCES || errno == EROFS;
|
||||
}
|
||||
bool mkdir_deep(const char *path)
|
||||
{
|
||||
--
|
||||
2.30.2
|
||||
|
||||
|
||||
From c4bedcdf06ea4cb1f4bb1fe1d7ed555f6f230b3b Mon Sep 17 00:00:00 2001
|
||||
From: Chris Roberts <cpr420@gmail.com>
|
||||
Date: Tue, 25 Jan 2022 16:07:08 -0700
|
||||
Subject: use libnetwork on Haiku
|
||||
|
||||
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index c7ed9b4..5036295 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -128,6 +128,8 @@ else()
|
||||
if(NOT BEOS AND NOT HAIKU)
|
||||
add_definitions(-Winline -Werror)
|
||||
set(EXTRA_LIBRARIES "m")
|
||||
+ elseif(HAIKU)
|
||||
+ set(EXTRA_LIBRARIES "network")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
|
||||
index 564cbf3..1caf8a6 100644
|
||||
--- a/src/CMakeLists.txt
|
||||
+++ b/src/CMakeLists.txt
|
||||
@@ -60,6 +60,8 @@ if(WIN32)
|
||||
set(CDOGS_SDL_EXTRA ../build/windows/cdogs.rc)
|
||||
elseif(APPLE)
|
||||
set(EXTRA_LIBRARIES "${EXTRA_LIBRARIES} -framework Carbon -framework IOKit")
|
||||
+elseif(HAIKU)
|
||||
+ set(EXTRA_LIBRARIES "network")
|
||||
endif()
|
||||
add_executable(cdogs-sdl
|
||||
${CDOGS_SDL_SOURCES} ${CDOGS_SDL_HEADERS} ${CDOGS_SDL_EXTRA})
|
||||
diff --git a/src/cdogs/enet/CMakeLists.txt b/src/cdogs/enet/CMakeLists.txt
|
||||
index ff6b420..9721759 100644
|
||||
--- a/src/cdogs/enet/CMakeLists.txt
|
||||
+++ b/src/cdogs/enet/CMakeLists.txt
|
||||
@@ -3,6 +3,10 @@ cmake_policy(SET CMP0054 NEW)
|
||||
|
||||
project(enet)
|
||||
|
||||
+if(HAIKU)
|
||||
+ set(CMAKE_REQUIRED_LIBRARIES network)
|
||||
+endif()
|
||||
+
|
||||
# The "configure" step.
|
||||
include(CheckFunctionExists)
|
||||
include(CheckStructHasMember)
|
||||
diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt
|
||||
index 60a3195..4f92ea9 100644
|
||||
--- a/src/tests/CMakeLists.txt
|
||||
+++ b/src/tests/CMakeLists.txt
|
||||
@@ -4,6 +4,8 @@ else()
|
||||
if(NOT BEOS AND NOT HAIKU)
|
||||
add_definitions(-Wno-unused-label)
|
||||
set(EXTRA_LIBRARIES "m")
|
||||
+ elseif(HAIKU)
|
||||
+ set(EXTRA_LIBRARIES "network")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
--
|
||||
2.30.2
|
||||
|
||||
|
||||
From 64377f7afd930bb10d75bcbe8ca7af1dffe2328c Mon Sep 17 00:00:00 2001
|
||||
From: Chris Roberts <cpr420@gmail.com>
|
||||
Date: Tue, 25 Jan 2022 17:29:56 -0700
|
||||
Subject: use CDOGS_DATA_DIR as DATA_INSTALL_DIR
|
||||
|
||||
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 5036295..e700afb 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -195,7 +195,7 @@ elseif(APPLE)
|
||||
set(INSTALL_PREFIX "cdogs-sdl")
|
||||
else()
|
||||
set(LIB_EXTENSION ".so")
|
||||
- set(DATA_INSTALL_DIR ".")
|
||||
+ set(DATA_INSTALL_DIR ${CDOGS_DATA_DIR})
|
||||
endif()
|
||||
|
||||
# Since Debian wants games binaries in /usr/games
|
||||
--
|
||||
2.30.2
|
||||
|
||||
|
||||
From 6c98a73e07c1a845ea13422ea0c0185d4bd4f4d6 Mon Sep 17 00:00:00 2001
|
||||
From: Chris Roberts <cpr420@gmail.com>
|
||||
Date: Tue, 25 Jan 2022 18:18:28 -0700
|
||||
Subject: Don't use a wrapper script on Haiku
|
||||
|
||||
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index e700afb..b1254eb 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -293,12 +293,6 @@ elseif(APPLE)
|
||||
DESTINATION ${INSTALL_PREFIX}/Frameworks)
|
||||
endforeach()
|
||||
endforeach()
|
||||
-elseif(BEOS OR HAIKU)
|
||||
- set(CPACK_GENERATOR TGZ)
|
||||
- install(
|
||||
- FILES ${CMAKE_SOURCE_DIR}/build/haiku/cdogs-sdl.sh
|
||||
- DESTINATION ${INSTALL_PREFIX}
|
||||
- PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
|
||||
else()
|
||||
# probably linux
|
||||
|
||||
diff --git a/build/haiku/cdogs-sdl.sh b/build/haiku/cdogs-sdl.sh
|
||||
deleted file mode 100644
|
||||
index d14ea03..0000000
|
||||
--- a/build/haiku/cdogs-sdl.sh
|
||||
+++ /dev/null
|
||||
@@ -1,3 +0,0 @@
|
||||
-#!/bin/bash
|
||||
-DIR="$( cd "$( dirname "$0" )" && pwd )"
|
||||
-cd "$DIR"/bin && ./cdogs-sdl
|
||||
\ No newline at end of file
|
||||
--
|
||||
2.30.2
|
||||
|
||||
@@ -1,59 +0,0 @@
|
||||
SUMMARY="A third-person shooting DOS game"
|
||||
DESCRIPTION="In this game, you get guns to shoot zombies and cyborgs. \
|
||||
For a DOS game, the graphics are pretty good. It also comes with a map editor."
|
||||
HOMEPAGE="https://github.com/lmartinking/cdogs-sdl"
|
||||
COPYRIGHT="2008-2010 Lucas Martin-King"
|
||||
LICENSE="GNU GPL v2"
|
||||
REVISION="2"
|
||||
srcGitRev="7f9f4d98b5c8ed38dd73ca210aaa6bd22c8f8562"
|
||||
SOURCE_URI="https://github.com/lmartinking/cdogs-sdl/archive/$srcGitRev.tar.gz"
|
||||
CHECKSUM_SHA256="6645be46d9266d74b29886b7505b99236991f449d3a51470e0c071ffcd176ce1"
|
||||
SOURCE_FILENAME="cdogs-sdl-$srcGitRev.zip"
|
||||
SOURCE_DIR="cdogs-sdl-$srcGitRev/src"
|
||||
srcGitRev2="0871f4f9c83d0ab416d88a17e0a79b16e26df392"
|
||||
SOURCE_URI_2="https://github.com/lmartinking/cdogs-sdl-data/archive/$srcGitRev2.tar.gz"
|
||||
CHECKSUM_SHA256_2="d63728f042ecd3ca401c500181385ac962da5e631014f87a5364ab22d67807c0"
|
||||
SOURCE_FILENAME_2="cdogs-sdl-data-$srcGitRev2.zip"
|
||||
|
||||
ARCHITECTURES="?all x86_gcc2"
|
||||
|
||||
PROVIDES="
|
||||
cyberdogs_sdl = $portVersion
|
||||
cmd:cdogs_sdl
|
||||
cmd:cdogs_sdl_editor
|
||||
"
|
||||
REQUIRES="
|
||||
haiku
|
||||
lib:libSDL_1.2
|
||||
lib:libSDL_mixer_1.2
|
||||
"
|
||||
|
||||
BUILD_REQUIRES="
|
||||
haiku_devel
|
||||
devel:libSDL
|
||||
devel:libSDL_mixer
|
||||
"
|
||||
BUILD_PREREQUIRES="
|
||||
cmd:gcc
|
||||
cmd:make
|
||||
"
|
||||
|
||||
BUILD()
|
||||
{
|
||||
mkdir -p $sourceDir/data
|
||||
cp -r $sourceDir2/cdogs-sdl-data-$srcGitRev2/* $sourceDir/data
|
||||
make $jobArgs cdogs-sdl cdogs-sdl-editor \
|
||||
BINDIR=$binDir DATADIR=$dataDir/cdogs_sdl \
|
||||
I_AM_CONFIGURED=yes
|
||||
}
|
||||
|
||||
INSTALL()
|
||||
{
|
||||
mkdir -p $binDir
|
||||
cp cdogs-sdl $binDir
|
||||
cp cdogs-sdl-editor $binDir
|
||||
mkdir -p $dataDir/cdogs_sdl
|
||||
cp -r data/* $dataDir/cdogs_sdl
|
||||
cp -r missions/* $dataDir/cdogs_sdl/missions
|
||||
addAppDeskbarSymlink $binDir/cdogs-sdl Cyberdogs-sdl
|
||||
}
|
||||
Reference in New Issue
Block a user