icebreaker: bump to 2.2.1 (#6275)

This commit is contained in:
davidkaroly
2021-10-16 20:44:20 +02:00
committed by GitHub
parent 40b5f7c67b
commit f91dc6489e
3 changed files with 186 additions and 34 deletions

View File

@@ -3,37 +3,39 @@ DESCRIPTION="So, uh, there's a bunch of penguins on an iceberg in \
Antarctica. You have been selected to catch them so they can be shipped \
to Finland, where they are essential to a secret plot for world domination."
HOMEPAGE="https://mattdm.org/icebreaker/"
COPYRIGHT="2000-2002 Matthew Miller"
COPYRIGHT="2000-2021 Matthew Miller"
LICENSE="GNU GPL v2"
REVISION="2"
SOURCE_URI="https://mattdm.org/icebreaker/1.9.x/icebreaker-$portVersion.tgz"
CHECKSUM_SHA256="2e9b1e898c50562c503cb109172c422544d2e5de09e642bb8eb3401a9180adc4"
PATCHES="icebreaker-$portVersion.patch"
REVISION="1"
SOURCE_URI="https://mattdm.org/icebreaker/2.2.x/icebreaker-$portVersion.tar.xz"
CHECKSUM_SHA256="29d02d59681faa1e83949b7bae4553720db0247c51ac040bb9f3b516350e9810"
PATCHES="icebreaker-$portVersion.patchset"
ADDITIONAL_FILES="icebreaker.rdef"
ARCHITECTURES="?all x86_gcc2"
ARCHITECTURES="all !x86_gcc2"
SECONDARY_ARCHITECTURES="x86"
GLOBAL_WRITABLE_FILES="settings/icebreaker.scores keep-old"
PROVIDES="
icebreaker = $portVersion
app:IceBreaker = $portVersion
icebreaker$secondaryArchSuffix = $portVersion
app:IceBreaker$secondaryArchSuffix = $portVersion
"
REQUIRES="
haiku
lib:libSDL_1.2
lib:libSDL_mixer_1.2
haiku$secondaryArchSuffix
lib:libSDL_1.2$secondaryArchSuffix
lib:libSDL_mixer_1.2$secondaryArchSuffix
"
BUILD_REQUIRES="
haiku_devel
devel:libSDL_1.2
devel:libSDL_mixer_1.2
haiku${secondaryArchSuffix}_devel
devel:libSDL_1.2$secondaryArchSuffix
devel:libSDL_mixer_1.2$secondaryArchSuffix
"
BUILD_PREREQUIRES="
cmd:awk
cmd:gcc
cmd:gcc$secondaryArchSuffix
cmd:make
cmd:pkg_config$secondaryArchSuffix
"
BUILD()

View File

@@ -1,19 +0,0 @@
--- icebreaker-1.9.7/icebreaker.h.org 2016-06-12 07:50:07.712245248 +0200
+++ icebreaker-1.9.7/icebreaker.h 2016-06-12 07:49:31.050331648 +0200
@@ -64,6 +64,16 @@
// HISCOREPREFIX and DATAPREFIX should probably be ".". Set in Makefile.w32
#endif
+#ifdef __HAIKU__
+
+ #define NEEDCHANGETOARGV0PATH
+
+ #ifndef OPTIONFILE
+ #define OPTIONFILE "config/settings/icebreaker.cfg"
+ #endif
+
+ // HISCOREPREFIX and DATAPREFIX should probably be ".". Set in Makefile.beos
+#endif
#ifdef __BEOS__

View File

@@ -0,0 +1,169 @@
From 274e3fd30dd99735cbbff6732c22a308b16e83e8 Mon Sep 17 00:00:00 2001
From: David Karoly <david.karoly@outlook.com>
Date: Thu, 14 Oct 2021 15:54:45 +0200
Subject: fix build
diff --git a/Makefile b/Makefile
index 686e636..94a5b07 100644
--- a/Makefile
+++ b/Makefile
@@ -20,7 +20,7 @@ ifndef bindir
endif
-CFLAGS+=-Wall -Werror $(OPTIMIZE) $(SDL_CFLAGS) -DDATAPREFIX=\"$(datadir)/icebreaker\"
+CFLAGS+=-Wall -Werror -Wno-error=format-truncation $(OPTIMIZE) $(SDL_CFLAGS) -DDATAPREFIX=\"$(datadir)/icebreaker\"
SRC=icebreaker.c cursor.c grid.c laundry.c line.c penguin.c sound.c \
level.c intro.c text.c status.c transition.c hiscore.c dialog.c \
@@ -33,7 +33,7 @@ SDL_MIXER := $(shell $(PKG_CONFIG) SDL_mixer --libs)
SDL_LIB=$(SDL_MIXER) $(SDL_LDFLAGS)
SDL_CFLAGS := $(shell $(PKG_CONFIG) sdl --cflags)
SDL_LDFLAGS := $(shell $(PKG_CONFIG) sdl --libs)
-VERSION := $(shell awk '/^#define VERSION/ { print $$3 }' icebreaker.h)
+VERSION := $(shell awk '/^\#define VERSION/ { print $$3 }' icebreaker.h)
VERDATE := $(shell LC_ALL=C date -u -r icebreaker.h +"%d %B %Y")
WINARCH=i686
--
2.30.2
From 3c5669c59868ba961895a7a38748dce6fa995d1a Mon Sep 17 00:00:00 2001
From: David Karoly <david.karoly@outlook.com>
Date: Thu, 14 Oct 2021 15:54:58 +0200
Subject: add paths for Haiku
diff --git a/Makefile b/Makefile
index 94a5b07..0b91af2 100644
--- a/Makefile
+++ b/Makefile
@@ -20,7 +20,8 @@ ifndef bindir
endif
-CFLAGS+=-Wall -Werror -Wno-error=format-truncation $(OPTIMIZE) $(SDL_CFLAGS) -DDATAPREFIX=\"$(datadir)/icebreaker\"
+CFLAGS+=-Wall -Werror -Wno-error=format-truncation $(OPTIMIZE) $(SDL_CFLAGS)
+CFLAGS+=-DDATAPREFIX=\"$(datadir)/icebreaker\" -DHISCOREPREFIX=\"$(highscoredir)\"
SRC=icebreaker.c cursor.c grid.c laundry.c line.c penguin.c sound.c \
level.c intro.c text.c status.c transition.c hiscore.c dialog.c \
diff --git a/icebreaker.h b/icebreaker.h
index 907ffa4..f041df3 100644
--- a/icebreaker.h
+++ b/icebreaker.h
@@ -65,6 +65,18 @@
#endif
+#ifdef __HAIKU__
+
+ #define NEEDCHANGETOARGV0PATH
+
+ #ifndef OPTIONFILE
+ #define OPTIONFILE "config/settings/icebreaker.cfg"
+ #endif
+
+ // HISCOREPREFIX and DATAPREFIX should probably be ".". Set in Makefile
+#endif
+
+
#ifdef __BEOS__
#define NEEDCHANGETOARGV0PATH
--
2.30.2
From 4cdf2d897d2e0e864c41fafa6fc97ae54de25433 Mon Sep 17 00:00:00 2001
From: David Karoly <david.karoly@outlook.com>
Date: Thu, 14 Oct 2021 15:55:07 +0200
Subject: adjust high score filename
diff --git a/Makefile b/Makefile
index 0b91af2..3df49fe 100644
--- a/Makefile
+++ b/Makefile
@@ -188,6 +188,7 @@ man: icebreaker.6
install-mkdirs:
install -m 755 -d $(datadir)/icebreaker
install -m 755 -d $(bindir)
+ install -m 755 -d $(highscoredir)
install -m 755 -d $(mandir)/man6
themes-install: install-themes
@@ -202,7 +203,13 @@ install-bin: install-mkdirs icebreaker
install-man: install-mkdirs icebreaker.6
install -m 644 icebreaker.6 $(mandir)/man6
-install: all install-mkdirs install-themes install-bin install-man
+install-scorefile: install-mkdirs
+ touch $(highscoredir)/icebreaker.scores
+ chown -f games:games $(highscoredir)/icebreaker.scores && \
+ chmod 664 $(highscoredir)/icebreaker.scores || \
+ chmod 644 $(highscoredir)/icebreaker.scores
+
+install: all install-mkdirs install-themes install-bin install-man install-scorefile
%.d: %.c
set -e; $(CC) -M $(CFLAGS) $< \
diff --git a/hiscore.c b/hiscore.c
index 3fd7393..e867de5 100644
--- a/hiscore.c
+++ b/hiscore.c
@@ -77,7 +77,7 @@ void readhiscores()
temphiscoreval[i]=100; //100 is better than 0. :)
}
- snprintf(filename,274,"%s/%s",homedir,HISCOREFILE);
+ snprintf(filename,274,HISCOREPREFIX "/" HISCOREFILE);
hiscorefile=fopen(filename,"r");
if (hiscorefile==NULL)
@@ -129,7 +129,7 @@ int addhiscore(char* username, long finalscore, int candelay)
FILE_DESC filelock;
char filename[274]; // fix -- use defined OS constant
- snprintf(filename,274,"%s/%s",homedir,HISCORELOCKFILE);
+ snprintf(filename,274,HISCORELOCKFILE);
filelock = openlockfile(filename);
if (filelock == INVALID_FILE_DESC)
@@ -240,7 +240,7 @@ void writehiscores(char * username, long thisgamescore)
sorthiscore(hiscorename,hiscoreval,username,thisgamescore);
- snprintf(filename,274,"%s/%s",homedir,HISCOREFILE);
+ snprintf(filename,274,HISCOREPREFIX "/" HISCOREFILE);
hiscorefile=fopen(filename,"w");
if (hiscorefile==NULL)
diff --git a/icebreaker.h b/icebreaker.h
index f041df3..96f89bf 100644
--- a/icebreaker.h
+++ b/icebreaker.h
@@ -73,7 +73,8 @@
#define OPTIONFILE "config/settings/icebreaker.cfg"
#endif
- // HISCOREPREFIX and DATAPREFIX should probably be ".". Set in Makefile
+ #define HISCOREFILE "icebreaker.scores"
+
#endif
@@ -117,7 +118,7 @@
#endif
#ifndef HISCORELOCKFILE
- #define HISCORELOCKFILE HISCOREFILE
+ #define HISCORELOCKFILE HISCOREPREFIX "/" HISCOREFILE
#endif
#ifndef PENGUINICONFILE
--
2.30.2