summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorLawrence González2022-05-16 13:24:14 -0400
committerLawrence González2022-05-16 13:29:27 -0400
commitd5344cfb32e4accb6a53723daef32e01b1e9690f (patch)
tree6261b1dada0567934c1a3725f45b34dcbed983b7
parent645c0ba7706993c7bd754a1b84be338d5ccb3a69 (diff)
downloadaur-d5344cfb32e4accb6a53723daef32e01b1e9690f.tar.gz
Add patch to fix -Werror=format_security error
I have also added the CC-BY-SA 3.0 and CC0 licenses because they apply to some assets.
-rw-r--r--.SRCINFO8
-rw-r--r--PKGBUILD24
-rw-r--r--werror_format_security.patch22
3 files changed, 45 insertions, 9 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 548be5a32033..32b4c396f3d7 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,11 +1,13 @@
pkgbase = wyrmsun
pkgdesc = Real-time strategy game based on history, mythology and fiction
pkgver = 5.3.5
- pkgrel = 2
- url = http://andrettin.github.io/
+ pkgrel = 3
+ url = https://andrettin.github.io/
arch = i686
arch = x86_64
license = GPL2
+ license = CCPL:by-sa
+ license = custom:CC0
makedepends = boost
makedepends = cmake
makedepends = glu
@@ -19,7 +21,9 @@ pkgbase = wyrmsun
depends = tolua++
source = wyrmsun-5.3.5.tar.gz::https://github.com/Andrettin/Wyrmsun/archive/v5.3.5.tar.gz
source = wyrmgus-5.3.5.tar.gz::https://github.com/Andrettin/Wyrmgus/archive/v5.3.5.tar.gz
+ source = werror_format_security.patch
md5sums = f519b26169499e52517196b24813d2ac
md5sums = 73b2e1bf4e29c0663af23d025c104f7c
+ md5sums = 426efa2e8ee8b3ab46736d634599963c
pkgname = wyrmsun
diff --git a/PKGBUILD b/PKGBUILD
index 6bbcfb4a125a..e970703806dc 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -4,11 +4,11 @@
pkgname=wyrmsun
pkgver=5.3.5
-pkgrel=2
+pkgrel=3
pkgdesc="Real-time strategy game based on history, mythology and fiction"
arch=('i686' 'x86_64')
-url="http://andrettin.github.io/"
-license=('GPL2')
+url="https://andrettin.github.io/"
+license=('GPL2' 'CCPL:by-sa' 'custom:CC0')
depends=('hicolor-icon-theme'
'qt5-graphicaleffects'
'qt5-location'
@@ -19,9 +19,18 @@ depends=('hicolor-icon-theme'
'tolua++')
makedepends=('boost' 'cmake' 'glu')
source=("wyrmsun-${pkgver}.tar.gz::https://github.com/Andrettin/Wyrmsun/archive/v${pkgver}.tar.gz"
- "wyrmgus-${pkgver}.tar.gz::https://github.com/Andrettin/Wyrmgus/archive/v${pkgver}.tar.gz")
+ "wyrmgus-${pkgver}.tar.gz::https://github.com/Andrettin/Wyrmgus/archive/v${pkgver}.tar.gz"
+ 'werror_format_security.patch')
md5sums=('f519b26169499e52517196b24813d2ac'
- '73b2e1bf4e29c0663af23d025c104f7c')
+ '73b2e1bf4e29c0663af23d025c104f7c'
+ '426efa2e8ee8b3ab46736d634599963c')
+
+prepare() {
+ cd "${srcdir}/Wyrmgus-${pkgver}"
+ # This patch fixes the compilation error with the -Werror=format_security flag
+ # until a new version is released.
+ patch src/player/player.cpp "${srcdir}/werror_format_security.patch"
+}
build() {
cd "${srcdir}/Wyrmgus-${pkgver}"
@@ -29,8 +38,8 @@ build() {
-DCMAKE_BUILD_TYPE=None \
-DOpenGL_GL_PREFERENCE=GLVND \
-DWITH_GEOJSON=OFF \
- -DCMAKE_C_FLAGS="$CFLAGS -Wno-error=format-security -DNDEBUG" \
- -DCMAKE_CXX_FLAGS="$CXXFLAGS -Wno-error=format-security -DNDEBUG" \
+ -DCMAKE_C_FLAGS="$CFLAGS -DNDEBUG" \
+ -DCMAKE_CXX_FLAGS="$CXXFLAGS -DNDEBUG" \
-Wno-dev
cmake --build . --target wyrmgus_main
@@ -56,4 +65,5 @@ package() {
cd "${srcdir}/Wyrmsun-${pkgver}"
cmake --install . --prefix "${pkgdir}/usr/"
+ install -Dm644 cc0.txt "${pkgdir}/usr/share/licenses/${pkgname}/cc0.txt"
}
diff --git a/werror_format_security.patch b/werror_format_security.patch
new file mode 100644
index 000000000000..0f8537f2ed89
--- /dev/null
+++ b/werror_format_security.patch
@@ -0,0 +1,22 @@
+From 0e1f7b365aac401434a94198d6339fcc1f2c815b Mon Sep 17 00:00:00 2001
+From: Andrettin <6322423+Andrettin@users.noreply.github.com>
+Date: Fri, 13 May 2022 06:40:12 +0200
+Subject: [PATCH] Fixed warning in CPlayer::set_enemy_diplomatic_stance_with()
+
+---
+ src/player/player.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/player/player.cpp b/src/player/player.cpp
+index 56ae1b632..8c0768de7 100644
+--- a/src/player/player.cpp
++++ b/src/player/player.cpp
+@@ -5173,7 +5173,7 @@ void CPlayer::set_enemy_diplomatic_stance_with(CPlayer *player)
+ }
+ message += this->get_name() + " changed their diplomatic stance with us to enemy";
+
+- CPlayer::GetThisPlayer()->Notify(message.c_str());
++ CPlayer::GetThisPlayer()->notify(message);
+ } else if (this == CPlayer::GetThisPlayer()) {
+ std::string message = "We have changed our diplomatic stance with ";
+ if (player->uses_definite_article()) {