update sdlpop to latest so it builds with -fno-common

A previous version of the diff was ok tb@
This commit is contained in:
daniel 2021-02-28 17:41:20 +00:00
parent e2fa4125b5
commit c45da19742
5 changed files with 58 additions and 69 deletions

View File

@ -1,16 +1,16 @@
# $OpenBSD: Makefile,v 1.6 2019/07/12 21:02:20 sthen Exp $
# $OpenBSD: Makefile,v 1.7 2021/02/28 17:41:20 daniel Exp $
NOT_FOR_ARCHS= ${BE_ARCHS}
COMMENT= open-source port of Prince of Persia
DISTNAME= sdlpop-20161103
CATEGORIES= games
REVISION= 1
# XXX: switching to a tagged release will require bumping EPOCH
DISTNAME= sdlpop-20210227
GH_ACCOUNT= NagyD
GH_PROJECT= SDLPoP
GH_COMMIT= 6185f28a3b8b74cfc5762aeeea38aedb4e142cbc
GH_COMMIT= b91c1d4e8171440b9f47c1b246400509fde76d8c
CATEGORIES= games
MAINTAINER= Robert Nagy <robert@openbsd.org>
@ -21,10 +21,9 @@ MAKE_FLAGS= CC="${CC}" LOCALBASE="${LOCALBASE}"
# GPLv3
PERMIT_PACKAGE= Yes
WANTLIB= SDL2 SDL2_image SDL2_mixer c m
WANTLIB= SDL2 SDL2_image c m
LIB_DEPENDS= devel/sdl2-image \
devel/sdl2-mixer
LIB_DEPENDS= devel/sdl2-image
pre-configure:
${SUBST_CMD} ${WRKSRC}/seg009.c

View File

@ -1,2 +1,2 @@
SHA256 (sdlpop-20161103-6185f28a.tar.gz) = U9CGdA+k12/MpS7hxVzQEh50tuWammV7cP2EVIKy624=
SIZE (sdlpop-20161103-6185f28a.tar.gz) = 3705930
SHA256 (sdlpop-20210227-b91c1d4e.tar.gz) = Qau9DV2I5F9WB7QxofQGjTOvxfgxf9VNPZ6gPQdiCvs=
SIZE (sdlpop-20210227-b91c1d4e.tar.gz) = 639436

View File

@ -1,17 +1,23 @@
$OpenBSD: patch-src_Makefile,v 1.4 2017/11/05 19:29:43 espie Exp $
$OpenBSD: patch-src_Makefile,v 1.5 2021/02/28 17:41:20 daniel Exp $
Index: src/Makefile
--- src/Makefile.orig
+++ src/Makefile
@@ -14,9 +14,9 @@ LIBS := $(shell sdl2-config --libs) -lSDL2_image -lSDL
INCS := -I/opt/local/include
CFLAGS += $(INCS) -Wall -std=gnu99 -D_GNU_SOURCE=1 -D_THREAD_SAFE -DOSX -O2
@@ -10,15 +10,15 @@ BIN = ../prince
OS := $(shell uname)
CPPFLAGS += -Wall -D_GNU_SOURCE=1
-CFLAGS += -std=gnu99 -O2
+CFLAGS += -std=gnu99
ifeq ($(OS),Darwin)
LIBS := $(shell sdl2-config --libs) -lSDL2_image
CFLAGS += -I/opt/local/include
CPPFLAGS += -D_THREAD_SAFE -DOSX
else
-LIBS := $(shell pkg-config --libs sdl2 SDL2_image SDL2_mixer)
-INCS := $(shell pkg-config --cflags sdl2 SDL2_image SDL2_mixer)
-CFLAGS += $(INCS) -Wall -std=gnu99 -O2
+LIBS := $(shell pkg-config --libs sdl2 SDL2_image SDL2_mixer) -lm
+INCS := $(shell pkg-config --cflags sdl2 SDL2_image SDL2_mixer) -I${LOCALBASE}/include
+CFLAGS += $(INCS) -Wall -std=gnu99
-LIBS := $(shell pkg-config --libs sdl2 SDL2_image)
-CFLAGS += $(shell pkg-config --cflags sdl2 SDL2_image)
+LIBS := $(shell pkg-config --libs sdl2 SDL2_image) -lm
+CFLAGS += $(shell pkg-config --cflags sdl2 SDL2_image) -I${LOCALBASE}/include
endif
all: $(BIN)

