diff --git a/games/xscorch/Portfile b/games/xscorch/Portfile index 7df00ed8ac3..5371535db30 100644 --- a/games/xscorch/Portfile +++ b/games/xscorch/Portfile @@ -6,7 +6,6 @@ name xscorch version 0.2.1 revision 1 categories games -platforms darwin maintainers nomaintainer license GPL-2 @@ -23,21 +22,33 @@ homepage http://www.xscorch.org/ master_sites ${homepage}releases/ checksums rmd160 ac8688e40162834db064c2aa18f904748ef56d0e \ - sha256 a315f7001a020c6b8f644db1c1dc56ccfbb9e3efcbf12c41ac9eb4e5e75cb5f7 + sha256 a315f7001a020c6b8f644db1c1dc56ccfbb9e3efcbf12c41ac9eb4e5e75cb5f7 \ + size 849773 -depends_build port:pkgconfig +depends_build path:bin/pkg-config:pkgconfig depends_lib path:lib/pkgconfig/gtk+-2.0.pc:gtk2 \ port:libmikmod -patchfiles patch-configure.diff \ +patchfiles change-echo-n-to-printf.patch \ + implicit.patch \ overlapping-memcpy.diff +if {![string match *gcc* ${configure.compiler}]} { + patchfiles-append \ + no-thread-jumps.patch +} + configure.args --mandir=${prefix}/share/man \ --disable-warn \ --disable-network \ --enable-opt +configure.cppflags-append \ + -D__ALLOW_DEPRECATED_GDK__ + +installs_libs no + livecheck.type regex livecheck.url [lindex ${master_sites} 0] livecheck.regex ${name}-(\[0-9.\]+)${extract.suffix} diff --git a/games/xscorch/files/patch-configure.diff b/games/xscorch/files/change-echo-n-to-printf.patch similarity index 92% rename from games/xscorch/files/patch-configure.diff rename to games/xscorch/files/change-echo-n-to-printf.patch index 9e1c9207c78..ea5630a7cc1 100644 --- a/games/xscorch/files/patch-configure.diff +++ b/games/xscorch/files/change-echo-n-to-printf.patch @@ -1,3 +1,4 @@ +Use printf instead of echo -n to avoid literal "-n" printed onscreen. --- configure.orig 2011-07-31 19:31:11.000000000 -0500 +++ configure 2011-09-12 21:47:50.000000000 -0500 @@ -16936,7 +16936,7 @@ diff --git a/games/xscorch/files/implicit.patch b/games/xscorch/files/implicit.patch new file mode 100644 index 00000000000..57c4aeb2657 --- /dev/null +++ b/games/xscorch/files/implicit.patch @@ -0,0 +1,27 @@ +Fix failure to find libmikmod: + +checking for libmikmod - version >= 3.1.5... no + +Because of: + +error: implicitly declaring library function 'strlen' with type 'unsigned long (const char *)' [-Werror,-Wimplicit-function-declaration] +error: implicitly declaring library function 'strcpy' with type 'char *(char *, const char *)' [-Werror,-Wimplicit-function-declaration] +--- configure.orig 2011-07-31 19:31:11.000000000 -0500 ++++ configure 2024-01-10 02:23:19.000000000 -0600 +@@ -12947,6 +12947,7 @@ + #include + #include + #include ++#include + + char* my_strdup (char *str) + { +@@ -12961,7 +12962,7 @@ + return new_str; + } + +-int main() ++int main(void) + { + int major,minor,micro; + int libmikmod_major_version,libmikmod_minor_version,libmikmod_micro_version; diff --git a/games/xscorch/files/no-thread-jumps.patch b/games/xscorch/files/no-thread-jumps.patch new file mode 100644 index 00000000000..bcc85e105e2 --- /dev/null +++ b/games/xscorch/files/no-thread-jumps.patch @@ -0,0 +1,20 @@ +Remove -fthread-jumps which causes compile failure with clang when --enable-opt +is used because clang does not understand that flag. + +This patch is applied conditionally, when the compiler is not gcc. + +The flag is probably also pointless for gcc since this optimization is included +in -O1 and later and this line already uses -O3. + +https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html#index-fthread-jumps +--- configure.orig 2011-07-31 19:31:11.000000000 -0500 ++++ configure 2024-01-10 01:43:56.000000000 -0600 +@@ -14422,7 +14422,7 @@ + if test "x$enable_opt" = "xyes" -o \( "x$enable_opt" = "xmaybe" -a "x$CFLAGS" = "x" \); then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: enabled" >&5 + $as_echo "enabled" >&6; } +- LIBJ_CFLAGS_OPT="-O3 -fomit-frame-pointer -finline-functions -funroll-loops -fthread-jumps -DNDEBUG" ++ LIBJ_CFLAGS_OPT="-O3 -fomit-frame-pointer -finline-functions -funroll-loops -DNDEBUG" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not enabled" >&5 + $as_echo "not enabled" >&6; }