mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-08 21:00:05 +02:00
frozen_bubble: revbump for new perl, secondaryArch changes, build fix, add tests
Consolidated the patches into a single patchset. Added a new patch to fix the build with the new Module::Build version. It runs now also on x86!
This commit is contained in:
@@ -8,21 +8,21 @@ opponent to 'die' before you."
|
||||
HOMEPAGE="https://metacpan.org/dist/Games-FrozenBubble/view/bin/frozen-bubble"
|
||||
COPYRIGHT="2000-2010 The Frozen-Bubble Team"
|
||||
LICENSE="GNU GPL v2"
|
||||
REVISION="3"
|
||||
REVISION="4"
|
||||
SOURCE_URI="https://cpan.metacpan.org/authors/id/K/KT/KTHAKORE/Games-FrozenBubble-$portVersion.tar.gz"
|
||||
CHECKSUM_SHA256="721e04ff69c5233060656bfbf4002aa1aeadd96c95351f0c57bb85b6da35a305"
|
||||
SOURCE_DIR="Games-FrozenBubble-$portVersion"
|
||||
PATCHES="frozen-bubble-$portVersion.patch
|
||||
frozen_bubble-$portVersion.patchset"
|
||||
PATCHES="frozen_bubble-$portVersion.patchset"
|
||||
|
||||
ARCHITECTURES="all !x86_gcc2"
|
||||
SECONDARY_ARCHITECTURES="?x86"
|
||||
SECONDARY_ARCHITECTURES="x86"
|
||||
|
||||
PROVIDES="
|
||||
frozen_bubble$secondaryArchSuffix = $portVersion
|
||||
cmd:fb_server
|
||||
cmd:frozen_bubble
|
||||
cmd:frozen_bubble_editor
|
||||
games_frozenbubble = $portVersion # this is the perl module name
|
||||
"
|
||||
REQUIRES="
|
||||
haiku$secondaryArchSuffix
|
||||
@@ -32,9 +32,9 @@ REQUIRES="
|
||||
lib:libSDL_mixer_1.2$secondaryArchSuffix
|
||||
lib:libSDL_Pango$secondaryArchSuffix
|
||||
compress_bzip2$secondaryArchSuffix
|
||||
file_which$secondaryArchSuffix
|
||||
file_which
|
||||
sdl_perl$secondaryArchSuffix
|
||||
vendor_perl$secondaryArchSuffix
|
||||
vendor_perl
|
||||
"
|
||||
|
||||
BUILD_REQUIRES="
|
||||
@@ -45,20 +45,20 @@ BUILD_REQUIRES="
|
||||
devel:libSDL_1.2$secondaryArchSuffix
|
||||
devel:libSDL_mixer_1.2$secondaryArchSuffix
|
||||
devel:libSDL_Pango$secondaryArchSuffix
|
||||
capture_tiny$secondaryArchSuffix
|
||||
class_inspector$secondaryArchSuffix
|
||||
capture_tiny
|
||||
class_inspector
|
||||
compress_bzip2$secondaryArchSuffix
|
||||
file_sharedir$secondaryArchSuffix
|
||||
file_slurp$secondaryArchSuffix
|
||||
file_which$secondaryArchSuffix
|
||||
ipc_system_simple$secondaryArchSuffix
|
||||
locale_maketext_extract$secondaryArchSuffix
|
||||
module_build$secondaryArchSuffix
|
||||
file_sharedir
|
||||
file_slurp
|
||||
file_which
|
||||
ipc_system_simple
|
||||
locale_maketext_extract
|
||||
module_build
|
||||
sdl_perl$secondaryArchSuffix
|
||||
"
|
||||
BUILD_PREREQUIRES="
|
||||
cmd:gcc$secondaryArchSuffix
|
||||
cmd:perl$secondaryArchSuffix
|
||||
cmd:perl
|
||||
cmd:pkg_config$secondaryArchSuffix
|
||||
"
|
||||
|
||||
@@ -75,3 +75,8 @@ INSTALL()
|
||||
|
||||
addAppDeskbarSymlink $prefix/bin/frozen-bubble FrozenBubble
|
||||
}
|
||||
|
||||
TEST()
|
||||
{
|
||||
./Build test
|
||||
}
|
||||
|
||||
@@ -1,69 +0,0 @@
|
||||
From aa2ce32185b4477e659ed7c70d09c440610ef67b Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
|
||||
Date: Fri, 2 Feb 2018 12:44:15 +0100
|
||||
Subject: [PATCH] Fix buffer size when formatting current date
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
gcc-8 and glibc-2.26.9000 reports this error:
|
||||
|
||||
server/log.c:64:54: error: '%03d' directive output may be truncated writing between 3 and 11 bytes into a region of size between 0 and 49 [-Werror=format-truncation=]
|
||||
snprintf(current_date, sizeof(current_date), "%s.%03d", buf, (int)(1000 * (time-seconds)));
|
||||
^~~~
|
||||
|
||||
This patch fixes two mistakes in the get_current_date() function:
|
||||
|
||||
First strftime() can fail and then buf content is undefined. The patch
|
||||
makes sure the buf content is properly null-termited.
|
||||
|
||||
Second if strftime() uses up the the whole buf array, no space will be
|
||||
left for appending miliseconds to current_date value in the subsequent
|
||||
snprintf() call. The patch increases current_data size so that things
|
||||
will always fit.
|
||||
|
||||
In reality, all this should not matter because sane strftime() will
|
||||
return fixed-lenght string. But for all the cases and for sake of the
|
||||
compiler check this patch should be applied.
|
||||
|
||||
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
||||
---
|
||||
server/log.c | 6 ++++--
|
||||
1 file changed, 4 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/server/log.c b/server/log.c
|
||||
index 2fe7b7c..f696752 100644
|
||||
--- a/server/log.c
|
||||
+++ b/server/log.c
|
||||
@@ -52,15 +52,17 @@ double get_current_time_exact(void)
|
||||
return (double) now.tv_sec + now.tv_usec / 1e6; // bad bad idea to use float as precision is not down to the seconds then
|
||||
}
|
||||
|
||||
-char current_date[50];
|
||||
+char current_date[70];
|
||||
char* get_current_date(void)
|
||||
{
|
||||
struct tm * lt;
|
||||
char buf[50];
|
||||
double time = get_current_time_exact();
|
||||
time_t seconds = (time_t)time;
|
||||
+ size_t length;
|
||||
lt = localtime(&seconds);
|
||||
- strftime(buf, sizeof(buf), "%Y-%m-%d %H:%M:%S", lt);
|
||||
+ length = strftime(buf, sizeof(buf), "%Y-%m-%d %H:%M:%S", lt);
|
||||
+ buf[length] = '\0';
|
||||
snprintf(current_date, sizeof(current_date), "%s.%03d", buf, (int)(1000 * (time-seconds)));
|
||||
return current_date;
|
||||
}
|
||||
diff -up frozen-bubble-2.2.1-beta1/server/log.h~ frozen-bubble-2.2.1-beta1/server/log.h
|
||||
--- frozen-bubble-2.2.1-beta1/server/log.h~ 2010-08-07 15:36:27.000000000 +0200
|
||||
+++ frozen-bubble-2.2.1-beta1/server/log.h 2018-02-08 14:09:52.472451694 +0100
|
||||
@@ -23,7 +23,7 @@
|
||||
time_t get_current_time(void);
|
||||
double get_current_time_exact(void);
|
||||
|
||||
-extern char current_date[50];
|
||||
+extern char current_date[70];
|
||||
char* get_current_date(void);
|
||||
|
||||
enum output_types { OUTPUT_TYPE_DEBUG, OUTPUT_TYPE_CONNECT, OUTPUT_TYPE_INFO, OUTPUT_TYPE_ERROR };
|
||||
@@ -1,4 +1,75 @@
|
||||
From 060b2c3cda3f7a59e0aea5b69067d4916f87ee37 Mon Sep 17 00:00:00 2001
|
||||
From 6cd1bf72e9035776ecbb4c37104d0d5f5285ac67 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
|
||||
Date: Fri, 2 Feb 2018 12:44:15 +0100
|
||||
Subject: Fix buffer size when formatting current date
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
gcc-8 and glibc-2.26.9000 reports this error:
|
||||
|
||||
server/log.c:64:54: error: '%03d' directive output may be truncated writing between 3 and 11 bytes into a region of size between 0 and 49 [-Werror=format-truncation=]
|
||||
snprintf(current_date, sizeof(current_date), "%s.%03d", buf, (int)(1000 * (time-seconds)));
|
||||
^~~~
|
||||
|
||||
This patch fixes two mistakes in the get_current_date() function:
|
||||
|
||||
First strftime() can fail and then buf content is undefined. The patch
|
||||
makes sure the buf content is properly null-termited.
|
||||
|
||||
Second if strftime() uses up the the whole buf array, no space will be
|
||||
left for appending miliseconds to current_date value in the subsequent
|
||||
snprintf() call. The patch increases current_data size so that things
|
||||
will always fit.
|
||||
|
||||
In reality, all this should not matter because sane strftime() will
|
||||
return fixed-lenght string. But for all the cases and for sake of the
|
||||
compiler check this patch should be applied.
|
||||
|
||||
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
||||
|
||||
diff --git a/server/log.c b/server/log.c
|
||||
index 2fe7b7c..539b41a 100644
|
||||
--- a/server/log.c
|
||||
+++ b/server/log.c
|
||||
@@ -52,15 +52,17 @@ double get_current_time_exact(void)
|
||||
return (double) now.tv_sec + now.tv_usec / 1e6; // bad bad idea to use float as precision is not down to the seconds then
|
||||
}
|
||||
|
||||
-char current_date[50];
|
||||
+char current_date[70];
|
||||
char* get_current_date(void)
|
||||
{
|
||||
struct tm * lt;
|
||||
char buf[50];
|
||||
double time = get_current_time_exact();
|
||||
time_t seconds = (time_t)time;
|
||||
+ size_t length;
|
||||
lt = localtime(&seconds);
|
||||
- strftime(buf, sizeof(buf), "%Y-%m-%d %H:%M:%S", lt);
|
||||
+ length = strftime(buf, sizeof(buf), "%Y-%m-%d %H:%M:%S", lt);
|
||||
+ buf[length] = '\0';
|
||||
snprintf(current_date, sizeof(current_date), "%s.%03d", buf, (int)(1000 * (time-seconds)));
|
||||
return current_date;
|
||||
}
|
||||
diff --git a/server/log.h b/server/log.h
|
||||
index a672395..72f1af6 100644
|
||||
--- a/server/log.h
|
||||
+++ b/server/log.h
|
||||
@@ -23,7 +23,7 @@
|
||||
time_t get_current_time(void);
|
||||
double get_current_time_exact(void);
|
||||
|
||||
-extern char current_date[50];
|
||||
+extern char current_date[70];
|
||||
char* get_current_date(void);
|
||||
|
||||
enum output_types { OUTPUT_TYPE_DEBUG, OUTPUT_TYPE_CONNECT, OUTPUT_TYPE_INFO, OUTPUT_TYPE_ERROR };
|
||||
--
|
||||
2.45.2
|
||||
|
||||
|
||||
From a8735ee246ea983efd51d304eddb1bba736d25d8 Mon Sep 17 00:00:00 2001
|
||||
From: Begasus <begasus@gmail.com>
|
||||
Date: Sat, 9 Sep 2023 13:53:35 +0200
|
||||
Subject: Fix path for highscores et all ...
|
||||
@@ -18,5 +89,29 @@ index 6b3ee8f..feff10d 100644
|
||||
migrate_resource_files();
|
||||
|
||||
--
|
||||
2.42.0
|
||||
2.45.2
|
||||
|
||||
|
||||
From a742a3fb833337de1f3233a3c180291663bfbc21 Mon Sep 17 00:00:00 2001
|
||||
From: Sergio Lindo Mansilla <sergio.lindomansilla@urbangames.com>
|
||||
Date: Fri, 5 Jul 2024 14:08:01 +0200
|
||||
Subject: Fix build
|
||||
|
||||
- Remove explicit version when importing Module::Build
|
||||
|
||||
diff --git a/inc/My/Builder.pm b/inc/My/Builder.pm
|
||||
index 21c5e86..87a090d 100644
|
||||
--- a/inc/My/Builder.pm
|
||||
+++ b/inc/My/Builder.pm
|
||||
@@ -8,7 +8,7 @@ use File::Copy qw(move);
|
||||
use File::Slurp qw(read_file write_file);
|
||||
use File::Spec::Functions qw(catdir catfile rootdir);
|
||||
use IO::File qw();
|
||||
-use Module::Build '0.36' => qw();
|
||||
+use Module::Build qw();
|
||||
use autodie qw(:all move read_file write_file);
|
||||
use parent 'Module::Build';
|
||||
use Locale::Maketext::Extract;
|
||||
--
|
||||
2.45.2
|
||||
|
||||
|
||||
Reference in New Issue
Block a user