Github messages for voidlinux
 help / color / mirror / Atom feed
From: sgn <sgn@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: [PR PATCH] [Updated] [do not merge] cabbage: fix build for gcc 12
Date: Sat, 03 Dec 2022 18:32:28 +0100	[thread overview]
Message-ID: <20221203173228.hzILbj6HA_Hnc126mO9tPFqpeUApBkURGf8Sru1d_Ko@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-40885@inbox.vuxu.org>

[-- Attachment #1: Type: text/plain, Size: 1271 bytes --]

There is an updated pull request by sgn against master on the void-packages repository

https://github.com/sgn/void-packages gcc-12
https://github.com/void-linux/void-packages/pull/40885

[do not merge] cabbage: fix build for gcc 12
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**|**briefly**|**NO**

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/40885.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc-12-40885.patch --]
[-- Type: text/x-diff, Size: 5303 bytes --]

From 70a3b1dca48a9f10110b2b2807054b4d2c1693b1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Sun, 4 Dec 2022 00:31:25 +0700
Subject: [PATCH] Cataclysm-DDA: fix build with gcc-12

---
 srcpkgs/Cataclysm-DDA/patches/gcc-12.patch    | 37 +++++++++++++++++
 srcpkgs/Cataclysm-DDA/patches/no-werror.patch | 13 ++++++
 srcpkgs/Cataclysm-DDA/template                | 41 +++++++++++++------
 3 files changed, 78 insertions(+), 13 deletions(-)
 create mode 100644 srcpkgs/Cataclysm-DDA/patches/gcc-12.patch
 create mode 100644 srcpkgs/Cataclysm-DDA/patches/no-werror.patch

