Here's another attempt to update sdlpop and fix the compile breakage. Differences from the last proposal: - we avoid adding EPOCH and continue to use the date of the last commit as the package version - update to the latest commit which is a bit newer than v1.21. - remove sdl2_mixer dependencies
Retested this update by playing most of the first level again. ok? Index: Makefile =================================================================== RCS file: /cvs/ports/games/sdlpop/Makefile,v retrieving revision 1.6 diff -u -p -u -r1.6 Makefile --- Makefile 12 Jul 2019 21:02:20 -0000 1.6 +++ Makefile 28 Feb 2021 06:39:48 -0000 @@ -4,13 +4,13 @@ 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 <rob...@openbsd.org> @@ -21,10 +21,9 @@ MAKE_FLAGS= CC="${CC}" LOCALBASE="${LOCA # 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 Index: distinfo =================================================================== RCS file: /cvs/ports/games/sdlpop/distinfo,v retrieving revision 1.2 diff -u -p -u -r1.2 distinfo --- distinfo 6 May 2017 15:10:17 -0000 1.2 +++ distinfo 28 Feb 2021 06:39:48 -0000 @@ -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 Index: patches/patch-src_Makefile =================================================================== RCS file: /cvs/ports/games/sdlpop/patches/patch-src_Makefile,v retrieving revision 1.4 diff -u -p -u -r1.4 patch-src_Makefile --- patches/patch-src_Makefile 5 Nov 2017 19:29:43 -0000 1.4 +++ patches/patch-src_Makefile 28 Feb 2021 06:39:48 -0000 @@ -2,16 +2,22 @@ $OpenBSD: patch-src_Makefile,v 1.4 2017/ 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) Index: patches/patch-src_seg009_c =================================================================== RCS file: /cvs/ports/games/sdlpop/patches/patch-src_seg009_c,v retrieving revision 1.1.1.1 diff -u -p -u -r1.1.1.1 patch-src_seg009_c --- patches/patch-src_seg009_c 3 Nov 2016 17:30:32 -0000 1.1.1.1 +++ patches/patch-src_seg009_c 28 Feb 2021 06:39:48 -0000 @@ -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 +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"); Index: pkg/PLIST =================================================================== RCS file: /cvs/ports/games/sdlpop/pkg/PLIST,v retrieving revision 1.2 diff -u -p -u -r1.2 PLIST --- pkg/PLIST 10 Nov 2016 05:41:53 -0000 1.2 +++ pkg/PLIST 28 Feb 2021 06:39:48 -0000 @@ -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 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