View File

@ -1,39 +1,40 @@
$OpenBSD: patch-src_seg009_c,v 1.1.1.1 2016/11/03 17:30:32 robert Exp $
--- src/seg009.c.orig Thu Nov 3 18:07:22 2016
+++ src/seg009.c Thu Nov 3 18:14:31 2016
@@ -152,7 +152,7 @@ static FILE* open_dat_from_root_or_data_dir(const char
$OpenBSD: patch-src_seg009_c,v 1.2 2021/02/28 17:41:20 daniel Exp $
Index: src/seg009.c
--- src/seg009.c.orig
+++ src/seg009.c
@@ -334,7 +334,7 @@ static FILE* open_dat_from_root_or_data_dir(const char
// if failed, try if the DAT file can be opened in the data/ directory, instead of the main folder
if (fp == NULL) {
char data_path[POP_MAX_PATH];
- snprintf(data_path, sizeof(data_path), "data/%s", filename);
+ snprintf(data_path, sizeof(data_path), "${PREFIX}/share/sdlpop/data/%s", filename);
- snprintf_check(data_path, sizeof(data_path), "data/%s", filename);
+ snprintf_check(data_path, sizeof(data_path), "${PREFIX}/share/sdlpop/data/%s", filename);
// verify that this is a regular file and not a directory (otherwise, don't open)
struct stat path_stat;
@@ -1634,7 +1634,7 @@ const int max_sound_id = 58;
char** sound_names = NULL;
if (!file_exists(data_path)) {
find_exe_dir();
@@ -2069,7 +2069,7 @@ const int sound_channel = 0;
const int max_sound_id = 58;
void load_sound_names() {
- const char* names_path = "data/music/names.txt";
+ const char* names_path = "${PREFIX}/share/sdlpop/data/music/names.txt";
- const char* names_path = locate_file("data/music/names.txt");
+ const char* names_path = locate_file("${PREFIX}/share/sdlpop/data/music/names.txt");
if (sound_names != NULL) return;
FILE* fp = fopen(names_path,"rt");
if (fp==NULL) return;
@@ -1682,7 +1682,7 @@ sound_buffer_type* load_sound(int index) {
const char* ext=exts[i];
struct stat info;
- snprintf(filename, sizeof(filename), "data/music/%s.%s", sound_name(index), ext);
+ snprintf(filename, sizeof(filename), "${PREFIX}/share/sdlpop/data/music/%s.%s", sound_name(index), ext);
// Skip nonexistent files:
if (stat(filename, &info))
continue;
@@ -2079,7 +2079,7 @@ void load_from_opendats_metadata(int resource_id, cons
@@ -2119,7 +2119,7 @@ sound_buffer_type* load_sound(int index) {
fp = fopen(filename, "rb");
}
if (fp == NULL && !skip_normal_data_files) {
- snprintf_check(filename, sizeof(filename), "data/music/%s.ogg", sound_name(index));
+ snprintf_check(filename, sizeof(filename), "${PREFIX}/share/sdlpop/data/music/%s.ogg", sound_name(index));
fp = fopen(locate_file(filename), "rb");
}
if (fp == NULL) {
@@ -2723,7 +2723,7 @@ void load_from_opendats_metadata(int resource_id, cons
if (len >= 5 && filename_no_ext[len-4] == '.') {
filename_no_ext[len-4] = '\0'; // terminate, so ".DAT" is deleted from the filename
}
- snprintf(image_filename,sizeof(image_filename),"data/%s/res%d.%s",filename_no_ext, resource_id, extension);
+ snprintf(image_filename,sizeof(image_filename),"${PREFIX}/share/sdlpop/data/%s/res%d.%s",filename_no_ext, resource_id, extension);
- snprintf_check(image_filename,sizeof(image_filename),"data/%s/res%d.%s",filename_no_ext, resource_id, extension);
+ snprintf_check(image_filename,sizeof(image_filename),"${PREFIX}/share/sdlpop/data/%s/res%d.%s",filename_no_ext, resource_id, extension);
if (!use_custom_levelset) {
//printf("loading (binary) %s",image_filename);
fp = fopen(image_filename, "rb");
fp = fopen(locate_file(image_filename), "rb");

View File

@ -1,4 +1,4 @@
@comment $OpenBSD: PLIST,v 1.2 2016/11/10 05:41:53 jca Exp $
@comment $OpenBSD: PLIST,v 1.3 2021/02/28 17:41:20 daniel Exp $
@bin bin/sdlpop
share/doc/sdlpop/
share/doc/sdlpop/Readme.txt
@ -382,7 +382,10 @@ share/sdlpop/data/LEVELS/res2012.bin
share/sdlpop/data/LEVELS/res2013.bin
share/sdlpop/data/LEVELS/res2014.bin
share/sdlpop/data/LEVELS/res2015.bin
share/sdlpop/data/MIDISND1.DAT
share/sdlpop/data/MIDISND2.DAT
share/sdlpop/data/PRINCE/
share/sdlpop/data/PRINCE/res1.bin
share/sdlpop/data/PRINCE/res10.bin
share/sdlpop/data/PRINCE/res150.pal
share/sdlpop/data/PRINCE/res151.png
@ -1041,6 +1044,7 @@ share/sdlpop/data/font/res1128.png
share/sdlpop/data/font/res1129.png
share/sdlpop/data/font/res1130.png
share/sdlpop/data/font/res1131.png
share/sdlpop/data/icon.png
share/sdlpop/data/levels-original/
share/sdlpop/data/levels-original/res2000.bin
share/sdlpop/data/levels-original/res2001.bin
@ -1069,27 +1073,6 @@ share/sdlpop/data/levels-test/04-through-tapestry
share/sdlpop/data/levels-test/05-stacked-gates
share/sdlpop/data/levels-test/07-jump
share/sdlpop/data/levels-test/12-shadow
share/sdlpop/data/light.png
share/sdlpop/data/music/
share/sdlpop/data/music/cutscene_before_2_4_6_12.ogg
share/sdlpop/data/music/cutscene_before_8_9.ogg
share/sdlpop/data/music/cutscene_not_much_time_left.ogg
share/sdlpop/data/music/embrace.ogg
share/sdlpop/data/music/end_level_4_and_killed_by_shadow.ogg
share/sdlpop/data/music/fight_death.ogg
share/sdlpop/data/music/find_mirror_and_find_shadow.ogg
share/sdlpop/data/music/floating.ogg
share/sdlpop/data/music/guard_death_and_obtaining_the_sword.ogg
share/sdlpop/data/music/intro_theme.ogg
share/sdlpop/data/music/killed_Jaffar.ogg
share/sdlpop/data/music/life_potion.ogg
share/sdlpop/data/music/meet_Jaffar.ogg
share/sdlpop/data/music/names.txt
share/sdlpop/data/music/out_of_time.ogg
share/sdlpop/data/music/potion.ogg
share/sdlpop/data/music/regular_death.ogg
share/sdlpop/data/music/story_1_absence.ogg
share/sdlpop/data/music/story_2_princess.ogg
share/sdlpop/data/music/story_3_Jaffar_enters.ogg
share/sdlpop/data/music/story_4_Jaffar_leaves.ogg
share/sdlpop/data/music/story_5_level_end_and_merge_with_shadow.ogg
share/sdlpop/data/music/won.ogg