git: e979cc6c84ea - main - emulators/joytran: fix build by removing -Werror

From: Dmitry Marakasov <amdmi3_at_FreeBSD.org>
Date: Wed, 07 Sep 2022 15:01:17 UTC
The branch main has been updated by amdmi3:

URL: https://cgit.FreeBSD.org/ports/commit/?id=e979cc6c84ea64e213e48808f7a00b21431c45f9

commit e979cc6c84ea64e213e48808f7a00b21431c45f9
Author:     Dmitry Marakasov <amdmi3@FreeBSD.org>
AuthorDate: 2022-09-07 14:30:58 +0000
Commit:     Dmitry Marakasov <amdmi3@FreeBSD.org>
CommitDate: 2022-09-07 14:53:34 +0000

    emulators/joytran: fix build by removing -Werror
    
    While here, add -fcommon to a more suitable var (cflags instead of
    warning flags) and in a less obscure way (through patch instead of
    reinplace_cmd).
    
    Approved by:    portmgr blanket
---
 emulators/joytran/Makefile                   |  4 ----
 emulators/joytran/files/patch-CMakeLists.txt | 14 ++++++++++++++
 2 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/emulators/joytran/Makefile b/emulators/joytran/Makefile
index 1c3ee58e7e45..d28f112c6599 100644
--- a/emulators/joytran/Makefile
+++ b/emulators/joytran/Makefile
@@ -17,10 +17,6 @@ CMAKE_ARGS=	-DLOCALBASE:PATH="${LOCALBASE}"
 
 OPTIONS_DEFINE=	DOCS
 
-post-patch:
-	@${REINPLACE_CMD} -e '/WARNING_FLAGS/s,-pedantic,& -fcommon,' \
-		${WRKSRC}/CMakeLists.txt
-
 post-install:
 	@${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/${PORTNAME}
 
diff --git a/emulators/joytran/files/patch-CMakeLists.txt b/emulators/joytran/files/patch-CMakeLists.txt
new file mode 100644
index 000000000000..e3b8e55447ce
--- /dev/null
+++ b/emulators/joytran/files/patch-CMakeLists.txt
@@ -0,0 +1,14 @@
+--- CMakeLists.txt.orig	2013-05-02 04:53:08 UTC
++++ CMakeLists.txt
+@@ -119,9 +119,9 @@ IF( SDL_LIB STREQUAL "SDL2" )
+   SET(CMAKE_CPP_FLAGS "${CMAKE_CPP_FLAGS} -DWITH_SDL2")
+ ENDIF()
+ ## These work in both clang and gcc
+-SET(WARNING_FLAGS "-W -Wall -Werror -pedantic")
++SET(WARNING_FLAGS "-W -Wall -pedantic")
+ SET(CMAKE_C_FLAGS
+-  "${WARNING_FLAGS} -isystem${CMAKE_INCLUDE_PATH} ${CMAKE_CPP_FLAGS}")
++  "${WARNING_FLAGS} -isystem${CMAKE_INCLUDE_PATH} ${CMAKE_CPP_FLAGS} -fcommon")
+ SET(CMAKE_LD_FLAGS "-L${CMAKE_LIB_PATH} -lX11 -lXtst -l${SDL_LIB}")
+ SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${CMAKE_LD_FLAGS}")
+ SET(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${CMAKE_LD_FLAGS}")