diff --git a/srcpkgs/Cataclysm-DDA/patches/gcc-12.patch b/srcpkgs/Cataclysm-DDA/patches/gcc-12.patch
new file mode 100644
index 000000000000..06d4e855d6fc
--- /dev/null
+++ b/srcpkgs/Cataclysm-DDA/patches/gcc-12.patch
@@ -0,0 +1,37 @@
+Index: Cataclysm-DDA-0.E/src/sdltiles.cpp
+===================================================================
+--- Cataclysm-DDA-0.E.orig/src/sdltiles.cpp
++++ Cataclysm-DDA-0.E/src/sdltiles.cpp
+@@ -3246,7 +3246,7 @@ static void font_folder_list( std::ostre
+             }
+ 
+             // Add font family
+-            char *fami = TTF_FontFaceFamilyName( fnt.get() );
++            const char *fami = TTF_FontFaceFamilyName( fnt.get() );
+             if( fami != nullptr ) {
+                 fout << fami;
+             } else {
+@@ -3254,7 +3254,7 @@ static void font_folder_list( std::ostre
+             }
+ 
+             // Add font style
+-            char *style = TTF_FontFaceStyleName( fnt.get() );
++            const char *style = TTF_FontFaceStyleName( fnt.get() );
+             bool isbitmap = ends_with( f, ".fon" );
+             if( style != nullptr && !isbitmap && strcasecmp( style, "Regular" ) != 0 ) {
+                 fout << " " << style;
+@@ -3365,12 +3365,12 @@ static int test_face_size( const std::st
+ {
+     const TTF_Font_Ptr fnt( TTF_OpenFontIndex( f.c_str(), size, faceIndex ) );
+     if( fnt ) {
+-        char *style = TTF_FontFaceStyleName( fnt.get() );
++        const char *style = TTF_FontFaceStyleName( fnt.get() );
+         if( style != nullptr ) {
+             int faces = TTF_FontFaces( fnt.get() );
+             for( int i = faces - 1; i >= 0; i-- ) {
+                 const TTF_Font_Ptr tf( TTF_OpenFontIndex( f.c_str(), size, i ) );
+-                char *ts = nullptr;
++                const char *ts = nullptr;
+                 if( tf ) {
+                     if( nullptr != ( ts = TTF_FontFaceStyleName( tf.get() ) ) ) {
+                         if( 0 == strcasecmp( ts, style ) && TTF_FontHeight( tf.get() ) <= size ) {
diff --git a/srcpkgs/Cataclysm-DDA/patches/no-werror.patch b/srcpkgs/Cataclysm-DDA/patches/no-werror.patch
new file mode 100644
index 000000000000..2855c96db62c
--- /dev/null
+++ b/srcpkgs/Cataclysm-DDA/patches/no-werror.patch
@@ -0,0 +1,13 @@
+Index: Cataclysm-DDA-0.E/CMakeLists.txt
+===================================================================
+--- Cataclysm-DDA-0.E.orig/CMakeLists.txt
++++ Cataclysm-DDA-0.E/CMakeLists.txt
+@@ -222,7 +222,7 @@ IF(MSVC)
+     endif()
+ ELSE()
+     SET(CATA_WARNINGS
+-      "-Werror -Wall -Wextra \
++      "-Wall -Wextra \
+        -Wformat-signedness \
+        -Wlogical-op \
+        -Wmissing-declarations \
diff --git a/srcpkgs/Cataclysm-DDA/template b/srcpkgs/Cataclysm-DDA/template
index bbe66b9f29b9..b5044e01f092 100644
--- a/srcpkgs/Cataclysm-DDA/template
+++ b/srcpkgs/Cataclysm-DDA/template
@@ -13,8 +13,12 @@ short_desc="Turn-based survival game set in a post-apocalyptic world"
 maintainer="John <me@johnnynator.dev>"
 license="CC-BY-SA-3.0, CC-BY-3.0"
 homepage="https://cataclysmdda.org/"
-distfiles="https://github.com/CleverRaven/Cataclysm-DDA/archive/${version}.tar.gz"
-checksum=b0af9a9292929e17332edcea770bca9a91f1d08ea47726d78a47e09281a42fa3
+distfiles="https://github.com/CleverRaven/Cataclysm-DDA/archive/${version}.tar.gz
+ https://github.com/catchorg/Catch2/releases/download/v2.13.10/catch.hpp"
+checksum="b0af9a9292929e17332edcea770bca9a91f1d08ea47726d78a47e09281a42fa3
+ 3725c0f0a75f376a5005dde31ead0feb8f7da7507644c201b814443de8355170"
+skip_extraction="catch.hpp"
+make_check=no # needs tap++.h
 
 build_options="tiles backtrace"
 build_options_default="tiles"
@@ -29,26 +33,37 @@ esac
 subpackages=""
 if [ "$build_option_tiles" ]; then
 	subpackages+=" Cataclysm-DDA-tiles"
-	post_configure() {
+fi
+subpackages+=" Cataclysm-DDA-data"
+
+post_extract() {
+	_srcdir="${XBPS_SRCDISTDIR}/${pkgname}-${version}"
+	cp ${_srcdir}/catch.hpp tests/catch/catch.hpp
+}
+
+post_configure() {
+	if [ "$build_option_tiles" ]; then
 		local cmake_builddir=build-tiles
+		local fprefix=$wrksrc/build-tiles/build
+		CFLAGS="${CFLAGS} -ffile-prefix-map=$fprefix=."
+		CXXFLAGS="${CXXFLAGS} -ffile-prefix-map=$fprefix=."
 		configure_args+=" -DTILES=ON -DSOUND=ON"
 		do_configure
-	}
+	fi
+}
 
-	post_build() {
+post_build() {
+	if [ "$build_option_tiles" ]; then
 		local cmake_builddir=build-tiles
 		do_build
-	}
+	fi
+}
 
-	post_install() {
+post_install() {
+	if [ "$build_option_tiles" ]; then
 		local cmake_builddir=build-tiles
 		do_install
-	}
-fi
-subpackages+=" Cataclysm-DDA-data"
-
-do_check() {
-	: #needs tap++.h
+	fi
 }
 
 Cataclysm-DDA-tiles_package() {

  parent reply	other threads:[~2022-12-03 17:32 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-03  7:31 [PR PATCH] [do not merge] " sgn
2022-12-03 10:25 ` [PR PATCH] [Updated] " sgn
2022-12-03 12:01 ` [PR PATCH] [Updated] [do not merge] cabbage: " sgn
2022-12-03 12:07 ` sgn
2022-12-03 17:32 ` sgn [this message]
2022-12-03 17:37 ` [PR PATCH] [Merged]: " sgn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221203173228.hzILbj6HA_Hnc126mO9tPFqpeUApBkURGf8Sru1d_Ko@z \
    --to=sgn@users.noreply.github.com \
    --cc=ml@inbox.vuxu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).