Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] [WIP] build-style/cmake: set CMAKE_BUILD_TYPE to None
@ 2021-03-14 13:19 sgn
  2021-03-15  1:07 ` [PR PATCH] [Updated] " sgn
                   ` (32 more replies)
  0 siblings, 33 replies; 34+ messages in thread
From: sgn @ 2021-03-14 13:19 UTC (permalink / raw)
  To: ml

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

There is a new pull request by sgn against master on the void-packages repository

https://github.com/sgn/void-packages cmake-build-type-to-None
https://github.com/void-linux/void-packages/pull/29459

[WIP] build-style/cmake: set CMAKE_BUILD_TYPE to None
- I'm going to build all packages with `build_style=cmake` and fix them one by one before merging this in.

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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-cmake-build-type-to-None-29459.patch --]
[-- Type: text/x-diff, Size: 877 bytes --]

From 29a1cf381722bad700d19a597ca60f20aec44b29 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, 14 Mar 2021 20:18:03 +0700
Subject: [PATCH] build-style/cmake: set CMAKE_BUILD_TYPE to None

---
 common/build-style/cmake.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/build-style/cmake.sh b/common/build-style/cmake.sh
index 5100a96dfd7b..9d1a1a7a1941 100644
--- a/common/build-style/cmake.sh
+++ b/common/build-style/cmake.sh
@@ -52,7 +52,7 @@ _EOF
 		cmake_args+=" -DCMAKE_TOOLCHAIN_FILE=cross_${XBPS_CROSS_TRIPLET}.cmake"
 	fi
 	cmake_args+=" -DCMAKE_INSTALL_PREFIX=/usr"
-	cmake_args+=" -DCMAKE_BUILD_TYPE=Release"
+	cmake_args+=" -DCMAKE_BUILD_TYPE=None"
 	cmake_args+=" -DCMAKE_INSTALL_LIBDIR=lib${XBPS_TARGET_WORDSIZE}"
 
 	if [[ $build_helper = *"qemu"* ]]; then

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PR PATCH] [Updated] [WIP] build-style/cmake: set CMAKE_BUILD_TYPE to None
  2021-03-14 13:19 [PR PATCH] [WIP] build-style/cmake: set CMAKE_BUILD_TYPE to None sgn
@ 2021-03-15  1:07 ` sgn
  2021-03-16 23:26 ` sgn
                   ` (31 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: sgn @ 2021-03-15  1:07 UTC (permalink / raw)
  To: ml

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

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

https://github.com/sgn/void-packages cmake-build-type-to-None
https://github.com/void-linux/void-packages/pull/29459

[WIP] build-style/cmake: set CMAKE_BUILD_TYPE to None
- I'm going to build all packages with `build_style=cmake` and fix them one by one before merging this in.

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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-cmake-build-type-to-None-29459.patch --]
[-- Type: text/x-diff, Size: 4159 bytes --]

From 29a1cf381722bad700d19a597ca60f20aec44b29 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, 14 Mar 2021 20:18:03 +0700
Subject: [PATCH 1/2] build-style/cmake: set CMAKE_BUILD_TYPE to None

---
 common/build-style/cmake.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/build-style/cmake.sh b/common/build-style/cmake.sh
index 5100a96dfd7b..9d1a1a7a1941 100644
--- a/common/build-style/cmake.sh
+++ b/common/build-style/cmake.sh
@@ -52,7 +52,7 @@ _EOF
 		cmake_args+=" -DCMAKE_TOOLCHAIN_FILE=cross_${XBPS_CROSS_TRIPLET}.cmake"
 	fi
 	cmake_args+=" -DCMAKE_INSTALL_PREFIX=/usr"
-	cmake_args+=" -DCMAKE_BUILD_TYPE=Release"
+	cmake_args+=" -DCMAKE_BUILD_TYPE=None"
 	cmake_args+=" -DCMAKE_INSTALL_LIBDIR=lib${XBPS_TARGET_WORDSIZE}"
 
 	if [[ $build_helper = *"qemu"* ]]; then

From 45ff98bf8c3eed44872d2ed318a7ab2e289b1aa0 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: Mon, 15 Mar 2021 08:07:16 +0700
Subject: [PATCH 2/2] amdvlk: allow CMAKE_BUILD_TYPE=None

---
 .../patches/cmake-build-type-none.patch       | 60 +++++++++++++++++++
 1 file changed, 60 insertions(+)
 create mode 100644 srcpkgs/amdvlk/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/amdvlk/patches/cmake-build-type-none.patch b/srcpkgs/amdvlk/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..7a629e58548e
--- /dev/null
+++ b/srcpkgs/amdvlk/patches/cmake-build-type-none.patch
@@ -0,0 +1,60 @@
+Index: llvm-project/llvm/CMakeLists.txt
+===================================================================
+--- llvm-project/llvm/CMakeLists.txt.orig
++++ llvm-project/llvm/CMakeLists.txt
+@@ -251,11 +251,6 @@ endif()
+ 
+ string(TOUPPER "${CMAKE_BUILD_TYPE}" uppercase_CMAKE_BUILD_TYPE)
+ 
+-if (CMAKE_BUILD_TYPE AND
+-    NOT uppercase_CMAKE_BUILD_TYPE MATCHES "^(DEBUG|RELEASE|RELWITHDEBINFO|MINSIZEREL)$")
+-  message(FATAL_ERROR "Invalid value for CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
+-endif()
+-
+ set(LLVM_LIBDIR_SUFFIX "" CACHE STRING "Define suffix of library directory name (32/64)" )
+ 
+ set(LLVM_TOOLS_INSTALL_DIR "bin" CACHE STRING "Path for binary subdirectory (defaults to 'bin')")
+Index: pal/cmake/Modules/AmdCmakeHelper.cmake
+===================================================================
+--- pal/cmake/Modules/AmdCmakeHelper.cmake.orig
++++ pal/cmake/Modules/AmdCmakeHelper.cmake
+@@ -37,11 +37,6 @@ if (CMAKE_CONFIGURATION_TYPES)
+ else()
+     string(TOUPPER "${CMAKE_BUILD_TYPE}" capital_CMAKE_BUILD_TYPE)
+ 
+-    if (CMAKE_BUILD_TYPE AND
+-        NOT capital_CMAKE_BUILD_TYPE MATCHES "^(DEBUG|RELEASE|RELWITHDEBINFO|MINSIZEREL)$")
+-        message(FATAL_ERROR "Invalid value for CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
+-    endif()
+-
+     if(capital_CMAKE_BUILD_TYPE STREQUAL "DEBUG")
+         set(CMAKE_BUILD_TYPE_DEBUG ON)
+         set(CMAKE_BUILD_TYPE_RELEASE OFF)
+Index: xgl/CMakeLists.txt
+===================================================================
+--- xgl/CMakeLists.txt.orig
++++ xgl/CMakeLists.txt
+@@ -181,11 +181,6 @@ if (CMAKE_CONFIGURATION_TYPES)
+ else()
+     string(TOUPPER "${CMAKE_BUILD_TYPE}" capital_CMAKE_BUILD_TYPE)
+ 
+-    if (CMAKE_BUILD_TYPE AND
+-        NOT capital_CMAKE_BUILD_TYPE MATCHES "^(DEBUG|RELEASE|RELWITHDEBINFO|MINSIZEREL)$")
+-        message(FATAL_ERROR "Invalid value for CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
+-    endif()
+-
+     if(capital_CMAKE_BUILD_TYPE STREQUAL "DEBUG")
+         set(CMAKE_BUILD_TYPE_DEBUG ON)
+         set(CMAKE_BUILD_TYPE_RELEASE OFF)
+Index: xgl/icd/CMakeLists.txt
+===================================================================
+--- xgl/icd/CMakeLists.txt.orig
++++ xgl/icd/CMakeLists.txt
+@@ -84,7 +84,6 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Cl
+     endif()
+ 
+     if(CMAKE_BUILD_TYPE_RELEASE)
+-        target_compile_options(xgl PRIVATE -O3)
+         if(XGL_ENABLE_LTO)
+             if(${CMAKE_CXX_COMPILER_ID} MATCHES "GNU")
+                 execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION)

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PR PATCH] [Updated] [WIP] build-style/cmake: set CMAKE_BUILD_TYPE to None
  2021-03-14 13:19 [PR PATCH] [WIP] build-style/cmake: set CMAKE_BUILD_TYPE to None sgn
  2021-03-15  1:07 ` [PR PATCH] [Updated] " sgn
@ 2021-03-16 23:26 ` sgn
  2021-03-17 15:32 ` sgn
                   ` (30 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: sgn @ 2021-03-16 23:26 UTC (permalink / raw)
  To: ml

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

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

https://github.com/sgn/void-packages cmake-build-type-to-None
https://github.com/void-linux/void-packages/pull/29459

[WIP] build-style/cmake: set CMAKE_BUILD_TYPE to None
- I'm going to build all packages with `build_style=cmake` and fix them one by one before merging this in.

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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-cmake-build-type-to-None-29459.patch --]
[-- Type: text/x-diff, Size: 5674 bytes --]

From 277c23f6efe6fc3a83053fe13148776326d61c9b 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, 14 Mar 2021 20:18:03 +0700
Subject: [PATCH 1/3] build-style/cmake: set CMAKE_BUILD_TYPE to None

---
 common/build-style/cmake.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/build-style/cmake.sh b/common/build-style/cmake.sh
index 5100a96dfd7b..9d1a1a7a1941 100644
--- a/common/build-style/cmake.sh
+++ b/common/build-style/cmake.sh
@@ -52,7 +52,7 @@ _EOF
 		cmake_args+=" -DCMAKE_TOOLCHAIN_FILE=cross_${XBPS_CROSS_TRIPLET}.cmake"
 	fi
 	cmake_args+=" -DCMAKE_INSTALL_PREFIX=/usr"
-	cmake_args+=" -DCMAKE_BUILD_TYPE=Release"
+	cmake_args+=" -DCMAKE_BUILD_TYPE=None"
 	cmake_args+=" -DCMAKE_INSTALL_LIBDIR=lib${XBPS_TARGET_WORDSIZE}"
 
 	if [[ $build_helper = *"qemu"* ]]; then

From ad2d2b63694f6ca95931612cacf23fbfc62e245f 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: Mon, 15 Mar 2021 08:07:16 +0700
Subject: [PATCH 2/3] amdvlk: allow CMAKE_BUILD_TYPE=None

---
 .../patches/cmake-build-type-none.patch       | 60 +++++++++++++++++++
 1 file changed, 60 insertions(+)
 create mode 100644 srcpkgs/amdvlk/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/amdvlk/patches/cmake-build-type-none.patch b/srcpkgs/amdvlk/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..7a629e58548e
--- /dev/null
+++ b/srcpkgs/amdvlk/patches/cmake-build-type-none.patch
@@ -0,0 +1,60 @@
+Index: llvm-project/llvm/CMakeLists.txt
+===================================================================
+--- llvm-project/llvm/CMakeLists.txt.orig
++++ llvm-project/llvm/CMakeLists.txt
+@@ -251,11 +251,6 @@ endif()
+ 
+ string(TOUPPER "${CMAKE_BUILD_TYPE}" uppercase_CMAKE_BUILD_TYPE)
+ 
+-if (CMAKE_BUILD_TYPE AND
+-    NOT uppercase_CMAKE_BUILD_TYPE MATCHES "^(DEBUG|RELEASE|RELWITHDEBINFO|MINSIZEREL)$")
+-  message(FATAL_ERROR "Invalid value for CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
+-endif()
+-
+ set(LLVM_LIBDIR_SUFFIX "" CACHE STRING "Define suffix of library directory name (32/64)" )
+ 
+ set(LLVM_TOOLS_INSTALL_DIR "bin" CACHE STRING "Path for binary subdirectory (defaults to 'bin')")
+Index: pal/cmake/Modules/AmdCmakeHelper.cmake
+===================================================================
+--- pal/cmake/Modules/AmdCmakeHelper.cmake.orig
++++ pal/cmake/Modules/AmdCmakeHelper.cmake
+@@ -37,11 +37,6 @@ if (CMAKE_CONFIGURATION_TYPES)
+ else()
+     string(TOUPPER "${CMAKE_BUILD_TYPE}" capital_CMAKE_BUILD_TYPE)
+ 
+-    if (CMAKE_BUILD_TYPE AND
+-        NOT capital_CMAKE_BUILD_TYPE MATCHES "^(DEBUG|RELEASE|RELWITHDEBINFO|MINSIZEREL)$")
+-        message(FATAL_ERROR "Invalid value for CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
+-    endif()
+-
+     if(capital_CMAKE_BUILD_TYPE STREQUAL "DEBUG")
+         set(CMAKE_BUILD_TYPE_DEBUG ON)
+         set(CMAKE_BUILD_TYPE_RELEASE OFF)
+Index: xgl/CMakeLists.txt
+===================================================================
+--- xgl/CMakeLists.txt.orig
++++ xgl/CMakeLists.txt
+@@ -181,11 +181,6 @@ if (CMAKE_CONFIGURATION_TYPES)
+ else()
+     string(TOUPPER "${CMAKE_BUILD_TYPE}" capital_CMAKE_BUILD_TYPE)
+ 
+-    if (CMAKE_BUILD_TYPE AND
+-        NOT capital_CMAKE_BUILD_TYPE MATCHES "^(DEBUG|RELEASE|RELWITHDEBINFO|MINSIZEREL)$")
+-        message(FATAL_ERROR "Invalid value for CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
+-    endif()
+-
+     if(capital_CMAKE_BUILD_TYPE STREQUAL "DEBUG")
+         set(CMAKE_BUILD_TYPE_DEBUG ON)
+         set(CMAKE_BUILD_TYPE_RELEASE OFF)
+Index: xgl/icd/CMakeLists.txt
+===================================================================
+--- xgl/icd/CMakeLists.txt.orig
++++ xgl/icd/CMakeLists.txt
+@@ -84,7 +84,6 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Cl
+     endif()
+ 
+     if(CMAKE_BUILD_TYPE_RELEASE)
+-        target_compile_options(xgl PRIVATE -O3)
+         if(XGL_ENABLE_LTO)
+             if(${CMAKE_CXX_COMPILER_ID} MATCHES "GNU")
+                 execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION)

From 6bbe5ce1771a10e9b2e80a6035cf47134897f6b7 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: Wed, 17 Mar 2021 06:24:04 +0700
Subject: [PATCH 3/3] eigen*: set CMAKE_BUILD_TYPE to Release

We're going to set default CMAKE_BUILD_TYPE to None soon. Those packages
are header only libraries, no need to waste time on patching.
---
 srcpkgs/eigen/template    | 2 ++
 srcpkgs/eigen3.2/template | 1 +
 2 files changed, 3 insertions(+)

diff --git a/srcpkgs/eigen/template b/srcpkgs/eigen/template
index ee825e95f273..28e8d458b639 100644
--- a/srcpkgs/eigen/template
+++ b/srcpkgs/eigen/template
@@ -3,6 +3,8 @@ pkgname=eigen
 version=3.3.9
 revision=1
 build_style=cmake
+# This is header only library, don't waste time to patch
+configure_args="-DCMAKE_BUILD_TYPE=Release"
 short_desc="C++ template library for linear algebra (version 3.x)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MPL-2.0, GPL-3.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
diff --git a/srcpkgs/eigen3.2/template b/srcpkgs/eigen3.2/template
index 5715fc1b3a19..7b710534b5e5 100644
--- a/srcpkgs/eigen3.2/template
+++ b/srcpkgs/eigen3.2/template
@@ -4,6 +4,7 @@ version=3.2.10
 revision=3
 wrksrc="eigen-${version}"
 build_style=cmake
+configure_args="-DCMAKE_BUILD_TYPE=Release"
 short_desc="C++ template library for linear algebra (version 3.x)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MPL-2.0, GPL-3.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PR PATCH] [Updated] [WIP] build-style/cmake: set CMAKE_BUILD_TYPE to None
  2021-03-14 13:19 [PR PATCH] [WIP] build-style/cmake: set CMAKE_BUILD_TYPE to None sgn
  2021-03-15  1:07 ` [PR PATCH] [Updated] " sgn
  2021-03-16 23:26 ` sgn
@ 2021-03-17 15:32 ` sgn
  2021-03-21  9:45 ` sgn
                   ` (29 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: sgn @ 2021-03-17 15:32 UTC (permalink / raw)
  To: ml

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

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

https://github.com/sgn/void-packages cmake-build-type-to-None
https://github.com/void-linux/void-packages/pull/29459

[WIP] build-style/cmake: set CMAKE_BUILD_TYPE to None
- I'm going to build all packages with `build_style=cmake` and fix them one by one before merging this in.

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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-cmake-build-type-to-None-29459.patch --]
[-- Type: text/x-diff, Size: 13860 bytes --]

From 38577478b61f8cf8e7d300578df40151fcd04374 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, 14 Mar 2021 20:18:03 +0700
Subject: [PATCH 1/7] build-style/cmake: set CMAKE_BUILD_TYPE to None

---
 common/build-style/cmake.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/build-style/cmake.sh b/common/build-style/cmake.sh
index 5100a96dfd7b..9d1a1a7a1941 100644
--- a/common/build-style/cmake.sh
+++ b/common/build-style/cmake.sh
@@ -52,7 +52,7 @@ _EOF
 		cmake_args+=" -DCMAKE_TOOLCHAIN_FILE=cross_${XBPS_CROSS_TRIPLET}.cmake"
 	fi
 	cmake_args+=" -DCMAKE_INSTALL_PREFIX=/usr"
-	cmake_args+=" -DCMAKE_BUILD_TYPE=Release"
+	cmake_args+=" -DCMAKE_BUILD_TYPE=None"
 	cmake_args+=" -DCMAKE_INSTALL_LIBDIR=lib${XBPS_TARGET_WORDSIZE}"
 
 	if [[ $build_helper = *"qemu"* ]]; then

From a3d53690f5213acda1647a4ca80b15b9ee3313a2 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: Mon, 15 Mar 2021 08:07:16 +0700
Subject: [PATCH 2/7] amdvlk: allow CMAKE_BUILD_TYPE=None

---
 .../patches/cmake-build-type-none.patch       | 60 +++++++++++++++++++
 1 file changed, 60 insertions(+)
 create mode 100644 srcpkgs/amdvlk/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/amdvlk/patches/cmake-build-type-none.patch b/srcpkgs/amdvlk/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..7a629e58548e
--- /dev/null
+++ b/srcpkgs/amdvlk/patches/cmake-build-type-none.patch
@@ -0,0 +1,60 @@
+Index: llvm-project/llvm/CMakeLists.txt
+===================================================================
+--- llvm-project/llvm/CMakeLists.txt.orig
++++ llvm-project/llvm/CMakeLists.txt
+@@ -251,11 +251,6 @@ endif()
+ 
+ string(TOUPPER "${CMAKE_BUILD_TYPE}" uppercase_CMAKE_BUILD_TYPE)
+ 
+-if (CMAKE_BUILD_TYPE AND
+-    NOT uppercase_CMAKE_BUILD_TYPE MATCHES "^(DEBUG|RELEASE|RELWITHDEBINFO|MINSIZEREL)$")
+-  message(FATAL_ERROR "Invalid value for CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
+-endif()
+-
+ set(LLVM_LIBDIR_SUFFIX "" CACHE STRING "Define suffix of library directory name (32/64)" )
+ 
+ set(LLVM_TOOLS_INSTALL_DIR "bin" CACHE STRING "Path for binary subdirectory (defaults to 'bin')")
+Index: pal/cmake/Modules/AmdCmakeHelper.cmake
+===================================================================
+--- pal/cmake/Modules/AmdCmakeHelper.cmake.orig
++++ pal/cmake/Modules/AmdCmakeHelper.cmake
+@@ -37,11 +37,6 @@ if (CMAKE_CONFIGURATION_TYPES)
+ else()
+     string(TOUPPER "${CMAKE_BUILD_TYPE}" capital_CMAKE_BUILD_TYPE)
+ 
+-    if (CMAKE_BUILD_TYPE AND
+-        NOT capital_CMAKE_BUILD_TYPE MATCHES "^(DEBUG|RELEASE|RELWITHDEBINFO|MINSIZEREL)$")
+-        message(FATAL_ERROR "Invalid value for CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
+-    endif()
+-
+     if(capital_CMAKE_BUILD_TYPE STREQUAL "DEBUG")
+         set(CMAKE_BUILD_TYPE_DEBUG ON)
+         set(CMAKE_BUILD_TYPE_RELEASE OFF)
+Index: xgl/CMakeLists.txt
+===================================================================
+--- xgl/CMakeLists.txt.orig
++++ xgl/CMakeLists.txt
+@@ -181,11 +181,6 @@ if (CMAKE_CONFIGURATION_TYPES)
+ else()
+     string(TOUPPER "${CMAKE_BUILD_TYPE}" capital_CMAKE_BUILD_TYPE)
+ 
+-    if (CMAKE_BUILD_TYPE AND
+-        NOT capital_CMAKE_BUILD_TYPE MATCHES "^(DEBUG|RELEASE|RELWITHDEBINFO|MINSIZEREL)$")
+-        message(FATAL_ERROR "Invalid value for CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
+-    endif()
+-
+     if(capital_CMAKE_BUILD_TYPE STREQUAL "DEBUG")
+         set(CMAKE_BUILD_TYPE_DEBUG ON)
+         set(CMAKE_BUILD_TYPE_RELEASE OFF)
+Index: xgl/icd/CMakeLists.txt
+===================================================================
+--- xgl/icd/CMakeLists.txt.orig
++++ xgl/icd/CMakeLists.txt
+@@ -84,7 +84,6 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Cl
+     endif()
+ 
+     if(CMAKE_BUILD_TYPE_RELEASE)
+-        target_compile_options(xgl PRIVATE -O3)
+         if(XGL_ENABLE_LTO)
+             if(${CMAKE_CXX_COMPILER_ID} MATCHES "GNU")
+                 execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION)

From 3c2548422548a672a02786f33e430b9a54a95a24 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: Wed, 17 Mar 2021 06:24:04 +0700
Subject: [PATCH 3/7] eigen*: set CMAKE_BUILD_TYPE to Release

We're going to set default CMAKE_BUILD_TYPE to None soon. Those packages
are header only libraries, no need to waste time on patching.
---
 srcpkgs/eigen/template    | 2 ++
 srcpkgs/eigen3.2/template | 1 +
 2 files changed, 3 insertions(+)

diff --git a/srcpkgs/eigen/template b/srcpkgs/eigen/template
index ee825e95f273..28e8d458b639 100644
--- a/srcpkgs/eigen/template
+++ b/srcpkgs/eigen/template
@@ -3,6 +3,8 @@ pkgname=eigen
 version=3.3.9
 revision=1
 build_style=cmake
+# This is header only library, don't waste time to patch
+configure_args="-DCMAKE_BUILD_TYPE=Release"
 short_desc="C++ template library for linear algebra (version 3.x)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MPL-2.0, GPL-3.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
diff --git a/srcpkgs/eigen3.2/template b/srcpkgs/eigen3.2/template
index 5715fc1b3a19..7b710534b5e5 100644
--- a/srcpkgs/eigen3.2/template
+++ b/srcpkgs/eigen3.2/template
@@ -4,6 +4,7 @@ version=3.2.10
 revision=3
 wrksrc="eigen-${version}"
 build_style=cmake
+configure_args="-DCMAKE_BUILD_TYPE=Release"
 short_desc="C++ template library for linear algebra (version 3.x)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MPL-2.0, GPL-3.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"

From a884a100aaa65e4edec63b535e7cbb219ea32f8b 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: Wed, 17 Mar 2021 07:04:48 +0700
Subject: [PATCH 4/7] embree: don't ignore CXXFLAGS, fix build with ispc 1.13+

---
 .../embree/patches/uintNN-is-part-of-ispc-1.13.patch | 12 ++++++++++++
 srcpkgs/embree/template                              |  6 ++----
 2 files changed, 14 insertions(+), 4 deletions(-)
 create mode 100644 srcpkgs/embree/patches/uintNN-is-part-of-ispc-1.13.patch

diff --git a/srcpkgs/embree/patches/uintNN-is-part-of-ispc-1.13.patch b/srcpkgs/embree/patches/uintNN-is-part-of-ispc-1.13.patch
new file mode 100644
index 000000000000..5d0b02f3b2e5
--- /dev/null
+++ b/srcpkgs/embree/patches/uintNN-is-part-of-ispc-1.13.patch
@@ -0,0 +1,12 @@
+Index: embree-2.17.7/tutorials/common/common.isph
+===================================================================
+--- embree-2.17.7.orig/tutorials/common/common.isph
++++ embree-2.17.7/tutorials/common/common.isph
+@@ -16,7 +16,3 @@
+ 
+ #pragma once
+ 
+-typedef unsigned int64 uint64;
+-typedef unsigned int32 uint32;
+-typedef unsigned int16 uint16;
+-typedef unsigned int8  uint8;
diff --git a/srcpkgs/embree/template b/srcpkgs/embree/template
index 0bc72f46b6d8..849ec3c26c1d 100644
--- a/srcpkgs/embree/template
+++ b/srcpkgs/embree/template
@@ -4,6 +4,7 @@ version=2.17.7
 revision=2
 archs="x86_64"
 build_style=cmake
+configure_args="-DTBB_ROOT=/usr -DEMBREE_IGNORE_CMAKE_CXX_FLAGS=OFF"
 hostmakedepends="ispc"
 makedepends="libfreeglut-devel libXmu-devel tbb-devel MesaLib-devel libpng-devel
  libopenexr-devel libjpeg-turbo-devel libmagick-devel"
@@ -13,10 +14,7 @@ license="Apache-2.0"
 homepage="https://embree.github.io/"
 distfiles="https://github.com/$pkgname/$pkgname/archive/v$version.tar.gz"
 checksum=c0694f287fa1fbb382aba3a895702e248d92f7e89c0e5f64aefee965482ec04c
-
-nopie=y
-
-configure_args="-DTBB_ROOT=/usr -DENABLE_TUTORIALS=OFF"
+patch_args=-Np1
 
 embree-devel_package() {
 	depends="${sourcepkg}>=${version}_${revision}"

From da785dda6fbfcc5a0b48a9d1e8a9e3d5600e98e9 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: Wed, 17 Mar 2021 07:35:19 +0700
Subject: [PATCH 5/7] ettercap: remove libressl patch, CMAKE_BUILD_TYPE=None

---
 .../patches/allow-build-type-none.patch       | 24 ++++++++++++++
 srcpkgs/ettercap/patches/libressl.patch       | 31 -------------------
 srcpkgs/ettercap/template                     |  9 ++++--
 3 files changed, 31 insertions(+), 33 deletions(-)
 create mode 100644 srcpkgs/ettercap/patches/allow-build-type-none.patch
 delete mode 100644 srcpkgs/ettercap/patches/libressl.patch

diff --git a/srcpkgs/ettercap/patches/allow-build-type-none.patch b/srcpkgs/ettercap/patches/allow-build-type-none.patch
new file mode 100644
index 000000000000..324d75086b05
--- /dev/null
+++ b/srcpkgs/ettercap/patches/allow-build-type-none.patch
@@ -0,0 +1,24 @@
+Index: ettercap-0.8.3.1/CMakeLists.txt
+===================================================================
+--- ettercap-0.8.3.1.orig/CMakeLists.txt
++++ ettercap-0.8.3.1/CMakeLists.txt
+@@ -22,19 +22,6 @@ option(LIBRARY_BUILD "Build for libetter
+ option(INSTALL_DESKTOP "Install ettercap desktop files" ON)
+ 
+ 
+-set(VALID_BUILD_TYPES Debug Release RelWithDebInfo)
+-
+-if(NOT CMAKE_BUILD_TYPE)
+-  # Default to using "Release" as our build type.
+-  set(CMAKE_BUILD_TYPE "Release" CACHE STRING
+-    "Choose the type of build, options are: ${VALID_BUILD_TYPES}." FORCE)
+-endif()
+-list(FIND VALID_BUILD_TYPES ${CMAKE_BUILD_TYPE} contains_valid)
+-if(contains_valid EQUAL -1)
+-  message(FATAL_ERROR "Unknown CMAKE_BUILD_TYPE: '${CMAKE_BUILD_TYPE}'. Valid options are: ${VALID_BUILD_TYPES}")
+-endif()
+-unset(contains_valid)
+-
+ include(CMakeDependentOption)
+ 
+ # If SYSTEM_LIBS is set to off, then all SYSTEM_* options will be
diff --git a/srcpkgs/ettercap/patches/libressl.patch b/srcpkgs/ettercap/patches/libressl.patch
deleted file mode 100644
index 15e0d3c1c9e7..000000000000
--- a/srcpkgs/ettercap/patches/libressl.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From b2f7634c9dbc0ef68640f0571787d92300e9f9f9 Mon Sep 17 00:00:00 2001
-From: Stefan Strogin <stefan@steils.org>
-Date: Sat, 15 Aug 2020 07:18:31 +0300
-Subject: [PATCH] ec_sslwrap: fix compilation with LibreSSL
-
-Disable taking over SNI extension from ClientHello and SSL configuration
-operations until LibreSSL supports the required API.
-
-Fixes: https://github.com/Ettercap/ettercap/issues/1068
----
- src/ec_sslwrap.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git src/ec_sslwrap.c src/ec_sslwrap.c
-index b9f26a142..1e4c24fc1 100644
---- src/ec_sslwrap.c
-+++ src/ec_sslwrap.c
-@@ -71,11 +71,11 @@
- #define TLS_server_method SSLv23_server_method
- #endif
- 
--#if (OPENSSL_VERSION_NUMBER >= 0x10100000L)
-+#if (OPENSSL_VERSION_NUMBER >= 0x10100000L) && !defined(LIBRESSL_VERSION_NUMBER)
- #define HAVE_OPENSSL_1_1_0
- #endif
- 
--#if (OPENSSL_VERSION_NUMBER >= 0x10101000L)
-+#if (OPENSSL_VERSION_NUMBER >= 0x10101000L) && !defined(LIBRESSL_VERSION_NUMBER)
- #define HAVE_OPENSSL_1_1_1
- #endif
- 
diff --git a/srcpkgs/ettercap/template b/srcpkgs/ettercap/template
index 7fe4c340a079..611b4e9aded7 100644
--- a/srcpkgs/ettercap/template
+++ b/srcpkgs/ettercap/template
@@ -3,8 +3,8 @@ pkgname=ettercap
 version=0.8.3.1
 revision=2
 build_style=cmake
-configure_args="-DENABLE_GTK=OFF"
-hostmakedepends="flex"
+configure_args="-DENABLE_GTK=OFF -DBUNDLED_LIBS=OFF"
+hostmakedepends="flex pkg-config"
 makedepends="geoip-devel ncurses-devel openssl-devel libcurl-devel
  libltdl-devel libnet-devel libpcap-devel pcre-devel"
 conf_files="/etc/${pkgname}/etter.conf"
@@ -15,5 +15,10 @@ homepage="http://ettercap.github.com/ettercap/"
 distfiles="https://github.com/Ettercap/ettercap/archive/v${version}.tar.gz"
 checksum=d0c3ef88dfc284b61d3d5b64d946c1160fd04276b448519c1ae4438a9cdffaf3
 lib32disabled=yes
+patch_args=-Np1
 
 CFLAGS="-fcommon"
+
+post_extract() {
+	rm -rf bundled_deps
+}

From 6111ce52d7b5b9bb3e245823a52f7a44460af11a 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: Wed, 17 Mar 2021 08:27:10 +0700
Subject: [PATCH 6/7] injeqt: disable coverage

---
 srcpkgs/injeqt/template | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/injeqt/template b/srcpkgs/injeqt/template
index 1e5777fc0f18..78eba09a0249 100644
--- a/srcpkgs/injeqt/template
+++ b/srcpkgs/injeqt/template
@@ -3,7 +3,8 @@ pkgname=injeqt
 version=1.2.0
 revision=2
 build_style=cmake
-hostmakedepends="pkg-config"
+configure_args="-DDISABLE_COVERAGE=ON"
+hostmakedepends="pkg-config qt5-qmake qt5-host-tools"
 makedepends="qt5-devel"
 short_desc="Dependency injection framework for Qt"
 maintainer="Jürgen Buchmüller <pullmoll@t-online.de>"
@@ -12,9 +13,6 @@ homepage="https://github.com/vogel/injeqt/"
 distfiles="https://github.com/vogel/${pkgname}/archive/${version}.tar.gz>${pkgname}-${version}.tar.gz"
 checksum=77540cedb0b26affe993dd18124d796059e34c80a51d9ae6433fdff1860db135
 
-if [ -n "$CROSS_BUILD" ]; then
-	hostmakedepends+=" qt5-host-tools qt5-devel"
-fi
 CXXFLAGS="-fno-lifetime-dse -Wno-error=cast-align"
 
 injeqt-devel_package() {

From a3a2d1f3208478b2a2a21f246e16abd7aeeba130 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: Wed, 17 Mar 2021 22:26:37 +0700
Subject: [PATCH 7/7] kindd: build with CMAKE_BUILD_TYPE=None

---
 srcpkgs/kindd/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/kindd/template b/srcpkgs/kindd/template
index e634b0f69bf6..4416041de58c 100644
--- a/srcpkgs/kindd/template
+++ b/srcpkgs/kindd/template
@@ -15,7 +15,7 @@ distfiles="${homepage}/archive/${version}.tar.gz"
 checksum=e596f1b1577ff3e83a779e6181252ae2f09731f513d17dd6b95cbc2cf204654f
 
 do_install() {
-	vbin release/kindd
+	vbin build/core/kindd
 	vinstall assets/appconf/kindd.svg 644 usr/share/pixmaps
 	vinstall assets/appconf/kindd.desktop 644 usr/share/applications
 }

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PR PATCH] [Updated] [WIP] build-style/cmake: set CMAKE_BUILD_TYPE to None
  2021-03-14 13:19 [PR PATCH] [WIP] build-style/cmake: set CMAKE_BUILD_TYPE to None sgn
                   ` (2 preceding siblings ...)
  2021-03-17 15:32 ` sgn
@ 2021-03-21  9:45 ` sgn
  2021-03-21  9:48 ` sgn
                   ` (28 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: sgn @ 2021-03-21  9:45 UTC (permalink / raw)
  To: ml

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

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

https://github.com/sgn/void-packages cmake-build-type-to-None
https://github.com/void-linux/void-packages/pull/29459

[WIP] build-style/cmake: set CMAKE_BUILD_TYPE to None
- I'm going to build all packages with `build_style=cmake` and fix them one by one before merging this in.

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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-cmake-build-type-to-None-29459.patch --]
[-- Type: text/x-diff, Size: 46679 bytes --]

From e4ed239dc955d450e286c66d7079aaee659358c2 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, 14 Mar 2021 20:18:03 +0700
Subject: [PATCH 01/17] build-style/cmake: set CMAKE_BUILD_TYPE to None

---
 common/build-style/cmake.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/build-style/cmake.sh b/common/build-style/cmake.sh
index 5100a96dfd7b..9d1a1a7a1941 100644
--- a/common/build-style/cmake.sh
+++ b/common/build-style/cmake.sh
@@ -52,7 +52,7 @@ _EOF
 		cmake_args+=" -DCMAKE_TOOLCHAIN_FILE=cross_${XBPS_CROSS_TRIPLET}.cmake"
 	fi
 	cmake_args+=" -DCMAKE_INSTALL_PREFIX=/usr"
-	cmake_args+=" -DCMAKE_BUILD_TYPE=Release"
+	cmake_args+=" -DCMAKE_BUILD_TYPE=None"
 	cmake_args+=" -DCMAKE_INSTALL_LIBDIR=lib${XBPS_TARGET_WORDSIZE}"
 
 	if [[ $build_helper = *"qemu"* ]]; then

From 5f97403628e454d684e767e4f9d786a5bd6b301c 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: Mon, 15 Mar 2021 08:07:16 +0700
Subject: [PATCH 02/17] amdvlk: allow CMAKE_BUILD_TYPE=None

---
 .../patches/cmake-build-type-none.patch       | 60 +++++++++++++++++++
 1 file changed, 60 insertions(+)
 create mode 100644 srcpkgs/amdvlk/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/amdvlk/patches/cmake-build-type-none.patch b/srcpkgs/amdvlk/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..7a629e58548e
--- /dev/null
+++ b/srcpkgs/amdvlk/patches/cmake-build-type-none.patch
@@ -0,0 +1,60 @@
+Index: llvm-project/llvm/CMakeLists.txt
+===================================================================
+--- llvm-project/llvm/CMakeLists.txt.orig
++++ llvm-project/llvm/CMakeLists.txt
+@@ -251,11 +251,6 @@ endif()
+ 
+ string(TOUPPER "${CMAKE_BUILD_TYPE}" uppercase_CMAKE_BUILD_TYPE)
+ 
+-if (CMAKE_BUILD_TYPE AND
+-    NOT uppercase_CMAKE_BUILD_TYPE MATCHES "^(DEBUG|RELEASE|RELWITHDEBINFO|MINSIZEREL)$")
+-  message(FATAL_ERROR "Invalid value for CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
+-endif()
+-
+ set(LLVM_LIBDIR_SUFFIX "" CACHE STRING "Define suffix of library directory name (32/64)" )
+ 
+ set(LLVM_TOOLS_INSTALL_DIR "bin" CACHE STRING "Path for binary subdirectory (defaults to 'bin')")
+Index: pal/cmake/Modules/AmdCmakeHelper.cmake
+===================================================================
+--- pal/cmake/Modules/AmdCmakeHelper.cmake.orig
++++ pal/cmake/Modules/AmdCmakeHelper.cmake
+@@ -37,11 +37,6 @@ if (CMAKE_CONFIGURATION_TYPES)
+ else()
+     string(TOUPPER "${CMAKE_BUILD_TYPE}" capital_CMAKE_BUILD_TYPE)
+ 
+-    if (CMAKE_BUILD_TYPE AND
+-        NOT capital_CMAKE_BUILD_TYPE MATCHES "^(DEBUG|RELEASE|RELWITHDEBINFO|MINSIZEREL)$")
+-        message(FATAL_ERROR "Invalid value for CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
+-    endif()
+-
+     if(capital_CMAKE_BUILD_TYPE STREQUAL "DEBUG")
+         set(CMAKE_BUILD_TYPE_DEBUG ON)
+         set(CMAKE_BUILD_TYPE_RELEASE OFF)
+Index: xgl/CMakeLists.txt
+===================================================================
+--- xgl/CMakeLists.txt.orig
++++ xgl/CMakeLists.txt
+@@ -181,11 +181,6 @@ if (CMAKE_CONFIGURATION_TYPES)
+ else()
+     string(TOUPPER "${CMAKE_BUILD_TYPE}" capital_CMAKE_BUILD_TYPE)
+ 
+-    if (CMAKE_BUILD_TYPE AND
+-        NOT capital_CMAKE_BUILD_TYPE MATCHES "^(DEBUG|RELEASE|RELWITHDEBINFO|MINSIZEREL)$")
+-        message(FATAL_ERROR "Invalid value for CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
+-    endif()
+-
+     if(capital_CMAKE_BUILD_TYPE STREQUAL "DEBUG")
+         set(CMAKE_BUILD_TYPE_DEBUG ON)
+         set(CMAKE_BUILD_TYPE_RELEASE OFF)
+Index: xgl/icd/CMakeLists.txt
+===================================================================
+--- xgl/icd/CMakeLists.txt.orig
++++ xgl/icd/CMakeLists.txt
+@@ -84,7 +84,6 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Cl
+     endif()
+ 
+     if(CMAKE_BUILD_TYPE_RELEASE)
+-        target_compile_options(xgl PRIVATE -O3)
+         if(XGL_ENABLE_LTO)
+             if(${CMAKE_CXX_COMPILER_ID} MATCHES "GNU")
+                 execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION)

From 9eff39e4f467730bc896176c6280244e16a917ad 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: Wed, 17 Mar 2021 06:24:04 +0700
Subject: [PATCH 03/17] eigen*: set CMAKE_BUILD_TYPE to Release

We're going to set default CMAKE_BUILD_TYPE to None soon. Those packages
are header only libraries, no need to waste time on patching.
---
 srcpkgs/eigen/template    | 2 ++
 srcpkgs/eigen3.2/template | 1 +
 2 files changed, 3 insertions(+)

diff --git a/srcpkgs/eigen/template b/srcpkgs/eigen/template
index ee825e95f273..28e8d458b639 100644
--- a/srcpkgs/eigen/template
+++ b/srcpkgs/eigen/template
@@ -3,6 +3,8 @@ pkgname=eigen
 version=3.3.9
 revision=1
 build_style=cmake
+# This is header only library, don't waste time to patch
+configure_args="-DCMAKE_BUILD_TYPE=Release"
 short_desc="C++ template library for linear algebra (version 3.x)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MPL-2.0, GPL-3.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
diff --git a/srcpkgs/eigen3.2/template b/srcpkgs/eigen3.2/template
index 5715fc1b3a19..7b710534b5e5 100644
--- a/srcpkgs/eigen3.2/template
+++ b/srcpkgs/eigen3.2/template
@@ -4,6 +4,7 @@ version=3.2.10
 revision=3
 wrksrc="eigen-${version}"
 build_style=cmake
+configure_args="-DCMAKE_BUILD_TYPE=Release"
 short_desc="C++ template library for linear algebra (version 3.x)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MPL-2.0, GPL-3.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"

From 6f2a0d8bc0688a8784b90f370ea5e8fdae079413 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: Wed, 17 Mar 2021 07:04:48 +0700
Subject: [PATCH 04/17] embree: don't ignore CXXFLAGS, fix build with ispc
 1.13+

---
 .../embree/patches/uintNN-is-part-of-ispc-1.13.patch | 12 ++++++++++++
 srcpkgs/embree/template                              |  6 ++----
 2 files changed, 14 insertions(+), 4 deletions(-)
 create mode 100644 srcpkgs/embree/patches/uintNN-is-part-of-ispc-1.13.patch

diff --git a/srcpkgs/embree/patches/uintNN-is-part-of-ispc-1.13.patch b/srcpkgs/embree/patches/uintNN-is-part-of-ispc-1.13.patch
new file mode 100644
index 000000000000..5d0b02f3b2e5
--- /dev/null
+++ b/srcpkgs/embree/patches/uintNN-is-part-of-ispc-1.13.patch
@@ -0,0 +1,12 @@
+Index: embree-2.17.7/tutorials/common/common.isph
+===================================================================
+--- embree-2.17.7.orig/tutorials/common/common.isph
++++ embree-2.17.7/tutorials/common/common.isph
+@@ -16,7 +16,3 @@
+ 
+ #pragma once
+ 
+-typedef unsigned int64 uint64;
+-typedef unsigned int32 uint32;
+-typedef unsigned int16 uint16;
+-typedef unsigned int8  uint8;
diff --git a/srcpkgs/embree/template b/srcpkgs/embree/template
index 0bc72f46b6d8..849ec3c26c1d 100644
--- a/srcpkgs/embree/template
+++ b/srcpkgs/embree/template
@@ -4,6 +4,7 @@ version=2.17.7
 revision=2
 archs="x86_64"
 build_style=cmake
+configure_args="-DTBB_ROOT=/usr -DEMBREE_IGNORE_CMAKE_CXX_FLAGS=OFF"
 hostmakedepends="ispc"
 makedepends="libfreeglut-devel libXmu-devel tbb-devel MesaLib-devel libpng-devel
  libopenexr-devel libjpeg-turbo-devel libmagick-devel"
@@ -13,10 +14,7 @@ license="Apache-2.0"
 homepage="https://embree.github.io/"
 distfiles="https://github.com/$pkgname/$pkgname/archive/v$version.tar.gz"
 checksum=c0694f287fa1fbb382aba3a895702e248d92f7e89c0e5f64aefee965482ec04c
-
-nopie=y
-
-configure_args="-DTBB_ROOT=/usr -DENABLE_TUTORIALS=OFF"
+patch_args=-Np1
 
 embree-devel_package() {
 	depends="${sourcepkg}>=${version}_${revision}"

From ce340057e2e1488e2d06bc4bf6f5108f454135b1 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: Wed, 17 Mar 2021 07:35:19 +0700
Subject: [PATCH 05/17] ettercap: remove libressl patch, CMAKE_BUILD_TYPE=None

---
 .../patches/allow-build-type-none.patch       | 24 ++++++++++++++
 srcpkgs/ettercap/patches/libressl.patch       | 31 -------------------
 srcpkgs/ettercap/template                     |  9 ++++--
 3 files changed, 31 insertions(+), 33 deletions(-)
 create mode 100644 srcpkgs/ettercap/patches/allow-build-type-none.patch
 delete mode 100644 srcpkgs/ettercap/patches/libressl.patch

diff --git a/srcpkgs/ettercap/patches/allow-build-type-none.patch b/srcpkgs/ettercap/patches/allow-build-type-none.patch
new file mode 100644
index 000000000000..324d75086b05
--- /dev/null
+++ b/srcpkgs/ettercap/patches/allow-build-type-none.patch
@@ -0,0 +1,24 @@
+Index: ettercap-0.8.3.1/CMakeLists.txt
+===================================================================
+--- ettercap-0.8.3.1.orig/CMakeLists.txt
++++ ettercap-0.8.3.1/CMakeLists.txt
+@@ -22,19 +22,6 @@ option(LIBRARY_BUILD "Build for libetter
+ option(INSTALL_DESKTOP "Install ettercap desktop files" ON)
+ 
+ 
+-set(VALID_BUILD_TYPES Debug Release RelWithDebInfo)
+-
+-if(NOT CMAKE_BUILD_TYPE)
+-  # Default to using "Release" as our build type.
+-  set(CMAKE_BUILD_TYPE "Release" CACHE STRING
+-    "Choose the type of build, options are: ${VALID_BUILD_TYPES}." FORCE)
+-endif()
+-list(FIND VALID_BUILD_TYPES ${CMAKE_BUILD_TYPE} contains_valid)
+-if(contains_valid EQUAL -1)
+-  message(FATAL_ERROR "Unknown CMAKE_BUILD_TYPE: '${CMAKE_BUILD_TYPE}'. Valid options are: ${VALID_BUILD_TYPES}")
+-endif()
+-unset(contains_valid)
+-
+ include(CMakeDependentOption)
+ 
+ # If SYSTEM_LIBS is set to off, then all SYSTEM_* options will be
diff --git a/srcpkgs/ettercap/patches/libressl.patch b/srcpkgs/ettercap/patches/libressl.patch
deleted file mode 100644
index 15e0d3c1c9e7..000000000000
--- a/srcpkgs/ettercap/patches/libressl.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From b2f7634c9dbc0ef68640f0571787d92300e9f9f9 Mon Sep 17 00:00:00 2001
-From: Stefan Strogin <stefan@steils.org>
-Date: Sat, 15 Aug 2020 07:18:31 +0300
-Subject: [PATCH] ec_sslwrap: fix compilation with LibreSSL
-
-Disable taking over SNI extension from ClientHello and SSL configuration
-operations until LibreSSL supports the required API.
-
-Fixes: https://github.com/Ettercap/ettercap/issues/1068
----
- src/ec_sslwrap.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git src/ec_sslwrap.c src/ec_sslwrap.c
-index b9f26a142..1e4c24fc1 100644
---- src/ec_sslwrap.c
-+++ src/ec_sslwrap.c
-@@ -71,11 +71,11 @@
- #define TLS_server_method SSLv23_server_method
- #endif
- 
--#if (OPENSSL_VERSION_NUMBER >= 0x10100000L)
-+#if (OPENSSL_VERSION_NUMBER >= 0x10100000L) && !defined(LIBRESSL_VERSION_NUMBER)
- #define HAVE_OPENSSL_1_1_0
- #endif
- 
--#if (OPENSSL_VERSION_NUMBER >= 0x10101000L)
-+#if (OPENSSL_VERSION_NUMBER >= 0x10101000L) && !defined(LIBRESSL_VERSION_NUMBER)
- #define HAVE_OPENSSL_1_1_1
- #endif
- 
diff --git a/srcpkgs/ettercap/template b/srcpkgs/ettercap/template
index 7fe4c340a079..611b4e9aded7 100644
--- a/srcpkgs/ettercap/template
+++ b/srcpkgs/ettercap/template
@@ -3,8 +3,8 @@ pkgname=ettercap
 version=0.8.3.1
 revision=2
 build_style=cmake
-configure_args="-DENABLE_GTK=OFF"
-hostmakedepends="flex"
+configure_args="-DENABLE_GTK=OFF -DBUNDLED_LIBS=OFF"
+hostmakedepends="flex pkg-config"
 makedepends="geoip-devel ncurses-devel openssl-devel libcurl-devel
  libltdl-devel libnet-devel libpcap-devel pcre-devel"
 conf_files="/etc/${pkgname}/etter.conf"
@@ -15,5 +15,10 @@ homepage="http://ettercap.github.com/ettercap/"
 distfiles="https://github.com/Ettercap/ettercap/archive/v${version}.tar.gz"
 checksum=d0c3ef88dfc284b61d3d5b64d946c1160fd04276b448519c1ae4438a9cdffaf3
 lib32disabled=yes
+patch_args=-Np1
 
 CFLAGS="-fcommon"
+
+post_extract() {
+	rm -rf bundled_deps
+}

From ec8041bfb30a774c1ef62210fdac9e61c3d951c6 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: Wed, 17 Mar 2021 08:27:10 +0700
Subject: [PATCH 06/17] injeqt: disable coverage

---
 srcpkgs/injeqt/template | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/injeqt/template b/srcpkgs/injeqt/template
index 1e5777fc0f18..78eba09a0249 100644
--- a/srcpkgs/injeqt/template
+++ b/srcpkgs/injeqt/template
@@ -3,7 +3,8 @@ pkgname=injeqt
 version=1.2.0
 revision=2
 build_style=cmake
-hostmakedepends="pkg-config"
+configure_args="-DDISABLE_COVERAGE=ON"
+hostmakedepends="pkg-config qt5-qmake qt5-host-tools"
 makedepends="qt5-devel"
 short_desc="Dependency injection framework for Qt"
 maintainer="Jürgen Buchmüller <pullmoll@t-online.de>"
@@ -12,9 +13,6 @@ homepage="https://github.com/vogel/injeqt/"
 distfiles="https://github.com/vogel/${pkgname}/archive/${version}.tar.gz>${pkgname}-${version}.tar.gz"
 checksum=77540cedb0b26affe993dd18124d796059e34c80a51d9ae6433fdff1860db135
 
-if [ -n "$CROSS_BUILD" ]; then
-	hostmakedepends+=" qt5-host-tools qt5-devel"
-fi
 CXXFLAGS="-fno-lifetime-dse -Wno-error=cast-align"
 
 injeqt-devel_package() {

From 7636347432f3ab071cdddbdbe5b09ffeda0e3c14 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: Wed, 17 Mar 2021 22:26:37 +0700
Subject: [PATCH 07/17] kindd: build with CMAKE_BUILD_TYPE=None

---
 srcpkgs/kindd/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/kindd/template b/srcpkgs/kindd/template
index e634b0f69bf6..4416041de58c 100644
--- a/srcpkgs/kindd/template
+++ b/srcpkgs/kindd/template
@@ -15,7 +15,7 @@ distfiles="${homepage}/archive/${version}.tar.gz"
 checksum=e596f1b1577ff3e83a779e6181252ae2f09731f513d17dd6b95cbc2cf204654f
 
 do_install() {
-	vbin release/kindd
+	vbin build/core/kindd
 	vinstall assets/appconf/kindd.svg 644 usr/share/pixmaps
 	vinstall assets/appconf/kindd.desktop 644 usr/share/applications
 }

From 5580042e469a73d9f84518505de0f8dc59094ad8 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: Thu, 18 Mar 2021 23:58:53 +0700
Subject: [PATCH 08/17] occt: allow CMAKE_BUILD_TYPE=None

---
 srcpkgs/occt/patches/cmake-build-type-none.patch | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 srcpkgs/occt/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/occt/patches/cmake-build-type-none.patch b/srcpkgs/occt/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..acb06fb55766
--- /dev/null
+++ b/srcpkgs/occt/patches/cmake-build-type-none.patch
@@ -0,0 +1,13 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -4,7 +4,7 @@ set (CMAKE_MODULE_PATH "${CMAKE_SOURCE_D
+ 
+ set (CMAKE_SUPPRESS_REGENERATION TRUE)
+ 
+-set (CMAKE_CONFIGURATION_TYPES Release Debug RelWithDebInfo CACHE INTERNAL "" FORCE)
++set (CMAKE_CONFIGURATION_TYPES None Release Debug RelWithDebInfo CACHE INTERNAL "" FORCE)
+ 
+ # macro: include patched file if it exists
+ macro (OCCT_INCLUDE_CMAKE_FILE BEING_INCLUDED_FILE)

From 7ffc140c66e5c1a213750723449e30b0dd00c89a 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: Fri, 19 Mar 2021 23:07:05 +0700
Subject: [PATCH 09/17] renderdoc: devendor zstd, lz4

---
 .../patches/build-type-none-is-release.patch  | 12 ++++
 .../renderdoc/patches/qmake-no-rpath.patch    | 13 ++++
 .../renderdoc/patches/unvendor-zstd-lz4.patch | 68 +++++++++++++++++++
 srcpkgs/renderdoc/template                    | 15 ++--
 4 files changed, 99 insertions(+), 9 deletions(-)
 create mode 100644 srcpkgs/renderdoc/patches/build-type-none-is-release.patch
 create mode 100644 srcpkgs/renderdoc/patches/qmake-no-rpath.patch
 create mode 100644 srcpkgs/renderdoc/patches/unvendor-zstd-lz4.patch

diff --git a/srcpkgs/renderdoc/patches/build-type-none-is-release.patch b/srcpkgs/renderdoc/patches/build-type-none-is-release.patch
new file mode 100644
index 000000000000..f16b944bc12c
--- /dev/null
+++ b/srcpkgs/renderdoc/patches/build-type-none-is-release.patch
@@ -0,0 +1,12 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -315,6 +315,7 @@ set(RELEASE_MODE 0)
+ 
+ if(cmake_build_type_lower STREQUAL "release" OR
+    cmake_build_type_lower STREQUAL "relwithdebinfo" OR
++   cmake_build_type_lower STREQUAL "none" OR
+    cmake_build_type_lower STREQUAL "minsizerel")
+     add_definitions(-D_RELEASE)
+     message(STATUS "Building RenderDoc in Release mode: ${CMAKE_BUILD_TYPE}")
diff --git a/srcpkgs/renderdoc/patches/qmake-no-rpath.patch b/srcpkgs/renderdoc/patches/qmake-no-rpath.patch
new file mode 100644
index 000000000000..6e6325c53555
--- /dev/null
+++ b/srcpkgs/renderdoc/patches/qmake-no-rpath.patch
@@ -0,0 +1,13 @@
+Index: qrenderdoc/CMakeLists.txt
+===================================================================
+--- qrenderdoc/CMakeLists.txt.orig
++++ qrenderdoc/CMakeLists.txt
+@@ -144,7 +144,7 @@ endif()
+ # and finding dependencies from the cmake build
+ file(WRITE
+      ${CMAKE_BINARY_DIR}/qrenderdoc/qrenderdoc_cmake.pri
+-     "CONFIG+=${QMAKE_CONFIG}\n"
++     "CONFIG+=${QMAKE_CONFIG} no_qt_rpath\n"
+      "\n"
+      "QMAKE_CC=${CMAKE_C_COMPILER}\n"
+      "QMAKE_CXX=${CMAKE_CXX_COMPILER}\n"
diff --git a/srcpkgs/renderdoc/patches/unvendor-zstd-lz4.patch b/srcpkgs/renderdoc/patches/unvendor-zstd-lz4.patch
new file mode 100644
index 000000000000..d4003ded9161
--- /dev/null
+++ b/srcpkgs/renderdoc/patches/unvendor-zstd-lz4.patch
@@ -0,0 +1,68 @@
+Index: renderdoc/CMakeLists.txt
+===================================================================
+--- renderdoc/CMakeLists.txt.orig
++++ renderdoc/CMakeLists.txt
+@@ -213,54 +213,10 @@ set(sources
+     3rdparty/pugixml/pugixml.cpp
+     3rdparty/pugixml/pugixml.hpp
+     3rdparty/pugixml/pugiconfig.hpp
+-    3rdparty/lz4/lz4.c
+-    3rdparty/lz4/lz4.h
+     3rdparty/miniz/miniz.c
+     3rdparty/miniz/miniz.h
+     3rdparty/superluminal/superluminal.cpp
+     3rdparty/superluminal/superluminal.h
+-    3rdparty/zstd/bitstream.h
+-    3rdparty/zstd/compiler.h
+-    3rdparty/zstd/cpu.h
+-    3rdparty/zstd/debug.c
+-    3rdparty/zstd/debug.h
+-    3rdparty/zstd/entropy_common.c
+-    3rdparty/zstd/error_private.c
+-    3rdparty/zstd/error_private.h
+-    3rdparty/zstd/fse.h
+-    3rdparty/zstd/fse_compress.c
+-    3rdparty/zstd/fse_decompress.c
+-    3rdparty/zstd/hist.c
+-    3rdparty/zstd/hist.h
+-    3rdparty/zstd/huf.h
+-    3rdparty/zstd/huf_compress.c
+-    3rdparty/zstd/huf_decompress.c
+-    3rdparty/zstd/mem.h
+-    3rdparty/zstd/pool.c
+-    3rdparty/zstd/pool.h
+-    3rdparty/zstd/threading.c
+-    3rdparty/zstd/threading.h
+-    3rdparty/zstd/xxhash.c
+-    3rdparty/zstd/xxhash.h
+-    3rdparty/zstd/zstd.h
+-    3rdparty/zstd/zstd_common.c
+-    3rdparty/zstd/zstd_compress.c
+-    3rdparty/zstd/zstd_compress_internal.h
+-    3rdparty/zstd/zstd_decompress.c
+-    3rdparty/zstd/zstd_double_fast.c
+-    3rdparty/zstd/zstd_double_fast.h
+-    3rdparty/zstd/zstd_errors.h
+-    3rdparty/zstd/zstd_fast.c
+-    3rdparty/zstd/zstd_fast.h
+-    3rdparty/zstd/zstd_internal.h
+-    3rdparty/zstd/zstd_lazy.c
+-    3rdparty/zstd/zstd_lazy.h
+-    3rdparty/zstd/zstd_ldm.c
+-    3rdparty/zstd/zstd_ldm.h
+-    3rdparty/zstd/zstd_opt.c
+-    3rdparty/zstd/zstd_opt.h
+-    3rdparty/zstd/zstdmt_compress.c
+-    3rdparty/zstd/zstdmt_compress.h
+     3rdparty/stb/stb_image.h
+     3rdparty/stb/stb_image_write.h
+     3rdparty/stb/stb_image_resize.h
+@@ -271,6 +227,8 @@ set(sources
+     3rdparty/tinyfiledialogs/tinyfiledialogs.c
+     3rdparty/tinyfiledialogs/tinyfiledialogs.h)
+ 
++list(APPEND RDOC_LIBRARIES -llz4 -lzstd)
++
+ if(ANDROID)
+     list(APPEND sources
+         data/embedded_files.h
diff --git a/srcpkgs/renderdoc/template b/srcpkgs/renderdoc/template
index 7240e9ebc307..4615d45c52c9 100644
--- a/srcpkgs/renderdoc/template
+++ b/srcpkgs/renderdoc/template
@@ -1,13 +1,14 @@
 # Template file for 'renderdoc'
 pkgname=renderdoc
 version=1.12
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DENABLE_GL=ON -DENABLE_GLES=ON -DENABLE_QRENDERDOC=ON
  -DENABLE_RENDERDOCCMD=ON -DENABLE_VULKAN=ON -DENABLE_XCB=ON -DENABLE_XLIB=ON
  -DENABLE_PYRENDERDOC=ON"
-hostmakedepends="bison autoconf automake pkg-config python3"
+hostmakedepends="bison autoconf automake pkg-config python3 swig"
 makedepends="libX11-devel libxcb-devel xcb-util-keysyms-devel qt5-devel
+ libzstd-devel liblz4-devel
  qt5-svg-devel qt5-x11extras-devel pcre-devel python3-devel"
 short_desc="Stand-alone graphics debugging tool for Vulkan and OpenGL"
 maintainer="Urs Schulz <voidpkgs@ursschulz.de>"
@@ -19,19 +20,14 @@ checksum=4dece1b4cb859a76533b28fcd50e17321acfaa81c3435500a006c4a5ba15fddb
 if [ "$XBPS_TARGET_LIBC" = musl ]; then
 	makedepends+=" libexecinfo-devel"
 	LDLIBS="-lexecinfo"
+	broken="uses RTLD_DL_LINKMAP, RTLD_DEEPBIND, _r_debug"
 fi
 
 if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
 	makedepends+=" libatomic-devel"
 fi
 
-case "$XBPS_TARGET_MACHINE" in
-	*-musl) broken="uses RTLD_DL_LINKMAP, RTLD_DEEPBIND, _r_debug" ;;
-esac
-
-if [ "$CROSS_BUILD" ]; then
-	broken="Cross-compilation can't find python3 interpreter"
-fi
+nocross="Cross-compilation can't find python3 interpreter"
 
 post_patch() {
 	[ -z "$XBPS_TARGET_NO_ATOMIC8" ] && return 0
@@ -40,4 +36,5 @@ post_patch() {
 
 post_install() {
 	vlicense LICENSE.md
+	vlicense docs/credits_acknowledgements.rst
 }

From 15e91a49e4672b91806234498e1136fb9c246d42 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: Sat, 20 Mar 2021 00:47:52 +0700
Subject: [PATCH 10/17] python3-occ: build with CMAKE_BUILD_TYPE=None

---
 srcpkgs/python3-occ/template | 1 +
 1 file changed, 1 insertion(+)

diff --git a/srcpkgs/python3-occ/template b/srcpkgs/python3-occ/template
index 705f37457943..3ea0ef5e6387 100644
--- a/srcpkgs/python3-occ/template
+++ b/srcpkgs/python3-occ/template
@@ -5,6 +5,7 @@ revision=1
 archs="i686* x86_64* armv7l* aarch64* ppc*"
 wrksrc="pythonocc-core-${version}"
 build_style=cmake
+configure_args="-DPYTHONOCC_BUILD_TYPE=None -DCMAKE_BUILD_TYPE=None"
 hostmakedepends="python3 swig"
 makedepends="python3-devel occt-devel freetype-devel swig"
 depends="python3 occt freetype"

From b279d298e5ec4b5bc334f0c778eaf098d2ccf0a1 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: Fri, 19 Mar 2021 23:38:10 +0700
Subject: [PATCH 11/17] widelands: allow CMAKE_BUILD_TYPE=None

---
 srcpkgs/widelands-data                        |  1 -
 .../patches/cmake-build-type-none.patch       | 63 +++++++++++++++++++
 .../widelands/patches/fix-install-path.patch  | 40 ++++++++++++
 srcpkgs/widelands/template                    | 21 +------
 4 files changed, 105 insertions(+), 20 deletions(-)
 delete mode 120000 srcpkgs/widelands-data
 create mode 100644 srcpkgs/widelands/patches/cmake-build-type-none.patch
 create mode 100644 srcpkgs/widelands/patches/fix-install-path.patch

diff --git a/srcpkgs/widelands-data b/srcpkgs/widelands-data
deleted file mode 120000
index e9fbf89517f2..000000000000
--- a/srcpkgs/widelands-data
+++ /dev/null
@@ -1 +0,0 @@
-widelands
\ No newline at end of file
diff --git a/srcpkgs/widelands/patches/cmake-build-type-none.patch b/srcpkgs/widelands/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..3d210854741b
--- /dev/null
+++ b/srcpkgs/widelands/patches/cmake-build-type-none.patch
@@ -0,0 +1,63 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -202,7 +202,7 @@ elseif(CMAKE_BUILD_TYPE STREQUAL "RelWit
+   set(WL_DEBUG_FLAGS "-DNDEBUG -DNOPARACHUTE")
+   option(OPTION_ASAN "Build with AddressSanitizer" ON)
+ else()
+-  message(FATAL_ERROR "Unknown CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
++  set(WL_DEBUG_FLAGS "-DNDEBUG -DNOPARACHUTE")
+ endif()
+ 
+ wl_add_flag(WL_GENERIC_CXX_FLAGS "-std=c++11")
+@@ -353,7 +353,7 @@ endif (OPTION_BUILD_TESTS)
+ install (
+   FILES ${CMAKE_CURRENT_BINARY_DIR}/VERSION
+   DESTINATION ${WL_INSTALL_BASEDIR}
+-  CONFIGURATIONS Debug;Release
++  CONFIGURATIONS Debug
+   COMPONENT CoreVersionFile
+ )
+ 
+@@ -378,7 +378,6 @@ install(
+     data/txts
+     data/world
+   DESTINATION ${WL_INSTALL_DATADIR}
+-  CONFIGURATIONS Debug;Release
+   COMPONENT CoreDataFiles
+ )
+ 
+@@ -386,7 +385,6 @@ install(
+   DIRECTORY
+     data/maps
+   DESTINATION ${WL_INSTALL_DATADIR}
+-  CONFIGURATIONS Debug;Release
+   COMPONENT MapFiles
+ )
+ 
+@@ -395,7 +393,6 @@ install(
+     data/music
+     data/sound
+   DESTINATION ${WL_INSTALL_DATADIR}
+-  CONFIGURATIONS Debug;Release
+   COMPONENT MusicFiles
+ )
+ 
+@@ -405,7 +402,7 @@ install(
+     CREDITS
+     ChangeLog
+   DESTINATION ${WL_INSTALL_BASEDIR}
+-  CONFIGURATIONS Debug;Release
++  CONFIGURATIONS Debug
+   COMPONENT CoreLicenseFiles
+ )
+ 
+@@ -424,7 +421,6 @@ install(
+   DIRECTORY
+     ${CMAKE_CURRENT_BINARY_DIR}/locale/
+   DESTINATION ${WL_INSTALL_DATADIR}/locale
+-  CONFIGURATIONS Debug;Release
+   COMPONENT CoreLanguageFiles
+ )
+ 
diff --git a/srcpkgs/widelands/patches/fix-install-path.patch b/srcpkgs/widelands/patches/fix-install-path.patch
new file mode 100644
index 000000000000..6bb461389f03
--- /dev/null
+++ b/srcpkgs/widelands/patches/fix-install-path.patch
@@ -0,0 +1,40 @@
+Index: cmake/WlFunctions.cmake
+===================================================================
+--- cmake/WlFunctions.cmake.orig
++++ cmake/WlFunctions.cmake
+@@ -289,5 +289,5 @@ function(wl_binary NAME)
+ 
+   #Quoting the CMake documentation on DESTINATION:
+   #"If a relative path is given it is interpreted relative to the value of CMAKE_INSTALL_PREFIX"
+-  install(TARGETS ${NAME} DESTINATION "." COMPONENT ExecutableFiles)
++  install(TARGETS ${NAME} DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT ExecutableFiles)
+ endfunction()
+Index: xdg/CMakeLists.txt
+===================================================================
+--- xdg/CMakeLists.txt.orig
++++ xdg/CMakeLists.txt
+@@ -6,19 +6,19 @@ set(XDG_APPLICATION_ID "org.widelands.Wi
+ list(APPEND icon_sizes "16" "32" "48" "64" "128")
+ foreach (icon_size ${icon_sizes})
+   #install(FILES ${CMAKE_SOURCE_DIR}/data/images/logos/wl-ico-${icon_size}.png DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/${icon_size}x${icon_size}/apps RENAME ${XDG_APPLICATION_ID}.png)
+-  install(FILES ${CMAKE_SOURCE_DIR}/data/images/logos/wl-ico-${icon_size}.png DESTINATION ../share/icons/hicolor/${icon_size}x${icon_size}/apps RENAME ${XDG_APPLICATION_ID}.png)
++  install(FILES ${CMAKE_SOURCE_DIR}/data/images/logos/wl-ico-${icon_size}.png DESTINATION share/icons/hicolor/${icon_size}x${icon_size}/apps RENAME ${XDG_APPLICATION_ID}.png)
+ endforeach (icon_size ${icon_sizes})
+ #install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${CMAKE_PROJECT_NAME}.6           DESTINATION ${CMAKE_INSTALL_MANDIR}/man6)
+-install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${CMAKE_PROJECT_NAME}.6           DESTINATION ../share/man/man6)
++install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${CMAKE_PROJECT_NAME}.6           DESTINATION share/man/man6)
+ #install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${XDG_APPLICATION_ID}.desktop     DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications)
+-install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${XDG_APPLICATION_ID}.desktop     DESTINATION ../share/applications)
++install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${XDG_APPLICATION_ID}.desktop     DESTINATION share/applications)
+ #install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${XDG_APPLICATION_ID}.appdata.xml DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/metainfo)
+-install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${XDG_APPLICATION_ID}.appdata.xml DESTINATION ../share/metainfo)
++install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${XDG_APPLICATION_ID}.appdata.xml DESTINATION share/metainfo)
+ 
+ find_program(GTK_UPDATE_ICON_CACHE NAMES gtk-update-icon-cache)
+ if (GTK_UPDATE_ICON_CACHE)
+   #install(CODE "execute_process (COMMAND ${GTK_UPDATE_ICON_CACHE} -t -f ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor ||: )")
+-  install(CODE "execute_process (COMMAND ${GTK_UPDATE_ICON_CACHE} -t -f ${CMAKE_INSTALL_PREFIX}/../share/icons/hicolor ||: )")
++  install(CODE "execute_process (COMMAND ${GTK_UPDATE_ICON_CACHE} -t -f ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor ||: )")
+ else (GTK_UPDATE_ICON_CACHE)
+   message(WARNING "gtk-update-icon-cache not found!")
+ endif (GTK_UPDATE_ICON_CACHE)
diff --git a/srcpkgs/widelands/template b/srcpkgs/widelands/template
index 6cee85087ea7..cfa2c10993e0 100644
--- a/srcpkgs/widelands/template
+++ b/srcpkgs/widelands/template
@@ -1,7 +1,7 @@
 # Template file for 'widelands'
 pkgname=widelands
 version=21
-revision=3
+revision=4
 wrksrc="${pkgname}-build${version}"
 build_style=cmake
 configure_args="-DOPENGL_INCLUDE_DIR=${XBPS_CROSS_BASE}/usr/include
@@ -10,13 +10,13 @@ hostmakedepends="python3 pkg-config gettext"
 makedepends="boost-devel icu-devel minizip-devel gettext-devel
  glu-devel glew-devel SDL2-devel SDL2_gfx-devel SDL2_image-devel
  SDL2_net-devel SDL2_mixer-devel SDL2_ttf-devel"
-depends="${pkgname}-data-${version}_${revision}"
 short_desc="Real-time strategy game"
 maintainer="Jürgen Buchmüller <pullmoll@t-online.de>"
 license="GPL-2.0-or-later"
 homepage="http://www.widelands.org/"
 distfiles="https://github.com/widelands/widelands/archive/build${version}.tar.gz>${pkgname}-${version}.tar.gz"
 checksum=601e0e4c6f91b3fb0ece2cd1b83ecfb02344a1b9194fbb70ef3f70e06994e357
+replaces="widelands-data>=0"
 
 CXXFLAGS="-DU_USING_ICU_NAMESPACE=1"
 
@@ -29,22 +29,5 @@ if [ "$CROSS_BUILD" ]; then
 fi
 
 post_install() {
-	# For some reason the binary is installed as /usr/widelands - move it
-	vmkdir usr/bin
-	mv ${DESTDIR}/usr/${pkgname} ${DESTDIR}/usr/bin
-	vmkdir usr/share
-	mv ${DESTDIR}/share/* ${DESTDIR}/usr/share/
-	rmdir ${DESTDIR}/share
-
-	# Remove files not needed in the package
-	rm -f ${DESTDIR}/usr/COPYING ${DESTDIR}/usr/CREDITS ${DESTDIR}/usr/ChangeLog ${DESTDIR}/usr/VERSION
-
 	vinstall ${FILESDIR}/${pkgname}.desktop 644 usr/share/applications
 }
-
-widelands-data_package() {
-	short_desc+=" - data files"
-	pkg_install() {
-		vmove usr/share/widelands
-	}
-}

From 0ea13887d74777dd58be451f32dcf54408126db6 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: Sat, 20 Mar 2021 09:49:25 +0700
Subject: [PATCH 12/17] zziplib: fix SONAME when build with
 -DCMAKE_BUILD_TYPE=None

---
 .../cmake-build-type-none-soname.patch        | 35 +++++++++++++++++++
 srcpkgs/zziplib/template                      |  1 +
 2 files changed, 36 insertions(+)
 create mode 100644 srcpkgs/zziplib/patches/cmake-build-type-none-soname.patch

diff --git a/srcpkgs/zziplib/patches/cmake-build-type-none-soname.patch b/srcpkgs/zziplib/patches/cmake-build-type-none-soname.patch
new file mode 100644
index 000000000000..2d31b5b8a46a
--- /dev/null
+++ b/srcpkgs/zziplib/patches/cmake-build-type-none-soname.patch
@@ -0,0 +1,35 @@
+Index: zziplib-0.13.72/zzip/CMakeLists.txt
+===================================================================
+--- zziplib-0.13.72.orig/zzip/CMakeLists.txt
++++ zziplib-0.13.72/zzip/CMakeLists.txt
+@@ -190,15 +190,18 @@ target_include_directories (libzzipmmapp
+ endif()
+ 
+ set_target_properties(libzzip PROPERTIES OUTPUT_NAME "zzip" RELEASE_POSTFIX "-${RELNUM}")
++set_target_properties(libzzip PROPERTIES OUTPUT_NAME "zzip" NONE_POSTFIX "-${RELNUM}")
+ SET_TARGET_PROPERTIES(libzzip PROPERTIES VERSION ${VERNUM}.${FIXNUM} SOVERSION ${VERNUM})
+ 
+ if(ZZIPFSEEKO)
+ set_target_properties(libzzipfseeko PROPERTIES OUTPUT_NAME "zzipfseeko" RELEASE_POSTFIX "-${RELNUM}")
++set_target_properties(libzzipfseeko PROPERTIES OUTPUT_NAME "zzipfseeko" NONE_POSTFIX "-${RELNUM}")
+ SET_TARGET_PROPERTIES(libzzipfseeko PROPERTIES VERSION ${VERNUM}.${FIXNUM} SOVERSION ${VERNUM})
+ endif()
+ 
+ if(ZZIPMMAPPED)
+ set_target_properties(libzzipmmapped PROPERTIES OUTPUT_NAME "zzipmmapped" RELEASE_POSTFIX "-${RELNUM}")
++set_target_properties(libzzipmmapped PROPERTIES OUTPUT_NAME "zzipmmapped" NONE_POSTFIX "-${RELNUM}")
+ SET_TARGET_PROPERTIES(libzzipmmapped PROPERTIES VERSION ${VERNUM}.${FIXNUM} SOVERSION ${VERNUM})
+ endif()
+ 
+Index: zziplib-0.13.72/zzipwrap/CMakeLists.txt
+===================================================================
+--- zziplib-0.13.72.orig/zzipwrap/CMakeLists.txt
++++ zziplib-0.13.72/zzipwrap/CMakeLists.txt
+@@ -49,6 +49,7 @@ target_link_libraries(libzzipwrap libzzi
+ target_include_directories(libzzipwrap PRIVATE "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}")
+ 
+ set_target_properties(libzzipwrap PROPERTIES OUTPUT_NAME "zzipwrap" RELEASE_POSTFIX "-${RELNUM}")
++set_target_properties(libzzipwrap PROPERTIES OUTPUT_NAME "zzipwrap" NONE_POSTFIX "-${RELNUM}")
+ SET_TARGET_PROPERTIES(libzzipwrap PROPERTIES VERSION ${VERNUM}.${FIXNUM} SOVERSION ${VERNUM})
+ set_target_properties(libzzipwrap PROPERTIES DEFINE_SYMBOL "libzzip_EXPORTS")
+ 
diff --git a/srcpkgs/zziplib/template b/srcpkgs/zziplib/template
index ab5af234af62..2026f3e4a521 100644
--- a/srcpkgs/zziplib/template
+++ b/srcpkgs/zziplib/template
@@ -12,6 +12,7 @@ homepage="https://github.com/gdraheim/zziplib"
 changelog="https://raw.githubusercontent.com/gdraheim/zziplib/master/ChangeLog"
 distfiles="https://github.com/gdraheim/zziplib/archive/v${version}.tar.gz"
 checksum=93ef44bf1f1ea24fc66080426a469df82fa631d13ca3b2e4abaeab89538518dc
+patch_args=-Np1
 
 if [ "$CROSS_BUILD" ]; then
 	configure_args+=" -DZZIPTEST=OFF"

From 382139c1712d284d6872d99e8b55d27a926134a9 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, 21 Mar 2021 15:28:04 +0700
Subject: [PATCH 13/17] mellowplayer: fix build

---
 srcpkgs/mellowplayer/patches/no-werror.patch | 13 +++++++++++++
 srcpkgs/mellowplayer/template                | 13 +++++++------
 2 files changed, 20 insertions(+), 6 deletions(-)
 create mode 100644 srcpkgs/mellowplayer/patches/no-werror.patch

diff --git a/srcpkgs/mellowplayer/patches/no-werror.patch b/srcpkgs/mellowplayer/patches/no-werror.patch
new file mode 100644
index 000000000000..7e678453a123
--- /dev/null
+++ b/srcpkgs/mellowplayer/patches/no-werror.patch
@@ -0,0 +1,13 @@
+Index: MellowPlayer-3.6.6/src/3rdparty/boost/di.hpp
+===================================================================
+--- MellowPlayer-3.6.6.orig/src/3rdparty/boost/di.hpp
++++ MellowPlayer-3.6.6/src/3rdparty/boost/di.hpp
+@@ -67,7 +67,7 @@ BOOST_DI_CFG_FWD
+ #pragma clang diagnostic error "-Wundefined-internal"
+ #pragma clang diagnostic ignored "-Wmissing-field-initializers"
+ #elif defined(__GCC__)
+-#pragma GCC diagnostic error "-Wdeprecated-declarations"
++#pragma GCC diagnostic warning "-Wdeprecated-declarations"
+ #pragma GCC diagnostic push
+ #if (__GNUC__ < 6)
+ #pragma GCC diagnostic error "-Werror"
diff --git a/srcpkgs/mellowplayer/template b/srcpkgs/mellowplayer/template
index 2f8f13960ca6..cfd8a185556f 100644
--- a/srcpkgs/mellowplayer/template
+++ b/srcpkgs/mellowplayer/template
@@ -4,7 +4,7 @@ version=3.6.6
 revision=1
 wrksrc="MellowPlayer-${version}"
 build_style=cmake
-hostmakedepends="pkg-config qt5-tools qt5-qmake"
+hostmakedepends="pkg-config qt5-tools qt5-qmake qt5-host-tools"
 makedepends="qt5-declarative-devel qt5-quickcontrols2-devel
  qt5-plugin-mysql qt5-plugin-pgsql qt5-plugin-sqlite
  qt5-plugin-tds qt5-plugin-odbc
@@ -17,11 +17,12 @@ license="GPL-2.0-or-later"
 homepage="https://colinduquesnoy.gitlab.io/MellowPlayer/"
 distfiles="https://gitlab.com/ColinDuquesnoy/MellowPlayer/-/archive/${version}/MellowPlayer-${version}.tar.bz2"
 checksum=17b8b25ca6b3d27b223f8be6ad80186ae5bd17ce762eb04ecd8b0e82e687b327
+patch_args=-Np1
 
-if [ "$CROSS_BUILD" ]; then
-	hostmakedepends+=" qt5-host-tools"
+if [ "$XBPS_WORDSIZE" != "$XBPS_TARGET_WORDSIZE" ]; then
+	broken="webengine can be built only if word size matches"
 fi
 
-case "$XBPS_TARGET_MACHINE" in
-	arm*) broken="qt5-webengine not available" ;;
-esac
+if [ "$XBPS_TARGET_ENDIAN" != "le" ]; then
+	broken="webengine only supports little endian"
+fi

From 01d09d9bbd208a3cfe7779d4a612a6fd1c7da266 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, 21 Mar 2021 15:43:09 +0700
Subject: [PATCH 14/17] ispc: fix CMAKE_BUILD_TYPE=None

---
 .../ispc/patches/cmake-build-type-none.patch   | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
 create mode 100644 srcpkgs/ispc/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/ispc/patches/cmake-build-type-none.patch b/srcpkgs/ispc/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..411e353c7314
--- /dev/null
+++ b/srcpkgs/ispc/patches/cmake-build-type-none.patch
@@ -0,0 +1,18 @@
+Index: ispc-1.15.0/CMakeLists.txt
+===================================================================
+--- ispc-1.15.0.orig/CMakeLists.txt
++++ ispc-1.15.0/CMakeLists.txt
+@@ -157,13 +157,6 @@ set(OUTPUT_RELEASE Release/bin)
+ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin )
+ 
+ if(CMAKE_BUILD_TYPE)
+-    # Validate build type
+-    set(CONFIGURATION_TYPES "Debug;Release;RelWithDebInfo")
+-
+-    string(FIND "${CONFIGURATION_TYPES}" "${CMAKE_BUILD_TYPE}" MATCHED_CONFIG)
+-    if (${MATCHED_CONFIG} EQUAL -1)
+-         message(FATAL_ERROR "CMAKE_BUILD_TYPE (${CMAKE_BUILD_TYPE}) allows only the following values: ${CONFIGURATION_TYPES}")
+-    endif()
+ else(NOT CMAKE_BUILD_TYPE)
+     set(CMAKE_BUILD_TYPE "Release")
+     message(STATUS "Build type not specified: Use Release by default.")

From a0a11edfdf327494160f76418c6e68dbcfde0167 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, 21 Mar 2021 15:56:50 +0700
Subject: [PATCH 15/17] darktable: fix CMAKE_BUILD_TYPE=None

---
 .../darktable/patches/cmake-build-type-none.patch  | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
 create mode 100644 srcpkgs/darktable/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/darktable/patches/cmake-build-type-none.patch b/srcpkgs/darktable/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..7101f9c1a0e7
--- /dev/null
+++ b/srcpkgs/darktable/patches/cmake-build-type-none.patch
@@ -0,0 +1,14 @@
+Index: src/external/rawspeed/cmake/build-type.cmake
+===================================================================
+--- src/external/rawspeed/cmake/build-type.cmake.orig
++++ src/external/rawspeed/cmake/build-type.cmake
+@@ -27,9 +27,6 @@ string(TOUPPER "${RAWSPEED_SPECIAL_BUILD
+ 
+ # is this one of the known build types?
+ list (FIND CMAKE_CONFIGURATION_TYPES_UPPERCASE ${CMAKE_BUILD_TYPE_UPPERCASE} BUILD_TYPE_IS_KNOWN)
+-if (${BUILD_TYPE_IS_KNOWN} EQUAL -1)
+- message(SEND_ERROR "Unknown build type: ${CMAKE_BUILD_TYPE_UPPERCASE}. Please specify one of: ${CMAKE_CONFIGURATION_TYPES}")
+-endif()
+ 
+ # is this a special build?
+ list (FIND RAWSPEED_SPECIAL_BUILD_TYPES_UPPERCASE ${CMAKE_BUILD_TYPE_UPPERCASE} IS_SPECIAL_BUILD)

From 1b76a7aad143eda3a94b8f0279b6f5c0a08ee610 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, 21 Mar 2021 15:33:29 +0700
Subject: [PATCH 16/17] hedgewars: merge -data back

---
 srcpkgs/hedgewars-data                        |  1 -
 .../patches/cmake-build-type-none.patch       | 30 +++++++++++++++++++
 srcpkgs/hedgewars/template                    | 23 +++++---------
 3 files changed, 38 insertions(+), 16 deletions(-)
 delete mode 120000 srcpkgs/hedgewars-data
 create mode 100644 srcpkgs/hedgewars/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/hedgewars-data b/srcpkgs/hedgewars-data
deleted file mode 120000
index b57dc45ebadc..000000000000
--- a/srcpkgs/hedgewars-data
+++ /dev/null
@@ -1 +0,0 @@
-hedgewars
\ No newline at end of file
diff --git a/srcpkgs/hedgewars/patches/cmake-build-type-none.patch b/srcpkgs/hedgewars/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..b4e0c186717c
--- /dev/null
+++ b/srcpkgs/hedgewars/patches/cmake-build-type-none.patch
@@ -0,0 +1,30 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -54,7 +54,7 @@ option(NOVERSIONINFOUPDATE "Disable upda
+ 
+ 
+ if(BUILD_ENGINE_C AND NOT NOVIDEOREC)
+-    if((CMAKE_BUILD_TYPE STREQUAL "Release") OR (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo"))
++    if((CMAKE_BUILD_TYPE STREQUAL "Release") OR (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo") OR (CMAKE_BUILD_TYPE STREQUAL "None"))
+         message("NOTE: Video recorder support disabled. It's incompatible with BUILD_ENGINE_C")
+         set(BUILD_ENGINE_C ON CACHE STRING "Required for BUILD_ENGINE_JS" FORCE)
+     else()
+@@ -93,7 +93,7 @@ set(CPACK_PACKAGE_VERSION_MAJOR 1)
+ set(CPACK_PACKAGE_VERSION_MINOR 0)
+ set(CPACK_PACKAGE_VERSION_PATCH 0)
+ set(HEDGEWARS_PROTO_VER 59)
+-if((CMAKE_BUILD_TYPE STREQUAL "Release") OR (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo"))
++if((CMAKE_BUILD_TYPE STREQUAL "Release") OR (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo") OR (CMAKE_BUILD_TYPE STREQUAL "None"))
+     set(HEDGEWARS_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
+ else()
+     set(HEDGEWARS_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}-dev")
+@@ -114,6 +114,7 @@ include(${CMAKE_MODULE_PATH}/platform.cm
+ if(CMAKE_BUILD_TYPE)
+     if(NOT((CMAKE_BUILD_TYPE STREQUAL "Release") OR
+            (CMAKE_BUILD_TYPE STREQUAL "Debug") OR
++	   (CMAKE_BUILD_TYPE STREQUAL "None") OR
+            (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")))
+         set(CMAKE_BUILD_TYPE ${default_build_type} CACHE STRING "Build type (Debug/Release/RelWithDebInfo)" FORCE)
+         message(STATUS "Unknown build type ${CMAKE_BUILD_TYPE}, using default (${default_build_type})")
diff --git a/srcpkgs/hedgewars/template b/srcpkgs/hedgewars/template
index d2294cf572f5..f413a965ff2e 100644
--- a/srcpkgs/hedgewars/template
+++ b/srcpkgs/hedgewars/template
@@ -1,15 +1,15 @@
 # Template file for 'hedgewars'
 pkgname=hedgewars
 version=1.0.0
-revision=2
+revision=3
 wrksrc="${pkgname}-src-${version}"
 build_style=cmake
 configure_args="-DNOSERVER=1 -DDATA_INSTALL_DIR=/usr/share/${pkgname}
- -DPHYSFS_SYSTEM=1 -DCMAKE_VERBOSE_MAKEFILE=1 -DMINIMAL_FLAGS=1"
-hostmakedepends="lua51 pkg-config"
+ -DPHYSFS_SYSTEM=1 -DMINIMAL_FLAGS=1"
+hostmakedepends="lua51 pkg-config qt5-qmake qt5-host-tools"
 makedepends="ffmpeg-devel lua51-devel physfs-devel qt5-tools-devel SDL2_image-devel
  SDL2_mixer-devel SDL2_net-devel SDL2_ttf-devel"
-depends="hedgewars-data>=${version}_${revision} libfreeglut"
+depends="libfreeglut"
 short_desc="Funny turn-based artillery game, featuring fighting Hedgehogs!"
 maintainer="Jakub Skrzypnik <jot.skrzyp@gmail.com>"
 license="GPL-2.0-only"
@@ -18,10 +18,9 @@ distfiles="https://hedgewars.org/download/releases/hedgewars-src-${version}.tar.
 checksum=211634e61f2e4beecc3c98c6f749601fcd08321fda1ba969b3b3832a004f155b
 nopie_files="/usr/bin/hwengine"
 nocross="Needs investigation: fails to link hwengine"
-
-if [ -n "$CROSS_BUILD" ]; then
-	hostmakedepends+=" qt5-devel"
-fi
+replaces="hedgewars-data>=0"
+export CMAKE_GENERATOR="Unix Makefiles"
+make_cmd=make
 
 case $XBPS_TARGET_MACHINE in
 	x86_64*)
@@ -38,6 +37,7 @@ esac
 
 if [ -n "$_use_c_engine" ]; then
 	hostmakedepends+=" glew-devel libatomic-devel ghc clang"
+	makedepends+=" glew-devel libatomic-devel"
 	configure_args+=" -DBUILD_ENGINE_C=1"
 	nopie_files+=" /usr/bin/hedgewars"
 fi
@@ -56,10 +56,3 @@ pre_configure() {
 post_install() {
 	vinstall ${DESTDIR}/usr/share/hedgewars/Data/misc/hedgewars.desktop 644 usr/share/applications
 }
-
-hedgewars-data_package() {
-	short_desc+=" - data files"
-	pkg_install() {
-		vmove usr/share/hedgewars/Data
-	}
-}

From 8f29b89d9a40015e40f688f73c994b5166b1b8ea 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, 21 Mar 2021 16:41:58 +0700
Subject: [PATCH 17/17] mariadb: fix for CMAKE_BUILD_TYPE=None

---
 srcpkgs/mariadb/template | 32 ++++++++++++++------------------
 1 file changed, 14 insertions(+), 18 deletions(-)

diff --git a/srcpkgs/mariadb/template b/srcpkgs/mariadb/template
index 437ff757b383..78d5e2dbdbe8 100644
--- a/srcpkgs/mariadb/template
+++ b/srcpkgs/mariadb/template
@@ -34,35 +34,31 @@ replaces="mysql>=0"
 conf_files="/etc/mysql/my.cnf"
 system_accounts="mysql"
 mysql_homedir="/var/lib/mysql"
-CFLAGS="-w -fcommon"
+CFLAGS="-w -fcommon -DDBUG_OFF=1"
+CXXFLAGS="-DDBUG_OFF=1"
 
 pre_configure() {
 	# We need some host binaries before starting cross compilation.
 	if [ "$CROSS_BUILD" ]; then
+		mkdir -p build.native
 		# XXX still broken: jemalloc configure execs host bins.
-		CC= CXX= CPP= LD= AR= AS= RANLIB= CFLAGS= CXXFLAGS= LDFLAGS= cmake .
-		make comp_err comp_sql gen_lex_hash gen_lex_token
-		mkdir bin.host
-		cp extra/comp_err bin.host
-		cp scripts/comp_sql bin.host
-		cp sql/gen_lex_hash bin.host
-		cp sql/gen_lex_token bin.host
-		make clean
-		rm CMakeCache.txt
+		CC= CXX= CPP= LD= AR= AS= RANLIB= CFLAGS= CXXFLAGS= LDFLAGS= \
+			cmake -S . -B build.native
+		make -C build.native comp_err comp_sql gen_lex_hash gen_lex_token
 	fi
 }
 
 pre_build() {
 	if [ "$CROSS_BUILD" ]; then
 		# CMake complains if those binaries ain't in build
-		cp bin.host/comp_err ${wrksrc}/extra
-		cp bin.host/comp_err ${wrksrc}/build/extra
-		cp bin.host/comp_sql ${wrksrc}/scripts
-		cp bin.host/comp_sql ${wrksrc}/build/scripts
-		cp bin.host/gen_lex_hash ${wrksrc}/sql
-		cp bin.host/gen_lex_hash ${wrksrc}/build/sql
-		cp bin.host/gen_lex_token ${wrksrc}/sql
-		cp bin.host/gen_lex_token ${wrksrc}/build/sql
+		cp build.native/extra/comp_err ${wrksrc}/extra
+		cp build.native/extra/comp_err ${wrksrc}/build/extra
+		cp build.native/scripts/comp_sql ${wrksrc}/scripts
+		cp build.native/scripts/comp_sql ${wrksrc}/build/scripts
+		cp build.native/sql/gen_lex_hash ${wrksrc}/sql
+		cp build.native/sql/gen_lex_hash ${wrksrc}/build/sql
+		cp build.native/sql/gen_lex_token ${wrksrc}/sql
+		cp build.native/sql/gen_lex_token ${wrksrc}/build/sql
 		export PATH=${PATH}:${wrksrc}/extra:${wrksrc}/scripts:${wrksrc}/sql
 	fi
 	export LD_LIBRARY_PATH=${wrksrc}/build/storage/tokudb/ft-index/portability

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: build-style/cmake: set CMAKE_BUILD_TYPE to None
  2021-03-14 13:19 [PR PATCH] [WIP] build-style/cmake: set CMAKE_BUILD_TYPE to None sgn
                   ` (3 preceding siblings ...)
  2021-03-21  9:45 ` sgn
@ 2021-03-21  9:48 ` sgn
  2021-03-21  9:48 ` [PR REVIEW] " sgn
                   ` (27 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: sgn @ 2021-03-21  9:48 UTC (permalink / raw)
  To: ml

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

New comment by sgn on void-packages repository

https://github.com/void-linux/void-packages/pull/29459#issuecomment-803544107

Comment:
Below changes will be submited separately:
- paraview: update to 5.9.0.
- vtk: devendor most of dependencies
- opencv4: update to 4.5.1.
- opencv: update to 3.4.13.
- libechonest-qt5: upstream moved
- k2pdfopt: update to 2.53.

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PR REVIEW] build-style/cmake: set CMAKE_BUILD_TYPE to None
  2021-03-14 13:19 [PR PATCH] [WIP] build-style/cmake: set CMAKE_BUILD_TYPE to None sgn
                   ` (4 preceding siblings ...)
  2021-03-21  9:48 ` sgn
@ 2021-03-21  9:48 ` sgn
  2021-03-21  9:52 ` sgn
                   ` (26 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: sgn @ 2021-03-21  9:48 UTC (permalink / raw)
  To: ml

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

New review comment by sgn on void-packages repository

https://github.com/void-linux/void-packages/pull/29459#discussion_r598251771

Comment:
@thypon 

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: build-style/cmake: set CMAKE_BUILD_TYPE to None
  2021-03-14 13:19 [PR PATCH] [WIP] build-style/cmake: set CMAKE_BUILD_TYPE to None sgn
                   ` (5 preceding siblings ...)
  2021-03-21  9:48 ` [PR REVIEW] " sgn
@ 2021-03-21  9:52 ` sgn
  2021-03-21  9:55 ` sgn
                   ` (25 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: sgn @ 2021-03-21  9:52 UTC (permalink / raw)
  To: ml

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

New comment by sgn on void-packages repository

https://github.com/void-linux/void-packages/pull/29459#issuecomment-803544107

Comment:
Below changes will be submited separately:
- paraview: update to 5.9.0.
- vtk: devendor most of dependencies
- opencv4: update to 4.5.1. #29565 
- opencv: update to 3.4.13. #29565 
- libechonest-qt5: upstream moved
- k2pdfopt: update to 2.53. #29536 

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: build-style/cmake: set CMAKE_BUILD_TYPE to None
  2021-03-14 13:19 [PR PATCH] [WIP] build-style/cmake: set CMAKE_BUILD_TYPE to None sgn
                   ` (6 preceding siblings ...)
  2021-03-21  9:52 ` sgn
@ 2021-03-21  9:55 ` sgn
  2021-03-21  9:55 ` [PR REVIEW] " thypon
                   ` (24 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: sgn @ 2021-03-21  9:55 UTC (permalink / raw)
  To: ml

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

New comment by sgn on void-packages repository

https://github.com/void-linux/void-packages/pull/29459#issuecomment-803544107

Comment:
Below changes will be submited separately:
- paraview: update to 5.9.0. #29648
- vtk: devendor most of dependencies #29647
- opencv4: update to 4.5.1. #29565 
- opencv: update to 3.4.13. #29565 
- libechonest-qt5: upstream moved
- k2pdfopt: update to 2.53. #29536 

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PR REVIEW] build-style/cmake: set CMAKE_BUILD_TYPE to None
  2021-03-14 13:19 [PR PATCH] [WIP] build-style/cmake: set CMAKE_BUILD_TYPE to None sgn
                   ` (7 preceding siblings ...)
  2021-03-21  9:55 ` sgn
@ 2021-03-21  9:55 ` thypon
  2021-03-21  9:55 ` thypon
                   ` (23 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: thypon @ 2021-03-21  9:55 UTC (permalink / raw)
  To: ml

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

New review comment by thypon on void-packages repository

https://github.com/void-linux/void-packages/pull/29459#discussion_r598252504

Comment:
I think it derived from archlinux package.

It should be defined this way now '-DEMBREE_MAX_ISA="AVX512SKX"'

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: build-style/cmake: set CMAKE_BUILD_TYPE to None
  2021-03-14 13:19 [PR PATCH] [WIP] build-style/cmake: set CMAKE_BUILD_TYPE to None sgn
                   ` (8 preceding siblings ...)
  2021-03-21  9:55 ` [PR REVIEW] " thypon
@ 2021-03-21  9:55 ` thypon
  2021-03-21  9:59 ` sgn
                   ` (22 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: thypon @ 2021-03-21  9:55 UTC (permalink / raw)
  To: ml

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

New comment by thypon on void-packages repository

https://github.com/void-linux/void-packages/pull/29459#issuecomment-803545371

Comment:
What's the reason for switching from release to none?

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: build-style/cmake: set CMAKE_BUILD_TYPE to None
  2021-03-14 13:19 [PR PATCH] [WIP] build-style/cmake: set CMAKE_BUILD_TYPE to None sgn
                   ` (9 preceding siblings ...)
  2021-03-21  9:55 ` thypon
@ 2021-03-21  9:59 ` sgn
  2021-03-23  9:15 ` [PR REVIEW] " Piraty
                   ` (21 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: sgn @ 2021-03-21  9:59 UTC (permalink / raw)
  To: ml

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

New comment by sgn on void-packages repository

https://github.com/void-linux/void-packages/pull/29459#issuecomment-803545914

Comment:
> What's the reason for switching from release to none?

Release force `-O3`

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PR REVIEW] build-style/cmake: set CMAKE_BUILD_TYPE to None
  2021-03-14 13:19 [PR PATCH] [WIP] build-style/cmake: set CMAKE_BUILD_TYPE to None sgn
                   ` (10 preceding siblings ...)
  2021-03-21  9:59 ` sgn
@ 2021-03-23  9:15 ` Piraty
  2021-03-25  0:45 ` [PR PATCH] [Updated] " sgn
                   ` (20 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: Piraty @ 2021-03-23  9:15 UTC (permalink / raw)
  To: ml

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

New review comment by Piraty on void-packages repository

https://github.com/void-linux/void-packages/pull/29459#discussion_r599391846

Comment:
this might make a good commit message, but not an in-source comment

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PR PATCH] [Updated] build-style/cmake: set CMAKE_BUILD_TYPE to None
  2021-03-14 13:19 [PR PATCH] [WIP] build-style/cmake: set CMAKE_BUILD_TYPE to None sgn
                   ` (11 preceding siblings ...)
  2021-03-23  9:15 ` [PR REVIEW] " Piraty
@ 2021-03-25  0:45 ` sgn
  2021-03-25  1:38 ` sgn
                   ` (19 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: sgn @ 2021-03-25  0:45 UTC (permalink / raw)
  To: ml

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

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

https://github.com/sgn/void-packages cmake-build-type-to-None
https://github.com/void-linux/void-packages/pull/29459

build-style/cmake: set CMAKE_BUILD_TYPE to None
- I'm going to build all packages with `build_style=cmake` and fix them one by one before merging this in.

[ci skip]

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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-cmake-build-type-to-None-29459.patch --]
[-- Type: text/x-diff, Size: 46620 bytes --]

From c0b78ace53e546c679ddac242002a2a5010f7bba 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, 14 Mar 2021 20:18:03 +0700
Subject: [PATCH 01/17] build-style/cmake: set CMAKE_BUILD_TYPE to None

---
 common/build-style/cmake.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/build-style/cmake.sh b/common/build-style/cmake.sh
index 5100a96dfd7b..9d1a1a7a1941 100644
--- a/common/build-style/cmake.sh
+++ b/common/build-style/cmake.sh
@@ -52,7 +52,7 @@ _EOF
 		cmake_args+=" -DCMAKE_TOOLCHAIN_FILE=cross_${XBPS_CROSS_TRIPLET}.cmake"
 	fi
 	cmake_args+=" -DCMAKE_INSTALL_PREFIX=/usr"
-	cmake_args+=" -DCMAKE_BUILD_TYPE=Release"
+	cmake_args+=" -DCMAKE_BUILD_TYPE=None"
 	cmake_args+=" -DCMAKE_INSTALL_LIBDIR=lib${XBPS_TARGET_WORDSIZE}"
 
 	if [[ $build_helper = *"qemu"* ]]; then

From 7be8ff40535dfcd2c59c913e3174163665cb21b3 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: Mon, 15 Mar 2021 08:07:16 +0700
Subject: [PATCH 02/17] amdvlk: allow CMAKE_BUILD_TYPE=None

---
 .../patches/cmake-build-type-none.patch       | 60 +++++++++++++++++++
 1 file changed, 60 insertions(+)
 create mode 100644 srcpkgs/amdvlk/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/amdvlk/patches/cmake-build-type-none.patch b/srcpkgs/amdvlk/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..7a629e58548e
--- /dev/null
+++ b/srcpkgs/amdvlk/patches/cmake-build-type-none.patch
@@ -0,0 +1,60 @@
+Index: llvm-project/llvm/CMakeLists.txt
+===================================================================
+--- llvm-project/llvm/CMakeLists.txt.orig
++++ llvm-project/llvm/CMakeLists.txt
+@@ -251,11 +251,6 @@ endif()
+ 
+ string(TOUPPER "${CMAKE_BUILD_TYPE}" uppercase_CMAKE_BUILD_TYPE)
+ 
+-if (CMAKE_BUILD_TYPE AND
+-    NOT uppercase_CMAKE_BUILD_TYPE MATCHES "^(DEBUG|RELEASE|RELWITHDEBINFO|MINSIZEREL)$")
+-  message(FATAL_ERROR "Invalid value for CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
+-endif()
+-
+ set(LLVM_LIBDIR_SUFFIX "" CACHE STRING "Define suffix of library directory name (32/64)" )
+ 
+ set(LLVM_TOOLS_INSTALL_DIR "bin" CACHE STRING "Path for binary subdirectory (defaults to 'bin')")
+Index: pal/cmake/Modules/AmdCmakeHelper.cmake
+===================================================================
+--- pal/cmake/Modules/AmdCmakeHelper.cmake.orig
++++ pal/cmake/Modules/AmdCmakeHelper.cmake
+@@ -37,11 +37,6 @@ if (CMAKE_CONFIGURATION_TYPES)
+ else()
+     string(TOUPPER "${CMAKE_BUILD_TYPE}" capital_CMAKE_BUILD_TYPE)
+ 
+-    if (CMAKE_BUILD_TYPE AND
+-        NOT capital_CMAKE_BUILD_TYPE MATCHES "^(DEBUG|RELEASE|RELWITHDEBINFO|MINSIZEREL)$")
+-        message(FATAL_ERROR "Invalid value for CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
+-    endif()
+-
+     if(capital_CMAKE_BUILD_TYPE STREQUAL "DEBUG")
+         set(CMAKE_BUILD_TYPE_DEBUG ON)
+         set(CMAKE_BUILD_TYPE_RELEASE OFF)
+Index: xgl/CMakeLists.txt
+===================================================================
+--- xgl/CMakeLists.txt.orig
++++ xgl/CMakeLists.txt
+@@ -181,11 +181,6 @@ if (CMAKE_CONFIGURATION_TYPES)
+ else()
+     string(TOUPPER "${CMAKE_BUILD_TYPE}" capital_CMAKE_BUILD_TYPE)
+ 
+-    if (CMAKE_BUILD_TYPE AND
+-        NOT capital_CMAKE_BUILD_TYPE MATCHES "^(DEBUG|RELEASE|RELWITHDEBINFO|MINSIZEREL)$")
+-        message(FATAL_ERROR "Invalid value for CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
+-    endif()
+-
+     if(capital_CMAKE_BUILD_TYPE STREQUAL "DEBUG")
+         set(CMAKE_BUILD_TYPE_DEBUG ON)
+         set(CMAKE_BUILD_TYPE_RELEASE OFF)
+Index: xgl/icd/CMakeLists.txt
+===================================================================
+--- xgl/icd/CMakeLists.txt.orig
++++ xgl/icd/CMakeLists.txt
+@@ -84,7 +84,6 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Cl
+     endif()
+ 
+     if(CMAKE_BUILD_TYPE_RELEASE)
+-        target_compile_options(xgl PRIVATE -O3)
+         if(XGL_ENABLE_LTO)
+             if(${CMAKE_CXX_COMPILER_ID} MATCHES "GNU")
+                 execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION)

From 7d7b4c8eb8e4a70daebc2fa0e7f1e9f8c02df5a2 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: Wed, 17 Mar 2021 06:24:04 +0700
Subject: [PATCH 03/17] eigen*: set CMAKE_BUILD_TYPE to Release

We're going to set default CMAKE_BUILD_TYPE to None soon. Those packages
are header only libraries, no need to waste time on patching.
---
 srcpkgs/eigen/template    | 1 +
 srcpkgs/eigen3.2/template | 1 +
 2 files changed, 2 insertions(+)

diff --git a/srcpkgs/eigen/template b/srcpkgs/eigen/template
index ee825e95f273..072228c16915 100644
--- a/srcpkgs/eigen/template
+++ b/srcpkgs/eigen/template
@@ -3,6 +3,7 @@ pkgname=eigen
 version=3.3.9
 revision=1
 build_style=cmake
+configure_args="-DCMAKE_BUILD_TYPE=Release"
 short_desc="C++ template library for linear algebra (version 3.x)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MPL-2.0, GPL-3.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
diff --git a/srcpkgs/eigen3.2/template b/srcpkgs/eigen3.2/template
index 5715fc1b3a19..7b710534b5e5 100644
--- a/srcpkgs/eigen3.2/template
+++ b/srcpkgs/eigen3.2/template
@@ -4,6 +4,7 @@ version=3.2.10
 revision=3
 wrksrc="eigen-${version}"
 build_style=cmake
+configure_args="-DCMAKE_BUILD_TYPE=Release"
 short_desc="C++ template library for linear algebra (version 3.x)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MPL-2.0, GPL-3.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"

From a60865874d618e70e7a7ea77fc5836a9504f0b8b 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: Wed, 17 Mar 2021 07:04:48 +0700
Subject: [PATCH 04/17] embree: don't ignore CXXFLAGS, fix build with ispc
 1.13+

---
 .../embree/patches/uintNN-is-part-of-ispc-1.13.patch | 12 ++++++++++++
 srcpkgs/embree/template                              |  6 ++----
 2 files changed, 14 insertions(+), 4 deletions(-)
 create mode 100644 srcpkgs/embree/patches/uintNN-is-part-of-ispc-1.13.patch

diff --git a/srcpkgs/embree/patches/uintNN-is-part-of-ispc-1.13.patch b/srcpkgs/embree/patches/uintNN-is-part-of-ispc-1.13.patch
new file mode 100644
index 000000000000..5d0b02f3b2e5
--- /dev/null
+++ b/srcpkgs/embree/patches/uintNN-is-part-of-ispc-1.13.patch
@@ -0,0 +1,12 @@
+Index: embree-2.17.7/tutorials/common/common.isph
+===================================================================
+--- embree-2.17.7.orig/tutorials/common/common.isph
++++ embree-2.17.7/tutorials/common/common.isph
+@@ -16,7 +16,3 @@
+ 
+ #pragma once
+ 
+-typedef unsigned int64 uint64;
+-typedef unsigned int32 uint32;
+-typedef unsigned int16 uint16;
+-typedef unsigned int8  uint8;
diff --git a/srcpkgs/embree/template b/srcpkgs/embree/template
index 0bc72f46b6d8..849ec3c26c1d 100644
--- a/srcpkgs/embree/template
+++ b/srcpkgs/embree/template
@@ -4,6 +4,7 @@ version=2.17.7
 revision=2
 archs="x86_64"
 build_style=cmake
+configure_args="-DTBB_ROOT=/usr -DEMBREE_IGNORE_CMAKE_CXX_FLAGS=OFF"
 hostmakedepends="ispc"
 makedepends="libfreeglut-devel libXmu-devel tbb-devel MesaLib-devel libpng-devel
  libopenexr-devel libjpeg-turbo-devel libmagick-devel"
@@ -13,10 +14,7 @@ license="Apache-2.0"
 homepage="https://embree.github.io/"
 distfiles="https://github.com/$pkgname/$pkgname/archive/v$version.tar.gz"
 checksum=c0694f287fa1fbb382aba3a895702e248d92f7e89c0e5f64aefee965482ec04c
-
-nopie=y
-
-configure_args="-DTBB_ROOT=/usr -DENABLE_TUTORIALS=OFF"
+patch_args=-Np1
 
 embree-devel_package() {
 	depends="${sourcepkg}>=${version}_${revision}"

From 3df90c8e8f65d6594eb1811b6dc03e9d34b09754 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: Wed, 17 Mar 2021 07:35:19 +0700
Subject: [PATCH 05/17] ettercap: remove libressl patch, CMAKE_BUILD_TYPE=None

---
 .../patches/allow-build-type-none.patch       | 24 ++++++++++++++
 srcpkgs/ettercap/patches/libressl.patch       | 31 -------------------
 srcpkgs/ettercap/template                     |  9 ++++--
 3 files changed, 31 insertions(+), 33 deletions(-)
 create mode 100644 srcpkgs/ettercap/patches/allow-build-type-none.patch
 delete mode 100644 srcpkgs/ettercap/patches/libressl.patch

diff --git a/srcpkgs/ettercap/patches/allow-build-type-none.patch b/srcpkgs/ettercap/patches/allow-build-type-none.patch
new file mode 100644
index 000000000000..324d75086b05
--- /dev/null
+++ b/srcpkgs/ettercap/patches/allow-build-type-none.patch
@@ -0,0 +1,24 @@
+Index: ettercap-0.8.3.1/CMakeLists.txt
+===================================================================
+--- ettercap-0.8.3.1.orig/CMakeLists.txt
++++ ettercap-0.8.3.1/CMakeLists.txt
+@@ -22,19 +22,6 @@ option(LIBRARY_BUILD "Build for libetter
+ option(INSTALL_DESKTOP "Install ettercap desktop files" ON)
+ 
+ 
+-set(VALID_BUILD_TYPES Debug Release RelWithDebInfo)
+-
+-if(NOT CMAKE_BUILD_TYPE)
+-  # Default to using "Release" as our build type.
+-  set(CMAKE_BUILD_TYPE "Release" CACHE STRING
+-    "Choose the type of build, options are: ${VALID_BUILD_TYPES}." FORCE)
+-endif()
+-list(FIND VALID_BUILD_TYPES ${CMAKE_BUILD_TYPE} contains_valid)
+-if(contains_valid EQUAL -1)
+-  message(FATAL_ERROR "Unknown CMAKE_BUILD_TYPE: '${CMAKE_BUILD_TYPE}'. Valid options are: ${VALID_BUILD_TYPES}")
+-endif()
+-unset(contains_valid)
+-
+ include(CMakeDependentOption)
+ 
+ # If SYSTEM_LIBS is set to off, then all SYSTEM_* options will be
diff --git a/srcpkgs/ettercap/patches/libressl.patch b/srcpkgs/ettercap/patches/libressl.patch
deleted file mode 100644
index 15e0d3c1c9e7..000000000000
--- a/srcpkgs/ettercap/patches/libressl.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From b2f7634c9dbc0ef68640f0571787d92300e9f9f9 Mon Sep 17 00:00:00 2001
-From: Stefan Strogin <stefan@steils.org>
-Date: Sat, 15 Aug 2020 07:18:31 +0300
-Subject: [PATCH] ec_sslwrap: fix compilation with LibreSSL
-
-Disable taking over SNI extension from ClientHello and SSL configuration
-operations until LibreSSL supports the required API.
-
-Fixes: https://github.com/Ettercap/ettercap/issues/1068
----
- src/ec_sslwrap.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git src/ec_sslwrap.c src/ec_sslwrap.c
-index b9f26a142..1e4c24fc1 100644
---- src/ec_sslwrap.c
-+++ src/ec_sslwrap.c
-@@ -71,11 +71,11 @@
- #define TLS_server_method SSLv23_server_method
- #endif
- 
--#if (OPENSSL_VERSION_NUMBER >= 0x10100000L)
-+#if (OPENSSL_VERSION_NUMBER >= 0x10100000L) && !defined(LIBRESSL_VERSION_NUMBER)
- #define HAVE_OPENSSL_1_1_0
- #endif
- 
--#if (OPENSSL_VERSION_NUMBER >= 0x10101000L)
-+#if (OPENSSL_VERSION_NUMBER >= 0x10101000L) && !defined(LIBRESSL_VERSION_NUMBER)
- #define HAVE_OPENSSL_1_1_1
- #endif
- 
diff --git a/srcpkgs/ettercap/template b/srcpkgs/ettercap/template
index 7fe4c340a079..611b4e9aded7 100644
--- a/srcpkgs/ettercap/template
+++ b/srcpkgs/ettercap/template
@@ -3,8 +3,8 @@ pkgname=ettercap
 version=0.8.3.1
 revision=2
 build_style=cmake
-configure_args="-DENABLE_GTK=OFF"
-hostmakedepends="flex"
+configure_args="-DENABLE_GTK=OFF -DBUNDLED_LIBS=OFF"
+hostmakedepends="flex pkg-config"
 makedepends="geoip-devel ncurses-devel openssl-devel libcurl-devel
  libltdl-devel libnet-devel libpcap-devel pcre-devel"
 conf_files="/etc/${pkgname}/etter.conf"
@@ -15,5 +15,10 @@ homepage="http://ettercap.github.com/ettercap/"
 distfiles="https://github.com/Ettercap/ettercap/archive/v${version}.tar.gz"
 checksum=d0c3ef88dfc284b61d3d5b64d946c1160fd04276b448519c1ae4438a9cdffaf3
 lib32disabled=yes
+patch_args=-Np1
 
 CFLAGS="-fcommon"
+
+post_extract() {
+	rm -rf bundled_deps
+}

From e79e4f30aae357bd9041a6e0774ba05750e29128 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: Wed, 17 Mar 2021 08:27:10 +0700
Subject: [PATCH 06/17] injeqt: disable coverage

---
 srcpkgs/injeqt/template | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/injeqt/template b/srcpkgs/injeqt/template
index 1e5777fc0f18..78eba09a0249 100644
--- a/srcpkgs/injeqt/template
+++ b/srcpkgs/injeqt/template
@@ -3,7 +3,8 @@ pkgname=injeqt
 version=1.2.0
 revision=2
 build_style=cmake
-hostmakedepends="pkg-config"
+configure_args="-DDISABLE_COVERAGE=ON"
+hostmakedepends="pkg-config qt5-qmake qt5-host-tools"
 makedepends="qt5-devel"
 short_desc="Dependency injection framework for Qt"
 maintainer="Jürgen Buchmüller <pullmoll@t-online.de>"
@@ -12,9 +13,6 @@ homepage="https://github.com/vogel/injeqt/"
 distfiles="https://github.com/vogel/${pkgname}/archive/${version}.tar.gz>${pkgname}-${version}.tar.gz"
 checksum=77540cedb0b26affe993dd18124d796059e34c80a51d9ae6433fdff1860db135
 
-if [ -n "$CROSS_BUILD" ]; then
-	hostmakedepends+=" qt5-host-tools qt5-devel"
-fi
 CXXFLAGS="-fno-lifetime-dse -Wno-error=cast-align"
 
 injeqt-devel_package() {

From e12a376cb2af1613a7946543d571477e07d1b5e9 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: Wed, 17 Mar 2021 22:26:37 +0700
Subject: [PATCH 07/17] kindd: build with CMAKE_BUILD_TYPE=None

---
 srcpkgs/kindd/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/kindd/template b/srcpkgs/kindd/template
index e634b0f69bf6..4416041de58c 100644
--- a/srcpkgs/kindd/template
+++ b/srcpkgs/kindd/template
@@ -15,7 +15,7 @@ distfiles="${homepage}/archive/${version}.tar.gz"
 checksum=e596f1b1577ff3e83a779e6181252ae2f09731f513d17dd6b95cbc2cf204654f
 
 do_install() {
-	vbin release/kindd
+	vbin build/core/kindd
 	vinstall assets/appconf/kindd.svg 644 usr/share/pixmaps
 	vinstall assets/appconf/kindd.desktop 644 usr/share/applications
 }

From 696ea938a905a1bbe3ab2482a3e2cfa6523edfbc 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: Thu, 18 Mar 2021 23:58:53 +0700
Subject: [PATCH 08/17] occt: allow CMAKE_BUILD_TYPE=None

---
 srcpkgs/occt/patches/cmake-build-type-none.patch | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 srcpkgs/occt/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/occt/patches/cmake-build-type-none.patch b/srcpkgs/occt/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..acb06fb55766
--- /dev/null
+++ b/srcpkgs/occt/patches/cmake-build-type-none.patch
@@ -0,0 +1,13 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -4,7 +4,7 @@ set (CMAKE_MODULE_PATH "${CMAKE_SOURCE_D
+ 
+ set (CMAKE_SUPPRESS_REGENERATION TRUE)
+ 
+-set (CMAKE_CONFIGURATION_TYPES Release Debug RelWithDebInfo CACHE INTERNAL "" FORCE)
++set (CMAKE_CONFIGURATION_TYPES None Release Debug RelWithDebInfo CACHE INTERNAL "" FORCE)
+ 
+ # macro: include patched file if it exists
+ macro (OCCT_INCLUDE_CMAKE_FILE BEING_INCLUDED_FILE)

From 460078bac5369a33b061c6da1dff0c82fa6ac569 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: Fri, 19 Mar 2021 23:07:05 +0700
Subject: [PATCH 09/17] renderdoc: devendor zstd, lz4

---
 .../patches/build-type-none-is-release.patch  | 12 ++++
 .../renderdoc/patches/qmake-no-rpath.patch    | 13 ++++
 .../renderdoc/patches/unvendor-zstd-lz4.patch | 68 +++++++++++++++++++
 srcpkgs/renderdoc/template                    | 15 ++--
 4 files changed, 99 insertions(+), 9 deletions(-)
 create mode 100644 srcpkgs/renderdoc/patches/build-type-none-is-release.patch
 create mode 100644 srcpkgs/renderdoc/patches/qmake-no-rpath.patch
 create mode 100644 srcpkgs/renderdoc/patches/unvendor-zstd-lz4.patch

diff --git a/srcpkgs/renderdoc/patches/build-type-none-is-release.patch b/srcpkgs/renderdoc/patches/build-type-none-is-release.patch
new file mode 100644
index 000000000000..f16b944bc12c
--- /dev/null
+++ b/srcpkgs/renderdoc/patches/build-type-none-is-release.patch
@@ -0,0 +1,12 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -315,6 +315,7 @@ set(RELEASE_MODE 0)
+ 
+ if(cmake_build_type_lower STREQUAL "release" OR
+    cmake_build_type_lower STREQUAL "relwithdebinfo" OR
++   cmake_build_type_lower STREQUAL "none" OR
+    cmake_build_type_lower STREQUAL "minsizerel")
+     add_definitions(-D_RELEASE)
+     message(STATUS "Building RenderDoc in Release mode: ${CMAKE_BUILD_TYPE}")
diff --git a/srcpkgs/renderdoc/patches/qmake-no-rpath.patch b/srcpkgs/renderdoc/patches/qmake-no-rpath.patch
new file mode 100644
index 000000000000..6e6325c53555
--- /dev/null
+++ b/srcpkgs/renderdoc/patches/qmake-no-rpath.patch
@@ -0,0 +1,13 @@
+Index: qrenderdoc/CMakeLists.txt
+===================================================================
+--- qrenderdoc/CMakeLists.txt.orig
++++ qrenderdoc/CMakeLists.txt
+@@ -144,7 +144,7 @@ endif()
+ # and finding dependencies from the cmake build
+ file(WRITE
+      ${CMAKE_BINARY_DIR}/qrenderdoc/qrenderdoc_cmake.pri
+-     "CONFIG+=${QMAKE_CONFIG}\n"
++     "CONFIG+=${QMAKE_CONFIG} no_qt_rpath\n"
+      "\n"
+      "QMAKE_CC=${CMAKE_C_COMPILER}\n"
+      "QMAKE_CXX=${CMAKE_CXX_COMPILER}\n"
diff --git a/srcpkgs/renderdoc/patches/unvendor-zstd-lz4.patch b/srcpkgs/renderdoc/patches/unvendor-zstd-lz4.patch
new file mode 100644
index 000000000000..d4003ded9161
--- /dev/null
+++ b/srcpkgs/renderdoc/patches/unvendor-zstd-lz4.patch
@@ -0,0 +1,68 @@
+Index: renderdoc/CMakeLists.txt
+===================================================================
+--- renderdoc/CMakeLists.txt.orig
++++ renderdoc/CMakeLists.txt
+@@ -213,54 +213,10 @@ set(sources
+     3rdparty/pugixml/pugixml.cpp
+     3rdparty/pugixml/pugixml.hpp
+     3rdparty/pugixml/pugiconfig.hpp
+-    3rdparty/lz4/lz4.c
+-    3rdparty/lz4/lz4.h
+     3rdparty/miniz/miniz.c
+     3rdparty/miniz/miniz.h
+     3rdparty/superluminal/superluminal.cpp
+     3rdparty/superluminal/superluminal.h
+-    3rdparty/zstd/bitstream.h
+-    3rdparty/zstd/compiler.h
+-    3rdparty/zstd/cpu.h
+-    3rdparty/zstd/debug.c
+-    3rdparty/zstd/debug.h
+-    3rdparty/zstd/entropy_common.c
+-    3rdparty/zstd/error_private.c
+-    3rdparty/zstd/error_private.h
+-    3rdparty/zstd/fse.h
+-    3rdparty/zstd/fse_compress.c
+-    3rdparty/zstd/fse_decompress.c
+-    3rdparty/zstd/hist.c
+-    3rdparty/zstd/hist.h
+-    3rdparty/zstd/huf.h
+-    3rdparty/zstd/huf_compress.c
+-    3rdparty/zstd/huf_decompress.c
+-    3rdparty/zstd/mem.h
+-    3rdparty/zstd/pool.c
+-    3rdparty/zstd/pool.h
+-    3rdparty/zstd/threading.c
+-    3rdparty/zstd/threading.h
+-    3rdparty/zstd/xxhash.c
+-    3rdparty/zstd/xxhash.h
+-    3rdparty/zstd/zstd.h
+-    3rdparty/zstd/zstd_common.c
+-    3rdparty/zstd/zstd_compress.c
+-    3rdparty/zstd/zstd_compress_internal.h
+-    3rdparty/zstd/zstd_decompress.c
+-    3rdparty/zstd/zstd_double_fast.c
+-    3rdparty/zstd/zstd_double_fast.h
+-    3rdparty/zstd/zstd_errors.h
+-    3rdparty/zstd/zstd_fast.c
+-    3rdparty/zstd/zstd_fast.h
+-    3rdparty/zstd/zstd_internal.h
+-    3rdparty/zstd/zstd_lazy.c
+-    3rdparty/zstd/zstd_lazy.h
+-    3rdparty/zstd/zstd_ldm.c
+-    3rdparty/zstd/zstd_ldm.h
+-    3rdparty/zstd/zstd_opt.c
+-    3rdparty/zstd/zstd_opt.h
+-    3rdparty/zstd/zstdmt_compress.c
+-    3rdparty/zstd/zstdmt_compress.h
+     3rdparty/stb/stb_image.h
+     3rdparty/stb/stb_image_write.h
+     3rdparty/stb/stb_image_resize.h
+@@ -271,6 +227,8 @@ set(sources
+     3rdparty/tinyfiledialogs/tinyfiledialogs.c
+     3rdparty/tinyfiledialogs/tinyfiledialogs.h)
+ 
++list(APPEND RDOC_LIBRARIES -llz4 -lzstd)
++
+ if(ANDROID)
+     list(APPEND sources
+         data/embedded_files.h
diff --git a/srcpkgs/renderdoc/template b/srcpkgs/renderdoc/template
index 7240e9ebc307..4615d45c52c9 100644
--- a/srcpkgs/renderdoc/template
+++ b/srcpkgs/renderdoc/template
@@ -1,13 +1,14 @@
 # Template file for 'renderdoc'
 pkgname=renderdoc
 version=1.12
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DENABLE_GL=ON -DENABLE_GLES=ON -DENABLE_QRENDERDOC=ON
  -DENABLE_RENDERDOCCMD=ON -DENABLE_VULKAN=ON -DENABLE_XCB=ON -DENABLE_XLIB=ON
  -DENABLE_PYRENDERDOC=ON"
-hostmakedepends="bison autoconf automake pkg-config python3"
+hostmakedepends="bison autoconf automake pkg-config python3 swig"
 makedepends="libX11-devel libxcb-devel xcb-util-keysyms-devel qt5-devel
+ libzstd-devel liblz4-devel
  qt5-svg-devel qt5-x11extras-devel pcre-devel python3-devel"
 short_desc="Stand-alone graphics debugging tool for Vulkan and OpenGL"
 maintainer="Urs Schulz <voidpkgs@ursschulz.de>"
@@ -19,19 +20,14 @@ checksum=4dece1b4cb859a76533b28fcd50e17321acfaa81c3435500a006c4a5ba15fddb
 if [ "$XBPS_TARGET_LIBC" = musl ]; then
 	makedepends+=" libexecinfo-devel"
 	LDLIBS="-lexecinfo"
+	broken="uses RTLD_DL_LINKMAP, RTLD_DEEPBIND, _r_debug"
 fi
 
 if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
 	makedepends+=" libatomic-devel"
 fi
 
-case "$XBPS_TARGET_MACHINE" in
-	*-musl) broken="uses RTLD_DL_LINKMAP, RTLD_DEEPBIND, _r_debug" ;;
-esac
-
-if [ "$CROSS_BUILD" ]; then
-	broken="Cross-compilation can't find python3 interpreter"
-fi
+nocross="Cross-compilation can't find python3 interpreter"
 
 post_patch() {
 	[ -z "$XBPS_TARGET_NO_ATOMIC8" ] && return 0
@@ -40,4 +36,5 @@ post_patch() {
 
 post_install() {
 	vlicense LICENSE.md
+	vlicense docs/credits_acknowledgements.rst
 }

From 25c169d53cb3ae195144d4a41a7b252a342d4380 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: Sat, 20 Mar 2021 00:47:52 +0700
Subject: [PATCH 10/17] python3-occ: build with CMAKE_BUILD_TYPE=None

---
 srcpkgs/python3-occ/template | 1 +
 1 file changed, 1 insertion(+)

diff --git a/srcpkgs/python3-occ/template b/srcpkgs/python3-occ/template
index 705f37457943..3ea0ef5e6387 100644
--- a/srcpkgs/python3-occ/template
+++ b/srcpkgs/python3-occ/template
@@ -5,6 +5,7 @@ revision=1
 archs="i686* x86_64* armv7l* aarch64* ppc*"
 wrksrc="pythonocc-core-${version}"
 build_style=cmake
+configure_args="-DPYTHONOCC_BUILD_TYPE=None -DCMAKE_BUILD_TYPE=None"
 hostmakedepends="python3 swig"
 makedepends="python3-devel occt-devel freetype-devel swig"
 depends="python3 occt freetype"

From edca0503dc14719bd48836252f3dab366b6c5f06 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: Fri, 19 Mar 2021 23:38:10 +0700
Subject: [PATCH 11/17] widelands: allow CMAKE_BUILD_TYPE=None

---
 srcpkgs/widelands-data                        |  1 -
 .../patches/cmake-build-type-none.patch       | 63 +++++++++++++++++++
 .../widelands/patches/fix-install-path.patch  | 40 ++++++++++++
 srcpkgs/widelands/template                    | 21 +------
 4 files changed, 105 insertions(+), 20 deletions(-)
 delete mode 120000 srcpkgs/widelands-data
 create mode 100644 srcpkgs/widelands/patches/cmake-build-type-none.patch
 create mode 100644 srcpkgs/widelands/patches/fix-install-path.patch

diff --git a/srcpkgs/widelands-data b/srcpkgs/widelands-data
deleted file mode 120000
index e9fbf89517f2..000000000000
--- a/srcpkgs/widelands-data
+++ /dev/null
@@ -1 +0,0 @@
-widelands
\ No newline at end of file
diff --git a/srcpkgs/widelands/patches/cmake-build-type-none.patch b/srcpkgs/widelands/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..3d210854741b
--- /dev/null
+++ b/srcpkgs/widelands/patches/cmake-build-type-none.patch
@@ -0,0 +1,63 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -202,7 +202,7 @@ elseif(CMAKE_BUILD_TYPE STREQUAL "RelWit
+   set(WL_DEBUG_FLAGS "-DNDEBUG -DNOPARACHUTE")
+   option(OPTION_ASAN "Build with AddressSanitizer" ON)
+ else()
+-  message(FATAL_ERROR "Unknown CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
++  set(WL_DEBUG_FLAGS "-DNDEBUG -DNOPARACHUTE")
+ endif()
+ 
+ wl_add_flag(WL_GENERIC_CXX_FLAGS "-std=c++11")
+@@ -353,7 +353,7 @@ endif (OPTION_BUILD_TESTS)
+ install (
+   FILES ${CMAKE_CURRENT_BINARY_DIR}/VERSION
+   DESTINATION ${WL_INSTALL_BASEDIR}
+-  CONFIGURATIONS Debug;Release
++  CONFIGURATIONS Debug
+   COMPONENT CoreVersionFile
+ )
+ 
+@@ -378,7 +378,6 @@ install(
+     data/txts
+     data/world
+   DESTINATION ${WL_INSTALL_DATADIR}
+-  CONFIGURATIONS Debug;Release
+   COMPONENT CoreDataFiles
+ )
+ 
+@@ -386,7 +385,6 @@ install(
+   DIRECTORY
+     data/maps
+   DESTINATION ${WL_INSTALL_DATADIR}
+-  CONFIGURATIONS Debug;Release
+   COMPONENT MapFiles
+ )
+ 
+@@ -395,7 +393,6 @@ install(
+     data/music
+     data/sound
+   DESTINATION ${WL_INSTALL_DATADIR}
+-  CONFIGURATIONS Debug;Release
+   COMPONENT MusicFiles
+ )
+ 
+@@ -405,7 +402,7 @@ install(
+     CREDITS
+     ChangeLog
+   DESTINATION ${WL_INSTALL_BASEDIR}
+-  CONFIGURATIONS Debug;Release
++  CONFIGURATIONS Debug
+   COMPONENT CoreLicenseFiles
+ )
+ 
+@@ -424,7 +421,6 @@ install(
+   DIRECTORY
+     ${CMAKE_CURRENT_BINARY_DIR}/locale/
+   DESTINATION ${WL_INSTALL_DATADIR}/locale
+-  CONFIGURATIONS Debug;Release
+   COMPONENT CoreLanguageFiles
+ )
+ 
diff --git a/srcpkgs/widelands/patches/fix-install-path.patch b/srcpkgs/widelands/patches/fix-install-path.patch
new file mode 100644
index 000000000000..6bb461389f03
--- /dev/null
+++ b/srcpkgs/widelands/patches/fix-install-path.patch
@@ -0,0 +1,40 @@
+Index: cmake/WlFunctions.cmake
+===================================================================
+--- cmake/WlFunctions.cmake.orig
++++ cmake/WlFunctions.cmake
+@@ -289,5 +289,5 @@ function(wl_binary NAME)
+ 
+   #Quoting the CMake documentation on DESTINATION:
+   #"If a relative path is given it is interpreted relative to the value of CMAKE_INSTALL_PREFIX"
+-  install(TARGETS ${NAME} DESTINATION "." COMPONENT ExecutableFiles)
++  install(TARGETS ${NAME} DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT ExecutableFiles)
+ endfunction()
+Index: xdg/CMakeLists.txt
+===================================================================
+--- xdg/CMakeLists.txt.orig
++++ xdg/CMakeLists.txt
+@@ -6,19 +6,19 @@ set(XDG_APPLICATION_ID "org.widelands.Wi
+ list(APPEND icon_sizes "16" "32" "48" "64" "128")
+ foreach (icon_size ${icon_sizes})
+   #install(FILES ${CMAKE_SOURCE_DIR}/data/images/logos/wl-ico-${icon_size}.png DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/${icon_size}x${icon_size}/apps RENAME ${XDG_APPLICATION_ID}.png)
+-  install(FILES ${CMAKE_SOURCE_DIR}/data/images/logos/wl-ico-${icon_size}.png DESTINATION ../share/icons/hicolor/${icon_size}x${icon_size}/apps RENAME ${XDG_APPLICATION_ID}.png)
++  install(FILES ${CMAKE_SOURCE_DIR}/data/images/logos/wl-ico-${icon_size}.png DESTINATION share/icons/hicolor/${icon_size}x${icon_size}/apps RENAME ${XDG_APPLICATION_ID}.png)
+ endforeach (icon_size ${icon_sizes})
+ #install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${CMAKE_PROJECT_NAME}.6           DESTINATION ${CMAKE_INSTALL_MANDIR}/man6)
+-install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${CMAKE_PROJECT_NAME}.6           DESTINATION ../share/man/man6)
++install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${CMAKE_PROJECT_NAME}.6           DESTINATION share/man/man6)
+ #install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${XDG_APPLICATION_ID}.desktop     DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications)
+-install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${XDG_APPLICATION_ID}.desktop     DESTINATION ../share/applications)
++install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${XDG_APPLICATION_ID}.desktop     DESTINATION share/applications)
+ #install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${XDG_APPLICATION_ID}.appdata.xml DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/metainfo)
+-install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${XDG_APPLICATION_ID}.appdata.xml DESTINATION ../share/metainfo)
++install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${XDG_APPLICATION_ID}.appdata.xml DESTINATION share/metainfo)
+ 
+ find_program(GTK_UPDATE_ICON_CACHE NAMES gtk-update-icon-cache)
+ if (GTK_UPDATE_ICON_CACHE)
+   #install(CODE "execute_process (COMMAND ${GTK_UPDATE_ICON_CACHE} -t -f ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor ||: )")
+-  install(CODE "execute_process (COMMAND ${GTK_UPDATE_ICON_CACHE} -t -f ${CMAKE_INSTALL_PREFIX}/../share/icons/hicolor ||: )")
++  install(CODE "execute_process (COMMAND ${GTK_UPDATE_ICON_CACHE} -t -f ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor ||: )")
+ else (GTK_UPDATE_ICON_CACHE)
+   message(WARNING "gtk-update-icon-cache not found!")
+ endif (GTK_UPDATE_ICON_CACHE)
diff --git a/srcpkgs/widelands/template b/srcpkgs/widelands/template
index 6cee85087ea7..cfa2c10993e0 100644
--- a/srcpkgs/widelands/template
+++ b/srcpkgs/widelands/template
@@ -1,7 +1,7 @@
 # Template file for 'widelands'
 pkgname=widelands
 version=21
-revision=3
+revision=4
 wrksrc="${pkgname}-build${version}"
 build_style=cmake
 configure_args="-DOPENGL_INCLUDE_DIR=${XBPS_CROSS_BASE}/usr/include
@@ -10,13 +10,13 @@ hostmakedepends="python3 pkg-config gettext"
 makedepends="boost-devel icu-devel minizip-devel gettext-devel
  glu-devel glew-devel SDL2-devel SDL2_gfx-devel SDL2_image-devel
  SDL2_net-devel SDL2_mixer-devel SDL2_ttf-devel"
-depends="${pkgname}-data-${version}_${revision}"
 short_desc="Real-time strategy game"
 maintainer="Jürgen Buchmüller <pullmoll@t-online.de>"
 license="GPL-2.0-or-later"
 homepage="http://www.widelands.org/"
 distfiles="https://github.com/widelands/widelands/archive/build${version}.tar.gz>${pkgname}-${version}.tar.gz"
 checksum=601e0e4c6f91b3fb0ece2cd1b83ecfb02344a1b9194fbb70ef3f70e06994e357
+replaces="widelands-data>=0"
 
 CXXFLAGS="-DU_USING_ICU_NAMESPACE=1"
 
@@ -29,22 +29,5 @@ if [ "$CROSS_BUILD" ]; then
 fi
 
 post_install() {
-	# For some reason the binary is installed as /usr/widelands - move it
-	vmkdir usr/bin
-	mv ${DESTDIR}/usr/${pkgname} ${DESTDIR}/usr/bin
-	vmkdir usr/share
-	mv ${DESTDIR}/share/* ${DESTDIR}/usr/share/
-	rmdir ${DESTDIR}/share
-
-	# Remove files not needed in the package
-	rm -f ${DESTDIR}/usr/COPYING ${DESTDIR}/usr/CREDITS ${DESTDIR}/usr/ChangeLog ${DESTDIR}/usr/VERSION
-
 	vinstall ${FILESDIR}/${pkgname}.desktop 644 usr/share/applications
 }
-
-widelands-data_package() {
-	short_desc+=" - data files"
-	pkg_install() {
-		vmove usr/share/widelands
-	}
-}

From e8f5c10736617910048c849e657bff94d0292923 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: Sat, 20 Mar 2021 09:49:25 +0700
Subject: [PATCH 12/17] zziplib: fix SONAME when build with
 -DCMAKE_BUILD_TYPE=None

---
 .../cmake-build-type-none-soname.patch        | 35 +++++++++++++++++++
 srcpkgs/zziplib/template                      |  1 +
 2 files changed, 36 insertions(+)
 create mode 100644 srcpkgs/zziplib/patches/cmake-build-type-none-soname.patch

diff --git a/srcpkgs/zziplib/patches/cmake-build-type-none-soname.patch b/srcpkgs/zziplib/patches/cmake-build-type-none-soname.patch
new file mode 100644
index 000000000000..2d31b5b8a46a
--- /dev/null
+++ b/srcpkgs/zziplib/patches/cmake-build-type-none-soname.patch
@@ -0,0 +1,35 @@
+Index: zziplib-0.13.72/zzip/CMakeLists.txt
+===================================================================
+--- zziplib-0.13.72.orig/zzip/CMakeLists.txt
++++ zziplib-0.13.72/zzip/CMakeLists.txt
+@@ -190,15 +190,18 @@ target_include_directories (libzzipmmapp
+ endif()
+ 
+ set_target_properties(libzzip PROPERTIES OUTPUT_NAME "zzip" RELEASE_POSTFIX "-${RELNUM}")
++set_target_properties(libzzip PROPERTIES OUTPUT_NAME "zzip" NONE_POSTFIX "-${RELNUM}")
+ SET_TARGET_PROPERTIES(libzzip PROPERTIES VERSION ${VERNUM}.${FIXNUM} SOVERSION ${VERNUM})
+ 
+ if(ZZIPFSEEKO)
+ set_target_properties(libzzipfseeko PROPERTIES OUTPUT_NAME "zzipfseeko" RELEASE_POSTFIX "-${RELNUM}")
++set_target_properties(libzzipfseeko PROPERTIES OUTPUT_NAME "zzipfseeko" NONE_POSTFIX "-${RELNUM}")
+ SET_TARGET_PROPERTIES(libzzipfseeko PROPERTIES VERSION ${VERNUM}.${FIXNUM} SOVERSION ${VERNUM})
+ endif()
+ 
+ if(ZZIPMMAPPED)
+ set_target_properties(libzzipmmapped PROPERTIES OUTPUT_NAME "zzipmmapped" RELEASE_POSTFIX "-${RELNUM}")
++set_target_properties(libzzipmmapped PROPERTIES OUTPUT_NAME "zzipmmapped" NONE_POSTFIX "-${RELNUM}")
+ SET_TARGET_PROPERTIES(libzzipmmapped PROPERTIES VERSION ${VERNUM}.${FIXNUM} SOVERSION ${VERNUM})
+ endif()
+ 
+Index: zziplib-0.13.72/zzipwrap/CMakeLists.txt
+===================================================================
+--- zziplib-0.13.72.orig/zzipwrap/CMakeLists.txt
++++ zziplib-0.13.72/zzipwrap/CMakeLists.txt
+@@ -49,6 +49,7 @@ target_link_libraries(libzzipwrap libzzi
+ target_include_directories(libzzipwrap PRIVATE "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}")
+ 
+ set_target_properties(libzzipwrap PROPERTIES OUTPUT_NAME "zzipwrap" RELEASE_POSTFIX "-${RELNUM}")
++set_target_properties(libzzipwrap PROPERTIES OUTPUT_NAME "zzipwrap" NONE_POSTFIX "-${RELNUM}")
+ SET_TARGET_PROPERTIES(libzzipwrap PROPERTIES VERSION ${VERNUM}.${FIXNUM} SOVERSION ${VERNUM})
+ set_target_properties(libzzipwrap PROPERTIES DEFINE_SYMBOL "libzzip_EXPORTS")
+ 
diff --git a/srcpkgs/zziplib/template b/srcpkgs/zziplib/template
index ab5af234af62..2026f3e4a521 100644
--- a/srcpkgs/zziplib/template
+++ b/srcpkgs/zziplib/template
@@ -12,6 +12,7 @@ homepage="https://github.com/gdraheim/zziplib"
 changelog="https://raw.githubusercontent.com/gdraheim/zziplib/master/ChangeLog"
 distfiles="https://github.com/gdraheim/zziplib/archive/v${version}.tar.gz"
 checksum=93ef44bf1f1ea24fc66080426a469df82fa631d13ca3b2e4abaeab89538518dc
+patch_args=-Np1
 
 if [ "$CROSS_BUILD" ]; then
 	configure_args+=" -DZZIPTEST=OFF"

From ae883d60fc8ae070c8a3fab84aa9f1c27cc7cf6b 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, 21 Mar 2021 15:28:04 +0700
Subject: [PATCH 13/17] mellowplayer: fix build

---
 srcpkgs/mellowplayer/patches/no-werror.patch | 13 +++++++++++++
 srcpkgs/mellowplayer/template                | 13 +++++++------
 2 files changed, 20 insertions(+), 6 deletions(-)
 create mode 100644 srcpkgs/mellowplayer/patches/no-werror.patch

diff --git a/srcpkgs/mellowplayer/patches/no-werror.patch b/srcpkgs/mellowplayer/patches/no-werror.patch
new file mode 100644
index 000000000000..7e678453a123
--- /dev/null
+++ b/srcpkgs/mellowplayer/patches/no-werror.patch
@@ -0,0 +1,13 @@
+Index: MellowPlayer-3.6.6/src/3rdparty/boost/di.hpp
+===================================================================
+--- MellowPlayer-3.6.6.orig/src/3rdparty/boost/di.hpp
++++ MellowPlayer-3.6.6/src/3rdparty/boost/di.hpp
+@@ -67,7 +67,7 @@ BOOST_DI_CFG_FWD
+ #pragma clang diagnostic error "-Wundefined-internal"
+ #pragma clang diagnostic ignored "-Wmissing-field-initializers"
+ #elif defined(__GCC__)
+-#pragma GCC diagnostic error "-Wdeprecated-declarations"
++#pragma GCC diagnostic warning "-Wdeprecated-declarations"
+ #pragma GCC diagnostic push
+ #if (__GNUC__ < 6)
+ #pragma GCC diagnostic error "-Werror"
diff --git a/srcpkgs/mellowplayer/template b/srcpkgs/mellowplayer/template
index 2f8f13960ca6..cfd8a185556f 100644
--- a/srcpkgs/mellowplayer/template
+++ b/srcpkgs/mellowplayer/template
@@ -4,7 +4,7 @@ version=3.6.6
 revision=1
 wrksrc="MellowPlayer-${version}"
 build_style=cmake
-hostmakedepends="pkg-config qt5-tools qt5-qmake"
+hostmakedepends="pkg-config qt5-tools qt5-qmake qt5-host-tools"
 makedepends="qt5-declarative-devel qt5-quickcontrols2-devel
  qt5-plugin-mysql qt5-plugin-pgsql qt5-plugin-sqlite
  qt5-plugin-tds qt5-plugin-odbc
@@ -17,11 +17,12 @@ license="GPL-2.0-or-later"
 homepage="https://colinduquesnoy.gitlab.io/MellowPlayer/"
 distfiles="https://gitlab.com/ColinDuquesnoy/MellowPlayer/-/archive/${version}/MellowPlayer-${version}.tar.bz2"
 checksum=17b8b25ca6b3d27b223f8be6ad80186ae5bd17ce762eb04ecd8b0e82e687b327
+patch_args=-Np1
 
-if [ "$CROSS_BUILD" ]; then
-	hostmakedepends+=" qt5-host-tools"
+if [ "$XBPS_WORDSIZE" != "$XBPS_TARGET_WORDSIZE" ]; then
+	broken="webengine can be built only if word size matches"
 fi
 
-case "$XBPS_TARGET_MACHINE" in
-	arm*) broken="qt5-webengine not available" ;;
-esac
+if [ "$XBPS_TARGET_ENDIAN" != "le" ]; then
+	broken="webengine only supports little endian"
+fi

From 3edb59146513e9e4ed8368017ae94f0b37d56f80 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, 21 Mar 2021 15:43:09 +0700
Subject: [PATCH 14/17] ispc: fix CMAKE_BUILD_TYPE=None

---
 .../ispc/patches/cmake-build-type-none.patch   | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
 create mode 100644 srcpkgs/ispc/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/ispc/patches/cmake-build-type-none.patch b/srcpkgs/ispc/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..411e353c7314
--- /dev/null
+++ b/srcpkgs/ispc/patches/cmake-build-type-none.patch
@@ -0,0 +1,18 @@
+Index: ispc-1.15.0/CMakeLists.txt
+===================================================================
+--- ispc-1.15.0.orig/CMakeLists.txt
++++ ispc-1.15.0/CMakeLists.txt
+@@ -157,13 +157,6 @@ set(OUTPUT_RELEASE Release/bin)
+ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin )
+ 
+ if(CMAKE_BUILD_TYPE)
+-    # Validate build type
+-    set(CONFIGURATION_TYPES "Debug;Release;RelWithDebInfo")
+-
+-    string(FIND "${CONFIGURATION_TYPES}" "${CMAKE_BUILD_TYPE}" MATCHED_CONFIG)
+-    if (${MATCHED_CONFIG} EQUAL -1)
+-         message(FATAL_ERROR "CMAKE_BUILD_TYPE (${CMAKE_BUILD_TYPE}) allows only the following values: ${CONFIGURATION_TYPES}")
+-    endif()
+ else(NOT CMAKE_BUILD_TYPE)
+     set(CMAKE_BUILD_TYPE "Release")
+     message(STATUS "Build type not specified: Use Release by default.")

From 7cf4758d5acb5f440fb52b44301865897a6f741c 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, 21 Mar 2021 15:56:50 +0700
Subject: [PATCH 15/17] darktable: fix CMAKE_BUILD_TYPE=None

---
 .../darktable/patches/cmake-build-type-none.patch  | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
 create mode 100644 srcpkgs/darktable/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/darktable/patches/cmake-build-type-none.patch b/srcpkgs/darktable/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..7101f9c1a0e7
--- /dev/null
+++ b/srcpkgs/darktable/patches/cmake-build-type-none.patch
@@ -0,0 +1,14 @@
+Index: src/external/rawspeed/cmake/build-type.cmake
+===================================================================
+--- src/external/rawspeed/cmake/build-type.cmake.orig
++++ src/external/rawspeed/cmake/build-type.cmake
+@@ -27,9 +27,6 @@ string(TOUPPER "${RAWSPEED_SPECIAL_BUILD
+ 
+ # is this one of the known build types?
+ list (FIND CMAKE_CONFIGURATION_TYPES_UPPERCASE ${CMAKE_BUILD_TYPE_UPPERCASE} BUILD_TYPE_IS_KNOWN)
+-if (${BUILD_TYPE_IS_KNOWN} EQUAL -1)
+- message(SEND_ERROR "Unknown build type: ${CMAKE_BUILD_TYPE_UPPERCASE}. Please specify one of: ${CMAKE_CONFIGURATION_TYPES}")
+-endif()
+ 
+ # is this a special build?
+ list (FIND RAWSPEED_SPECIAL_BUILD_TYPES_UPPERCASE ${CMAKE_BUILD_TYPE_UPPERCASE} IS_SPECIAL_BUILD)

From bffce4873ddcb17fc785be5cd6bad8dc085762bd 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, 21 Mar 2021 15:33:29 +0700
Subject: [PATCH 16/17] hedgewars: merge -data back

---
 srcpkgs/hedgewars-data                        |  1 -
 .../patches/cmake-build-type-none.patch       | 30 +++++++++++++++++++
 srcpkgs/hedgewars/template                    | 23 +++++---------
 3 files changed, 38 insertions(+), 16 deletions(-)
 delete mode 120000 srcpkgs/hedgewars-data
 create mode 100644 srcpkgs/hedgewars/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/hedgewars-data b/srcpkgs/hedgewars-data
deleted file mode 120000
index b57dc45ebadc..000000000000
--- a/srcpkgs/hedgewars-data
+++ /dev/null
@@ -1 +0,0 @@
-hedgewars
\ No newline at end of file
diff --git a/srcpkgs/hedgewars/patches/cmake-build-type-none.patch b/srcpkgs/hedgewars/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..b4e0c186717c
--- /dev/null
+++ b/srcpkgs/hedgewars/patches/cmake-build-type-none.patch
@@ -0,0 +1,30 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -54,7 +54,7 @@ option(NOVERSIONINFOUPDATE "Disable upda
+ 
+ 
+ if(BUILD_ENGINE_C AND NOT NOVIDEOREC)
+-    if((CMAKE_BUILD_TYPE STREQUAL "Release") OR (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo"))
++    if((CMAKE_BUILD_TYPE STREQUAL "Release") OR (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo") OR (CMAKE_BUILD_TYPE STREQUAL "None"))
+         message("NOTE: Video recorder support disabled. It's incompatible with BUILD_ENGINE_C")
+         set(BUILD_ENGINE_C ON CACHE STRING "Required for BUILD_ENGINE_JS" FORCE)
+     else()
+@@ -93,7 +93,7 @@ set(CPACK_PACKAGE_VERSION_MAJOR 1)
+ set(CPACK_PACKAGE_VERSION_MINOR 0)
+ set(CPACK_PACKAGE_VERSION_PATCH 0)
+ set(HEDGEWARS_PROTO_VER 59)
+-if((CMAKE_BUILD_TYPE STREQUAL "Release") OR (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo"))
++if((CMAKE_BUILD_TYPE STREQUAL "Release") OR (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo") OR (CMAKE_BUILD_TYPE STREQUAL "None"))
+     set(HEDGEWARS_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
+ else()
+     set(HEDGEWARS_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}-dev")
+@@ -114,6 +114,7 @@ include(${CMAKE_MODULE_PATH}/platform.cm
+ if(CMAKE_BUILD_TYPE)
+     if(NOT((CMAKE_BUILD_TYPE STREQUAL "Release") OR
+            (CMAKE_BUILD_TYPE STREQUAL "Debug") OR
++	   (CMAKE_BUILD_TYPE STREQUAL "None") OR
+            (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")))
+         set(CMAKE_BUILD_TYPE ${default_build_type} CACHE STRING "Build type (Debug/Release/RelWithDebInfo)" FORCE)
+         message(STATUS "Unknown build type ${CMAKE_BUILD_TYPE}, using default (${default_build_type})")
diff --git a/srcpkgs/hedgewars/template b/srcpkgs/hedgewars/template
index d2294cf572f5..f413a965ff2e 100644
--- a/srcpkgs/hedgewars/template
+++ b/srcpkgs/hedgewars/template
@@ -1,15 +1,15 @@
 # Template file for 'hedgewars'
 pkgname=hedgewars
 version=1.0.0
-revision=2
+revision=3
 wrksrc="${pkgname}-src-${version}"
 build_style=cmake
 configure_args="-DNOSERVER=1 -DDATA_INSTALL_DIR=/usr/share/${pkgname}
- -DPHYSFS_SYSTEM=1 -DCMAKE_VERBOSE_MAKEFILE=1 -DMINIMAL_FLAGS=1"
-hostmakedepends="lua51 pkg-config"
+ -DPHYSFS_SYSTEM=1 -DMINIMAL_FLAGS=1"
+hostmakedepends="lua51 pkg-config qt5-qmake qt5-host-tools"
 makedepends="ffmpeg-devel lua51-devel physfs-devel qt5-tools-devel SDL2_image-devel
  SDL2_mixer-devel SDL2_net-devel SDL2_ttf-devel"
-depends="hedgewars-data>=${version}_${revision} libfreeglut"
+depends="libfreeglut"
 short_desc="Funny turn-based artillery game, featuring fighting Hedgehogs!"
 maintainer="Jakub Skrzypnik <jot.skrzyp@gmail.com>"
 license="GPL-2.0-only"
@@ -18,10 +18,9 @@ distfiles="https://hedgewars.org/download/releases/hedgewars-src-${version}.tar.
 checksum=211634e61f2e4beecc3c98c6f749601fcd08321fda1ba969b3b3832a004f155b
 nopie_files="/usr/bin/hwengine"
 nocross="Needs investigation: fails to link hwengine"
-
-if [ -n "$CROSS_BUILD" ]; then
-	hostmakedepends+=" qt5-devel"
-fi
+replaces="hedgewars-data>=0"
+export CMAKE_GENERATOR="Unix Makefiles"
+make_cmd=make
 
 case $XBPS_TARGET_MACHINE in
 	x86_64*)
@@ -38,6 +37,7 @@ esac
 
 if [ -n "$_use_c_engine" ]; then
 	hostmakedepends+=" glew-devel libatomic-devel ghc clang"
+	makedepends+=" glew-devel libatomic-devel"
 	configure_args+=" -DBUILD_ENGINE_C=1"
 	nopie_files+=" /usr/bin/hedgewars"
 fi
@@ -56,10 +56,3 @@ pre_configure() {
 post_install() {
 	vinstall ${DESTDIR}/usr/share/hedgewars/Data/misc/hedgewars.desktop 644 usr/share/applications
 }
-
-hedgewars-data_package() {
-	short_desc+=" - data files"
-	pkg_install() {
-		vmove usr/share/hedgewars/Data
-	}
-}

From 8dce29e8dad8ccd73f9f0476e816046dae92ec81 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, 21 Mar 2021 16:41:58 +0700
Subject: [PATCH 17/17] mariadb: fix for CMAKE_BUILD_TYPE=None

---
 srcpkgs/mariadb/template | 32 ++++++++++++++------------------
 1 file changed, 14 insertions(+), 18 deletions(-)

diff --git a/srcpkgs/mariadb/template b/srcpkgs/mariadb/template
index 437ff757b383..78d5e2dbdbe8 100644
--- a/srcpkgs/mariadb/template
+++ b/srcpkgs/mariadb/template
@@ -34,35 +34,31 @@ replaces="mysql>=0"
 conf_files="/etc/mysql/my.cnf"
 system_accounts="mysql"
 mysql_homedir="/var/lib/mysql"
-CFLAGS="-w -fcommon"
+CFLAGS="-w -fcommon -DDBUG_OFF=1"
+CXXFLAGS="-DDBUG_OFF=1"
 
 pre_configure() {
 	# We need some host binaries before starting cross compilation.
 	if [ "$CROSS_BUILD" ]; then
+		mkdir -p build.native
 		# XXX still broken: jemalloc configure execs host bins.
-		CC= CXX= CPP= LD= AR= AS= RANLIB= CFLAGS= CXXFLAGS= LDFLAGS= cmake .
-		make comp_err comp_sql gen_lex_hash gen_lex_token
-		mkdir bin.host
-		cp extra/comp_err bin.host
-		cp scripts/comp_sql bin.host
-		cp sql/gen_lex_hash bin.host
-		cp sql/gen_lex_token bin.host
-		make clean
-		rm CMakeCache.txt
+		CC= CXX= CPP= LD= AR= AS= RANLIB= CFLAGS= CXXFLAGS= LDFLAGS= \
+			cmake -S . -B build.native
+		make -C build.native comp_err comp_sql gen_lex_hash gen_lex_token
 	fi
 }
 
 pre_build() {
 	if [ "$CROSS_BUILD" ]; then
 		# CMake complains if those binaries ain't in build
-		cp bin.host/comp_err ${wrksrc}/extra
-		cp bin.host/comp_err ${wrksrc}/build/extra
-		cp bin.host/comp_sql ${wrksrc}/scripts
-		cp bin.host/comp_sql ${wrksrc}/build/scripts
-		cp bin.host/gen_lex_hash ${wrksrc}/sql
-		cp bin.host/gen_lex_hash ${wrksrc}/build/sql
-		cp bin.host/gen_lex_token ${wrksrc}/sql
-		cp bin.host/gen_lex_token ${wrksrc}/build/sql
+		cp build.native/extra/comp_err ${wrksrc}/extra
+		cp build.native/extra/comp_err ${wrksrc}/build/extra
+		cp build.native/scripts/comp_sql ${wrksrc}/scripts
+		cp build.native/scripts/comp_sql ${wrksrc}/build/scripts
+		cp build.native/sql/gen_lex_hash ${wrksrc}/sql
+		cp build.native/sql/gen_lex_hash ${wrksrc}/build/sql
+		cp build.native/sql/gen_lex_token ${wrksrc}/sql
+		cp build.native/sql/gen_lex_token ${wrksrc}/build/sql
 		export PATH=${PATH}:${wrksrc}/extra:${wrksrc}/scripts:${wrksrc}/sql
 	fi
 	export LD_LIBRARY_PATH=${wrksrc}/build/storage/tokudb/ft-index/portability

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PR PATCH] [Updated] build-style/cmake: set CMAKE_BUILD_TYPE to None
  2021-03-14 13:19 [PR PATCH] [WIP] build-style/cmake: set CMAKE_BUILD_TYPE to None sgn
                   ` (12 preceding siblings ...)
  2021-03-25  0:45 ` [PR PATCH] [Updated] " sgn
@ 2021-03-25  1:38 ` sgn
  2021-03-26 15:13 ` sgn
                   ` (18 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: sgn @ 2021-03-25  1:38 UTC (permalink / raw)
  To: ml

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

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

https://github.com/sgn/void-packages cmake-build-type-to-None
https://github.com/void-linux/void-packages/pull/29459

build-style/cmake: set CMAKE_BUILD_TYPE to None
- I'm going to build all packages with `build_style=cmake` and fix them one by one before merging this in.

[ci skip]

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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-cmake-build-type-to-None-29459.patch --]
[-- Type: text/x-diff, Size: 55250 bytes --]

From c0b78ace53e546c679ddac242002a2a5010f7bba 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, 14 Mar 2021 20:18:03 +0700
Subject: [PATCH 01/21] build-style/cmake: set CMAKE_BUILD_TYPE to None

---
 common/build-style/cmake.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/build-style/cmake.sh b/common/build-style/cmake.sh
index 5100a96dfd7b..9d1a1a7a1941 100644
--- a/common/build-style/cmake.sh
+++ b/common/build-style/cmake.sh
@@ -52,7 +52,7 @@ _EOF
 		cmake_args+=" -DCMAKE_TOOLCHAIN_FILE=cross_${XBPS_CROSS_TRIPLET}.cmake"
 	fi
 	cmake_args+=" -DCMAKE_INSTALL_PREFIX=/usr"
-	cmake_args+=" -DCMAKE_BUILD_TYPE=Release"
+	cmake_args+=" -DCMAKE_BUILD_TYPE=None"
 	cmake_args+=" -DCMAKE_INSTALL_LIBDIR=lib${XBPS_TARGET_WORDSIZE}"
 
 	if [[ $build_helper = *"qemu"* ]]; then

From 7be8ff40535dfcd2c59c913e3174163665cb21b3 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: Mon, 15 Mar 2021 08:07:16 +0700
Subject: [PATCH 02/21] amdvlk: allow CMAKE_BUILD_TYPE=None

---
 .../patches/cmake-build-type-none.patch       | 60 +++++++++++++++++++
 1 file changed, 60 insertions(+)
 create mode 100644 srcpkgs/amdvlk/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/amdvlk/patches/cmake-build-type-none.patch b/srcpkgs/amdvlk/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..7a629e58548e
--- /dev/null
+++ b/srcpkgs/amdvlk/patches/cmake-build-type-none.patch
@@ -0,0 +1,60 @@
+Index: llvm-project/llvm/CMakeLists.txt
+===================================================================
+--- llvm-project/llvm/CMakeLists.txt.orig
++++ llvm-project/llvm/CMakeLists.txt
+@@ -251,11 +251,6 @@ endif()
+ 
+ string(TOUPPER "${CMAKE_BUILD_TYPE}" uppercase_CMAKE_BUILD_TYPE)
+ 
+-if (CMAKE_BUILD_TYPE AND
+-    NOT uppercase_CMAKE_BUILD_TYPE MATCHES "^(DEBUG|RELEASE|RELWITHDEBINFO|MINSIZEREL)$")
+-  message(FATAL_ERROR "Invalid value for CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
+-endif()
+-
+ set(LLVM_LIBDIR_SUFFIX "" CACHE STRING "Define suffix of library directory name (32/64)" )
+ 
+ set(LLVM_TOOLS_INSTALL_DIR "bin" CACHE STRING "Path for binary subdirectory (defaults to 'bin')")
+Index: pal/cmake/Modules/AmdCmakeHelper.cmake
+===================================================================
+--- pal/cmake/Modules/AmdCmakeHelper.cmake.orig
++++ pal/cmake/Modules/AmdCmakeHelper.cmake
+@@ -37,11 +37,6 @@ if (CMAKE_CONFIGURATION_TYPES)
+ else()
+     string(TOUPPER "${CMAKE_BUILD_TYPE}" capital_CMAKE_BUILD_TYPE)
+ 
+-    if (CMAKE_BUILD_TYPE AND
+-        NOT capital_CMAKE_BUILD_TYPE MATCHES "^(DEBUG|RELEASE|RELWITHDEBINFO|MINSIZEREL)$")
+-        message(FATAL_ERROR "Invalid value for CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
+-    endif()
+-
+     if(capital_CMAKE_BUILD_TYPE STREQUAL "DEBUG")
+         set(CMAKE_BUILD_TYPE_DEBUG ON)
+         set(CMAKE_BUILD_TYPE_RELEASE OFF)
+Index: xgl/CMakeLists.txt
+===================================================================
+--- xgl/CMakeLists.txt.orig
++++ xgl/CMakeLists.txt
+@@ -181,11 +181,6 @@ if (CMAKE_CONFIGURATION_TYPES)
+ else()
+     string(TOUPPER "${CMAKE_BUILD_TYPE}" capital_CMAKE_BUILD_TYPE)
+ 
+-    if (CMAKE_BUILD_TYPE AND
+-        NOT capital_CMAKE_BUILD_TYPE MATCHES "^(DEBUG|RELEASE|RELWITHDEBINFO|MINSIZEREL)$")
+-        message(FATAL_ERROR "Invalid value for CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
+-    endif()
+-
+     if(capital_CMAKE_BUILD_TYPE STREQUAL "DEBUG")
+         set(CMAKE_BUILD_TYPE_DEBUG ON)
+         set(CMAKE_BUILD_TYPE_RELEASE OFF)
+Index: xgl/icd/CMakeLists.txt
+===================================================================
+--- xgl/icd/CMakeLists.txt.orig
++++ xgl/icd/CMakeLists.txt
+@@ -84,7 +84,6 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Cl
+     endif()
+ 
+     if(CMAKE_BUILD_TYPE_RELEASE)
+-        target_compile_options(xgl PRIVATE -O3)
+         if(XGL_ENABLE_LTO)
+             if(${CMAKE_CXX_COMPILER_ID} MATCHES "GNU")
+                 execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION)

From 7d7b4c8eb8e4a70daebc2fa0e7f1e9f8c02df5a2 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: Wed, 17 Mar 2021 06:24:04 +0700
Subject: [PATCH 03/21] eigen*: set CMAKE_BUILD_TYPE to Release

We're going to set default CMAKE_BUILD_TYPE to None soon. Those packages
are header only libraries, no need to waste time on patching.
---
 srcpkgs/eigen/template    | 1 +
 srcpkgs/eigen3.2/template | 1 +
 2 files changed, 2 insertions(+)

diff --git a/srcpkgs/eigen/template b/srcpkgs/eigen/template
index ee825e95f273..072228c16915 100644
--- a/srcpkgs/eigen/template
+++ b/srcpkgs/eigen/template
@@ -3,6 +3,7 @@ pkgname=eigen
 version=3.3.9
 revision=1
 build_style=cmake
+configure_args="-DCMAKE_BUILD_TYPE=Release"
 short_desc="C++ template library for linear algebra (version 3.x)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MPL-2.0, GPL-3.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
diff --git a/srcpkgs/eigen3.2/template b/srcpkgs/eigen3.2/template
index 5715fc1b3a19..7b710534b5e5 100644
--- a/srcpkgs/eigen3.2/template
+++ b/srcpkgs/eigen3.2/template
@@ -4,6 +4,7 @@ version=3.2.10
 revision=3
 wrksrc="eigen-${version}"
 build_style=cmake
+configure_args="-DCMAKE_BUILD_TYPE=Release"
 short_desc="C++ template library for linear algebra (version 3.x)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MPL-2.0, GPL-3.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"

From a60865874d618e70e7a7ea77fc5836a9504f0b8b 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: Wed, 17 Mar 2021 07:04:48 +0700
Subject: [PATCH 04/21] embree: don't ignore CXXFLAGS, fix build with ispc
 1.13+

---
 .../embree/patches/uintNN-is-part-of-ispc-1.13.patch | 12 ++++++++++++
 srcpkgs/embree/template                              |  6 ++----
 2 files changed, 14 insertions(+), 4 deletions(-)
 create mode 100644 srcpkgs/embree/patches/uintNN-is-part-of-ispc-1.13.patch

diff --git a/srcpkgs/embree/patches/uintNN-is-part-of-ispc-1.13.patch b/srcpkgs/embree/patches/uintNN-is-part-of-ispc-1.13.patch
new file mode 100644
index 000000000000..5d0b02f3b2e5
--- /dev/null
+++ b/srcpkgs/embree/patches/uintNN-is-part-of-ispc-1.13.patch
@@ -0,0 +1,12 @@
+Index: embree-2.17.7/tutorials/common/common.isph
+===================================================================
+--- embree-2.17.7.orig/tutorials/common/common.isph
++++ embree-2.17.7/tutorials/common/common.isph
+@@ -16,7 +16,3 @@
+ 
+ #pragma once
+ 
+-typedef unsigned int64 uint64;
+-typedef unsigned int32 uint32;
+-typedef unsigned int16 uint16;
+-typedef unsigned int8  uint8;
diff --git a/srcpkgs/embree/template b/srcpkgs/embree/template
index 0bc72f46b6d8..849ec3c26c1d 100644
--- a/srcpkgs/embree/template
+++ b/srcpkgs/embree/template
@@ -4,6 +4,7 @@ version=2.17.7
 revision=2
 archs="x86_64"
 build_style=cmake
+configure_args="-DTBB_ROOT=/usr -DEMBREE_IGNORE_CMAKE_CXX_FLAGS=OFF"
 hostmakedepends="ispc"
 makedepends="libfreeglut-devel libXmu-devel tbb-devel MesaLib-devel libpng-devel
  libopenexr-devel libjpeg-turbo-devel libmagick-devel"
@@ -13,10 +14,7 @@ license="Apache-2.0"
 homepage="https://embree.github.io/"
 distfiles="https://github.com/$pkgname/$pkgname/archive/v$version.tar.gz"
 checksum=c0694f287fa1fbb382aba3a895702e248d92f7e89c0e5f64aefee965482ec04c
-
-nopie=y
-
-configure_args="-DTBB_ROOT=/usr -DENABLE_TUTORIALS=OFF"
+patch_args=-Np1
 
 embree-devel_package() {
 	depends="${sourcepkg}>=${version}_${revision}"

From 3df90c8e8f65d6594eb1811b6dc03e9d34b09754 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: Wed, 17 Mar 2021 07:35:19 +0700
Subject: [PATCH 05/21] ettercap: remove libressl patch, CMAKE_BUILD_TYPE=None

---
 .../patches/allow-build-type-none.patch       | 24 ++++++++++++++
 srcpkgs/ettercap/patches/libressl.patch       | 31 -------------------
 srcpkgs/ettercap/template                     |  9 ++++--
 3 files changed, 31 insertions(+), 33 deletions(-)
 create mode 100644 srcpkgs/ettercap/patches/allow-build-type-none.patch
 delete mode 100644 srcpkgs/ettercap/patches/libressl.patch

diff --git a/srcpkgs/ettercap/patches/allow-build-type-none.patch b/srcpkgs/ettercap/patches/allow-build-type-none.patch
new file mode 100644
index 000000000000..324d75086b05
--- /dev/null
+++ b/srcpkgs/ettercap/patches/allow-build-type-none.patch
@@ -0,0 +1,24 @@
+Index: ettercap-0.8.3.1/CMakeLists.txt
+===================================================================
+--- ettercap-0.8.3.1.orig/CMakeLists.txt
++++ ettercap-0.8.3.1/CMakeLists.txt
+@@ -22,19 +22,6 @@ option(LIBRARY_BUILD "Build for libetter
+ option(INSTALL_DESKTOP "Install ettercap desktop files" ON)
+ 
+ 
+-set(VALID_BUILD_TYPES Debug Release RelWithDebInfo)
+-
+-if(NOT CMAKE_BUILD_TYPE)
+-  # Default to using "Release" as our build type.
+-  set(CMAKE_BUILD_TYPE "Release" CACHE STRING
+-    "Choose the type of build, options are: ${VALID_BUILD_TYPES}." FORCE)
+-endif()
+-list(FIND VALID_BUILD_TYPES ${CMAKE_BUILD_TYPE} contains_valid)
+-if(contains_valid EQUAL -1)
+-  message(FATAL_ERROR "Unknown CMAKE_BUILD_TYPE: '${CMAKE_BUILD_TYPE}'. Valid options are: ${VALID_BUILD_TYPES}")
+-endif()
+-unset(contains_valid)
+-
+ include(CMakeDependentOption)
+ 
+ # If SYSTEM_LIBS is set to off, then all SYSTEM_* options will be
diff --git a/srcpkgs/ettercap/patches/libressl.patch b/srcpkgs/ettercap/patches/libressl.patch
deleted file mode 100644
index 15e0d3c1c9e7..000000000000
--- a/srcpkgs/ettercap/patches/libressl.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From b2f7634c9dbc0ef68640f0571787d92300e9f9f9 Mon Sep 17 00:00:00 2001
-From: Stefan Strogin <stefan@steils.org>
-Date: Sat, 15 Aug 2020 07:18:31 +0300
-Subject: [PATCH] ec_sslwrap: fix compilation with LibreSSL
-
-Disable taking over SNI extension from ClientHello and SSL configuration
-operations until LibreSSL supports the required API.
-
-Fixes: https://github.com/Ettercap/ettercap/issues/1068
----
- src/ec_sslwrap.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git src/ec_sslwrap.c src/ec_sslwrap.c
-index b9f26a142..1e4c24fc1 100644
---- src/ec_sslwrap.c
-+++ src/ec_sslwrap.c
-@@ -71,11 +71,11 @@
- #define TLS_server_method SSLv23_server_method
- #endif
- 
--#if (OPENSSL_VERSION_NUMBER >= 0x10100000L)
-+#if (OPENSSL_VERSION_NUMBER >= 0x10100000L) && !defined(LIBRESSL_VERSION_NUMBER)
- #define HAVE_OPENSSL_1_1_0
- #endif
- 
--#if (OPENSSL_VERSION_NUMBER >= 0x10101000L)
-+#if (OPENSSL_VERSION_NUMBER >= 0x10101000L) && !defined(LIBRESSL_VERSION_NUMBER)
- #define HAVE_OPENSSL_1_1_1
- #endif
- 
diff --git a/srcpkgs/ettercap/template b/srcpkgs/ettercap/template
index 7fe4c340a079..611b4e9aded7 100644
--- a/srcpkgs/ettercap/template
+++ b/srcpkgs/ettercap/template
@@ -3,8 +3,8 @@ pkgname=ettercap
 version=0.8.3.1
 revision=2
 build_style=cmake
-configure_args="-DENABLE_GTK=OFF"
-hostmakedepends="flex"
+configure_args="-DENABLE_GTK=OFF -DBUNDLED_LIBS=OFF"
+hostmakedepends="flex pkg-config"
 makedepends="geoip-devel ncurses-devel openssl-devel libcurl-devel
  libltdl-devel libnet-devel libpcap-devel pcre-devel"
 conf_files="/etc/${pkgname}/etter.conf"
@@ -15,5 +15,10 @@ homepage="http://ettercap.github.com/ettercap/"
 distfiles="https://github.com/Ettercap/ettercap/archive/v${version}.tar.gz"
 checksum=d0c3ef88dfc284b61d3d5b64d946c1160fd04276b448519c1ae4438a9cdffaf3
 lib32disabled=yes
+patch_args=-Np1
 
 CFLAGS="-fcommon"
+
+post_extract() {
+	rm -rf bundled_deps
+}

From e79e4f30aae357bd9041a6e0774ba05750e29128 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: Wed, 17 Mar 2021 08:27:10 +0700
Subject: [PATCH 06/21] injeqt: disable coverage

---
 srcpkgs/injeqt/template | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/injeqt/template b/srcpkgs/injeqt/template
index 1e5777fc0f18..78eba09a0249 100644
--- a/srcpkgs/injeqt/template
+++ b/srcpkgs/injeqt/template
@@ -3,7 +3,8 @@ pkgname=injeqt
 version=1.2.0
 revision=2
 build_style=cmake
-hostmakedepends="pkg-config"
+configure_args="-DDISABLE_COVERAGE=ON"
+hostmakedepends="pkg-config qt5-qmake qt5-host-tools"
 makedepends="qt5-devel"
 short_desc="Dependency injection framework for Qt"
 maintainer="Jürgen Buchmüller <pullmoll@t-online.de>"
@@ -12,9 +13,6 @@ homepage="https://github.com/vogel/injeqt/"
 distfiles="https://github.com/vogel/${pkgname}/archive/${version}.tar.gz>${pkgname}-${version}.tar.gz"
 checksum=77540cedb0b26affe993dd18124d796059e34c80a51d9ae6433fdff1860db135
 
-if [ -n "$CROSS_BUILD" ]; then
-	hostmakedepends+=" qt5-host-tools qt5-devel"
-fi
 CXXFLAGS="-fno-lifetime-dse -Wno-error=cast-align"
 
 injeqt-devel_package() {

From e12a376cb2af1613a7946543d571477e07d1b5e9 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: Wed, 17 Mar 2021 22:26:37 +0700
Subject: [PATCH 07/21] kindd: build with CMAKE_BUILD_TYPE=None

---
 srcpkgs/kindd/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/kindd/template b/srcpkgs/kindd/template
index e634b0f69bf6..4416041de58c 100644
--- a/srcpkgs/kindd/template
+++ b/srcpkgs/kindd/template
@@ -15,7 +15,7 @@ distfiles="${homepage}/archive/${version}.tar.gz"
 checksum=e596f1b1577ff3e83a779e6181252ae2f09731f513d17dd6b95cbc2cf204654f
 
 do_install() {
-	vbin release/kindd
+	vbin build/core/kindd
 	vinstall assets/appconf/kindd.svg 644 usr/share/pixmaps
 	vinstall assets/appconf/kindd.desktop 644 usr/share/applications
 }

From 696ea938a905a1bbe3ab2482a3e2cfa6523edfbc 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: Thu, 18 Mar 2021 23:58:53 +0700
Subject: [PATCH 08/21] occt: allow CMAKE_BUILD_TYPE=None

---
 srcpkgs/occt/patches/cmake-build-type-none.patch | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 srcpkgs/occt/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/occt/patches/cmake-build-type-none.patch b/srcpkgs/occt/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..acb06fb55766
--- /dev/null
+++ b/srcpkgs/occt/patches/cmake-build-type-none.patch
@@ -0,0 +1,13 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -4,7 +4,7 @@ set (CMAKE_MODULE_PATH "${CMAKE_SOURCE_D
+ 
+ set (CMAKE_SUPPRESS_REGENERATION TRUE)
+ 
+-set (CMAKE_CONFIGURATION_TYPES Release Debug RelWithDebInfo CACHE INTERNAL "" FORCE)
++set (CMAKE_CONFIGURATION_TYPES None Release Debug RelWithDebInfo CACHE INTERNAL "" FORCE)
+ 
+ # macro: include patched file if it exists
+ macro (OCCT_INCLUDE_CMAKE_FILE BEING_INCLUDED_FILE)

From 460078bac5369a33b061c6da1dff0c82fa6ac569 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: Fri, 19 Mar 2021 23:07:05 +0700
Subject: [PATCH 09/21] renderdoc: devendor zstd, lz4

---
 .../patches/build-type-none-is-release.patch  | 12 ++++
 .../renderdoc/patches/qmake-no-rpath.patch    | 13 ++++
 .../renderdoc/patches/unvendor-zstd-lz4.patch | 68 +++++++++++++++++++
 srcpkgs/renderdoc/template                    | 15 ++--
 4 files changed, 99 insertions(+), 9 deletions(-)
 create mode 100644 srcpkgs/renderdoc/patches/build-type-none-is-release.patch
 create mode 100644 srcpkgs/renderdoc/patches/qmake-no-rpath.patch
 create mode 100644 srcpkgs/renderdoc/patches/unvendor-zstd-lz4.patch

diff --git a/srcpkgs/renderdoc/patches/build-type-none-is-release.patch b/srcpkgs/renderdoc/patches/build-type-none-is-release.patch
new file mode 100644
index 000000000000..f16b944bc12c
--- /dev/null
+++ b/srcpkgs/renderdoc/patches/build-type-none-is-release.patch
@@ -0,0 +1,12 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -315,6 +315,7 @@ set(RELEASE_MODE 0)
+ 
+ if(cmake_build_type_lower STREQUAL "release" OR
+    cmake_build_type_lower STREQUAL "relwithdebinfo" OR
++   cmake_build_type_lower STREQUAL "none" OR
+    cmake_build_type_lower STREQUAL "minsizerel")
+     add_definitions(-D_RELEASE)
+     message(STATUS "Building RenderDoc in Release mode: ${CMAKE_BUILD_TYPE}")
diff --git a/srcpkgs/renderdoc/patches/qmake-no-rpath.patch b/srcpkgs/renderdoc/patches/qmake-no-rpath.patch
new file mode 100644
index 000000000000..6e6325c53555
--- /dev/null
+++ b/srcpkgs/renderdoc/patches/qmake-no-rpath.patch
@@ -0,0 +1,13 @@
+Index: qrenderdoc/CMakeLists.txt
+===================================================================
+--- qrenderdoc/CMakeLists.txt.orig
++++ qrenderdoc/CMakeLists.txt
+@@ -144,7 +144,7 @@ endif()
+ # and finding dependencies from the cmake build
+ file(WRITE
+      ${CMAKE_BINARY_DIR}/qrenderdoc/qrenderdoc_cmake.pri
+-     "CONFIG+=${QMAKE_CONFIG}\n"
++     "CONFIG+=${QMAKE_CONFIG} no_qt_rpath\n"
+      "\n"
+      "QMAKE_CC=${CMAKE_C_COMPILER}\n"
+      "QMAKE_CXX=${CMAKE_CXX_COMPILER}\n"
diff --git a/srcpkgs/renderdoc/patches/unvendor-zstd-lz4.patch b/srcpkgs/renderdoc/patches/unvendor-zstd-lz4.patch
new file mode 100644
index 000000000000..d4003ded9161
--- /dev/null
+++ b/srcpkgs/renderdoc/patches/unvendor-zstd-lz4.patch
@@ -0,0 +1,68 @@
+Index: renderdoc/CMakeLists.txt
+===================================================================
+--- renderdoc/CMakeLists.txt.orig
++++ renderdoc/CMakeLists.txt
+@@ -213,54 +213,10 @@ set(sources
+     3rdparty/pugixml/pugixml.cpp
+     3rdparty/pugixml/pugixml.hpp
+     3rdparty/pugixml/pugiconfig.hpp
+-    3rdparty/lz4/lz4.c
+-    3rdparty/lz4/lz4.h
+     3rdparty/miniz/miniz.c
+     3rdparty/miniz/miniz.h
+     3rdparty/superluminal/superluminal.cpp
+     3rdparty/superluminal/superluminal.h
+-    3rdparty/zstd/bitstream.h
+-    3rdparty/zstd/compiler.h
+-    3rdparty/zstd/cpu.h
+-    3rdparty/zstd/debug.c
+-    3rdparty/zstd/debug.h
+-    3rdparty/zstd/entropy_common.c
+-    3rdparty/zstd/error_private.c
+-    3rdparty/zstd/error_private.h
+-    3rdparty/zstd/fse.h
+-    3rdparty/zstd/fse_compress.c
+-    3rdparty/zstd/fse_decompress.c
+-    3rdparty/zstd/hist.c
+-    3rdparty/zstd/hist.h
+-    3rdparty/zstd/huf.h
+-    3rdparty/zstd/huf_compress.c
+-    3rdparty/zstd/huf_decompress.c
+-    3rdparty/zstd/mem.h
+-    3rdparty/zstd/pool.c
+-    3rdparty/zstd/pool.h
+-    3rdparty/zstd/threading.c
+-    3rdparty/zstd/threading.h
+-    3rdparty/zstd/xxhash.c
+-    3rdparty/zstd/xxhash.h
+-    3rdparty/zstd/zstd.h
+-    3rdparty/zstd/zstd_common.c
+-    3rdparty/zstd/zstd_compress.c
+-    3rdparty/zstd/zstd_compress_internal.h
+-    3rdparty/zstd/zstd_decompress.c
+-    3rdparty/zstd/zstd_double_fast.c
+-    3rdparty/zstd/zstd_double_fast.h
+-    3rdparty/zstd/zstd_errors.h
+-    3rdparty/zstd/zstd_fast.c
+-    3rdparty/zstd/zstd_fast.h
+-    3rdparty/zstd/zstd_internal.h
+-    3rdparty/zstd/zstd_lazy.c
+-    3rdparty/zstd/zstd_lazy.h
+-    3rdparty/zstd/zstd_ldm.c
+-    3rdparty/zstd/zstd_ldm.h
+-    3rdparty/zstd/zstd_opt.c
+-    3rdparty/zstd/zstd_opt.h
+-    3rdparty/zstd/zstdmt_compress.c
+-    3rdparty/zstd/zstdmt_compress.h
+     3rdparty/stb/stb_image.h
+     3rdparty/stb/stb_image_write.h
+     3rdparty/stb/stb_image_resize.h
+@@ -271,6 +227,8 @@ set(sources
+     3rdparty/tinyfiledialogs/tinyfiledialogs.c
+     3rdparty/tinyfiledialogs/tinyfiledialogs.h)
+ 
++list(APPEND RDOC_LIBRARIES -llz4 -lzstd)
++
+ if(ANDROID)
+     list(APPEND sources
+         data/embedded_files.h
diff --git a/srcpkgs/renderdoc/template b/srcpkgs/renderdoc/template
index 7240e9ebc307..4615d45c52c9 100644
--- a/srcpkgs/renderdoc/template
+++ b/srcpkgs/renderdoc/template
@@ -1,13 +1,14 @@
 # Template file for 'renderdoc'
 pkgname=renderdoc
 version=1.12
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DENABLE_GL=ON -DENABLE_GLES=ON -DENABLE_QRENDERDOC=ON
  -DENABLE_RENDERDOCCMD=ON -DENABLE_VULKAN=ON -DENABLE_XCB=ON -DENABLE_XLIB=ON
  -DENABLE_PYRENDERDOC=ON"
-hostmakedepends="bison autoconf automake pkg-config python3"
+hostmakedepends="bison autoconf automake pkg-config python3 swig"
 makedepends="libX11-devel libxcb-devel xcb-util-keysyms-devel qt5-devel
+ libzstd-devel liblz4-devel
  qt5-svg-devel qt5-x11extras-devel pcre-devel python3-devel"
 short_desc="Stand-alone graphics debugging tool for Vulkan and OpenGL"
 maintainer="Urs Schulz <voidpkgs@ursschulz.de>"
@@ -19,19 +20,14 @@ checksum=4dece1b4cb859a76533b28fcd50e17321acfaa81c3435500a006c4a5ba15fddb
 if [ "$XBPS_TARGET_LIBC" = musl ]; then
 	makedepends+=" libexecinfo-devel"
 	LDLIBS="-lexecinfo"
+	broken="uses RTLD_DL_LINKMAP, RTLD_DEEPBIND, _r_debug"
 fi
 
 if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
 	makedepends+=" libatomic-devel"
 fi
 
-case "$XBPS_TARGET_MACHINE" in
-	*-musl) broken="uses RTLD_DL_LINKMAP, RTLD_DEEPBIND, _r_debug" ;;
-esac
-
-if [ "$CROSS_BUILD" ]; then
-	broken="Cross-compilation can't find python3 interpreter"
-fi
+nocross="Cross-compilation can't find python3 interpreter"
 
 post_patch() {
 	[ -z "$XBPS_TARGET_NO_ATOMIC8" ] && return 0
@@ -40,4 +36,5 @@ post_patch() {
 
 post_install() {
 	vlicense LICENSE.md
+	vlicense docs/credits_acknowledgements.rst
 }

From 25c169d53cb3ae195144d4a41a7b252a342d4380 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: Sat, 20 Mar 2021 00:47:52 +0700
Subject: [PATCH 10/21] python3-occ: build with CMAKE_BUILD_TYPE=None

---
 srcpkgs/python3-occ/template | 1 +
 1 file changed, 1 insertion(+)

diff --git a/srcpkgs/python3-occ/template b/srcpkgs/python3-occ/template
index 705f37457943..3ea0ef5e6387 100644
--- a/srcpkgs/python3-occ/template
+++ b/srcpkgs/python3-occ/template
@@ -5,6 +5,7 @@ revision=1
 archs="i686* x86_64* armv7l* aarch64* ppc*"
 wrksrc="pythonocc-core-${version}"
 build_style=cmake
+configure_args="-DPYTHONOCC_BUILD_TYPE=None -DCMAKE_BUILD_TYPE=None"
 hostmakedepends="python3 swig"
 makedepends="python3-devel occt-devel freetype-devel swig"
 depends="python3 occt freetype"

From edca0503dc14719bd48836252f3dab366b6c5f06 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: Fri, 19 Mar 2021 23:38:10 +0700
Subject: [PATCH 11/21] widelands: allow CMAKE_BUILD_TYPE=None

---
 srcpkgs/widelands-data                        |  1 -
 .../patches/cmake-build-type-none.patch       | 63 +++++++++++++++++++
 .../widelands/patches/fix-install-path.patch  | 40 ++++++++++++
 srcpkgs/widelands/template                    | 21 +------
 4 files changed, 105 insertions(+), 20 deletions(-)
 delete mode 120000 srcpkgs/widelands-data
 create mode 100644 srcpkgs/widelands/patches/cmake-build-type-none.patch
 create mode 100644 srcpkgs/widelands/patches/fix-install-path.patch

diff --git a/srcpkgs/widelands-data b/srcpkgs/widelands-data
deleted file mode 120000
index e9fbf89517f2..000000000000
--- a/srcpkgs/widelands-data
+++ /dev/null
@@ -1 +0,0 @@
-widelands
\ No newline at end of file
diff --git a/srcpkgs/widelands/patches/cmake-build-type-none.patch b/srcpkgs/widelands/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..3d210854741b
--- /dev/null
+++ b/srcpkgs/widelands/patches/cmake-build-type-none.patch
@@ -0,0 +1,63 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -202,7 +202,7 @@ elseif(CMAKE_BUILD_TYPE STREQUAL "RelWit
+   set(WL_DEBUG_FLAGS "-DNDEBUG -DNOPARACHUTE")
+   option(OPTION_ASAN "Build with AddressSanitizer" ON)
+ else()
+-  message(FATAL_ERROR "Unknown CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
++  set(WL_DEBUG_FLAGS "-DNDEBUG -DNOPARACHUTE")
+ endif()
+ 
+ wl_add_flag(WL_GENERIC_CXX_FLAGS "-std=c++11")
+@@ -353,7 +353,7 @@ endif (OPTION_BUILD_TESTS)
+ install (
+   FILES ${CMAKE_CURRENT_BINARY_DIR}/VERSION
+   DESTINATION ${WL_INSTALL_BASEDIR}
+-  CONFIGURATIONS Debug;Release
++  CONFIGURATIONS Debug
+   COMPONENT CoreVersionFile
+ )
+ 
+@@ -378,7 +378,6 @@ install(
+     data/txts
+     data/world
+   DESTINATION ${WL_INSTALL_DATADIR}
+-  CONFIGURATIONS Debug;Release
+   COMPONENT CoreDataFiles
+ )
+ 
+@@ -386,7 +385,6 @@ install(
+   DIRECTORY
+     data/maps
+   DESTINATION ${WL_INSTALL_DATADIR}
+-  CONFIGURATIONS Debug;Release
+   COMPONENT MapFiles
+ )
+ 
+@@ -395,7 +393,6 @@ install(
+     data/music
+     data/sound
+   DESTINATION ${WL_INSTALL_DATADIR}
+-  CONFIGURATIONS Debug;Release
+   COMPONENT MusicFiles
+ )
+ 
+@@ -405,7 +402,7 @@ install(
+     CREDITS
+     ChangeLog
+   DESTINATION ${WL_INSTALL_BASEDIR}
+-  CONFIGURATIONS Debug;Release
++  CONFIGURATIONS Debug
+   COMPONENT CoreLicenseFiles
+ )
+ 
+@@ -424,7 +421,6 @@ install(
+   DIRECTORY
+     ${CMAKE_CURRENT_BINARY_DIR}/locale/
+   DESTINATION ${WL_INSTALL_DATADIR}/locale
+-  CONFIGURATIONS Debug;Release
+   COMPONENT CoreLanguageFiles
+ )
+ 
diff --git a/srcpkgs/widelands/patches/fix-install-path.patch b/srcpkgs/widelands/patches/fix-install-path.patch
new file mode 100644
index 000000000000..6bb461389f03
--- /dev/null
+++ b/srcpkgs/widelands/patches/fix-install-path.patch
@@ -0,0 +1,40 @@
+Index: cmake/WlFunctions.cmake
+===================================================================
+--- cmake/WlFunctions.cmake.orig
++++ cmake/WlFunctions.cmake
+@@ -289,5 +289,5 @@ function(wl_binary NAME)
+ 
+   #Quoting the CMake documentation on DESTINATION:
+   #"If a relative path is given it is interpreted relative to the value of CMAKE_INSTALL_PREFIX"
+-  install(TARGETS ${NAME} DESTINATION "." COMPONENT ExecutableFiles)
++  install(TARGETS ${NAME} DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT ExecutableFiles)
+ endfunction()
+Index: xdg/CMakeLists.txt
+===================================================================
+--- xdg/CMakeLists.txt.orig
++++ xdg/CMakeLists.txt
+@@ -6,19 +6,19 @@ set(XDG_APPLICATION_ID "org.widelands.Wi
+ list(APPEND icon_sizes "16" "32" "48" "64" "128")
+ foreach (icon_size ${icon_sizes})
+   #install(FILES ${CMAKE_SOURCE_DIR}/data/images/logos/wl-ico-${icon_size}.png DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/${icon_size}x${icon_size}/apps RENAME ${XDG_APPLICATION_ID}.png)
+-  install(FILES ${CMAKE_SOURCE_DIR}/data/images/logos/wl-ico-${icon_size}.png DESTINATION ../share/icons/hicolor/${icon_size}x${icon_size}/apps RENAME ${XDG_APPLICATION_ID}.png)
++  install(FILES ${CMAKE_SOURCE_DIR}/data/images/logos/wl-ico-${icon_size}.png DESTINATION share/icons/hicolor/${icon_size}x${icon_size}/apps RENAME ${XDG_APPLICATION_ID}.png)
+ endforeach (icon_size ${icon_sizes})
+ #install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${CMAKE_PROJECT_NAME}.6           DESTINATION ${CMAKE_INSTALL_MANDIR}/man6)
+-install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${CMAKE_PROJECT_NAME}.6           DESTINATION ../share/man/man6)
++install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${CMAKE_PROJECT_NAME}.6           DESTINATION share/man/man6)
+ #install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${XDG_APPLICATION_ID}.desktop     DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications)
+-install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${XDG_APPLICATION_ID}.desktop     DESTINATION ../share/applications)
++install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${XDG_APPLICATION_ID}.desktop     DESTINATION share/applications)
+ #install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${XDG_APPLICATION_ID}.appdata.xml DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/metainfo)
+-install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${XDG_APPLICATION_ID}.appdata.xml DESTINATION ../share/metainfo)
++install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${XDG_APPLICATION_ID}.appdata.xml DESTINATION share/metainfo)
+ 
+ find_program(GTK_UPDATE_ICON_CACHE NAMES gtk-update-icon-cache)
+ if (GTK_UPDATE_ICON_CACHE)
+   #install(CODE "execute_process (COMMAND ${GTK_UPDATE_ICON_CACHE} -t -f ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor ||: )")
+-  install(CODE "execute_process (COMMAND ${GTK_UPDATE_ICON_CACHE} -t -f ${CMAKE_INSTALL_PREFIX}/../share/icons/hicolor ||: )")
++  install(CODE "execute_process (COMMAND ${GTK_UPDATE_ICON_CACHE} -t -f ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor ||: )")
+ else (GTK_UPDATE_ICON_CACHE)
+   message(WARNING "gtk-update-icon-cache not found!")
+ endif (GTK_UPDATE_ICON_CACHE)
diff --git a/srcpkgs/widelands/template b/srcpkgs/widelands/template
index 6cee85087ea7..cfa2c10993e0 100644
--- a/srcpkgs/widelands/template
+++ b/srcpkgs/widelands/template
@@ -1,7 +1,7 @@
 # Template file for 'widelands'
 pkgname=widelands
 version=21
-revision=3
+revision=4
 wrksrc="${pkgname}-build${version}"
 build_style=cmake
 configure_args="-DOPENGL_INCLUDE_DIR=${XBPS_CROSS_BASE}/usr/include
@@ -10,13 +10,13 @@ hostmakedepends="python3 pkg-config gettext"
 makedepends="boost-devel icu-devel minizip-devel gettext-devel
  glu-devel glew-devel SDL2-devel SDL2_gfx-devel SDL2_image-devel
  SDL2_net-devel SDL2_mixer-devel SDL2_ttf-devel"
-depends="${pkgname}-data-${version}_${revision}"
 short_desc="Real-time strategy game"
 maintainer="Jürgen Buchmüller <pullmoll@t-online.de>"
 license="GPL-2.0-or-later"
 homepage="http://www.widelands.org/"
 distfiles="https://github.com/widelands/widelands/archive/build${version}.tar.gz>${pkgname}-${version}.tar.gz"
 checksum=601e0e4c6f91b3fb0ece2cd1b83ecfb02344a1b9194fbb70ef3f70e06994e357
+replaces="widelands-data>=0"
 
 CXXFLAGS="-DU_USING_ICU_NAMESPACE=1"
 
@@ -29,22 +29,5 @@ if [ "$CROSS_BUILD" ]; then
 fi
 
 post_install() {
-	# For some reason the binary is installed as /usr/widelands - move it
-	vmkdir usr/bin
-	mv ${DESTDIR}/usr/${pkgname} ${DESTDIR}/usr/bin
-	vmkdir usr/share
-	mv ${DESTDIR}/share/* ${DESTDIR}/usr/share/
-	rmdir ${DESTDIR}/share
-
-	# Remove files not needed in the package
-	rm -f ${DESTDIR}/usr/COPYING ${DESTDIR}/usr/CREDITS ${DESTDIR}/usr/ChangeLog ${DESTDIR}/usr/VERSION
-
 	vinstall ${FILESDIR}/${pkgname}.desktop 644 usr/share/applications
 }
-
-widelands-data_package() {
-	short_desc+=" - data files"
-	pkg_install() {
-		vmove usr/share/widelands
-	}
-}

From e8f5c10736617910048c849e657bff94d0292923 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: Sat, 20 Mar 2021 09:49:25 +0700
Subject: [PATCH 12/21] zziplib: fix SONAME when build with
 -DCMAKE_BUILD_TYPE=None

---
 .../cmake-build-type-none-soname.patch        | 35 +++++++++++++++++++
 srcpkgs/zziplib/template                      |  1 +
 2 files changed, 36 insertions(+)
 create mode 100644 srcpkgs/zziplib/patches/cmake-build-type-none-soname.patch

diff --git a/srcpkgs/zziplib/patches/cmake-build-type-none-soname.patch b/srcpkgs/zziplib/patches/cmake-build-type-none-soname.patch
new file mode 100644
index 000000000000..2d31b5b8a46a
--- /dev/null
+++ b/srcpkgs/zziplib/patches/cmake-build-type-none-soname.patch
@@ -0,0 +1,35 @@
+Index: zziplib-0.13.72/zzip/CMakeLists.txt
+===================================================================
+--- zziplib-0.13.72.orig/zzip/CMakeLists.txt
++++ zziplib-0.13.72/zzip/CMakeLists.txt
+@@ -190,15 +190,18 @@ target_include_directories (libzzipmmapp
+ endif()
+ 
+ set_target_properties(libzzip PROPERTIES OUTPUT_NAME "zzip" RELEASE_POSTFIX "-${RELNUM}")
++set_target_properties(libzzip PROPERTIES OUTPUT_NAME "zzip" NONE_POSTFIX "-${RELNUM}")
+ SET_TARGET_PROPERTIES(libzzip PROPERTIES VERSION ${VERNUM}.${FIXNUM} SOVERSION ${VERNUM})
+ 
+ if(ZZIPFSEEKO)
+ set_target_properties(libzzipfseeko PROPERTIES OUTPUT_NAME "zzipfseeko" RELEASE_POSTFIX "-${RELNUM}")
++set_target_properties(libzzipfseeko PROPERTIES OUTPUT_NAME "zzipfseeko" NONE_POSTFIX "-${RELNUM}")
+ SET_TARGET_PROPERTIES(libzzipfseeko PROPERTIES VERSION ${VERNUM}.${FIXNUM} SOVERSION ${VERNUM})
+ endif()
+ 
+ if(ZZIPMMAPPED)
+ set_target_properties(libzzipmmapped PROPERTIES OUTPUT_NAME "zzipmmapped" RELEASE_POSTFIX "-${RELNUM}")
++set_target_properties(libzzipmmapped PROPERTIES OUTPUT_NAME "zzipmmapped" NONE_POSTFIX "-${RELNUM}")
+ SET_TARGET_PROPERTIES(libzzipmmapped PROPERTIES VERSION ${VERNUM}.${FIXNUM} SOVERSION ${VERNUM})
+ endif()
+ 
+Index: zziplib-0.13.72/zzipwrap/CMakeLists.txt
+===================================================================
+--- zziplib-0.13.72.orig/zzipwrap/CMakeLists.txt
++++ zziplib-0.13.72/zzipwrap/CMakeLists.txt
+@@ -49,6 +49,7 @@ target_link_libraries(libzzipwrap libzzi
+ target_include_directories(libzzipwrap PRIVATE "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}")
+ 
+ set_target_properties(libzzipwrap PROPERTIES OUTPUT_NAME "zzipwrap" RELEASE_POSTFIX "-${RELNUM}")
++set_target_properties(libzzipwrap PROPERTIES OUTPUT_NAME "zzipwrap" NONE_POSTFIX "-${RELNUM}")
+ SET_TARGET_PROPERTIES(libzzipwrap PROPERTIES VERSION ${VERNUM}.${FIXNUM} SOVERSION ${VERNUM})
+ set_target_properties(libzzipwrap PROPERTIES DEFINE_SYMBOL "libzzip_EXPORTS")
+ 
diff --git a/srcpkgs/zziplib/template b/srcpkgs/zziplib/template
index ab5af234af62..2026f3e4a521 100644
--- a/srcpkgs/zziplib/template
+++ b/srcpkgs/zziplib/template
@@ -12,6 +12,7 @@ homepage="https://github.com/gdraheim/zziplib"
 changelog="https://raw.githubusercontent.com/gdraheim/zziplib/master/ChangeLog"
 distfiles="https://github.com/gdraheim/zziplib/archive/v${version}.tar.gz"
 checksum=93ef44bf1f1ea24fc66080426a469df82fa631d13ca3b2e4abaeab89538518dc
+patch_args=-Np1
 
 if [ "$CROSS_BUILD" ]; then
 	configure_args+=" -DZZIPTEST=OFF"

From ae883d60fc8ae070c8a3fab84aa9f1c27cc7cf6b 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, 21 Mar 2021 15:28:04 +0700
Subject: [PATCH 13/21] mellowplayer: fix build

---
 srcpkgs/mellowplayer/patches/no-werror.patch | 13 +++++++++++++
 srcpkgs/mellowplayer/template                | 13 +++++++------
 2 files changed, 20 insertions(+), 6 deletions(-)
 create mode 100644 srcpkgs/mellowplayer/patches/no-werror.patch

diff --git a/srcpkgs/mellowplayer/patches/no-werror.patch b/srcpkgs/mellowplayer/patches/no-werror.patch
new file mode 100644
index 000000000000..7e678453a123
--- /dev/null
+++ b/srcpkgs/mellowplayer/patches/no-werror.patch
@@ -0,0 +1,13 @@
+Index: MellowPlayer-3.6.6/src/3rdparty/boost/di.hpp
+===================================================================
+--- MellowPlayer-3.6.6.orig/src/3rdparty/boost/di.hpp
++++ MellowPlayer-3.6.6/src/3rdparty/boost/di.hpp
+@@ -67,7 +67,7 @@ BOOST_DI_CFG_FWD
+ #pragma clang diagnostic error "-Wundefined-internal"
+ #pragma clang diagnostic ignored "-Wmissing-field-initializers"
+ #elif defined(__GCC__)
+-#pragma GCC diagnostic error "-Wdeprecated-declarations"
++#pragma GCC diagnostic warning "-Wdeprecated-declarations"
+ #pragma GCC diagnostic push
+ #if (__GNUC__ < 6)
+ #pragma GCC diagnostic error "-Werror"
diff --git a/srcpkgs/mellowplayer/template b/srcpkgs/mellowplayer/template
index 2f8f13960ca6..cfd8a185556f 100644
--- a/srcpkgs/mellowplayer/template
+++ b/srcpkgs/mellowplayer/template
@@ -4,7 +4,7 @@ version=3.6.6
 revision=1
 wrksrc="MellowPlayer-${version}"
 build_style=cmake
-hostmakedepends="pkg-config qt5-tools qt5-qmake"
+hostmakedepends="pkg-config qt5-tools qt5-qmake qt5-host-tools"
 makedepends="qt5-declarative-devel qt5-quickcontrols2-devel
  qt5-plugin-mysql qt5-plugin-pgsql qt5-plugin-sqlite
  qt5-plugin-tds qt5-plugin-odbc
@@ -17,11 +17,12 @@ license="GPL-2.0-or-later"
 homepage="https://colinduquesnoy.gitlab.io/MellowPlayer/"
 distfiles="https://gitlab.com/ColinDuquesnoy/MellowPlayer/-/archive/${version}/MellowPlayer-${version}.tar.bz2"
 checksum=17b8b25ca6b3d27b223f8be6ad80186ae5bd17ce762eb04ecd8b0e82e687b327
+patch_args=-Np1
 
-if [ "$CROSS_BUILD" ]; then
-	hostmakedepends+=" qt5-host-tools"
+if [ "$XBPS_WORDSIZE" != "$XBPS_TARGET_WORDSIZE" ]; then
+	broken="webengine can be built only if word size matches"
 fi
 
-case "$XBPS_TARGET_MACHINE" in
-	arm*) broken="qt5-webengine not available" ;;
-esac
+if [ "$XBPS_TARGET_ENDIAN" != "le" ]; then
+	broken="webengine only supports little endian"
+fi

From 3edb59146513e9e4ed8368017ae94f0b37d56f80 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, 21 Mar 2021 15:43:09 +0700
Subject: [PATCH 14/21] ispc: fix CMAKE_BUILD_TYPE=None

---
 .../ispc/patches/cmake-build-type-none.patch   | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
 create mode 100644 srcpkgs/ispc/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/ispc/patches/cmake-build-type-none.patch b/srcpkgs/ispc/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..411e353c7314
--- /dev/null
+++ b/srcpkgs/ispc/patches/cmake-build-type-none.patch
@@ -0,0 +1,18 @@
+Index: ispc-1.15.0/CMakeLists.txt
+===================================================================
+--- ispc-1.15.0.orig/CMakeLists.txt
++++ ispc-1.15.0/CMakeLists.txt
+@@ -157,13 +157,6 @@ set(OUTPUT_RELEASE Release/bin)
+ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin )
+ 
+ if(CMAKE_BUILD_TYPE)
+-    # Validate build type
+-    set(CONFIGURATION_TYPES "Debug;Release;RelWithDebInfo")
+-
+-    string(FIND "${CONFIGURATION_TYPES}" "${CMAKE_BUILD_TYPE}" MATCHED_CONFIG)
+-    if (${MATCHED_CONFIG} EQUAL -1)
+-         message(FATAL_ERROR "CMAKE_BUILD_TYPE (${CMAKE_BUILD_TYPE}) allows only the following values: ${CONFIGURATION_TYPES}")
+-    endif()
+ else(NOT CMAKE_BUILD_TYPE)
+     set(CMAKE_BUILD_TYPE "Release")
+     message(STATUS "Build type not specified: Use Release by default.")

From 7cf4758d5acb5f440fb52b44301865897a6f741c 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, 21 Mar 2021 15:56:50 +0700
Subject: [PATCH 15/21] darktable: fix CMAKE_BUILD_TYPE=None

---
 .../darktable/patches/cmake-build-type-none.patch  | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
 create mode 100644 srcpkgs/darktable/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/darktable/patches/cmake-build-type-none.patch b/srcpkgs/darktable/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..7101f9c1a0e7
--- /dev/null
+++ b/srcpkgs/darktable/patches/cmake-build-type-none.patch
@@ -0,0 +1,14 @@
+Index: src/external/rawspeed/cmake/build-type.cmake
+===================================================================
+--- src/external/rawspeed/cmake/build-type.cmake.orig
++++ src/external/rawspeed/cmake/build-type.cmake
+@@ -27,9 +27,6 @@ string(TOUPPER "${RAWSPEED_SPECIAL_BUILD
+ 
+ # is this one of the known build types?
+ list (FIND CMAKE_CONFIGURATION_TYPES_UPPERCASE ${CMAKE_BUILD_TYPE_UPPERCASE} BUILD_TYPE_IS_KNOWN)
+-if (${BUILD_TYPE_IS_KNOWN} EQUAL -1)
+- message(SEND_ERROR "Unknown build type: ${CMAKE_BUILD_TYPE_UPPERCASE}. Please specify one of: ${CMAKE_CONFIGURATION_TYPES}")
+-endif()
+ 
+ # is this a special build?
+ list (FIND RAWSPEED_SPECIAL_BUILD_TYPES_UPPERCASE ${CMAKE_BUILD_TYPE_UPPERCASE} IS_SPECIAL_BUILD)

From bffce4873ddcb17fc785be5cd6bad8dc085762bd 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, 21 Mar 2021 15:33:29 +0700
Subject: [PATCH 16/21] hedgewars: merge -data back

---
 srcpkgs/hedgewars-data                        |  1 -
 .../patches/cmake-build-type-none.patch       | 30 +++++++++++++++++++
 srcpkgs/hedgewars/template                    | 23 +++++---------
 3 files changed, 38 insertions(+), 16 deletions(-)
 delete mode 120000 srcpkgs/hedgewars-data
 create mode 100644 srcpkgs/hedgewars/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/hedgewars-data b/srcpkgs/hedgewars-data
deleted file mode 120000
index b57dc45ebadc..000000000000
--- a/srcpkgs/hedgewars-data
+++ /dev/null
@@ -1 +0,0 @@
-hedgewars
\ No newline at end of file
diff --git a/srcpkgs/hedgewars/patches/cmake-build-type-none.patch b/srcpkgs/hedgewars/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..b4e0c186717c
--- /dev/null
+++ b/srcpkgs/hedgewars/patches/cmake-build-type-none.patch
@@ -0,0 +1,30 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -54,7 +54,7 @@ option(NOVERSIONINFOUPDATE "Disable upda
+ 
+ 
+ if(BUILD_ENGINE_C AND NOT NOVIDEOREC)
+-    if((CMAKE_BUILD_TYPE STREQUAL "Release") OR (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo"))
++    if((CMAKE_BUILD_TYPE STREQUAL "Release") OR (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo") OR (CMAKE_BUILD_TYPE STREQUAL "None"))
+         message("NOTE: Video recorder support disabled. It's incompatible with BUILD_ENGINE_C")
+         set(BUILD_ENGINE_C ON CACHE STRING "Required for BUILD_ENGINE_JS" FORCE)
+     else()
+@@ -93,7 +93,7 @@ set(CPACK_PACKAGE_VERSION_MAJOR 1)
+ set(CPACK_PACKAGE_VERSION_MINOR 0)
+ set(CPACK_PACKAGE_VERSION_PATCH 0)
+ set(HEDGEWARS_PROTO_VER 59)
+-if((CMAKE_BUILD_TYPE STREQUAL "Release") OR (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo"))
++if((CMAKE_BUILD_TYPE STREQUAL "Release") OR (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo") OR (CMAKE_BUILD_TYPE STREQUAL "None"))
+     set(HEDGEWARS_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
+ else()
+     set(HEDGEWARS_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}-dev")
+@@ -114,6 +114,7 @@ include(${CMAKE_MODULE_PATH}/platform.cm
+ if(CMAKE_BUILD_TYPE)
+     if(NOT((CMAKE_BUILD_TYPE STREQUAL "Release") OR
+            (CMAKE_BUILD_TYPE STREQUAL "Debug") OR
++	   (CMAKE_BUILD_TYPE STREQUAL "None") OR
+            (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")))
+         set(CMAKE_BUILD_TYPE ${default_build_type} CACHE STRING "Build type (Debug/Release/RelWithDebInfo)" FORCE)
+         message(STATUS "Unknown build type ${CMAKE_BUILD_TYPE}, using default (${default_build_type})")
diff --git a/srcpkgs/hedgewars/template b/srcpkgs/hedgewars/template
index d2294cf572f5..f413a965ff2e 100644
--- a/srcpkgs/hedgewars/template
+++ b/srcpkgs/hedgewars/template
@@ -1,15 +1,15 @@
 # Template file for 'hedgewars'
 pkgname=hedgewars
 version=1.0.0
-revision=2
+revision=3
 wrksrc="${pkgname}-src-${version}"
 build_style=cmake
 configure_args="-DNOSERVER=1 -DDATA_INSTALL_DIR=/usr/share/${pkgname}
- -DPHYSFS_SYSTEM=1 -DCMAKE_VERBOSE_MAKEFILE=1 -DMINIMAL_FLAGS=1"
-hostmakedepends="lua51 pkg-config"
+ -DPHYSFS_SYSTEM=1 -DMINIMAL_FLAGS=1"
+hostmakedepends="lua51 pkg-config qt5-qmake qt5-host-tools"
 makedepends="ffmpeg-devel lua51-devel physfs-devel qt5-tools-devel SDL2_image-devel
  SDL2_mixer-devel SDL2_net-devel SDL2_ttf-devel"
-depends="hedgewars-data>=${version}_${revision} libfreeglut"
+depends="libfreeglut"
 short_desc="Funny turn-based artillery game, featuring fighting Hedgehogs!"
 maintainer="Jakub Skrzypnik <jot.skrzyp@gmail.com>"
 license="GPL-2.0-only"
@@ -18,10 +18,9 @@ distfiles="https://hedgewars.org/download/releases/hedgewars-src-${version}.tar.
 checksum=211634e61f2e4beecc3c98c6f749601fcd08321fda1ba969b3b3832a004f155b
 nopie_files="/usr/bin/hwengine"
 nocross="Needs investigation: fails to link hwengine"
-
-if [ -n "$CROSS_BUILD" ]; then
-	hostmakedepends+=" qt5-devel"
-fi
+replaces="hedgewars-data>=0"
+export CMAKE_GENERATOR="Unix Makefiles"
+make_cmd=make
 
 case $XBPS_TARGET_MACHINE in
 	x86_64*)
@@ -38,6 +37,7 @@ esac
 
 if [ -n "$_use_c_engine" ]; then
 	hostmakedepends+=" glew-devel libatomic-devel ghc clang"
+	makedepends+=" glew-devel libatomic-devel"
 	configure_args+=" -DBUILD_ENGINE_C=1"
 	nopie_files+=" /usr/bin/hedgewars"
 fi
@@ -56,10 +56,3 @@ pre_configure() {
 post_install() {
 	vinstall ${DESTDIR}/usr/share/hedgewars/Data/misc/hedgewars.desktop 644 usr/share/applications
 }
-
-hedgewars-data_package() {
-	short_desc+=" - data files"
-	pkg_install() {
-		vmove usr/share/hedgewars/Data
-	}
-}

From 8dce29e8dad8ccd73f9f0476e816046dae92ec81 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, 21 Mar 2021 16:41:58 +0700
Subject: [PATCH 17/21] mariadb: fix for CMAKE_BUILD_TYPE=None

---
 srcpkgs/mariadb/template | 32 ++++++++++++++------------------
 1 file changed, 14 insertions(+), 18 deletions(-)

diff --git a/srcpkgs/mariadb/template b/srcpkgs/mariadb/template
index 437ff757b383..78d5e2dbdbe8 100644
--- a/srcpkgs/mariadb/template
+++ b/srcpkgs/mariadb/template
@@ -34,35 +34,31 @@ replaces="mysql>=0"
 conf_files="/etc/mysql/my.cnf"
 system_accounts="mysql"
 mysql_homedir="/var/lib/mysql"
-CFLAGS="-w -fcommon"
+CFLAGS="-w -fcommon -DDBUG_OFF=1"
+CXXFLAGS="-DDBUG_OFF=1"
 
 pre_configure() {
 	# We need some host binaries before starting cross compilation.
 	if [ "$CROSS_BUILD" ]; then
+		mkdir -p build.native
 		# XXX still broken: jemalloc configure execs host bins.
-		CC= CXX= CPP= LD= AR= AS= RANLIB= CFLAGS= CXXFLAGS= LDFLAGS= cmake .
-		make comp_err comp_sql gen_lex_hash gen_lex_token
-		mkdir bin.host
-		cp extra/comp_err bin.host
-		cp scripts/comp_sql bin.host
-		cp sql/gen_lex_hash bin.host
-		cp sql/gen_lex_token bin.host
-		make clean
-		rm CMakeCache.txt
+		CC= CXX= CPP= LD= AR= AS= RANLIB= CFLAGS= CXXFLAGS= LDFLAGS= \
+			cmake -S . -B build.native
+		make -C build.native comp_err comp_sql gen_lex_hash gen_lex_token
 	fi
 }
 
 pre_build() {
 	if [ "$CROSS_BUILD" ]; then
 		# CMake complains if those binaries ain't in build
-		cp bin.host/comp_err ${wrksrc}/extra
-		cp bin.host/comp_err ${wrksrc}/build/extra
-		cp bin.host/comp_sql ${wrksrc}/scripts
-		cp bin.host/comp_sql ${wrksrc}/build/scripts
-		cp bin.host/gen_lex_hash ${wrksrc}/sql
-		cp bin.host/gen_lex_hash ${wrksrc}/build/sql
-		cp bin.host/gen_lex_token ${wrksrc}/sql
-		cp bin.host/gen_lex_token ${wrksrc}/build/sql
+		cp build.native/extra/comp_err ${wrksrc}/extra
+		cp build.native/extra/comp_err ${wrksrc}/build/extra
+		cp build.native/scripts/comp_sql ${wrksrc}/scripts
+		cp build.native/scripts/comp_sql ${wrksrc}/build/scripts
+		cp build.native/sql/gen_lex_hash ${wrksrc}/sql
+		cp build.native/sql/gen_lex_hash ${wrksrc}/build/sql
+		cp build.native/sql/gen_lex_token ${wrksrc}/sql
+		cp build.native/sql/gen_lex_token ${wrksrc}/build/sql
 		export PATH=${PATH}:${wrksrc}/extra:${wrksrc}/scripts:${wrksrc}/sql
 	fi
 	export LD_LIBRARY_PATH=${wrksrc}/build/storage/tokudb/ft-index/portability

From f2ee2dd5cb5229e27aebd8d4a65a0e62f06ff99e 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: Thu, 25 Mar 2021 07:58:28 +0700
Subject: [PATCH 18/21] EternalTerminal: remove -ggdb3

---
 .../EternalTerminal/patches/fix-cflags.patch    | 17 +++++++++++++++++
 srcpkgs/EternalTerminal/template                |  1 +
 2 files changed, 18 insertions(+)
 create mode 100644 srcpkgs/EternalTerminal/patches/fix-cflags.patch

diff --git a/srcpkgs/EternalTerminal/patches/fix-cflags.patch b/srcpkgs/EternalTerminal/patches/fix-cflags.patch
new file mode 100644
index 000000000000..e6fcd432f7e7
--- /dev/null
+++ b/srcpkgs/EternalTerminal/patches/fix-cflags.patch
@@ -0,0 +1,17 @@
+Index: EternalTerminal-et-v6.0.13/CMakeLists.txt
+===================================================================
+--- EternalTerminal-et-v6.0.13.orig/CMakeLists.txt
++++ EternalTerminal-et-v6.0.13/CMakeLists.txt
+@@ -26,12 +26,6 @@ if(DISABLE_CRASH_LOG)
+ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DELPP_DISABLE_DEFAULT_CRASH_HANDLING")
+ ENDIF(DISABLE_CRASH_LOG)
+ 
+-if(UNIX)
+-  # Enable debug info
+-  SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -ggdb3")
+-  SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -ggdb3")
+-endif()
+-
+ # Enable C++-11
+ set(CMAKE_CXX_STANDARD 11)
+ set(CMAKE_CXX_STANDARD_REQUIRED ON)
diff --git a/srcpkgs/EternalTerminal/template b/srcpkgs/EternalTerminal/template
index 7bac78d2ffd4..bc92e47743dd 100644
--- a/srcpkgs/EternalTerminal/template
+++ b/srcpkgs/EternalTerminal/template
@@ -13,6 +13,7 @@ homepage="https://eternalterminal.dev/"
 distfiles="https://github.com/MisterTea/EternalTerminal/archive/et-v${version}.tar.gz"
 checksum=728c3a444d666897c710e33fe473d8d289263a59574451b13aa53ec3c6ac88b3
 system_accounts="_eternal"
+patch_args=-Np1
 
 LDFLAGS="-lgflags"
 

From ba5d66e44011b1a584a300141a7e2b0e530e9704 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: Thu, 25 Mar 2021 08:20:29 +0700
Subject: [PATCH 19/21] OTPClient: respect CFLAGS

---
 srcpkgs/OTPClient/patches/fix-cflags.patch | 17 +++++++++++++++++
 srcpkgs/OTPClient/template                 |  1 +
 2 files changed, 18 insertions(+)
 create mode 100644 srcpkgs/OTPClient/patches/fix-cflags.patch

diff --git a/srcpkgs/OTPClient/patches/fix-cflags.patch b/srcpkgs/OTPClient/patches/fix-cflags.patch
new file mode 100644
index 000000000000..ae70f441538f
--- /dev/null
+++ b/srcpkgs/OTPClient/patches/fix-cflags.patch
@@ -0,0 +1,17 @@
+Index: OTPClient-2.4.2/CMakeLists.txt
+===================================================================
+--- OTPClient-2.4.2.orig/CMakeLists.txt
++++ OTPClient-2.4.2/CMakeLists.txt
+@@ -11,11 +11,10 @@ option(BUILD_GUI "Build the GUI" ON)
+ option(BUILD_CLI "Build the CLI" ON)
+ 
+ set(CMAKE_C_STANDARD 11)
+-set(CMAKE_C_FLAGS "-Wall -Wextra -O3 -Wformat=2 -Wmissing-format-attribute -fstack-protector-strong -Wundef -Wmissing-format-attribute")
++set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wformat=2 -Wmissing-format-attribute -fstack-protector-strong -Wundef -Wmissing-format-attribute")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fdiagnostics-color=always -Wstrict-prototypes -Wunreachable-code")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wchar-subscripts -Wwrite-strings -Wpointer-arith -Wbad-function-cast -Wcast-align")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror=format-security -Werror=implicit-function-declaration -Wno-sign-compare")
+-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3")
+ if(CMAKE_COMPILER_IS_GNUCC)
+     set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pie -fPIE")
+ endif()
diff --git a/srcpkgs/OTPClient/template b/srcpkgs/OTPClient/template
index e8c0099850b7..f5af76e655a6 100644
--- a/srcpkgs/OTPClient/template
+++ b/srcpkgs/OTPClient/template
@@ -12,3 +12,4 @@ license="GPL-3.0-or-later"
 homepage="https://github.com/paolostivanin/OTPClient"
 distfiles="https://github.com/paolostivanin/OTPClient/archive/v${version}.tar.gz"
 checksum=74bc4312aa1cd336ca983434e3bed951c5ead327091e7708e3beb08508813495
+patch_args=-Np1

From 5be9e25a2fa0a7832e245115a9e283b435a27f33 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: Thu, 25 Mar 2021 08:30:31 +0700
Subject: [PATCH 20/21] crex: hardening

---
 srcpkgs/crex/patches/fix-cflags.patch | 20 ++++++++++++++++++++
 srcpkgs/crex/template                 |  7 ++-----
 2 files changed, 22 insertions(+), 5 deletions(-)
 create mode 100644 srcpkgs/crex/patches/fix-cflags.patch

diff --git a/srcpkgs/crex/patches/fix-cflags.patch b/srcpkgs/crex/patches/fix-cflags.patch
new file mode 100644
index 000000000000..d191fb1e9ec0
--- /dev/null
+++ b/srcpkgs/crex/patches/fix-cflags.patch
@@ -0,0 +1,20 @@
+Index: crex-0.2.5/CMakeLists.txt
+===================================================================
+--- crex-0.2.5.orig/CMakeLists.txt
++++ crex-0.2.5/CMakeLists.txt
+@@ -13,9 +13,6 @@ endif(CCACHE_FOUND)
+ set (CMAKE_CXX_STANDARD 14)
+ set (CMAKE_CXX_STANDARD_REQUIRED ON)
+ 
+-set (CMAKE_CXX_FLAGS "-fdiagnostics-color=auto")
+-set (CMAKE_C_FLAGS "-fdiagnostics-color=auto")
+-
+ set (DEBUG_FLAGS "-Wpedantic -Wall -Wextra -Wcast-align -Wcast-qual -Wctor-dtor-privacy -Wdisabled-optimization -Wformat=2 -Winit-self -Wlogical-op -Wmissing-declarations -Wmissing-include-dirs -Wnoexcept -Wold-style-cast -Woverloaded-virtual -Wredundant-decls -Wshadow -Wsign-conversion -Wsign-promo -Wstrict-null-sentinel -Wstrict-overflow=5 -Wswitch-default -Wundef -Wno-unused -std=c++14 -g")
+ set (DEBUG_LINK_FLAGS "-fprofile-arcs -ftest-coverage -flto")
+ 
+@@ -56,4 +53,4 @@ target_link_libraries (
+   ${TARGET}
+ )
+ 
+-install (TARGETS ${TARGET} DESTINATION "/usr/local/bin")
++install (TARGETS ${TARGET} DESTINATION "/usr/bin")
diff --git a/srcpkgs/crex/template b/srcpkgs/crex/template
index a54697a93adc..2f455a0b0c72 100644
--- a/srcpkgs/crex/template
+++ b/srcpkgs/crex/template
@@ -1,7 +1,7 @@
 # Template file for 'crex'
 pkgname=crex
 version=0.2.5
-revision=1
+revision=2
 build_style=cmake
 short_desc="Explore, test, and check regular expressions in the terminal"
 maintainer="Piotr Wójcik <chocimier@tlen.pl>"
@@ -9,10 +9,7 @@ license="MIT"
 homepage="https://github.com/octobanana/crex"
 distfiles="https://github.com/octobanana/crex/archive/${version}.tar.gz"
 checksum=c6a166b7a1e696a7babeaf7c5728eece1624704a18357f827129fc95ef2ecc56
-
-pre_configure() {
-	sed -e 's|/local/|/|' -i CMakeLists.txt
-}
+patch_args=-Np1
 
 post_install() {
 	vlicense LICENSE

From a17e78e0ab88daaa731074bfa5f1ce100aafa4d1 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: Thu, 25 Mar 2021 08:34:32 +0700
Subject: [PATCH 21/21] libbaseencode: hardening

---
 srcpkgs/libbaseencode/patches/fix-cflags.patch | 13 +++++++++++++
 srcpkgs/libbaseencode/template                 |  3 ++-
 2 files changed, 15 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/libbaseencode/patches/fix-cflags.patch

diff --git a/srcpkgs/libbaseencode/patches/fix-cflags.patch b/srcpkgs/libbaseencode/patches/fix-cflags.patch
new file mode 100644
index 000000000000..1bb86a0b15a4
--- /dev/null
+++ b/srcpkgs/libbaseencode/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: libbaseencode-1.0.9/CMakeLists.txt
+===================================================================
+--- libbaseencode-1.0.9.orig/CMakeLists.txt
++++ libbaseencode-1.0.9/CMakeLists.txt
+@@ -15,7 +15,7 @@ set(CMAKE_C_STANDARD 11)
+ set(BASEENCODE_HEADERS src/baseencode.h)
+ set(SOURCE_FILES src/base32.c src/base64.c)
+ 
+-set(CMAKE_C_FLAGS "-Wall -Werror -fPIC")
++set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Werror -fPIC")
+ 
+ add_library(${PROJECT_NAME} SHARED ${SOURCE_FILES})
+ 
diff --git a/srcpkgs/libbaseencode/template b/srcpkgs/libbaseencode/template
index 384a189224df..d5929ad7bb51 100644
--- a/srcpkgs/libbaseencode/template
+++ b/srcpkgs/libbaseencode/template
@@ -1,7 +1,7 @@
 # Template file for 'libbaseencode'
 pkgname=libbaseencode
 version=1.0.9
-revision=1
+revision=2
 build_style=cmake
 short_desc="Library for encoding decoding data use base32 or base64"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -9,6 +9,7 @@ license="Apache-2.0"
 homepage="https://github.com/paolostivanin/libbaseencode"
 distfiles="https://github.com/paolostivanin/libbaseencode/archive/v${version}.tar.gz"
 checksum=a183d7cf30d931b2a078d6f0ef64616b71ab26f9258e5f4e191778c7ace7175d
+patch_args=-Np1
 
 libbaseencode-devel_package() {
 	depends="libbaseencode-${version}_${revision}"

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: build-style/cmake: set CMAKE_BUILD_TYPE to None
  2021-03-14 13:19 [PR PATCH] [WIP] build-style/cmake: set CMAKE_BUILD_TYPE to None sgn
                   ` (13 preceding siblings ...)
  2021-03-25  1:38 ` sgn
@ 2021-03-26 15:13 ` sgn
  2021-03-26 15:42 ` ericonr
                   ` (17 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: sgn @ 2021-03-26 15:13 UTC (permalink / raw)
  To: ml

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

New comment by sgn on void-packages repository

https://github.com/void-linux/void-packages/pull/29459#issuecomment-808296504

Comment:
Question: Should we add `-DNDEBUG` to `CFLAGS` and `CXXFLAGS`?

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: build-style/cmake: set CMAKE_BUILD_TYPE to None
  2021-03-14 13:19 [PR PATCH] [WIP] build-style/cmake: set CMAKE_BUILD_TYPE to None sgn
                   ` (14 preceding siblings ...)
  2021-03-26 15:13 ` sgn
@ 2021-03-26 15:42 ` ericonr
  2021-03-26 15:43 ` ericonr
                   ` (16 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: ericonr @ 2021-03-26 15:42 UTC (permalink / raw)
  To: ml

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

New comment by ericonr on void-packages repository

https://github.com/void-linux/void-packages/pull/29459#issuecomment-808320442

Comment:
I would rather not.

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: build-style/cmake: set CMAKE_BUILD_TYPE to None
  2021-03-14 13:19 [PR PATCH] [WIP] build-style/cmake: set CMAKE_BUILD_TYPE to None sgn
                   ` (15 preceding siblings ...)
  2021-03-26 15:42 ` ericonr
@ 2021-03-26 15:43 ` ericonr
  2021-03-26 15:48 ` sgn
                   ` (15 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: ericonr @ 2021-03-26 15:43 UTC (permalink / raw)
  To: ml

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

New comment by ericonr on void-packages repository

https://github.com/void-linux/void-packages/pull/29459#issuecomment-808320809

Comment:
Hmmm, unless CMake release mode adds it... Then I guess yes... This complicated.

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: build-style/cmake: set CMAKE_BUILD_TYPE to None
  2021-03-14 13:19 [PR PATCH] [WIP] build-style/cmake: set CMAKE_BUILD_TYPE to None sgn
                   ` (16 preceding siblings ...)
  2021-03-26 15:43 ` ericonr
@ 2021-03-26 15:48 ` sgn
  2021-03-26 16:01 ` [PR PATCH] [Updated] " sgn
                   ` (14 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: sgn @ 2021-03-26 15:48 UTC (permalink / raw)
  To: ml

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

New comment by sgn on void-packages repository

https://github.com/void-linux/void-packages/pull/29459#issuecomment-808324115

Comment:
> Hmmm, unless CMake release mode adds it... Then I guess yes... This complicated.

Yes, `-DNDEBUG` added in `Release` `MinSizeRel` and `RelWithDebInfo`.

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PR PATCH] [Updated] build-style/cmake: set CMAKE_BUILD_TYPE to None
  2021-03-14 13:19 [PR PATCH] [WIP] build-style/cmake: set CMAKE_BUILD_TYPE to None sgn
                   ` (17 preceding siblings ...)
  2021-03-26 15:48 ` sgn
@ 2021-03-26 16:01 ` sgn
  2021-03-27  8:23 ` sgn
                   ` (13 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: sgn @ 2021-03-26 16:01 UTC (permalink / raw)
  To: ml

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

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

https://github.com/sgn/void-packages cmake-build-type-to-None
https://github.com/void-linux/void-packages/pull/29459

build-style/cmake: set CMAKE_BUILD_TYPE to None
- I'm going to build all packages with `build_style=cmake` and fix them one by one before merging this in.

[ci skip]

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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-cmake-build-type-to-None-29459.patch --]
[-- Type: text/x-diff, Size: 74146 bytes --]

From 6bba5dd40c15240ad76ace09d23d777b465040ef 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, 14 Mar 2021 20:18:03 +0700
Subject: [PATCH 01/32] build-style/cmake: set CMAKE_BUILD_TYPE to None

---
 common/build-style/cmake.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/build-style/cmake.sh b/common/build-style/cmake.sh
index 5100a96dfd7b..9d1a1a7a1941 100644
--- a/common/build-style/cmake.sh
+++ b/common/build-style/cmake.sh
@@ -52,7 +52,7 @@ _EOF
 		cmake_args+=" -DCMAKE_TOOLCHAIN_FILE=cross_${XBPS_CROSS_TRIPLET}.cmake"
 	fi
 	cmake_args+=" -DCMAKE_INSTALL_PREFIX=/usr"
-	cmake_args+=" -DCMAKE_BUILD_TYPE=Release"
+	cmake_args+=" -DCMAKE_BUILD_TYPE=None"
 	cmake_args+=" -DCMAKE_INSTALL_LIBDIR=lib${XBPS_TARGET_WORDSIZE}"
 
 	if [[ $build_helper = *"qemu"* ]]; then

From 77c730b123b94a1374cf0ef798d70b633fffb2e3 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: Mon, 15 Mar 2021 08:07:16 +0700
Subject: [PATCH 02/32] amdvlk: allow CMAKE_BUILD_TYPE=None

---
 .../patches/cmake-build-type-none.patch       | 60 +++++++++++++++++++
 1 file changed, 60 insertions(+)
 create mode 100644 srcpkgs/amdvlk/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/amdvlk/patches/cmake-build-type-none.patch b/srcpkgs/amdvlk/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..7a629e58548e
--- /dev/null
+++ b/srcpkgs/amdvlk/patches/cmake-build-type-none.patch
@@ -0,0 +1,60 @@
+Index: llvm-project/llvm/CMakeLists.txt
+===================================================================
+--- llvm-project/llvm/CMakeLists.txt.orig
++++ llvm-project/llvm/CMakeLists.txt
+@@ -251,11 +251,6 @@ endif()
+ 
+ string(TOUPPER "${CMAKE_BUILD_TYPE}" uppercase_CMAKE_BUILD_TYPE)
+ 
+-if (CMAKE_BUILD_TYPE AND
+-    NOT uppercase_CMAKE_BUILD_TYPE MATCHES "^(DEBUG|RELEASE|RELWITHDEBINFO|MINSIZEREL)$")
+-  message(FATAL_ERROR "Invalid value for CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
+-endif()
+-
+ set(LLVM_LIBDIR_SUFFIX "" CACHE STRING "Define suffix of library directory name (32/64)" )
+ 
+ set(LLVM_TOOLS_INSTALL_DIR "bin" CACHE STRING "Path for binary subdirectory (defaults to 'bin')")
+Index: pal/cmake/Modules/AmdCmakeHelper.cmake
+===================================================================
+--- pal/cmake/Modules/AmdCmakeHelper.cmake.orig
++++ pal/cmake/Modules/AmdCmakeHelper.cmake
+@@ -37,11 +37,6 @@ if (CMAKE_CONFIGURATION_TYPES)
+ else()
+     string(TOUPPER "${CMAKE_BUILD_TYPE}" capital_CMAKE_BUILD_TYPE)
+ 
+-    if (CMAKE_BUILD_TYPE AND
+-        NOT capital_CMAKE_BUILD_TYPE MATCHES "^(DEBUG|RELEASE|RELWITHDEBINFO|MINSIZEREL)$")
+-        message(FATAL_ERROR "Invalid value for CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
+-    endif()
+-
+     if(capital_CMAKE_BUILD_TYPE STREQUAL "DEBUG")
+         set(CMAKE_BUILD_TYPE_DEBUG ON)
+         set(CMAKE_BUILD_TYPE_RELEASE OFF)
+Index: xgl/CMakeLists.txt
+===================================================================
+--- xgl/CMakeLists.txt.orig
++++ xgl/CMakeLists.txt
+@@ -181,11 +181,6 @@ if (CMAKE_CONFIGURATION_TYPES)
+ else()
+     string(TOUPPER "${CMAKE_BUILD_TYPE}" capital_CMAKE_BUILD_TYPE)
+ 
+-    if (CMAKE_BUILD_TYPE AND
+-        NOT capital_CMAKE_BUILD_TYPE MATCHES "^(DEBUG|RELEASE|RELWITHDEBINFO|MINSIZEREL)$")
+-        message(FATAL_ERROR "Invalid value for CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
+-    endif()
+-
+     if(capital_CMAKE_BUILD_TYPE STREQUAL "DEBUG")
+         set(CMAKE_BUILD_TYPE_DEBUG ON)
+         set(CMAKE_BUILD_TYPE_RELEASE OFF)
+Index: xgl/icd/CMakeLists.txt
+===================================================================
+--- xgl/icd/CMakeLists.txt.orig
++++ xgl/icd/CMakeLists.txt
+@@ -84,7 +84,6 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Cl
+     endif()
+ 
+     if(CMAKE_BUILD_TYPE_RELEASE)
+-        target_compile_options(xgl PRIVATE -O3)
+         if(XGL_ENABLE_LTO)
+             if(${CMAKE_CXX_COMPILER_ID} MATCHES "GNU")
+                 execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION)

From c5dcd247ea1c0ae8e2a83457b4c5a9bdcd05f324 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: Wed, 17 Mar 2021 06:24:04 +0700
Subject: [PATCH 03/32] eigen*: set CMAKE_BUILD_TYPE to Release

We're going to set default CMAKE_BUILD_TYPE to None soon. Those packages
are header only libraries, no need to waste time on patching.
---
 srcpkgs/eigen/template    | 1 +
 srcpkgs/eigen3.2/template | 1 +
 2 files changed, 2 insertions(+)

diff --git a/srcpkgs/eigen/template b/srcpkgs/eigen/template
index ee825e95f273..072228c16915 100644
--- a/srcpkgs/eigen/template
+++ b/srcpkgs/eigen/template
@@ -3,6 +3,7 @@ pkgname=eigen
 version=3.3.9
 revision=1
 build_style=cmake
+configure_args="-DCMAKE_BUILD_TYPE=Release"
 short_desc="C++ template library for linear algebra (version 3.x)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MPL-2.0, GPL-3.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
diff --git a/srcpkgs/eigen3.2/template b/srcpkgs/eigen3.2/template
index 5715fc1b3a19..7b710534b5e5 100644
--- a/srcpkgs/eigen3.2/template
+++ b/srcpkgs/eigen3.2/template
@@ -4,6 +4,7 @@ version=3.2.10
 revision=3
 wrksrc="eigen-${version}"
 build_style=cmake
+configure_args="-DCMAKE_BUILD_TYPE=Release"
 short_desc="C++ template library for linear algebra (version 3.x)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MPL-2.0, GPL-3.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"

From 3eea18f71241971bfe905f1ba4a917eeb5436fe6 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: Wed, 17 Mar 2021 07:04:48 +0700
Subject: [PATCH 04/32] embree: don't ignore CXXFLAGS, fix build with ispc
 1.13+

---
 .../embree/patches/uintNN-is-part-of-ispc-1.13.patch | 12 ++++++++++++
 srcpkgs/embree/template                              |  6 ++----
 2 files changed, 14 insertions(+), 4 deletions(-)
 create mode 100644 srcpkgs/embree/patches/uintNN-is-part-of-ispc-1.13.patch

diff --git a/srcpkgs/embree/patches/uintNN-is-part-of-ispc-1.13.patch b/srcpkgs/embree/patches/uintNN-is-part-of-ispc-1.13.patch
new file mode 100644
index 000000000000..5d0b02f3b2e5
--- /dev/null
+++ b/srcpkgs/embree/patches/uintNN-is-part-of-ispc-1.13.patch
@@ -0,0 +1,12 @@
+Index: embree-2.17.7/tutorials/common/common.isph
+===================================================================
+--- embree-2.17.7.orig/tutorials/common/common.isph
++++ embree-2.17.7/tutorials/common/common.isph
+@@ -16,7 +16,3 @@
+ 
+ #pragma once
+ 
+-typedef unsigned int64 uint64;
+-typedef unsigned int32 uint32;
+-typedef unsigned int16 uint16;
+-typedef unsigned int8  uint8;
diff --git a/srcpkgs/embree/template b/srcpkgs/embree/template
index 0bc72f46b6d8..849ec3c26c1d 100644
--- a/srcpkgs/embree/template
+++ b/srcpkgs/embree/template
@@ -4,6 +4,7 @@ version=2.17.7
 revision=2
 archs="x86_64"
 build_style=cmake
+configure_args="-DTBB_ROOT=/usr -DEMBREE_IGNORE_CMAKE_CXX_FLAGS=OFF"
 hostmakedepends="ispc"
 makedepends="libfreeglut-devel libXmu-devel tbb-devel MesaLib-devel libpng-devel
  libopenexr-devel libjpeg-turbo-devel libmagick-devel"
@@ -13,10 +14,7 @@ license="Apache-2.0"
 homepage="https://embree.github.io/"
 distfiles="https://github.com/$pkgname/$pkgname/archive/v$version.tar.gz"
 checksum=c0694f287fa1fbb382aba3a895702e248d92f7e89c0e5f64aefee965482ec04c
-
-nopie=y
-
-configure_args="-DTBB_ROOT=/usr -DENABLE_TUTORIALS=OFF"
+patch_args=-Np1
 
 embree-devel_package() {
 	depends="${sourcepkg}>=${version}_${revision}"

From 274f24869e6542463139b0bd98f5f9b442b7a5ca 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: Wed, 17 Mar 2021 07:35:19 +0700
Subject: [PATCH 05/32] ettercap: remove libressl patch, CMAKE_BUILD_TYPE=None

---
 .../patches/allow-build-type-none.patch       | 24 ++++++++++++++
 srcpkgs/ettercap/patches/libressl.patch       | 31 -------------------
 srcpkgs/ettercap/template                     |  9 ++++--
 3 files changed, 31 insertions(+), 33 deletions(-)
 create mode 100644 srcpkgs/ettercap/patches/allow-build-type-none.patch
 delete mode 100644 srcpkgs/ettercap/patches/libressl.patch

diff --git a/srcpkgs/ettercap/patches/allow-build-type-none.patch b/srcpkgs/ettercap/patches/allow-build-type-none.patch
new file mode 100644
index 000000000000..324d75086b05
--- /dev/null
+++ b/srcpkgs/ettercap/patches/allow-build-type-none.patch
@@ -0,0 +1,24 @@
+Index: ettercap-0.8.3.1/CMakeLists.txt
+===================================================================
+--- ettercap-0.8.3.1.orig/CMakeLists.txt
++++ ettercap-0.8.3.1/CMakeLists.txt
+@@ -22,19 +22,6 @@ option(LIBRARY_BUILD "Build for libetter
+ option(INSTALL_DESKTOP "Install ettercap desktop files" ON)
+ 
+ 
+-set(VALID_BUILD_TYPES Debug Release RelWithDebInfo)
+-
+-if(NOT CMAKE_BUILD_TYPE)
+-  # Default to using "Release" as our build type.
+-  set(CMAKE_BUILD_TYPE "Release" CACHE STRING
+-    "Choose the type of build, options are: ${VALID_BUILD_TYPES}." FORCE)
+-endif()
+-list(FIND VALID_BUILD_TYPES ${CMAKE_BUILD_TYPE} contains_valid)
+-if(contains_valid EQUAL -1)
+-  message(FATAL_ERROR "Unknown CMAKE_BUILD_TYPE: '${CMAKE_BUILD_TYPE}'. Valid options are: ${VALID_BUILD_TYPES}")
+-endif()
+-unset(contains_valid)
+-
+ include(CMakeDependentOption)
+ 
+ # If SYSTEM_LIBS is set to off, then all SYSTEM_* options will be
diff --git a/srcpkgs/ettercap/patches/libressl.patch b/srcpkgs/ettercap/patches/libressl.patch
deleted file mode 100644
index 15e0d3c1c9e7..000000000000
--- a/srcpkgs/ettercap/patches/libressl.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From b2f7634c9dbc0ef68640f0571787d92300e9f9f9 Mon Sep 17 00:00:00 2001
-From: Stefan Strogin <stefan@steils.org>
-Date: Sat, 15 Aug 2020 07:18:31 +0300
-Subject: [PATCH] ec_sslwrap: fix compilation with LibreSSL
-
-Disable taking over SNI extension from ClientHello and SSL configuration
-operations until LibreSSL supports the required API.
-
-Fixes: https://github.com/Ettercap/ettercap/issues/1068
----
- src/ec_sslwrap.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git src/ec_sslwrap.c src/ec_sslwrap.c
-index b9f26a142..1e4c24fc1 100644
---- src/ec_sslwrap.c
-+++ src/ec_sslwrap.c
-@@ -71,11 +71,11 @@
- #define TLS_server_method SSLv23_server_method
- #endif
- 
--#if (OPENSSL_VERSION_NUMBER >= 0x10100000L)
-+#if (OPENSSL_VERSION_NUMBER >= 0x10100000L) && !defined(LIBRESSL_VERSION_NUMBER)
- #define HAVE_OPENSSL_1_1_0
- #endif
- 
--#if (OPENSSL_VERSION_NUMBER >= 0x10101000L)
-+#if (OPENSSL_VERSION_NUMBER >= 0x10101000L) && !defined(LIBRESSL_VERSION_NUMBER)
- #define HAVE_OPENSSL_1_1_1
- #endif
- 
diff --git a/srcpkgs/ettercap/template b/srcpkgs/ettercap/template
index 7fe4c340a079..611b4e9aded7 100644
--- a/srcpkgs/ettercap/template
+++ b/srcpkgs/ettercap/template
@@ -3,8 +3,8 @@ pkgname=ettercap
 version=0.8.3.1
 revision=2
 build_style=cmake
-configure_args="-DENABLE_GTK=OFF"
-hostmakedepends="flex"
+configure_args="-DENABLE_GTK=OFF -DBUNDLED_LIBS=OFF"
+hostmakedepends="flex pkg-config"
 makedepends="geoip-devel ncurses-devel openssl-devel libcurl-devel
  libltdl-devel libnet-devel libpcap-devel pcre-devel"
 conf_files="/etc/${pkgname}/etter.conf"
@@ -15,5 +15,10 @@ homepage="http://ettercap.github.com/ettercap/"
 distfiles="https://github.com/Ettercap/ettercap/archive/v${version}.tar.gz"
 checksum=d0c3ef88dfc284b61d3d5b64d946c1160fd04276b448519c1ae4438a9cdffaf3
 lib32disabled=yes
+patch_args=-Np1
 
 CFLAGS="-fcommon"
+
+post_extract() {
+	rm -rf bundled_deps
+}

From dae502a371be70e437826a4726cf398ce148e037 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: Wed, 17 Mar 2021 08:27:10 +0700
Subject: [PATCH 06/32] injeqt: disable coverage

---
 srcpkgs/injeqt/template | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/injeqt/template b/srcpkgs/injeqt/template
index 1e5777fc0f18..78eba09a0249 100644
--- a/srcpkgs/injeqt/template
+++ b/srcpkgs/injeqt/template
@@ -3,7 +3,8 @@ pkgname=injeqt
 version=1.2.0
 revision=2
 build_style=cmake
-hostmakedepends="pkg-config"
+configure_args="-DDISABLE_COVERAGE=ON"
+hostmakedepends="pkg-config qt5-qmake qt5-host-tools"
 makedepends="qt5-devel"
 short_desc="Dependency injection framework for Qt"
 maintainer="Jürgen Buchmüller <pullmoll@t-online.de>"
@@ -12,9 +13,6 @@ homepage="https://github.com/vogel/injeqt/"
 distfiles="https://github.com/vogel/${pkgname}/archive/${version}.tar.gz>${pkgname}-${version}.tar.gz"
 checksum=77540cedb0b26affe993dd18124d796059e34c80a51d9ae6433fdff1860db135
 
-if [ -n "$CROSS_BUILD" ]; then
-	hostmakedepends+=" qt5-host-tools qt5-devel"
-fi
 CXXFLAGS="-fno-lifetime-dse -Wno-error=cast-align"
 
 injeqt-devel_package() {

From 4b7c6187ec6c4640ec9da85315e4c2393dfc1820 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: Wed, 17 Mar 2021 22:26:37 +0700
Subject: [PATCH 07/32] kindd: build with CMAKE_BUILD_TYPE=None

---
 srcpkgs/kindd/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/kindd/template b/srcpkgs/kindd/template
index e634b0f69bf6..4416041de58c 100644
--- a/srcpkgs/kindd/template
+++ b/srcpkgs/kindd/template
@@ -15,7 +15,7 @@ distfiles="${homepage}/archive/${version}.tar.gz"
 checksum=e596f1b1577ff3e83a779e6181252ae2f09731f513d17dd6b95cbc2cf204654f
 
 do_install() {
-	vbin release/kindd
+	vbin build/core/kindd
 	vinstall assets/appconf/kindd.svg 644 usr/share/pixmaps
 	vinstall assets/appconf/kindd.desktop 644 usr/share/applications
 }

From 5727dad7ecbfac1581934fe3664e3b1f3fa2bcb7 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: Thu, 18 Mar 2021 23:58:53 +0700
Subject: [PATCH 08/32] occt: allow CMAKE_BUILD_TYPE=None

---
 srcpkgs/occt/patches/cmake-build-type-none.patch | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 srcpkgs/occt/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/occt/patches/cmake-build-type-none.patch b/srcpkgs/occt/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..acb06fb55766
--- /dev/null
+++ b/srcpkgs/occt/patches/cmake-build-type-none.patch
@@ -0,0 +1,13 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -4,7 +4,7 @@ set (CMAKE_MODULE_PATH "${CMAKE_SOURCE_D
+ 
+ set (CMAKE_SUPPRESS_REGENERATION TRUE)
+ 
+-set (CMAKE_CONFIGURATION_TYPES Release Debug RelWithDebInfo CACHE INTERNAL "" FORCE)
++set (CMAKE_CONFIGURATION_TYPES None Release Debug RelWithDebInfo CACHE INTERNAL "" FORCE)
+ 
+ # macro: include patched file if it exists
+ macro (OCCT_INCLUDE_CMAKE_FILE BEING_INCLUDED_FILE)

From 20f059a77216f81625f772d4d238aab032c7f073 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: Fri, 19 Mar 2021 23:07:05 +0700
Subject: [PATCH 09/32] renderdoc: devendor zstd, lz4

---
 .../patches/build-type-none-is-release.patch  | 12 ++++
 .../renderdoc/patches/qmake-no-rpath.patch    | 13 ++++
 .../renderdoc/patches/unvendor-zstd-lz4.patch | 68 +++++++++++++++++++
 srcpkgs/renderdoc/template                    | 15 ++--
 4 files changed, 99 insertions(+), 9 deletions(-)
 create mode 100644 srcpkgs/renderdoc/patches/build-type-none-is-release.patch
 create mode 100644 srcpkgs/renderdoc/patches/qmake-no-rpath.patch
 create mode 100644 srcpkgs/renderdoc/patches/unvendor-zstd-lz4.patch

diff --git a/srcpkgs/renderdoc/patches/build-type-none-is-release.patch b/srcpkgs/renderdoc/patches/build-type-none-is-release.patch
new file mode 100644
index 000000000000..f16b944bc12c
--- /dev/null
+++ b/srcpkgs/renderdoc/patches/build-type-none-is-release.patch
@@ -0,0 +1,12 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -315,6 +315,7 @@ set(RELEASE_MODE 0)
+ 
+ if(cmake_build_type_lower STREQUAL "release" OR
+    cmake_build_type_lower STREQUAL "relwithdebinfo" OR
++   cmake_build_type_lower STREQUAL "none" OR
+    cmake_build_type_lower STREQUAL "minsizerel")
+     add_definitions(-D_RELEASE)
+     message(STATUS "Building RenderDoc in Release mode: ${CMAKE_BUILD_TYPE}")
diff --git a/srcpkgs/renderdoc/patches/qmake-no-rpath.patch b/srcpkgs/renderdoc/patches/qmake-no-rpath.patch
new file mode 100644
index 000000000000..6e6325c53555
--- /dev/null
+++ b/srcpkgs/renderdoc/patches/qmake-no-rpath.patch
@@ -0,0 +1,13 @@
+Index: qrenderdoc/CMakeLists.txt
+===================================================================
+--- qrenderdoc/CMakeLists.txt.orig
++++ qrenderdoc/CMakeLists.txt
+@@ -144,7 +144,7 @@ endif()
+ # and finding dependencies from the cmake build
+ file(WRITE
+      ${CMAKE_BINARY_DIR}/qrenderdoc/qrenderdoc_cmake.pri
+-     "CONFIG+=${QMAKE_CONFIG}\n"
++     "CONFIG+=${QMAKE_CONFIG} no_qt_rpath\n"
+      "\n"
+      "QMAKE_CC=${CMAKE_C_COMPILER}\n"
+      "QMAKE_CXX=${CMAKE_CXX_COMPILER}\n"
diff --git a/srcpkgs/renderdoc/patches/unvendor-zstd-lz4.patch b/srcpkgs/renderdoc/patches/unvendor-zstd-lz4.patch
new file mode 100644
index 000000000000..d4003ded9161
--- /dev/null
+++ b/srcpkgs/renderdoc/patches/unvendor-zstd-lz4.patch
@@ -0,0 +1,68 @@
+Index: renderdoc/CMakeLists.txt
+===================================================================
+--- renderdoc/CMakeLists.txt.orig
++++ renderdoc/CMakeLists.txt
+@@ -213,54 +213,10 @@ set(sources
+     3rdparty/pugixml/pugixml.cpp
+     3rdparty/pugixml/pugixml.hpp
+     3rdparty/pugixml/pugiconfig.hpp
+-    3rdparty/lz4/lz4.c
+-    3rdparty/lz4/lz4.h
+     3rdparty/miniz/miniz.c
+     3rdparty/miniz/miniz.h
+     3rdparty/superluminal/superluminal.cpp
+     3rdparty/superluminal/superluminal.h
+-    3rdparty/zstd/bitstream.h
+-    3rdparty/zstd/compiler.h
+-    3rdparty/zstd/cpu.h
+-    3rdparty/zstd/debug.c
+-    3rdparty/zstd/debug.h
+-    3rdparty/zstd/entropy_common.c
+-    3rdparty/zstd/error_private.c
+-    3rdparty/zstd/error_private.h
+-    3rdparty/zstd/fse.h
+-    3rdparty/zstd/fse_compress.c
+-    3rdparty/zstd/fse_decompress.c
+-    3rdparty/zstd/hist.c
+-    3rdparty/zstd/hist.h
+-    3rdparty/zstd/huf.h
+-    3rdparty/zstd/huf_compress.c
+-    3rdparty/zstd/huf_decompress.c
+-    3rdparty/zstd/mem.h
+-    3rdparty/zstd/pool.c
+-    3rdparty/zstd/pool.h
+-    3rdparty/zstd/threading.c
+-    3rdparty/zstd/threading.h
+-    3rdparty/zstd/xxhash.c
+-    3rdparty/zstd/xxhash.h
+-    3rdparty/zstd/zstd.h
+-    3rdparty/zstd/zstd_common.c
+-    3rdparty/zstd/zstd_compress.c
+-    3rdparty/zstd/zstd_compress_internal.h
+-    3rdparty/zstd/zstd_decompress.c
+-    3rdparty/zstd/zstd_double_fast.c
+-    3rdparty/zstd/zstd_double_fast.h
+-    3rdparty/zstd/zstd_errors.h
+-    3rdparty/zstd/zstd_fast.c
+-    3rdparty/zstd/zstd_fast.h
+-    3rdparty/zstd/zstd_internal.h
+-    3rdparty/zstd/zstd_lazy.c
+-    3rdparty/zstd/zstd_lazy.h
+-    3rdparty/zstd/zstd_ldm.c
+-    3rdparty/zstd/zstd_ldm.h
+-    3rdparty/zstd/zstd_opt.c
+-    3rdparty/zstd/zstd_opt.h
+-    3rdparty/zstd/zstdmt_compress.c
+-    3rdparty/zstd/zstdmt_compress.h
+     3rdparty/stb/stb_image.h
+     3rdparty/stb/stb_image_write.h
+     3rdparty/stb/stb_image_resize.h
+@@ -271,6 +227,8 @@ set(sources
+     3rdparty/tinyfiledialogs/tinyfiledialogs.c
+     3rdparty/tinyfiledialogs/tinyfiledialogs.h)
+ 
++list(APPEND RDOC_LIBRARIES -llz4 -lzstd)
++
+ if(ANDROID)
+     list(APPEND sources
+         data/embedded_files.h
diff --git a/srcpkgs/renderdoc/template b/srcpkgs/renderdoc/template
index 7240e9ebc307..4615d45c52c9 100644
--- a/srcpkgs/renderdoc/template
+++ b/srcpkgs/renderdoc/template
@@ -1,13 +1,14 @@
 # Template file for 'renderdoc'
 pkgname=renderdoc
 version=1.12
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DENABLE_GL=ON -DENABLE_GLES=ON -DENABLE_QRENDERDOC=ON
  -DENABLE_RENDERDOCCMD=ON -DENABLE_VULKAN=ON -DENABLE_XCB=ON -DENABLE_XLIB=ON
  -DENABLE_PYRENDERDOC=ON"
-hostmakedepends="bison autoconf automake pkg-config python3"
+hostmakedepends="bison autoconf automake pkg-config python3 swig"
 makedepends="libX11-devel libxcb-devel xcb-util-keysyms-devel qt5-devel
+ libzstd-devel liblz4-devel
  qt5-svg-devel qt5-x11extras-devel pcre-devel python3-devel"
 short_desc="Stand-alone graphics debugging tool for Vulkan and OpenGL"
 maintainer="Urs Schulz <voidpkgs@ursschulz.de>"
@@ -19,19 +20,14 @@ checksum=4dece1b4cb859a76533b28fcd50e17321acfaa81c3435500a006c4a5ba15fddb
 if [ "$XBPS_TARGET_LIBC" = musl ]; then
 	makedepends+=" libexecinfo-devel"
 	LDLIBS="-lexecinfo"
+	broken="uses RTLD_DL_LINKMAP, RTLD_DEEPBIND, _r_debug"
 fi
 
 if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
 	makedepends+=" libatomic-devel"
 fi
 
-case "$XBPS_TARGET_MACHINE" in
-	*-musl) broken="uses RTLD_DL_LINKMAP, RTLD_DEEPBIND, _r_debug" ;;
-esac
-
-if [ "$CROSS_BUILD" ]; then
-	broken="Cross-compilation can't find python3 interpreter"
-fi
+nocross="Cross-compilation can't find python3 interpreter"
 
 post_patch() {
 	[ -z "$XBPS_TARGET_NO_ATOMIC8" ] && return 0
@@ -40,4 +36,5 @@ post_patch() {
 
 post_install() {
 	vlicense LICENSE.md
+	vlicense docs/credits_acknowledgements.rst
 }

From 6aacee04e09f823622647cff143a6d3ab2403eda 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: Sat, 20 Mar 2021 00:47:52 +0700
Subject: [PATCH 10/32] python3-occ: build with CMAKE_BUILD_TYPE=None

---
 srcpkgs/python3-occ/template | 1 +
 1 file changed, 1 insertion(+)

diff --git a/srcpkgs/python3-occ/template b/srcpkgs/python3-occ/template
index 705f37457943..3ea0ef5e6387 100644
--- a/srcpkgs/python3-occ/template
+++ b/srcpkgs/python3-occ/template
@@ -5,6 +5,7 @@ revision=1
 archs="i686* x86_64* armv7l* aarch64* ppc*"
 wrksrc="pythonocc-core-${version}"
 build_style=cmake
+configure_args="-DPYTHONOCC_BUILD_TYPE=None -DCMAKE_BUILD_TYPE=None"
 hostmakedepends="python3 swig"
 makedepends="python3-devel occt-devel freetype-devel swig"
 depends="python3 occt freetype"

From f36567e806214b96fa6f1b40e49c0f26fbd71677 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: Fri, 19 Mar 2021 23:38:10 +0700
Subject: [PATCH 11/32] widelands: allow CMAKE_BUILD_TYPE=None

---
 srcpkgs/widelands-data                        |  1 -
 .../patches/cmake-build-type-none.patch       | 63 +++++++++++++++++++
 .../widelands/patches/fix-install-path.patch  | 40 ++++++++++++
 srcpkgs/widelands/template                    | 21 +------
 4 files changed, 105 insertions(+), 20 deletions(-)
 delete mode 120000 srcpkgs/widelands-data
 create mode 100644 srcpkgs/widelands/patches/cmake-build-type-none.patch
 create mode 100644 srcpkgs/widelands/patches/fix-install-path.patch

diff --git a/srcpkgs/widelands-data b/srcpkgs/widelands-data
deleted file mode 120000
index e9fbf89517f2..000000000000
--- a/srcpkgs/widelands-data
+++ /dev/null
@@ -1 +0,0 @@
-widelands
\ No newline at end of file
diff --git a/srcpkgs/widelands/patches/cmake-build-type-none.patch b/srcpkgs/widelands/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..3d210854741b
--- /dev/null
+++ b/srcpkgs/widelands/patches/cmake-build-type-none.patch
@@ -0,0 +1,63 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -202,7 +202,7 @@ elseif(CMAKE_BUILD_TYPE STREQUAL "RelWit
+   set(WL_DEBUG_FLAGS "-DNDEBUG -DNOPARACHUTE")
+   option(OPTION_ASAN "Build with AddressSanitizer" ON)
+ else()
+-  message(FATAL_ERROR "Unknown CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
++  set(WL_DEBUG_FLAGS "-DNDEBUG -DNOPARACHUTE")
+ endif()
+ 
+ wl_add_flag(WL_GENERIC_CXX_FLAGS "-std=c++11")
+@@ -353,7 +353,7 @@ endif (OPTION_BUILD_TESTS)
+ install (
+   FILES ${CMAKE_CURRENT_BINARY_DIR}/VERSION
+   DESTINATION ${WL_INSTALL_BASEDIR}
+-  CONFIGURATIONS Debug;Release
++  CONFIGURATIONS Debug
+   COMPONENT CoreVersionFile
+ )
+ 
+@@ -378,7 +378,6 @@ install(
+     data/txts
+     data/world
+   DESTINATION ${WL_INSTALL_DATADIR}
+-  CONFIGURATIONS Debug;Release
+   COMPONENT CoreDataFiles
+ )
+ 
+@@ -386,7 +385,6 @@ install(
+   DIRECTORY
+     data/maps
+   DESTINATION ${WL_INSTALL_DATADIR}
+-  CONFIGURATIONS Debug;Release
+   COMPONENT MapFiles
+ )
+ 
+@@ -395,7 +393,6 @@ install(
+     data/music
+     data/sound
+   DESTINATION ${WL_INSTALL_DATADIR}
+-  CONFIGURATIONS Debug;Release
+   COMPONENT MusicFiles
+ )
+ 
+@@ -405,7 +402,7 @@ install(
+     CREDITS
+     ChangeLog
+   DESTINATION ${WL_INSTALL_BASEDIR}
+-  CONFIGURATIONS Debug;Release
++  CONFIGURATIONS Debug
+   COMPONENT CoreLicenseFiles
+ )
+ 
+@@ -424,7 +421,6 @@ install(
+   DIRECTORY
+     ${CMAKE_CURRENT_BINARY_DIR}/locale/
+   DESTINATION ${WL_INSTALL_DATADIR}/locale
+-  CONFIGURATIONS Debug;Release
+   COMPONENT CoreLanguageFiles
+ )
+ 
diff --git a/srcpkgs/widelands/patches/fix-install-path.patch b/srcpkgs/widelands/patches/fix-install-path.patch
new file mode 100644
index 000000000000..6bb461389f03
--- /dev/null
+++ b/srcpkgs/widelands/patches/fix-install-path.patch
@@ -0,0 +1,40 @@
+Index: cmake/WlFunctions.cmake
+===================================================================
+--- cmake/WlFunctions.cmake.orig
++++ cmake/WlFunctions.cmake
+@@ -289,5 +289,5 @@ function(wl_binary NAME)
+ 
+   #Quoting the CMake documentation on DESTINATION:
+   #"If a relative path is given it is interpreted relative to the value of CMAKE_INSTALL_PREFIX"
+-  install(TARGETS ${NAME} DESTINATION "." COMPONENT ExecutableFiles)
++  install(TARGETS ${NAME} DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT ExecutableFiles)
+ endfunction()
+Index: xdg/CMakeLists.txt
+===================================================================
+--- xdg/CMakeLists.txt.orig
++++ xdg/CMakeLists.txt
+@@ -6,19 +6,19 @@ set(XDG_APPLICATION_ID "org.widelands.Wi
+ list(APPEND icon_sizes "16" "32" "48" "64" "128")
+ foreach (icon_size ${icon_sizes})
+   #install(FILES ${CMAKE_SOURCE_DIR}/data/images/logos/wl-ico-${icon_size}.png DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/${icon_size}x${icon_size}/apps RENAME ${XDG_APPLICATION_ID}.png)
+-  install(FILES ${CMAKE_SOURCE_DIR}/data/images/logos/wl-ico-${icon_size}.png DESTINATION ../share/icons/hicolor/${icon_size}x${icon_size}/apps RENAME ${XDG_APPLICATION_ID}.png)
++  install(FILES ${CMAKE_SOURCE_DIR}/data/images/logos/wl-ico-${icon_size}.png DESTINATION share/icons/hicolor/${icon_size}x${icon_size}/apps RENAME ${XDG_APPLICATION_ID}.png)
+ endforeach (icon_size ${icon_sizes})
+ #install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${CMAKE_PROJECT_NAME}.6           DESTINATION ${CMAKE_INSTALL_MANDIR}/man6)
+-install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${CMAKE_PROJECT_NAME}.6           DESTINATION ../share/man/man6)
++install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${CMAKE_PROJECT_NAME}.6           DESTINATION share/man/man6)
+ #install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${XDG_APPLICATION_ID}.desktop     DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications)
+-install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${XDG_APPLICATION_ID}.desktop     DESTINATION ../share/applications)
++install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${XDG_APPLICATION_ID}.desktop     DESTINATION share/applications)
+ #install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${XDG_APPLICATION_ID}.appdata.xml DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/metainfo)
+-install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${XDG_APPLICATION_ID}.appdata.xml DESTINATION ../share/metainfo)
++install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${XDG_APPLICATION_ID}.appdata.xml DESTINATION share/metainfo)
+ 
+ find_program(GTK_UPDATE_ICON_CACHE NAMES gtk-update-icon-cache)
+ if (GTK_UPDATE_ICON_CACHE)
+   #install(CODE "execute_process (COMMAND ${GTK_UPDATE_ICON_CACHE} -t -f ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor ||: )")
+-  install(CODE "execute_process (COMMAND ${GTK_UPDATE_ICON_CACHE} -t -f ${CMAKE_INSTALL_PREFIX}/../share/icons/hicolor ||: )")
++  install(CODE "execute_process (COMMAND ${GTK_UPDATE_ICON_CACHE} -t -f ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor ||: )")
+ else (GTK_UPDATE_ICON_CACHE)
+   message(WARNING "gtk-update-icon-cache not found!")
+ endif (GTK_UPDATE_ICON_CACHE)
diff --git a/srcpkgs/widelands/template b/srcpkgs/widelands/template
index 6cee85087ea7..cfa2c10993e0 100644
--- a/srcpkgs/widelands/template
+++ b/srcpkgs/widelands/template
@@ -1,7 +1,7 @@
 # Template file for 'widelands'
 pkgname=widelands
 version=21
-revision=3
+revision=4
 wrksrc="${pkgname}-build${version}"
 build_style=cmake
 configure_args="-DOPENGL_INCLUDE_DIR=${XBPS_CROSS_BASE}/usr/include
@@ -10,13 +10,13 @@ hostmakedepends="python3 pkg-config gettext"
 makedepends="boost-devel icu-devel minizip-devel gettext-devel
  glu-devel glew-devel SDL2-devel SDL2_gfx-devel SDL2_image-devel
  SDL2_net-devel SDL2_mixer-devel SDL2_ttf-devel"
-depends="${pkgname}-data-${version}_${revision}"
 short_desc="Real-time strategy game"
 maintainer="Jürgen Buchmüller <pullmoll@t-online.de>"
 license="GPL-2.0-or-later"
 homepage="http://www.widelands.org/"
 distfiles="https://github.com/widelands/widelands/archive/build${version}.tar.gz>${pkgname}-${version}.tar.gz"
 checksum=601e0e4c6f91b3fb0ece2cd1b83ecfb02344a1b9194fbb70ef3f70e06994e357
+replaces="widelands-data>=0"
 
 CXXFLAGS="-DU_USING_ICU_NAMESPACE=1"
 
@@ -29,22 +29,5 @@ if [ "$CROSS_BUILD" ]; then
 fi
 
 post_install() {
-	# For some reason the binary is installed as /usr/widelands - move it
-	vmkdir usr/bin
-	mv ${DESTDIR}/usr/${pkgname} ${DESTDIR}/usr/bin
-	vmkdir usr/share
-	mv ${DESTDIR}/share/* ${DESTDIR}/usr/share/
-	rmdir ${DESTDIR}/share
-
-	# Remove files not needed in the package
-	rm -f ${DESTDIR}/usr/COPYING ${DESTDIR}/usr/CREDITS ${DESTDIR}/usr/ChangeLog ${DESTDIR}/usr/VERSION
-
 	vinstall ${FILESDIR}/${pkgname}.desktop 644 usr/share/applications
 }
-
-widelands-data_package() {
-	short_desc+=" - data files"
-	pkg_install() {
-		vmove usr/share/widelands
-	}
-}

From e8b44331d198ba41b7d99b00d2194eb75207e65b 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: Sat, 20 Mar 2021 09:49:25 +0700
Subject: [PATCH 12/32] zziplib: fix SONAME when build with
 -DCMAKE_BUILD_TYPE=None

---
 .../cmake-build-type-none-soname.patch        | 35 +++++++++++++++++++
 srcpkgs/zziplib/template                      |  1 +
 2 files changed, 36 insertions(+)
 create mode 100644 srcpkgs/zziplib/patches/cmake-build-type-none-soname.patch

diff --git a/srcpkgs/zziplib/patches/cmake-build-type-none-soname.patch b/srcpkgs/zziplib/patches/cmake-build-type-none-soname.patch
new file mode 100644
index 000000000000..2d31b5b8a46a
--- /dev/null
+++ b/srcpkgs/zziplib/patches/cmake-build-type-none-soname.patch
@@ -0,0 +1,35 @@
+Index: zziplib-0.13.72/zzip/CMakeLists.txt
+===================================================================
+--- zziplib-0.13.72.orig/zzip/CMakeLists.txt
++++ zziplib-0.13.72/zzip/CMakeLists.txt
+@@ -190,15 +190,18 @@ target_include_directories (libzzipmmapp
+ endif()
+ 
+ set_target_properties(libzzip PROPERTIES OUTPUT_NAME "zzip" RELEASE_POSTFIX "-${RELNUM}")
++set_target_properties(libzzip PROPERTIES OUTPUT_NAME "zzip" NONE_POSTFIX "-${RELNUM}")
+ SET_TARGET_PROPERTIES(libzzip PROPERTIES VERSION ${VERNUM}.${FIXNUM} SOVERSION ${VERNUM})
+ 
+ if(ZZIPFSEEKO)
+ set_target_properties(libzzipfseeko PROPERTIES OUTPUT_NAME "zzipfseeko" RELEASE_POSTFIX "-${RELNUM}")
++set_target_properties(libzzipfseeko PROPERTIES OUTPUT_NAME "zzipfseeko" NONE_POSTFIX "-${RELNUM}")
+ SET_TARGET_PROPERTIES(libzzipfseeko PROPERTIES VERSION ${VERNUM}.${FIXNUM} SOVERSION ${VERNUM})
+ endif()
+ 
+ if(ZZIPMMAPPED)
+ set_target_properties(libzzipmmapped PROPERTIES OUTPUT_NAME "zzipmmapped" RELEASE_POSTFIX "-${RELNUM}")
++set_target_properties(libzzipmmapped PROPERTIES OUTPUT_NAME "zzipmmapped" NONE_POSTFIX "-${RELNUM}")
+ SET_TARGET_PROPERTIES(libzzipmmapped PROPERTIES VERSION ${VERNUM}.${FIXNUM} SOVERSION ${VERNUM})
+ endif()
+ 
+Index: zziplib-0.13.72/zzipwrap/CMakeLists.txt
+===================================================================
+--- zziplib-0.13.72.orig/zzipwrap/CMakeLists.txt
++++ zziplib-0.13.72/zzipwrap/CMakeLists.txt
+@@ -49,6 +49,7 @@ target_link_libraries(libzzipwrap libzzi
+ target_include_directories(libzzipwrap PRIVATE "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}")
+ 
+ set_target_properties(libzzipwrap PROPERTIES OUTPUT_NAME "zzipwrap" RELEASE_POSTFIX "-${RELNUM}")
++set_target_properties(libzzipwrap PROPERTIES OUTPUT_NAME "zzipwrap" NONE_POSTFIX "-${RELNUM}")
+ SET_TARGET_PROPERTIES(libzzipwrap PROPERTIES VERSION ${VERNUM}.${FIXNUM} SOVERSION ${VERNUM})
+ set_target_properties(libzzipwrap PROPERTIES DEFINE_SYMBOL "libzzip_EXPORTS")
+ 
diff --git a/srcpkgs/zziplib/template b/srcpkgs/zziplib/template
index ab5af234af62..2026f3e4a521 100644
--- a/srcpkgs/zziplib/template
+++ b/srcpkgs/zziplib/template
@@ -12,6 +12,7 @@ homepage="https://github.com/gdraheim/zziplib"
 changelog="https://raw.githubusercontent.com/gdraheim/zziplib/master/ChangeLog"
 distfiles="https://github.com/gdraheim/zziplib/archive/v${version}.tar.gz"
 checksum=93ef44bf1f1ea24fc66080426a469df82fa631d13ca3b2e4abaeab89538518dc
+patch_args=-Np1
 
 if [ "$CROSS_BUILD" ]; then
 	configure_args+=" -DZZIPTEST=OFF"

From 0e7c8856f68c3ffc1691567e2ad65967425afbaa 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, 21 Mar 2021 15:28:04 +0700
Subject: [PATCH 13/32] mellowplayer: fix build

---
 srcpkgs/mellowplayer/patches/no-werror.patch | 13 +++++++++++++
 srcpkgs/mellowplayer/template                | 13 +++++++------
 2 files changed, 20 insertions(+), 6 deletions(-)
 create mode 100644 srcpkgs/mellowplayer/patches/no-werror.patch

diff --git a/srcpkgs/mellowplayer/patches/no-werror.patch b/srcpkgs/mellowplayer/patches/no-werror.patch
new file mode 100644
index 000000000000..7e678453a123
--- /dev/null
+++ b/srcpkgs/mellowplayer/patches/no-werror.patch
@@ -0,0 +1,13 @@
+Index: MellowPlayer-3.6.6/src/3rdparty/boost/di.hpp
+===================================================================
+--- MellowPlayer-3.6.6.orig/src/3rdparty/boost/di.hpp
++++ MellowPlayer-3.6.6/src/3rdparty/boost/di.hpp
+@@ -67,7 +67,7 @@ BOOST_DI_CFG_FWD
+ #pragma clang diagnostic error "-Wundefined-internal"
+ #pragma clang diagnostic ignored "-Wmissing-field-initializers"
+ #elif defined(__GCC__)
+-#pragma GCC diagnostic error "-Wdeprecated-declarations"
++#pragma GCC diagnostic warning "-Wdeprecated-declarations"
+ #pragma GCC diagnostic push
+ #if (__GNUC__ < 6)
+ #pragma GCC diagnostic error "-Werror"
diff --git a/srcpkgs/mellowplayer/template b/srcpkgs/mellowplayer/template
index 2f8f13960ca6..cfd8a185556f 100644
--- a/srcpkgs/mellowplayer/template
+++ b/srcpkgs/mellowplayer/template
@@ -4,7 +4,7 @@ version=3.6.6
 revision=1
 wrksrc="MellowPlayer-${version}"
 build_style=cmake
-hostmakedepends="pkg-config qt5-tools qt5-qmake"
+hostmakedepends="pkg-config qt5-tools qt5-qmake qt5-host-tools"
 makedepends="qt5-declarative-devel qt5-quickcontrols2-devel
  qt5-plugin-mysql qt5-plugin-pgsql qt5-plugin-sqlite
  qt5-plugin-tds qt5-plugin-odbc
@@ -17,11 +17,12 @@ license="GPL-2.0-or-later"
 homepage="https://colinduquesnoy.gitlab.io/MellowPlayer/"
 distfiles="https://gitlab.com/ColinDuquesnoy/MellowPlayer/-/archive/${version}/MellowPlayer-${version}.tar.bz2"
 checksum=17b8b25ca6b3d27b223f8be6ad80186ae5bd17ce762eb04ecd8b0e82e687b327
+patch_args=-Np1
 
-if [ "$CROSS_BUILD" ]; then
-	hostmakedepends+=" qt5-host-tools"
+if [ "$XBPS_WORDSIZE" != "$XBPS_TARGET_WORDSIZE" ]; then
+	broken="webengine can be built only if word size matches"
 fi
 
-case "$XBPS_TARGET_MACHINE" in
-	arm*) broken="qt5-webengine not available" ;;
-esac
+if [ "$XBPS_TARGET_ENDIAN" != "le" ]; then
+	broken="webengine only supports little endian"
+fi

From 0ce1832319113c1a92f43c7aaa50bf23f5514cdf 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, 21 Mar 2021 15:43:09 +0700
Subject: [PATCH 14/32] ispc: fix CMAKE_BUILD_TYPE=None

---
 .../ispc/patches/cmake-build-type-none.patch   | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
 create mode 100644 srcpkgs/ispc/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/ispc/patches/cmake-build-type-none.patch b/srcpkgs/ispc/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..411e353c7314
--- /dev/null
+++ b/srcpkgs/ispc/patches/cmake-build-type-none.patch
@@ -0,0 +1,18 @@
+Index: ispc-1.15.0/CMakeLists.txt
+===================================================================
+--- ispc-1.15.0.orig/CMakeLists.txt
++++ ispc-1.15.0/CMakeLists.txt
+@@ -157,13 +157,6 @@ set(OUTPUT_RELEASE Release/bin)
+ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin )
+ 
+ if(CMAKE_BUILD_TYPE)
+-    # Validate build type
+-    set(CONFIGURATION_TYPES "Debug;Release;RelWithDebInfo")
+-
+-    string(FIND "${CONFIGURATION_TYPES}" "${CMAKE_BUILD_TYPE}" MATCHED_CONFIG)
+-    if (${MATCHED_CONFIG} EQUAL -1)
+-         message(FATAL_ERROR "CMAKE_BUILD_TYPE (${CMAKE_BUILD_TYPE}) allows only the following values: ${CONFIGURATION_TYPES}")
+-    endif()
+ else(NOT CMAKE_BUILD_TYPE)
+     set(CMAKE_BUILD_TYPE "Release")
+     message(STATUS "Build type not specified: Use Release by default.")

From 914acbd42098081f79b90a5d0756c0e9b76d3006 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, 21 Mar 2021 15:56:50 +0700
Subject: [PATCH 15/32] darktable: fix CMAKE_BUILD_TYPE=None

---
 .../darktable/patches/cmake-build-type-none.patch  | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
 create mode 100644 srcpkgs/darktable/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/darktable/patches/cmake-build-type-none.patch b/srcpkgs/darktable/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..7101f9c1a0e7
--- /dev/null
+++ b/srcpkgs/darktable/patches/cmake-build-type-none.patch
@@ -0,0 +1,14 @@
+Index: src/external/rawspeed/cmake/build-type.cmake
+===================================================================
+--- src/external/rawspeed/cmake/build-type.cmake.orig
++++ src/external/rawspeed/cmake/build-type.cmake
+@@ -27,9 +27,6 @@ string(TOUPPER "${RAWSPEED_SPECIAL_BUILD
+ 
+ # is this one of the known build types?
+ list (FIND CMAKE_CONFIGURATION_TYPES_UPPERCASE ${CMAKE_BUILD_TYPE_UPPERCASE} BUILD_TYPE_IS_KNOWN)
+-if (${BUILD_TYPE_IS_KNOWN} EQUAL -1)
+- message(SEND_ERROR "Unknown build type: ${CMAKE_BUILD_TYPE_UPPERCASE}. Please specify one of: ${CMAKE_CONFIGURATION_TYPES}")
+-endif()
+ 
+ # is this a special build?
+ list (FIND RAWSPEED_SPECIAL_BUILD_TYPES_UPPERCASE ${CMAKE_BUILD_TYPE_UPPERCASE} IS_SPECIAL_BUILD)

From e745e765d75fabb99f127940714e28720ee55c6d 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, 21 Mar 2021 15:33:29 +0700
Subject: [PATCH 16/32] hedgewars: merge -data back

---
 srcpkgs/hedgewars-data                        |  1 -
 .../patches/cmake-build-type-none.patch       | 30 +++++++++++++++++++
 srcpkgs/hedgewars/template                    | 23 +++++---------
 3 files changed, 38 insertions(+), 16 deletions(-)
 delete mode 120000 srcpkgs/hedgewars-data
 create mode 100644 srcpkgs/hedgewars/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/hedgewars-data b/srcpkgs/hedgewars-data
deleted file mode 120000
index b57dc45ebadc..000000000000
--- a/srcpkgs/hedgewars-data
+++ /dev/null
@@ -1 +0,0 @@
-hedgewars
\ No newline at end of file
diff --git a/srcpkgs/hedgewars/patches/cmake-build-type-none.patch b/srcpkgs/hedgewars/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..b4e0c186717c
--- /dev/null
+++ b/srcpkgs/hedgewars/patches/cmake-build-type-none.patch
@@ -0,0 +1,30 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -54,7 +54,7 @@ option(NOVERSIONINFOUPDATE "Disable upda
+ 
+ 
+ if(BUILD_ENGINE_C AND NOT NOVIDEOREC)
+-    if((CMAKE_BUILD_TYPE STREQUAL "Release") OR (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo"))
++    if((CMAKE_BUILD_TYPE STREQUAL "Release") OR (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo") OR (CMAKE_BUILD_TYPE STREQUAL "None"))
+         message("NOTE: Video recorder support disabled. It's incompatible with BUILD_ENGINE_C")
+         set(BUILD_ENGINE_C ON CACHE STRING "Required for BUILD_ENGINE_JS" FORCE)
+     else()
+@@ -93,7 +93,7 @@ set(CPACK_PACKAGE_VERSION_MAJOR 1)
+ set(CPACK_PACKAGE_VERSION_MINOR 0)
+ set(CPACK_PACKAGE_VERSION_PATCH 0)
+ set(HEDGEWARS_PROTO_VER 59)
+-if((CMAKE_BUILD_TYPE STREQUAL "Release") OR (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo"))
++if((CMAKE_BUILD_TYPE STREQUAL "Release") OR (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo") OR (CMAKE_BUILD_TYPE STREQUAL "None"))
+     set(HEDGEWARS_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
+ else()
+     set(HEDGEWARS_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}-dev")
+@@ -114,6 +114,7 @@ include(${CMAKE_MODULE_PATH}/platform.cm
+ if(CMAKE_BUILD_TYPE)
+     if(NOT((CMAKE_BUILD_TYPE STREQUAL "Release") OR
+            (CMAKE_BUILD_TYPE STREQUAL "Debug") OR
++	   (CMAKE_BUILD_TYPE STREQUAL "None") OR
+            (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")))
+         set(CMAKE_BUILD_TYPE ${default_build_type} CACHE STRING "Build type (Debug/Release/RelWithDebInfo)" FORCE)
+         message(STATUS "Unknown build type ${CMAKE_BUILD_TYPE}, using default (${default_build_type})")
diff --git a/srcpkgs/hedgewars/template b/srcpkgs/hedgewars/template
index d2294cf572f5..f413a965ff2e 100644
--- a/srcpkgs/hedgewars/template
+++ b/srcpkgs/hedgewars/template
@@ -1,15 +1,15 @@
 # Template file for 'hedgewars'
 pkgname=hedgewars
 version=1.0.0
-revision=2
+revision=3
 wrksrc="${pkgname}-src-${version}"
 build_style=cmake
 configure_args="-DNOSERVER=1 -DDATA_INSTALL_DIR=/usr/share/${pkgname}
- -DPHYSFS_SYSTEM=1 -DCMAKE_VERBOSE_MAKEFILE=1 -DMINIMAL_FLAGS=1"
-hostmakedepends="lua51 pkg-config"
+ -DPHYSFS_SYSTEM=1 -DMINIMAL_FLAGS=1"
+hostmakedepends="lua51 pkg-config qt5-qmake qt5-host-tools"
 makedepends="ffmpeg-devel lua51-devel physfs-devel qt5-tools-devel SDL2_image-devel
  SDL2_mixer-devel SDL2_net-devel SDL2_ttf-devel"
-depends="hedgewars-data>=${version}_${revision} libfreeglut"
+depends="libfreeglut"
 short_desc="Funny turn-based artillery game, featuring fighting Hedgehogs!"
 maintainer="Jakub Skrzypnik <jot.skrzyp@gmail.com>"
 license="GPL-2.0-only"
@@ -18,10 +18,9 @@ distfiles="https://hedgewars.org/download/releases/hedgewars-src-${version}.tar.
 checksum=211634e61f2e4beecc3c98c6f749601fcd08321fda1ba969b3b3832a004f155b
 nopie_files="/usr/bin/hwengine"
 nocross="Needs investigation: fails to link hwengine"
-
-if [ -n "$CROSS_BUILD" ]; then
-	hostmakedepends+=" qt5-devel"
-fi
+replaces="hedgewars-data>=0"
+export CMAKE_GENERATOR="Unix Makefiles"
+make_cmd=make
 
 case $XBPS_TARGET_MACHINE in
 	x86_64*)
@@ -38,6 +37,7 @@ esac
 
 if [ -n "$_use_c_engine" ]; then
 	hostmakedepends+=" glew-devel libatomic-devel ghc clang"
+	makedepends+=" glew-devel libatomic-devel"
 	configure_args+=" -DBUILD_ENGINE_C=1"
 	nopie_files+=" /usr/bin/hedgewars"
 fi
@@ -56,10 +56,3 @@ pre_configure() {
 post_install() {
 	vinstall ${DESTDIR}/usr/share/hedgewars/Data/misc/hedgewars.desktop 644 usr/share/applications
 }
-
-hedgewars-data_package() {
-	short_desc+=" - data files"
-	pkg_install() {
-		vmove usr/share/hedgewars/Data
-	}
-}

From 8e0fe63861ce4cb12009deaff8cb78ba64eba469 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, 21 Mar 2021 16:41:58 +0700
Subject: [PATCH 17/32] mariadb: fix for CMAKE_BUILD_TYPE=None

---
 srcpkgs/mariadb/template | 32 ++++++++++++++------------------
 1 file changed, 14 insertions(+), 18 deletions(-)

diff --git a/srcpkgs/mariadb/template b/srcpkgs/mariadb/template
index 437ff757b383..78d5e2dbdbe8 100644
--- a/srcpkgs/mariadb/template
+++ b/srcpkgs/mariadb/template
@@ -34,35 +34,31 @@ replaces="mysql>=0"
 conf_files="/etc/mysql/my.cnf"
 system_accounts="mysql"
 mysql_homedir="/var/lib/mysql"
-CFLAGS="-w -fcommon"
+CFLAGS="-w -fcommon -DDBUG_OFF=1"
+CXXFLAGS="-DDBUG_OFF=1"
 
 pre_configure() {
 	# We need some host binaries before starting cross compilation.
 	if [ "$CROSS_BUILD" ]; then
+		mkdir -p build.native
 		# XXX still broken: jemalloc configure execs host bins.
-		CC= CXX= CPP= LD= AR= AS= RANLIB= CFLAGS= CXXFLAGS= LDFLAGS= cmake .
-		make comp_err comp_sql gen_lex_hash gen_lex_token
-		mkdir bin.host
-		cp extra/comp_err bin.host
-		cp scripts/comp_sql bin.host
-		cp sql/gen_lex_hash bin.host
-		cp sql/gen_lex_token bin.host
-		make clean
-		rm CMakeCache.txt
+		CC= CXX= CPP= LD= AR= AS= RANLIB= CFLAGS= CXXFLAGS= LDFLAGS= \
+			cmake -S . -B build.native
+		make -C build.native comp_err comp_sql gen_lex_hash gen_lex_token
 	fi
 }
 
 pre_build() {
 	if [ "$CROSS_BUILD" ]; then
 		# CMake complains if those binaries ain't in build
-		cp bin.host/comp_err ${wrksrc}/extra
-		cp bin.host/comp_err ${wrksrc}/build/extra
-		cp bin.host/comp_sql ${wrksrc}/scripts
-		cp bin.host/comp_sql ${wrksrc}/build/scripts
-		cp bin.host/gen_lex_hash ${wrksrc}/sql
-		cp bin.host/gen_lex_hash ${wrksrc}/build/sql
-		cp bin.host/gen_lex_token ${wrksrc}/sql
-		cp bin.host/gen_lex_token ${wrksrc}/build/sql
+		cp build.native/extra/comp_err ${wrksrc}/extra
+		cp build.native/extra/comp_err ${wrksrc}/build/extra
+		cp build.native/scripts/comp_sql ${wrksrc}/scripts
+		cp build.native/scripts/comp_sql ${wrksrc}/build/scripts
+		cp build.native/sql/gen_lex_hash ${wrksrc}/sql
+		cp build.native/sql/gen_lex_hash ${wrksrc}/build/sql
+		cp build.native/sql/gen_lex_token ${wrksrc}/sql
+		cp build.native/sql/gen_lex_token ${wrksrc}/build/sql
 		export PATH=${PATH}:${wrksrc}/extra:${wrksrc}/scripts:${wrksrc}/sql
 	fi
 	export LD_LIBRARY_PATH=${wrksrc}/build/storage/tokudb/ft-index/portability

From fab84820a91e5a12b52327ba0d979a07f71841a0 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: Thu, 25 Mar 2021 07:58:28 +0700
Subject: [PATCH 18/32] EternalTerminal: remove -ggdb3

---
 .../EternalTerminal/patches/fix-cflags.patch    | 17 +++++++++++++++++
 srcpkgs/EternalTerminal/template                |  1 +
 2 files changed, 18 insertions(+)
 create mode 100644 srcpkgs/EternalTerminal/patches/fix-cflags.patch

diff --git a/srcpkgs/EternalTerminal/patches/fix-cflags.patch b/srcpkgs/EternalTerminal/patches/fix-cflags.patch
new file mode 100644
index 000000000000..e6fcd432f7e7
--- /dev/null
+++ b/srcpkgs/EternalTerminal/patches/fix-cflags.patch
@@ -0,0 +1,17 @@
+Index: EternalTerminal-et-v6.0.13/CMakeLists.txt
+===================================================================
+--- EternalTerminal-et-v6.0.13.orig/CMakeLists.txt
++++ EternalTerminal-et-v6.0.13/CMakeLists.txt
+@@ -26,12 +26,6 @@ if(DISABLE_CRASH_LOG)
+ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DELPP_DISABLE_DEFAULT_CRASH_HANDLING")
+ ENDIF(DISABLE_CRASH_LOG)
+ 
+-if(UNIX)
+-  # Enable debug info
+-  SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -ggdb3")
+-  SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -ggdb3")
+-endif()
+-
+ # Enable C++-11
+ set(CMAKE_CXX_STANDARD 11)
+ set(CMAKE_CXX_STANDARD_REQUIRED ON)
diff --git a/srcpkgs/EternalTerminal/template b/srcpkgs/EternalTerminal/template
index 7bac78d2ffd4..bc92e47743dd 100644
--- a/srcpkgs/EternalTerminal/template
+++ b/srcpkgs/EternalTerminal/template
@@ -13,6 +13,7 @@ homepage="https://eternalterminal.dev/"
 distfiles="https://github.com/MisterTea/EternalTerminal/archive/et-v${version}.tar.gz"
 checksum=728c3a444d666897c710e33fe473d8d289263a59574451b13aa53ec3c6ac88b3
 system_accounts="_eternal"
+patch_args=-Np1
 
 LDFLAGS="-lgflags"
 

From 51f5739b2de15686b26fadcf32c51d7cc018f102 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: Thu, 25 Mar 2021 08:20:29 +0700
Subject: [PATCH 19/32] OTPClient: respect CFLAGS

---
 srcpkgs/OTPClient/patches/fix-cflags.patch | 17 +++++++++++++++++
 srcpkgs/OTPClient/template                 |  1 +
 2 files changed, 18 insertions(+)
 create mode 100644 srcpkgs/OTPClient/patches/fix-cflags.patch

diff --git a/srcpkgs/OTPClient/patches/fix-cflags.patch b/srcpkgs/OTPClient/patches/fix-cflags.patch
new file mode 100644
index 000000000000..ae70f441538f
--- /dev/null
+++ b/srcpkgs/OTPClient/patches/fix-cflags.patch
@@ -0,0 +1,17 @@
+Index: OTPClient-2.4.2/CMakeLists.txt
+===================================================================
+--- OTPClient-2.4.2.orig/CMakeLists.txt
++++ OTPClient-2.4.2/CMakeLists.txt
+@@ -11,11 +11,10 @@ option(BUILD_GUI "Build the GUI" ON)
+ option(BUILD_CLI "Build the CLI" ON)
+ 
+ set(CMAKE_C_STANDARD 11)
+-set(CMAKE_C_FLAGS "-Wall -Wextra -O3 -Wformat=2 -Wmissing-format-attribute -fstack-protector-strong -Wundef -Wmissing-format-attribute")
++set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wformat=2 -Wmissing-format-attribute -fstack-protector-strong -Wundef -Wmissing-format-attribute")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fdiagnostics-color=always -Wstrict-prototypes -Wunreachable-code")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wchar-subscripts -Wwrite-strings -Wpointer-arith -Wbad-function-cast -Wcast-align")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror=format-security -Werror=implicit-function-declaration -Wno-sign-compare")
+-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3")
+ if(CMAKE_COMPILER_IS_GNUCC)
+     set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pie -fPIE")
+ endif()
diff --git a/srcpkgs/OTPClient/template b/srcpkgs/OTPClient/template
index e8c0099850b7..f5af76e655a6 100644
--- a/srcpkgs/OTPClient/template
+++ b/srcpkgs/OTPClient/template
@@ -12,3 +12,4 @@ license="GPL-3.0-or-later"
 homepage="https://github.com/paolostivanin/OTPClient"
 distfiles="https://github.com/paolostivanin/OTPClient/archive/v${version}.tar.gz"
 checksum=74bc4312aa1cd336ca983434e3bed951c5ead327091e7708e3beb08508813495
+patch_args=-Np1

From 84e9de6048876804dc062cd2ea7044517084f4b4 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: Thu, 25 Mar 2021 08:30:31 +0700
Subject: [PATCH 20/32] crex: hardening

---
 srcpkgs/crex/patches/fix-cflags.patch | 20 ++++++++++++++++++++
 srcpkgs/crex/template                 |  7 ++-----
 2 files changed, 22 insertions(+), 5 deletions(-)
 create mode 100644 srcpkgs/crex/patches/fix-cflags.patch

diff --git a/srcpkgs/crex/patches/fix-cflags.patch b/srcpkgs/crex/patches/fix-cflags.patch
new file mode 100644
index 000000000000..d191fb1e9ec0
--- /dev/null
+++ b/srcpkgs/crex/patches/fix-cflags.patch
@@ -0,0 +1,20 @@
+Index: crex-0.2.5/CMakeLists.txt
+===================================================================
+--- crex-0.2.5.orig/CMakeLists.txt
++++ crex-0.2.5/CMakeLists.txt
+@@ -13,9 +13,6 @@ endif(CCACHE_FOUND)
+ set (CMAKE_CXX_STANDARD 14)
+ set (CMAKE_CXX_STANDARD_REQUIRED ON)
+ 
+-set (CMAKE_CXX_FLAGS "-fdiagnostics-color=auto")
+-set (CMAKE_C_FLAGS "-fdiagnostics-color=auto")
+-
+ set (DEBUG_FLAGS "-Wpedantic -Wall -Wextra -Wcast-align -Wcast-qual -Wctor-dtor-privacy -Wdisabled-optimization -Wformat=2 -Winit-self -Wlogical-op -Wmissing-declarations -Wmissing-include-dirs -Wnoexcept -Wold-style-cast -Woverloaded-virtual -Wredundant-decls -Wshadow -Wsign-conversion -Wsign-promo -Wstrict-null-sentinel -Wstrict-overflow=5 -Wswitch-default -Wundef -Wno-unused -std=c++14 -g")
+ set (DEBUG_LINK_FLAGS "-fprofile-arcs -ftest-coverage -flto")
+ 
+@@ -56,4 +53,4 @@ target_link_libraries (
+   ${TARGET}
+ )
+ 
+-install (TARGETS ${TARGET} DESTINATION "/usr/local/bin")
++install (TARGETS ${TARGET} DESTINATION "/usr/bin")
diff --git a/srcpkgs/crex/template b/srcpkgs/crex/template
index a54697a93adc..2f455a0b0c72 100644
--- a/srcpkgs/crex/template
+++ b/srcpkgs/crex/template
@@ -1,7 +1,7 @@
 # Template file for 'crex'
 pkgname=crex
 version=0.2.5
-revision=1
+revision=2
 build_style=cmake
 short_desc="Explore, test, and check regular expressions in the terminal"
 maintainer="Piotr Wójcik <chocimier@tlen.pl>"
@@ -9,10 +9,7 @@ license="MIT"
 homepage="https://github.com/octobanana/crex"
 distfiles="https://github.com/octobanana/crex/archive/${version}.tar.gz"
 checksum=c6a166b7a1e696a7babeaf7c5728eece1624704a18357f827129fc95ef2ecc56
-
-pre_configure() {
-	sed -e 's|/local/|/|' -i CMakeLists.txt
-}
+patch_args=-Np1
 
 post_install() {
 	vlicense LICENSE

From 6c422f8770ca53892e54ecfc3a28d940a7869049 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: Thu, 25 Mar 2021 08:34:32 +0700
Subject: [PATCH 21/32] libbaseencode: hardening

---
 srcpkgs/libbaseencode/patches/fix-cflags.patch | 13 +++++++++++++
 srcpkgs/libbaseencode/template                 |  3 ++-
 2 files changed, 15 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/libbaseencode/patches/fix-cflags.patch

diff --git a/srcpkgs/libbaseencode/patches/fix-cflags.patch b/srcpkgs/libbaseencode/patches/fix-cflags.patch
new file mode 100644
index 000000000000..1bb86a0b15a4
--- /dev/null
+++ b/srcpkgs/libbaseencode/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: libbaseencode-1.0.9/CMakeLists.txt
+===================================================================
+--- libbaseencode-1.0.9.orig/CMakeLists.txt
++++ libbaseencode-1.0.9/CMakeLists.txt
+@@ -15,7 +15,7 @@ set(CMAKE_C_STANDARD 11)
+ set(BASEENCODE_HEADERS src/baseencode.h)
+ set(SOURCE_FILES src/base32.c src/base64.c)
+ 
+-set(CMAKE_C_FLAGS "-Wall -Werror -fPIC")
++set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Werror -fPIC")
+ 
+ add_library(${PROJECT_NAME} SHARED ${SOURCE_FILES})
+ 
diff --git a/srcpkgs/libbaseencode/template b/srcpkgs/libbaseencode/template
index 384a189224df..d5929ad7bb51 100644
--- a/srcpkgs/libbaseencode/template
+++ b/srcpkgs/libbaseencode/template
@@ -1,7 +1,7 @@
 # Template file for 'libbaseencode'
 pkgname=libbaseencode
 version=1.0.9
-revision=1
+revision=2
 build_style=cmake
 short_desc="Library for encoding decoding data use base32 or base64"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -9,6 +9,7 @@ license="Apache-2.0"
 homepage="https://github.com/paolostivanin/libbaseencode"
 distfiles="https://github.com/paolostivanin/libbaseencode/archive/v${version}.tar.gz"
 checksum=a183d7cf30d931b2a078d6f0ef64616b71ab26f9258e5f4e191778c7ace7175d
+patch_args=-Np1
 
 libbaseencode-devel_package() {
 	depends="libbaseencode-${version}_${revision}"

From 9f83619b22575994581f90ce253206dfcd118936 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: Fri, 26 Mar 2021 08:46:56 +0700
Subject: [PATCH 22/32] bibletime: clean build flags

---
 srcpkgs/bibletime/patches/fix-cflags.patch | 13 +++++++++++++
 srcpkgs/bibletime/template                 |  1 +
 2 files changed, 14 insertions(+)
 create mode 100644 srcpkgs/bibletime/patches/fix-cflags.patch

diff --git a/srcpkgs/bibletime/patches/fix-cflags.patch b/srcpkgs/bibletime/patches/fix-cflags.patch
new file mode 100644
index 000000000000..480c5ca4ac1e
--- /dev/null
+++ b/srcpkgs/bibletime/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: bibletime-3.0/cmake/BTApplication.cmake
+===================================================================
+--- bibletime-3.0.orig/cmake/BTApplication.cmake
++++ bibletime-3.0/cmake/BTApplication.cmake
+@@ -41,7 +41,7 @@ IF(WIN32)
+     ADD_COMPILE_OPTIONS("/Zi")
+ ELSE()
+     ADD_COMPILE_OPTIONS(
+-        "-ggdb" "-Wall" "-Wextra"
++        "-Wall" "-Wextra" "-DNDEBUG" "-DQT_NO_DEBUG"
+         "$<$<STREQUAL:$<CONFIGURATION>,Release>:-O2>"
+         "$<$<STREQUAL:$<CONFIGURATION>,Release>:-DNDEBUG>"
+         "$<$<STREQUAL:$<CONFIGURATION>,Release>:-DQT_NO_DEBUG>"
diff --git a/srcpkgs/bibletime/template b/srcpkgs/bibletime/template
index 224881c45516..85bcc7f22f87 100644
--- a/srcpkgs/bibletime/template
+++ b/srcpkgs/bibletime/template
@@ -18,6 +18,7 @@ license="GPL-2.0-or-later"
 homepage="http://bibletime.info"
 distfiles="https://github.com/bibletime/bibletime/releases/download/v${version}/bibletime-${version}.tar.xz"
 checksum=d6beef62ad44b255e3dc4c5e89214bf01a0e85c9136073b0be12fca3d2b22622
+patch_args=-Np1
 
 pre_build() {
 	. /etc/profile.d/10_openjdk11.sh

From 41dbc96694adad5d7d20b3f1f94241aa2b719a06 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: Fri, 26 Mar 2021 08:54:25 +0700
Subject: [PATCH 23/32] boomerang: clean build flags

---
 srcpkgs/boomerang/patches/fix-cflags.patch | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
 create mode 100644 srcpkgs/boomerang/patches/fix-cflags.patch

diff --git a/srcpkgs/boomerang/patches/fix-cflags.patch b/srcpkgs/boomerang/patches/fix-cflags.patch
new file mode 100644
index 000000000000..eb59766c1c5b
--- /dev/null
+++ b/srcpkgs/boomerang/patches/fix-cflags.patch
@@ -0,0 +1,21 @@
+Index: cmake-scripts/boomerang-flags.cmake
+===================================================================
+--- cmake-scripts/boomerang-flags.cmake
++++ cmake-scripts/boomerang-flags.cmake
+@@ -104,16 +104,6 @@ endif ()
+ 
+ 
+ if (NOT MSVC)
+-    if ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
+-        BOOMERANG_ADD_COMPILE_FLAGS(-O0)
+-    elseif ("${CMAKE_BUILD_TYPE}" STREQUAL "RelWithDebInfo")
+-        # No special flags
+-    elseif ("${CMAKE_BUILD_TYPE}" STREQUAL "MinSizeRel")
+-        BOOMERANG_ADD_COMPILE_FLAGS(-Os)
+-    else () # Release
+-        BOOMERANG_ADD_COMPILE_FLAGS(-O3)
+-    endif ()
+-
+     if (BOOMERANG_ENABLE_COVERAGE)
+         set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fprofile-arcs -ftest-coverage")
+         set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage")

From efe9b6ce70c7ecfe7d17e605b8edcef1e8d57b6a 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: Fri, 26 Mar 2021 08:58:11 +0700
Subject: [PATCH 24/32] catimg: don't change our build-type

---
 srcpkgs/catimg/patches/fix-cflags.patch | 12 ++++++++++++
 srcpkgs/catimg/template                 |  2 +-
 2 files changed, 13 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/catimg/patches/fix-cflags.patch

diff --git a/srcpkgs/catimg/patches/fix-cflags.patch b/srcpkgs/catimg/patches/fix-cflags.patch
new file mode 100644
index 000000000000..9b9f1074ef20
--- /dev/null
+++ b/srcpkgs/catimg/patches/fix-cflags.patch
@@ -0,0 +1,12 @@
+Index: catimg-2.7.0/CMakeLists.txt
+===================================================================
+--- catimg-2.7.0.orig/CMakeLists.txt
++++ catimg-2.7.0/CMakeLists.txt
+@@ -11,7 +11,6 @@ endif()
+ #set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wall -Wextra -g -std=c99 -Wno-unused-result")
+ #set(CMAKE_BUILD_TYPE Debug)
+ set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -Wall -Wextra -Os -std=c99 -Wno-unused-result")
+-set(CMAKE_BUILD_TYPE Release)
+ 
+ set(SRC ${PROJECT_SOURCE_DIR}/src)
+ 
diff --git a/srcpkgs/catimg/template b/srcpkgs/catimg/template
index 374351c45379..6fbc5f1d9140 100644
--- a/srcpkgs/catimg/template
+++ b/srcpkgs/catimg/template
@@ -9,7 +9,7 @@ license="MIT"
 homepage="https://github.com/posva/catimg"
 distfiles="https://github.com/posva/catimg/archive/${version}.tar.gz"
 checksum=3a6450316ff62fb07c3facb47ea208bf98f62abd02783e88c56f2a6508035139
-
+patch_args=-Np1
 CFLAGS="-fcommon"
 
 post_install() {

From 22b3a599845d51009ee8fdea58cc2e916a29b5c9 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: Fri, 26 Mar 2021 09:09:37 +0700
Subject: [PATCH 25/32] libcotp: fix build flags

---
 srcpkgs/libcotp/patches/fix-cflags.patch | 14 ++++++++++++++
 srcpkgs/libcotp/template                 |  1 +
 2 files changed, 15 insertions(+)
 create mode 100644 srcpkgs/libcotp/patches/fix-cflags.patch

diff --git a/srcpkgs/libcotp/patches/fix-cflags.patch b/srcpkgs/libcotp/patches/fix-cflags.patch
new file mode 100644
index 000000000000..397b3960e9f4
--- /dev/null
+++ b/srcpkgs/libcotp/patches/fix-cflags.patch
@@ -0,0 +1,14 @@
+Index: libcotp-1.2.2/CMakeLists.txt
+===================================================================
+--- libcotp-1.2.2.orig/CMakeLists.txt
++++ libcotp-1.2.2/CMakeLists.txt
+@@ -25,8 +25,7 @@ set(CMAKE_C_STANDARD 11)
+ set(COTP_HEADERS src/cotp.h)
+ set(SOURCE_FILES src/otp.c)
+ 
+-set(CMAKE_C_FLAGS "-Wall -Wextra -O3 -Wno-format-truncation -fstack-protector-strong -fPIC")
+-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3")
++set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wno-format-truncation -fstack-protector-strong -fPIC")
+ 
+ add_library(cotp SHARED ${SOURCE_FILES})
+ 
diff --git a/srcpkgs/libcotp/template b/srcpkgs/libcotp/template
index 9e147ff7deb6..88337290d1e8 100644
--- a/srcpkgs/libcotp/template
+++ b/srcpkgs/libcotp/template
@@ -11,6 +11,7 @@ license="Apache-2.0"
 homepage="https://github.com/paolostivanin/libcotp"
 distfiles="https://github.com/paolostivanin/libcotp/archive/v${version}.tar.gz"
 checksum=25b45ffa4aece5cc689503ebea7356a2f760c194f0c41805934495d2fe7165b1
+patch_args=-Np1
 
 libcotp-devel_package() {
 	depends="libcotp-${version}_${revision}"

From ac42bb7ea627abae3810e20e08dddba3e387dd34 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: Fri, 26 Mar 2021 21:06:07 +0700
Subject: [PATCH 26/32] loudgain: hardening

---
 srcpkgs/loudgain/patches/fix-cflags.patch | 20 ++++++++++++++++++++
 srcpkgs/loudgain/template                 |  3 ++-
 2 files changed, 22 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/loudgain/patches/fix-cflags.patch

diff --git a/srcpkgs/loudgain/patches/fix-cflags.patch b/srcpkgs/loudgain/patches/fix-cflags.patch
new file mode 100644
index 000000000000..25b2c969bef4
--- /dev/null
+++ b/srcpkgs/loudgain/patches/fix-cflags.patch
@@ -0,0 +1,20 @@
+Index: loudgain-0.6.8/CMakeLists.txt
+===================================================================
+--- loudgain-0.6.8.orig/CMakeLists.txt
++++ loudgain-0.6.8/CMakeLists.txt
+@@ -69,12 +69,12 @@ TARGET_LINK_LIBRARIES(loudgain
+ )
+ 
+ SET_TARGET_PROPERTIES(loudgain PROPERTIES
+-  COMPILE_FLAGS "-Wall -pedantic -g"
++  COMPILE_FLAGS "-Wall -pedantic"
+ )
+ 
+-SET(CMAKE_C_FLAGS "-std=gnu99 -D_GNU_SOURCE")
++SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99 -D_GNU_SOURCE")
+ 
+-SET(CMAKE_CXX_FLAGS "-std=gnu++11 -D_GNU_SOURCE")
++SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11 -D_GNU_SOURCE")
+ 
+ INSTALL(TARGETS loudgain DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
+ 
diff --git a/srcpkgs/loudgain/template b/srcpkgs/loudgain/template
index f29167883439..00b2d20d27d6 100644
--- a/srcpkgs/loudgain/template
+++ b/srcpkgs/loudgain/template
@@ -1,7 +1,7 @@
 # Template file for 'loudgain'
 pkgname=loudgain
 version=0.6.8
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="pkg-config"
 makedepends="libebur128-devel taglib-devel ffmpeg-devel"
@@ -11,6 +11,7 @@ license="BSD-2-Clause"
 homepage="https://github.com/Moonbase59/loudgain"
 distfiles="https://github.com/Moonbase59/loudgain/archive/v${version}.tar.gz"
 checksum=1137c193ad941b366e87c5d84ccc95a7aa8571affc060db0bd1cf72c489aeaee
+patch_args=-Np1
 
 post_install() {
 	vlicense COPYING

From 945f5f78560865469f251f4403f78b61a287032f 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: Fri, 26 Mar 2021 21:14:31 +0700
Subject: [PATCH 27/32] masterpassword-cli: hardening

---
 srcpkgs/masterpassword-cli/patches/fix-cflags.patch | 13 +++++++++++++
 srcpkgs/masterpassword-cli/template                 |  2 +-
 2 files changed, 14 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/masterpassword-cli/patches/fix-cflags.patch

diff --git a/srcpkgs/masterpassword-cli/patches/fix-cflags.patch b/srcpkgs/masterpassword-cli/patches/fix-cflags.patch
new file mode 100644
index 000000000000..a303f6954544
--- /dev/null
+++ b/srcpkgs/masterpassword-cli/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: platform-independent/cli-c/CMakeLists.txt
+===================================================================
+--- platform-independent/cli-c/CMakeLists.txt.orig
++++ platform-independent/cli-c/CMakeLists.txt
+@@ -15,8 +15,6 @@ option( BUILD_MPW_BENCH         "C CLI M
+ option( BUILD_MPW_TESTS         "C Master Password algorithm test suite (needs: mpw_sodium, mpw_xml)." OFF )
+ 
+ # Default build flags.
+-set( CMAKE_BUILD_TYPE           Release )
+-set( CMAKE_C_FLAGS              "-O3" )
+ 
+ # Version.
+ file( READ                      "VERSION" mpw_version )
diff --git a/srcpkgs/masterpassword-cli/template b/srcpkgs/masterpassword-cli/template
index ee2b8d41ae4b..8536228a602b 100644
--- a/srcpkgs/masterpassword-cli/template
+++ b/srcpkgs/masterpassword-cli/template
@@ -1,7 +1,7 @@
 # Template file for 'masterpassword-cli'
 pkgname=masterpassword-cli
 version=2.6
-revision=5
+revision=6
 wrksrc=MasterPassword-${version}-cli-3
 build_wrksrc=platform-independent/cli-c
 build_style=cmake

From aca59ecccb28137ba6992ec1705ec5ed79a85dac 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: Fri, 26 Mar 2021 21:20:13 +0700
Subject: [PATCH 28/32] msg2: hardening

---
 srcpkgs/msg2/patches/fix-cflags.patch | 13 +++++++++++++
 srcpkgs/msg2/template                 |  2 +-
 2 files changed, 14 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/msg2/patches/fix-cflags.patch

diff --git a/srcpkgs/msg2/patches/fix-cflags.patch b/srcpkgs/msg2/patches/fix-cflags.patch
new file mode 100644
index 000000000000..64404bf44fcb
--- /dev/null
+++ b/srcpkgs/msg2/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -3,7 +3,7 @@ project(msg2)
+ 
+ # Flags
+ set(CMAKE_CXX_STANDARD 17)
+-set(CMAKE_CXX_FLAGS "-Os -pipe -fPIC -fno-plt -fstack-protector-strong -Wall -Wshadow -pedantic -Wno-parentheses -Wfatal-errors")
++set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pipe -fPIC -fno-plt -fstack-protector-strong -Wall -Wshadow -pedantic -Wno-parentheses -Wfatal-errors")
+ 
+ # Add source files
+ add_executable(msg2 main.cpp)
diff --git a/srcpkgs/msg2/template b/srcpkgs/msg2/template
index b4f77400bf22..473b3c4ec4d2 100644
--- a/srcpkgs/msg2/template
+++ b/srcpkgs/msg2/template
@@ -1,7 +1,7 @@
 # Template file for 'msg2'
 pkgname=msg2
 version=1.2.0
-revision=1
+revision=2
 build_style=cmake
 short_desc="Output a blue arrow and a white message on the commandline"
 maintainer="Orphaned <orphan@voidlinux.org>"

From a33f9ddbff33b5b942029ac6bb883ec571dee3b0 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: Fri, 26 Mar 2021 21:22:55 +0700
Subject: [PATCH 29/32] ippusbxd: fix cflags -O2 not -o2

---
 srcpkgs/ippusbxd/patches/fix-cflags.patch | 12 ++++++++++++
 srcpkgs/ippusbxd/template                 |  2 +-
 2 files changed, 13 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/ippusbxd/patches/fix-cflags.patch

diff --git a/srcpkgs/ippusbxd/patches/fix-cflags.patch b/srcpkgs/ippusbxd/patches/fix-cflags.patch
new file mode 100644
index 000000000000..5d36903c3ffd
--- /dev/null
+++ b/srcpkgs/ippusbxd/patches/fix-cflags.patch
@@ -0,0 +1,12 @@
+Index: src/CMakeLists.txt
+===================================================================
+--- src/CMakeLists.txt.orig
++++ src/CMakeLists.txt
+@@ -1,6 +1,6 @@
+ cmake_minimum_required(VERSION 2.6)
+ project(ippusbxd)
+-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -o2 -g -std=c99 -Wall -Wextra -pedantic -pedantic-errors")
++set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -Wall -Wextra -pedantic -pedantic-errors")
+ 
+ 
+ # Compiler specific configuration
diff --git a/srcpkgs/ippusbxd/template b/srcpkgs/ippusbxd/template
index ce4ff2ea9125..e81064e8b91d 100644
--- a/srcpkgs/ippusbxd/template
+++ b/srcpkgs/ippusbxd/template
@@ -1,7 +1,7 @@
 # Template file for 'ippusbxd'
 pkgname=ippusbxd
 version=1.34
-revision=1
+revision=2
 build_wrksrc=src
 build_style=cmake
 make_cmd=make

From 2803dbd76ff0838b2287e1d76343cdcb967ca617 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: Fri, 26 Mar 2021 21:34:52 +0700
Subject: [PATCH 30/32] tlsh: respect -g

---
 srcpkgs/tlsh/patches/fix-cflags.patch | 13 +++++++++++++
 srcpkgs/tlsh/template                 |  2 +-
 2 files changed, 14 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/tlsh/patches/fix-cflags.patch

diff --git a/srcpkgs/tlsh/patches/fix-cflags.patch b/srcpkgs/tlsh/patches/fix-cflags.patch
new file mode 100644
index 000000000000..8715563715c7
--- /dev/null
+++ b/srcpkgs/tlsh/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -125,7 +125,7 @@ if (CMAKE_BUILD_TYPE STREQUAL Debug)
+     endif()
+ else(CMAKE_BUILD_TYPE STREQUAL Debug)
+     if(CMAKE_COMPILER_IS_GNUCXX)
+-        set(CMAKE_CXX_FLAGS "-O2 -fvisibility=internal")  ## Remove TlshImpl symbols
++        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=internal")  ## Remove TlshImpl symbols
+     endif()
+     if(MSVC)
+         set(CMAKE_CXX_FLAGS "/O2")        ## Optimize
diff --git a/srcpkgs/tlsh/template b/srcpkgs/tlsh/template
index 7cb5c28b48b9..dfea27526e14 100644
--- a/srcpkgs/tlsh/template
+++ b/srcpkgs/tlsh/template
@@ -1,7 +1,7 @@
 # Template file for 'tlsh'
 pkgname=tlsh
 version=3.17.0
-revision=2
+revision=3
 build_style=cmake
 hostmakedepends="python3"
 makedepends="python3-devel"

From fc4f5d8f9f209542679424d6b6ccdcaac549ddde 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: Fri, 26 Mar 2021 21:59:06 +0700
Subject: [PATCH 31/32] poppler: hardening + respect -g

---
 srcpkgs/poppler/patches/fix-cflags.patch | 21 +++++++++++++++++++++
 srcpkgs/poppler/template                 |  2 +-
 2 files changed, 22 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/poppler/patches/fix-cflags.patch

diff --git a/srcpkgs/poppler/patches/fix-cflags.patch b/srcpkgs/poppler/patches/fix-cflags.patch
new file mode 100644
index 000000000000..9e62b11010ba
--- /dev/null
+++ b/srcpkgs/poppler/patches/fix-cflags.patch
@@ -0,0 +1,21 @@
+Index: cmake/modules/PopplerMacros.cmake
+===================================================================
+--- cmake/modules/PopplerMacros.cmake.orig
++++ cmake/modules/PopplerMacros.cmake
+@@ -123,14 +123,14 @@ if(CMAKE_COMPILER_IS_GNUCXX)
+   set(DEFAULT_COMPILE_WARNINGS_EXTRA "${_warn} ${_warnx}")
+ 
+   set(_save_cxxflags "${CMAKE_CXX_FLAGS}")
+-  set(CMAKE_CXX_FLAGS                "-fno-exceptions -fno-check-new -fno-common -D_DEFAULT_SOURCE")
++  set(CMAKE_CXX_FLAGS                "-fno-exceptions -fno-check-new -fno-common -D_DEFAULT_SOURCE ${_save_cxxflags}")
+   set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g ${_save_cxxflags}")
+   set(CMAKE_CXX_FLAGS_RELEASE        "-O2 -DNDEBUG ${_save_cxxflags}")
+   set(CMAKE_CXX_FLAGS_DEBUG          "-g -O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline ${_save_cxxflags}")
+   set(CMAKE_CXX_FLAGS_DEBUGFULL      "-g3 -fno-inline ${_save_cxxflags}")
+   set(CMAKE_CXX_FLAGS_PROFILE        "-g3 -fno-inline -ftest-coverage -fprofile-arcs ${_save_cxxflags}")
+   set(_save_cflags "${CMAKE_C_FLAGS}")
+-  set(CMAKE_C_FLAGS                  "-std=c99 -D_DEFAULT_SOURCE")
++  set(CMAKE_C_FLAGS                  "-std=c99 -D_DEFAULT_SOURCE ${_save_cflags}")
+   set(CMAKE_C_FLAGS_RELWITHDEBINFO   "-O2 -g ${_save_cflags}")
+   set(CMAKE_C_FLAGS_RELEASE          "-O2 -DNDEBUG ${_save_cflags}")
+   set(CMAKE_C_FLAGS_DEBUG            "-g -O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline ${_save_cflags}")
diff --git a/srcpkgs/poppler/template b/srcpkgs/poppler/template
index ed0db8de7ab6..1aebd7f7e177 100644
--- a/srcpkgs/poppler/template
+++ b/srcpkgs/poppler/template
@@ -4,7 +4,7 @@
 #
 pkgname=poppler
 version=20.09.0
-revision=2
+revision=3
 build_style=cmake
 build_helper="gir"
 configure_args="-DENABLE_UNSTABLE_API_ABI_HEADERS=ON -DENABLE_CPP=ON

From b03e1da70d9867657d421a45760437890a7f69c9 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: Fri, 26 Mar 2021 21:59:29 +0700
Subject: [PATCH 32/32] poppler-qt5: hardening + respect -g

---
 srcpkgs/poppler-qt5/patches  | 1 +
 srcpkgs/poppler-qt5/template | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)
 create mode 120000 srcpkgs/poppler-qt5/patches

diff --git a/srcpkgs/poppler-qt5/patches b/srcpkgs/poppler-qt5/patches
new file mode 120000
index 000000000000..636e4ac2cbd9
--- /dev/null
+++ b/srcpkgs/poppler-qt5/patches
@@ -0,0 +1 @@
+../poppler/patches
\ No newline at end of file
diff --git a/srcpkgs/poppler-qt5/template b/srcpkgs/poppler-qt5/template
index 0dc45c05c58b..c2ec35dbbad3 100644
--- a/srcpkgs/poppler-qt5/template
+++ b/srcpkgs/poppler-qt5/template
@@ -5,7 +5,7 @@
 #
 pkgname=poppler-qt5
 version=20.09.0
-revision=1
+revision=2
 wrksrc="poppler-${version}"
 build_style=cmake
 configure_args="-DENABLE_UNSTABLE_API_ABI_HEADERS=ON -DENABLE_GLIB=OFF

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PR PATCH] [Updated] build-style/cmake: set CMAKE_BUILD_TYPE to None
  2021-03-14 13:19 [PR PATCH] [WIP] build-style/cmake: set CMAKE_BUILD_TYPE to None sgn
                   ` (18 preceding siblings ...)
  2021-03-26 16:01 ` [PR PATCH] [Updated] " sgn
@ 2021-03-27  8:23 ` sgn
  2021-03-27  8:24 ` sgn
                   ` (12 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: sgn @ 2021-03-27  8:23 UTC (permalink / raw)
  To: ml

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

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

https://github.com/sgn/void-packages cmake-build-type-to-None
https://github.com/void-linux/void-packages/pull/29459

build-style/cmake: set CMAKE_BUILD_TYPE to None
- I'm going to build all packages with `build_style=cmake` and fix them one by one before merging this in.

[ci skip]

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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-cmake-build-type-to-None-29459.patch --]
[-- Type: text/x-diff, Size: 100746 bytes --]

From 55db3b4b32ca39f77aae5cc1d839ba275616d05a 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, 14 Mar 2021 20:18:03 +0700
Subject: [PATCH 01/53] build-style/cmake: set CMAKE_BUILD_TYPE to None

---
 common/build-style/cmake.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/build-style/cmake.sh b/common/build-style/cmake.sh
index 5100a96dfd7b..9d1a1a7a1941 100644
--- a/common/build-style/cmake.sh
+++ b/common/build-style/cmake.sh
@@ -52,7 +52,7 @@ _EOF
 		cmake_args+=" -DCMAKE_TOOLCHAIN_FILE=cross_${XBPS_CROSS_TRIPLET}.cmake"
 	fi
 	cmake_args+=" -DCMAKE_INSTALL_PREFIX=/usr"
-	cmake_args+=" -DCMAKE_BUILD_TYPE=Release"
+	cmake_args+=" -DCMAKE_BUILD_TYPE=None"
 	cmake_args+=" -DCMAKE_INSTALL_LIBDIR=lib${XBPS_TARGET_WORDSIZE}"
 
 	if [[ $build_helper = *"qemu"* ]]; then

From 69b4670a7e9a0711508e4c9b86ec00add865621b 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: Mon, 15 Mar 2021 08:07:16 +0700
Subject: [PATCH 02/53] amdvlk: allow CMAKE_BUILD_TYPE=None

---
 .../patches/cmake-build-type-none.patch       | 60 +++++++++++++++++++
 1 file changed, 60 insertions(+)
 create mode 100644 srcpkgs/amdvlk/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/amdvlk/patches/cmake-build-type-none.patch b/srcpkgs/amdvlk/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..7a629e58548e
--- /dev/null
+++ b/srcpkgs/amdvlk/patches/cmake-build-type-none.patch
@@ -0,0 +1,60 @@
+Index: llvm-project/llvm/CMakeLists.txt
+===================================================================
+--- llvm-project/llvm/CMakeLists.txt.orig
++++ llvm-project/llvm/CMakeLists.txt
+@@ -251,11 +251,6 @@ endif()
+ 
+ string(TOUPPER "${CMAKE_BUILD_TYPE}" uppercase_CMAKE_BUILD_TYPE)
+ 
+-if (CMAKE_BUILD_TYPE AND
+-    NOT uppercase_CMAKE_BUILD_TYPE MATCHES "^(DEBUG|RELEASE|RELWITHDEBINFO|MINSIZEREL)$")
+-  message(FATAL_ERROR "Invalid value for CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
+-endif()
+-
+ set(LLVM_LIBDIR_SUFFIX "" CACHE STRING "Define suffix of library directory name (32/64)" )
+ 
+ set(LLVM_TOOLS_INSTALL_DIR "bin" CACHE STRING "Path for binary subdirectory (defaults to 'bin')")
+Index: pal/cmake/Modules/AmdCmakeHelper.cmake
+===================================================================
+--- pal/cmake/Modules/AmdCmakeHelper.cmake.orig
++++ pal/cmake/Modules/AmdCmakeHelper.cmake
+@@ -37,11 +37,6 @@ if (CMAKE_CONFIGURATION_TYPES)
+ else()
+     string(TOUPPER "${CMAKE_BUILD_TYPE}" capital_CMAKE_BUILD_TYPE)
+ 
+-    if (CMAKE_BUILD_TYPE AND
+-        NOT capital_CMAKE_BUILD_TYPE MATCHES "^(DEBUG|RELEASE|RELWITHDEBINFO|MINSIZEREL)$")
+-        message(FATAL_ERROR "Invalid value for CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
+-    endif()
+-
+     if(capital_CMAKE_BUILD_TYPE STREQUAL "DEBUG")
+         set(CMAKE_BUILD_TYPE_DEBUG ON)
+         set(CMAKE_BUILD_TYPE_RELEASE OFF)
+Index: xgl/CMakeLists.txt
+===================================================================
+--- xgl/CMakeLists.txt.orig
++++ xgl/CMakeLists.txt
+@@ -181,11 +181,6 @@ if (CMAKE_CONFIGURATION_TYPES)
+ else()
+     string(TOUPPER "${CMAKE_BUILD_TYPE}" capital_CMAKE_BUILD_TYPE)
+ 
+-    if (CMAKE_BUILD_TYPE AND
+-        NOT capital_CMAKE_BUILD_TYPE MATCHES "^(DEBUG|RELEASE|RELWITHDEBINFO|MINSIZEREL)$")
+-        message(FATAL_ERROR "Invalid value for CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
+-    endif()
+-
+     if(capital_CMAKE_BUILD_TYPE STREQUAL "DEBUG")
+         set(CMAKE_BUILD_TYPE_DEBUG ON)
+         set(CMAKE_BUILD_TYPE_RELEASE OFF)
+Index: xgl/icd/CMakeLists.txt
+===================================================================
+--- xgl/icd/CMakeLists.txt.orig
++++ xgl/icd/CMakeLists.txt
+@@ -84,7 +84,6 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Cl
+     endif()
+ 
+     if(CMAKE_BUILD_TYPE_RELEASE)
+-        target_compile_options(xgl PRIVATE -O3)
+         if(XGL_ENABLE_LTO)
+             if(${CMAKE_CXX_COMPILER_ID} MATCHES "GNU")
+                 execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION)

From 8b11bab2f08c4249907f06feb14f43d234eb3e13 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: Wed, 17 Mar 2021 06:24:04 +0700
Subject: [PATCH 03/53] eigen*: set CMAKE_BUILD_TYPE to Release

We're going to set default CMAKE_BUILD_TYPE to None soon. Those packages
are header only libraries, no need to waste time on patching.
---
 srcpkgs/eigen/template    | 1 +
 srcpkgs/eigen3.2/template | 1 +
 2 files changed, 2 insertions(+)

diff --git a/srcpkgs/eigen/template b/srcpkgs/eigen/template
index ee825e95f273..072228c16915 100644
--- a/srcpkgs/eigen/template
+++ b/srcpkgs/eigen/template
@@ -3,6 +3,7 @@ pkgname=eigen
 version=3.3.9
 revision=1
 build_style=cmake
+configure_args="-DCMAKE_BUILD_TYPE=Release"
 short_desc="C++ template library for linear algebra (version 3.x)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MPL-2.0, GPL-3.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
diff --git a/srcpkgs/eigen3.2/template b/srcpkgs/eigen3.2/template
index 5715fc1b3a19..7b710534b5e5 100644
--- a/srcpkgs/eigen3.2/template
+++ b/srcpkgs/eigen3.2/template
@@ -4,6 +4,7 @@ version=3.2.10
 revision=3
 wrksrc="eigen-${version}"
 build_style=cmake
+configure_args="-DCMAKE_BUILD_TYPE=Release"
 short_desc="C++ template library for linear algebra (version 3.x)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MPL-2.0, GPL-3.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"

From b8efabf7c89056d3e1f16955efb152b725c8c725 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: Wed, 17 Mar 2021 07:04:48 +0700
Subject: [PATCH 04/53] embree: don't ignore CXXFLAGS, fix build with ispc
 1.13+

---
 .../embree/patches/uintNN-is-part-of-ispc-1.13.patch | 12 ++++++++++++
 srcpkgs/embree/template                              |  6 ++----
 2 files changed, 14 insertions(+), 4 deletions(-)
 create mode 100644 srcpkgs/embree/patches/uintNN-is-part-of-ispc-1.13.patch

diff --git a/srcpkgs/embree/patches/uintNN-is-part-of-ispc-1.13.patch b/srcpkgs/embree/patches/uintNN-is-part-of-ispc-1.13.patch
new file mode 100644
index 000000000000..5d0b02f3b2e5
--- /dev/null
+++ b/srcpkgs/embree/patches/uintNN-is-part-of-ispc-1.13.patch
@@ -0,0 +1,12 @@
+Index: embree-2.17.7/tutorials/common/common.isph
+===================================================================
+--- embree-2.17.7.orig/tutorials/common/common.isph
++++ embree-2.17.7/tutorials/common/common.isph
+@@ -16,7 +16,3 @@
+ 
+ #pragma once
+ 
+-typedef unsigned int64 uint64;
+-typedef unsigned int32 uint32;
+-typedef unsigned int16 uint16;
+-typedef unsigned int8  uint8;
diff --git a/srcpkgs/embree/template b/srcpkgs/embree/template
index 0bc72f46b6d8..849ec3c26c1d 100644
--- a/srcpkgs/embree/template
+++ b/srcpkgs/embree/template
@@ -4,6 +4,7 @@ version=2.17.7
 revision=2
 archs="x86_64"
 build_style=cmake
+configure_args="-DTBB_ROOT=/usr -DEMBREE_IGNORE_CMAKE_CXX_FLAGS=OFF"
 hostmakedepends="ispc"
 makedepends="libfreeglut-devel libXmu-devel tbb-devel MesaLib-devel libpng-devel
  libopenexr-devel libjpeg-turbo-devel libmagick-devel"
@@ -13,10 +14,7 @@ license="Apache-2.0"
 homepage="https://embree.github.io/"
 distfiles="https://github.com/$pkgname/$pkgname/archive/v$version.tar.gz"
 checksum=c0694f287fa1fbb382aba3a895702e248d92f7e89c0e5f64aefee965482ec04c
-
-nopie=y
-
-configure_args="-DTBB_ROOT=/usr -DENABLE_TUTORIALS=OFF"
+patch_args=-Np1
 
 embree-devel_package() {
 	depends="${sourcepkg}>=${version}_${revision}"

From d6ffe21ebc7b3e3f5652d81cc974630449381baf 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: Wed, 17 Mar 2021 07:35:19 +0700
Subject: [PATCH 05/53] ettercap: remove libressl patch, CMAKE_BUILD_TYPE=None

---
 .../patches/allow-build-type-none.patch       | 24 ++++++++++++++
 srcpkgs/ettercap/patches/libressl.patch       | 31 -------------------
 srcpkgs/ettercap/template                     |  9 ++++--
 3 files changed, 31 insertions(+), 33 deletions(-)
 create mode 100644 srcpkgs/ettercap/patches/allow-build-type-none.patch
 delete mode 100644 srcpkgs/ettercap/patches/libressl.patch

diff --git a/srcpkgs/ettercap/patches/allow-build-type-none.patch b/srcpkgs/ettercap/patches/allow-build-type-none.patch
new file mode 100644
index 000000000000..324d75086b05
--- /dev/null
+++ b/srcpkgs/ettercap/patches/allow-build-type-none.patch
@@ -0,0 +1,24 @@
+Index: ettercap-0.8.3.1/CMakeLists.txt
+===================================================================
+--- ettercap-0.8.3.1.orig/CMakeLists.txt
++++ ettercap-0.8.3.1/CMakeLists.txt
+@@ -22,19 +22,6 @@ option(LIBRARY_BUILD "Build for libetter
+ option(INSTALL_DESKTOP "Install ettercap desktop files" ON)
+ 
+ 
+-set(VALID_BUILD_TYPES Debug Release RelWithDebInfo)
+-
+-if(NOT CMAKE_BUILD_TYPE)
+-  # Default to using "Release" as our build type.
+-  set(CMAKE_BUILD_TYPE "Release" CACHE STRING
+-    "Choose the type of build, options are: ${VALID_BUILD_TYPES}." FORCE)
+-endif()
+-list(FIND VALID_BUILD_TYPES ${CMAKE_BUILD_TYPE} contains_valid)
+-if(contains_valid EQUAL -1)
+-  message(FATAL_ERROR "Unknown CMAKE_BUILD_TYPE: '${CMAKE_BUILD_TYPE}'. Valid options are: ${VALID_BUILD_TYPES}")
+-endif()
+-unset(contains_valid)
+-
+ include(CMakeDependentOption)
+ 
+ # If SYSTEM_LIBS is set to off, then all SYSTEM_* options will be
diff --git a/srcpkgs/ettercap/patches/libressl.patch b/srcpkgs/ettercap/patches/libressl.patch
deleted file mode 100644
index 15e0d3c1c9e7..000000000000
--- a/srcpkgs/ettercap/patches/libressl.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From b2f7634c9dbc0ef68640f0571787d92300e9f9f9 Mon Sep 17 00:00:00 2001
-From: Stefan Strogin <stefan@steils.org>
-Date: Sat, 15 Aug 2020 07:18:31 +0300
-Subject: [PATCH] ec_sslwrap: fix compilation with LibreSSL
-
-Disable taking over SNI extension from ClientHello and SSL configuration
-operations until LibreSSL supports the required API.
-
-Fixes: https://github.com/Ettercap/ettercap/issues/1068
----
- src/ec_sslwrap.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git src/ec_sslwrap.c src/ec_sslwrap.c
-index b9f26a142..1e4c24fc1 100644
---- src/ec_sslwrap.c
-+++ src/ec_sslwrap.c
-@@ -71,11 +71,11 @@
- #define TLS_server_method SSLv23_server_method
- #endif
- 
--#if (OPENSSL_VERSION_NUMBER >= 0x10100000L)
-+#if (OPENSSL_VERSION_NUMBER >= 0x10100000L) && !defined(LIBRESSL_VERSION_NUMBER)
- #define HAVE_OPENSSL_1_1_0
- #endif
- 
--#if (OPENSSL_VERSION_NUMBER >= 0x10101000L)
-+#if (OPENSSL_VERSION_NUMBER >= 0x10101000L) && !defined(LIBRESSL_VERSION_NUMBER)
- #define HAVE_OPENSSL_1_1_1
- #endif
- 
diff --git a/srcpkgs/ettercap/template b/srcpkgs/ettercap/template
index 7fe4c340a079..611b4e9aded7 100644
--- a/srcpkgs/ettercap/template
+++ b/srcpkgs/ettercap/template
@@ -3,8 +3,8 @@ pkgname=ettercap
 version=0.8.3.1
 revision=2
 build_style=cmake
-configure_args="-DENABLE_GTK=OFF"
-hostmakedepends="flex"
+configure_args="-DENABLE_GTK=OFF -DBUNDLED_LIBS=OFF"
+hostmakedepends="flex pkg-config"
 makedepends="geoip-devel ncurses-devel openssl-devel libcurl-devel
  libltdl-devel libnet-devel libpcap-devel pcre-devel"
 conf_files="/etc/${pkgname}/etter.conf"
@@ -15,5 +15,10 @@ homepage="http://ettercap.github.com/ettercap/"
 distfiles="https://github.com/Ettercap/ettercap/archive/v${version}.tar.gz"
 checksum=d0c3ef88dfc284b61d3d5b64d946c1160fd04276b448519c1ae4438a9cdffaf3
 lib32disabled=yes
+patch_args=-Np1
 
 CFLAGS="-fcommon"
+
+post_extract() {
+	rm -rf bundled_deps
+}

From e21005d53cfdb11658e9f4109934769a5612c9ef 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: Wed, 17 Mar 2021 08:27:10 +0700
Subject: [PATCH 06/53] injeqt: disable coverage

---
 srcpkgs/injeqt/template | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/injeqt/template b/srcpkgs/injeqt/template
index 1e5777fc0f18..78eba09a0249 100644
--- a/srcpkgs/injeqt/template
+++ b/srcpkgs/injeqt/template
@@ -3,7 +3,8 @@ pkgname=injeqt
 version=1.2.0
 revision=2
 build_style=cmake
-hostmakedepends="pkg-config"
+configure_args="-DDISABLE_COVERAGE=ON"
+hostmakedepends="pkg-config qt5-qmake qt5-host-tools"
 makedepends="qt5-devel"
 short_desc="Dependency injection framework for Qt"
 maintainer="Jürgen Buchmüller <pullmoll@t-online.de>"
@@ -12,9 +13,6 @@ homepage="https://github.com/vogel/injeqt/"
 distfiles="https://github.com/vogel/${pkgname}/archive/${version}.tar.gz>${pkgname}-${version}.tar.gz"
 checksum=77540cedb0b26affe993dd18124d796059e34c80a51d9ae6433fdff1860db135
 
-if [ -n "$CROSS_BUILD" ]; then
-	hostmakedepends+=" qt5-host-tools qt5-devel"
-fi
 CXXFLAGS="-fno-lifetime-dse -Wno-error=cast-align"
 
 injeqt-devel_package() {

From 7500ce845b31acf5d0d005a07f8c7cf9e4c0f6a0 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: Wed, 17 Mar 2021 22:26:37 +0700
Subject: [PATCH 07/53] kindd: build with CMAKE_BUILD_TYPE=None

---
 srcpkgs/kindd/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/kindd/template b/srcpkgs/kindd/template
index e634b0f69bf6..4416041de58c 100644
--- a/srcpkgs/kindd/template
+++ b/srcpkgs/kindd/template
@@ -15,7 +15,7 @@ distfiles="${homepage}/archive/${version}.tar.gz"
 checksum=e596f1b1577ff3e83a779e6181252ae2f09731f513d17dd6b95cbc2cf204654f
 
 do_install() {
-	vbin release/kindd
+	vbin build/core/kindd
 	vinstall assets/appconf/kindd.svg 644 usr/share/pixmaps
 	vinstall assets/appconf/kindd.desktop 644 usr/share/applications
 }

From d6666ee1e6987563f13a1b7b918f0fab75a21f4a 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: Thu, 18 Mar 2021 23:58:53 +0700
Subject: [PATCH 08/53] occt: allow CMAKE_BUILD_TYPE=None

---
 srcpkgs/occt/patches/cmake-build-type-none.patch | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 srcpkgs/occt/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/occt/patches/cmake-build-type-none.patch b/srcpkgs/occt/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..acb06fb55766
--- /dev/null
+++ b/srcpkgs/occt/patches/cmake-build-type-none.patch
@@ -0,0 +1,13 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -4,7 +4,7 @@ set (CMAKE_MODULE_PATH "${CMAKE_SOURCE_D
+ 
+ set (CMAKE_SUPPRESS_REGENERATION TRUE)
+ 
+-set (CMAKE_CONFIGURATION_TYPES Release Debug RelWithDebInfo CACHE INTERNAL "" FORCE)
++set (CMAKE_CONFIGURATION_TYPES None Release Debug RelWithDebInfo CACHE INTERNAL "" FORCE)
+ 
+ # macro: include patched file if it exists
+ macro (OCCT_INCLUDE_CMAKE_FILE BEING_INCLUDED_FILE)

From 57901f747262b182fe0dbed11788b788d63fb699 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: Fri, 19 Mar 2021 23:07:05 +0700
Subject: [PATCH 09/53] renderdoc: devendor zstd, lz4

---
 .../patches/build-type-none-is-release.patch  | 12 ++++
 .../renderdoc/patches/qmake-no-rpath.patch    | 13 ++++
 .../renderdoc/patches/unvendor-zstd-lz4.patch | 68 +++++++++++++++++++
 srcpkgs/renderdoc/template                    | 15 ++--
 4 files changed, 99 insertions(+), 9 deletions(-)
 create mode 100644 srcpkgs/renderdoc/patches/build-type-none-is-release.patch
 create mode 100644 srcpkgs/renderdoc/patches/qmake-no-rpath.patch
 create mode 100644 srcpkgs/renderdoc/patches/unvendor-zstd-lz4.patch

diff --git a/srcpkgs/renderdoc/patches/build-type-none-is-release.patch b/srcpkgs/renderdoc/patches/build-type-none-is-release.patch
new file mode 100644
index 000000000000..f16b944bc12c
--- /dev/null
+++ b/srcpkgs/renderdoc/patches/build-type-none-is-release.patch
@@ -0,0 +1,12 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -315,6 +315,7 @@ set(RELEASE_MODE 0)
+ 
+ if(cmake_build_type_lower STREQUAL "release" OR
+    cmake_build_type_lower STREQUAL "relwithdebinfo" OR
++   cmake_build_type_lower STREQUAL "none" OR
+    cmake_build_type_lower STREQUAL "minsizerel")
+     add_definitions(-D_RELEASE)
+     message(STATUS "Building RenderDoc in Release mode: ${CMAKE_BUILD_TYPE}")
diff --git a/srcpkgs/renderdoc/patches/qmake-no-rpath.patch b/srcpkgs/renderdoc/patches/qmake-no-rpath.patch
new file mode 100644
index 000000000000..6e6325c53555
--- /dev/null
+++ b/srcpkgs/renderdoc/patches/qmake-no-rpath.patch
@@ -0,0 +1,13 @@
+Index: qrenderdoc/CMakeLists.txt
+===================================================================
+--- qrenderdoc/CMakeLists.txt.orig
++++ qrenderdoc/CMakeLists.txt
+@@ -144,7 +144,7 @@ endif()
+ # and finding dependencies from the cmake build
+ file(WRITE
+      ${CMAKE_BINARY_DIR}/qrenderdoc/qrenderdoc_cmake.pri
+-     "CONFIG+=${QMAKE_CONFIG}\n"
++     "CONFIG+=${QMAKE_CONFIG} no_qt_rpath\n"
+      "\n"
+      "QMAKE_CC=${CMAKE_C_COMPILER}\n"
+      "QMAKE_CXX=${CMAKE_CXX_COMPILER}\n"
diff --git a/srcpkgs/renderdoc/patches/unvendor-zstd-lz4.patch b/srcpkgs/renderdoc/patches/unvendor-zstd-lz4.patch
new file mode 100644
index 000000000000..d4003ded9161
--- /dev/null
+++ b/srcpkgs/renderdoc/patches/unvendor-zstd-lz4.patch
@@ -0,0 +1,68 @@
+Index: renderdoc/CMakeLists.txt
+===================================================================
+--- renderdoc/CMakeLists.txt.orig
++++ renderdoc/CMakeLists.txt
+@@ -213,54 +213,10 @@ set(sources
+     3rdparty/pugixml/pugixml.cpp
+     3rdparty/pugixml/pugixml.hpp
+     3rdparty/pugixml/pugiconfig.hpp
+-    3rdparty/lz4/lz4.c
+-    3rdparty/lz4/lz4.h
+     3rdparty/miniz/miniz.c
+     3rdparty/miniz/miniz.h
+     3rdparty/superluminal/superluminal.cpp
+     3rdparty/superluminal/superluminal.h
+-    3rdparty/zstd/bitstream.h
+-    3rdparty/zstd/compiler.h
+-    3rdparty/zstd/cpu.h
+-    3rdparty/zstd/debug.c
+-    3rdparty/zstd/debug.h
+-    3rdparty/zstd/entropy_common.c
+-    3rdparty/zstd/error_private.c
+-    3rdparty/zstd/error_private.h
+-    3rdparty/zstd/fse.h
+-    3rdparty/zstd/fse_compress.c
+-    3rdparty/zstd/fse_decompress.c
+-    3rdparty/zstd/hist.c
+-    3rdparty/zstd/hist.h
+-    3rdparty/zstd/huf.h
+-    3rdparty/zstd/huf_compress.c
+-    3rdparty/zstd/huf_decompress.c
+-    3rdparty/zstd/mem.h
+-    3rdparty/zstd/pool.c
+-    3rdparty/zstd/pool.h
+-    3rdparty/zstd/threading.c
+-    3rdparty/zstd/threading.h
+-    3rdparty/zstd/xxhash.c
+-    3rdparty/zstd/xxhash.h
+-    3rdparty/zstd/zstd.h
+-    3rdparty/zstd/zstd_common.c
+-    3rdparty/zstd/zstd_compress.c
+-    3rdparty/zstd/zstd_compress_internal.h
+-    3rdparty/zstd/zstd_decompress.c
+-    3rdparty/zstd/zstd_double_fast.c
+-    3rdparty/zstd/zstd_double_fast.h
+-    3rdparty/zstd/zstd_errors.h
+-    3rdparty/zstd/zstd_fast.c
+-    3rdparty/zstd/zstd_fast.h
+-    3rdparty/zstd/zstd_internal.h
+-    3rdparty/zstd/zstd_lazy.c
+-    3rdparty/zstd/zstd_lazy.h
+-    3rdparty/zstd/zstd_ldm.c
+-    3rdparty/zstd/zstd_ldm.h
+-    3rdparty/zstd/zstd_opt.c
+-    3rdparty/zstd/zstd_opt.h
+-    3rdparty/zstd/zstdmt_compress.c
+-    3rdparty/zstd/zstdmt_compress.h
+     3rdparty/stb/stb_image.h
+     3rdparty/stb/stb_image_write.h
+     3rdparty/stb/stb_image_resize.h
+@@ -271,6 +227,8 @@ set(sources
+     3rdparty/tinyfiledialogs/tinyfiledialogs.c
+     3rdparty/tinyfiledialogs/tinyfiledialogs.h)
+ 
++list(APPEND RDOC_LIBRARIES -llz4 -lzstd)
++
+ if(ANDROID)
+     list(APPEND sources
+         data/embedded_files.h
diff --git a/srcpkgs/renderdoc/template b/srcpkgs/renderdoc/template
index 7240e9ebc307..4615d45c52c9 100644
--- a/srcpkgs/renderdoc/template
+++ b/srcpkgs/renderdoc/template
@@ -1,13 +1,14 @@
 # Template file for 'renderdoc'
 pkgname=renderdoc
 version=1.12
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DENABLE_GL=ON -DENABLE_GLES=ON -DENABLE_QRENDERDOC=ON
  -DENABLE_RENDERDOCCMD=ON -DENABLE_VULKAN=ON -DENABLE_XCB=ON -DENABLE_XLIB=ON
  -DENABLE_PYRENDERDOC=ON"
-hostmakedepends="bison autoconf automake pkg-config python3"
+hostmakedepends="bison autoconf automake pkg-config python3 swig"
 makedepends="libX11-devel libxcb-devel xcb-util-keysyms-devel qt5-devel
+ libzstd-devel liblz4-devel
  qt5-svg-devel qt5-x11extras-devel pcre-devel python3-devel"
 short_desc="Stand-alone graphics debugging tool for Vulkan and OpenGL"
 maintainer="Urs Schulz <voidpkgs@ursschulz.de>"
@@ -19,19 +20,14 @@ checksum=4dece1b4cb859a76533b28fcd50e17321acfaa81c3435500a006c4a5ba15fddb
 if [ "$XBPS_TARGET_LIBC" = musl ]; then
 	makedepends+=" libexecinfo-devel"
 	LDLIBS="-lexecinfo"
+	broken="uses RTLD_DL_LINKMAP, RTLD_DEEPBIND, _r_debug"
 fi
 
 if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
 	makedepends+=" libatomic-devel"
 fi
 
-case "$XBPS_TARGET_MACHINE" in
-	*-musl) broken="uses RTLD_DL_LINKMAP, RTLD_DEEPBIND, _r_debug" ;;
-esac
-
-if [ "$CROSS_BUILD" ]; then
-	broken="Cross-compilation can't find python3 interpreter"
-fi
+nocross="Cross-compilation can't find python3 interpreter"
 
 post_patch() {
 	[ -z "$XBPS_TARGET_NO_ATOMIC8" ] && return 0
@@ -40,4 +36,5 @@ post_patch() {
 
 post_install() {
 	vlicense LICENSE.md
+	vlicense docs/credits_acknowledgements.rst
 }

From 70b3adf4d48c8a8897ae88a92f6be0dd58235a2d 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: Sat, 20 Mar 2021 00:47:52 +0700
Subject: [PATCH 10/53] python3-occ: build with CMAKE_BUILD_TYPE=None

---
 srcpkgs/python3-occ/template | 1 +
 1 file changed, 1 insertion(+)

diff --git a/srcpkgs/python3-occ/template b/srcpkgs/python3-occ/template
index 705f37457943..3ea0ef5e6387 100644
--- a/srcpkgs/python3-occ/template
+++ b/srcpkgs/python3-occ/template
@@ -5,6 +5,7 @@ revision=1
 archs="i686* x86_64* armv7l* aarch64* ppc*"
 wrksrc="pythonocc-core-${version}"
 build_style=cmake
+configure_args="-DPYTHONOCC_BUILD_TYPE=None -DCMAKE_BUILD_TYPE=None"
 hostmakedepends="python3 swig"
 makedepends="python3-devel occt-devel freetype-devel swig"
 depends="python3 occt freetype"

From 31c72be771839b04988425633e262b0ea0924ccb 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: Fri, 19 Mar 2021 23:38:10 +0700
Subject: [PATCH 11/53] widelands: allow CMAKE_BUILD_TYPE=None

---
 srcpkgs/widelands-data                        |  1 -
 .../patches/cmake-build-type-none.patch       | 63 +++++++++++++++++++
 .../widelands/patches/fix-install-path.patch  | 40 ++++++++++++
 srcpkgs/widelands/template                    | 21 +------
 4 files changed, 105 insertions(+), 20 deletions(-)
 delete mode 120000 srcpkgs/widelands-data
 create mode 100644 srcpkgs/widelands/patches/cmake-build-type-none.patch
 create mode 100644 srcpkgs/widelands/patches/fix-install-path.patch

diff --git a/srcpkgs/widelands-data b/srcpkgs/widelands-data
deleted file mode 120000
index e9fbf89517f2..000000000000
--- a/srcpkgs/widelands-data
+++ /dev/null
@@ -1 +0,0 @@
-widelands
\ No newline at end of file
diff --git a/srcpkgs/widelands/patches/cmake-build-type-none.patch b/srcpkgs/widelands/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..3d210854741b
--- /dev/null
+++ b/srcpkgs/widelands/patches/cmake-build-type-none.patch
@@ -0,0 +1,63 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -202,7 +202,7 @@ elseif(CMAKE_BUILD_TYPE STREQUAL "RelWit
+   set(WL_DEBUG_FLAGS "-DNDEBUG -DNOPARACHUTE")
+   option(OPTION_ASAN "Build with AddressSanitizer" ON)
+ else()
+-  message(FATAL_ERROR "Unknown CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
++  set(WL_DEBUG_FLAGS "-DNDEBUG -DNOPARACHUTE")
+ endif()
+ 
+ wl_add_flag(WL_GENERIC_CXX_FLAGS "-std=c++11")
+@@ -353,7 +353,7 @@ endif (OPTION_BUILD_TESTS)
+ install (
+   FILES ${CMAKE_CURRENT_BINARY_DIR}/VERSION
+   DESTINATION ${WL_INSTALL_BASEDIR}
+-  CONFIGURATIONS Debug;Release
++  CONFIGURATIONS Debug
+   COMPONENT CoreVersionFile
+ )
+ 
+@@ -378,7 +378,6 @@ install(
+     data/txts
+     data/world
+   DESTINATION ${WL_INSTALL_DATADIR}
+-  CONFIGURATIONS Debug;Release
+   COMPONENT CoreDataFiles
+ )
+ 
+@@ -386,7 +385,6 @@ install(
+   DIRECTORY
+     data/maps
+   DESTINATION ${WL_INSTALL_DATADIR}
+-  CONFIGURATIONS Debug;Release
+   COMPONENT MapFiles
+ )
+ 
+@@ -395,7 +393,6 @@ install(
+     data/music
+     data/sound
+   DESTINATION ${WL_INSTALL_DATADIR}
+-  CONFIGURATIONS Debug;Release
+   COMPONENT MusicFiles
+ )
+ 
+@@ -405,7 +402,7 @@ install(
+     CREDITS
+     ChangeLog
+   DESTINATION ${WL_INSTALL_BASEDIR}
+-  CONFIGURATIONS Debug;Release
++  CONFIGURATIONS Debug
+   COMPONENT CoreLicenseFiles
+ )
+ 
+@@ -424,7 +421,6 @@ install(
+   DIRECTORY
+     ${CMAKE_CURRENT_BINARY_DIR}/locale/
+   DESTINATION ${WL_INSTALL_DATADIR}/locale
+-  CONFIGURATIONS Debug;Release
+   COMPONENT CoreLanguageFiles
+ )
+ 
diff --git a/srcpkgs/widelands/patches/fix-install-path.patch b/srcpkgs/widelands/patches/fix-install-path.patch
new file mode 100644
index 000000000000..6bb461389f03
--- /dev/null
+++ b/srcpkgs/widelands/patches/fix-install-path.patch
@@ -0,0 +1,40 @@
+Index: cmake/WlFunctions.cmake
+===================================================================
+--- cmake/WlFunctions.cmake.orig
++++ cmake/WlFunctions.cmake
+@@ -289,5 +289,5 @@ function(wl_binary NAME)
+ 
+   #Quoting the CMake documentation on DESTINATION:
+   #"If a relative path is given it is interpreted relative to the value of CMAKE_INSTALL_PREFIX"
+-  install(TARGETS ${NAME} DESTINATION "." COMPONENT ExecutableFiles)
++  install(TARGETS ${NAME} DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT ExecutableFiles)
+ endfunction()
+Index: xdg/CMakeLists.txt
+===================================================================
+--- xdg/CMakeLists.txt.orig
++++ xdg/CMakeLists.txt
+@@ -6,19 +6,19 @@ set(XDG_APPLICATION_ID "org.widelands.Wi
+ list(APPEND icon_sizes "16" "32" "48" "64" "128")
+ foreach (icon_size ${icon_sizes})
+   #install(FILES ${CMAKE_SOURCE_DIR}/data/images/logos/wl-ico-${icon_size}.png DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/${icon_size}x${icon_size}/apps RENAME ${XDG_APPLICATION_ID}.png)
+-  install(FILES ${CMAKE_SOURCE_DIR}/data/images/logos/wl-ico-${icon_size}.png DESTINATION ../share/icons/hicolor/${icon_size}x${icon_size}/apps RENAME ${XDG_APPLICATION_ID}.png)
++  install(FILES ${CMAKE_SOURCE_DIR}/data/images/logos/wl-ico-${icon_size}.png DESTINATION share/icons/hicolor/${icon_size}x${icon_size}/apps RENAME ${XDG_APPLICATION_ID}.png)
+ endforeach (icon_size ${icon_sizes})
+ #install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${CMAKE_PROJECT_NAME}.6           DESTINATION ${CMAKE_INSTALL_MANDIR}/man6)
+-install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${CMAKE_PROJECT_NAME}.6           DESTINATION ../share/man/man6)
++install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${CMAKE_PROJECT_NAME}.6           DESTINATION share/man/man6)
+ #install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${XDG_APPLICATION_ID}.desktop     DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications)
+-install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${XDG_APPLICATION_ID}.desktop     DESTINATION ../share/applications)
++install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${XDG_APPLICATION_ID}.desktop     DESTINATION share/applications)
+ #install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${XDG_APPLICATION_ID}.appdata.xml DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/metainfo)
+-install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${XDG_APPLICATION_ID}.appdata.xml DESTINATION ../share/metainfo)
++install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${XDG_APPLICATION_ID}.appdata.xml DESTINATION share/metainfo)
+ 
+ find_program(GTK_UPDATE_ICON_CACHE NAMES gtk-update-icon-cache)
+ if (GTK_UPDATE_ICON_CACHE)
+   #install(CODE "execute_process (COMMAND ${GTK_UPDATE_ICON_CACHE} -t -f ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor ||: )")
+-  install(CODE "execute_process (COMMAND ${GTK_UPDATE_ICON_CACHE} -t -f ${CMAKE_INSTALL_PREFIX}/../share/icons/hicolor ||: )")
++  install(CODE "execute_process (COMMAND ${GTK_UPDATE_ICON_CACHE} -t -f ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor ||: )")
+ else (GTK_UPDATE_ICON_CACHE)
+   message(WARNING "gtk-update-icon-cache not found!")
+ endif (GTK_UPDATE_ICON_CACHE)
diff --git a/srcpkgs/widelands/template b/srcpkgs/widelands/template
index 6cee85087ea7..cfa2c10993e0 100644
--- a/srcpkgs/widelands/template
+++ b/srcpkgs/widelands/template
@@ -1,7 +1,7 @@
 # Template file for 'widelands'
 pkgname=widelands
 version=21
-revision=3
+revision=4
 wrksrc="${pkgname}-build${version}"
 build_style=cmake
 configure_args="-DOPENGL_INCLUDE_DIR=${XBPS_CROSS_BASE}/usr/include
@@ -10,13 +10,13 @@ hostmakedepends="python3 pkg-config gettext"
 makedepends="boost-devel icu-devel minizip-devel gettext-devel
  glu-devel glew-devel SDL2-devel SDL2_gfx-devel SDL2_image-devel
  SDL2_net-devel SDL2_mixer-devel SDL2_ttf-devel"
-depends="${pkgname}-data-${version}_${revision}"
 short_desc="Real-time strategy game"
 maintainer="Jürgen Buchmüller <pullmoll@t-online.de>"
 license="GPL-2.0-or-later"
 homepage="http://www.widelands.org/"
 distfiles="https://github.com/widelands/widelands/archive/build${version}.tar.gz>${pkgname}-${version}.tar.gz"
 checksum=601e0e4c6f91b3fb0ece2cd1b83ecfb02344a1b9194fbb70ef3f70e06994e357
+replaces="widelands-data>=0"
 
 CXXFLAGS="-DU_USING_ICU_NAMESPACE=1"
 
@@ -29,22 +29,5 @@ if [ "$CROSS_BUILD" ]; then
 fi
 
 post_install() {
-	# For some reason the binary is installed as /usr/widelands - move it
-	vmkdir usr/bin
-	mv ${DESTDIR}/usr/${pkgname} ${DESTDIR}/usr/bin
-	vmkdir usr/share
-	mv ${DESTDIR}/share/* ${DESTDIR}/usr/share/
-	rmdir ${DESTDIR}/share
-
-	# Remove files not needed in the package
-	rm -f ${DESTDIR}/usr/COPYING ${DESTDIR}/usr/CREDITS ${DESTDIR}/usr/ChangeLog ${DESTDIR}/usr/VERSION
-
 	vinstall ${FILESDIR}/${pkgname}.desktop 644 usr/share/applications
 }
-
-widelands-data_package() {
-	short_desc+=" - data files"
-	pkg_install() {
-		vmove usr/share/widelands
-	}
-}

From fca89613196fead100dc4e43f640c4f3d88ec39e 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: Sat, 20 Mar 2021 09:49:25 +0700
Subject: [PATCH 12/53] zziplib: fix SONAME when build with
 -DCMAKE_BUILD_TYPE=None

---
 .../cmake-build-type-none-soname.patch        | 35 +++++++++++++++++++
 srcpkgs/zziplib/template                      |  1 +
 2 files changed, 36 insertions(+)
 create mode 100644 srcpkgs/zziplib/patches/cmake-build-type-none-soname.patch

diff --git a/srcpkgs/zziplib/patches/cmake-build-type-none-soname.patch b/srcpkgs/zziplib/patches/cmake-build-type-none-soname.patch
new file mode 100644
index 000000000000..2d31b5b8a46a
--- /dev/null
+++ b/srcpkgs/zziplib/patches/cmake-build-type-none-soname.patch
@@ -0,0 +1,35 @@
+Index: zziplib-0.13.72/zzip/CMakeLists.txt
+===================================================================
+--- zziplib-0.13.72.orig/zzip/CMakeLists.txt
++++ zziplib-0.13.72/zzip/CMakeLists.txt
+@@ -190,15 +190,18 @@ target_include_directories (libzzipmmapp
+ endif()
+ 
+ set_target_properties(libzzip PROPERTIES OUTPUT_NAME "zzip" RELEASE_POSTFIX "-${RELNUM}")
++set_target_properties(libzzip PROPERTIES OUTPUT_NAME "zzip" NONE_POSTFIX "-${RELNUM}")
+ SET_TARGET_PROPERTIES(libzzip PROPERTIES VERSION ${VERNUM}.${FIXNUM} SOVERSION ${VERNUM})
+ 
+ if(ZZIPFSEEKO)
+ set_target_properties(libzzipfseeko PROPERTIES OUTPUT_NAME "zzipfseeko" RELEASE_POSTFIX "-${RELNUM}")
++set_target_properties(libzzipfseeko PROPERTIES OUTPUT_NAME "zzipfseeko" NONE_POSTFIX "-${RELNUM}")
+ SET_TARGET_PROPERTIES(libzzipfseeko PROPERTIES VERSION ${VERNUM}.${FIXNUM} SOVERSION ${VERNUM})
+ endif()
+ 
+ if(ZZIPMMAPPED)
+ set_target_properties(libzzipmmapped PROPERTIES OUTPUT_NAME "zzipmmapped" RELEASE_POSTFIX "-${RELNUM}")
++set_target_properties(libzzipmmapped PROPERTIES OUTPUT_NAME "zzipmmapped" NONE_POSTFIX "-${RELNUM}")
+ SET_TARGET_PROPERTIES(libzzipmmapped PROPERTIES VERSION ${VERNUM}.${FIXNUM} SOVERSION ${VERNUM})
+ endif()
+ 
+Index: zziplib-0.13.72/zzipwrap/CMakeLists.txt
+===================================================================
+--- zziplib-0.13.72.orig/zzipwrap/CMakeLists.txt
++++ zziplib-0.13.72/zzipwrap/CMakeLists.txt
+@@ -49,6 +49,7 @@ target_link_libraries(libzzipwrap libzzi
+ target_include_directories(libzzipwrap PRIVATE "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}")
+ 
+ set_target_properties(libzzipwrap PROPERTIES OUTPUT_NAME "zzipwrap" RELEASE_POSTFIX "-${RELNUM}")
++set_target_properties(libzzipwrap PROPERTIES OUTPUT_NAME "zzipwrap" NONE_POSTFIX "-${RELNUM}")
+ SET_TARGET_PROPERTIES(libzzipwrap PROPERTIES VERSION ${VERNUM}.${FIXNUM} SOVERSION ${VERNUM})
+ set_target_properties(libzzipwrap PROPERTIES DEFINE_SYMBOL "libzzip_EXPORTS")
+ 
diff --git a/srcpkgs/zziplib/template b/srcpkgs/zziplib/template
index ab5af234af62..2026f3e4a521 100644
--- a/srcpkgs/zziplib/template
+++ b/srcpkgs/zziplib/template
@@ -12,6 +12,7 @@ homepage="https://github.com/gdraheim/zziplib"
 changelog="https://raw.githubusercontent.com/gdraheim/zziplib/master/ChangeLog"
 distfiles="https://github.com/gdraheim/zziplib/archive/v${version}.tar.gz"
 checksum=93ef44bf1f1ea24fc66080426a469df82fa631d13ca3b2e4abaeab89538518dc
+patch_args=-Np1
 
 if [ "$CROSS_BUILD" ]; then
 	configure_args+=" -DZZIPTEST=OFF"

From 19d159530e95c960321ed55448195bbd1081ce15 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, 21 Mar 2021 15:28:04 +0700
Subject: [PATCH 13/53] mellowplayer: fix build

---
 srcpkgs/mellowplayer/patches/no-werror.patch | 13 +++++++++++++
 srcpkgs/mellowplayer/template                | 13 +++++++------
 2 files changed, 20 insertions(+), 6 deletions(-)
 create mode 100644 srcpkgs/mellowplayer/patches/no-werror.patch

diff --git a/srcpkgs/mellowplayer/patches/no-werror.patch b/srcpkgs/mellowplayer/patches/no-werror.patch
new file mode 100644
index 000000000000..7e678453a123
--- /dev/null
+++ b/srcpkgs/mellowplayer/patches/no-werror.patch
@@ -0,0 +1,13 @@
+Index: MellowPlayer-3.6.6/src/3rdparty/boost/di.hpp
+===================================================================
+--- MellowPlayer-3.6.6.orig/src/3rdparty/boost/di.hpp
++++ MellowPlayer-3.6.6/src/3rdparty/boost/di.hpp
+@@ -67,7 +67,7 @@ BOOST_DI_CFG_FWD
+ #pragma clang diagnostic error "-Wundefined-internal"
+ #pragma clang diagnostic ignored "-Wmissing-field-initializers"
+ #elif defined(__GCC__)
+-#pragma GCC diagnostic error "-Wdeprecated-declarations"
++#pragma GCC diagnostic warning "-Wdeprecated-declarations"
+ #pragma GCC diagnostic push
+ #if (__GNUC__ < 6)
+ #pragma GCC diagnostic error "-Werror"
diff --git a/srcpkgs/mellowplayer/template b/srcpkgs/mellowplayer/template
index 2f8f13960ca6..cfd8a185556f 100644
--- a/srcpkgs/mellowplayer/template
+++ b/srcpkgs/mellowplayer/template
@@ -4,7 +4,7 @@ version=3.6.6
 revision=1
 wrksrc="MellowPlayer-${version}"
 build_style=cmake
-hostmakedepends="pkg-config qt5-tools qt5-qmake"
+hostmakedepends="pkg-config qt5-tools qt5-qmake qt5-host-tools"
 makedepends="qt5-declarative-devel qt5-quickcontrols2-devel
  qt5-plugin-mysql qt5-plugin-pgsql qt5-plugin-sqlite
  qt5-plugin-tds qt5-plugin-odbc
@@ -17,11 +17,12 @@ license="GPL-2.0-or-later"
 homepage="https://colinduquesnoy.gitlab.io/MellowPlayer/"
 distfiles="https://gitlab.com/ColinDuquesnoy/MellowPlayer/-/archive/${version}/MellowPlayer-${version}.tar.bz2"
 checksum=17b8b25ca6b3d27b223f8be6ad80186ae5bd17ce762eb04ecd8b0e82e687b327
+patch_args=-Np1
 
-if [ "$CROSS_BUILD" ]; then
-	hostmakedepends+=" qt5-host-tools"
+if [ "$XBPS_WORDSIZE" != "$XBPS_TARGET_WORDSIZE" ]; then
+	broken="webengine can be built only if word size matches"
 fi
 
-case "$XBPS_TARGET_MACHINE" in
-	arm*) broken="qt5-webengine not available" ;;
-esac
+if [ "$XBPS_TARGET_ENDIAN" != "le" ]; then
+	broken="webengine only supports little endian"
+fi

From 4addcf87857b01ccc9968ba2ae44f1507df410a7 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, 21 Mar 2021 15:43:09 +0700
Subject: [PATCH 14/53] ispc: fix CMAKE_BUILD_TYPE=None

---
 .../ispc/patches/cmake-build-type-none.patch   | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
 create mode 100644 srcpkgs/ispc/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/ispc/patches/cmake-build-type-none.patch b/srcpkgs/ispc/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..411e353c7314
--- /dev/null
+++ b/srcpkgs/ispc/patches/cmake-build-type-none.patch
@@ -0,0 +1,18 @@
+Index: ispc-1.15.0/CMakeLists.txt
+===================================================================
+--- ispc-1.15.0.orig/CMakeLists.txt
++++ ispc-1.15.0/CMakeLists.txt
+@@ -157,13 +157,6 @@ set(OUTPUT_RELEASE Release/bin)
+ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin )
+ 
+ if(CMAKE_BUILD_TYPE)
+-    # Validate build type
+-    set(CONFIGURATION_TYPES "Debug;Release;RelWithDebInfo")
+-
+-    string(FIND "${CONFIGURATION_TYPES}" "${CMAKE_BUILD_TYPE}" MATCHED_CONFIG)
+-    if (${MATCHED_CONFIG} EQUAL -1)
+-         message(FATAL_ERROR "CMAKE_BUILD_TYPE (${CMAKE_BUILD_TYPE}) allows only the following values: ${CONFIGURATION_TYPES}")
+-    endif()
+ else(NOT CMAKE_BUILD_TYPE)
+     set(CMAKE_BUILD_TYPE "Release")
+     message(STATUS "Build type not specified: Use Release by default.")

From 62c59bf52f7c48e41b54c82938c55c140439e870 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, 21 Mar 2021 15:56:50 +0700
Subject: [PATCH 15/53] darktable: fix CMAKE_BUILD_TYPE=None

---
 .../darktable/patches/cmake-build-type-none.patch  | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
 create mode 100644 srcpkgs/darktable/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/darktable/patches/cmake-build-type-none.patch b/srcpkgs/darktable/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..7101f9c1a0e7
--- /dev/null
+++ b/srcpkgs/darktable/patches/cmake-build-type-none.patch
@@ -0,0 +1,14 @@
+Index: src/external/rawspeed/cmake/build-type.cmake
+===================================================================
+--- src/external/rawspeed/cmake/build-type.cmake.orig
++++ src/external/rawspeed/cmake/build-type.cmake
+@@ -27,9 +27,6 @@ string(TOUPPER "${RAWSPEED_SPECIAL_BUILD
+ 
+ # is this one of the known build types?
+ list (FIND CMAKE_CONFIGURATION_TYPES_UPPERCASE ${CMAKE_BUILD_TYPE_UPPERCASE} BUILD_TYPE_IS_KNOWN)
+-if (${BUILD_TYPE_IS_KNOWN} EQUAL -1)
+- message(SEND_ERROR "Unknown build type: ${CMAKE_BUILD_TYPE_UPPERCASE}. Please specify one of: ${CMAKE_CONFIGURATION_TYPES}")
+-endif()
+ 
+ # is this a special build?
+ list (FIND RAWSPEED_SPECIAL_BUILD_TYPES_UPPERCASE ${CMAKE_BUILD_TYPE_UPPERCASE} IS_SPECIAL_BUILD)

From eb56ba5585ec737dda61bf20fb37a9238afd1a3d 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, 21 Mar 2021 15:33:29 +0700
Subject: [PATCH 16/53] hedgewars: merge -data back

---
 srcpkgs/hedgewars-data                        |  1 -
 .../patches/cmake-build-type-none.patch       | 30 +++++++++++++++++++
 srcpkgs/hedgewars/template                    | 23 +++++---------
 3 files changed, 38 insertions(+), 16 deletions(-)
 delete mode 120000 srcpkgs/hedgewars-data
 create mode 100644 srcpkgs/hedgewars/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/hedgewars-data b/srcpkgs/hedgewars-data
deleted file mode 120000
index b57dc45ebadc..000000000000
--- a/srcpkgs/hedgewars-data
+++ /dev/null
@@ -1 +0,0 @@
-hedgewars
\ No newline at end of file
diff --git a/srcpkgs/hedgewars/patches/cmake-build-type-none.patch b/srcpkgs/hedgewars/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..b4e0c186717c
--- /dev/null
+++ b/srcpkgs/hedgewars/patches/cmake-build-type-none.patch
@@ -0,0 +1,30 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -54,7 +54,7 @@ option(NOVERSIONINFOUPDATE "Disable upda
+ 
+ 
+ if(BUILD_ENGINE_C AND NOT NOVIDEOREC)
+-    if((CMAKE_BUILD_TYPE STREQUAL "Release") OR (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo"))
++    if((CMAKE_BUILD_TYPE STREQUAL "Release") OR (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo") OR (CMAKE_BUILD_TYPE STREQUAL "None"))
+         message("NOTE: Video recorder support disabled. It's incompatible with BUILD_ENGINE_C")
+         set(BUILD_ENGINE_C ON CACHE STRING "Required for BUILD_ENGINE_JS" FORCE)
+     else()
+@@ -93,7 +93,7 @@ set(CPACK_PACKAGE_VERSION_MAJOR 1)
+ set(CPACK_PACKAGE_VERSION_MINOR 0)
+ set(CPACK_PACKAGE_VERSION_PATCH 0)
+ set(HEDGEWARS_PROTO_VER 59)
+-if((CMAKE_BUILD_TYPE STREQUAL "Release") OR (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo"))
++if((CMAKE_BUILD_TYPE STREQUAL "Release") OR (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo") OR (CMAKE_BUILD_TYPE STREQUAL "None"))
+     set(HEDGEWARS_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
+ else()
+     set(HEDGEWARS_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}-dev")
+@@ -114,6 +114,7 @@ include(${CMAKE_MODULE_PATH}/platform.cm
+ if(CMAKE_BUILD_TYPE)
+     if(NOT((CMAKE_BUILD_TYPE STREQUAL "Release") OR
+            (CMAKE_BUILD_TYPE STREQUAL "Debug") OR
++	   (CMAKE_BUILD_TYPE STREQUAL "None") OR
+            (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")))
+         set(CMAKE_BUILD_TYPE ${default_build_type} CACHE STRING "Build type (Debug/Release/RelWithDebInfo)" FORCE)
+         message(STATUS "Unknown build type ${CMAKE_BUILD_TYPE}, using default (${default_build_type})")
diff --git a/srcpkgs/hedgewars/template b/srcpkgs/hedgewars/template
index d2294cf572f5..f413a965ff2e 100644
--- a/srcpkgs/hedgewars/template
+++ b/srcpkgs/hedgewars/template
@@ -1,15 +1,15 @@
 # Template file for 'hedgewars'
 pkgname=hedgewars
 version=1.0.0
-revision=2
+revision=3
 wrksrc="${pkgname}-src-${version}"
 build_style=cmake
 configure_args="-DNOSERVER=1 -DDATA_INSTALL_DIR=/usr/share/${pkgname}
- -DPHYSFS_SYSTEM=1 -DCMAKE_VERBOSE_MAKEFILE=1 -DMINIMAL_FLAGS=1"
-hostmakedepends="lua51 pkg-config"
+ -DPHYSFS_SYSTEM=1 -DMINIMAL_FLAGS=1"
+hostmakedepends="lua51 pkg-config qt5-qmake qt5-host-tools"
 makedepends="ffmpeg-devel lua51-devel physfs-devel qt5-tools-devel SDL2_image-devel
  SDL2_mixer-devel SDL2_net-devel SDL2_ttf-devel"
-depends="hedgewars-data>=${version}_${revision} libfreeglut"
+depends="libfreeglut"
 short_desc="Funny turn-based artillery game, featuring fighting Hedgehogs!"
 maintainer="Jakub Skrzypnik <jot.skrzyp@gmail.com>"
 license="GPL-2.0-only"
@@ -18,10 +18,9 @@ distfiles="https://hedgewars.org/download/releases/hedgewars-src-${version}.tar.
 checksum=211634e61f2e4beecc3c98c6f749601fcd08321fda1ba969b3b3832a004f155b
 nopie_files="/usr/bin/hwengine"
 nocross="Needs investigation: fails to link hwengine"
-
-if [ -n "$CROSS_BUILD" ]; then
-	hostmakedepends+=" qt5-devel"
-fi
+replaces="hedgewars-data>=0"
+export CMAKE_GENERATOR="Unix Makefiles"
+make_cmd=make
 
 case $XBPS_TARGET_MACHINE in
 	x86_64*)
@@ -38,6 +37,7 @@ esac
 
 if [ -n "$_use_c_engine" ]; then
 	hostmakedepends+=" glew-devel libatomic-devel ghc clang"
+	makedepends+=" glew-devel libatomic-devel"
 	configure_args+=" -DBUILD_ENGINE_C=1"
 	nopie_files+=" /usr/bin/hedgewars"
 fi
@@ -56,10 +56,3 @@ pre_configure() {
 post_install() {
 	vinstall ${DESTDIR}/usr/share/hedgewars/Data/misc/hedgewars.desktop 644 usr/share/applications
 }
-
-hedgewars-data_package() {
-	short_desc+=" - data files"
-	pkg_install() {
-		vmove usr/share/hedgewars/Data
-	}
-}

From 58db8b7dd88bcbe23982de545008cc86e3eec1e1 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, 21 Mar 2021 16:41:58 +0700
Subject: [PATCH 17/53] mariadb: fix for CMAKE_BUILD_TYPE=None

---
 srcpkgs/mariadb/template | 32 ++++++++++++++------------------
 1 file changed, 14 insertions(+), 18 deletions(-)

diff --git a/srcpkgs/mariadb/template b/srcpkgs/mariadb/template
index 437ff757b383..78d5e2dbdbe8 100644
--- a/srcpkgs/mariadb/template
+++ b/srcpkgs/mariadb/template
@@ -34,35 +34,31 @@ replaces="mysql>=0"
 conf_files="/etc/mysql/my.cnf"
 system_accounts="mysql"
 mysql_homedir="/var/lib/mysql"
-CFLAGS="-w -fcommon"
+CFLAGS="-w -fcommon -DDBUG_OFF=1"
+CXXFLAGS="-DDBUG_OFF=1"
 
 pre_configure() {
 	# We need some host binaries before starting cross compilation.
 	if [ "$CROSS_BUILD" ]; then
+		mkdir -p build.native
 		# XXX still broken: jemalloc configure execs host bins.
-		CC= CXX= CPP= LD= AR= AS= RANLIB= CFLAGS= CXXFLAGS= LDFLAGS= cmake .
-		make comp_err comp_sql gen_lex_hash gen_lex_token
-		mkdir bin.host
-		cp extra/comp_err bin.host
-		cp scripts/comp_sql bin.host
-		cp sql/gen_lex_hash bin.host
-		cp sql/gen_lex_token bin.host
-		make clean
-		rm CMakeCache.txt
+		CC= CXX= CPP= LD= AR= AS= RANLIB= CFLAGS= CXXFLAGS= LDFLAGS= \
+			cmake -S . -B build.native
+		make -C build.native comp_err comp_sql gen_lex_hash gen_lex_token
 	fi
 }
 
 pre_build() {
 	if [ "$CROSS_BUILD" ]; then
 		# CMake complains if those binaries ain't in build
-		cp bin.host/comp_err ${wrksrc}/extra
-		cp bin.host/comp_err ${wrksrc}/build/extra
-		cp bin.host/comp_sql ${wrksrc}/scripts
-		cp bin.host/comp_sql ${wrksrc}/build/scripts
-		cp bin.host/gen_lex_hash ${wrksrc}/sql
-		cp bin.host/gen_lex_hash ${wrksrc}/build/sql
-		cp bin.host/gen_lex_token ${wrksrc}/sql
-		cp bin.host/gen_lex_token ${wrksrc}/build/sql
+		cp build.native/extra/comp_err ${wrksrc}/extra
+		cp build.native/extra/comp_err ${wrksrc}/build/extra
+		cp build.native/scripts/comp_sql ${wrksrc}/scripts
+		cp build.native/scripts/comp_sql ${wrksrc}/build/scripts
+		cp build.native/sql/gen_lex_hash ${wrksrc}/sql
+		cp build.native/sql/gen_lex_hash ${wrksrc}/build/sql
+		cp build.native/sql/gen_lex_token ${wrksrc}/sql
+		cp build.native/sql/gen_lex_token ${wrksrc}/build/sql
 		export PATH=${PATH}:${wrksrc}/extra:${wrksrc}/scripts:${wrksrc}/sql
 	fi
 	export LD_LIBRARY_PATH=${wrksrc}/build/storage/tokudb/ft-index/portability

From 354480bad13ad497bfb1eb698e7ea90faf8547db 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: Thu, 25 Mar 2021 07:58:28 +0700
Subject: [PATCH 18/53] EternalTerminal: remove -ggdb3

---
 .../EternalTerminal/patches/fix-cflags.patch    | 17 +++++++++++++++++
 srcpkgs/EternalTerminal/template                |  1 +
 2 files changed, 18 insertions(+)
 create mode 100644 srcpkgs/EternalTerminal/patches/fix-cflags.patch

diff --git a/srcpkgs/EternalTerminal/patches/fix-cflags.patch b/srcpkgs/EternalTerminal/patches/fix-cflags.patch
new file mode 100644
index 000000000000..e6fcd432f7e7
--- /dev/null
+++ b/srcpkgs/EternalTerminal/patches/fix-cflags.patch
@@ -0,0 +1,17 @@
+Index: EternalTerminal-et-v6.0.13/CMakeLists.txt
+===================================================================
+--- EternalTerminal-et-v6.0.13.orig/CMakeLists.txt
++++ EternalTerminal-et-v6.0.13/CMakeLists.txt
+@@ -26,12 +26,6 @@ if(DISABLE_CRASH_LOG)
+ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DELPP_DISABLE_DEFAULT_CRASH_HANDLING")
+ ENDIF(DISABLE_CRASH_LOG)
+ 
+-if(UNIX)
+-  # Enable debug info
+-  SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -ggdb3")
+-  SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -ggdb3")
+-endif()
+-
+ # Enable C++-11
+ set(CMAKE_CXX_STANDARD 11)
+ set(CMAKE_CXX_STANDARD_REQUIRED ON)
diff --git a/srcpkgs/EternalTerminal/template b/srcpkgs/EternalTerminal/template
index 7bac78d2ffd4..bc92e47743dd 100644
--- a/srcpkgs/EternalTerminal/template
+++ b/srcpkgs/EternalTerminal/template
@@ -13,6 +13,7 @@ homepage="https://eternalterminal.dev/"
 distfiles="https://github.com/MisterTea/EternalTerminal/archive/et-v${version}.tar.gz"
 checksum=728c3a444d666897c710e33fe473d8d289263a59574451b13aa53ec3c6ac88b3
 system_accounts="_eternal"
+patch_args=-Np1
 
 LDFLAGS="-lgflags"
 

From c54d489a593cc1a80bf18a12c72ba1cd4ae4d6ec 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: Thu, 25 Mar 2021 08:20:29 +0700
Subject: [PATCH 19/53] OTPClient: respect CFLAGS

---
 srcpkgs/OTPClient/patches/fix-cflags.patch | 17 +++++++++++++++++
 srcpkgs/OTPClient/template                 |  1 +
 2 files changed, 18 insertions(+)
 create mode 100644 srcpkgs/OTPClient/patches/fix-cflags.patch

diff --git a/srcpkgs/OTPClient/patches/fix-cflags.patch b/srcpkgs/OTPClient/patches/fix-cflags.patch
new file mode 100644
index 000000000000..ae70f441538f
--- /dev/null
+++ b/srcpkgs/OTPClient/patches/fix-cflags.patch
@@ -0,0 +1,17 @@
+Index: OTPClient-2.4.2/CMakeLists.txt
+===================================================================
+--- OTPClient-2.4.2.orig/CMakeLists.txt
++++ OTPClient-2.4.2/CMakeLists.txt
+@@ -11,11 +11,10 @@ option(BUILD_GUI "Build the GUI" ON)
+ option(BUILD_CLI "Build the CLI" ON)
+ 
+ set(CMAKE_C_STANDARD 11)
+-set(CMAKE_C_FLAGS "-Wall -Wextra -O3 -Wformat=2 -Wmissing-format-attribute -fstack-protector-strong -Wundef -Wmissing-format-attribute")
++set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wformat=2 -Wmissing-format-attribute -fstack-protector-strong -Wundef -Wmissing-format-attribute")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fdiagnostics-color=always -Wstrict-prototypes -Wunreachable-code")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wchar-subscripts -Wwrite-strings -Wpointer-arith -Wbad-function-cast -Wcast-align")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror=format-security -Werror=implicit-function-declaration -Wno-sign-compare")
+-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3")
+ if(CMAKE_COMPILER_IS_GNUCC)
+     set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pie -fPIE")
+ endif()
diff --git a/srcpkgs/OTPClient/template b/srcpkgs/OTPClient/template
index e8c0099850b7..f5af76e655a6 100644
--- a/srcpkgs/OTPClient/template
+++ b/srcpkgs/OTPClient/template
@@ -12,3 +12,4 @@ license="GPL-3.0-or-later"
 homepage="https://github.com/paolostivanin/OTPClient"
 distfiles="https://github.com/paolostivanin/OTPClient/archive/v${version}.tar.gz"
 checksum=74bc4312aa1cd336ca983434e3bed951c5ead327091e7708e3beb08508813495
+patch_args=-Np1

From c56133981d7325565d546b93aee085e6c16ad000 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: Thu, 25 Mar 2021 08:30:31 +0700
Subject: [PATCH 20/53] crex: hardening

---
 srcpkgs/crex/patches/fix-cflags.patch | 20 ++++++++++++++++++++
 srcpkgs/crex/template                 |  7 ++-----
 2 files changed, 22 insertions(+), 5 deletions(-)
 create mode 100644 srcpkgs/crex/patches/fix-cflags.patch

diff --git a/srcpkgs/crex/patches/fix-cflags.patch b/srcpkgs/crex/patches/fix-cflags.patch
new file mode 100644
index 000000000000..d191fb1e9ec0
--- /dev/null
+++ b/srcpkgs/crex/patches/fix-cflags.patch
@@ -0,0 +1,20 @@
+Index: crex-0.2.5/CMakeLists.txt
+===================================================================
+--- crex-0.2.5.orig/CMakeLists.txt
++++ crex-0.2.5/CMakeLists.txt
+@@ -13,9 +13,6 @@ endif(CCACHE_FOUND)
+ set (CMAKE_CXX_STANDARD 14)
+ set (CMAKE_CXX_STANDARD_REQUIRED ON)
+ 
+-set (CMAKE_CXX_FLAGS "-fdiagnostics-color=auto")
+-set (CMAKE_C_FLAGS "-fdiagnostics-color=auto")
+-
+ set (DEBUG_FLAGS "-Wpedantic -Wall -Wextra -Wcast-align -Wcast-qual -Wctor-dtor-privacy -Wdisabled-optimization -Wformat=2 -Winit-self -Wlogical-op -Wmissing-declarations -Wmissing-include-dirs -Wnoexcept -Wold-style-cast -Woverloaded-virtual -Wredundant-decls -Wshadow -Wsign-conversion -Wsign-promo -Wstrict-null-sentinel -Wstrict-overflow=5 -Wswitch-default -Wundef -Wno-unused -std=c++14 -g")
+ set (DEBUG_LINK_FLAGS "-fprofile-arcs -ftest-coverage -flto")
+ 
+@@ -56,4 +53,4 @@ target_link_libraries (
+   ${TARGET}
+ )
+ 
+-install (TARGETS ${TARGET} DESTINATION "/usr/local/bin")
++install (TARGETS ${TARGET} DESTINATION "/usr/bin")
diff --git a/srcpkgs/crex/template b/srcpkgs/crex/template
index a54697a93adc..2f455a0b0c72 100644
--- a/srcpkgs/crex/template
+++ b/srcpkgs/crex/template
@@ -1,7 +1,7 @@
 # Template file for 'crex'
 pkgname=crex
 version=0.2.5
-revision=1
+revision=2
 build_style=cmake
 short_desc="Explore, test, and check regular expressions in the terminal"
 maintainer="Piotr Wójcik <chocimier@tlen.pl>"
@@ -9,10 +9,7 @@ license="MIT"
 homepage="https://github.com/octobanana/crex"
 distfiles="https://github.com/octobanana/crex/archive/${version}.tar.gz"
 checksum=c6a166b7a1e696a7babeaf7c5728eece1624704a18357f827129fc95ef2ecc56
-
-pre_configure() {
-	sed -e 's|/local/|/|' -i CMakeLists.txt
-}
+patch_args=-Np1
 
 post_install() {
 	vlicense LICENSE

From 25880e318b653c94d3d83be8f06089490a693d11 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: Thu, 25 Mar 2021 08:34:32 +0700
Subject: [PATCH 21/53] libbaseencode: hardening

---
 srcpkgs/libbaseencode/patches/fix-cflags.patch | 13 +++++++++++++
 srcpkgs/libbaseencode/template                 |  3 ++-
 2 files changed, 15 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/libbaseencode/patches/fix-cflags.patch

diff --git a/srcpkgs/libbaseencode/patches/fix-cflags.patch b/srcpkgs/libbaseencode/patches/fix-cflags.patch
new file mode 100644
index 000000000000..1bb86a0b15a4
--- /dev/null
+++ b/srcpkgs/libbaseencode/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: libbaseencode-1.0.9/CMakeLists.txt
+===================================================================
+--- libbaseencode-1.0.9.orig/CMakeLists.txt
++++ libbaseencode-1.0.9/CMakeLists.txt
+@@ -15,7 +15,7 @@ set(CMAKE_C_STANDARD 11)
+ set(BASEENCODE_HEADERS src/baseencode.h)
+ set(SOURCE_FILES src/base32.c src/base64.c)
+ 
+-set(CMAKE_C_FLAGS "-Wall -Werror -fPIC")
++set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Werror -fPIC")
+ 
+ add_library(${PROJECT_NAME} SHARED ${SOURCE_FILES})
+ 
diff --git a/srcpkgs/libbaseencode/template b/srcpkgs/libbaseencode/template
index 384a189224df..d5929ad7bb51 100644
--- a/srcpkgs/libbaseencode/template
+++ b/srcpkgs/libbaseencode/template
@@ -1,7 +1,7 @@
 # Template file for 'libbaseencode'
 pkgname=libbaseencode
 version=1.0.9
-revision=1
+revision=2
 build_style=cmake
 short_desc="Library for encoding decoding data use base32 or base64"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -9,6 +9,7 @@ license="Apache-2.0"
 homepage="https://github.com/paolostivanin/libbaseencode"
 distfiles="https://github.com/paolostivanin/libbaseencode/archive/v${version}.tar.gz"
 checksum=a183d7cf30d931b2a078d6f0ef64616b71ab26f9258e5f4e191778c7ace7175d
+patch_args=-Np1
 
 libbaseencode-devel_package() {
 	depends="libbaseencode-${version}_${revision}"

From fe698a0ffa406bc3a7ee232190ada09143be49c2 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: Fri, 26 Mar 2021 08:46:56 +0700
Subject: [PATCH 22/53] bibletime: clean build flags

---
 srcpkgs/bibletime/patches/fix-cflags.patch | 13 +++++++++++++
 srcpkgs/bibletime/template                 |  1 +
 2 files changed, 14 insertions(+)
 create mode 100644 srcpkgs/bibletime/patches/fix-cflags.patch

diff --git a/srcpkgs/bibletime/patches/fix-cflags.patch b/srcpkgs/bibletime/patches/fix-cflags.patch
new file mode 100644
index 000000000000..480c5ca4ac1e
--- /dev/null
+++ b/srcpkgs/bibletime/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: bibletime-3.0/cmake/BTApplication.cmake
+===================================================================
+--- bibletime-3.0.orig/cmake/BTApplication.cmake
++++ bibletime-3.0/cmake/BTApplication.cmake
+@@ -41,7 +41,7 @@ IF(WIN32)
+     ADD_COMPILE_OPTIONS("/Zi")
+ ELSE()
+     ADD_COMPILE_OPTIONS(
+-        "-ggdb" "-Wall" "-Wextra"
++        "-Wall" "-Wextra" "-DNDEBUG" "-DQT_NO_DEBUG"
+         "$<$<STREQUAL:$<CONFIGURATION>,Release>:-O2>"
+         "$<$<STREQUAL:$<CONFIGURATION>,Release>:-DNDEBUG>"
+         "$<$<STREQUAL:$<CONFIGURATION>,Release>:-DQT_NO_DEBUG>"
diff --git a/srcpkgs/bibletime/template b/srcpkgs/bibletime/template
index 224881c45516..85bcc7f22f87 100644
--- a/srcpkgs/bibletime/template
+++ b/srcpkgs/bibletime/template
@@ -18,6 +18,7 @@ license="GPL-2.0-or-later"
 homepage="http://bibletime.info"
 distfiles="https://github.com/bibletime/bibletime/releases/download/v${version}/bibletime-${version}.tar.xz"
 checksum=d6beef62ad44b255e3dc4c5e89214bf01a0e85c9136073b0be12fca3d2b22622
+patch_args=-Np1
 
 pre_build() {
 	. /etc/profile.d/10_openjdk11.sh

From a189cfa5c38ca49c4aa7b52933e42f58ded69da2 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: Fri, 26 Mar 2021 08:54:25 +0700
Subject: [PATCH 23/53] boomerang: clean build flags

---
 srcpkgs/boomerang/patches/fix-cflags.patch | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
 create mode 100644 srcpkgs/boomerang/patches/fix-cflags.patch

diff --git a/srcpkgs/boomerang/patches/fix-cflags.patch b/srcpkgs/boomerang/patches/fix-cflags.patch
new file mode 100644
index 000000000000..eb59766c1c5b
--- /dev/null
+++ b/srcpkgs/boomerang/patches/fix-cflags.patch
@@ -0,0 +1,21 @@
+Index: cmake-scripts/boomerang-flags.cmake
+===================================================================
+--- cmake-scripts/boomerang-flags.cmake
++++ cmake-scripts/boomerang-flags.cmake
+@@ -104,16 +104,6 @@ endif ()
+ 
+ 
+ if (NOT MSVC)
+-    if ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
+-        BOOMERANG_ADD_COMPILE_FLAGS(-O0)
+-    elseif ("${CMAKE_BUILD_TYPE}" STREQUAL "RelWithDebInfo")
+-        # No special flags
+-    elseif ("${CMAKE_BUILD_TYPE}" STREQUAL "MinSizeRel")
+-        BOOMERANG_ADD_COMPILE_FLAGS(-Os)
+-    else () # Release
+-        BOOMERANG_ADD_COMPILE_FLAGS(-O3)
+-    endif ()
+-
+     if (BOOMERANG_ENABLE_COVERAGE)
+         set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fprofile-arcs -ftest-coverage")
+         set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage")

From 7ffea495739868a61e6ba77763ddbcce962a8c6b 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: Fri, 26 Mar 2021 08:58:11 +0700
Subject: [PATCH 24/53] catimg: don't change our build-type

---
 srcpkgs/catimg/patches/fix-cflags.patch | 12 ++++++++++++
 srcpkgs/catimg/template                 |  2 +-
 2 files changed, 13 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/catimg/patches/fix-cflags.patch

diff --git a/srcpkgs/catimg/patches/fix-cflags.patch b/srcpkgs/catimg/patches/fix-cflags.patch
new file mode 100644
index 000000000000..9b9f1074ef20
--- /dev/null
+++ b/srcpkgs/catimg/patches/fix-cflags.patch
@@ -0,0 +1,12 @@
+Index: catimg-2.7.0/CMakeLists.txt
+===================================================================
+--- catimg-2.7.0.orig/CMakeLists.txt
++++ catimg-2.7.0/CMakeLists.txt
+@@ -11,7 +11,6 @@ endif()
+ #set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wall -Wextra -g -std=c99 -Wno-unused-result")
+ #set(CMAKE_BUILD_TYPE Debug)
+ set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -Wall -Wextra -Os -std=c99 -Wno-unused-result")
+-set(CMAKE_BUILD_TYPE Release)
+ 
+ set(SRC ${PROJECT_SOURCE_DIR}/src)
+ 
diff --git a/srcpkgs/catimg/template b/srcpkgs/catimg/template
index 374351c45379..6fbc5f1d9140 100644
--- a/srcpkgs/catimg/template
+++ b/srcpkgs/catimg/template
@@ -9,7 +9,7 @@ license="MIT"
 homepage="https://github.com/posva/catimg"
 distfiles="https://github.com/posva/catimg/archive/${version}.tar.gz"
 checksum=3a6450316ff62fb07c3facb47ea208bf98f62abd02783e88c56f2a6508035139
-
+patch_args=-Np1
 CFLAGS="-fcommon"
 
 post_install() {

From 9d68bc40bd7d99914e7515cc6851eba248fc4c84 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: Fri, 26 Mar 2021 09:09:37 +0700
Subject: [PATCH 25/53] libcotp: fix build flags

---
 srcpkgs/libcotp/patches/fix-cflags.patch | 14 ++++++++++++++
 srcpkgs/libcotp/template                 |  1 +
 2 files changed, 15 insertions(+)
 create mode 100644 srcpkgs/libcotp/patches/fix-cflags.patch

diff --git a/srcpkgs/libcotp/patches/fix-cflags.patch b/srcpkgs/libcotp/patches/fix-cflags.patch
new file mode 100644
index 000000000000..397b3960e9f4
--- /dev/null
+++ b/srcpkgs/libcotp/patches/fix-cflags.patch
@@ -0,0 +1,14 @@
+Index: libcotp-1.2.2/CMakeLists.txt
+===================================================================
+--- libcotp-1.2.2.orig/CMakeLists.txt
++++ libcotp-1.2.2/CMakeLists.txt
+@@ -25,8 +25,7 @@ set(CMAKE_C_STANDARD 11)
+ set(COTP_HEADERS src/cotp.h)
+ set(SOURCE_FILES src/otp.c)
+ 
+-set(CMAKE_C_FLAGS "-Wall -Wextra -O3 -Wno-format-truncation -fstack-protector-strong -fPIC")
+-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3")
++set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wno-format-truncation -fstack-protector-strong -fPIC")
+ 
+ add_library(cotp SHARED ${SOURCE_FILES})
+ 
diff --git a/srcpkgs/libcotp/template b/srcpkgs/libcotp/template
index 9e147ff7deb6..88337290d1e8 100644
--- a/srcpkgs/libcotp/template
+++ b/srcpkgs/libcotp/template
@@ -11,6 +11,7 @@ license="Apache-2.0"
 homepage="https://github.com/paolostivanin/libcotp"
 distfiles="https://github.com/paolostivanin/libcotp/archive/v${version}.tar.gz"
 checksum=25b45ffa4aece5cc689503ebea7356a2f760c194f0c41805934495d2fe7165b1
+patch_args=-Np1
 
 libcotp-devel_package() {
 	depends="libcotp-${version}_${revision}"

From 14e7c5f8587fa1c281bcfca1c6347e4e02a9ee70 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: Fri, 26 Mar 2021 21:06:07 +0700
Subject: [PATCH 26/53] loudgain: hardening

---
 srcpkgs/loudgain/patches/fix-cflags.patch | 20 ++++++++++++++++++++
 srcpkgs/loudgain/template                 |  3 ++-
 2 files changed, 22 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/loudgain/patches/fix-cflags.patch

diff --git a/srcpkgs/loudgain/patches/fix-cflags.patch b/srcpkgs/loudgain/patches/fix-cflags.patch
new file mode 100644
index 000000000000..25b2c969bef4
--- /dev/null
+++ b/srcpkgs/loudgain/patches/fix-cflags.patch
@@ -0,0 +1,20 @@
+Index: loudgain-0.6.8/CMakeLists.txt
+===================================================================
+--- loudgain-0.6.8.orig/CMakeLists.txt
++++ loudgain-0.6.8/CMakeLists.txt
+@@ -69,12 +69,12 @@ TARGET_LINK_LIBRARIES(loudgain
+ )
+ 
+ SET_TARGET_PROPERTIES(loudgain PROPERTIES
+-  COMPILE_FLAGS "-Wall -pedantic -g"
++  COMPILE_FLAGS "-Wall -pedantic"
+ )
+ 
+-SET(CMAKE_C_FLAGS "-std=gnu99 -D_GNU_SOURCE")
++SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99 -D_GNU_SOURCE")
+ 
+-SET(CMAKE_CXX_FLAGS "-std=gnu++11 -D_GNU_SOURCE")
++SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11 -D_GNU_SOURCE")
+ 
+ INSTALL(TARGETS loudgain DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
+ 
diff --git a/srcpkgs/loudgain/template b/srcpkgs/loudgain/template
index f29167883439..00b2d20d27d6 100644
--- a/srcpkgs/loudgain/template
+++ b/srcpkgs/loudgain/template
@@ -1,7 +1,7 @@
 # Template file for 'loudgain'
 pkgname=loudgain
 version=0.6.8
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="pkg-config"
 makedepends="libebur128-devel taglib-devel ffmpeg-devel"
@@ -11,6 +11,7 @@ license="BSD-2-Clause"
 homepage="https://github.com/Moonbase59/loudgain"
 distfiles="https://github.com/Moonbase59/loudgain/archive/v${version}.tar.gz"
 checksum=1137c193ad941b366e87c5d84ccc95a7aa8571affc060db0bd1cf72c489aeaee
+patch_args=-Np1
 
 post_install() {
 	vlicense COPYING

From 09d7a5b27e2722fc2b20269914d6b75e5aca889f 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: Fri, 26 Mar 2021 21:14:31 +0700
Subject: [PATCH 27/53] masterpassword-cli: hardening

---
 srcpkgs/masterpassword-cli/patches/fix-cflags.patch | 13 +++++++++++++
 srcpkgs/masterpassword-cli/template                 |  2 +-
 2 files changed, 14 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/masterpassword-cli/patches/fix-cflags.patch

diff --git a/srcpkgs/masterpassword-cli/patches/fix-cflags.patch b/srcpkgs/masterpassword-cli/patches/fix-cflags.patch
new file mode 100644
index 000000000000..a303f6954544
--- /dev/null
+++ b/srcpkgs/masterpassword-cli/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: platform-independent/cli-c/CMakeLists.txt
+===================================================================
+--- platform-independent/cli-c/CMakeLists.txt.orig
++++ platform-independent/cli-c/CMakeLists.txt
+@@ -15,8 +15,6 @@ option( BUILD_MPW_BENCH         "C CLI M
+ option( BUILD_MPW_TESTS         "C Master Password algorithm test suite (needs: mpw_sodium, mpw_xml)." OFF )
+ 
+ # Default build flags.
+-set( CMAKE_BUILD_TYPE           Release )
+-set( CMAKE_C_FLAGS              "-O3" )
+ 
+ # Version.
+ file( READ                      "VERSION" mpw_version )
diff --git a/srcpkgs/masterpassword-cli/template b/srcpkgs/masterpassword-cli/template
index ee2b8d41ae4b..8536228a602b 100644
--- a/srcpkgs/masterpassword-cli/template
+++ b/srcpkgs/masterpassword-cli/template
@@ -1,7 +1,7 @@
 # Template file for 'masterpassword-cli'
 pkgname=masterpassword-cli
 version=2.6
-revision=5
+revision=6
 wrksrc=MasterPassword-${version}-cli-3
 build_wrksrc=platform-independent/cli-c
 build_style=cmake

From fb19973b59716c83aeb60b6bdc4f0433fbb39f3c 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: Fri, 26 Mar 2021 21:20:13 +0700
Subject: [PATCH 28/53] msg2: hardening

---
 srcpkgs/msg2/patches/fix-cflags.patch | 13 +++++++++++++
 srcpkgs/msg2/template                 |  2 +-
 2 files changed, 14 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/msg2/patches/fix-cflags.patch

diff --git a/srcpkgs/msg2/patches/fix-cflags.patch b/srcpkgs/msg2/patches/fix-cflags.patch
new file mode 100644
index 000000000000..64404bf44fcb
--- /dev/null
+++ b/srcpkgs/msg2/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -3,7 +3,7 @@ project(msg2)
+ 
+ # Flags
+ set(CMAKE_CXX_STANDARD 17)
+-set(CMAKE_CXX_FLAGS "-Os -pipe -fPIC -fno-plt -fstack-protector-strong -Wall -Wshadow -pedantic -Wno-parentheses -Wfatal-errors")
++set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pipe -fPIC -fno-plt -fstack-protector-strong -Wall -Wshadow -pedantic -Wno-parentheses -Wfatal-errors")
+ 
+ # Add source files
+ add_executable(msg2 main.cpp)
diff --git a/srcpkgs/msg2/template b/srcpkgs/msg2/template
index b4f77400bf22..473b3c4ec4d2 100644
--- a/srcpkgs/msg2/template
+++ b/srcpkgs/msg2/template
@@ -1,7 +1,7 @@
 # Template file for 'msg2'
 pkgname=msg2
 version=1.2.0
-revision=1
+revision=2
 build_style=cmake
 short_desc="Output a blue arrow and a white message on the commandline"
 maintainer="Orphaned <orphan@voidlinux.org>"

From 68c18bb12ce26c1c56d43e4f2ac5f6638135f4b5 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: Fri, 26 Mar 2021 21:22:55 +0700
Subject: [PATCH 29/53] ippusbxd: fix cflags -O2 not -o2

---
 srcpkgs/ippusbxd/patches/fix-cflags.patch | 12 ++++++++++++
 srcpkgs/ippusbxd/template                 |  2 +-
 2 files changed, 13 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/ippusbxd/patches/fix-cflags.patch

diff --git a/srcpkgs/ippusbxd/patches/fix-cflags.patch b/srcpkgs/ippusbxd/patches/fix-cflags.patch
new file mode 100644
index 000000000000..5d36903c3ffd
--- /dev/null
+++ b/srcpkgs/ippusbxd/patches/fix-cflags.patch
@@ -0,0 +1,12 @@
+Index: src/CMakeLists.txt
+===================================================================
+--- src/CMakeLists.txt.orig
++++ src/CMakeLists.txt
+@@ -1,6 +1,6 @@
+ cmake_minimum_required(VERSION 2.6)
+ project(ippusbxd)
+-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -o2 -g -std=c99 -Wall -Wextra -pedantic -pedantic-errors")
++set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -Wall -Wextra -pedantic -pedantic-errors")
+ 
+ 
+ # Compiler specific configuration
diff --git a/srcpkgs/ippusbxd/template b/srcpkgs/ippusbxd/template
index ce4ff2ea9125..e81064e8b91d 100644
--- a/srcpkgs/ippusbxd/template
+++ b/srcpkgs/ippusbxd/template
@@ -1,7 +1,7 @@
 # Template file for 'ippusbxd'
 pkgname=ippusbxd
 version=1.34
-revision=1
+revision=2
 build_wrksrc=src
 build_style=cmake
 make_cmd=make

From 7c20a3dda7da1bbb0283a93979173e556660f0c2 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: Fri, 26 Mar 2021 21:34:52 +0700
Subject: [PATCH 30/53] tlsh: respect -g

---
 srcpkgs/tlsh/patches/fix-cflags.patch | 13 +++++++++++++
 srcpkgs/tlsh/template                 |  2 +-
 2 files changed, 14 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/tlsh/patches/fix-cflags.patch

diff --git a/srcpkgs/tlsh/patches/fix-cflags.patch b/srcpkgs/tlsh/patches/fix-cflags.patch
new file mode 100644
index 000000000000..8715563715c7
--- /dev/null
+++ b/srcpkgs/tlsh/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -125,7 +125,7 @@ if (CMAKE_BUILD_TYPE STREQUAL Debug)
+     endif()
+ else(CMAKE_BUILD_TYPE STREQUAL Debug)
+     if(CMAKE_COMPILER_IS_GNUCXX)
+-        set(CMAKE_CXX_FLAGS "-O2 -fvisibility=internal")  ## Remove TlshImpl symbols
++        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=internal")  ## Remove TlshImpl symbols
+     endif()
+     if(MSVC)
+         set(CMAKE_CXX_FLAGS "/O2")        ## Optimize
diff --git a/srcpkgs/tlsh/template b/srcpkgs/tlsh/template
index 7cb5c28b48b9..dfea27526e14 100644
--- a/srcpkgs/tlsh/template
+++ b/srcpkgs/tlsh/template
@@ -1,7 +1,7 @@
 # Template file for 'tlsh'
 pkgname=tlsh
 version=3.17.0
-revision=2
+revision=3
 build_style=cmake
 hostmakedepends="python3"
 makedepends="python3-devel"

From 95e405039dc339297b5fcf907faa01f19cf1bd01 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: Fri, 26 Mar 2021 21:59:06 +0700
Subject: [PATCH 31/53] poppler: hardening + respect -g

---
 srcpkgs/poppler/patches/fix-cflags.patch | 21 +++++++++++++++++++++
 srcpkgs/poppler/template                 |  2 +-
 2 files changed, 22 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/poppler/patches/fix-cflags.patch

diff --git a/srcpkgs/poppler/patches/fix-cflags.patch b/srcpkgs/poppler/patches/fix-cflags.patch
new file mode 100644
index 000000000000..9e62b11010ba
--- /dev/null
+++ b/srcpkgs/poppler/patches/fix-cflags.patch
@@ -0,0 +1,21 @@
+Index: cmake/modules/PopplerMacros.cmake
+===================================================================
+--- cmake/modules/PopplerMacros.cmake.orig
++++ cmake/modules/PopplerMacros.cmake
+@@ -123,14 +123,14 @@ if(CMAKE_COMPILER_IS_GNUCXX)
+   set(DEFAULT_COMPILE_WARNINGS_EXTRA "${_warn} ${_warnx}")
+ 
+   set(_save_cxxflags "${CMAKE_CXX_FLAGS}")
+-  set(CMAKE_CXX_FLAGS                "-fno-exceptions -fno-check-new -fno-common -D_DEFAULT_SOURCE")
++  set(CMAKE_CXX_FLAGS                "-fno-exceptions -fno-check-new -fno-common -D_DEFAULT_SOURCE ${_save_cxxflags}")
+   set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g ${_save_cxxflags}")
+   set(CMAKE_CXX_FLAGS_RELEASE        "-O2 -DNDEBUG ${_save_cxxflags}")
+   set(CMAKE_CXX_FLAGS_DEBUG          "-g -O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline ${_save_cxxflags}")
+   set(CMAKE_CXX_FLAGS_DEBUGFULL      "-g3 -fno-inline ${_save_cxxflags}")
+   set(CMAKE_CXX_FLAGS_PROFILE        "-g3 -fno-inline -ftest-coverage -fprofile-arcs ${_save_cxxflags}")
+   set(_save_cflags "${CMAKE_C_FLAGS}")
+-  set(CMAKE_C_FLAGS                  "-std=c99 -D_DEFAULT_SOURCE")
++  set(CMAKE_C_FLAGS                  "-std=c99 -D_DEFAULT_SOURCE ${_save_cflags}")
+   set(CMAKE_C_FLAGS_RELWITHDEBINFO   "-O2 -g ${_save_cflags}")
+   set(CMAKE_C_FLAGS_RELEASE          "-O2 -DNDEBUG ${_save_cflags}")
+   set(CMAKE_C_FLAGS_DEBUG            "-g -O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline ${_save_cflags}")
diff --git a/srcpkgs/poppler/template b/srcpkgs/poppler/template
index ed0db8de7ab6..1aebd7f7e177 100644
--- a/srcpkgs/poppler/template
+++ b/srcpkgs/poppler/template
@@ -4,7 +4,7 @@
 #
 pkgname=poppler
 version=20.09.0
-revision=2
+revision=3
 build_style=cmake
 build_helper="gir"
 configure_args="-DENABLE_UNSTABLE_API_ABI_HEADERS=ON -DENABLE_CPP=ON

From e1de828c93386e95d7f3e91b26e7571714aad31c 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: Fri, 26 Mar 2021 21:59:29 +0700
Subject: [PATCH 32/53] poppler-qt5: hardening + respect -g

---
 srcpkgs/poppler-qt5/patches  | 1 +
 srcpkgs/poppler-qt5/template | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)
 create mode 120000 srcpkgs/poppler-qt5/patches

diff --git a/srcpkgs/poppler-qt5/patches b/srcpkgs/poppler-qt5/patches
new file mode 120000
index 000000000000..636e4ac2cbd9
--- /dev/null
+++ b/srcpkgs/poppler-qt5/patches
@@ -0,0 +1 @@
+../poppler/patches
\ No newline at end of file
diff --git a/srcpkgs/poppler-qt5/template b/srcpkgs/poppler-qt5/template
index 0dc45c05c58b..c2ec35dbbad3 100644
--- a/srcpkgs/poppler-qt5/template
+++ b/srcpkgs/poppler-qt5/template
@@ -5,7 +5,7 @@
 #
 pkgname=poppler-qt5
 version=20.09.0
-revision=1
+revision=2
 wrksrc="poppler-${version}"
 build_style=cmake
 configure_args="-DENABLE_UNSTABLE_API_ABI_HEADERS=ON -DENABLE_GLIB=OFF

From 66b1f5468350d9224eac19570cc5d70c08172e09 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: Sat, 27 Mar 2021 11:17:35 +0700
Subject: [PATCH 33/53] artyfx: remove -O1 -g

---
 srcpkgs/artyfx/patches/fix-avtk-cmake-sse.patch | 4 ++--
 srcpkgs/artyfx/patches/respect-our-cflags.patch | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/artyfx/patches/fix-avtk-cmake-sse.patch b/srcpkgs/artyfx/patches/fix-avtk-cmake-sse.patch
index 1a832155a566..47ef4dd9b84e 100644
--- a/srcpkgs/artyfx/patches/fix-avtk-cmake-sse.patch
+++ b/srcpkgs/artyfx/patches/fix-avtk-cmake-sse.patch
@@ -6,8 +6,8 @@
  
 -SET(CMAKE_C_FLAGS   "-fPIC -msse -msse2 -mfpmath=sse -g") # -fsanitize=address
 -SET(CMAKE_CXX_FLAGS "-fPIC -msse -msse2 -mfpmath=sse -g") # -fsanitize=address
-+SET(CMAKE_C_FLAGS   "${CMAKE_C_FLAGS} -fPIC -g") # -fsanitize=address
-+SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -g") # -fsanitize=address
++SET(CMAKE_C_FLAGS   "${CMAKE_C_FLAGS} -fPIC") # -fsanitize=address
++SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") # -fsanitize=address
 +
 +IF(BUILD_SSE)
 +	SET(CMAKE_C_FLAGS   "${CMAKE_C_FLAGS} -msse -msse2 -mfpmath=sse")
diff --git a/srcpkgs/artyfx/patches/respect-our-cflags.patch b/srcpkgs/artyfx/patches/respect-our-cflags.patch
index ee9155c7729e..7a32fd9df73b 100644
--- a/srcpkgs/artyfx/patches/respect-our-cflags.patch
+++ b/srcpkgs/artyfx/patches/respect-our-cflags.patch
@@ -10,8 +10,8 @@ Index: CMakeLists.txt
 -SET(CMAKE_C_FLAGS "-g -Wall -O1 -Wno-unused-variable")
 -SET(CMAKE_CXX_FLAGS "-g -Wall -O1 -Wno-unused-variable -ftree-vectorize")
 +SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fPIC -shared -L./src/avtk -Wl,--no-undefined")
-+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -Wall -O1 -Wno-unused-variable")
-+SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -Wall -O1 -Wno-unused-variable -ftree-vectorize")
++SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall  -Wno-unused-variable")
++SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall  -Wno-unused-variable -ftree-vectorize")
  
  
  # DSP sources

From 90813c81627143120b9da7f055a78f40b5b00347 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: Sat, 27 Mar 2021 11:27:28 +0700
Subject: [PATCH 34/53] coin3: build with CMAKE_BUILD_TYPE=None

---
 srcpkgs/coin3/template | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/coin3/template b/srcpkgs/coin3/template
index d5483ee048c3..8f7218c2e8c3 100644
--- a/srcpkgs/coin3/template
+++ b/srcpkgs/coin3/template
@@ -5,7 +5,7 @@ revision=1
 wrksrc="coin-Coin-${version}"
 build_style=cmake
 configure_args="-DCMAKE_INSTALL_INCLUDEDIR=/usr/include/Coin3
- -DCMAKE_BUILD_TYPE=Release -DCOIN_BUILD_TESTS=OFF -DCOIN_BUILD_DOCUMENTATION=ON"
+ -DCOIN_BUILD_TESTS=OFF -DCOIN_BUILD_DOCUMENTATION=ON"
 hostmakedepends="doxygen graphviz"
 makedepends="boost-devel glu-devel"
 short_desc="High-level 3D graphics toolkit"
@@ -15,6 +15,9 @@ homepage="https://coin3d.github.io/"
 distfiles="https://github.com/coin3d/coin/archive/Coin-${version}.tar.gz"
 checksum=b00d2a8e9d962397cf9bf0d9baa81bcecfbd16eef675a98c792f5cf49eb6e805
 
+CFLAGS=-DNDEBUG
+CXXFLAGS=-DNDEBUG
+
 if [ "$CROSS_BUILD" ]; then
 	# bypass runtime test (quote hashing is fine with gcc 9.3)
 	configure_args+=" -DHAVE_HASH_QUOTING_EXITCODE=0"

From 03e8b6fda409a611b61589375149510f1aa29b69 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: Sat, 27 Mar 2021 11:46:46 +0700
Subject: [PATCH 35/53] conky: don't overwrite CMAKE_BUILD_TYPE

---
 srcpkgs/conky/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/conky/template b/srcpkgs/conky/template
index 8b95a628edfb..f05c7d4a1bf2 100644
--- a/srcpkgs/conky/template
+++ b/srcpkgs/conky/template
@@ -5,7 +5,7 @@ version=1.12.1
 revision=1
 build_style=cmake
 conf_files="/etc/conky/conky.conf /etc/conky/conky_no_x11.conf"
-configure_args="-DCMAKE_BUILD_TYPE=Release -DMAINTAINER_MODE=ON -DRELEASE=ON
+configure_args="-DMAINTAINER_MODE=ON -DRELEASE=ON
  -DDOC_PATH=share/doc/${pkgname} -DBUILD_X11=ON -DBUILD_CURL=ON -DBUILD_XDBE=ON
  -DBUILD_RSS=ON -DBUILD_WEATHER_METAR=ON -DBUILD_IMLIB2=ON -DBUILD_WLAN=ON
  -DBUILD_LUA_CAIRO=ON -DBUILD_LUA_IMLIB2=ON -DBUILD_LUA_RSVG=ON

From 3fc9d69a8644d2024ba565ce7b49b69bcfedcd00 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: Sat, 27 Mar 2021 11:46:46 +0700
Subject: [PATCH 36/53] conky-cli: don't overwrite CMAKE_BUILD_TYPE

---
 srcpkgs/conky-cli/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/conky-cli/template b/srcpkgs/conky-cli/template
index b61bdcca0504..7d512b65ab3e 100644
--- a/srcpkgs/conky-cli/template
+++ b/srcpkgs/conky-cli/template
@@ -6,7 +6,7 @@ revision=1
 wrksrc="${pkgname/-cli/}-${version}"
 build_style=cmake
 conf_files="/etc/conky/conky.conf /etc/conky/conky_no_x11.conf"
-configure_args="-DCMAKE_BUILD_TYPE=Release -DMAINTAINER_MODE=ON -DRELEASE=ON
+configure_args="-DMAINTAINER_MODE=ON -DRELEASE=ON
  -DDOC_PATH=share/doc/${pkgname} -DBUILD_X11=OFF -DBUILD_CURL=ON -DBUILD_XDBE=OFF
  -DBUILD_RSS=ON -DBUILD_WEATHER_METAR=OFF -DBUILD_IMLIB2=OFF -DBUILD_WLAN=ON
  -DBUILD_DOCS=ON"

From 1da3b95083e94ba66b44d038a30e9dca677c52d6 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: Sat, 27 Mar 2021 11:48:25 +0700
Subject: [PATCH 37/53] crossguid: don't overwrite -O2

---
 srcpkgs/crossguid/fix-cflags.patch | 12 ++++++++++++
 1 file changed, 12 insertions(+)
 create mode 100644 srcpkgs/crossguid/fix-cflags.patch

diff --git a/srcpkgs/crossguid/fix-cflags.patch b/srcpkgs/crossguid/fix-cflags.patch
new file mode 100644
index 000000000000..983360a07ccf
--- /dev/null
+++ b/srcpkgs/crossguid/fix-cflags.patch
@@ -0,0 +1,12 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -2,7 +2,6 @@ cmake_minimum_required(VERSION 3.5.1)
+ project(CrossGuid)
+ 
+ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake")
+-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3")
+ 
+ option(XG_TESTS "Build test runner" ON)
+ 

From 54080ff581bd2a194f2304f4681bf2e67f13ba32 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: Sat, 27 Mar 2021 12:19:04 +0700
Subject: [PATCH 38/53] rapidjson: define -DNDEBUG

---
 srcpkgs/rapidjson/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/rapidjson/template b/srcpkgs/rapidjson/template
index 8597f8fb2706..99d92702cc9d 100644
--- a/srcpkgs/rapidjson/template
+++ b/srcpkgs/rapidjson/template
@@ -11,7 +11,7 @@ distfiles="https://github.com/miloyip/${pkgname}/archive/v${version}.tar.gz"
 checksum=bf7ced29704a1e696fbccf2a2b4ea068e7774fa37f6d7dd4039d0787f8bed98e
 
 # class-memaccess is required by https://github.com/Tencent/rapidjson/issues/1700
-CXXFLAGS="-Wno-type-limits -Wno-error=class-memaccess"
+CXXFLAGS="-Wno-type-limits -Wno-error=class-memaccess -DNDEBUG"
 
 post_patch() {
 	# Remove bin/jsonchecker, which is the JSON licensed files

From b733a9c7a88e2f7bb97024727723b02e7986faa4 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: Sat, 27 Mar 2021 12:18:36 +0700
Subject: [PATCH 39/53] cura-engine: ignore -O3

---
 srcpkgs/cura-engine/patches/fix-cflags.patch | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 srcpkgs/cura-engine/patches/fix-cflags.patch

diff --git a/srcpkgs/cura-engine/patches/fix-cflags.patch b/srcpkgs/cura-engine/patches/fix-cflags.patch
new file mode 100644
index 000000000000..e48a665523b8
--- /dev/null
+++ b/srcpkgs/cura-engine/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -42,7 +42,7 @@ endif()
+ if(CMAKE_BUILD_TYPE_UPPER MATCHES "DEBUG")
+     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_DEBUG_INIT}")
+ else()
+-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELEASE_INIT}")
++    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DNDEBUG")
+ endif()
+ 
+ set(CMAKE_CXX_STANDARD 11)

From da1b039e5a26db467ae1aff4d5ef82a20a30413d 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: Sat, 27 Mar 2021 12:22:29 +0700
Subject: [PATCH 40/53] dislocker: remove -O1

---
 srcpkgs/dislocker/patches/fix-cflags.patch | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 srcpkgs/dislocker/patches/fix-cflags.patch

diff --git a/srcpkgs/dislocker/patches/fix-cflags.patch b/srcpkgs/dislocker/patches/fix-cflags.patch
new file mode 100644
index 000000000000..1229efeeaf0c
--- /dev/null
+++ b/srcpkgs/dislocker/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: src/CMakeLists.txt
+===================================================================
+--- src/CMakeLists.txt.orig
++++ src/CMakeLists.txt
+@@ -71,7 +71,7 @@ if(NOT DEFINED WARN_FLAGS)
+ 	set (WARN_FLAGS "-Wall -Wextra" CACHE STRING "" FORCE)
+ endif()
+ if(NOT DEFINED HARDEN_FLAGS)
+-	set (HARDEN_FLAGS "-fstack-protector -fstrict-aliasing -D_FORTIFY_SOURCE=2 -O1" CACHE STRING "" FORCE)
++	set (HARDEN_FLAGS "-fstack-protector -fstrict-aliasing" CACHE STRING "" FORCE)
+ endif()
+ 
+ set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")

From d696b037e44e0f8f3a761053b5d457ed6c8bb358 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: Sat, 27 Mar 2021 12:29:31 +0700
Subject: [PATCH 41/53] freeorion: remove -O3

---
 srcpkgs/freeorion/patches/fix-cflags.patch | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
 create mode 100644 srcpkgs/freeorion/patches/fix-cflags.patch

diff --git a/srcpkgs/freeorion/patches/fix-cflags.patch b/srcpkgs/freeorion/patches/fix-cflags.patch
new file mode 100644
index 000000000000..c66d54599556
--- /dev/null
+++ b/srcpkgs/freeorion/patches/fix-cflags.patch
@@ -0,0 +1,18 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -432,13 +432,6 @@ if(MSVC)
+     )
+ endif()
+ 
+-target_compile_options(freeorionparseobj
+-    PRIVATE
+-        $<$<CXX_COMPILER_ID:Clang>:-ftemplate-depth=512>
+-        $<$<CXX_COMPILER_ID:AppleClang>:-ftemplate-depth=512>
+-        $<$<AND:$<NOT:$<BOOL:${BUILD_TESTING}>>,$<CXX_COMPILER_ID:GNU>>:-O3>
+-)
+-
+ target_compile_definitions(freeorionparseobj
+     PUBLIC
+         -DBOOST_ALL_DYN_LINK

From 91f356e7242e1f657c52912c875f0ff96e2d185e 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: Fri, 26 Mar 2021 09:01:12 +0700
Subject: [PATCH 42/53] cglm: fix build flags

---
 srcpkgs/cglm/patches/fix-cflags.patch | 13 +++++++++++++
 srcpkgs/cglm/template                 |  1 +
 2 files changed, 14 insertions(+)
 create mode 100644 srcpkgs/cglm/patches/fix-cflags.patch

diff --git a/srcpkgs/cglm/patches/fix-cflags.patch b/srcpkgs/cglm/patches/fix-cflags.patch
new file mode 100644
index 000000000000..c74de6ea62d7
--- /dev/null
+++ b/srcpkgs/cglm/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: cglm-0.7.6/CMakeLists.txt
+===================================================================
+--- cglm-0.7.6.orig/CMakeLists.txt
++++ cglm-0.7.6/CMakeLists.txt
+@@ -25,7 +25,7 @@ if(MSVC)
+ 	add_definitions(-DNDEBUG -D_WINDOWS -D_USRDLL -DCGLM_EXPORTS -DCGLM_DLL)
+ 	add_compile_options(/W3 /Ox /Gy /Oi /TC)
+ else()
+-  add_compile_options(-Wall -Werror -O3)
++  add_compile_options(-Wall)
+ endif()
+ 
+ if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
diff --git a/srcpkgs/cglm/template b/srcpkgs/cglm/template
index f00a093edab9..311b4c79a7d3 100644
--- a/srcpkgs/cglm/template
+++ b/srcpkgs/cglm/template
@@ -9,6 +9,7 @@ license="MIT"
 homepage="https://github.com/recp/cglm"
 distfiles="https://github.com/recp/cglm/archive/v${version}.tar.gz"
 checksum=29ff8af4edc03697e36d3e6f99a80b884a80ee09d46055ce45765e5d6b2456d9
+patch_args=-Np1
 
 post_install() {
 	vlicense LICENSE

From 17a62c8e0e65e0f9ad5e4f8a307b4306500c4682 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: Sat, 27 Mar 2021 12:36:19 +0700
Subject: [PATCH 43/53] glyr: don't force Release build

---
 srcpkgs/glyr/patches/fix-cflags.patch | 12 ++++++++++++
 1 file changed, 12 insertions(+)
 create mode 100644 srcpkgs/glyr/patches/fix-cflags.patch

diff --git a/srcpkgs/glyr/patches/fix-cflags.patch b/srcpkgs/glyr/patches/fix-cflags.patch
new file mode 100644
index 000000000000..498ffe09a38f
--- /dev/null
+++ b/srcpkgs/glyr/patches/fix-cflags.patch
@@ -0,0 +1,12 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -60,7 +60,6 @@ exec_program(
+ IF(CMAKE_BUILD_TYPE STREQUAL "debug")
+     SET(GLYR_DEBUG TRUE)
+ ELSE()
+-    SET(CMAKE_BUILD_TYPE "release")
+     SET(GLYR_DEBUG FALSE)
+ ENDIF()
+ MESSAGE("-- Building Target: ${CMAKE_BUILD_TYPE}")

From 3835ff6ca73a86bcd48492781c8848303a1684e9 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: Sat, 27 Mar 2021 12:41:50 +0700
Subject: [PATCH 44/53] hugin: remove -O3

---
 srcpkgs/hugin/patches/fix-cflags.patch | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
 create mode 100644 srcpkgs/hugin/patches/fix-cflags.patch

diff --git a/srcpkgs/hugin/patches/fix-cflags.patch b/srcpkgs/hugin/patches/fix-cflags.patch
new file mode 100644
index 000000000000..02fa56bef0e1
--- /dev/null
+++ b/srcpkgs/hugin/patches/fix-cflags.patch
@@ -0,0 +1,15 @@
+Index: src/celeste/CMakeLists.txt
+===================================================================
+--- src/celeste/CMakeLists.txt.orig
++++ src/celeste/CMakeLists.txt
+@@ -16,10 +16,6 @@
+ #    You should have received a copy of the GNU General Public License
+ #    along with Hugin  If not, see <http://www.gnu.org/licenses/>.
+  
+-IF(NOT WIN32)
+-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3")
+-ENDIF(NOT WIN32)
+-
+ # a list of all files belonging to celeste library
+ 
+ SET(CELESTE_SRC

From 3136d268326d0b0165734b46e40b70288c393b0a 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: Sat, 27 Mar 2021 13:05:27 +0700
Subject: [PATCH 45/53] ledger: don't overwrite CMAKE_BUILD_TYPE

---
 srcpkgs/ledger/patches/fix-cflags.patch | 12 ++++++++++++
 1 file changed, 12 insertions(+)
 create mode 100644 srcpkgs/ledger/patches/fix-cflags.patch

diff --git a/srcpkgs/ledger/patches/fix-cflags.patch b/srcpkgs/ledger/patches/fix-cflags.patch
new file mode 100644
index 000000000000..179ab79cd148
--- /dev/null
+++ b/srcpkgs/ledger/patches/fix-cflags.patch
@@ -0,0 +1,12 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -41,7 +41,6 @@ if (BUILD_DEBUG)
+   set(CMAKE_BUILD_TYPE Debug)
+   set(DEBUG_MODE 1)
+ else()
+-  set(CMAKE_BUILD_TYPE Release)
+   set(DEBUG_MODE 0)
+ endif()
+ 

From 8ca408695483d46b50476d60edfc75c1694eb4ea 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: Sat, 27 Mar 2021 13:18:24 +0700
Subject: [PATCH 46/53] libmygpo-qt: remove -ggdb3

---
 srcpkgs/libmygpo-qt/patches/fix-cflags.patch | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 srcpkgs/libmygpo-qt/patches/fix-cflags.patch

diff --git a/srcpkgs/libmygpo-qt/patches/fix-cflags.patch b/srcpkgs/libmygpo-qt/patches/fix-cflags.patch
new file mode 100644
index 000000000000..9940b6fc4323
--- /dev/null
+++ b/srcpkgs/libmygpo-qt/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -69,7 +69,7 @@ if (CMAKE_COMPILER_IS_GNUCXX)
+        -Wwrite-strings -Wpacked -Wformat-security -Wmissing-format-attribute
+        -Wold-style-cast -Woverloaded-virtual -Wnon-virtual-dtor  -Wall -Wextra
+        -Wformat=2 -Wundef -Wstack-protector -Wmissing-include-dirs
+-       -Winit-self -Wunsafe-loop-optimizations  -ggdb3 -fno-inline -DQT_STRICT_ITERATORS )
++       -Winit-self -Wunsafe-loop-optimizations  -fno-inline -DQT_STRICT_ITERATORS )
+     if ( NOT WIN32 )
+         add_definitions( -fvisibility=hidden )
+     endif()

From b23a0e23a7327baed0cc7f8d4291591333dc069f 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: Sat, 27 Mar 2021 13:48:38 +0700
Subject: [PATCH 47/53] libogre: don't build vendored libraries

---
 srcpkgs/libogre/template | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/srcpkgs/libogre/template b/srcpkgs/libogre/template
index 784e3a648bac..6dd88ea08c73 100644
--- a/srcpkgs/libogre/template
+++ b/srcpkgs/libogre/template
@@ -3,11 +3,8 @@ pkgname=libogre
 version=1.12.9
 revision=1
 build_style=cmake
-configure_args="-DCMAKE_INSTALL_PREFIX=/usr \
-	-DOGRE_INSTALL_SAMPLES=TRUE \
-	-DOGRE_INSTALL_DOCS=TRUE \
-	-DOGRE_INSTALL_SAMPLES_SOURCE=TRUE \
-	-DCMAKE_BUILD_TYPE=Release"
+configure_args="-DOGRE_INSTALL_SAMPLES=TRUE -DOGRE_INSTALL_DOCS=TRUE
+ -DOGRE_INSTALL_SAMPLES_SOURCE=TRUE -DOGRE_BUILD_DEPENDENCIES=FALSE"
 hostmakedepends="pkg-config graphviz doxygen dejavu-fonts-ttf"
 makedepends="boost-devel freetype-devel libXaw-devel libXrandr-devel
  MesaLib-devel zziplib-devel libcppunit-devel glu-devel libatomic-devel

From 8f98c1074196a4fe8ce01ca10ad3e5b0ac3b5deb 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: Sat, 27 Mar 2021 13:52:50 +0700
Subject: [PATCH 48/53] libopenglrecorder: remove -O3

---
 srcpkgs/libopenglrecorder/patches/fix-cflags.patch | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 srcpkgs/libopenglrecorder/patches/fix-cflags.patch

diff --git a/srcpkgs/libopenglrecorder/patches/fix-cflags.patch b/srcpkgs/libopenglrecorder/patches/fix-cflags.patch
new file mode 100644
index 000000000000..7c48a0d2d822
--- /dev/null
+++ b/srcpkgs/libopenglrecorder/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -21,7 +21,7 @@ if (UNIX OR MINGW)
+     if (CMAKE_BUILD_TYPE MATCHES Debug)
+         add_definitions(-std=gnu++0x -O0)
+     else()
+-        add_definitions(-std=gnu++0x -O3)
++        add_definitions(-std=gnu++0x)
+     endif()
+ endif()
+ 

From e22405b0d9f79f4a7ab37841ebc59139941bfbce 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: Sat, 27 Mar 2021 13:55:41 +0700
Subject: [PATCH 49/53] libvidstab: remove -O3

---
 srcpkgs/libvidstab/patches/fix-cflags.patch | 39 +++++++++++++++++++++
 1 file changed, 39 insertions(+)
 create mode 100644 srcpkgs/libvidstab/patches/fix-cflags.patch

diff --git a/srcpkgs/libvidstab/patches/fix-cflags.patch b/srcpkgs/libvidstab/patches/fix-cflags.patch
new file mode 100644
index 000000000000..51c357efb101
--- /dev/null
+++ b/srcpkgs/libvidstab/patches/fix-cflags.patch
@@ -0,0 +1,39 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -25,7 +25,7 @@ else()
+     set(LIBSUFFIX "")
+ endif()
+ 
+-add_definitions( -Wall -O3 -g -Wno-pointer-sign -fPIC -std=gnu99)
++add_definitions( -Wall -Wno-pointer-sign -fPIC -std=gnu99)
+ # add_definitions(  -Wall -O0 -g -Wno-pointer-sign )
+ 
+ ### ORC is not used in any active code at the moment  ###
+Index: tests/CMakeLists.txt
+===================================================================
+--- tests/CMakeLists.txt.orig
++++ tests/CMakeLists.txt
+@@ -11,7 +11,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PAT
+ option(USE_OMP "use parallelization use OMP" ON)
+ 
+ #add_definitions( -Wall -O3 -Wno-pointer-sign -DTESTING  -std=gnu99)
+-add_definitions(  -Wall -O0 -g -Wno-pointer-sign -DTESTING -std=gnu99)
++add_definitions(  -Wall -Wno-pointer-sign -DTESTING -std=gnu99)
+ find_package(Orc)
+ if(ORC_FOUND)
+ add_definitions( -DUSE_ORC ${ORC_DEFINITIONS})
+Index: transcode/CMakeLists.txt
+===================================================================
+--- transcode/CMakeLists.txt.orig
++++ transcode/CMakeLists.txt
+@@ -9,7 +9,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PAT
+ set(TRANSCODE_ROOT ../../transcode)
+ 
+ 
+-add_definitions( -Wall -O3 -Wno-pointer-sign -DTRANSCODE -std=gnu99)
++add_definitions( -Wall -Wno-pointer-sign -DTRANSCODE -std=gnu99)
+ #add_definitions(  -Wall -O0 -g -Wno-pointer-sign )
+ # I tried it with 0.4.14
+ #  0.4.10 did not work (not all opcode implemented)

From 76996b6ee1d983b62dadd8ccaa1d0d36207af8c0 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: Sat, 27 Mar 2021 14:18:34 +0700
Subject: [PATCH 50/53] openlierox: don't overwrote CMAKE_BUILD_TYPE

---
 srcpkgs/openlierox/patches/fix-cflags.patch | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
 create mode 100644 srcpkgs/openlierox/patches/fix-cflags.patch

diff --git a/srcpkgs/openlierox/patches/fix-cflags.patch b/srcpkgs/openlierox/patches/fix-cflags.patch
new file mode 100644
index 000000000000..4fe6652fd0a2
--- /dev/null
+++ b/srcpkgs/openlierox/patches/fix-cflags.patch
@@ -0,0 +1,17 @@
+Index: CMakeOlxCommon.cmake
+===================================================================
+--- CMakeOlxCommon.cmake.orig
++++ CMakeOlxCommon.cmake
+@@ -36,12 +36,6 @@ OPTION(BREAKPAD "Google Breakpad support
+ OPTION(DISABLE_JOYSTICK "Disable joystick support" No)
+ OPTION(MINGW_CROSS_COMPILE "Cross-compile Windows .EXE using i686-w64-mingw32-gcc compiler" No)
+ 
+-IF (DEBUG)
+-	SET(CMAKE_BUILD_TYPE Debug)
+-ELSE (DEBUG)
+-	SET(CMAKE_BUILD_TYPE Release)
+-ENDIF (DEBUG)
+-
+ IF (DEDICATED_ONLY)
+ 	SET(X11 No)
+ 	SET(WITH_G15 No)

From b94c3c020ffda6ed82417adf30eaaf93c0ef5d4f 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: Sat, 27 Mar 2021 14:25:12 +0700
Subject: [PATCH 51/53] opensonic: don't overwrite CMAKE_BUILD_TYPE

---
 srcpkgs/opensonic/patches/fix-cflags.patch | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
 create mode 100644 srcpkgs/opensonic/patches/fix-cflags.patch

diff --git a/srcpkgs/opensonic/patches/fix-cflags.patch b/srcpkgs/opensonic/patches/fix-cflags.patch
new file mode 100644
index 000000000000..10d2c7c80e64
--- /dev/null
+++ b/srcpkgs/opensonic/patches/fix-cflags.patch
@@ -0,0 +1,17 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -25,12 +25,10 @@ SET(GAME_NAME "Open Sonic")
+ SET(GAME_VERSION "0.1.4")
+ SET(RTFM "Please read the user manual (readme.html) to get help.")
+ SET(ALLEGRO_RECOMMENDED_VERSION "4.4.1")
+-SET(CMAKE_BUILD_TYPE Release)
+ MESSAGE("${GAME_NAME} version ${GAME_VERSION}")
+ 
+ # configuring...
+ SET(DEFS "")
+-SET(CFLAGS_EXTRA "-g")
+ SET(CFLAGS "${CFLAGS} ${CMAKE_C_FLAGS}")
+ MESSAGE("Using CFLAGS='${CFLAGS}'")
+ 

From a8977d46fe0ffc58ae248aed254580b9e263f108 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: Sat, 27 Mar 2021 15:17:28 +0700
Subject: [PATCH 52/53] rocksdb: don't overwrite CMAKE_BUILD_TYPE

---
 srcpkgs/rocksdb/template | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/rocksdb/template b/srcpkgs/rocksdb/template
index e39329e5d6a6..5a6ca434f29b 100644
--- a/srcpkgs/rocksdb/template
+++ b/srcpkgs/rocksdb/template
@@ -3,8 +3,7 @@ pkgname=rocksdb
 version=5.18.3
 revision=2
 build_style=cmake
-configure_args="-DCMAKE_BUILD_TYPE=Release -DPORTABLE=1 -DWITH_TESTS=0
- -DUSE_RTTI=0 -DWITH_LZ4=1"
+configure_args="-DPORTABLE=1 -DWITH_TESTS=0 -DUSE_RTTI=0 -DWITH_LZ4=1"
 makedepends="liblz4-devel"
 short_desc="RocksDB is a embeddable, persistent key-value store for fast storage"
 maintainer="magenbluten <mb0@codemonkey.cc>"
@@ -12,6 +11,8 @@ license="GPL-2.0-or-later, Apache-2.0"
 homepage="https://github.com/facebook/rocksdb"
 distfiles="${homepage}/archive/v${version}.tar.gz"
 checksum=7fb6738263d3f2b360d7468cf2ebe333f3109f3ba1ff80115abd145d75287254
+CFLAGS=-DNDEBUG
+CXXFLAGS=-DNDEBUG
 
 if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
 	makedepends+=" libatomic-devel"

From 77a508fe68f3c83a9fdea7d94b00794697a08ff7 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: Sat, 27 Mar 2021 15:19:47 +0700
Subject: [PATCH 53/53] rofs-filtered: hardening

---
 srcpkgs/rofs-filtered/patches/fix-cflags.patch | 13 +++++++++++++
 srcpkgs/rofs-filtered/template                 |  2 +-
 2 files changed, 14 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/rofs-filtered/patches/fix-cflags.patch

diff --git a/srcpkgs/rofs-filtered/patches/fix-cflags.patch b/srcpkgs/rofs-filtered/patches/fix-cflags.patch
new file mode 100644
index 000000000000..f64d3274f091
--- /dev/null
+++ b/srcpkgs/rofs-filtered/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -9,7 +9,7 @@ set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PA
+      "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
+ 
+ add_definitions(-D_GNU_SOURCE)
+-set(CMAKE_C_FLAGS "-Wall -std=c99")
++set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -std=c99")
+ 
+ # find fuse library
+ find_package (FUSE REQUIRED)
diff --git a/srcpkgs/rofs-filtered/template b/srcpkgs/rofs-filtered/template
index 332cd57a9902..e585877eaf59 100644
--- a/srcpkgs/rofs-filtered/template
+++ b/srcpkgs/rofs-filtered/template
@@ -1,7 +1,7 @@
 # Template file for 'rofs-filtered'
 pkgname=rofs-filtered
 version=1.7
-revision=1
+revision=2
 build_style=cmake
 makedepends="fuse-devel"
 short_desc="Filtered read only filesystem for FUSE"

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: build-style/cmake: set CMAKE_BUILD_TYPE to None
  2021-03-14 13:19 [PR PATCH] [WIP] build-style/cmake: set CMAKE_BUILD_TYPE to None sgn
                   ` (19 preceding siblings ...)
  2021-03-27  8:23 ` sgn
@ 2021-03-27  8:24 ` sgn
  2021-03-27  8:51 ` [PR PATCH] [Updated] " sgn
                   ` (11 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: sgn @ 2021-03-27  8:24 UTC (permalink / raw)
  To: ml

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

New comment by sgn on void-packages repository

https://github.com/void-linux/void-packages/pull/29459#issuecomment-808689607

Comment:
`rspamd` vendored too much dependencies. I gave up on it.

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PR PATCH] [Updated] build-style/cmake: set CMAKE_BUILD_TYPE to None
  2021-03-14 13:19 [PR PATCH] [WIP] build-style/cmake: set CMAKE_BUILD_TYPE to None sgn
                   ` (20 preceding siblings ...)
  2021-03-27  8:24 ` sgn
@ 2021-03-27  8:51 ` sgn
  2021-03-27 12:30 ` sgn
                   ` (10 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: sgn @ 2021-03-27  8:51 UTC (permalink / raw)
  To: ml

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

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

https://github.com/sgn/void-packages cmake-build-type-to-None
https://github.com/void-linux/void-packages/pull/29459

build-style/cmake: set CMAKE_BUILD_TYPE to None
- I'm going to build all packages with `build_style=cmake` and fix them one by one before merging this in.

[ci skip]

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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-cmake-build-type-to-None-29459.patch --]
[-- Type: text/x-diff, Size: 104114 bytes --]

From 55db3b4b32ca39f77aae5cc1d839ba275616d05a 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, 14 Mar 2021 20:18:03 +0700
Subject: [PATCH 01/55] build-style/cmake: set CMAKE_BUILD_TYPE to None

---
 common/build-style/cmake.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/build-style/cmake.sh b/common/build-style/cmake.sh
index 5100a96dfd7b..9d1a1a7a1941 100644
--- a/common/build-style/cmake.sh
+++ b/common/build-style/cmake.sh
@@ -52,7 +52,7 @@ _EOF
 		cmake_args+=" -DCMAKE_TOOLCHAIN_FILE=cross_${XBPS_CROSS_TRIPLET}.cmake"
 	fi
 	cmake_args+=" -DCMAKE_INSTALL_PREFIX=/usr"
-	cmake_args+=" -DCMAKE_BUILD_TYPE=Release"
+	cmake_args+=" -DCMAKE_BUILD_TYPE=None"
 	cmake_args+=" -DCMAKE_INSTALL_LIBDIR=lib${XBPS_TARGET_WORDSIZE}"
 
 	if [[ $build_helper = *"qemu"* ]]; then

From 69b4670a7e9a0711508e4c9b86ec00add865621b 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: Mon, 15 Mar 2021 08:07:16 +0700
Subject: [PATCH 02/55] amdvlk: allow CMAKE_BUILD_TYPE=None

---
 .../patches/cmake-build-type-none.patch       | 60 +++++++++++++++++++
 1 file changed, 60 insertions(+)
 create mode 100644 srcpkgs/amdvlk/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/amdvlk/patches/cmake-build-type-none.patch b/srcpkgs/amdvlk/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..7a629e58548e
--- /dev/null
+++ b/srcpkgs/amdvlk/patches/cmake-build-type-none.patch
@@ -0,0 +1,60 @@
+Index: llvm-project/llvm/CMakeLists.txt
+===================================================================
+--- llvm-project/llvm/CMakeLists.txt.orig
++++ llvm-project/llvm/CMakeLists.txt
+@@ -251,11 +251,6 @@ endif()
+ 
+ string(TOUPPER "${CMAKE_BUILD_TYPE}" uppercase_CMAKE_BUILD_TYPE)
+ 
+-if (CMAKE_BUILD_TYPE AND
+-    NOT uppercase_CMAKE_BUILD_TYPE MATCHES "^(DEBUG|RELEASE|RELWITHDEBINFO|MINSIZEREL)$")
+-  message(FATAL_ERROR "Invalid value for CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
+-endif()
+-
+ set(LLVM_LIBDIR_SUFFIX "" CACHE STRING "Define suffix of library directory name (32/64)" )
+ 
+ set(LLVM_TOOLS_INSTALL_DIR "bin" CACHE STRING "Path for binary subdirectory (defaults to 'bin')")
+Index: pal/cmake/Modules/AmdCmakeHelper.cmake
+===================================================================
+--- pal/cmake/Modules/AmdCmakeHelper.cmake.orig
++++ pal/cmake/Modules/AmdCmakeHelper.cmake
+@@ -37,11 +37,6 @@ if (CMAKE_CONFIGURATION_TYPES)
+ else()
+     string(TOUPPER "${CMAKE_BUILD_TYPE}" capital_CMAKE_BUILD_TYPE)
+ 
+-    if (CMAKE_BUILD_TYPE AND
+-        NOT capital_CMAKE_BUILD_TYPE MATCHES "^(DEBUG|RELEASE|RELWITHDEBINFO|MINSIZEREL)$")
+-        message(FATAL_ERROR "Invalid value for CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
+-    endif()
+-
+     if(capital_CMAKE_BUILD_TYPE STREQUAL "DEBUG")
+         set(CMAKE_BUILD_TYPE_DEBUG ON)
+         set(CMAKE_BUILD_TYPE_RELEASE OFF)
+Index: xgl/CMakeLists.txt
+===================================================================
+--- xgl/CMakeLists.txt.orig
++++ xgl/CMakeLists.txt
+@@ -181,11 +181,6 @@ if (CMAKE_CONFIGURATION_TYPES)
+ else()
+     string(TOUPPER "${CMAKE_BUILD_TYPE}" capital_CMAKE_BUILD_TYPE)
+ 
+-    if (CMAKE_BUILD_TYPE AND
+-        NOT capital_CMAKE_BUILD_TYPE MATCHES "^(DEBUG|RELEASE|RELWITHDEBINFO|MINSIZEREL)$")
+-        message(FATAL_ERROR "Invalid value for CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
+-    endif()
+-
+     if(capital_CMAKE_BUILD_TYPE STREQUAL "DEBUG")
+         set(CMAKE_BUILD_TYPE_DEBUG ON)
+         set(CMAKE_BUILD_TYPE_RELEASE OFF)
+Index: xgl/icd/CMakeLists.txt
+===================================================================
+--- xgl/icd/CMakeLists.txt.orig
++++ xgl/icd/CMakeLists.txt
+@@ -84,7 +84,6 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Cl
+     endif()
+ 
+     if(CMAKE_BUILD_TYPE_RELEASE)
+-        target_compile_options(xgl PRIVATE -O3)
+         if(XGL_ENABLE_LTO)
+             if(${CMAKE_CXX_COMPILER_ID} MATCHES "GNU")
+                 execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION)

From 8b11bab2f08c4249907f06feb14f43d234eb3e13 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: Wed, 17 Mar 2021 06:24:04 +0700
Subject: [PATCH 03/55] eigen*: set CMAKE_BUILD_TYPE to Release

We're going to set default CMAKE_BUILD_TYPE to None soon. Those packages
are header only libraries, no need to waste time on patching.
---
 srcpkgs/eigen/template    | 1 +
 srcpkgs/eigen3.2/template | 1 +
 2 files changed, 2 insertions(+)

diff --git a/srcpkgs/eigen/template b/srcpkgs/eigen/template
index ee825e95f273..072228c16915 100644
--- a/srcpkgs/eigen/template
+++ b/srcpkgs/eigen/template
@@ -3,6 +3,7 @@ pkgname=eigen
 version=3.3.9
 revision=1
 build_style=cmake
+configure_args="-DCMAKE_BUILD_TYPE=Release"
 short_desc="C++ template library for linear algebra (version 3.x)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MPL-2.0, GPL-3.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
diff --git a/srcpkgs/eigen3.2/template b/srcpkgs/eigen3.2/template
index 5715fc1b3a19..7b710534b5e5 100644
--- a/srcpkgs/eigen3.2/template
+++ b/srcpkgs/eigen3.2/template
@@ -4,6 +4,7 @@ version=3.2.10
 revision=3
 wrksrc="eigen-${version}"
 build_style=cmake
+configure_args="-DCMAKE_BUILD_TYPE=Release"
 short_desc="C++ template library for linear algebra (version 3.x)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MPL-2.0, GPL-3.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"

From b8efabf7c89056d3e1f16955efb152b725c8c725 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: Wed, 17 Mar 2021 07:04:48 +0700
Subject: [PATCH 04/55] embree: don't ignore CXXFLAGS, fix build with ispc
 1.13+

---
 .../embree/patches/uintNN-is-part-of-ispc-1.13.patch | 12 ++++++++++++
 srcpkgs/embree/template                              |  6 ++----
 2 files changed, 14 insertions(+), 4 deletions(-)
 create mode 100644 srcpkgs/embree/patches/uintNN-is-part-of-ispc-1.13.patch

diff --git a/srcpkgs/embree/patches/uintNN-is-part-of-ispc-1.13.patch b/srcpkgs/embree/patches/uintNN-is-part-of-ispc-1.13.patch
new file mode 100644
index 000000000000..5d0b02f3b2e5
--- /dev/null
+++ b/srcpkgs/embree/patches/uintNN-is-part-of-ispc-1.13.patch
@@ -0,0 +1,12 @@
+Index: embree-2.17.7/tutorials/common/common.isph
+===================================================================
+--- embree-2.17.7.orig/tutorials/common/common.isph
++++ embree-2.17.7/tutorials/common/common.isph
+@@ -16,7 +16,3 @@
+ 
+ #pragma once
+ 
+-typedef unsigned int64 uint64;
+-typedef unsigned int32 uint32;
+-typedef unsigned int16 uint16;
+-typedef unsigned int8  uint8;
diff --git a/srcpkgs/embree/template b/srcpkgs/embree/template
index 0bc72f46b6d8..849ec3c26c1d 100644
--- a/srcpkgs/embree/template
+++ b/srcpkgs/embree/template
@@ -4,6 +4,7 @@ version=2.17.7
 revision=2
 archs="x86_64"
 build_style=cmake
+configure_args="-DTBB_ROOT=/usr -DEMBREE_IGNORE_CMAKE_CXX_FLAGS=OFF"
 hostmakedepends="ispc"
 makedepends="libfreeglut-devel libXmu-devel tbb-devel MesaLib-devel libpng-devel
  libopenexr-devel libjpeg-turbo-devel libmagick-devel"
@@ -13,10 +14,7 @@ license="Apache-2.0"
 homepage="https://embree.github.io/"
 distfiles="https://github.com/$pkgname/$pkgname/archive/v$version.tar.gz"
 checksum=c0694f287fa1fbb382aba3a895702e248d92f7e89c0e5f64aefee965482ec04c
-
-nopie=y
-
-configure_args="-DTBB_ROOT=/usr -DENABLE_TUTORIALS=OFF"
+patch_args=-Np1
 
 embree-devel_package() {
 	depends="${sourcepkg}>=${version}_${revision}"

From d6ffe21ebc7b3e3f5652d81cc974630449381baf 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: Wed, 17 Mar 2021 07:35:19 +0700
Subject: [PATCH 05/55] ettercap: remove libressl patch, CMAKE_BUILD_TYPE=None

---
 .../patches/allow-build-type-none.patch       | 24 ++++++++++++++
 srcpkgs/ettercap/patches/libressl.patch       | 31 -------------------
 srcpkgs/ettercap/template                     |  9 ++++--
 3 files changed, 31 insertions(+), 33 deletions(-)
 create mode 100644 srcpkgs/ettercap/patches/allow-build-type-none.patch
 delete mode 100644 srcpkgs/ettercap/patches/libressl.patch

diff --git a/srcpkgs/ettercap/patches/allow-build-type-none.patch b/srcpkgs/ettercap/patches/allow-build-type-none.patch
new file mode 100644
index 000000000000..324d75086b05
--- /dev/null
+++ b/srcpkgs/ettercap/patches/allow-build-type-none.patch
@@ -0,0 +1,24 @@
+Index: ettercap-0.8.3.1/CMakeLists.txt
+===================================================================
+--- ettercap-0.8.3.1.orig/CMakeLists.txt
++++ ettercap-0.8.3.1/CMakeLists.txt
+@@ -22,19 +22,6 @@ option(LIBRARY_BUILD "Build for libetter
+ option(INSTALL_DESKTOP "Install ettercap desktop files" ON)
+ 
+ 
+-set(VALID_BUILD_TYPES Debug Release RelWithDebInfo)
+-
+-if(NOT CMAKE_BUILD_TYPE)
+-  # Default to using "Release" as our build type.
+-  set(CMAKE_BUILD_TYPE "Release" CACHE STRING
+-    "Choose the type of build, options are: ${VALID_BUILD_TYPES}." FORCE)
+-endif()
+-list(FIND VALID_BUILD_TYPES ${CMAKE_BUILD_TYPE} contains_valid)
+-if(contains_valid EQUAL -1)
+-  message(FATAL_ERROR "Unknown CMAKE_BUILD_TYPE: '${CMAKE_BUILD_TYPE}'. Valid options are: ${VALID_BUILD_TYPES}")
+-endif()
+-unset(contains_valid)
+-
+ include(CMakeDependentOption)
+ 
+ # If SYSTEM_LIBS is set to off, then all SYSTEM_* options will be
diff --git a/srcpkgs/ettercap/patches/libressl.patch b/srcpkgs/ettercap/patches/libressl.patch
deleted file mode 100644
index 15e0d3c1c9e7..000000000000
--- a/srcpkgs/ettercap/patches/libressl.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From b2f7634c9dbc0ef68640f0571787d92300e9f9f9 Mon Sep 17 00:00:00 2001
-From: Stefan Strogin <stefan@steils.org>
-Date: Sat, 15 Aug 2020 07:18:31 +0300
-Subject: [PATCH] ec_sslwrap: fix compilation with LibreSSL
-
-Disable taking over SNI extension from ClientHello and SSL configuration
-operations until LibreSSL supports the required API.
-
-Fixes: https://github.com/Ettercap/ettercap/issues/1068
----
- src/ec_sslwrap.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git src/ec_sslwrap.c src/ec_sslwrap.c
-index b9f26a142..1e4c24fc1 100644
---- src/ec_sslwrap.c
-+++ src/ec_sslwrap.c
-@@ -71,11 +71,11 @@
- #define TLS_server_method SSLv23_server_method
- #endif
- 
--#if (OPENSSL_VERSION_NUMBER >= 0x10100000L)
-+#if (OPENSSL_VERSION_NUMBER >= 0x10100000L) && !defined(LIBRESSL_VERSION_NUMBER)
- #define HAVE_OPENSSL_1_1_0
- #endif
- 
--#if (OPENSSL_VERSION_NUMBER >= 0x10101000L)
-+#if (OPENSSL_VERSION_NUMBER >= 0x10101000L) && !defined(LIBRESSL_VERSION_NUMBER)
- #define HAVE_OPENSSL_1_1_1
- #endif
- 
diff --git a/srcpkgs/ettercap/template b/srcpkgs/ettercap/template
index 7fe4c340a079..611b4e9aded7 100644
--- a/srcpkgs/ettercap/template
+++ b/srcpkgs/ettercap/template
@@ -3,8 +3,8 @@ pkgname=ettercap
 version=0.8.3.1
 revision=2
 build_style=cmake
-configure_args="-DENABLE_GTK=OFF"
-hostmakedepends="flex"
+configure_args="-DENABLE_GTK=OFF -DBUNDLED_LIBS=OFF"
+hostmakedepends="flex pkg-config"
 makedepends="geoip-devel ncurses-devel openssl-devel libcurl-devel
  libltdl-devel libnet-devel libpcap-devel pcre-devel"
 conf_files="/etc/${pkgname}/etter.conf"
@@ -15,5 +15,10 @@ homepage="http://ettercap.github.com/ettercap/"
 distfiles="https://github.com/Ettercap/ettercap/archive/v${version}.tar.gz"
 checksum=d0c3ef88dfc284b61d3d5b64d946c1160fd04276b448519c1ae4438a9cdffaf3
 lib32disabled=yes
+patch_args=-Np1
 
 CFLAGS="-fcommon"
+
+post_extract() {
+	rm -rf bundled_deps
+}

From e21005d53cfdb11658e9f4109934769a5612c9ef 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: Wed, 17 Mar 2021 08:27:10 +0700
Subject: [PATCH 06/55] injeqt: disable coverage

---
 srcpkgs/injeqt/template | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/injeqt/template b/srcpkgs/injeqt/template
index 1e5777fc0f18..78eba09a0249 100644
--- a/srcpkgs/injeqt/template
+++ b/srcpkgs/injeqt/template
@@ -3,7 +3,8 @@ pkgname=injeqt
 version=1.2.0
 revision=2
 build_style=cmake
-hostmakedepends="pkg-config"
+configure_args="-DDISABLE_COVERAGE=ON"
+hostmakedepends="pkg-config qt5-qmake qt5-host-tools"
 makedepends="qt5-devel"
 short_desc="Dependency injection framework for Qt"
 maintainer="Jürgen Buchmüller <pullmoll@t-online.de>"
@@ -12,9 +13,6 @@ homepage="https://github.com/vogel/injeqt/"
 distfiles="https://github.com/vogel/${pkgname}/archive/${version}.tar.gz>${pkgname}-${version}.tar.gz"
 checksum=77540cedb0b26affe993dd18124d796059e34c80a51d9ae6433fdff1860db135
 
-if [ -n "$CROSS_BUILD" ]; then
-	hostmakedepends+=" qt5-host-tools qt5-devel"
-fi
 CXXFLAGS="-fno-lifetime-dse -Wno-error=cast-align"
 
 injeqt-devel_package() {

From 7500ce845b31acf5d0d005a07f8c7cf9e4c0f6a0 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: Wed, 17 Mar 2021 22:26:37 +0700
Subject: [PATCH 07/55] kindd: build with CMAKE_BUILD_TYPE=None

---
 srcpkgs/kindd/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/kindd/template b/srcpkgs/kindd/template
index e634b0f69bf6..4416041de58c 100644
--- a/srcpkgs/kindd/template
+++ b/srcpkgs/kindd/template
@@ -15,7 +15,7 @@ distfiles="${homepage}/archive/${version}.tar.gz"
 checksum=e596f1b1577ff3e83a779e6181252ae2f09731f513d17dd6b95cbc2cf204654f
 
 do_install() {
-	vbin release/kindd
+	vbin build/core/kindd
 	vinstall assets/appconf/kindd.svg 644 usr/share/pixmaps
 	vinstall assets/appconf/kindd.desktop 644 usr/share/applications
 }

From d6666ee1e6987563f13a1b7b918f0fab75a21f4a 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: Thu, 18 Mar 2021 23:58:53 +0700
Subject: [PATCH 08/55] occt: allow CMAKE_BUILD_TYPE=None

---
 srcpkgs/occt/patches/cmake-build-type-none.patch | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 srcpkgs/occt/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/occt/patches/cmake-build-type-none.patch b/srcpkgs/occt/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..acb06fb55766
--- /dev/null
+++ b/srcpkgs/occt/patches/cmake-build-type-none.patch
@@ -0,0 +1,13 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -4,7 +4,7 @@ set (CMAKE_MODULE_PATH "${CMAKE_SOURCE_D
+ 
+ set (CMAKE_SUPPRESS_REGENERATION TRUE)
+ 
+-set (CMAKE_CONFIGURATION_TYPES Release Debug RelWithDebInfo CACHE INTERNAL "" FORCE)
++set (CMAKE_CONFIGURATION_TYPES None Release Debug RelWithDebInfo CACHE INTERNAL "" FORCE)
+ 
+ # macro: include patched file if it exists
+ macro (OCCT_INCLUDE_CMAKE_FILE BEING_INCLUDED_FILE)

From 57901f747262b182fe0dbed11788b788d63fb699 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: Fri, 19 Mar 2021 23:07:05 +0700
Subject: [PATCH 09/55] renderdoc: devendor zstd, lz4

---
 .../patches/build-type-none-is-release.patch  | 12 ++++
 .../renderdoc/patches/qmake-no-rpath.patch    | 13 ++++
 .../renderdoc/patches/unvendor-zstd-lz4.patch | 68 +++++++++++++++++++
 srcpkgs/renderdoc/template                    | 15 ++--
 4 files changed, 99 insertions(+), 9 deletions(-)
 create mode 100644 srcpkgs/renderdoc/patches/build-type-none-is-release.patch
 create mode 100644 srcpkgs/renderdoc/patches/qmake-no-rpath.patch
 create mode 100644 srcpkgs/renderdoc/patches/unvendor-zstd-lz4.patch

diff --git a/srcpkgs/renderdoc/patches/build-type-none-is-release.patch b/srcpkgs/renderdoc/patches/build-type-none-is-release.patch
new file mode 100644
index 000000000000..f16b944bc12c
--- /dev/null
+++ b/srcpkgs/renderdoc/patches/build-type-none-is-release.patch
@@ -0,0 +1,12 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -315,6 +315,7 @@ set(RELEASE_MODE 0)
+ 
+ if(cmake_build_type_lower STREQUAL "release" OR
+    cmake_build_type_lower STREQUAL "relwithdebinfo" OR
++   cmake_build_type_lower STREQUAL "none" OR
+    cmake_build_type_lower STREQUAL "minsizerel")
+     add_definitions(-D_RELEASE)
+     message(STATUS "Building RenderDoc in Release mode: ${CMAKE_BUILD_TYPE}")
diff --git a/srcpkgs/renderdoc/patches/qmake-no-rpath.patch b/srcpkgs/renderdoc/patches/qmake-no-rpath.patch
new file mode 100644
index 000000000000..6e6325c53555
--- /dev/null
+++ b/srcpkgs/renderdoc/patches/qmake-no-rpath.patch
@@ -0,0 +1,13 @@
+Index: qrenderdoc/CMakeLists.txt
+===================================================================
+--- qrenderdoc/CMakeLists.txt.orig
++++ qrenderdoc/CMakeLists.txt
+@@ -144,7 +144,7 @@ endif()
+ # and finding dependencies from the cmake build
+ file(WRITE
+      ${CMAKE_BINARY_DIR}/qrenderdoc/qrenderdoc_cmake.pri
+-     "CONFIG+=${QMAKE_CONFIG}\n"
++     "CONFIG+=${QMAKE_CONFIG} no_qt_rpath\n"
+      "\n"
+      "QMAKE_CC=${CMAKE_C_COMPILER}\n"
+      "QMAKE_CXX=${CMAKE_CXX_COMPILER}\n"
diff --git a/srcpkgs/renderdoc/patches/unvendor-zstd-lz4.patch b/srcpkgs/renderdoc/patches/unvendor-zstd-lz4.patch
new file mode 100644
index 000000000000..d4003ded9161
--- /dev/null
+++ b/srcpkgs/renderdoc/patches/unvendor-zstd-lz4.patch
@@ -0,0 +1,68 @@
+Index: renderdoc/CMakeLists.txt
+===================================================================
+--- renderdoc/CMakeLists.txt.orig
++++ renderdoc/CMakeLists.txt
+@@ -213,54 +213,10 @@ set(sources
+     3rdparty/pugixml/pugixml.cpp
+     3rdparty/pugixml/pugixml.hpp
+     3rdparty/pugixml/pugiconfig.hpp
+-    3rdparty/lz4/lz4.c
+-    3rdparty/lz4/lz4.h
+     3rdparty/miniz/miniz.c
+     3rdparty/miniz/miniz.h
+     3rdparty/superluminal/superluminal.cpp
+     3rdparty/superluminal/superluminal.h
+-    3rdparty/zstd/bitstream.h
+-    3rdparty/zstd/compiler.h
+-    3rdparty/zstd/cpu.h
+-    3rdparty/zstd/debug.c
+-    3rdparty/zstd/debug.h
+-    3rdparty/zstd/entropy_common.c
+-    3rdparty/zstd/error_private.c
+-    3rdparty/zstd/error_private.h
+-    3rdparty/zstd/fse.h
+-    3rdparty/zstd/fse_compress.c
+-    3rdparty/zstd/fse_decompress.c
+-    3rdparty/zstd/hist.c
+-    3rdparty/zstd/hist.h
+-    3rdparty/zstd/huf.h
+-    3rdparty/zstd/huf_compress.c
+-    3rdparty/zstd/huf_decompress.c
+-    3rdparty/zstd/mem.h
+-    3rdparty/zstd/pool.c
+-    3rdparty/zstd/pool.h
+-    3rdparty/zstd/threading.c
+-    3rdparty/zstd/threading.h
+-    3rdparty/zstd/xxhash.c
+-    3rdparty/zstd/xxhash.h
+-    3rdparty/zstd/zstd.h
+-    3rdparty/zstd/zstd_common.c
+-    3rdparty/zstd/zstd_compress.c
+-    3rdparty/zstd/zstd_compress_internal.h
+-    3rdparty/zstd/zstd_decompress.c
+-    3rdparty/zstd/zstd_double_fast.c
+-    3rdparty/zstd/zstd_double_fast.h
+-    3rdparty/zstd/zstd_errors.h
+-    3rdparty/zstd/zstd_fast.c
+-    3rdparty/zstd/zstd_fast.h
+-    3rdparty/zstd/zstd_internal.h
+-    3rdparty/zstd/zstd_lazy.c
+-    3rdparty/zstd/zstd_lazy.h
+-    3rdparty/zstd/zstd_ldm.c
+-    3rdparty/zstd/zstd_ldm.h
+-    3rdparty/zstd/zstd_opt.c
+-    3rdparty/zstd/zstd_opt.h
+-    3rdparty/zstd/zstdmt_compress.c
+-    3rdparty/zstd/zstdmt_compress.h
+     3rdparty/stb/stb_image.h
+     3rdparty/stb/stb_image_write.h
+     3rdparty/stb/stb_image_resize.h
+@@ -271,6 +227,8 @@ set(sources
+     3rdparty/tinyfiledialogs/tinyfiledialogs.c
+     3rdparty/tinyfiledialogs/tinyfiledialogs.h)
+ 
++list(APPEND RDOC_LIBRARIES -llz4 -lzstd)
++
+ if(ANDROID)
+     list(APPEND sources
+         data/embedded_files.h
diff --git a/srcpkgs/renderdoc/template b/srcpkgs/renderdoc/template
index 7240e9ebc307..4615d45c52c9 100644
--- a/srcpkgs/renderdoc/template
+++ b/srcpkgs/renderdoc/template
@@ -1,13 +1,14 @@
 # Template file for 'renderdoc'
 pkgname=renderdoc
 version=1.12
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DENABLE_GL=ON -DENABLE_GLES=ON -DENABLE_QRENDERDOC=ON
  -DENABLE_RENDERDOCCMD=ON -DENABLE_VULKAN=ON -DENABLE_XCB=ON -DENABLE_XLIB=ON
  -DENABLE_PYRENDERDOC=ON"
-hostmakedepends="bison autoconf automake pkg-config python3"
+hostmakedepends="bison autoconf automake pkg-config python3 swig"
 makedepends="libX11-devel libxcb-devel xcb-util-keysyms-devel qt5-devel
+ libzstd-devel liblz4-devel
  qt5-svg-devel qt5-x11extras-devel pcre-devel python3-devel"
 short_desc="Stand-alone graphics debugging tool for Vulkan and OpenGL"
 maintainer="Urs Schulz <voidpkgs@ursschulz.de>"
@@ -19,19 +20,14 @@ checksum=4dece1b4cb859a76533b28fcd50e17321acfaa81c3435500a006c4a5ba15fddb
 if [ "$XBPS_TARGET_LIBC" = musl ]; then
 	makedepends+=" libexecinfo-devel"
 	LDLIBS="-lexecinfo"
+	broken="uses RTLD_DL_LINKMAP, RTLD_DEEPBIND, _r_debug"
 fi
 
 if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
 	makedepends+=" libatomic-devel"
 fi
 
-case "$XBPS_TARGET_MACHINE" in
-	*-musl) broken="uses RTLD_DL_LINKMAP, RTLD_DEEPBIND, _r_debug" ;;
-esac
-
-if [ "$CROSS_BUILD" ]; then
-	broken="Cross-compilation can't find python3 interpreter"
-fi
+nocross="Cross-compilation can't find python3 interpreter"
 
 post_patch() {
 	[ -z "$XBPS_TARGET_NO_ATOMIC8" ] && return 0
@@ -40,4 +36,5 @@ post_patch() {
 
 post_install() {
 	vlicense LICENSE.md
+	vlicense docs/credits_acknowledgements.rst
 }

From 70b3adf4d48c8a8897ae88a92f6be0dd58235a2d 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: Sat, 20 Mar 2021 00:47:52 +0700
Subject: [PATCH 10/55] python3-occ: build with CMAKE_BUILD_TYPE=None

---
 srcpkgs/python3-occ/template | 1 +
 1 file changed, 1 insertion(+)

diff --git a/srcpkgs/python3-occ/template b/srcpkgs/python3-occ/template
index 705f37457943..3ea0ef5e6387 100644
--- a/srcpkgs/python3-occ/template
+++ b/srcpkgs/python3-occ/template
@@ -5,6 +5,7 @@ revision=1
 archs="i686* x86_64* armv7l* aarch64* ppc*"
 wrksrc="pythonocc-core-${version}"
 build_style=cmake
+configure_args="-DPYTHONOCC_BUILD_TYPE=None -DCMAKE_BUILD_TYPE=None"
 hostmakedepends="python3 swig"
 makedepends="python3-devel occt-devel freetype-devel swig"
 depends="python3 occt freetype"

From 31c72be771839b04988425633e262b0ea0924ccb 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: Fri, 19 Mar 2021 23:38:10 +0700
Subject: [PATCH 11/55] widelands: allow CMAKE_BUILD_TYPE=None

---
 srcpkgs/widelands-data                        |  1 -
 .../patches/cmake-build-type-none.patch       | 63 +++++++++++++++++++
 .../widelands/patches/fix-install-path.patch  | 40 ++++++++++++
 srcpkgs/widelands/template                    | 21 +------
 4 files changed, 105 insertions(+), 20 deletions(-)
 delete mode 120000 srcpkgs/widelands-data
 create mode 100644 srcpkgs/widelands/patches/cmake-build-type-none.patch
 create mode 100644 srcpkgs/widelands/patches/fix-install-path.patch

diff --git a/srcpkgs/widelands-data b/srcpkgs/widelands-data
deleted file mode 120000
index e9fbf89517f2..000000000000
--- a/srcpkgs/widelands-data
+++ /dev/null
@@ -1 +0,0 @@
-widelands
\ No newline at end of file
diff --git a/srcpkgs/widelands/patches/cmake-build-type-none.patch b/srcpkgs/widelands/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..3d210854741b
--- /dev/null
+++ b/srcpkgs/widelands/patches/cmake-build-type-none.patch
@@ -0,0 +1,63 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -202,7 +202,7 @@ elseif(CMAKE_BUILD_TYPE STREQUAL "RelWit
+   set(WL_DEBUG_FLAGS "-DNDEBUG -DNOPARACHUTE")
+   option(OPTION_ASAN "Build with AddressSanitizer" ON)
+ else()
+-  message(FATAL_ERROR "Unknown CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
++  set(WL_DEBUG_FLAGS "-DNDEBUG -DNOPARACHUTE")
+ endif()
+ 
+ wl_add_flag(WL_GENERIC_CXX_FLAGS "-std=c++11")
+@@ -353,7 +353,7 @@ endif (OPTION_BUILD_TESTS)
+ install (
+   FILES ${CMAKE_CURRENT_BINARY_DIR}/VERSION
+   DESTINATION ${WL_INSTALL_BASEDIR}
+-  CONFIGURATIONS Debug;Release
++  CONFIGURATIONS Debug
+   COMPONENT CoreVersionFile
+ )
+ 
+@@ -378,7 +378,6 @@ install(
+     data/txts
+     data/world
+   DESTINATION ${WL_INSTALL_DATADIR}
+-  CONFIGURATIONS Debug;Release
+   COMPONENT CoreDataFiles
+ )
+ 
+@@ -386,7 +385,6 @@ install(
+   DIRECTORY
+     data/maps
+   DESTINATION ${WL_INSTALL_DATADIR}
+-  CONFIGURATIONS Debug;Release
+   COMPONENT MapFiles
+ )
+ 
+@@ -395,7 +393,6 @@ install(
+     data/music
+     data/sound
+   DESTINATION ${WL_INSTALL_DATADIR}
+-  CONFIGURATIONS Debug;Release
+   COMPONENT MusicFiles
+ )
+ 
+@@ -405,7 +402,7 @@ install(
+     CREDITS
+     ChangeLog
+   DESTINATION ${WL_INSTALL_BASEDIR}
+-  CONFIGURATIONS Debug;Release
++  CONFIGURATIONS Debug
+   COMPONENT CoreLicenseFiles
+ )
+ 
+@@ -424,7 +421,6 @@ install(
+   DIRECTORY
+     ${CMAKE_CURRENT_BINARY_DIR}/locale/
+   DESTINATION ${WL_INSTALL_DATADIR}/locale
+-  CONFIGURATIONS Debug;Release
+   COMPONENT CoreLanguageFiles
+ )
+ 
diff --git a/srcpkgs/widelands/patches/fix-install-path.patch b/srcpkgs/widelands/patches/fix-install-path.patch
new file mode 100644
index 000000000000..6bb461389f03
--- /dev/null
+++ b/srcpkgs/widelands/patches/fix-install-path.patch
@@ -0,0 +1,40 @@
+Index: cmake/WlFunctions.cmake
+===================================================================
+--- cmake/WlFunctions.cmake.orig
++++ cmake/WlFunctions.cmake
+@@ -289,5 +289,5 @@ function(wl_binary NAME)
+ 
+   #Quoting the CMake documentation on DESTINATION:
+   #"If a relative path is given it is interpreted relative to the value of CMAKE_INSTALL_PREFIX"
+-  install(TARGETS ${NAME} DESTINATION "." COMPONENT ExecutableFiles)
++  install(TARGETS ${NAME} DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT ExecutableFiles)
+ endfunction()
+Index: xdg/CMakeLists.txt
+===================================================================
+--- xdg/CMakeLists.txt.orig
++++ xdg/CMakeLists.txt
+@@ -6,19 +6,19 @@ set(XDG_APPLICATION_ID "org.widelands.Wi
+ list(APPEND icon_sizes "16" "32" "48" "64" "128")
+ foreach (icon_size ${icon_sizes})
+   #install(FILES ${CMAKE_SOURCE_DIR}/data/images/logos/wl-ico-${icon_size}.png DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/${icon_size}x${icon_size}/apps RENAME ${XDG_APPLICATION_ID}.png)
+-  install(FILES ${CMAKE_SOURCE_DIR}/data/images/logos/wl-ico-${icon_size}.png DESTINATION ../share/icons/hicolor/${icon_size}x${icon_size}/apps RENAME ${XDG_APPLICATION_ID}.png)
++  install(FILES ${CMAKE_SOURCE_DIR}/data/images/logos/wl-ico-${icon_size}.png DESTINATION share/icons/hicolor/${icon_size}x${icon_size}/apps RENAME ${XDG_APPLICATION_ID}.png)
+ endforeach (icon_size ${icon_sizes})
+ #install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${CMAKE_PROJECT_NAME}.6           DESTINATION ${CMAKE_INSTALL_MANDIR}/man6)
+-install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${CMAKE_PROJECT_NAME}.6           DESTINATION ../share/man/man6)
++install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${CMAKE_PROJECT_NAME}.6           DESTINATION share/man/man6)
+ #install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${XDG_APPLICATION_ID}.desktop     DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications)
+-install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${XDG_APPLICATION_ID}.desktop     DESTINATION ../share/applications)
++install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${XDG_APPLICATION_ID}.desktop     DESTINATION share/applications)
+ #install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${XDG_APPLICATION_ID}.appdata.xml DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/metainfo)
+-install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${XDG_APPLICATION_ID}.appdata.xml DESTINATION ../share/metainfo)
++install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${XDG_APPLICATION_ID}.appdata.xml DESTINATION share/metainfo)
+ 
+ find_program(GTK_UPDATE_ICON_CACHE NAMES gtk-update-icon-cache)
+ if (GTK_UPDATE_ICON_CACHE)
+   #install(CODE "execute_process (COMMAND ${GTK_UPDATE_ICON_CACHE} -t -f ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor ||: )")
+-  install(CODE "execute_process (COMMAND ${GTK_UPDATE_ICON_CACHE} -t -f ${CMAKE_INSTALL_PREFIX}/../share/icons/hicolor ||: )")
++  install(CODE "execute_process (COMMAND ${GTK_UPDATE_ICON_CACHE} -t -f ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor ||: )")
+ else (GTK_UPDATE_ICON_CACHE)
+   message(WARNING "gtk-update-icon-cache not found!")
+ endif (GTK_UPDATE_ICON_CACHE)
diff --git a/srcpkgs/widelands/template b/srcpkgs/widelands/template
index 6cee85087ea7..cfa2c10993e0 100644
--- a/srcpkgs/widelands/template
+++ b/srcpkgs/widelands/template
@@ -1,7 +1,7 @@
 # Template file for 'widelands'
 pkgname=widelands
 version=21
-revision=3
+revision=4
 wrksrc="${pkgname}-build${version}"
 build_style=cmake
 configure_args="-DOPENGL_INCLUDE_DIR=${XBPS_CROSS_BASE}/usr/include
@@ -10,13 +10,13 @@ hostmakedepends="python3 pkg-config gettext"
 makedepends="boost-devel icu-devel minizip-devel gettext-devel
  glu-devel glew-devel SDL2-devel SDL2_gfx-devel SDL2_image-devel
  SDL2_net-devel SDL2_mixer-devel SDL2_ttf-devel"
-depends="${pkgname}-data-${version}_${revision}"
 short_desc="Real-time strategy game"
 maintainer="Jürgen Buchmüller <pullmoll@t-online.de>"
 license="GPL-2.0-or-later"
 homepage="http://www.widelands.org/"
 distfiles="https://github.com/widelands/widelands/archive/build${version}.tar.gz>${pkgname}-${version}.tar.gz"
 checksum=601e0e4c6f91b3fb0ece2cd1b83ecfb02344a1b9194fbb70ef3f70e06994e357
+replaces="widelands-data>=0"
 
 CXXFLAGS="-DU_USING_ICU_NAMESPACE=1"
 
@@ -29,22 +29,5 @@ if [ "$CROSS_BUILD" ]; then
 fi
 
 post_install() {
-	# For some reason the binary is installed as /usr/widelands - move it
-	vmkdir usr/bin
-	mv ${DESTDIR}/usr/${pkgname} ${DESTDIR}/usr/bin
-	vmkdir usr/share
-	mv ${DESTDIR}/share/* ${DESTDIR}/usr/share/
-	rmdir ${DESTDIR}/share
-
-	# Remove files not needed in the package
-	rm -f ${DESTDIR}/usr/COPYING ${DESTDIR}/usr/CREDITS ${DESTDIR}/usr/ChangeLog ${DESTDIR}/usr/VERSION
-
 	vinstall ${FILESDIR}/${pkgname}.desktop 644 usr/share/applications
 }
-
-widelands-data_package() {
-	short_desc+=" - data files"
-	pkg_install() {
-		vmove usr/share/widelands
-	}
-}

From fca89613196fead100dc4e43f640c4f3d88ec39e 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: Sat, 20 Mar 2021 09:49:25 +0700
Subject: [PATCH 12/55] zziplib: fix SONAME when build with
 -DCMAKE_BUILD_TYPE=None

---
 .../cmake-build-type-none-soname.patch        | 35 +++++++++++++++++++
 srcpkgs/zziplib/template                      |  1 +
 2 files changed, 36 insertions(+)
 create mode 100644 srcpkgs/zziplib/patches/cmake-build-type-none-soname.patch

diff --git a/srcpkgs/zziplib/patches/cmake-build-type-none-soname.patch b/srcpkgs/zziplib/patches/cmake-build-type-none-soname.patch
new file mode 100644
index 000000000000..2d31b5b8a46a
--- /dev/null
+++ b/srcpkgs/zziplib/patches/cmake-build-type-none-soname.patch
@@ -0,0 +1,35 @@
+Index: zziplib-0.13.72/zzip/CMakeLists.txt
+===================================================================
+--- zziplib-0.13.72.orig/zzip/CMakeLists.txt
++++ zziplib-0.13.72/zzip/CMakeLists.txt
+@@ -190,15 +190,18 @@ target_include_directories (libzzipmmapp
+ endif()
+ 
+ set_target_properties(libzzip PROPERTIES OUTPUT_NAME "zzip" RELEASE_POSTFIX "-${RELNUM}")
++set_target_properties(libzzip PROPERTIES OUTPUT_NAME "zzip" NONE_POSTFIX "-${RELNUM}")
+ SET_TARGET_PROPERTIES(libzzip PROPERTIES VERSION ${VERNUM}.${FIXNUM} SOVERSION ${VERNUM})
+ 
+ if(ZZIPFSEEKO)
+ set_target_properties(libzzipfseeko PROPERTIES OUTPUT_NAME "zzipfseeko" RELEASE_POSTFIX "-${RELNUM}")
++set_target_properties(libzzipfseeko PROPERTIES OUTPUT_NAME "zzipfseeko" NONE_POSTFIX "-${RELNUM}")
+ SET_TARGET_PROPERTIES(libzzipfseeko PROPERTIES VERSION ${VERNUM}.${FIXNUM} SOVERSION ${VERNUM})
+ endif()
+ 
+ if(ZZIPMMAPPED)
+ set_target_properties(libzzipmmapped PROPERTIES OUTPUT_NAME "zzipmmapped" RELEASE_POSTFIX "-${RELNUM}")
++set_target_properties(libzzipmmapped PROPERTIES OUTPUT_NAME "zzipmmapped" NONE_POSTFIX "-${RELNUM}")
+ SET_TARGET_PROPERTIES(libzzipmmapped PROPERTIES VERSION ${VERNUM}.${FIXNUM} SOVERSION ${VERNUM})
+ endif()
+ 
+Index: zziplib-0.13.72/zzipwrap/CMakeLists.txt
+===================================================================
+--- zziplib-0.13.72.orig/zzipwrap/CMakeLists.txt
++++ zziplib-0.13.72/zzipwrap/CMakeLists.txt
+@@ -49,6 +49,7 @@ target_link_libraries(libzzipwrap libzzi
+ target_include_directories(libzzipwrap PRIVATE "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}")
+ 
+ set_target_properties(libzzipwrap PROPERTIES OUTPUT_NAME "zzipwrap" RELEASE_POSTFIX "-${RELNUM}")
++set_target_properties(libzzipwrap PROPERTIES OUTPUT_NAME "zzipwrap" NONE_POSTFIX "-${RELNUM}")
+ SET_TARGET_PROPERTIES(libzzipwrap PROPERTIES VERSION ${VERNUM}.${FIXNUM} SOVERSION ${VERNUM})
+ set_target_properties(libzzipwrap PROPERTIES DEFINE_SYMBOL "libzzip_EXPORTS")
+ 
diff --git a/srcpkgs/zziplib/template b/srcpkgs/zziplib/template
index ab5af234af62..2026f3e4a521 100644
--- a/srcpkgs/zziplib/template
+++ b/srcpkgs/zziplib/template
@@ -12,6 +12,7 @@ homepage="https://github.com/gdraheim/zziplib"
 changelog="https://raw.githubusercontent.com/gdraheim/zziplib/master/ChangeLog"
 distfiles="https://github.com/gdraheim/zziplib/archive/v${version}.tar.gz"
 checksum=93ef44bf1f1ea24fc66080426a469df82fa631d13ca3b2e4abaeab89538518dc
+patch_args=-Np1
 
 if [ "$CROSS_BUILD" ]; then
 	configure_args+=" -DZZIPTEST=OFF"

From 19d159530e95c960321ed55448195bbd1081ce15 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, 21 Mar 2021 15:28:04 +0700
Subject: [PATCH 13/55] mellowplayer: fix build

---
 srcpkgs/mellowplayer/patches/no-werror.patch | 13 +++++++++++++
 srcpkgs/mellowplayer/template                | 13 +++++++------
 2 files changed, 20 insertions(+), 6 deletions(-)
 create mode 100644 srcpkgs/mellowplayer/patches/no-werror.patch

diff --git a/srcpkgs/mellowplayer/patches/no-werror.patch b/srcpkgs/mellowplayer/patches/no-werror.patch
new file mode 100644
index 000000000000..7e678453a123
--- /dev/null
+++ b/srcpkgs/mellowplayer/patches/no-werror.patch
@@ -0,0 +1,13 @@
+Index: MellowPlayer-3.6.6/src/3rdparty/boost/di.hpp
+===================================================================
+--- MellowPlayer-3.6.6.orig/src/3rdparty/boost/di.hpp
++++ MellowPlayer-3.6.6/src/3rdparty/boost/di.hpp
+@@ -67,7 +67,7 @@ BOOST_DI_CFG_FWD
+ #pragma clang diagnostic error "-Wundefined-internal"
+ #pragma clang diagnostic ignored "-Wmissing-field-initializers"
+ #elif defined(__GCC__)
+-#pragma GCC diagnostic error "-Wdeprecated-declarations"
++#pragma GCC diagnostic warning "-Wdeprecated-declarations"
+ #pragma GCC diagnostic push
+ #if (__GNUC__ < 6)
+ #pragma GCC diagnostic error "-Werror"
diff --git a/srcpkgs/mellowplayer/template b/srcpkgs/mellowplayer/template
index 2f8f13960ca6..cfd8a185556f 100644
--- a/srcpkgs/mellowplayer/template
+++ b/srcpkgs/mellowplayer/template
@@ -4,7 +4,7 @@ version=3.6.6
 revision=1
 wrksrc="MellowPlayer-${version}"
 build_style=cmake
-hostmakedepends="pkg-config qt5-tools qt5-qmake"
+hostmakedepends="pkg-config qt5-tools qt5-qmake qt5-host-tools"
 makedepends="qt5-declarative-devel qt5-quickcontrols2-devel
  qt5-plugin-mysql qt5-plugin-pgsql qt5-plugin-sqlite
  qt5-plugin-tds qt5-plugin-odbc
@@ -17,11 +17,12 @@ license="GPL-2.0-or-later"
 homepage="https://colinduquesnoy.gitlab.io/MellowPlayer/"
 distfiles="https://gitlab.com/ColinDuquesnoy/MellowPlayer/-/archive/${version}/MellowPlayer-${version}.tar.bz2"
 checksum=17b8b25ca6b3d27b223f8be6ad80186ae5bd17ce762eb04ecd8b0e82e687b327
+patch_args=-Np1
 
-if [ "$CROSS_BUILD" ]; then
-	hostmakedepends+=" qt5-host-tools"
+if [ "$XBPS_WORDSIZE" != "$XBPS_TARGET_WORDSIZE" ]; then
+	broken="webengine can be built only if word size matches"
 fi
 
-case "$XBPS_TARGET_MACHINE" in
-	arm*) broken="qt5-webengine not available" ;;
-esac
+if [ "$XBPS_TARGET_ENDIAN" != "le" ]; then
+	broken="webengine only supports little endian"
+fi

From 4addcf87857b01ccc9968ba2ae44f1507df410a7 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, 21 Mar 2021 15:43:09 +0700
Subject: [PATCH 14/55] ispc: fix CMAKE_BUILD_TYPE=None

---
 .../ispc/patches/cmake-build-type-none.patch   | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
 create mode 100644 srcpkgs/ispc/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/ispc/patches/cmake-build-type-none.patch b/srcpkgs/ispc/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..411e353c7314
--- /dev/null
+++ b/srcpkgs/ispc/patches/cmake-build-type-none.patch
@@ -0,0 +1,18 @@
+Index: ispc-1.15.0/CMakeLists.txt
+===================================================================
+--- ispc-1.15.0.orig/CMakeLists.txt
++++ ispc-1.15.0/CMakeLists.txt
+@@ -157,13 +157,6 @@ set(OUTPUT_RELEASE Release/bin)
+ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin )
+ 
+ if(CMAKE_BUILD_TYPE)
+-    # Validate build type
+-    set(CONFIGURATION_TYPES "Debug;Release;RelWithDebInfo")
+-
+-    string(FIND "${CONFIGURATION_TYPES}" "${CMAKE_BUILD_TYPE}" MATCHED_CONFIG)
+-    if (${MATCHED_CONFIG} EQUAL -1)
+-         message(FATAL_ERROR "CMAKE_BUILD_TYPE (${CMAKE_BUILD_TYPE}) allows only the following values: ${CONFIGURATION_TYPES}")
+-    endif()
+ else(NOT CMAKE_BUILD_TYPE)
+     set(CMAKE_BUILD_TYPE "Release")
+     message(STATUS "Build type not specified: Use Release by default.")

From 62c59bf52f7c48e41b54c82938c55c140439e870 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, 21 Mar 2021 15:56:50 +0700
Subject: [PATCH 15/55] darktable: fix CMAKE_BUILD_TYPE=None

---
 .../darktable/patches/cmake-build-type-none.patch  | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
 create mode 100644 srcpkgs/darktable/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/darktable/patches/cmake-build-type-none.patch b/srcpkgs/darktable/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..7101f9c1a0e7
--- /dev/null
+++ b/srcpkgs/darktable/patches/cmake-build-type-none.patch
@@ -0,0 +1,14 @@
+Index: src/external/rawspeed/cmake/build-type.cmake
+===================================================================
+--- src/external/rawspeed/cmake/build-type.cmake.orig
++++ src/external/rawspeed/cmake/build-type.cmake
+@@ -27,9 +27,6 @@ string(TOUPPER "${RAWSPEED_SPECIAL_BUILD
+ 
+ # is this one of the known build types?
+ list (FIND CMAKE_CONFIGURATION_TYPES_UPPERCASE ${CMAKE_BUILD_TYPE_UPPERCASE} BUILD_TYPE_IS_KNOWN)
+-if (${BUILD_TYPE_IS_KNOWN} EQUAL -1)
+- message(SEND_ERROR "Unknown build type: ${CMAKE_BUILD_TYPE_UPPERCASE}. Please specify one of: ${CMAKE_CONFIGURATION_TYPES}")
+-endif()
+ 
+ # is this a special build?
+ list (FIND RAWSPEED_SPECIAL_BUILD_TYPES_UPPERCASE ${CMAKE_BUILD_TYPE_UPPERCASE} IS_SPECIAL_BUILD)

From eb56ba5585ec737dda61bf20fb37a9238afd1a3d 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, 21 Mar 2021 15:33:29 +0700
Subject: [PATCH 16/55] hedgewars: merge -data back

---
 srcpkgs/hedgewars-data                        |  1 -
 .../patches/cmake-build-type-none.patch       | 30 +++++++++++++++++++
 srcpkgs/hedgewars/template                    | 23 +++++---------
 3 files changed, 38 insertions(+), 16 deletions(-)
 delete mode 120000 srcpkgs/hedgewars-data
 create mode 100644 srcpkgs/hedgewars/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/hedgewars-data b/srcpkgs/hedgewars-data
deleted file mode 120000
index b57dc45ebadc..000000000000
--- a/srcpkgs/hedgewars-data
+++ /dev/null
@@ -1 +0,0 @@
-hedgewars
\ No newline at end of file
diff --git a/srcpkgs/hedgewars/patches/cmake-build-type-none.patch b/srcpkgs/hedgewars/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..b4e0c186717c
--- /dev/null
+++ b/srcpkgs/hedgewars/patches/cmake-build-type-none.patch
@@ -0,0 +1,30 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -54,7 +54,7 @@ option(NOVERSIONINFOUPDATE "Disable upda
+ 
+ 
+ if(BUILD_ENGINE_C AND NOT NOVIDEOREC)
+-    if((CMAKE_BUILD_TYPE STREQUAL "Release") OR (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo"))
++    if((CMAKE_BUILD_TYPE STREQUAL "Release") OR (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo") OR (CMAKE_BUILD_TYPE STREQUAL "None"))
+         message("NOTE: Video recorder support disabled. It's incompatible with BUILD_ENGINE_C")
+         set(BUILD_ENGINE_C ON CACHE STRING "Required for BUILD_ENGINE_JS" FORCE)
+     else()
+@@ -93,7 +93,7 @@ set(CPACK_PACKAGE_VERSION_MAJOR 1)
+ set(CPACK_PACKAGE_VERSION_MINOR 0)
+ set(CPACK_PACKAGE_VERSION_PATCH 0)
+ set(HEDGEWARS_PROTO_VER 59)
+-if((CMAKE_BUILD_TYPE STREQUAL "Release") OR (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo"))
++if((CMAKE_BUILD_TYPE STREQUAL "Release") OR (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo") OR (CMAKE_BUILD_TYPE STREQUAL "None"))
+     set(HEDGEWARS_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
+ else()
+     set(HEDGEWARS_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}-dev")
+@@ -114,6 +114,7 @@ include(${CMAKE_MODULE_PATH}/platform.cm
+ if(CMAKE_BUILD_TYPE)
+     if(NOT((CMAKE_BUILD_TYPE STREQUAL "Release") OR
+            (CMAKE_BUILD_TYPE STREQUAL "Debug") OR
++	   (CMAKE_BUILD_TYPE STREQUAL "None") OR
+            (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")))
+         set(CMAKE_BUILD_TYPE ${default_build_type} CACHE STRING "Build type (Debug/Release/RelWithDebInfo)" FORCE)
+         message(STATUS "Unknown build type ${CMAKE_BUILD_TYPE}, using default (${default_build_type})")
diff --git a/srcpkgs/hedgewars/template b/srcpkgs/hedgewars/template
index d2294cf572f5..f413a965ff2e 100644
--- a/srcpkgs/hedgewars/template
+++ b/srcpkgs/hedgewars/template
@@ -1,15 +1,15 @@
 # Template file for 'hedgewars'
 pkgname=hedgewars
 version=1.0.0
-revision=2
+revision=3
 wrksrc="${pkgname}-src-${version}"
 build_style=cmake
 configure_args="-DNOSERVER=1 -DDATA_INSTALL_DIR=/usr/share/${pkgname}
- -DPHYSFS_SYSTEM=1 -DCMAKE_VERBOSE_MAKEFILE=1 -DMINIMAL_FLAGS=1"
-hostmakedepends="lua51 pkg-config"
+ -DPHYSFS_SYSTEM=1 -DMINIMAL_FLAGS=1"
+hostmakedepends="lua51 pkg-config qt5-qmake qt5-host-tools"
 makedepends="ffmpeg-devel lua51-devel physfs-devel qt5-tools-devel SDL2_image-devel
  SDL2_mixer-devel SDL2_net-devel SDL2_ttf-devel"
-depends="hedgewars-data>=${version}_${revision} libfreeglut"
+depends="libfreeglut"
 short_desc="Funny turn-based artillery game, featuring fighting Hedgehogs!"
 maintainer="Jakub Skrzypnik <jot.skrzyp@gmail.com>"
 license="GPL-2.0-only"
@@ -18,10 +18,9 @@ distfiles="https://hedgewars.org/download/releases/hedgewars-src-${version}.tar.
 checksum=211634e61f2e4beecc3c98c6f749601fcd08321fda1ba969b3b3832a004f155b
 nopie_files="/usr/bin/hwengine"
 nocross="Needs investigation: fails to link hwengine"
-
-if [ -n "$CROSS_BUILD" ]; then
-	hostmakedepends+=" qt5-devel"
-fi
+replaces="hedgewars-data>=0"
+export CMAKE_GENERATOR="Unix Makefiles"
+make_cmd=make
 
 case $XBPS_TARGET_MACHINE in
 	x86_64*)
@@ -38,6 +37,7 @@ esac
 
 if [ -n "$_use_c_engine" ]; then
 	hostmakedepends+=" glew-devel libatomic-devel ghc clang"
+	makedepends+=" glew-devel libatomic-devel"
 	configure_args+=" -DBUILD_ENGINE_C=1"
 	nopie_files+=" /usr/bin/hedgewars"
 fi
@@ -56,10 +56,3 @@ pre_configure() {
 post_install() {
 	vinstall ${DESTDIR}/usr/share/hedgewars/Data/misc/hedgewars.desktop 644 usr/share/applications
 }
-
-hedgewars-data_package() {
-	short_desc+=" - data files"
-	pkg_install() {
-		vmove usr/share/hedgewars/Data
-	}
-}

From 58db8b7dd88bcbe23982de545008cc86e3eec1e1 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, 21 Mar 2021 16:41:58 +0700
Subject: [PATCH 17/55] mariadb: fix for CMAKE_BUILD_TYPE=None

---
 srcpkgs/mariadb/template | 32 ++++++++++++++------------------
 1 file changed, 14 insertions(+), 18 deletions(-)

diff --git a/srcpkgs/mariadb/template b/srcpkgs/mariadb/template
index 437ff757b383..78d5e2dbdbe8 100644
--- a/srcpkgs/mariadb/template
+++ b/srcpkgs/mariadb/template
@@ -34,35 +34,31 @@ replaces="mysql>=0"
 conf_files="/etc/mysql/my.cnf"
 system_accounts="mysql"
 mysql_homedir="/var/lib/mysql"
-CFLAGS="-w -fcommon"
+CFLAGS="-w -fcommon -DDBUG_OFF=1"
+CXXFLAGS="-DDBUG_OFF=1"
 
 pre_configure() {
 	# We need some host binaries before starting cross compilation.
 	if [ "$CROSS_BUILD" ]; then
+		mkdir -p build.native
 		# XXX still broken: jemalloc configure execs host bins.
-		CC= CXX= CPP= LD= AR= AS= RANLIB= CFLAGS= CXXFLAGS= LDFLAGS= cmake .
-		make comp_err comp_sql gen_lex_hash gen_lex_token
-		mkdir bin.host
-		cp extra/comp_err bin.host
-		cp scripts/comp_sql bin.host
-		cp sql/gen_lex_hash bin.host
-		cp sql/gen_lex_token bin.host
-		make clean
-		rm CMakeCache.txt
+		CC= CXX= CPP= LD= AR= AS= RANLIB= CFLAGS= CXXFLAGS= LDFLAGS= \
+			cmake -S . -B build.native
+		make -C build.native comp_err comp_sql gen_lex_hash gen_lex_token
 	fi
 }
 
 pre_build() {
 	if [ "$CROSS_BUILD" ]; then
 		# CMake complains if those binaries ain't in build
-		cp bin.host/comp_err ${wrksrc}/extra
-		cp bin.host/comp_err ${wrksrc}/build/extra
-		cp bin.host/comp_sql ${wrksrc}/scripts
-		cp bin.host/comp_sql ${wrksrc}/build/scripts
-		cp bin.host/gen_lex_hash ${wrksrc}/sql
-		cp bin.host/gen_lex_hash ${wrksrc}/build/sql
-		cp bin.host/gen_lex_token ${wrksrc}/sql
-		cp bin.host/gen_lex_token ${wrksrc}/build/sql
+		cp build.native/extra/comp_err ${wrksrc}/extra
+		cp build.native/extra/comp_err ${wrksrc}/build/extra
+		cp build.native/scripts/comp_sql ${wrksrc}/scripts
+		cp build.native/scripts/comp_sql ${wrksrc}/build/scripts
+		cp build.native/sql/gen_lex_hash ${wrksrc}/sql
+		cp build.native/sql/gen_lex_hash ${wrksrc}/build/sql
+		cp build.native/sql/gen_lex_token ${wrksrc}/sql
+		cp build.native/sql/gen_lex_token ${wrksrc}/build/sql
 		export PATH=${PATH}:${wrksrc}/extra:${wrksrc}/scripts:${wrksrc}/sql
 	fi
 	export LD_LIBRARY_PATH=${wrksrc}/build/storage/tokudb/ft-index/portability

From 354480bad13ad497bfb1eb698e7ea90faf8547db 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: Thu, 25 Mar 2021 07:58:28 +0700
Subject: [PATCH 18/55] EternalTerminal: remove -ggdb3

---
 .../EternalTerminal/patches/fix-cflags.patch    | 17 +++++++++++++++++
 srcpkgs/EternalTerminal/template                |  1 +
 2 files changed, 18 insertions(+)
 create mode 100644 srcpkgs/EternalTerminal/patches/fix-cflags.patch

diff --git a/srcpkgs/EternalTerminal/patches/fix-cflags.patch b/srcpkgs/EternalTerminal/patches/fix-cflags.patch
new file mode 100644
index 000000000000..e6fcd432f7e7
--- /dev/null
+++ b/srcpkgs/EternalTerminal/patches/fix-cflags.patch
@@ -0,0 +1,17 @@
+Index: EternalTerminal-et-v6.0.13/CMakeLists.txt
+===================================================================
+--- EternalTerminal-et-v6.0.13.orig/CMakeLists.txt
++++ EternalTerminal-et-v6.0.13/CMakeLists.txt
+@@ -26,12 +26,6 @@ if(DISABLE_CRASH_LOG)
+ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DELPP_DISABLE_DEFAULT_CRASH_HANDLING")
+ ENDIF(DISABLE_CRASH_LOG)
+ 
+-if(UNIX)
+-  # Enable debug info
+-  SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -ggdb3")
+-  SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -ggdb3")
+-endif()
+-
+ # Enable C++-11
+ set(CMAKE_CXX_STANDARD 11)
+ set(CMAKE_CXX_STANDARD_REQUIRED ON)
diff --git a/srcpkgs/EternalTerminal/template b/srcpkgs/EternalTerminal/template
index 7bac78d2ffd4..bc92e47743dd 100644
--- a/srcpkgs/EternalTerminal/template
+++ b/srcpkgs/EternalTerminal/template
@@ -13,6 +13,7 @@ homepage="https://eternalterminal.dev/"
 distfiles="https://github.com/MisterTea/EternalTerminal/archive/et-v${version}.tar.gz"
 checksum=728c3a444d666897c710e33fe473d8d289263a59574451b13aa53ec3c6ac88b3
 system_accounts="_eternal"
+patch_args=-Np1
 
 LDFLAGS="-lgflags"
 

From c54d489a593cc1a80bf18a12c72ba1cd4ae4d6ec 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: Thu, 25 Mar 2021 08:20:29 +0700
Subject: [PATCH 19/55] OTPClient: respect CFLAGS

---
 srcpkgs/OTPClient/patches/fix-cflags.patch | 17 +++++++++++++++++
 srcpkgs/OTPClient/template                 |  1 +
 2 files changed, 18 insertions(+)
 create mode 100644 srcpkgs/OTPClient/patches/fix-cflags.patch

diff --git a/srcpkgs/OTPClient/patches/fix-cflags.patch b/srcpkgs/OTPClient/patches/fix-cflags.patch
new file mode 100644
index 000000000000..ae70f441538f
--- /dev/null
+++ b/srcpkgs/OTPClient/patches/fix-cflags.patch
@@ -0,0 +1,17 @@
+Index: OTPClient-2.4.2/CMakeLists.txt
+===================================================================
+--- OTPClient-2.4.2.orig/CMakeLists.txt
++++ OTPClient-2.4.2/CMakeLists.txt
+@@ -11,11 +11,10 @@ option(BUILD_GUI "Build the GUI" ON)
+ option(BUILD_CLI "Build the CLI" ON)
+ 
+ set(CMAKE_C_STANDARD 11)
+-set(CMAKE_C_FLAGS "-Wall -Wextra -O3 -Wformat=2 -Wmissing-format-attribute -fstack-protector-strong -Wundef -Wmissing-format-attribute")
++set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wformat=2 -Wmissing-format-attribute -fstack-protector-strong -Wundef -Wmissing-format-attribute")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fdiagnostics-color=always -Wstrict-prototypes -Wunreachable-code")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wchar-subscripts -Wwrite-strings -Wpointer-arith -Wbad-function-cast -Wcast-align")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror=format-security -Werror=implicit-function-declaration -Wno-sign-compare")
+-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3")
+ if(CMAKE_COMPILER_IS_GNUCC)
+     set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pie -fPIE")
+ endif()
diff --git a/srcpkgs/OTPClient/template b/srcpkgs/OTPClient/template
index e8c0099850b7..f5af76e655a6 100644
--- a/srcpkgs/OTPClient/template
+++ b/srcpkgs/OTPClient/template
@@ -12,3 +12,4 @@ license="GPL-3.0-or-later"
 homepage="https://github.com/paolostivanin/OTPClient"
 distfiles="https://github.com/paolostivanin/OTPClient/archive/v${version}.tar.gz"
 checksum=74bc4312aa1cd336ca983434e3bed951c5ead327091e7708e3beb08508813495
+patch_args=-Np1

From c56133981d7325565d546b93aee085e6c16ad000 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: Thu, 25 Mar 2021 08:30:31 +0700
Subject: [PATCH 20/55] crex: hardening

---
 srcpkgs/crex/patches/fix-cflags.patch | 20 ++++++++++++++++++++
 srcpkgs/crex/template                 |  7 ++-----
 2 files changed, 22 insertions(+), 5 deletions(-)
 create mode 100644 srcpkgs/crex/patches/fix-cflags.patch

diff --git a/srcpkgs/crex/patches/fix-cflags.patch b/srcpkgs/crex/patches/fix-cflags.patch
new file mode 100644
index 000000000000..d191fb1e9ec0
--- /dev/null
+++ b/srcpkgs/crex/patches/fix-cflags.patch
@@ -0,0 +1,20 @@
+Index: crex-0.2.5/CMakeLists.txt
+===================================================================
+--- crex-0.2.5.orig/CMakeLists.txt
++++ crex-0.2.5/CMakeLists.txt
+@@ -13,9 +13,6 @@ endif(CCACHE_FOUND)
+ set (CMAKE_CXX_STANDARD 14)
+ set (CMAKE_CXX_STANDARD_REQUIRED ON)
+ 
+-set (CMAKE_CXX_FLAGS "-fdiagnostics-color=auto")
+-set (CMAKE_C_FLAGS "-fdiagnostics-color=auto")
+-
+ set (DEBUG_FLAGS "-Wpedantic -Wall -Wextra -Wcast-align -Wcast-qual -Wctor-dtor-privacy -Wdisabled-optimization -Wformat=2 -Winit-self -Wlogical-op -Wmissing-declarations -Wmissing-include-dirs -Wnoexcept -Wold-style-cast -Woverloaded-virtual -Wredundant-decls -Wshadow -Wsign-conversion -Wsign-promo -Wstrict-null-sentinel -Wstrict-overflow=5 -Wswitch-default -Wundef -Wno-unused -std=c++14 -g")
+ set (DEBUG_LINK_FLAGS "-fprofile-arcs -ftest-coverage -flto")
+ 
+@@ -56,4 +53,4 @@ target_link_libraries (
+   ${TARGET}
+ )
+ 
+-install (TARGETS ${TARGET} DESTINATION "/usr/local/bin")
++install (TARGETS ${TARGET} DESTINATION "/usr/bin")
diff --git a/srcpkgs/crex/template b/srcpkgs/crex/template
index a54697a93adc..2f455a0b0c72 100644
--- a/srcpkgs/crex/template
+++ b/srcpkgs/crex/template
@@ -1,7 +1,7 @@
 # Template file for 'crex'
 pkgname=crex
 version=0.2.5
-revision=1
+revision=2
 build_style=cmake
 short_desc="Explore, test, and check regular expressions in the terminal"
 maintainer="Piotr Wójcik <chocimier@tlen.pl>"
@@ -9,10 +9,7 @@ license="MIT"
 homepage="https://github.com/octobanana/crex"
 distfiles="https://github.com/octobanana/crex/archive/${version}.tar.gz"
 checksum=c6a166b7a1e696a7babeaf7c5728eece1624704a18357f827129fc95ef2ecc56
-
-pre_configure() {
-	sed -e 's|/local/|/|' -i CMakeLists.txt
-}
+patch_args=-Np1
 
 post_install() {
 	vlicense LICENSE

From 25880e318b653c94d3d83be8f06089490a693d11 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: Thu, 25 Mar 2021 08:34:32 +0700
Subject: [PATCH 21/55] libbaseencode: hardening

---
 srcpkgs/libbaseencode/patches/fix-cflags.patch | 13 +++++++++++++
 srcpkgs/libbaseencode/template                 |  3 ++-
 2 files changed, 15 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/libbaseencode/patches/fix-cflags.patch

diff --git a/srcpkgs/libbaseencode/patches/fix-cflags.patch b/srcpkgs/libbaseencode/patches/fix-cflags.patch
new file mode 100644
index 000000000000..1bb86a0b15a4
--- /dev/null
+++ b/srcpkgs/libbaseencode/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: libbaseencode-1.0.9/CMakeLists.txt
+===================================================================
+--- libbaseencode-1.0.9.orig/CMakeLists.txt
++++ libbaseencode-1.0.9/CMakeLists.txt
+@@ -15,7 +15,7 @@ set(CMAKE_C_STANDARD 11)
+ set(BASEENCODE_HEADERS src/baseencode.h)
+ set(SOURCE_FILES src/base32.c src/base64.c)
+ 
+-set(CMAKE_C_FLAGS "-Wall -Werror -fPIC")
++set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Werror -fPIC")
+ 
+ add_library(${PROJECT_NAME} SHARED ${SOURCE_FILES})
+ 
diff --git a/srcpkgs/libbaseencode/template b/srcpkgs/libbaseencode/template
index 384a189224df..d5929ad7bb51 100644
--- a/srcpkgs/libbaseencode/template
+++ b/srcpkgs/libbaseencode/template
@@ -1,7 +1,7 @@
 # Template file for 'libbaseencode'
 pkgname=libbaseencode
 version=1.0.9
-revision=1
+revision=2
 build_style=cmake
 short_desc="Library for encoding decoding data use base32 or base64"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -9,6 +9,7 @@ license="Apache-2.0"
 homepage="https://github.com/paolostivanin/libbaseencode"
 distfiles="https://github.com/paolostivanin/libbaseencode/archive/v${version}.tar.gz"
 checksum=a183d7cf30d931b2a078d6f0ef64616b71ab26f9258e5f4e191778c7ace7175d
+patch_args=-Np1
 
 libbaseencode-devel_package() {
 	depends="libbaseencode-${version}_${revision}"

From fe698a0ffa406bc3a7ee232190ada09143be49c2 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: Fri, 26 Mar 2021 08:46:56 +0700
Subject: [PATCH 22/55] bibletime: clean build flags

---
 srcpkgs/bibletime/patches/fix-cflags.patch | 13 +++++++++++++
 srcpkgs/bibletime/template                 |  1 +
 2 files changed, 14 insertions(+)
 create mode 100644 srcpkgs/bibletime/patches/fix-cflags.patch

diff --git a/srcpkgs/bibletime/patches/fix-cflags.patch b/srcpkgs/bibletime/patches/fix-cflags.patch
new file mode 100644
index 000000000000..480c5ca4ac1e
--- /dev/null
+++ b/srcpkgs/bibletime/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: bibletime-3.0/cmake/BTApplication.cmake
+===================================================================
+--- bibletime-3.0.orig/cmake/BTApplication.cmake
++++ bibletime-3.0/cmake/BTApplication.cmake
+@@ -41,7 +41,7 @@ IF(WIN32)
+     ADD_COMPILE_OPTIONS("/Zi")
+ ELSE()
+     ADD_COMPILE_OPTIONS(
+-        "-ggdb" "-Wall" "-Wextra"
++        "-Wall" "-Wextra" "-DNDEBUG" "-DQT_NO_DEBUG"
+         "$<$<STREQUAL:$<CONFIGURATION>,Release>:-O2>"
+         "$<$<STREQUAL:$<CONFIGURATION>,Release>:-DNDEBUG>"
+         "$<$<STREQUAL:$<CONFIGURATION>,Release>:-DQT_NO_DEBUG>"
diff --git a/srcpkgs/bibletime/template b/srcpkgs/bibletime/template
index 224881c45516..85bcc7f22f87 100644
--- a/srcpkgs/bibletime/template
+++ b/srcpkgs/bibletime/template
@@ -18,6 +18,7 @@ license="GPL-2.0-or-later"
 homepage="http://bibletime.info"
 distfiles="https://github.com/bibletime/bibletime/releases/download/v${version}/bibletime-${version}.tar.xz"
 checksum=d6beef62ad44b255e3dc4c5e89214bf01a0e85c9136073b0be12fca3d2b22622
+patch_args=-Np1
 
 pre_build() {
 	. /etc/profile.d/10_openjdk11.sh

From a189cfa5c38ca49c4aa7b52933e42f58ded69da2 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: Fri, 26 Mar 2021 08:54:25 +0700
Subject: [PATCH 23/55] boomerang: clean build flags

---
 srcpkgs/boomerang/patches/fix-cflags.patch | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
 create mode 100644 srcpkgs/boomerang/patches/fix-cflags.patch

diff --git a/srcpkgs/boomerang/patches/fix-cflags.patch b/srcpkgs/boomerang/patches/fix-cflags.patch
new file mode 100644
index 000000000000..eb59766c1c5b
--- /dev/null
+++ b/srcpkgs/boomerang/patches/fix-cflags.patch
@@ -0,0 +1,21 @@
+Index: cmake-scripts/boomerang-flags.cmake
+===================================================================
+--- cmake-scripts/boomerang-flags.cmake
++++ cmake-scripts/boomerang-flags.cmake
+@@ -104,16 +104,6 @@ endif ()
+ 
+ 
+ if (NOT MSVC)
+-    if ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
+-        BOOMERANG_ADD_COMPILE_FLAGS(-O0)
+-    elseif ("${CMAKE_BUILD_TYPE}" STREQUAL "RelWithDebInfo")
+-        # No special flags
+-    elseif ("${CMAKE_BUILD_TYPE}" STREQUAL "MinSizeRel")
+-        BOOMERANG_ADD_COMPILE_FLAGS(-Os)
+-    else () # Release
+-        BOOMERANG_ADD_COMPILE_FLAGS(-O3)
+-    endif ()
+-
+     if (BOOMERANG_ENABLE_COVERAGE)
+         set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fprofile-arcs -ftest-coverage")
+         set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage")

From 7ffea495739868a61e6ba77763ddbcce962a8c6b 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: Fri, 26 Mar 2021 08:58:11 +0700
Subject: [PATCH 24/55] catimg: don't change our build-type

---
 srcpkgs/catimg/patches/fix-cflags.patch | 12 ++++++++++++
 srcpkgs/catimg/template                 |  2 +-
 2 files changed, 13 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/catimg/patches/fix-cflags.patch

diff --git a/srcpkgs/catimg/patches/fix-cflags.patch b/srcpkgs/catimg/patches/fix-cflags.patch
new file mode 100644
index 000000000000..9b9f1074ef20
--- /dev/null
+++ b/srcpkgs/catimg/patches/fix-cflags.patch
@@ -0,0 +1,12 @@
+Index: catimg-2.7.0/CMakeLists.txt
+===================================================================
+--- catimg-2.7.0.orig/CMakeLists.txt
++++ catimg-2.7.0/CMakeLists.txt
+@@ -11,7 +11,6 @@ endif()
+ #set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wall -Wextra -g -std=c99 -Wno-unused-result")
+ #set(CMAKE_BUILD_TYPE Debug)
+ set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -Wall -Wextra -Os -std=c99 -Wno-unused-result")
+-set(CMAKE_BUILD_TYPE Release)
+ 
+ set(SRC ${PROJECT_SOURCE_DIR}/src)
+ 
diff --git a/srcpkgs/catimg/template b/srcpkgs/catimg/template
index 374351c45379..6fbc5f1d9140 100644
--- a/srcpkgs/catimg/template
+++ b/srcpkgs/catimg/template
@@ -9,7 +9,7 @@ license="MIT"
 homepage="https://github.com/posva/catimg"
 distfiles="https://github.com/posva/catimg/archive/${version}.tar.gz"
 checksum=3a6450316ff62fb07c3facb47ea208bf98f62abd02783e88c56f2a6508035139
-
+patch_args=-Np1
 CFLAGS="-fcommon"
 
 post_install() {

From 9d68bc40bd7d99914e7515cc6851eba248fc4c84 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: Fri, 26 Mar 2021 09:09:37 +0700
Subject: [PATCH 25/55] libcotp: fix build flags

---
 srcpkgs/libcotp/patches/fix-cflags.patch | 14 ++++++++++++++
 srcpkgs/libcotp/template                 |  1 +
 2 files changed, 15 insertions(+)
 create mode 100644 srcpkgs/libcotp/patches/fix-cflags.patch

diff --git a/srcpkgs/libcotp/patches/fix-cflags.patch b/srcpkgs/libcotp/patches/fix-cflags.patch
new file mode 100644
index 000000000000..397b3960e9f4
--- /dev/null
+++ b/srcpkgs/libcotp/patches/fix-cflags.patch
@@ -0,0 +1,14 @@
+Index: libcotp-1.2.2/CMakeLists.txt
+===================================================================
+--- libcotp-1.2.2.orig/CMakeLists.txt
++++ libcotp-1.2.2/CMakeLists.txt
+@@ -25,8 +25,7 @@ set(CMAKE_C_STANDARD 11)
+ set(COTP_HEADERS src/cotp.h)
+ set(SOURCE_FILES src/otp.c)
+ 
+-set(CMAKE_C_FLAGS "-Wall -Wextra -O3 -Wno-format-truncation -fstack-protector-strong -fPIC")
+-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3")
++set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wno-format-truncation -fstack-protector-strong -fPIC")
+ 
+ add_library(cotp SHARED ${SOURCE_FILES})
+ 
diff --git a/srcpkgs/libcotp/template b/srcpkgs/libcotp/template
index 9e147ff7deb6..88337290d1e8 100644
--- a/srcpkgs/libcotp/template
+++ b/srcpkgs/libcotp/template
@@ -11,6 +11,7 @@ license="Apache-2.0"
 homepage="https://github.com/paolostivanin/libcotp"
 distfiles="https://github.com/paolostivanin/libcotp/archive/v${version}.tar.gz"
 checksum=25b45ffa4aece5cc689503ebea7356a2f760c194f0c41805934495d2fe7165b1
+patch_args=-Np1
 
 libcotp-devel_package() {
 	depends="libcotp-${version}_${revision}"

From 14e7c5f8587fa1c281bcfca1c6347e4e02a9ee70 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: Fri, 26 Mar 2021 21:06:07 +0700
Subject: [PATCH 26/55] loudgain: hardening

---
 srcpkgs/loudgain/patches/fix-cflags.patch | 20 ++++++++++++++++++++
 srcpkgs/loudgain/template                 |  3 ++-
 2 files changed, 22 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/loudgain/patches/fix-cflags.patch

diff --git a/srcpkgs/loudgain/patches/fix-cflags.patch b/srcpkgs/loudgain/patches/fix-cflags.patch
new file mode 100644
index 000000000000..25b2c969bef4
--- /dev/null
+++ b/srcpkgs/loudgain/patches/fix-cflags.patch
@@ -0,0 +1,20 @@
+Index: loudgain-0.6.8/CMakeLists.txt
+===================================================================
+--- loudgain-0.6.8.orig/CMakeLists.txt
++++ loudgain-0.6.8/CMakeLists.txt
+@@ -69,12 +69,12 @@ TARGET_LINK_LIBRARIES(loudgain
+ )
+ 
+ SET_TARGET_PROPERTIES(loudgain PROPERTIES
+-  COMPILE_FLAGS "-Wall -pedantic -g"
++  COMPILE_FLAGS "-Wall -pedantic"
+ )
+ 
+-SET(CMAKE_C_FLAGS "-std=gnu99 -D_GNU_SOURCE")
++SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99 -D_GNU_SOURCE")
+ 
+-SET(CMAKE_CXX_FLAGS "-std=gnu++11 -D_GNU_SOURCE")
++SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11 -D_GNU_SOURCE")
+ 
+ INSTALL(TARGETS loudgain DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
+ 
diff --git a/srcpkgs/loudgain/template b/srcpkgs/loudgain/template
index f29167883439..00b2d20d27d6 100644
--- a/srcpkgs/loudgain/template
+++ b/srcpkgs/loudgain/template
@@ -1,7 +1,7 @@
 # Template file for 'loudgain'
 pkgname=loudgain
 version=0.6.8
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="pkg-config"
 makedepends="libebur128-devel taglib-devel ffmpeg-devel"
@@ -11,6 +11,7 @@ license="BSD-2-Clause"
 homepage="https://github.com/Moonbase59/loudgain"
 distfiles="https://github.com/Moonbase59/loudgain/archive/v${version}.tar.gz"
 checksum=1137c193ad941b366e87c5d84ccc95a7aa8571affc060db0bd1cf72c489aeaee
+patch_args=-Np1
 
 post_install() {
 	vlicense COPYING

From 09d7a5b27e2722fc2b20269914d6b75e5aca889f 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: Fri, 26 Mar 2021 21:14:31 +0700
Subject: [PATCH 27/55] masterpassword-cli: hardening

---
 srcpkgs/masterpassword-cli/patches/fix-cflags.patch | 13 +++++++++++++
 srcpkgs/masterpassword-cli/template                 |  2 +-
 2 files changed, 14 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/masterpassword-cli/patches/fix-cflags.patch

diff --git a/srcpkgs/masterpassword-cli/patches/fix-cflags.patch b/srcpkgs/masterpassword-cli/patches/fix-cflags.patch
new file mode 100644
index 000000000000..a303f6954544
--- /dev/null
+++ b/srcpkgs/masterpassword-cli/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: platform-independent/cli-c/CMakeLists.txt
+===================================================================
+--- platform-independent/cli-c/CMakeLists.txt.orig
++++ platform-independent/cli-c/CMakeLists.txt
+@@ -15,8 +15,6 @@ option( BUILD_MPW_BENCH         "C CLI M
+ option( BUILD_MPW_TESTS         "C Master Password algorithm test suite (needs: mpw_sodium, mpw_xml)." OFF )
+ 
+ # Default build flags.
+-set( CMAKE_BUILD_TYPE           Release )
+-set( CMAKE_C_FLAGS              "-O3" )
+ 
+ # Version.
+ file( READ                      "VERSION" mpw_version )
diff --git a/srcpkgs/masterpassword-cli/template b/srcpkgs/masterpassword-cli/template
index ee2b8d41ae4b..8536228a602b 100644
--- a/srcpkgs/masterpassword-cli/template
+++ b/srcpkgs/masterpassword-cli/template
@@ -1,7 +1,7 @@
 # Template file for 'masterpassword-cli'
 pkgname=masterpassword-cli
 version=2.6
-revision=5
+revision=6
 wrksrc=MasterPassword-${version}-cli-3
 build_wrksrc=platform-independent/cli-c
 build_style=cmake

From fb19973b59716c83aeb60b6bdc4f0433fbb39f3c 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: Fri, 26 Mar 2021 21:20:13 +0700
Subject: [PATCH 28/55] msg2: hardening

---
 srcpkgs/msg2/patches/fix-cflags.patch | 13 +++++++++++++
 srcpkgs/msg2/template                 |  2 +-
 2 files changed, 14 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/msg2/patches/fix-cflags.patch

diff --git a/srcpkgs/msg2/patches/fix-cflags.patch b/srcpkgs/msg2/patches/fix-cflags.patch
new file mode 100644
index 000000000000..64404bf44fcb
--- /dev/null
+++ b/srcpkgs/msg2/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -3,7 +3,7 @@ project(msg2)
+ 
+ # Flags
+ set(CMAKE_CXX_STANDARD 17)
+-set(CMAKE_CXX_FLAGS "-Os -pipe -fPIC -fno-plt -fstack-protector-strong -Wall -Wshadow -pedantic -Wno-parentheses -Wfatal-errors")
++set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pipe -fPIC -fno-plt -fstack-protector-strong -Wall -Wshadow -pedantic -Wno-parentheses -Wfatal-errors")
+ 
+ # Add source files
+ add_executable(msg2 main.cpp)
diff --git a/srcpkgs/msg2/template b/srcpkgs/msg2/template
index b4f77400bf22..473b3c4ec4d2 100644
--- a/srcpkgs/msg2/template
+++ b/srcpkgs/msg2/template
@@ -1,7 +1,7 @@
 # Template file for 'msg2'
 pkgname=msg2
 version=1.2.0
-revision=1
+revision=2
 build_style=cmake
 short_desc="Output a blue arrow and a white message on the commandline"
 maintainer="Orphaned <orphan@voidlinux.org>"

From 68c18bb12ce26c1c56d43e4f2ac5f6638135f4b5 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: Fri, 26 Mar 2021 21:22:55 +0700
Subject: [PATCH 29/55] ippusbxd: fix cflags -O2 not -o2

---
 srcpkgs/ippusbxd/patches/fix-cflags.patch | 12 ++++++++++++
 srcpkgs/ippusbxd/template                 |  2 +-
 2 files changed, 13 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/ippusbxd/patches/fix-cflags.patch

diff --git a/srcpkgs/ippusbxd/patches/fix-cflags.patch b/srcpkgs/ippusbxd/patches/fix-cflags.patch
new file mode 100644
index 000000000000..5d36903c3ffd
--- /dev/null
+++ b/srcpkgs/ippusbxd/patches/fix-cflags.patch
@@ -0,0 +1,12 @@
+Index: src/CMakeLists.txt
+===================================================================
+--- src/CMakeLists.txt.orig
++++ src/CMakeLists.txt
+@@ -1,6 +1,6 @@
+ cmake_minimum_required(VERSION 2.6)
+ project(ippusbxd)
+-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -o2 -g -std=c99 -Wall -Wextra -pedantic -pedantic-errors")
++set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -Wall -Wextra -pedantic -pedantic-errors")
+ 
+ 
+ # Compiler specific configuration
diff --git a/srcpkgs/ippusbxd/template b/srcpkgs/ippusbxd/template
index ce4ff2ea9125..e81064e8b91d 100644
--- a/srcpkgs/ippusbxd/template
+++ b/srcpkgs/ippusbxd/template
@@ -1,7 +1,7 @@
 # Template file for 'ippusbxd'
 pkgname=ippusbxd
 version=1.34
-revision=1
+revision=2
 build_wrksrc=src
 build_style=cmake
 make_cmd=make

From 7c20a3dda7da1bbb0283a93979173e556660f0c2 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: Fri, 26 Mar 2021 21:34:52 +0700
Subject: [PATCH 30/55] tlsh: respect -g

---
 srcpkgs/tlsh/patches/fix-cflags.patch | 13 +++++++++++++
 srcpkgs/tlsh/template                 |  2 +-
 2 files changed, 14 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/tlsh/patches/fix-cflags.patch

diff --git a/srcpkgs/tlsh/patches/fix-cflags.patch b/srcpkgs/tlsh/patches/fix-cflags.patch
new file mode 100644
index 000000000000..8715563715c7
--- /dev/null
+++ b/srcpkgs/tlsh/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -125,7 +125,7 @@ if (CMAKE_BUILD_TYPE STREQUAL Debug)
+     endif()
+ else(CMAKE_BUILD_TYPE STREQUAL Debug)
+     if(CMAKE_COMPILER_IS_GNUCXX)
+-        set(CMAKE_CXX_FLAGS "-O2 -fvisibility=internal")  ## Remove TlshImpl symbols
++        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=internal")  ## Remove TlshImpl symbols
+     endif()
+     if(MSVC)
+         set(CMAKE_CXX_FLAGS "/O2")        ## Optimize
diff --git a/srcpkgs/tlsh/template b/srcpkgs/tlsh/template
index 7cb5c28b48b9..dfea27526e14 100644
--- a/srcpkgs/tlsh/template
+++ b/srcpkgs/tlsh/template
@@ -1,7 +1,7 @@
 # Template file for 'tlsh'
 pkgname=tlsh
 version=3.17.0
-revision=2
+revision=3
 build_style=cmake
 hostmakedepends="python3"
 makedepends="python3-devel"

From 95e405039dc339297b5fcf907faa01f19cf1bd01 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: Fri, 26 Mar 2021 21:59:06 +0700
Subject: [PATCH 31/55] poppler: hardening + respect -g

---
 srcpkgs/poppler/patches/fix-cflags.patch | 21 +++++++++++++++++++++
 srcpkgs/poppler/template                 |  2 +-
 2 files changed, 22 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/poppler/patches/fix-cflags.patch

diff --git a/srcpkgs/poppler/patches/fix-cflags.patch b/srcpkgs/poppler/patches/fix-cflags.patch
new file mode 100644
index 000000000000..9e62b11010ba
--- /dev/null
+++ b/srcpkgs/poppler/patches/fix-cflags.patch
@@ -0,0 +1,21 @@
+Index: cmake/modules/PopplerMacros.cmake
+===================================================================
+--- cmake/modules/PopplerMacros.cmake.orig
++++ cmake/modules/PopplerMacros.cmake
+@@ -123,14 +123,14 @@ if(CMAKE_COMPILER_IS_GNUCXX)
+   set(DEFAULT_COMPILE_WARNINGS_EXTRA "${_warn} ${_warnx}")
+ 
+   set(_save_cxxflags "${CMAKE_CXX_FLAGS}")
+-  set(CMAKE_CXX_FLAGS                "-fno-exceptions -fno-check-new -fno-common -D_DEFAULT_SOURCE")
++  set(CMAKE_CXX_FLAGS                "-fno-exceptions -fno-check-new -fno-common -D_DEFAULT_SOURCE ${_save_cxxflags}")
+   set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g ${_save_cxxflags}")
+   set(CMAKE_CXX_FLAGS_RELEASE        "-O2 -DNDEBUG ${_save_cxxflags}")
+   set(CMAKE_CXX_FLAGS_DEBUG          "-g -O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline ${_save_cxxflags}")
+   set(CMAKE_CXX_FLAGS_DEBUGFULL      "-g3 -fno-inline ${_save_cxxflags}")
+   set(CMAKE_CXX_FLAGS_PROFILE        "-g3 -fno-inline -ftest-coverage -fprofile-arcs ${_save_cxxflags}")
+   set(_save_cflags "${CMAKE_C_FLAGS}")
+-  set(CMAKE_C_FLAGS                  "-std=c99 -D_DEFAULT_SOURCE")
++  set(CMAKE_C_FLAGS                  "-std=c99 -D_DEFAULT_SOURCE ${_save_cflags}")
+   set(CMAKE_C_FLAGS_RELWITHDEBINFO   "-O2 -g ${_save_cflags}")
+   set(CMAKE_C_FLAGS_RELEASE          "-O2 -DNDEBUG ${_save_cflags}")
+   set(CMAKE_C_FLAGS_DEBUG            "-g -O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline ${_save_cflags}")
diff --git a/srcpkgs/poppler/template b/srcpkgs/poppler/template
index ed0db8de7ab6..1aebd7f7e177 100644
--- a/srcpkgs/poppler/template
+++ b/srcpkgs/poppler/template
@@ -4,7 +4,7 @@
 #
 pkgname=poppler
 version=20.09.0
-revision=2
+revision=3
 build_style=cmake
 build_helper="gir"
 configure_args="-DENABLE_UNSTABLE_API_ABI_HEADERS=ON -DENABLE_CPP=ON

From e1de828c93386e95d7f3e91b26e7571714aad31c 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: Fri, 26 Mar 2021 21:59:29 +0700
Subject: [PATCH 32/55] poppler-qt5: hardening + respect -g

---
 srcpkgs/poppler-qt5/patches  | 1 +
 srcpkgs/poppler-qt5/template | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)
 create mode 120000 srcpkgs/poppler-qt5/patches

diff --git a/srcpkgs/poppler-qt5/patches b/srcpkgs/poppler-qt5/patches
new file mode 120000
index 000000000000..636e4ac2cbd9
--- /dev/null
+++ b/srcpkgs/poppler-qt5/patches
@@ -0,0 +1 @@
+../poppler/patches
\ No newline at end of file
diff --git a/srcpkgs/poppler-qt5/template b/srcpkgs/poppler-qt5/template
index 0dc45c05c58b..c2ec35dbbad3 100644
--- a/srcpkgs/poppler-qt5/template
+++ b/srcpkgs/poppler-qt5/template
@@ -5,7 +5,7 @@
 #
 pkgname=poppler-qt5
 version=20.09.0
-revision=1
+revision=2
 wrksrc="poppler-${version}"
 build_style=cmake
 configure_args="-DENABLE_UNSTABLE_API_ABI_HEADERS=ON -DENABLE_GLIB=OFF

From 66b1f5468350d9224eac19570cc5d70c08172e09 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: Sat, 27 Mar 2021 11:17:35 +0700
Subject: [PATCH 33/55] artyfx: remove -O1 -g

---
 srcpkgs/artyfx/patches/fix-avtk-cmake-sse.patch | 4 ++--
 srcpkgs/artyfx/patches/respect-our-cflags.patch | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/artyfx/patches/fix-avtk-cmake-sse.patch b/srcpkgs/artyfx/patches/fix-avtk-cmake-sse.patch
index 1a832155a566..47ef4dd9b84e 100644
--- a/srcpkgs/artyfx/patches/fix-avtk-cmake-sse.patch
+++ b/srcpkgs/artyfx/patches/fix-avtk-cmake-sse.patch
@@ -6,8 +6,8 @@
  
 -SET(CMAKE_C_FLAGS   "-fPIC -msse -msse2 -mfpmath=sse -g") # -fsanitize=address
 -SET(CMAKE_CXX_FLAGS "-fPIC -msse -msse2 -mfpmath=sse -g") # -fsanitize=address
-+SET(CMAKE_C_FLAGS   "${CMAKE_C_FLAGS} -fPIC -g") # -fsanitize=address
-+SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -g") # -fsanitize=address
++SET(CMAKE_C_FLAGS   "${CMAKE_C_FLAGS} -fPIC") # -fsanitize=address
++SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") # -fsanitize=address
 +
 +IF(BUILD_SSE)
 +	SET(CMAKE_C_FLAGS   "${CMAKE_C_FLAGS} -msse -msse2 -mfpmath=sse")
diff --git a/srcpkgs/artyfx/patches/respect-our-cflags.patch b/srcpkgs/artyfx/patches/respect-our-cflags.patch
index ee9155c7729e..7a32fd9df73b 100644
--- a/srcpkgs/artyfx/patches/respect-our-cflags.patch
+++ b/srcpkgs/artyfx/patches/respect-our-cflags.patch
@@ -10,8 +10,8 @@ Index: CMakeLists.txt
 -SET(CMAKE_C_FLAGS "-g -Wall -O1 -Wno-unused-variable")
 -SET(CMAKE_CXX_FLAGS "-g -Wall -O1 -Wno-unused-variable -ftree-vectorize")
 +SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fPIC -shared -L./src/avtk -Wl,--no-undefined")
-+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -Wall -O1 -Wno-unused-variable")
-+SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -Wall -O1 -Wno-unused-variable -ftree-vectorize")
++SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall  -Wno-unused-variable")
++SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall  -Wno-unused-variable -ftree-vectorize")
  
  
  # DSP sources

From 90813c81627143120b9da7f055a78f40b5b00347 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: Sat, 27 Mar 2021 11:27:28 +0700
Subject: [PATCH 34/55] coin3: build with CMAKE_BUILD_TYPE=None

---
 srcpkgs/coin3/template | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/coin3/template b/srcpkgs/coin3/template
index d5483ee048c3..8f7218c2e8c3 100644
--- a/srcpkgs/coin3/template
+++ b/srcpkgs/coin3/template
@@ -5,7 +5,7 @@ revision=1
 wrksrc="coin-Coin-${version}"
 build_style=cmake
 configure_args="-DCMAKE_INSTALL_INCLUDEDIR=/usr/include/Coin3
- -DCMAKE_BUILD_TYPE=Release -DCOIN_BUILD_TESTS=OFF -DCOIN_BUILD_DOCUMENTATION=ON"
+ -DCOIN_BUILD_TESTS=OFF -DCOIN_BUILD_DOCUMENTATION=ON"
 hostmakedepends="doxygen graphviz"
 makedepends="boost-devel glu-devel"
 short_desc="High-level 3D graphics toolkit"
@@ -15,6 +15,9 @@ homepage="https://coin3d.github.io/"
 distfiles="https://github.com/coin3d/coin/archive/Coin-${version}.tar.gz"
 checksum=b00d2a8e9d962397cf9bf0d9baa81bcecfbd16eef675a98c792f5cf49eb6e805
 
+CFLAGS=-DNDEBUG
+CXXFLAGS=-DNDEBUG
+
 if [ "$CROSS_BUILD" ]; then
 	# bypass runtime test (quote hashing is fine with gcc 9.3)
 	configure_args+=" -DHAVE_HASH_QUOTING_EXITCODE=0"

From 03e8b6fda409a611b61589375149510f1aa29b69 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: Sat, 27 Mar 2021 11:46:46 +0700
Subject: [PATCH 35/55] conky: don't overwrite CMAKE_BUILD_TYPE

---
 srcpkgs/conky/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/conky/template b/srcpkgs/conky/template
index 8b95a628edfb..f05c7d4a1bf2 100644
--- a/srcpkgs/conky/template
+++ b/srcpkgs/conky/template
@@ -5,7 +5,7 @@ version=1.12.1
 revision=1
 build_style=cmake
 conf_files="/etc/conky/conky.conf /etc/conky/conky_no_x11.conf"
-configure_args="-DCMAKE_BUILD_TYPE=Release -DMAINTAINER_MODE=ON -DRELEASE=ON
+configure_args="-DMAINTAINER_MODE=ON -DRELEASE=ON
  -DDOC_PATH=share/doc/${pkgname} -DBUILD_X11=ON -DBUILD_CURL=ON -DBUILD_XDBE=ON
  -DBUILD_RSS=ON -DBUILD_WEATHER_METAR=ON -DBUILD_IMLIB2=ON -DBUILD_WLAN=ON
  -DBUILD_LUA_CAIRO=ON -DBUILD_LUA_IMLIB2=ON -DBUILD_LUA_RSVG=ON

From 3fc9d69a8644d2024ba565ce7b49b69bcfedcd00 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: Sat, 27 Mar 2021 11:46:46 +0700
Subject: [PATCH 36/55] conky-cli: don't overwrite CMAKE_BUILD_TYPE

---
 srcpkgs/conky-cli/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/conky-cli/template b/srcpkgs/conky-cli/template
index b61bdcca0504..7d512b65ab3e 100644
--- a/srcpkgs/conky-cli/template
+++ b/srcpkgs/conky-cli/template
@@ -6,7 +6,7 @@ revision=1
 wrksrc="${pkgname/-cli/}-${version}"
 build_style=cmake
 conf_files="/etc/conky/conky.conf /etc/conky/conky_no_x11.conf"
-configure_args="-DCMAKE_BUILD_TYPE=Release -DMAINTAINER_MODE=ON -DRELEASE=ON
+configure_args="-DMAINTAINER_MODE=ON -DRELEASE=ON
  -DDOC_PATH=share/doc/${pkgname} -DBUILD_X11=OFF -DBUILD_CURL=ON -DBUILD_XDBE=OFF
  -DBUILD_RSS=ON -DBUILD_WEATHER_METAR=OFF -DBUILD_IMLIB2=OFF -DBUILD_WLAN=ON
  -DBUILD_DOCS=ON"

From 1da3b95083e94ba66b44d038a30e9dca677c52d6 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: Sat, 27 Mar 2021 11:48:25 +0700
Subject: [PATCH 37/55] crossguid: don't overwrite -O2

---
 srcpkgs/crossguid/fix-cflags.patch | 12 ++++++++++++
 1 file changed, 12 insertions(+)
 create mode 100644 srcpkgs/crossguid/fix-cflags.patch

diff --git a/srcpkgs/crossguid/fix-cflags.patch b/srcpkgs/crossguid/fix-cflags.patch
new file mode 100644
index 000000000000..983360a07ccf
--- /dev/null
+++ b/srcpkgs/crossguid/fix-cflags.patch
@@ -0,0 +1,12 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -2,7 +2,6 @@ cmake_minimum_required(VERSION 3.5.1)
+ project(CrossGuid)
+ 
+ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake")
+-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3")
+ 
+ option(XG_TESTS "Build test runner" ON)
+ 

From 54080ff581bd2a194f2304f4681bf2e67f13ba32 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: Sat, 27 Mar 2021 12:19:04 +0700
Subject: [PATCH 38/55] rapidjson: define -DNDEBUG

---
 srcpkgs/rapidjson/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/rapidjson/template b/srcpkgs/rapidjson/template
index 8597f8fb2706..99d92702cc9d 100644
--- a/srcpkgs/rapidjson/template
+++ b/srcpkgs/rapidjson/template
@@ -11,7 +11,7 @@ distfiles="https://github.com/miloyip/${pkgname}/archive/v${version}.tar.gz"
 checksum=bf7ced29704a1e696fbccf2a2b4ea068e7774fa37f6d7dd4039d0787f8bed98e
 
 # class-memaccess is required by https://github.com/Tencent/rapidjson/issues/1700
-CXXFLAGS="-Wno-type-limits -Wno-error=class-memaccess"
+CXXFLAGS="-Wno-type-limits -Wno-error=class-memaccess -DNDEBUG"
 
 post_patch() {
 	# Remove bin/jsonchecker, which is the JSON licensed files

From b733a9c7a88e2f7bb97024727723b02e7986faa4 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: Sat, 27 Mar 2021 12:18:36 +0700
Subject: [PATCH 39/55] cura-engine: ignore -O3

---
 srcpkgs/cura-engine/patches/fix-cflags.patch | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 srcpkgs/cura-engine/patches/fix-cflags.patch

diff --git a/srcpkgs/cura-engine/patches/fix-cflags.patch b/srcpkgs/cura-engine/patches/fix-cflags.patch
new file mode 100644
index 000000000000..e48a665523b8
--- /dev/null
+++ b/srcpkgs/cura-engine/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -42,7 +42,7 @@ endif()
+ if(CMAKE_BUILD_TYPE_UPPER MATCHES "DEBUG")
+     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_DEBUG_INIT}")
+ else()
+-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELEASE_INIT}")
++    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DNDEBUG")
+ endif()
+ 
+ set(CMAKE_CXX_STANDARD 11)

From da1b039e5a26db467ae1aff4d5ef82a20a30413d 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: Sat, 27 Mar 2021 12:22:29 +0700
Subject: [PATCH 40/55] dislocker: remove -O1

---
 srcpkgs/dislocker/patches/fix-cflags.patch | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 srcpkgs/dislocker/patches/fix-cflags.patch

diff --git a/srcpkgs/dislocker/patches/fix-cflags.patch b/srcpkgs/dislocker/patches/fix-cflags.patch
new file mode 100644
index 000000000000..1229efeeaf0c
--- /dev/null
+++ b/srcpkgs/dislocker/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: src/CMakeLists.txt
+===================================================================
+--- src/CMakeLists.txt.orig
++++ src/CMakeLists.txt
+@@ -71,7 +71,7 @@ if(NOT DEFINED WARN_FLAGS)
+ 	set (WARN_FLAGS "-Wall -Wextra" CACHE STRING "" FORCE)
+ endif()
+ if(NOT DEFINED HARDEN_FLAGS)
+-	set (HARDEN_FLAGS "-fstack-protector -fstrict-aliasing -D_FORTIFY_SOURCE=2 -O1" CACHE STRING "" FORCE)
++	set (HARDEN_FLAGS "-fstack-protector -fstrict-aliasing" CACHE STRING "" FORCE)
+ endif()
+ 
+ set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")

From d696b037e44e0f8f3a761053b5d457ed6c8bb358 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: Sat, 27 Mar 2021 12:29:31 +0700
Subject: [PATCH 41/55] freeorion: remove -O3

---
 srcpkgs/freeorion/patches/fix-cflags.patch | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
 create mode 100644 srcpkgs/freeorion/patches/fix-cflags.patch

diff --git a/srcpkgs/freeorion/patches/fix-cflags.patch b/srcpkgs/freeorion/patches/fix-cflags.patch
new file mode 100644
index 000000000000..c66d54599556
--- /dev/null
+++ b/srcpkgs/freeorion/patches/fix-cflags.patch
@@ -0,0 +1,18 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -432,13 +432,6 @@ if(MSVC)
+     )
+ endif()
+ 
+-target_compile_options(freeorionparseobj
+-    PRIVATE
+-        $<$<CXX_COMPILER_ID:Clang>:-ftemplate-depth=512>
+-        $<$<CXX_COMPILER_ID:AppleClang>:-ftemplate-depth=512>
+-        $<$<AND:$<NOT:$<BOOL:${BUILD_TESTING}>>,$<CXX_COMPILER_ID:GNU>>:-O3>
+-)
+-
+ target_compile_definitions(freeorionparseobj
+     PUBLIC
+         -DBOOST_ALL_DYN_LINK

From 91f356e7242e1f657c52912c875f0ff96e2d185e 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: Fri, 26 Mar 2021 09:01:12 +0700
Subject: [PATCH 42/55] cglm: fix build flags

---
 srcpkgs/cglm/patches/fix-cflags.patch | 13 +++++++++++++
 srcpkgs/cglm/template                 |  1 +
 2 files changed, 14 insertions(+)
 create mode 100644 srcpkgs/cglm/patches/fix-cflags.patch

diff --git a/srcpkgs/cglm/patches/fix-cflags.patch b/srcpkgs/cglm/patches/fix-cflags.patch
new file mode 100644
index 000000000000..c74de6ea62d7
--- /dev/null
+++ b/srcpkgs/cglm/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: cglm-0.7.6/CMakeLists.txt
+===================================================================
+--- cglm-0.7.6.orig/CMakeLists.txt
++++ cglm-0.7.6/CMakeLists.txt
+@@ -25,7 +25,7 @@ if(MSVC)
+ 	add_definitions(-DNDEBUG -D_WINDOWS -D_USRDLL -DCGLM_EXPORTS -DCGLM_DLL)
+ 	add_compile_options(/W3 /Ox /Gy /Oi /TC)
+ else()
+-  add_compile_options(-Wall -Werror -O3)
++  add_compile_options(-Wall)
+ endif()
+ 
+ if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
diff --git a/srcpkgs/cglm/template b/srcpkgs/cglm/template
index f00a093edab9..311b4c79a7d3 100644
--- a/srcpkgs/cglm/template
+++ b/srcpkgs/cglm/template
@@ -9,6 +9,7 @@ license="MIT"
 homepage="https://github.com/recp/cglm"
 distfiles="https://github.com/recp/cglm/archive/v${version}.tar.gz"
 checksum=29ff8af4edc03697e36d3e6f99a80b884a80ee09d46055ce45765e5d6b2456d9
+patch_args=-Np1
 
 post_install() {
 	vlicense LICENSE

From 17a62c8e0e65e0f9ad5e4f8a307b4306500c4682 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: Sat, 27 Mar 2021 12:36:19 +0700
Subject: [PATCH 43/55] glyr: don't force Release build

---
 srcpkgs/glyr/patches/fix-cflags.patch | 12 ++++++++++++
 1 file changed, 12 insertions(+)
 create mode 100644 srcpkgs/glyr/patches/fix-cflags.patch

diff --git a/srcpkgs/glyr/patches/fix-cflags.patch b/srcpkgs/glyr/patches/fix-cflags.patch
new file mode 100644
index 000000000000..498ffe09a38f
--- /dev/null
+++ b/srcpkgs/glyr/patches/fix-cflags.patch
@@ -0,0 +1,12 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -60,7 +60,6 @@ exec_program(
+ IF(CMAKE_BUILD_TYPE STREQUAL "debug")
+     SET(GLYR_DEBUG TRUE)
+ ELSE()
+-    SET(CMAKE_BUILD_TYPE "release")
+     SET(GLYR_DEBUG FALSE)
+ ENDIF()
+ MESSAGE("-- Building Target: ${CMAKE_BUILD_TYPE}")

From 3835ff6ca73a86bcd48492781c8848303a1684e9 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: Sat, 27 Mar 2021 12:41:50 +0700
Subject: [PATCH 44/55] hugin: remove -O3

---
 srcpkgs/hugin/patches/fix-cflags.patch | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
 create mode 100644 srcpkgs/hugin/patches/fix-cflags.patch

diff --git a/srcpkgs/hugin/patches/fix-cflags.patch b/srcpkgs/hugin/patches/fix-cflags.patch
new file mode 100644
index 000000000000..02fa56bef0e1
--- /dev/null
+++ b/srcpkgs/hugin/patches/fix-cflags.patch
@@ -0,0 +1,15 @@
+Index: src/celeste/CMakeLists.txt
+===================================================================
+--- src/celeste/CMakeLists.txt.orig
++++ src/celeste/CMakeLists.txt
+@@ -16,10 +16,6 @@
+ #    You should have received a copy of the GNU General Public License
+ #    along with Hugin  If not, see <http://www.gnu.org/licenses/>.
+  
+-IF(NOT WIN32)
+-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3")
+-ENDIF(NOT WIN32)
+-
+ # a list of all files belonging to celeste library
+ 
+ SET(CELESTE_SRC

From 3136d268326d0b0165734b46e40b70288c393b0a 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: Sat, 27 Mar 2021 13:05:27 +0700
Subject: [PATCH 45/55] ledger: don't overwrite CMAKE_BUILD_TYPE

---
 srcpkgs/ledger/patches/fix-cflags.patch | 12 ++++++++++++
 1 file changed, 12 insertions(+)
 create mode 100644 srcpkgs/ledger/patches/fix-cflags.patch

diff --git a/srcpkgs/ledger/patches/fix-cflags.patch b/srcpkgs/ledger/patches/fix-cflags.patch
new file mode 100644
index 000000000000..179ab79cd148
--- /dev/null
+++ b/srcpkgs/ledger/patches/fix-cflags.patch
@@ -0,0 +1,12 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -41,7 +41,6 @@ if (BUILD_DEBUG)
+   set(CMAKE_BUILD_TYPE Debug)
+   set(DEBUG_MODE 1)
+ else()
+-  set(CMAKE_BUILD_TYPE Release)
+   set(DEBUG_MODE 0)
+ endif()
+ 

From 8ca408695483d46b50476d60edfc75c1694eb4ea 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: Sat, 27 Mar 2021 13:18:24 +0700
Subject: [PATCH 46/55] libmygpo-qt: remove -ggdb3

---
 srcpkgs/libmygpo-qt/patches/fix-cflags.patch | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 srcpkgs/libmygpo-qt/patches/fix-cflags.patch

diff --git a/srcpkgs/libmygpo-qt/patches/fix-cflags.patch b/srcpkgs/libmygpo-qt/patches/fix-cflags.patch
new file mode 100644
index 000000000000..9940b6fc4323
--- /dev/null
+++ b/srcpkgs/libmygpo-qt/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -69,7 +69,7 @@ if (CMAKE_COMPILER_IS_GNUCXX)
+        -Wwrite-strings -Wpacked -Wformat-security -Wmissing-format-attribute
+        -Wold-style-cast -Woverloaded-virtual -Wnon-virtual-dtor  -Wall -Wextra
+        -Wformat=2 -Wundef -Wstack-protector -Wmissing-include-dirs
+-       -Winit-self -Wunsafe-loop-optimizations  -ggdb3 -fno-inline -DQT_STRICT_ITERATORS )
++       -Winit-self -Wunsafe-loop-optimizations  -fno-inline -DQT_STRICT_ITERATORS )
+     if ( NOT WIN32 )
+         add_definitions( -fvisibility=hidden )
+     endif()

From b23a0e23a7327baed0cc7f8d4291591333dc069f 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: Sat, 27 Mar 2021 13:48:38 +0700
Subject: [PATCH 47/55] libogre: don't build vendored libraries

---
 srcpkgs/libogre/template | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/srcpkgs/libogre/template b/srcpkgs/libogre/template
index 784e3a648bac..6dd88ea08c73 100644
--- a/srcpkgs/libogre/template
+++ b/srcpkgs/libogre/template
@@ -3,11 +3,8 @@ pkgname=libogre
 version=1.12.9
 revision=1
 build_style=cmake
-configure_args="-DCMAKE_INSTALL_PREFIX=/usr \
-	-DOGRE_INSTALL_SAMPLES=TRUE \
-	-DOGRE_INSTALL_DOCS=TRUE \
-	-DOGRE_INSTALL_SAMPLES_SOURCE=TRUE \
-	-DCMAKE_BUILD_TYPE=Release"
+configure_args="-DOGRE_INSTALL_SAMPLES=TRUE -DOGRE_INSTALL_DOCS=TRUE
+ -DOGRE_INSTALL_SAMPLES_SOURCE=TRUE -DOGRE_BUILD_DEPENDENCIES=FALSE"
 hostmakedepends="pkg-config graphviz doxygen dejavu-fonts-ttf"
 makedepends="boost-devel freetype-devel libXaw-devel libXrandr-devel
  MesaLib-devel zziplib-devel libcppunit-devel glu-devel libatomic-devel

From 8f98c1074196a4fe8ce01ca10ad3e5b0ac3b5deb 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: Sat, 27 Mar 2021 13:52:50 +0700
Subject: [PATCH 48/55] libopenglrecorder: remove -O3

---
 srcpkgs/libopenglrecorder/patches/fix-cflags.patch | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 srcpkgs/libopenglrecorder/patches/fix-cflags.patch

diff --git a/srcpkgs/libopenglrecorder/patches/fix-cflags.patch b/srcpkgs/libopenglrecorder/patches/fix-cflags.patch
new file mode 100644
index 000000000000..7c48a0d2d822
--- /dev/null
+++ b/srcpkgs/libopenglrecorder/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -21,7 +21,7 @@ if (UNIX OR MINGW)
+     if (CMAKE_BUILD_TYPE MATCHES Debug)
+         add_definitions(-std=gnu++0x -O0)
+     else()
+-        add_definitions(-std=gnu++0x -O3)
++        add_definitions(-std=gnu++0x)
+     endif()
+ endif()
+ 

From e22405b0d9f79f4a7ab37841ebc59139941bfbce 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: Sat, 27 Mar 2021 13:55:41 +0700
Subject: [PATCH 49/55] libvidstab: remove -O3

---
 srcpkgs/libvidstab/patches/fix-cflags.patch | 39 +++++++++++++++++++++
 1 file changed, 39 insertions(+)
 create mode 100644 srcpkgs/libvidstab/patches/fix-cflags.patch

diff --git a/srcpkgs/libvidstab/patches/fix-cflags.patch b/srcpkgs/libvidstab/patches/fix-cflags.patch
new file mode 100644
index 000000000000..51c357efb101
--- /dev/null
+++ b/srcpkgs/libvidstab/patches/fix-cflags.patch
@@ -0,0 +1,39 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -25,7 +25,7 @@ else()
+     set(LIBSUFFIX "")
+ endif()
+ 
+-add_definitions( -Wall -O3 -g -Wno-pointer-sign -fPIC -std=gnu99)
++add_definitions( -Wall -Wno-pointer-sign -fPIC -std=gnu99)
+ # add_definitions(  -Wall -O0 -g -Wno-pointer-sign )
+ 
+ ### ORC is not used in any active code at the moment  ###
+Index: tests/CMakeLists.txt
+===================================================================
+--- tests/CMakeLists.txt.orig
++++ tests/CMakeLists.txt
+@@ -11,7 +11,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PAT
+ option(USE_OMP "use parallelization use OMP" ON)
+ 
+ #add_definitions( -Wall -O3 -Wno-pointer-sign -DTESTING  -std=gnu99)
+-add_definitions(  -Wall -O0 -g -Wno-pointer-sign -DTESTING -std=gnu99)
++add_definitions(  -Wall -Wno-pointer-sign -DTESTING -std=gnu99)
+ find_package(Orc)
+ if(ORC_FOUND)
+ add_definitions( -DUSE_ORC ${ORC_DEFINITIONS})
+Index: transcode/CMakeLists.txt
+===================================================================
+--- transcode/CMakeLists.txt.orig
++++ transcode/CMakeLists.txt
+@@ -9,7 +9,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PAT
+ set(TRANSCODE_ROOT ../../transcode)
+ 
+ 
+-add_definitions( -Wall -O3 -Wno-pointer-sign -DTRANSCODE -std=gnu99)
++add_definitions( -Wall -Wno-pointer-sign -DTRANSCODE -std=gnu99)
+ #add_definitions(  -Wall -O0 -g -Wno-pointer-sign )
+ # I tried it with 0.4.14
+ #  0.4.10 did not work (not all opcode implemented)

From 76996b6ee1d983b62dadd8ccaa1d0d36207af8c0 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: Sat, 27 Mar 2021 14:18:34 +0700
Subject: [PATCH 50/55] openlierox: don't overwrote CMAKE_BUILD_TYPE

---
 srcpkgs/openlierox/patches/fix-cflags.patch | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
 create mode 100644 srcpkgs/openlierox/patches/fix-cflags.patch

diff --git a/srcpkgs/openlierox/patches/fix-cflags.patch b/srcpkgs/openlierox/patches/fix-cflags.patch
new file mode 100644
index 000000000000..4fe6652fd0a2
--- /dev/null
+++ b/srcpkgs/openlierox/patches/fix-cflags.patch
@@ -0,0 +1,17 @@
+Index: CMakeOlxCommon.cmake
+===================================================================
+--- CMakeOlxCommon.cmake.orig
++++ CMakeOlxCommon.cmake
+@@ -36,12 +36,6 @@ OPTION(BREAKPAD "Google Breakpad support
+ OPTION(DISABLE_JOYSTICK "Disable joystick support" No)
+ OPTION(MINGW_CROSS_COMPILE "Cross-compile Windows .EXE using i686-w64-mingw32-gcc compiler" No)
+ 
+-IF (DEBUG)
+-	SET(CMAKE_BUILD_TYPE Debug)
+-ELSE (DEBUG)
+-	SET(CMAKE_BUILD_TYPE Release)
+-ENDIF (DEBUG)
+-
+ IF (DEDICATED_ONLY)
+ 	SET(X11 No)
+ 	SET(WITH_G15 No)

From b94c3c020ffda6ed82417adf30eaaf93c0ef5d4f 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: Sat, 27 Mar 2021 14:25:12 +0700
Subject: [PATCH 51/55] opensonic: don't overwrite CMAKE_BUILD_TYPE

---
 srcpkgs/opensonic/patches/fix-cflags.patch | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
 create mode 100644 srcpkgs/opensonic/patches/fix-cflags.patch

diff --git a/srcpkgs/opensonic/patches/fix-cflags.patch b/srcpkgs/opensonic/patches/fix-cflags.patch
new file mode 100644
index 000000000000..10d2c7c80e64
--- /dev/null
+++ b/srcpkgs/opensonic/patches/fix-cflags.patch
@@ -0,0 +1,17 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -25,12 +25,10 @@ SET(GAME_NAME "Open Sonic")
+ SET(GAME_VERSION "0.1.4")
+ SET(RTFM "Please read the user manual (readme.html) to get help.")
+ SET(ALLEGRO_RECOMMENDED_VERSION "4.4.1")
+-SET(CMAKE_BUILD_TYPE Release)
+ MESSAGE("${GAME_NAME} version ${GAME_VERSION}")
+ 
+ # configuring...
+ SET(DEFS "")
+-SET(CFLAGS_EXTRA "-g")
+ SET(CFLAGS "${CFLAGS} ${CMAKE_C_FLAGS}")
+ MESSAGE("Using CFLAGS='${CFLAGS}'")
+ 

From a8977d46fe0ffc58ae248aed254580b9e263f108 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: Sat, 27 Mar 2021 15:17:28 +0700
Subject: [PATCH 52/55] rocksdb: don't overwrite CMAKE_BUILD_TYPE

---
 srcpkgs/rocksdb/template | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/rocksdb/template b/srcpkgs/rocksdb/template
index e39329e5d6a6..5a6ca434f29b 100644
--- a/srcpkgs/rocksdb/template
+++ b/srcpkgs/rocksdb/template
@@ -3,8 +3,7 @@ pkgname=rocksdb
 version=5.18.3
 revision=2
 build_style=cmake
-configure_args="-DCMAKE_BUILD_TYPE=Release -DPORTABLE=1 -DWITH_TESTS=0
- -DUSE_RTTI=0 -DWITH_LZ4=1"
+configure_args="-DPORTABLE=1 -DWITH_TESTS=0 -DUSE_RTTI=0 -DWITH_LZ4=1"
 makedepends="liblz4-devel"
 short_desc="RocksDB is a embeddable, persistent key-value store for fast storage"
 maintainer="magenbluten <mb0@codemonkey.cc>"
@@ -12,6 +11,8 @@ license="GPL-2.0-or-later, Apache-2.0"
 homepage="https://github.com/facebook/rocksdb"
 distfiles="${homepage}/archive/v${version}.tar.gz"
 checksum=7fb6738263d3f2b360d7468cf2ebe333f3109f3ba1ff80115abd145d75287254
+CFLAGS=-DNDEBUG
+CXXFLAGS=-DNDEBUG
 
 if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
 	makedepends+=" libatomic-devel"

From 77a508fe68f3c83a9fdea7d94b00794697a08ff7 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: Sat, 27 Mar 2021 15:19:47 +0700
Subject: [PATCH 53/55] rofs-filtered: hardening

---
 srcpkgs/rofs-filtered/patches/fix-cflags.patch | 13 +++++++++++++
 srcpkgs/rofs-filtered/template                 |  2 +-
 2 files changed, 14 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/rofs-filtered/patches/fix-cflags.patch

diff --git a/srcpkgs/rofs-filtered/patches/fix-cflags.patch b/srcpkgs/rofs-filtered/patches/fix-cflags.patch
new file mode 100644
index 000000000000..f64d3274f091
--- /dev/null
+++ b/srcpkgs/rofs-filtered/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -9,7 +9,7 @@ set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PA
+      "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
+ 
+ add_definitions(-D_GNU_SOURCE)
+-set(CMAKE_C_FLAGS "-Wall -std=c99")
++set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -std=c99")
+ 
+ # find fuse library
+ find_package (FUSE REQUIRED)
diff --git a/srcpkgs/rofs-filtered/template b/srcpkgs/rofs-filtered/template
index 332cd57a9902..e585877eaf59 100644
--- a/srcpkgs/rofs-filtered/template
+++ b/srcpkgs/rofs-filtered/template
@@ -1,7 +1,7 @@
 # Template file for 'rofs-filtered'
 pkgname=rofs-filtered
 version=1.7
-revision=1
+revision=2
 build_style=cmake
 makedepends="fuse-devel"
 short_desc="Filtered read only filesystem for FUSE"

From ac027dab8d60f67e8aaf98a5d50e9f6af887561f 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: Sat, 27 Mar 2021 15:40:26 +0700
Subject: [PATCH 54/55] seexpr-krita: don't overwrite CMAKE_BUILD_TYPE

---
 .../patches/cmake-build-type-none.patch       | 32 +++++++++++++++++++
 1 file changed, 32 insertions(+)
 create mode 100644 srcpkgs/seexpr-krita/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/seexpr-krita/patches/cmake-build-type-none.patch b/srcpkgs/seexpr-krita/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..94bb1f37db75
--- /dev/null
+++ b/srcpkgs/seexpr-krita/patches/cmake-build-type-none.patch
@@ -0,0 +1,32 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -42,14 +42,6 @@ endif()
+ 
+ ## Choose build options
+ # Disney specific method of choosing variant
+-if (${FLAVOR} STREQUAL "optimize")
+-    set(CMAKE_BUILD_TYPE "Release" CACHE STRING "type of build" FORCE)
+-endif()
+-
+-if (${FLAVOR} STREQUAL "debug")
+-    set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "type of build" FORCE)
+-endif()
+-
+ if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
+     execute_process(
+         COMMAND sh -c "echo `uname -s`-`uname -r | cut -d- -f1`-`uname -m`"
+@@ -212,12 +204,6 @@ else()
+ endif()
+ 
+ # Set to release if nothing else defined
+-if (NOT CMAKE_BUILD_TYPE)
+-  set(CMAKE_BUILD_TYPE "Release" CACHE STRING
+-      "Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel."
+-      FORCE)
+-endif()
+-
+ if (ENABLE_QT5)
+     find_package(Qt5 5.9.0 COMPONENTS Core Gui Widgets REQUIRED)
+     set_package_properties(Qt5 PROPERTIES

From b79bc64acaa582acd26c7359344870b5c70d5bba 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: Sat, 27 Mar 2021 15:50:53 +0700
Subject: [PATCH 55/55] speed-dreams: hardening

---
 srcpkgs/speed-dreams/template | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/speed-dreams/template b/srcpkgs/speed-dreams/template
index 722f0c5ed87a..df7164f9c808 100644
--- a/srcpkgs/speed-dreams/template
+++ b/srcpkgs/speed-dreams/template
@@ -1,13 +1,13 @@
 # Template file for 'speed-dreams'
 pkgname=speed-dreams
 version=2.2.2
-revision=2
+revision=3
 archs="i686* x86_64* ppc64le*"
 _rev=r6553
 create_wrksrc=yes
 build_style=cmake
-configure_args="-DSD_BINDIR=/usr/bin -DSD_DATADIR=/usr/share/speed-dreams-2 -DSD_LIBDIR=/usr/lib/speed-dreams-2
- -DOPTION_OFFICIAL_ONLY=ON -DCMAKE_CXX_FLAGS=-fpermissive -DCMAKE_C_FLAGS=-fpermissive"
+configure_args="-DSD_BINDIR=/usr/bin -DSD_DATADIR=/usr/share/speed-dreams-2
+ -DSD_LIBDIR=/usr/lib/speed-dreams-2 -DOPTION_OFFICIAL_ONLY=ON"
 hostmakedepends="pkg-config"
 makedepends="freealut-devel libenet-devel libfreeglut-devel libjpeg-turbo-devel
  libpng-devel libvorbis-devel libXrandr-devel osg-devel plib-devel SDL2-devel
@@ -26,6 +26,8 @@ checksum="32aa55c17f8dafc1c54fb0d0b7b993d2688d431899cfc5db9eeece148c6887d0
  0b7b417d007ab3b7f0f4dcfdc868aafee1722150b81af519e1cd4c082b408183"
 nocross=yes
 replaces="speed-dreams-data>=0"
+CFLAGS=-fpermissive
+CXXFLAGS=-fpermissive
 
 if [ "$XBPS_TARGET_LIBC" = musl ]; then
 	broken="Segmentation fault"

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PR PATCH] [Updated] build-style/cmake: set CMAKE_BUILD_TYPE to None
  2021-03-14 13:19 [PR PATCH] [WIP] build-style/cmake: set CMAKE_BUILD_TYPE to None sgn
                   ` (21 preceding siblings ...)
  2021-03-27  8:51 ` [PR PATCH] [Updated] " sgn
@ 2021-03-27 12:30 ` sgn
  2021-03-27 12:33 ` sgn
                   ` (9 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: sgn @ 2021-03-27 12:30 UTC (permalink / raw)
  To: ml

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

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

https://github.com/sgn/void-packages cmake-build-type-to-None
https://github.com/void-linux/void-packages/pull/29459

build-style/cmake: set CMAKE_BUILD_TYPE to None
- I'm going to build all packages with `build_style=cmake` and fix them one by one before merging this in.

[ci skip]

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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-cmake-build-type-to-None-29459.patch --]
[-- Type: text/x-diff, Size: 112195 bytes --]

From c689c6f7b4e4dde56b163fd8a7435f106eed995b 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, 14 Mar 2021 20:18:03 +0700
Subject: [PATCH 01/60] build-style/cmake: set CMAKE_BUILD_TYPE to None

---
 common/build-style/cmake.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/build-style/cmake.sh b/common/build-style/cmake.sh
index 5100a96dfd7b..9d1a1a7a1941 100644
--- a/common/build-style/cmake.sh
+++ b/common/build-style/cmake.sh
@@ -52,7 +52,7 @@ _EOF
 		cmake_args+=" -DCMAKE_TOOLCHAIN_FILE=cross_${XBPS_CROSS_TRIPLET}.cmake"
 	fi
 	cmake_args+=" -DCMAKE_INSTALL_PREFIX=/usr"
-	cmake_args+=" -DCMAKE_BUILD_TYPE=Release"
+	cmake_args+=" -DCMAKE_BUILD_TYPE=None"
 	cmake_args+=" -DCMAKE_INSTALL_LIBDIR=lib${XBPS_TARGET_WORDSIZE}"
 
 	if [[ $build_helper = *"qemu"* ]]; then

From 9fd574422a1c9c3cb4c21e25dd4201d7cab1e2df 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: Mon, 15 Mar 2021 08:07:16 +0700
Subject: [PATCH 02/60] amdvlk: allow CMAKE_BUILD_TYPE=None

---
 .../patches/cmake-build-type-none.patch       | 60 +++++++++++++++++++
 1 file changed, 60 insertions(+)
 create mode 100644 srcpkgs/amdvlk/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/amdvlk/patches/cmake-build-type-none.patch b/srcpkgs/amdvlk/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..7a629e58548e
--- /dev/null
+++ b/srcpkgs/amdvlk/patches/cmake-build-type-none.patch
@@ -0,0 +1,60 @@
+Index: llvm-project/llvm/CMakeLists.txt
+===================================================================
+--- llvm-project/llvm/CMakeLists.txt.orig
++++ llvm-project/llvm/CMakeLists.txt
+@@ -251,11 +251,6 @@ endif()
+ 
+ string(TOUPPER "${CMAKE_BUILD_TYPE}" uppercase_CMAKE_BUILD_TYPE)
+ 
+-if (CMAKE_BUILD_TYPE AND
+-    NOT uppercase_CMAKE_BUILD_TYPE MATCHES "^(DEBUG|RELEASE|RELWITHDEBINFO|MINSIZEREL)$")
+-  message(FATAL_ERROR "Invalid value for CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
+-endif()
+-
+ set(LLVM_LIBDIR_SUFFIX "" CACHE STRING "Define suffix of library directory name (32/64)" )
+ 
+ set(LLVM_TOOLS_INSTALL_DIR "bin" CACHE STRING "Path for binary subdirectory (defaults to 'bin')")
+Index: pal/cmake/Modules/AmdCmakeHelper.cmake
+===================================================================
+--- pal/cmake/Modules/AmdCmakeHelper.cmake.orig
++++ pal/cmake/Modules/AmdCmakeHelper.cmake
+@@ -37,11 +37,6 @@ if (CMAKE_CONFIGURATION_TYPES)
+ else()
+     string(TOUPPER "${CMAKE_BUILD_TYPE}" capital_CMAKE_BUILD_TYPE)
+ 
+-    if (CMAKE_BUILD_TYPE AND
+-        NOT capital_CMAKE_BUILD_TYPE MATCHES "^(DEBUG|RELEASE|RELWITHDEBINFO|MINSIZEREL)$")
+-        message(FATAL_ERROR "Invalid value for CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
+-    endif()
+-
+     if(capital_CMAKE_BUILD_TYPE STREQUAL "DEBUG")
+         set(CMAKE_BUILD_TYPE_DEBUG ON)
+         set(CMAKE_BUILD_TYPE_RELEASE OFF)
+Index: xgl/CMakeLists.txt
+===================================================================
+--- xgl/CMakeLists.txt.orig
++++ xgl/CMakeLists.txt
+@@ -181,11 +181,6 @@ if (CMAKE_CONFIGURATION_TYPES)
+ else()
+     string(TOUPPER "${CMAKE_BUILD_TYPE}" capital_CMAKE_BUILD_TYPE)
+ 
+-    if (CMAKE_BUILD_TYPE AND
+-        NOT capital_CMAKE_BUILD_TYPE MATCHES "^(DEBUG|RELEASE|RELWITHDEBINFO|MINSIZEREL)$")
+-        message(FATAL_ERROR "Invalid value for CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
+-    endif()
+-
+     if(capital_CMAKE_BUILD_TYPE STREQUAL "DEBUG")
+         set(CMAKE_BUILD_TYPE_DEBUG ON)
+         set(CMAKE_BUILD_TYPE_RELEASE OFF)
+Index: xgl/icd/CMakeLists.txt
+===================================================================
+--- xgl/icd/CMakeLists.txt.orig
++++ xgl/icd/CMakeLists.txt
+@@ -84,7 +84,6 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Cl
+     endif()
+ 
+     if(CMAKE_BUILD_TYPE_RELEASE)
+-        target_compile_options(xgl PRIVATE -O3)
+         if(XGL_ENABLE_LTO)
+             if(${CMAKE_CXX_COMPILER_ID} MATCHES "GNU")
+                 execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION)

From dd120cf233fb6f92850b034f78b3135fa70208f0 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: Wed, 17 Mar 2021 06:24:04 +0700
Subject: [PATCH 03/60] eigen*: set CMAKE_BUILD_TYPE to Release

We're going to set default CMAKE_BUILD_TYPE to None soon. Those packages
are header only libraries, no need to waste time on patching.
---
 srcpkgs/eigen/template    | 1 +
 srcpkgs/eigen3.2/template | 1 +
 2 files changed, 2 insertions(+)

diff --git a/srcpkgs/eigen/template b/srcpkgs/eigen/template
index ee825e95f273..072228c16915 100644
--- a/srcpkgs/eigen/template
+++ b/srcpkgs/eigen/template
@@ -3,6 +3,7 @@ pkgname=eigen
 version=3.3.9
 revision=1
 build_style=cmake
+configure_args="-DCMAKE_BUILD_TYPE=Release"
 short_desc="C++ template library for linear algebra (version 3.x)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MPL-2.0, GPL-3.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
diff --git a/srcpkgs/eigen3.2/template b/srcpkgs/eigen3.2/template
index 5715fc1b3a19..7b710534b5e5 100644
--- a/srcpkgs/eigen3.2/template
+++ b/srcpkgs/eigen3.2/template
@@ -4,6 +4,7 @@ version=3.2.10
 revision=3
 wrksrc="eigen-${version}"
 build_style=cmake
+configure_args="-DCMAKE_BUILD_TYPE=Release"
 short_desc="C++ template library for linear algebra (version 3.x)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MPL-2.0, GPL-3.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"

From 9b9479f8ca54e6b305003131143bdc746dd72492 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: Wed, 17 Mar 2021 07:04:48 +0700
Subject: [PATCH 04/60] embree: don't ignore CXXFLAGS, fix build with ispc
 1.13+

---
 .../embree/patches/uintNN-is-part-of-ispc-1.13.patch | 12 ++++++++++++
 srcpkgs/embree/template                              |  6 ++----
 2 files changed, 14 insertions(+), 4 deletions(-)
 create mode 100644 srcpkgs/embree/patches/uintNN-is-part-of-ispc-1.13.patch

diff --git a/srcpkgs/embree/patches/uintNN-is-part-of-ispc-1.13.patch b/srcpkgs/embree/patches/uintNN-is-part-of-ispc-1.13.patch
new file mode 100644
index 000000000000..5d0b02f3b2e5
--- /dev/null
+++ b/srcpkgs/embree/patches/uintNN-is-part-of-ispc-1.13.patch
@@ -0,0 +1,12 @@
+Index: embree-2.17.7/tutorials/common/common.isph
+===================================================================
+--- embree-2.17.7.orig/tutorials/common/common.isph
++++ embree-2.17.7/tutorials/common/common.isph
+@@ -16,7 +16,3 @@
+ 
+ #pragma once
+ 
+-typedef unsigned int64 uint64;
+-typedef unsigned int32 uint32;
+-typedef unsigned int16 uint16;
+-typedef unsigned int8  uint8;
diff --git a/srcpkgs/embree/template b/srcpkgs/embree/template
index 0bc72f46b6d8..849ec3c26c1d 100644
--- a/srcpkgs/embree/template
+++ b/srcpkgs/embree/template
@@ -4,6 +4,7 @@ version=2.17.7
 revision=2
 archs="x86_64"
 build_style=cmake
+configure_args="-DTBB_ROOT=/usr -DEMBREE_IGNORE_CMAKE_CXX_FLAGS=OFF"
 hostmakedepends="ispc"
 makedepends="libfreeglut-devel libXmu-devel tbb-devel MesaLib-devel libpng-devel
  libopenexr-devel libjpeg-turbo-devel libmagick-devel"
@@ -13,10 +14,7 @@ license="Apache-2.0"
 homepage="https://embree.github.io/"
 distfiles="https://github.com/$pkgname/$pkgname/archive/v$version.tar.gz"
 checksum=c0694f287fa1fbb382aba3a895702e248d92f7e89c0e5f64aefee965482ec04c
-
-nopie=y
-
-configure_args="-DTBB_ROOT=/usr -DENABLE_TUTORIALS=OFF"
+patch_args=-Np1
 
 embree-devel_package() {
 	depends="${sourcepkg}>=${version}_${revision}"

From 9bb1bbe9f5bbc7f837dc83583cc4ceec4df18077 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: Wed, 17 Mar 2021 07:35:19 +0700
Subject: [PATCH 05/60] ettercap: remove libressl patch, CMAKE_BUILD_TYPE=None

---
 .../patches/allow-build-type-none.patch       | 24 ++++++++++++++
 srcpkgs/ettercap/patches/libressl.patch       | 31 -------------------
 srcpkgs/ettercap/template                     |  9 ++++--
 3 files changed, 31 insertions(+), 33 deletions(-)
 create mode 100644 srcpkgs/ettercap/patches/allow-build-type-none.patch
 delete mode 100644 srcpkgs/ettercap/patches/libressl.patch

diff --git a/srcpkgs/ettercap/patches/allow-build-type-none.patch b/srcpkgs/ettercap/patches/allow-build-type-none.patch
new file mode 100644
index 000000000000..324d75086b05
--- /dev/null
+++ b/srcpkgs/ettercap/patches/allow-build-type-none.patch
@@ -0,0 +1,24 @@
+Index: ettercap-0.8.3.1/CMakeLists.txt
+===================================================================
+--- ettercap-0.8.3.1.orig/CMakeLists.txt
++++ ettercap-0.8.3.1/CMakeLists.txt
+@@ -22,19 +22,6 @@ option(LIBRARY_BUILD "Build for libetter
+ option(INSTALL_DESKTOP "Install ettercap desktop files" ON)
+ 
+ 
+-set(VALID_BUILD_TYPES Debug Release RelWithDebInfo)
+-
+-if(NOT CMAKE_BUILD_TYPE)
+-  # Default to using "Release" as our build type.
+-  set(CMAKE_BUILD_TYPE "Release" CACHE STRING
+-    "Choose the type of build, options are: ${VALID_BUILD_TYPES}." FORCE)
+-endif()
+-list(FIND VALID_BUILD_TYPES ${CMAKE_BUILD_TYPE} contains_valid)
+-if(contains_valid EQUAL -1)
+-  message(FATAL_ERROR "Unknown CMAKE_BUILD_TYPE: '${CMAKE_BUILD_TYPE}'. Valid options are: ${VALID_BUILD_TYPES}")
+-endif()
+-unset(contains_valid)
+-
+ include(CMakeDependentOption)
+ 
+ # If SYSTEM_LIBS is set to off, then all SYSTEM_* options will be
diff --git a/srcpkgs/ettercap/patches/libressl.patch b/srcpkgs/ettercap/patches/libressl.patch
deleted file mode 100644
index 15e0d3c1c9e7..000000000000
--- a/srcpkgs/ettercap/patches/libressl.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From b2f7634c9dbc0ef68640f0571787d92300e9f9f9 Mon Sep 17 00:00:00 2001
-From: Stefan Strogin <stefan@steils.org>
-Date: Sat, 15 Aug 2020 07:18:31 +0300
-Subject: [PATCH] ec_sslwrap: fix compilation with LibreSSL
-
-Disable taking over SNI extension from ClientHello and SSL configuration
-operations until LibreSSL supports the required API.
-
-Fixes: https://github.com/Ettercap/ettercap/issues/1068
----
- src/ec_sslwrap.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git src/ec_sslwrap.c src/ec_sslwrap.c
-index b9f26a142..1e4c24fc1 100644
---- src/ec_sslwrap.c
-+++ src/ec_sslwrap.c
-@@ -71,11 +71,11 @@
- #define TLS_server_method SSLv23_server_method
- #endif
- 
--#if (OPENSSL_VERSION_NUMBER >= 0x10100000L)
-+#if (OPENSSL_VERSION_NUMBER >= 0x10100000L) && !defined(LIBRESSL_VERSION_NUMBER)
- #define HAVE_OPENSSL_1_1_0
- #endif
- 
--#if (OPENSSL_VERSION_NUMBER >= 0x10101000L)
-+#if (OPENSSL_VERSION_NUMBER >= 0x10101000L) && !defined(LIBRESSL_VERSION_NUMBER)
- #define HAVE_OPENSSL_1_1_1
- #endif
- 
diff --git a/srcpkgs/ettercap/template b/srcpkgs/ettercap/template
index 7fe4c340a079..611b4e9aded7 100644
--- a/srcpkgs/ettercap/template
+++ b/srcpkgs/ettercap/template
@@ -3,8 +3,8 @@ pkgname=ettercap
 version=0.8.3.1
 revision=2
 build_style=cmake
-configure_args="-DENABLE_GTK=OFF"
-hostmakedepends="flex"
+configure_args="-DENABLE_GTK=OFF -DBUNDLED_LIBS=OFF"
+hostmakedepends="flex pkg-config"
 makedepends="geoip-devel ncurses-devel openssl-devel libcurl-devel
  libltdl-devel libnet-devel libpcap-devel pcre-devel"
 conf_files="/etc/${pkgname}/etter.conf"
@@ -15,5 +15,10 @@ homepage="http://ettercap.github.com/ettercap/"
 distfiles="https://github.com/Ettercap/ettercap/archive/v${version}.tar.gz"
 checksum=d0c3ef88dfc284b61d3d5b64d946c1160fd04276b448519c1ae4438a9cdffaf3
 lib32disabled=yes
+patch_args=-Np1
 
 CFLAGS="-fcommon"
+
+post_extract() {
+	rm -rf bundled_deps
+}

From 92bffa64b0bab7210b0e48ead4e0b51de124e3b2 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: Wed, 17 Mar 2021 08:27:10 +0700
Subject: [PATCH 06/60] injeqt: disable coverage

---
 srcpkgs/injeqt/template | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/injeqt/template b/srcpkgs/injeqt/template
index 1e5777fc0f18..78eba09a0249 100644
--- a/srcpkgs/injeqt/template
+++ b/srcpkgs/injeqt/template
@@ -3,7 +3,8 @@ pkgname=injeqt
 version=1.2.0
 revision=2
 build_style=cmake
-hostmakedepends="pkg-config"
+configure_args="-DDISABLE_COVERAGE=ON"
+hostmakedepends="pkg-config qt5-qmake qt5-host-tools"
 makedepends="qt5-devel"
 short_desc="Dependency injection framework for Qt"
 maintainer="Jürgen Buchmüller <pullmoll@t-online.de>"
@@ -12,9 +13,6 @@ homepage="https://github.com/vogel/injeqt/"
 distfiles="https://github.com/vogel/${pkgname}/archive/${version}.tar.gz>${pkgname}-${version}.tar.gz"
 checksum=77540cedb0b26affe993dd18124d796059e34c80a51d9ae6433fdff1860db135
 
-if [ -n "$CROSS_BUILD" ]; then
-	hostmakedepends+=" qt5-host-tools qt5-devel"
-fi
 CXXFLAGS="-fno-lifetime-dse -Wno-error=cast-align"
 
 injeqt-devel_package() {

From 2b7b532cd36bc2eded2bc375bede1c1e68a46425 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: Wed, 17 Mar 2021 22:26:37 +0700
Subject: [PATCH 07/60] kindd: build with CMAKE_BUILD_TYPE=None

---
 srcpkgs/kindd/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/kindd/template b/srcpkgs/kindd/template
index e634b0f69bf6..4416041de58c 100644
--- a/srcpkgs/kindd/template
+++ b/srcpkgs/kindd/template
@@ -15,7 +15,7 @@ distfiles="${homepage}/archive/${version}.tar.gz"
 checksum=e596f1b1577ff3e83a779e6181252ae2f09731f513d17dd6b95cbc2cf204654f
 
 do_install() {
-	vbin release/kindd
+	vbin build/core/kindd
 	vinstall assets/appconf/kindd.svg 644 usr/share/pixmaps
 	vinstall assets/appconf/kindd.desktop 644 usr/share/applications
 }

From cf86cccf5f50b71c77a2afd19a559cc6104052c1 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: Thu, 18 Mar 2021 23:58:53 +0700
Subject: [PATCH 08/60] occt: allow CMAKE_BUILD_TYPE=None

---
 srcpkgs/occt/patches/cmake-build-type-none.patch | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 srcpkgs/occt/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/occt/patches/cmake-build-type-none.patch b/srcpkgs/occt/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..acb06fb55766
--- /dev/null
+++ b/srcpkgs/occt/patches/cmake-build-type-none.patch
@@ -0,0 +1,13 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -4,7 +4,7 @@ set (CMAKE_MODULE_PATH "${CMAKE_SOURCE_D
+ 
+ set (CMAKE_SUPPRESS_REGENERATION TRUE)
+ 
+-set (CMAKE_CONFIGURATION_TYPES Release Debug RelWithDebInfo CACHE INTERNAL "" FORCE)
++set (CMAKE_CONFIGURATION_TYPES None Release Debug RelWithDebInfo CACHE INTERNAL "" FORCE)
+ 
+ # macro: include patched file if it exists
+ macro (OCCT_INCLUDE_CMAKE_FILE BEING_INCLUDED_FILE)

From 171a154a92a9f35b5a665ef83be98ec2d82af395 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: Fri, 19 Mar 2021 23:07:05 +0700
Subject: [PATCH 09/60] renderdoc: devendor zstd, lz4

---
 .../patches/build-type-none-is-release.patch  | 12 ++++
 .../renderdoc/patches/qmake-no-rpath.patch    | 13 ++++
 .../renderdoc/patches/unvendor-zstd-lz4.patch | 68 +++++++++++++++++++
 srcpkgs/renderdoc/template                    | 15 ++--
 4 files changed, 99 insertions(+), 9 deletions(-)
 create mode 100644 srcpkgs/renderdoc/patches/build-type-none-is-release.patch
 create mode 100644 srcpkgs/renderdoc/patches/qmake-no-rpath.patch
 create mode 100644 srcpkgs/renderdoc/patches/unvendor-zstd-lz4.patch

diff --git a/srcpkgs/renderdoc/patches/build-type-none-is-release.patch b/srcpkgs/renderdoc/patches/build-type-none-is-release.patch
new file mode 100644
index 000000000000..f16b944bc12c
--- /dev/null
+++ b/srcpkgs/renderdoc/patches/build-type-none-is-release.patch
@@ -0,0 +1,12 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -315,6 +315,7 @@ set(RELEASE_MODE 0)
+ 
+ if(cmake_build_type_lower STREQUAL "release" OR
+    cmake_build_type_lower STREQUAL "relwithdebinfo" OR
++   cmake_build_type_lower STREQUAL "none" OR
+    cmake_build_type_lower STREQUAL "minsizerel")
+     add_definitions(-D_RELEASE)
+     message(STATUS "Building RenderDoc in Release mode: ${CMAKE_BUILD_TYPE}")
diff --git a/srcpkgs/renderdoc/patches/qmake-no-rpath.patch b/srcpkgs/renderdoc/patches/qmake-no-rpath.patch
new file mode 100644
index 000000000000..6e6325c53555
--- /dev/null
+++ b/srcpkgs/renderdoc/patches/qmake-no-rpath.patch
@@ -0,0 +1,13 @@
+Index: qrenderdoc/CMakeLists.txt
+===================================================================
+--- qrenderdoc/CMakeLists.txt.orig
++++ qrenderdoc/CMakeLists.txt
+@@ -144,7 +144,7 @@ endif()
+ # and finding dependencies from the cmake build
+ file(WRITE
+      ${CMAKE_BINARY_DIR}/qrenderdoc/qrenderdoc_cmake.pri
+-     "CONFIG+=${QMAKE_CONFIG}\n"
++     "CONFIG+=${QMAKE_CONFIG} no_qt_rpath\n"
+      "\n"
+      "QMAKE_CC=${CMAKE_C_COMPILER}\n"
+      "QMAKE_CXX=${CMAKE_CXX_COMPILER}\n"
diff --git a/srcpkgs/renderdoc/patches/unvendor-zstd-lz4.patch b/srcpkgs/renderdoc/patches/unvendor-zstd-lz4.patch
new file mode 100644
index 000000000000..d4003ded9161
--- /dev/null
+++ b/srcpkgs/renderdoc/patches/unvendor-zstd-lz4.patch
@@ -0,0 +1,68 @@
+Index: renderdoc/CMakeLists.txt
+===================================================================
+--- renderdoc/CMakeLists.txt.orig
++++ renderdoc/CMakeLists.txt
+@@ -213,54 +213,10 @@ set(sources
+     3rdparty/pugixml/pugixml.cpp
+     3rdparty/pugixml/pugixml.hpp
+     3rdparty/pugixml/pugiconfig.hpp
+-    3rdparty/lz4/lz4.c
+-    3rdparty/lz4/lz4.h
+     3rdparty/miniz/miniz.c
+     3rdparty/miniz/miniz.h
+     3rdparty/superluminal/superluminal.cpp
+     3rdparty/superluminal/superluminal.h
+-    3rdparty/zstd/bitstream.h
+-    3rdparty/zstd/compiler.h
+-    3rdparty/zstd/cpu.h
+-    3rdparty/zstd/debug.c
+-    3rdparty/zstd/debug.h
+-    3rdparty/zstd/entropy_common.c
+-    3rdparty/zstd/error_private.c
+-    3rdparty/zstd/error_private.h
+-    3rdparty/zstd/fse.h
+-    3rdparty/zstd/fse_compress.c
+-    3rdparty/zstd/fse_decompress.c
+-    3rdparty/zstd/hist.c
+-    3rdparty/zstd/hist.h
+-    3rdparty/zstd/huf.h
+-    3rdparty/zstd/huf_compress.c
+-    3rdparty/zstd/huf_decompress.c
+-    3rdparty/zstd/mem.h
+-    3rdparty/zstd/pool.c
+-    3rdparty/zstd/pool.h
+-    3rdparty/zstd/threading.c
+-    3rdparty/zstd/threading.h
+-    3rdparty/zstd/xxhash.c
+-    3rdparty/zstd/xxhash.h
+-    3rdparty/zstd/zstd.h
+-    3rdparty/zstd/zstd_common.c
+-    3rdparty/zstd/zstd_compress.c
+-    3rdparty/zstd/zstd_compress_internal.h
+-    3rdparty/zstd/zstd_decompress.c
+-    3rdparty/zstd/zstd_double_fast.c
+-    3rdparty/zstd/zstd_double_fast.h
+-    3rdparty/zstd/zstd_errors.h
+-    3rdparty/zstd/zstd_fast.c
+-    3rdparty/zstd/zstd_fast.h
+-    3rdparty/zstd/zstd_internal.h
+-    3rdparty/zstd/zstd_lazy.c
+-    3rdparty/zstd/zstd_lazy.h
+-    3rdparty/zstd/zstd_ldm.c
+-    3rdparty/zstd/zstd_ldm.h
+-    3rdparty/zstd/zstd_opt.c
+-    3rdparty/zstd/zstd_opt.h
+-    3rdparty/zstd/zstdmt_compress.c
+-    3rdparty/zstd/zstdmt_compress.h
+     3rdparty/stb/stb_image.h
+     3rdparty/stb/stb_image_write.h
+     3rdparty/stb/stb_image_resize.h
+@@ -271,6 +227,8 @@ set(sources
+     3rdparty/tinyfiledialogs/tinyfiledialogs.c
+     3rdparty/tinyfiledialogs/tinyfiledialogs.h)
+ 
++list(APPEND RDOC_LIBRARIES -llz4 -lzstd)
++
+ if(ANDROID)
+     list(APPEND sources
+         data/embedded_files.h
diff --git a/srcpkgs/renderdoc/template b/srcpkgs/renderdoc/template
index 7240e9ebc307..4615d45c52c9 100644
--- a/srcpkgs/renderdoc/template
+++ b/srcpkgs/renderdoc/template
@@ -1,13 +1,14 @@
 # Template file for 'renderdoc'
 pkgname=renderdoc
 version=1.12
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DENABLE_GL=ON -DENABLE_GLES=ON -DENABLE_QRENDERDOC=ON
  -DENABLE_RENDERDOCCMD=ON -DENABLE_VULKAN=ON -DENABLE_XCB=ON -DENABLE_XLIB=ON
  -DENABLE_PYRENDERDOC=ON"
-hostmakedepends="bison autoconf automake pkg-config python3"
+hostmakedepends="bison autoconf automake pkg-config python3 swig"
 makedepends="libX11-devel libxcb-devel xcb-util-keysyms-devel qt5-devel
+ libzstd-devel liblz4-devel
  qt5-svg-devel qt5-x11extras-devel pcre-devel python3-devel"
 short_desc="Stand-alone graphics debugging tool for Vulkan and OpenGL"
 maintainer="Urs Schulz <voidpkgs@ursschulz.de>"
@@ -19,19 +20,14 @@ checksum=4dece1b4cb859a76533b28fcd50e17321acfaa81c3435500a006c4a5ba15fddb
 if [ "$XBPS_TARGET_LIBC" = musl ]; then
 	makedepends+=" libexecinfo-devel"
 	LDLIBS="-lexecinfo"
+	broken="uses RTLD_DL_LINKMAP, RTLD_DEEPBIND, _r_debug"
 fi
 
 if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
 	makedepends+=" libatomic-devel"
 fi
 
-case "$XBPS_TARGET_MACHINE" in
-	*-musl) broken="uses RTLD_DL_LINKMAP, RTLD_DEEPBIND, _r_debug" ;;
-esac
-
-if [ "$CROSS_BUILD" ]; then
-	broken="Cross-compilation can't find python3 interpreter"
-fi
+nocross="Cross-compilation can't find python3 interpreter"
 
 post_patch() {
 	[ -z "$XBPS_TARGET_NO_ATOMIC8" ] && return 0
@@ -40,4 +36,5 @@ post_patch() {
 
 post_install() {
 	vlicense LICENSE.md
+	vlicense docs/credits_acknowledgements.rst
 }

From 32b23e957a268ba1fb7e8928f857d307ffa17d22 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: Sat, 20 Mar 2021 00:47:52 +0700
Subject: [PATCH 10/60] python3-occ: build with CMAKE_BUILD_TYPE=None

---
 srcpkgs/python3-occ/template | 1 +
 1 file changed, 1 insertion(+)

diff --git a/srcpkgs/python3-occ/template b/srcpkgs/python3-occ/template
index 705f37457943..3ea0ef5e6387 100644
--- a/srcpkgs/python3-occ/template
+++ b/srcpkgs/python3-occ/template
@@ -5,6 +5,7 @@ revision=1
 archs="i686* x86_64* armv7l* aarch64* ppc*"
 wrksrc="pythonocc-core-${version}"
 build_style=cmake
+configure_args="-DPYTHONOCC_BUILD_TYPE=None -DCMAKE_BUILD_TYPE=None"
 hostmakedepends="python3 swig"
 makedepends="python3-devel occt-devel freetype-devel swig"
 depends="python3 occt freetype"

From 8f22755805af2d5236a09f4e74855f794774c865 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: Fri, 19 Mar 2021 23:38:10 +0700
Subject: [PATCH 11/60] widelands: allow CMAKE_BUILD_TYPE=None

---
 srcpkgs/widelands-data                        |  1 -
 .../patches/cmake-build-type-none.patch       | 63 +++++++++++++++++++
 .../widelands/patches/fix-install-path.patch  | 40 ++++++++++++
 srcpkgs/widelands/template                    | 21 +------
 4 files changed, 105 insertions(+), 20 deletions(-)
 delete mode 120000 srcpkgs/widelands-data
 create mode 100644 srcpkgs/widelands/patches/cmake-build-type-none.patch
 create mode 100644 srcpkgs/widelands/patches/fix-install-path.patch

diff --git a/srcpkgs/widelands-data b/srcpkgs/widelands-data
deleted file mode 120000
index e9fbf89517f2..000000000000
--- a/srcpkgs/widelands-data
+++ /dev/null
@@ -1 +0,0 @@
-widelands
\ No newline at end of file
diff --git a/srcpkgs/widelands/patches/cmake-build-type-none.patch b/srcpkgs/widelands/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..3d210854741b
--- /dev/null
+++ b/srcpkgs/widelands/patches/cmake-build-type-none.patch
@@ -0,0 +1,63 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -202,7 +202,7 @@ elseif(CMAKE_BUILD_TYPE STREQUAL "RelWit
+   set(WL_DEBUG_FLAGS "-DNDEBUG -DNOPARACHUTE")
+   option(OPTION_ASAN "Build with AddressSanitizer" ON)
+ else()
+-  message(FATAL_ERROR "Unknown CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
++  set(WL_DEBUG_FLAGS "-DNDEBUG -DNOPARACHUTE")
+ endif()
+ 
+ wl_add_flag(WL_GENERIC_CXX_FLAGS "-std=c++11")
+@@ -353,7 +353,7 @@ endif (OPTION_BUILD_TESTS)
+ install (
+   FILES ${CMAKE_CURRENT_BINARY_DIR}/VERSION
+   DESTINATION ${WL_INSTALL_BASEDIR}
+-  CONFIGURATIONS Debug;Release
++  CONFIGURATIONS Debug
+   COMPONENT CoreVersionFile
+ )
+ 
+@@ -378,7 +378,6 @@ install(
+     data/txts
+     data/world
+   DESTINATION ${WL_INSTALL_DATADIR}
+-  CONFIGURATIONS Debug;Release
+   COMPONENT CoreDataFiles
+ )
+ 
+@@ -386,7 +385,6 @@ install(
+   DIRECTORY
+     data/maps
+   DESTINATION ${WL_INSTALL_DATADIR}
+-  CONFIGURATIONS Debug;Release
+   COMPONENT MapFiles
+ )
+ 
+@@ -395,7 +393,6 @@ install(
+     data/music
+     data/sound
+   DESTINATION ${WL_INSTALL_DATADIR}
+-  CONFIGURATIONS Debug;Release
+   COMPONENT MusicFiles
+ )
+ 
+@@ -405,7 +402,7 @@ install(
+     CREDITS
+     ChangeLog
+   DESTINATION ${WL_INSTALL_BASEDIR}
+-  CONFIGURATIONS Debug;Release
++  CONFIGURATIONS Debug
+   COMPONENT CoreLicenseFiles
+ )
+ 
+@@ -424,7 +421,6 @@ install(
+   DIRECTORY
+     ${CMAKE_CURRENT_BINARY_DIR}/locale/
+   DESTINATION ${WL_INSTALL_DATADIR}/locale
+-  CONFIGURATIONS Debug;Release
+   COMPONENT CoreLanguageFiles
+ )
+ 
diff --git a/srcpkgs/widelands/patches/fix-install-path.patch b/srcpkgs/widelands/patches/fix-install-path.patch
new file mode 100644
index 000000000000..6bb461389f03
--- /dev/null
+++ b/srcpkgs/widelands/patches/fix-install-path.patch
@@ -0,0 +1,40 @@
+Index: cmake/WlFunctions.cmake
+===================================================================
+--- cmake/WlFunctions.cmake.orig
++++ cmake/WlFunctions.cmake
+@@ -289,5 +289,5 @@ function(wl_binary NAME)
+ 
+   #Quoting the CMake documentation on DESTINATION:
+   #"If a relative path is given it is interpreted relative to the value of CMAKE_INSTALL_PREFIX"
+-  install(TARGETS ${NAME} DESTINATION "." COMPONENT ExecutableFiles)
++  install(TARGETS ${NAME} DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT ExecutableFiles)
+ endfunction()
+Index: xdg/CMakeLists.txt
+===================================================================
+--- xdg/CMakeLists.txt.orig
++++ xdg/CMakeLists.txt
+@@ -6,19 +6,19 @@ set(XDG_APPLICATION_ID "org.widelands.Wi
+ list(APPEND icon_sizes "16" "32" "48" "64" "128")
+ foreach (icon_size ${icon_sizes})
+   #install(FILES ${CMAKE_SOURCE_DIR}/data/images/logos/wl-ico-${icon_size}.png DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/${icon_size}x${icon_size}/apps RENAME ${XDG_APPLICATION_ID}.png)
+-  install(FILES ${CMAKE_SOURCE_DIR}/data/images/logos/wl-ico-${icon_size}.png DESTINATION ../share/icons/hicolor/${icon_size}x${icon_size}/apps RENAME ${XDG_APPLICATION_ID}.png)
++  install(FILES ${CMAKE_SOURCE_DIR}/data/images/logos/wl-ico-${icon_size}.png DESTINATION share/icons/hicolor/${icon_size}x${icon_size}/apps RENAME ${XDG_APPLICATION_ID}.png)
+ endforeach (icon_size ${icon_sizes})
+ #install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${CMAKE_PROJECT_NAME}.6           DESTINATION ${CMAKE_INSTALL_MANDIR}/man6)
+-install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${CMAKE_PROJECT_NAME}.6           DESTINATION ../share/man/man6)
++install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${CMAKE_PROJECT_NAME}.6           DESTINATION share/man/man6)
+ #install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${XDG_APPLICATION_ID}.desktop     DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications)
+-install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${XDG_APPLICATION_ID}.desktop     DESTINATION ../share/applications)
++install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${XDG_APPLICATION_ID}.desktop     DESTINATION share/applications)
+ #install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${XDG_APPLICATION_ID}.appdata.xml DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/metainfo)
+-install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${XDG_APPLICATION_ID}.appdata.xml DESTINATION ../share/metainfo)
++install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${XDG_APPLICATION_ID}.appdata.xml DESTINATION share/metainfo)
+ 
+ find_program(GTK_UPDATE_ICON_CACHE NAMES gtk-update-icon-cache)
+ if (GTK_UPDATE_ICON_CACHE)
+   #install(CODE "execute_process (COMMAND ${GTK_UPDATE_ICON_CACHE} -t -f ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor ||: )")
+-  install(CODE "execute_process (COMMAND ${GTK_UPDATE_ICON_CACHE} -t -f ${CMAKE_INSTALL_PREFIX}/../share/icons/hicolor ||: )")
++  install(CODE "execute_process (COMMAND ${GTK_UPDATE_ICON_CACHE} -t -f ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor ||: )")
+ else (GTK_UPDATE_ICON_CACHE)
+   message(WARNING "gtk-update-icon-cache not found!")
+ endif (GTK_UPDATE_ICON_CACHE)
diff --git a/srcpkgs/widelands/template b/srcpkgs/widelands/template
index 6cee85087ea7..cfa2c10993e0 100644
--- a/srcpkgs/widelands/template
+++ b/srcpkgs/widelands/template
@@ -1,7 +1,7 @@
 # Template file for 'widelands'
 pkgname=widelands
 version=21
-revision=3
+revision=4
 wrksrc="${pkgname}-build${version}"
 build_style=cmake
 configure_args="-DOPENGL_INCLUDE_DIR=${XBPS_CROSS_BASE}/usr/include
@@ -10,13 +10,13 @@ hostmakedepends="python3 pkg-config gettext"
 makedepends="boost-devel icu-devel minizip-devel gettext-devel
  glu-devel glew-devel SDL2-devel SDL2_gfx-devel SDL2_image-devel
  SDL2_net-devel SDL2_mixer-devel SDL2_ttf-devel"
-depends="${pkgname}-data-${version}_${revision}"
 short_desc="Real-time strategy game"
 maintainer="Jürgen Buchmüller <pullmoll@t-online.de>"
 license="GPL-2.0-or-later"
 homepage="http://www.widelands.org/"
 distfiles="https://github.com/widelands/widelands/archive/build${version}.tar.gz>${pkgname}-${version}.tar.gz"
 checksum=601e0e4c6f91b3fb0ece2cd1b83ecfb02344a1b9194fbb70ef3f70e06994e357
+replaces="widelands-data>=0"
 
 CXXFLAGS="-DU_USING_ICU_NAMESPACE=1"
 
@@ -29,22 +29,5 @@ if [ "$CROSS_BUILD" ]; then
 fi
 
 post_install() {
-	# For some reason the binary is installed as /usr/widelands - move it
-	vmkdir usr/bin
-	mv ${DESTDIR}/usr/${pkgname} ${DESTDIR}/usr/bin
-	vmkdir usr/share
-	mv ${DESTDIR}/share/* ${DESTDIR}/usr/share/
-	rmdir ${DESTDIR}/share
-
-	# Remove files not needed in the package
-	rm -f ${DESTDIR}/usr/COPYING ${DESTDIR}/usr/CREDITS ${DESTDIR}/usr/ChangeLog ${DESTDIR}/usr/VERSION
-
 	vinstall ${FILESDIR}/${pkgname}.desktop 644 usr/share/applications
 }
-
-widelands-data_package() {
-	short_desc+=" - data files"
-	pkg_install() {
-		vmove usr/share/widelands
-	}
-}

From ff6a2d313b3b823d3d590e83ed11bcd3f8c386f8 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: Sat, 20 Mar 2021 09:49:25 +0700
Subject: [PATCH 12/60] zziplib: fix SONAME when build with
 -DCMAKE_BUILD_TYPE=None

---
 .../cmake-build-type-none-soname.patch        | 35 +++++++++++++++++++
 srcpkgs/zziplib/template                      |  1 +
 2 files changed, 36 insertions(+)
 create mode 100644 srcpkgs/zziplib/patches/cmake-build-type-none-soname.patch

diff --git a/srcpkgs/zziplib/patches/cmake-build-type-none-soname.patch b/srcpkgs/zziplib/patches/cmake-build-type-none-soname.patch
new file mode 100644
index 000000000000..2d31b5b8a46a
--- /dev/null
+++ b/srcpkgs/zziplib/patches/cmake-build-type-none-soname.patch
@@ -0,0 +1,35 @@
+Index: zziplib-0.13.72/zzip/CMakeLists.txt
+===================================================================
+--- zziplib-0.13.72.orig/zzip/CMakeLists.txt
++++ zziplib-0.13.72/zzip/CMakeLists.txt
+@@ -190,15 +190,18 @@ target_include_directories (libzzipmmapp
+ endif()
+ 
+ set_target_properties(libzzip PROPERTIES OUTPUT_NAME "zzip" RELEASE_POSTFIX "-${RELNUM}")
++set_target_properties(libzzip PROPERTIES OUTPUT_NAME "zzip" NONE_POSTFIX "-${RELNUM}")
+ SET_TARGET_PROPERTIES(libzzip PROPERTIES VERSION ${VERNUM}.${FIXNUM} SOVERSION ${VERNUM})
+ 
+ if(ZZIPFSEEKO)
+ set_target_properties(libzzipfseeko PROPERTIES OUTPUT_NAME "zzipfseeko" RELEASE_POSTFIX "-${RELNUM}")
++set_target_properties(libzzipfseeko PROPERTIES OUTPUT_NAME "zzipfseeko" NONE_POSTFIX "-${RELNUM}")
+ SET_TARGET_PROPERTIES(libzzipfseeko PROPERTIES VERSION ${VERNUM}.${FIXNUM} SOVERSION ${VERNUM})
+ endif()
+ 
+ if(ZZIPMMAPPED)
+ set_target_properties(libzzipmmapped PROPERTIES OUTPUT_NAME "zzipmmapped" RELEASE_POSTFIX "-${RELNUM}")
++set_target_properties(libzzipmmapped PROPERTIES OUTPUT_NAME "zzipmmapped" NONE_POSTFIX "-${RELNUM}")
+ SET_TARGET_PROPERTIES(libzzipmmapped PROPERTIES VERSION ${VERNUM}.${FIXNUM} SOVERSION ${VERNUM})
+ endif()
+ 
+Index: zziplib-0.13.72/zzipwrap/CMakeLists.txt
+===================================================================
+--- zziplib-0.13.72.orig/zzipwrap/CMakeLists.txt
++++ zziplib-0.13.72/zzipwrap/CMakeLists.txt
+@@ -49,6 +49,7 @@ target_link_libraries(libzzipwrap libzzi
+ target_include_directories(libzzipwrap PRIVATE "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}")
+ 
+ set_target_properties(libzzipwrap PROPERTIES OUTPUT_NAME "zzipwrap" RELEASE_POSTFIX "-${RELNUM}")
++set_target_properties(libzzipwrap PROPERTIES OUTPUT_NAME "zzipwrap" NONE_POSTFIX "-${RELNUM}")
+ SET_TARGET_PROPERTIES(libzzipwrap PROPERTIES VERSION ${VERNUM}.${FIXNUM} SOVERSION ${VERNUM})
+ set_target_properties(libzzipwrap PROPERTIES DEFINE_SYMBOL "libzzip_EXPORTS")
+ 
diff --git a/srcpkgs/zziplib/template b/srcpkgs/zziplib/template
index ab5af234af62..2026f3e4a521 100644
--- a/srcpkgs/zziplib/template
+++ b/srcpkgs/zziplib/template
@@ -12,6 +12,7 @@ homepage="https://github.com/gdraheim/zziplib"
 changelog="https://raw.githubusercontent.com/gdraheim/zziplib/master/ChangeLog"
 distfiles="https://github.com/gdraheim/zziplib/archive/v${version}.tar.gz"
 checksum=93ef44bf1f1ea24fc66080426a469df82fa631d13ca3b2e4abaeab89538518dc
+patch_args=-Np1
 
 if [ "$CROSS_BUILD" ]; then
 	configure_args+=" -DZZIPTEST=OFF"

From 683601ccac10d3a34de4da8da7b8b1ff52c640a1 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, 21 Mar 2021 15:28:04 +0700
Subject: [PATCH 13/60] mellowplayer: fix build

---
 srcpkgs/mellowplayer/patches/no-werror.patch | 13 +++++++++++++
 srcpkgs/mellowplayer/template                | 13 +++++++------
 2 files changed, 20 insertions(+), 6 deletions(-)
 create mode 100644 srcpkgs/mellowplayer/patches/no-werror.patch

diff --git a/srcpkgs/mellowplayer/patches/no-werror.patch b/srcpkgs/mellowplayer/patches/no-werror.patch
new file mode 100644
index 000000000000..7e678453a123
--- /dev/null
+++ b/srcpkgs/mellowplayer/patches/no-werror.patch
@@ -0,0 +1,13 @@
+Index: MellowPlayer-3.6.6/src/3rdparty/boost/di.hpp
+===================================================================
+--- MellowPlayer-3.6.6.orig/src/3rdparty/boost/di.hpp
++++ MellowPlayer-3.6.6/src/3rdparty/boost/di.hpp
+@@ -67,7 +67,7 @@ BOOST_DI_CFG_FWD
+ #pragma clang diagnostic error "-Wundefined-internal"
+ #pragma clang diagnostic ignored "-Wmissing-field-initializers"
+ #elif defined(__GCC__)
+-#pragma GCC diagnostic error "-Wdeprecated-declarations"
++#pragma GCC diagnostic warning "-Wdeprecated-declarations"
+ #pragma GCC diagnostic push
+ #if (__GNUC__ < 6)
+ #pragma GCC diagnostic error "-Werror"
diff --git a/srcpkgs/mellowplayer/template b/srcpkgs/mellowplayer/template
index 2f8f13960ca6..cfd8a185556f 100644
--- a/srcpkgs/mellowplayer/template
+++ b/srcpkgs/mellowplayer/template
@@ -4,7 +4,7 @@ version=3.6.6
 revision=1
 wrksrc="MellowPlayer-${version}"
 build_style=cmake
-hostmakedepends="pkg-config qt5-tools qt5-qmake"
+hostmakedepends="pkg-config qt5-tools qt5-qmake qt5-host-tools"
 makedepends="qt5-declarative-devel qt5-quickcontrols2-devel
  qt5-plugin-mysql qt5-plugin-pgsql qt5-plugin-sqlite
  qt5-plugin-tds qt5-plugin-odbc
@@ -17,11 +17,12 @@ license="GPL-2.0-or-later"
 homepage="https://colinduquesnoy.gitlab.io/MellowPlayer/"
 distfiles="https://gitlab.com/ColinDuquesnoy/MellowPlayer/-/archive/${version}/MellowPlayer-${version}.tar.bz2"
 checksum=17b8b25ca6b3d27b223f8be6ad80186ae5bd17ce762eb04ecd8b0e82e687b327
+patch_args=-Np1
 
-if [ "$CROSS_BUILD" ]; then
-	hostmakedepends+=" qt5-host-tools"
+if [ "$XBPS_WORDSIZE" != "$XBPS_TARGET_WORDSIZE" ]; then
+	broken="webengine can be built only if word size matches"
 fi
 
-case "$XBPS_TARGET_MACHINE" in
-	arm*) broken="qt5-webengine not available" ;;
-esac
+if [ "$XBPS_TARGET_ENDIAN" != "le" ]; then
+	broken="webengine only supports little endian"
+fi

From 60020334799d647c47b7e3522988ef2153771c61 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, 21 Mar 2021 15:43:09 +0700
Subject: [PATCH 14/60] ispc: fix CMAKE_BUILD_TYPE=None

---
 .../ispc/patches/cmake-build-type-none.patch   | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
 create mode 100644 srcpkgs/ispc/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/ispc/patches/cmake-build-type-none.patch b/srcpkgs/ispc/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..411e353c7314
--- /dev/null
+++ b/srcpkgs/ispc/patches/cmake-build-type-none.patch
@@ -0,0 +1,18 @@
+Index: ispc-1.15.0/CMakeLists.txt
+===================================================================
+--- ispc-1.15.0.orig/CMakeLists.txt
++++ ispc-1.15.0/CMakeLists.txt
+@@ -157,13 +157,6 @@ set(OUTPUT_RELEASE Release/bin)
+ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin )
+ 
+ if(CMAKE_BUILD_TYPE)
+-    # Validate build type
+-    set(CONFIGURATION_TYPES "Debug;Release;RelWithDebInfo")
+-
+-    string(FIND "${CONFIGURATION_TYPES}" "${CMAKE_BUILD_TYPE}" MATCHED_CONFIG)
+-    if (${MATCHED_CONFIG} EQUAL -1)
+-         message(FATAL_ERROR "CMAKE_BUILD_TYPE (${CMAKE_BUILD_TYPE}) allows only the following values: ${CONFIGURATION_TYPES}")
+-    endif()
+ else(NOT CMAKE_BUILD_TYPE)
+     set(CMAKE_BUILD_TYPE "Release")
+     message(STATUS "Build type not specified: Use Release by default.")

From 2dc448572543022d1b9a9d1b7c94223afc236100 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, 21 Mar 2021 15:56:50 +0700
Subject: [PATCH 15/60] darktable: fix CMAKE_BUILD_TYPE=None

---
 .../darktable/patches/cmake-build-type-none.patch  | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
 create mode 100644 srcpkgs/darktable/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/darktable/patches/cmake-build-type-none.patch b/srcpkgs/darktable/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..7101f9c1a0e7
--- /dev/null
+++ b/srcpkgs/darktable/patches/cmake-build-type-none.patch
@@ -0,0 +1,14 @@
+Index: src/external/rawspeed/cmake/build-type.cmake
+===================================================================
+--- src/external/rawspeed/cmake/build-type.cmake.orig
++++ src/external/rawspeed/cmake/build-type.cmake
+@@ -27,9 +27,6 @@ string(TOUPPER "${RAWSPEED_SPECIAL_BUILD
+ 
+ # is this one of the known build types?
+ list (FIND CMAKE_CONFIGURATION_TYPES_UPPERCASE ${CMAKE_BUILD_TYPE_UPPERCASE} BUILD_TYPE_IS_KNOWN)
+-if (${BUILD_TYPE_IS_KNOWN} EQUAL -1)
+- message(SEND_ERROR "Unknown build type: ${CMAKE_BUILD_TYPE_UPPERCASE}. Please specify one of: ${CMAKE_CONFIGURATION_TYPES}")
+-endif()
+ 
+ # is this a special build?
+ list (FIND RAWSPEED_SPECIAL_BUILD_TYPES_UPPERCASE ${CMAKE_BUILD_TYPE_UPPERCASE} IS_SPECIAL_BUILD)

From 89f0037e1b4268045438e5592950680555172349 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, 21 Mar 2021 15:33:29 +0700
Subject: [PATCH 16/60] hedgewars: merge -data back

---
 srcpkgs/hedgewars-data                        |  1 -
 .../patches/cmake-build-type-none.patch       | 30 +++++++++++++++++++
 srcpkgs/hedgewars/template                    | 23 +++++---------
 3 files changed, 38 insertions(+), 16 deletions(-)
 delete mode 120000 srcpkgs/hedgewars-data
 create mode 100644 srcpkgs/hedgewars/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/hedgewars-data b/srcpkgs/hedgewars-data
deleted file mode 120000
index b57dc45ebadc..000000000000
--- a/srcpkgs/hedgewars-data
+++ /dev/null
@@ -1 +0,0 @@
-hedgewars
\ No newline at end of file
diff --git a/srcpkgs/hedgewars/patches/cmake-build-type-none.patch b/srcpkgs/hedgewars/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..b4e0c186717c
--- /dev/null
+++ b/srcpkgs/hedgewars/patches/cmake-build-type-none.patch
@@ -0,0 +1,30 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -54,7 +54,7 @@ option(NOVERSIONINFOUPDATE "Disable upda
+ 
+ 
+ if(BUILD_ENGINE_C AND NOT NOVIDEOREC)
+-    if((CMAKE_BUILD_TYPE STREQUAL "Release") OR (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo"))
++    if((CMAKE_BUILD_TYPE STREQUAL "Release") OR (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo") OR (CMAKE_BUILD_TYPE STREQUAL "None"))
+         message("NOTE: Video recorder support disabled. It's incompatible with BUILD_ENGINE_C")
+         set(BUILD_ENGINE_C ON CACHE STRING "Required for BUILD_ENGINE_JS" FORCE)
+     else()
+@@ -93,7 +93,7 @@ set(CPACK_PACKAGE_VERSION_MAJOR 1)
+ set(CPACK_PACKAGE_VERSION_MINOR 0)
+ set(CPACK_PACKAGE_VERSION_PATCH 0)
+ set(HEDGEWARS_PROTO_VER 59)
+-if((CMAKE_BUILD_TYPE STREQUAL "Release") OR (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo"))
++if((CMAKE_BUILD_TYPE STREQUAL "Release") OR (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo") OR (CMAKE_BUILD_TYPE STREQUAL "None"))
+     set(HEDGEWARS_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
+ else()
+     set(HEDGEWARS_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}-dev")
+@@ -114,6 +114,7 @@ include(${CMAKE_MODULE_PATH}/platform.cm
+ if(CMAKE_BUILD_TYPE)
+     if(NOT((CMAKE_BUILD_TYPE STREQUAL "Release") OR
+            (CMAKE_BUILD_TYPE STREQUAL "Debug") OR
++	   (CMAKE_BUILD_TYPE STREQUAL "None") OR
+            (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")))
+         set(CMAKE_BUILD_TYPE ${default_build_type} CACHE STRING "Build type (Debug/Release/RelWithDebInfo)" FORCE)
+         message(STATUS "Unknown build type ${CMAKE_BUILD_TYPE}, using default (${default_build_type})")
diff --git a/srcpkgs/hedgewars/template b/srcpkgs/hedgewars/template
index d2294cf572f5..f413a965ff2e 100644
--- a/srcpkgs/hedgewars/template
+++ b/srcpkgs/hedgewars/template
@@ -1,15 +1,15 @@
 # Template file for 'hedgewars'
 pkgname=hedgewars
 version=1.0.0
-revision=2
+revision=3
 wrksrc="${pkgname}-src-${version}"
 build_style=cmake
 configure_args="-DNOSERVER=1 -DDATA_INSTALL_DIR=/usr/share/${pkgname}
- -DPHYSFS_SYSTEM=1 -DCMAKE_VERBOSE_MAKEFILE=1 -DMINIMAL_FLAGS=1"
-hostmakedepends="lua51 pkg-config"
+ -DPHYSFS_SYSTEM=1 -DMINIMAL_FLAGS=1"
+hostmakedepends="lua51 pkg-config qt5-qmake qt5-host-tools"
 makedepends="ffmpeg-devel lua51-devel physfs-devel qt5-tools-devel SDL2_image-devel
  SDL2_mixer-devel SDL2_net-devel SDL2_ttf-devel"
-depends="hedgewars-data>=${version}_${revision} libfreeglut"
+depends="libfreeglut"
 short_desc="Funny turn-based artillery game, featuring fighting Hedgehogs!"
 maintainer="Jakub Skrzypnik <jot.skrzyp@gmail.com>"
 license="GPL-2.0-only"
@@ -18,10 +18,9 @@ distfiles="https://hedgewars.org/download/releases/hedgewars-src-${version}.tar.
 checksum=211634e61f2e4beecc3c98c6f749601fcd08321fda1ba969b3b3832a004f155b
 nopie_files="/usr/bin/hwengine"
 nocross="Needs investigation: fails to link hwengine"
-
-if [ -n "$CROSS_BUILD" ]; then
-	hostmakedepends+=" qt5-devel"
-fi
+replaces="hedgewars-data>=0"
+export CMAKE_GENERATOR="Unix Makefiles"
+make_cmd=make
 
 case $XBPS_TARGET_MACHINE in
 	x86_64*)
@@ -38,6 +37,7 @@ esac
 
 if [ -n "$_use_c_engine" ]; then
 	hostmakedepends+=" glew-devel libatomic-devel ghc clang"
+	makedepends+=" glew-devel libatomic-devel"
 	configure_args+=" -DBUILD_ENGINE_C=1"
 	nopie_files+=" /usr/bin/hedgewars"
 fi
@@ -56,10 +56,3 @@ pre_configure() {
 post_install() {
 	vinstall ${DESTDIR}/usr/share/hedgewars/Data/misc/hedgewars.desktop 644 usr/share/applications
 }
-
-hedgewars-data_package() {
-	short_desc+=" - data files"
-	pkg_install() {
-		vmove usr/share/hedgewars/Data
-	}
-}

From b44bb61ac2fd15650be2baaf146b7f612e45e9ad 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, 21 Mar 2021 16:41:58 +0700
Subject: [PATCH 17/60] mariadb: fix for CMAKE_BUILD_TYPE=None

---
 srcpkgs/mariadb/template | 32 ++++++++++++++------------------
 1 file changed, 14 insertions(+), 18 deletions(-)

diff --git a/srcpkgs/mariadb/template b/srcpkgs/mariadb/template
index 437ff757b383..78d5e2dbdbe8 100644
--- a/srcpkgs/mariadb/template
+++ b/srcpkgs/mariadb/template
@@ -34,35 +34,31 @@ replaces="mysql>=0"
 conf_files="/etc/mysql/my.cnf"
 system_accounts="mysql"
 mysql_homedir="/var/lib/mysql"
-CFLAGS="-w -fcommon"
+CFLAGS="-w -fcommon -DDBUG_OFF=1"
+CXXFLAGS="-DDBUG_OFF=1"
 
 pre_configure() {
 	# We need some host binaries before starting cross compilation.
 	if [ "$CROSS_BUILD" ]; then
+		mkdir -p build.native
 		# XXX still broken: jemalloc configure execs host bins.
-		CC= CXX= CPP= LD= AR= AS= RANLIB= CFLAGS= CXXFLAGS= LDFLAGS= cmake .
-		make comp_err comp_sql gen_lex_hash gen_lex_token
-		mkdir bin.host
-		cp extra/comp_err bin.host
-		cp scripts/comp_sql bin.host
-		cp sql/gen_lex_hash bin.host
-		cp sql/gen_lex_token bin.host
-		make clean
-		rm CMakeCache.txt
+		CC= CXX= CPP= LD= AR= AS= RANLIB= CFLAGS= CXXFLAGS= LDFLAGS= \
+			cmake -S . -B build.native
+		make -C build.native comp_err comp_sql gen_lex_hash gen_lex_token
 	fi
 }
 
 pre_build() {
 	if [ "$CROSS_BUILD" ]; then
 		# CMake complains if those binaries ain't in build
-		cp bin.host/comp_err ${wrksrc}/extra
-		cp bin.host/comp_err ${wrksrc}/build/extra
-		cp bin.host/comp_sql ${wrksrc}/scripts
-		cp bin.host/comp_sql ${wrksrc}/build/scripts
-		cp bin.host/gen_lex_hash ${wrksrc}/sql
-		cp bin.host/gen_lex_hash ${wrksrc}/build/sql
-		cp bin.host/gen_lex_token ${wrksrc}/sql
-		cp bin.host/gen_lex_token ${wrksrc}/build/sql
+		cp build.native/extra/comp_err ${wrksrc}/extra
+		cp build.native/extra/comp_err ${wrksrc}/build/extra
+		cp build.native/scripts/comp_sql ${wrksrc}/scripts
+		cp build.native/scripts/comp_sql ${wrksrc}/build/scripts
+		cp build.native/sql/gen_lex_hash ${wrksrc}/sql
+		cp build.native/sql/gen_lex_hash ${wrksrc}/build/sql
+		cp build.native/sql/gen_lex_token ${wrksrc}/sql
+		cp build.native/sql/gen_lex_token ${wrksrc}/build/sql
 		export PATH=${PATH}:${wrksrc}/extra:${wrksrc}/scripts:${wrksrc}/sql
 	fi
 	export LD_LIBRARY_PATH=${wrksrc}/build/storage/tokudb/ft-index/portability

From 5735a86cf720c0cb8dbd1c3957ed8b72b7d2c50e 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: Thu, 25 Mar 2021 07:58:28 +0700
Subject: [PATCH 18/60] EternalTerminal: remove -ggdb3

---
 .../EternalTerminal/patches/fix-cflags.patch    | 17 +++++++++++++++++
 srcpkgs/EternalTerminal/template                |  1 +
 2 files changed, 18 insertions(+)
 create mode 100644 srcpkgs/EternalTerminal/patches/fix-cflags.patch

diff --git a/srcpkgs/EternalTerminal/patches/fix-cflags.patch b/srcpkgs/EternalTerminal/patches/fix-cflags.patch
new file mode 100644
index 000000000000..e6fcd432f7e7
--- /dev/null
+++ b/srcpkgs/EternalTerminal/patches/fix-cflags.patch
@@ -0,0 +1,17 @@
+Index: EternalTerminal-et-v6.0.13/CMakeLists.txt
+===================================================================
+--- EternalTerminal-et-v6.0.13.orig/CMakeLists.txt
++++ EternalTerminal-et-v6.0.13/CMakeLists.txt
+@@ -26,12 +26,6 @@ if(DISABLE_CRASH_LOG)
+ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DELPP_DISABLE_DEFAULT_CRASH_HANDLING")
+ ENDIF(DISABLE_CRASH_LOG)
+ 
+-if(UNIX)
+-  # Enable debug info
+-  SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -ggdb3")
+-  SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -ggdb3")
+-endif()
+-
+ # Enable C++-11
+ set(CMAKE_CXX_STANDARD 11)
+ set(CMAKE_CXX_STANDARD_REQUIRED ON)
diff --git a/srcpkgs/EternalTerminal/template b/srcpkgs/EternalTerminal/template
index 7bac78d2ffd4..bc92e47743dd 100644
--- a/srcpkgs/EternalTerminal/template
+++ b/srcpkgs/EternalTerminal/template
@@ -13,6 +13,7 @@ homepage="https://eternalterminal.dev/"
 distfiles="https://github.com/MisterTea/EternalTerminal/archive/et-v${version}.tar.gz"
 checksum=728c3a444d666897c710e33fe473d8d289263a59574451b13aa53ec3c6ac88b3
 system_accounts="_eternal"
+patch_args=-Np1
 
 LDFLAGS="-lgflags"
 

From 75da83090a1fe2b92155b681800814596184a562 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: Thu, 25 Mar 2021 08:20:29 +0700
Subject: [PATCH 19/60] OTPClient: respect CFLAGS

---
 srcpkgs/OTPClient/patches/fix-cflags.patch | 17 +++++++++++++++++
 srcpkgs/OTPClient/template                 |  1 +
 2 files changed, 18 insertions(+)
 create mode 100644 srcpkgs/OTPClient/patches/fix-cflags.patch

diff --git a/srcpkgs/OTPClient/patches/fix-cflags.patch b/srcpkgs/OTPClient/patches/fix-cflags.patch
new file mode 100644
index 000000000000..ae70f441538f
--- /dev/null
+++ b/srcpkgs/OTPClient/patches/fix-cflags.patch
@@ -0,0 +1,17 @@
+Index: OTPClient-2.4.2/CMakeLists.txt
+===================================================================
+--- OTPClient-2.4.2.orig/CMakeLists.txt
++++ OTPClient-2.4.2/CMakeLists.txt
+@@ -11,11 +11,10 @@ option(BUILD_GUI "Build the GUI" ON)
+ option(BUILD_CLI "Build the CLI" ON)
+ 
+ set(CMAKE_C_STANDARD 11)
+-set(CMAKE_C_FLAGS "-Wall -Wextra -O3 -Wformat=2 -Wmissing-format-attribute -fstack-protector-strong -Wundef -Wmissing-format-attribute")
++set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wformat=2 -Wmissing-format-attribute -fstack-protector-strong -Wundef -Wmissing-format-attribute")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fdiagnostics-color=always -Wstrict-prototypes -Wunreachable-code")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wchar-subscripts -Wwrite-strings -Wpointer-arith -Wbad-function-cast -Wcast-align")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror=format-security -Werror=implicit-function-declaration -Wno-sign-compare")
+-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3")
+ if(CMAKE_COMPILER_IS_GNUCC)
+     set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pie -fPIE")
+ endif()
diff --git a/srcpkgs/OTPClient/template b/srcpkgs/OTPClient/template
index e8c0099850b7..f5af76e655a6 100644
--- a/srcpkgs/OTPClient/template
+++ b/srcpkgs/OTPClient/template
@@ -12,3 +12,4 @@ license="GPL-3.0-or-later"
 homepage="https://github.com/paolostivanin/OTPClient"
 distfiles="https://github.com/paolostivanin/OTPClient/archive/v${version}.tar.gz"
 checksum=74bc4312aa1cd336ca983434e3bed951c5ead327091e7708e3beb08508813495
+patch_args=-Np1

From 8a573dad4563832a5be63882e85ccfc5e21fa3a7 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: Thu, 25 Mar 2021 08:30:31 +0700
Subject: [PATCH 20/60] crex: hardening

---
 srcpkgs/crex/patches/fix-cflags.patch | 20 ++++++++++++++++++++
 srcpkgs/crex/template                 |  7 ++-----
 2 files changed, 22 insertions(+), 5 deletions(-)
 create mode 100644 srcpkgs/crex/patches/fix-cflags.patch

diff --git a/srcpkgs/crex/patches/fix-cflags.patch b/srcpkgs/crex/patches/fix-cflags.patch
new file mode 100644
index 000000000000..d191fb1e9ec0
--- /dev/null
+++ b/srcpkgs/crex/patches/fix-cflags.patch
@@ -0,0 +1,20 @@
+Index: crex-0.2.5/CMakeLists.txt
+===================================================================
+--- crex-0.2.5.orig/CMakeLists.txt
++++ crex-0.2.5/CMakeLists.txt
+@@ -13,9 +13,6 @@ endif(CCACHE_FOUND)
+ set (CMAKE_CXX_STANDARD 14)
+ set (CMAKE_CXX_STANDARD_REQUIRED ON)
+ 
+-set (CMAKE_CXX_FLAGS "-fdiagnostics-color=auto")
+-set (CMAKE_C_FLAGS "-fdiagnostics-color=auto")
+-
+ set (DEBUG_FLAGS "-Wpedantic -Wall -Wextra -Wcast-align -Wcast-qual -Wctor-dtor-privacy -Wdisabled-optimization -Wformat=2 -Winit-self -Wlogical-op -Wmissing-declarations -Wmissing-include-dirs -Wnoexcept -Wold-style-cast -Woverloaded-virtual -Wredundant-decls -Wshadow -Wsign-conversion -Wsign-promo -Wstrict-null-sentinel -Wstrict-overflow=5 -Wswitch-default -Wundef -Wno-unused -std=c++14 -g")
+ set (DEBUG_LINK_FLAGS "-fprofile-arcs -ftest-coverage -flto")
+ 
+@@ -56,4 +53,4 @@ target_link_libraries (
+   ${TARGET}
+ )
+ 
+-install (TARGETS ${TARGET} DESTINATION "/usr/local/bin")
++install (TARGETS ${TARGET} DESTINATION "/usr/bin")
diff --git a/srcpkgs/crex/template b/srcpkgs/crex/template
index a54697a93adc..2f455a0b0c72 100644
--- a/srcpkgs/crex/template
+++ b/srcpkgs/crex/template
@@ -1,7 +1,7 @@
 # Template file for 'crex'
 pkgname=crex
 version=0.2.5
-revision=1
+revision=2
 build_style=cmake
 short_desc="Explore, test, and check regular expressions in the terminal"
 maintainer="Piotr Wójcik <chocimier@tlen.pl>"
@@ -9,10 +9,7 @@ license="MIT"
 homepage="https://github.com/octobanana/crex"
 distfiles="https://github.com/octobanana/crex/archive/${version}.tar.gz"
 checksum=c6a166b7a1e696a7babeaf7c5728eece1624704a18357f827129fc95ef2ecc56
-
-pre_configure() {
-	sed -e 's|/local/|/|' -i CMakeLists.txt
-}
+patch_args=-Np1
 
 post_install() {
 	vlicense LICENSE

From ecda668710cf851e4718245351e8563769be8990 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: Thu, 25 Mar 2021 08:34:32 +0700
Subject: [PATCH 21/60] libbaseencode: hardening

---
 srcpkgs/libbaseencode/patches/fix-cflags.patch | 13 +++++++++++++
 srcpkgs/libbaseencode/template                 |  3 ++-
 2 files changed, 15 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/libbaseencode/patches/fix-cflags.patch

diff --git a/srcpkgs/libbaseencode/patches/fix-cflags.patch b/srcpkgs/libbaseencode/patches/fix-cflags.patch
new file mode 100644
index 000000000000..1bb86a0b15a4
--- /dev/null
+++ b/srcpkgs/libbaseencode/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: libbaseencode-1.0.9/CMakeLists.txt
+===================================================================
+--- libbaseencode-1.0.9.orig/CMakeLists.txt
++++ libbaseencode-1.0.9/CMakeLists.txt
+@@ -15,7 +15,7 @@ set(CMAKE_C_STANDARD 11)
+ set(BASEENCODE_HEADERS src/baseencode.h)
+ set(SOURCE_FILES src/base32.c src/base64.c)
+ 
+-set(CMAKE_C_FLAGS "-Wall -Werror -fPIC")
++set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Werror -fPIC")
+ 
+ add_library(${PROJECT_NAME} SHARED ${SOURCE_FILES})
+ 
diff --git a/srcpkgs/libbaseencode/template b/srcpkgs/libbaseencode/template
index 384a189224df..d5929ad7bb51 100644
--- a/srcpkgs/libbaseencode/template
+++ b/srcpkgs/libbaseencode/template
@@ -1,7 +1,7 @@
 # Template file for 'libbaseencode'
 pkgname=libbaseencode
 version=1.0.9
-revision=1
+revision=2
 build_style=cmake
 short_desc="Library for encoding decoding data use base32 or base64"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -9,6 +9,7 @@ license="Apache-2.0"
 homepage="https://github.com/paolostivanin/libbaseencode"
 distfiles="https://github.com/paolostivanin/libbaseencode/archive/v${version}.tar.gz"
 checksum=a183d7cf30d931b2a078d6f0ef64616b71ab26f9258e5f4e191778c7ace7175d
+patch_args=-Np1
 
 libbaseencode-devel_package() {
 	depends="libbaseencode-${version}_${revision}"

From 4982c8c6db267deb5d700ca8f87f56b274759c1a 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: Fri, 26 Mar 2021 08:46:56 +0700
Subject: [PATCH 22/60] bibletime: clean build flags

---
 srcpkgs/bibletime/patches/fix-cflags.patch | 13 +++++++++++++
 srcpkgs/bibletime/template                 |  1 +
 2 files changed, 14 insertions(+)
 create mode 100644 srcpkgs/bibletime/patches/fix-cflags.patch

diff --git a/srcpkgs/bibletime/patches/fix-cflags.patch b/srcpkgs/bibletime/patches/fix-cflags.patch
new file mode 100644
index 000000000000..480c5ca4ac1e
--- /dev/null
+++ b/srcpkgs/bibletime/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: bibletime-3.0/cmake/BTApplication.cmake
+===================================================================
+--- bibletime-3.0.orig/cmake/BTApplication.cmake
++++ bibletime-3.0/cmake/BTApplication.cmake
+@@ -41,7 +41,7 @@ IF(WIN32)
+     ADD_COMPILE_OPTIONS("/Zi")
+ ELSE()
+     ADD_COMPILE_OPTIONS(
+-        "-ggdb" "-Wall" "-Wextra"
++        "-Wall" "-Wextra" "-DNDEBUG" "-DQT_NO_DEBUG"
+         "$<$<STREQUAL:$<CONFIGURATION>,Release>:-O2>"
+         "$<$<STREQUAL:$<CONFIGURATION>,Release>:-DNDEBUG>"
+         "$<$<STREQUAL:$<CONFIGURATION>,Release>:-DQT_NO_DEBUG>"
diff --git a/srcpkgs/bibletime/template b/srcpkgs/bibletime/template
index 224881c45516..85bcc7f22f87 100644
--- a/srcpkgs/bibletime/template
+++ b/srcpkgs/bibletime/template
@@ -18,6 +18,7 @@ license="GPL-2.0-or-later"
 homepage="http://bibletime.info"
 distfiles="https://github.com/bibletime/bibletime/releases/download/v${version}/bibletime-${version}.tar.xz"
 checksum=d6beef62ad44b255e3dc4c5e89214bf01a0e85c9136073b0be12fca3d2b22622
+patch_args=-Np1
 
 pre_build() {
 	. /etc/profile.d/10_openjdk11.sh

From 1213f8e1f990cd0f68137ef10473c41a5eaee9db 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: Fri, 26 Mar 2021 08:54:25 +0700
Subject: [PATCH 23/60] boomerang: clean build flags

---
 srcpkgs/boomerang/patches/fix-cflags.patch | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
 create mode 100644 srcpkgs/boomerang/patches/fix-cflags.patch

diff --git a/srcpkgs/boomerang/patches/fix-cflags.patch b/srcpkgs/boomerang/patches/fix-cflags.patch
new file mode 100644
index 000000000000..eb59766c1c5b
--- /dev/null
+++ b/srcpkgs/boomerang/patches/fix-cflags.patch
@@ -0,0 +1,21 @@
+Index: cmake-scripts/boomerang-flags.cmake
+===================================================================
+--- cmake-scripts/boomerang-flags.cmake
++++ cmake-scripts/boomerang-flags.cmake
+@@ -104,16 +104,6 @@ endif ()
+ 
+ 
+ if (NOT MSVC)
+-    if ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
+-        BOOMERANG_ADD_COMPILE_FLAGS(-O0)
+-    elseif ("${CMAKE_BUILD_TYPE}" STREQUAL "RelWithDebInfo")
+-        # No special flags
+-    elseif ("${CMAKE_BUILD_TYPE}" STREQUAL "MinSizeRel")
+-        BOOMERANG_ADD_COMPILE_FLAGS(-Os)
+-    else () # Release
+-        BOOMERANG_ADD_COMPILE_FLAGS(-O3)
+-    endif ()
+-
+     if (BOOMERANG_ENABLE_COVERAGE)
+         set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fprofile-arcs -ftest-coverage")
+         set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage")

From fae83a69ca5e9b05bd7fdeb034f0e8920baa8fbc 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: Fri, 26 Mar 2021 08:58:11 +0700
Subject: [PATCH 24/60] catimg: don't change our build-type

---
 srcpkgs/catimg/patches/fix-cflags.patch | 12 ++++++++++++
 srcpkgs/catimg/template                 |  2 +-
 2 files changed, 13 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/catimg/patches/fix-cflags.patch

diff --git a/srcpkgs/catimg/patches/fix-cflags.patch b/srcpkgs/catimg/patches/fix-cflags.patch
new file mode 100644
index 000000000000..9b9f1074ef20
--- /dev/null
+++ b/srcpkgs/catimg/patches/fix-cflags.patch
@@ -0,0 +1,12 @@
+Index: catimg-2.7.0/CMakeLists.txt
+===================================================================
+--- catimg-2.7.0.orig/CMakeLists.txt
++++ catimg-2.7.0/CMakeLists.txt
+@@ -11,7 +11,6 @@ endif()
+ #set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wall -Wextra -g -std=c99 -Wno-unused-result")
+ #set(CMAKE_BUILD_TYPE Debug)
+ set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -Wall -Wextra -Os -std=c99 -Wno-unused-result")
+-set(CMAKE_BUILD_TYPE Release)
+ 
+ set(SRC ${PROJECT_SOURCE_DIR}/src)
+ 
diff --git a/srcpkgs/catimg/template b/srcpkgs/catimg/template
index 374351c45379..6fbc5f1d9140 100644
--- a/srcpkgs/catimg/template
+++ b/srcpkgs/catimg/template
@@ -9,7 +9,7 @@ license="MIT"
 homepage="https://github.com/posva/catimg"
 distfiles="https://github.com/posva/catimg/archive/${version}.tar.gz"
 checksum=3a6450316ff62fb07c3facb47ea208bf98f62abd02783e88c56f2a6508035139
-
+patch_args=-Np1
 CFLAGS="-fcommon"
 
 post_install() {

From 01de770c05704a74ffb1587ab0a546a4126a7e71 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: Fri, 26 Mar 2021 09:09:37 +0700
Subject: [PATCH 25/60] libcotp: fix build flags

---
 srcpkgs/libcotp/patches/fix-cflags.patch | 14 ++++++++++++++
 srcpkgs/libcotp/template                 |  1 +
 2 files changed, 15 insertions(+)
 create mode 100644 srcpkgs/libcotp/patches/fix-cflags.patch

diff --git a/srcpkgs/libcotp/patches/fix-cflags.patch b/srcpkgs/libcotp/patches/fix-cflags.patch
new file mode 100644
index 000000000000..397b3960e9f4
--- /dev/null
+++ b/srcpkgs/libcotp/patches/fix-cflags.patch
@@ -0,0 +1,14 @@
+Index: libcotp-1.2.2/CMakeLists.txt
+===================================================================
+--- libcotp-1.2.2.orig/CMakeLists.txt
++++ libcotp-1.2.2/CMakeLists.txt
+@@ -25,8 +25,7 @@ set(CMAKE_C_STANDARD 11)
+ set(COTP_HEADERS src/cotp.h)
+ set(SOURCE_FILES src/otp.c)
+ 
+-set(CMAKE_C_FLAGS "-Wall -Wextra -O3 -Wno-format-truncation -fstack-protector-strong -fPIC")
+-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3")
++set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wno-format-truncation -fstack-protector-strong -fPIC")
+ 
+ add_library(cotp SHARED ${SOURCE_FILES})
+ 
diff --git a/srcpkgs/libcotp/template b/srcpkgs/libcotp/template
index 9e147ff7deb6..88337290d1e8 100644
--- a/srcpkgs/libcotp/template
+++ b/srcpkgs/libcotp/template
@@ -11,6 +11,7 @@ license="Apache-2.0"
 homepage="https://github.com/paolostivanin/libcotp"
 distfiles="https://github.com/paolostivanin/libcotp/archive/v${version}.tar.gz"
 checksum=25b45ffa4aece5cc689503ebea7356a2f760c194f0c41805934495d2fe7165b1
+patch_args=-Np1
 
 libcotp-devel_package() {
 	depends="libcotp-${version}_${revision}"

From 41dc8700b9f6ba5e745a6b43b129cd0354327972 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: Fri, 26 Mar 2021 21:06:07 +0700
Subject: [PATCH 26/60] loudgain: hardening

---
 srcpkgs/loudgain/patches/fix-cflags.patch | 20 ++++++++++++++++++++
 srcpkgs/loudgain/template                 |  3 ++-
 2 files changed, 22 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/loudgain/patches/fix-cflags.patch

diff --git a/srcpkgs/loudgain/patches/fix-cflags.patch b/srcpkgs/loudgain/patches/fix-cflags.patch
new file mode 100644
index 000000000000..25b2c969bef4
--- /dev/null
+++ b/srcpkgs/loudgain/patches/fix-cflags.patch
@@ -0,0 +1,20 @@
+Index: loudgain-0.6.8/CMakeLists.txt
+===================================================================
+--- loudgain-0.6.8.orig/CMakeLists.txt
++++ loudgain-0.6.8/CMakeLists.txt
+@@ -69,12 +69,12 @@ TARGET_LINK_LIBRARIES(loudgain
+ )
+ 
+ SET_TARGET_PROPERTIES(loudgain PROPERTIES
+-  COMPILE_FLAGS "-Wall -pedantic -g"
++  COMPILE_FLAGS "-Wall -pedantic"
+ )
+ 
+-SET(CMAKE_C_FLAGS "-std=gnu99 -D_GNU_SOURCE")
++SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99 -D_GNU_SOURCE")
+ 
+-SET(CMAKE_CXX_FLAGS "-std=gnu++11 -D_GNU_SOURCE")
++SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11 -D_GNU_SOURCE")
+ 
+ INSTALL(TARGETS loudgain DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
+ 
diff --git a/srcpkgs/loudgain/template b/srcpkgs/loudgain/template
index f29167883439..00b2d20d27d6 100644
--- a/srcpkgs/loudgain/template
+++ b/srcpkgs/loudgain/template
@@ -1,7 +1,7 @@
 # Template file for 'loudgain'
 pkgname=loudgain
 version=0.6.8
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="pkg-config"
 makedepends="libebur128-devel taglib-devel ffmpeg-devel"
@@ -11,6 +11,7 @@ license="BSD-2-Clause"
 homepage="https://github.com/Moonbase59/loudgain"
 distfiles="https://github.com/Moonbase59/loudgain/archive/v${version}.tar.gz"
 checksum=1137c193ad941b366e87c5d84ccc95a7aa8571affc060db0bd1cf72c489aeaee
+patch_args=-Np1
 
 post_install() {
 	vlicense COPYING

From 6bf0e06ec0942f7d4a35081a00443f1a9667b4ed 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: Fri, 26 Mar 2021 21:14:31 +0700
Subject: [PATCH 27/60] masterpassword-cli: hardening

---
 srcpkgs/masterpassword-cli/patches/fix-cflags.patch | 13 +++++++++++++
 srcpkgs/masterpassword-cli/template                 |  2 +-
 2 files changed, 14 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/masterpassword-cli/patches/fix-cflags.patch

diff --git a/srcpkgs/masterpassword-cli/patches/fix-cflags.patch b/srcpkgs/masterpassword-cli/patches/fix-cflags.patch
new file mode 100644
index 000000000000..a303f6954544
--- /dev/null
+++ b/srcpkgs/masterpassword-cli/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: platform-independent/cli-c/CMakeLists.txt
+===================================================================
+--- platform-independent/cli-c/CMakeLists.txt.orig
++++ platform-independent/cli-c/CMakeLists.txt
+@@ -15,8 +15,6 @@ option( BUILD_MPW_BENCH         "C CLI M
+ option( BUILD_MPW_TESTS         "C Master Password algorithm test suite (needs: mpw_sodium, mpw_xml)." OFF )
+ 
+ # Default build flags.
+-set( CMAKE_BUILD_TYPE           Release )
+-set( CMAKE_C_FLAGS              "-O3" )
+ 
+ # Version.
+ file( READ                      "VERSION" mpw_version )
diff --git a/srcpkgs/masterpassword-cli/template b/srcpkgs/masterpassword-cli/template
index ee2b8d41ae4b..8536228a602b 100644
--- a/srcpkgs/masterpassword-cli/template
+++ b/srcpkgs/masterpassword-cli/template
@@ -1,7 +1,7 @@
 # Template file for 'masterpassword-cli'
 pkgname=masterpassword-cli
 version=2.6
-revision=5
+revision=6
 wrksrc=MasterPassword-${version}-cli-3
 build_wrksrc=platform-independent/cli-c
 build_style=cmake

From 60c4314fbff51a6facc93a4ffbfe010fbdece0f3 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: Fri, 26 Mar 2021 21:20:13 +0700
Subject: [PATCH 28/60] msg2: hardening

---
 srcpkgs/msg2/patches/fix-cflags.patch | 13 +++++++++++++
 srcpkgs/msg2/template                 |  2 +-
 2 files changed, 14 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/msg2/patches/fix-cflags.patch

diff --git a/srcpkgs/msg2/patches/fix-cflags.patch b/srcpkgs/msg2/patches/fix-cflags.patch
new file mode 100644
index 000000000000..64404bf44fcb
--- /dev/null
+++ b/srcpkgs/msg2/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -3,7 +3,7 @@ project(msg2)
+ 
+ # Flags
+ set(CMAKE_CXX_STANDARD 17)
+-set(CMAKE_CXX_FLAGS "-Os -pipe -fPIC -fno-plt -fstack-protector-strong -Wall -Wshadow -pedantic -Wno-parentheses -Wfatal-errors")
++set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pipe -fPIC -fno-plt -fstack-protector-strong -Wall -Wshadow -pedantic -Wno-parentheses -Wfatal-errors")
+ 
+ # Add source files
+ add_executable(msg2 main.cpp)
diff --git a/srcpkgs/msg2/template b/srcpkgs/msg2/template
index b4f77400bf22..473b3c4ec4d2 100644
--- a/srcpkgs/msg2/template
+++ b/srcpkgs/msg2/template
@@ -1,7 +1,7 @@
 # Template file for 'msg2'
 pkgname=msg2
 version=1.2.0
-revision=1
+revision=2
 build_style=cmake
 short_desc="Output a blue arrow and a white message on the commandline"
 maintainer="Orphaned <orphan@voidlinux.org>"

From 413a129dd97a1b14a31ea782f051ce8a217b6337 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: Fri, 26 Mar 2021 21:22:55 +0700
Subject: [PATCH 29/60] ippusbxd: fix cflags -O2 not -o2

---
 srcpkgs/ippusbxd/patches/fix-cflags.patch | 12 ++++++++++++
 srcpkgs/ippusbxd/template                 |  2 +-
 2 files changed, 13 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/ippusbxd/patches/fix-cflags.patch

diff --git a/srcpkgs/ippusbxd/patches/fix-cflags.patch b/srcpkgs/ippusbxd/patches/fix-cflags.patch
new file mode 100644
index 000000000000..5d36903c3ffd
--- /dev/null
+++ b/srcpkgs/ippusbxd/patches/fix-cflags.patch
@@ -0,0 +1,12 @@
+Index: src/CMakeLists.txt
+===================================================================
+--- src/CMakeLists.txt.orig
++++ src/CMakeLists.txt
+@@ -1,6 +1,6 @@
+ cmake_minimum_required(VERSION 2.6)
+ project(ippusbxd)
+-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -o2 -g -std=c99 -Wall -Wextra -pedantic -pedantic-errors")
++set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -Wall -Wextra -pedantic -pedantic-errors")
+ 
+ 
+ # Compiler specific configuration
diff --git a/srcpkgs/ippusbxd/template b/srcpkgs/ippusbxd/template
index ce4ff2ea9125..e81064e8b91d 100644
--- a/srcpkgs/ippusbxd/template
+++ b/srcpkgs/ippusbxd/template
@@ -1,7 +1,7 @@
 # Template file for 'ippusbxd'
 pkgname=ippusbxd
 version=1.34
-revision=1
+revision=2
 build_wrksrc=src
 build_style=cmake
 make_cmd=make

From 55b458203af4eb7560ca0af3613d403da7e504ac 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: Fri, 26 Mar 2021 21:34:52 +0700
Subject: [PATCH 30/60] tlsh: respect -g

---
 srcpkgs/tlsh/patches/fix-cflags.patch | 13 +++++++++++++
 srcpkgs/tlsh/template                 |  2 +-
 2 files changed, 14 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/tlsh/patches/fix-cflags.patch

diff --git a/srcpkgs/tlsh/patches/fix-cflags.patch b/srcpkgs/tlsh/patches/fix-cflags.patch
new file mode 100644
index 000000000000..8715563715c7
--- /dev/null
+++ b/srcpkgs/tlsh/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -125,7 +125,7 @@ if (CMAKE_BUILD_TYPE STREQUAL Debug)
+     endif()
+ else(CMAKE_BUILD_TYPE STREQUAL Debug)
+     if(CMAKE_COMPILER_IS_GNUCXX)
+-        set(CMAKE_CXX_FLAGS "-O2 -fvisibility=internal")  ## Remove TlshImpl symbols
++        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=internal")  ## Remove TlshImpl symbols
+     endif()
+     if(MSVC)
+         set(CMAKE_CXX_FLAGS "/O2")        ## Optimize
diff --git a/srcpkgs/tlsh/template b/srcpkgs/tlsh/template
index 7cb5c28b48b9..dfea27526e14 100644
--- a/srcpkgs/tlsh/template
+++ b/srcpkgs/tlsh/template
@@ -1,7 +1,7 @@
 # Template file for 'tlsh'
 pkgname=tlsh
 version=3.17.0
-revision=2
+revision=3
 build_style=cmake
 hostmakedepends="python3"
 makedepends="python3-devel"

From c3e8bd61ab43e6881d0b55a3b1105401b8e8c703 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: Fri, 26 Mar 2021 21:59:06 +0700
Subject: [PATCH 31/60] poppler: hardening + respect -g

---
 srcpkgs/poppler/patches/fix-cflags.patch | 21 +++++++++++++++++++++
 srcpkgs/poppler/template                 |  2 +-
 2 files changed, 22 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/poppler/patches/fix-cflags.patch

diff --git a/srcpkgs/poppler/patches/fix-cflags.patch b/srcpkgs/poppler/patches/fix-cflags.patch
new file mode 100644
index 000000000000..9e62b11010ba
--- /dev/null
+++ b/srcpkgs/poppler/patches/fix-cflags.patch
@@ -0,0 +1,21 @@
+Index: cmake/modules/PopplerMacros.cmake
+===================================================================
+--- cmake/modules/PopplerMacros.cmake.orig
++++ cmake/modules/PopplerMacros.cmake
+@@ -123,14 +123,14 @@ if(CMAKE_COMPILER_IS_GNUCXX)
+   set(DEFAULT_COMPILE_WARNINGS_EXTRA "${_warn} ${_warnx}")
+ 
+   set(_save_cxxflags "${CMAKE_CXX_FLAGS}")
+-  set(CMAKE_CXX_FLAGS                "-fno-exceptions -fno-check-new -fno-common -D_DEFAULT_SOURCE")
++  set(CMAKE_CXX_FLAGS                "-fno-exceptions -fno-check-new -fno-common -D_DEFAULT_SOURCE ${_save_cxxflags}")
+   set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g ${_save_cxxflags}")
+   set(CMAKE_CXX_FLAGS_RELEASE        "-O2 -DNDEBUG ${_save_cxxflags}")
+   set(CMAKE_CXX_FLAGS_DEBUG          "-g -O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline ${_save_cxxflags}")
+   set(CMAKE_CXX_FLAGS_DEBUGFULL      "-g3 -fno-inline ${_save_cxxflags}")
+   set(CMAKE_CXX_FLAGS_PROFILE        "-g3 -fno-inline -ftest-coverage -fprofile-arcs ${_save_cxxflags}")
+   set(_save_cflags "${CMAKE_C_FLAGS}")
+-  set(CMAKE_C_FLAGS                  "-std=c99 -D_DEFAULT_SOURCE")
++  set(CMAKE_C_FLAGS                  "-std=c99 -D_DEFAULT_SOURCE ${_save_cflags}")
+   set(CMAKE_C_FLAGS_RELWITHDEBINFO   "-O2 -g ${_save_cflags}")
+   set(CMAKE_C_FLAGS_RELEASE          "-O2 -DNDEBUG ${_save_cflags}")
+   set(CMAKE_C_FLAGS_DEBUG            "-g -O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline ${_save_cflags}")
diff --git a/srcpkgs/poppler/template b/srcpkgs/poppler/template
index ed0db8de7ab6..1aebd7f7e177 100644
--- a/srcpkgs/poppler/template
+++ b/srcpkgs/poppler/template
@@ -4,7 +4,7 @@
 #
 pkgname=poppler
 version=20.09.0
-revision=2
+revision=3
 build_style=cmake
 build_helper="gir"
 configure_args="-DENABLE_UNSTABLE_API_ABI_HEADERS=ON -DENABLE_CPP=ON

From 9b7d1a1c2e07cf59fdb0f46d301e4641ded854f5 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: Fri, 26 Mar 2021 21:59:29 +0700
Subject: [PATCH 32/60] poppler-qt5: hardening + respect -g

---
 srcpkgs/poppler-qt5/patches  | 1 +
 srcpkgs/poppler-qt5/template | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)
 create mode 120000 srcpkgs/poppler-qt5/patches

diff --git a/srcpkgs/poppler-qt5/patches b/srcpkgs/poppler-qt5/patches
new file mode 120000
index 000000000000..636e4ac2cbd9
--- /dev/null
+++ b/srcpkgs/poppler-qt5/patches
@@ -0,0 +1 @@
+../poppler/patches
\ No newline at end of file
diff --git a/srcpkgs/poppler-qt5/template b/srcpkgs/poppler-qt5/template
index 0dc45c05c58b..c2ec35dbbad3 100644
--- a/srcpkgs/poppler-qt5/template
+++ b/srcpkgs/poppler-qt5/template
@@ -5,7 +5,7 @@
 #
 pkgname=poppler-qt5
 version=20.09.0
-revision=1
+revision=2
 wrksrc="poppler-${version}"
 build_style=cmake
 configure_args="-DENABLE_UNSTABLE_API_ABI_HEADERS=ON -DENABLE_GLIB=OFF

From a30d7f9571b664cc781fcb717fdd80da01d00d4e 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: Sat, 27 Mar 2021 11:17:35 +0700
Subject: [PATCH 33/60] artyfx: remove -O1 -g

---
 srcpkgs/artyfx/patches/fix-avtk-cmake-sse.patch | 4 ++--
 srcpkgs/artyfx/patches/respect-our-cflags.patch | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/artyfx/patches/fix-avtk-cmake-sse.patch b/srcpkgs/artyfx/patches/fix-avtk-cmake-sse.patch
index 1a832155a566..47ef4dd9b84e 100644
--- a/srcpkgs/artyfx/patches/fix-avtk-cmake-sse.patch
+++ b/srcpkgs/artyfx/patches/fix-avtk-cmake-sse.patch
@@ -6,8 +6,8 @@
  
 -SET(CMAKE_C_FLAGS   "-fPIC -msse -msse2 -mfpmath=sse -g") # -fsanitize=address
 -SET(CMAKE_CXX_FLAGS "-fPIC -msse -msse2 -mfpmath=sse -g") # -fsanitize=address
-+SET(CMAKE_C_FLAGS   "${CMAKE_C_FLAGS} -fPIC -g") # -fsanitize=address
-+SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -g") # -fsanitize=address
++SET(CMAKE_C_FLAGS   "${CMAKE_C_FLAGS} -fPIC") # -fsanitize=address
++SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") # -fsanitize=address
 +
 +IF(BUILD_SSE)
 +	SET(CMAKE_C_FLAGS   "${CMAKE_C_FLAGS} -msse -msse2 -mfpmath=sse")
diff --git a/srcpkgs/artyfx/patches/respect-our-cflags.patch b/srcpkgs/artyfx/patches/respect-our-cflags.patch
index ee9155c7729e..7a32fd9df73b 100644
--- a/srcpkgs/artyfx/patches/respect-our-cflags.patch
+++ b/srcpkgs/artyfx/patches/respect-our-cflags.patch
@@ -10,8 +10,8 @@ Index: CMakeLists.txt
 -SET(CMAKE_C_FLAGS "-g -Wall -O1 -Wno-unused-variable")
 -SET(CMAKE_CXX_FLAGS "-g -Wall -O1 -Wno-unused-variable -ftree-vectorize")
 +SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fPIC -shared -L./src/avtk -Wl,--no-undefined")
-+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -Wall -O1 -Wno-unused-variable")
-+SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -Wall -O1 -Wno-unused-variable -ftree-vectorize")
++SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall  -Wno-unused-variable")
++SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall  -Wno-unused-variable -ftree-vectorize")
  
  
  # DSP sources

From deea7830ab5fd4e0e61446050e0c5668085bb802 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: Sat, 27 Mar 2021 11:27:28 +0700
Subject: [PATCH 34/60] coin3: build with CMAKE_BUILD_TYPE=None

---
 srcpkgs/coin3/template | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/coin3/template b/srcpkgs/coin3/template
index d5483ee048c3..8f7218c2e8c3 100644
--- a/srcpkgs/coin3/template
+++ b/srcpkgs/coin3/template
@@ -5,7 +5,7 @@ revision=1
 wrksrc="coin-Coin-${version}"
 build_style=cmake
 configure_args="-DCMAKE_INSTALL_INCLUDEDIR=/usr/include/Coin3
- -DCMAKE_BUILD_TYPE=Release -DCOIN_BUILD_TESTS=OFF -DCOIN_BUILD_DOCUMENTATION=ON"
+ -DCOIN_BUILD_TESTS=OFF -DCOIN_BUILD_DOCUMENTATION=ON"
 hostmakedepends="doxygen graphviz"
 makedepends="boost-devel glu-devel"
 short_desc="High-level 3D graphics toolkit"
@@ -15,6 +15,9 @@ homepage="https://coin3d.github.io/"
 distfiles="https://github.com/coin3d/coin/archive/Coin-${version}.tar.gz"
 checksum=b00d2a8e9d962397cf9bf0d9baa81bcecfbd16eef675a98c792f5cf49eb6e805
 
+CFLAGS=-DNDEBUG
+CXXFLAGS=-DNDEBUG
+
 if [ "$CROSS_BUILD" ]; then
 	# bypass runtime test (quote hashing is fine with gcc 9.3)
 	configure_args+=" -DHAVE_HASH_QUOTING_EXITCODE=0"

From cd2c26387ef78300525935a0dea677d8bc7afb30 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: Sat, 27 Mar 2021 11:46:46 +0700
Subject: [PATCH 35/60] conky: don't overwrite CMAKE_BUILD_TYPE

---
 srcpkgs/conky/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/conky/template b/srcpkgs/conky/template
index 8b95a628edfb..f05c7d4a1bf2 100644
--- a/srcpkgs/conky/template
+++ b/srcpkgs/conky/template
@@ -5,7 +5,7 @@ version=1.12.1
 revision=1
 build_style=cmake
 conf_files="/etc/conky/conky.conf /etc/conky/conky_no_x11.conf"
-configure_args="-DCMAKE_BUILD_TYPE=Release -DMAINTAINER_MODE=ON -DRELEASE=ON
+configure_args="-DMAINTAINER_MODE=ON -DRELEASE=ON
  -DDOC_PATH=share/doc/${pkgname} -DBUILD_X11=ON -DBUILD_CURL=ON -DBUILD_XDBE=ON
  -DBUILD_RSS=ON -DBUILD_WEATHER_METAR=ON -DBUILD_IMLIB2=ON -DBUILD_WLAN=ON
  -DBUILD_LUA_CAIRO=ON -DBUILD_LUA_IMLIB2=ON -DBUILD_LUA_RSVG=ON

From a75a7d99905f388bb90c45c850491e47d5f8ef79 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: Sat, 27 Mar 2021 11:46:46 +0700
Subject: [PATCH 36/60] conky-cli: don't overwrite CMAKE_BUILD_TYPE

---
 srcpkgs/conky-cli/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/conky-cli/template b/srcpkgs/conky-cli/template
index b61bdcca0504..7d512b65ab3e 100644
--- a/srcpkgs/conky-cli/template
+++ b/srcpkgs/conky-cli/template
@@ -6,7 +6,7 @@ revision=1
 wrksrc="${pkgname/-cli/}-${version}"
 build_style=cmake
 conf_files="/etc/conky/conky.conf /etc/conky/conky_no_x11.conf"
-configure_args="-DCMAKE_BUILD_TYPE=Release -DMAINTAINER_MODE=ON -DRELEASE=ON
+configure_args="-DMAINTAINER_MODE=ON -DRELEASE=ON
  -DDOC_PATH=share/doc/${pkgname} -DBUILD_X11=OFF -DBUILD_CURL=ON -DBUILD_XDBE=OFF
  -DBUILD_RSS=ON -DBUILD_WEATHER_METAR=OFF -DBUILD_IMLIB2=OFF -DBUILD_WLAN=ON
  -DBUILD_DOCS=ON"

From 9d1f975de97d04d6f522d58707eedbda43ea4fe7 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: Sat, 27 Mar 2021 11:48:25 +0700
Subject: [PATCH 37/60] crossguid: don't overwrite -O2

---
 srcpkgs/crossguid/fix-cflags.patch | 12 ++++++++++++
 1 file changed, 12 insertions(+)
 create mode 100644 srcpkgs/crossguid/fix-cflags.patch

diff --git a/srcpkgs/crossguid/fix-cflags.patch b/srcpkgs/crossguid/fix-cflags.patch
new file mode 100644
index 000000000000..983360a07ccf
--- /dev/null
+++ b/srcpkgs/crossguid/fix-cflags.patch
@@ -0,0 +1,12 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -2,7 +2,6 @@ cmake_minimum_required(VERSION 3.5.1)
+ project(CrossGuid)
+ 
+ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake")
+-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3")
+ 
+ option(XG_TESTS "Build test runner" ON)
+ 

From a15d53deb0e0797e0c6dc6aaeafd91a5a3b8cb4b 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: Sat, 27 Mar 2021 12:19:04 +0700
Subject: [PATCH 38/60] rapidjson: define -DNDEBUG

---
 srcpkgs/rapidjson/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/rapidjson/template b/srcpkgs/rapidjson/template
index 8597f8fb2706..99d92702cc9d 100644
--- a/srcpkgs/rapidjson/template
+++ b/srcpkgs/rapidjson/template
@@ -11,7 +11,7 @@ distfiles="https://github.com/miloyip/${pkgname}/archive/v${version}.tar.gz"
 checksum=bf7ced29704a1e696fbccf2a2b4ea068e7774fa37f6d7dd4039d0787f8bed98e
 
 # class-memaccess is required by https://github.com/Tencent/rapidjson/issues/1700
-CXXFLAGS="-Wno-type-limits -Wno-error=class-memaccess"
+CXXFLAGS="-Wno-type-limits -Wno-error=class-memaccess -DNDEBUG"
 
 post_patch() {
 	# Remove bin/jsonchecker, which is the JSON licensed files

From eddc6279bb03f41b96fabbc5ed6dc4fa72a87c9a 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: Sat, 27 Mar 2021 12:18:36 +0700
Subject: [PATCH 39/60] cura-engine: ignore -O3

---
 srcpkgs/cura-engine/patches/fix-cflags.patch | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 srcpkgs/cura-engine/patches/fix-cflags.patch

diff --git a/srcpkgs/cura-engine/patches/fix-cflags.patch b/srcpkgs/cura-engine/patches/fix-cflags.patch
new file mode 100644
index 000000000000..e48a665523b8
--- /dev/null
+++ b/srcpkgs/cura-engine/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -42,7 +42,7 @@ endif()
+ if(CMAKE_BUILD_TYPE_UPPER MATCHES "DEBUG")
+     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_DEBUG_INIT}")
+ else()
+-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELEASE_INIT}")
++    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DNDEBUG")
+ endif()
+ 
+ set(CMAKE_CXX_STANDARD 11)

From 43d33c989c6fa01be38651ebab40cbccb497a34f 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: Sat, 27 Mar 2021 12:22:29 +0700
Subject: [PATCH 40/60] dislocker: remove -O1

---
 srcpkgs/dislocker/patches/fix-cflags.patch | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 srcpkgs/dislocker/patches/fix-cflags.patch

diff --git a/srcpkgs/dislocker/patches/fix-cflags.patch b/srcpkgs/dislocker/patches/fix-cflags.patch
new file mode 100644
index 000000000000..1229efeeaf0c
--- /dev/null
+++ b/srcpkgs/dislocker/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: src/CMakeLists.txt
+===================================================================
+--- src/CMakeLists.txt.orig
++++ src/CMakeLists.txt
+@@ -71,7 +71,7 @@ if(NOT DEFINED WARN_FLAGS)
+ 	set (WARN_FLAGS "-Wall -Wextra" CACHE STRING "" FORCE)
+ endif()
+ if(NOT DEFINED HARDEN_FLAGS)
+-	set (HARDEN_FLAGS "-fstack-protector -fstrict-aliasing -D_FORTIFY_SOURCE=2 -O1" CACHE STRING "" FORCE)
++	set (HARDEN_FLAGS "-fstack-protector -fstrict-aliasing" CACHE STRING "" FORCE)
+ endif()
+ 
+ set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")

From 4d27494fe91d1c9a71a2db18abe0de00cf38fb5f 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: Sat, 27 Mar 2021 12:29:31 +0700
Subject: [PATCH 41/60] freeorion: remove -O3

---
 srcpkgs/freeorion/patches/fix-cflags.patch | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
 create mode 100644 srcpkgs/freeorion/patches/fix-cflags.patch

diff --git a/srcpkgs/freeorion/patches/fix-cflags.patch b/srcpkgs/freeorion/patches/fix-cflags.patch
new file mode 100644
index 000000000000..c66d54599556
--- /dev/null
+++ b/srcpkgs/freeorion/patches/fix-cflags.patch
@@ -0,0 +1,18 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -432,13 +432,6 @@ if(MSVC)
+     )
+ endif()
+ 
+-target_compile_options(freeorionparseobj
+-    PRIVATE
+-        $<$<CXX_COMPILER_ID:Clang>:-ftemplate-depth=512>
+-        $<$<CXX_COMPILER_ID:AppleClang>:-ftemplate-depth=512>
+-        $<$<AND:$<NOT:$<BOOL:${BUILD_TESTING}>>,$<CXX_COMPILER_ID:GNU>>:-O3>
+-)
+-
+ target_compile_definitions(freeorionparseobj
+     PUBLIC
+         -DBOOST_ALL_DYN_LINK

From b479c208d6e6968d1e04721c2d22d18564770ad8 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: Fri, 26 Mar 2021 09:01:12 +0700
Subject: [PATCH 42/60] cglm: fix build flags

---
 srcpkgs/cglm/patches/fix-cflags.patch | 13 +++++++++++++
 srcpkgs/cglm/template                 |  1 +
 2 files changed, 14 insertions(+)
 create mode 100644 srcpkgs/cglm/patches/fix-cflags.patch

diff --git a/srcpkgs/cglm/patches/fix-cflags.patch b/srcpkgs/cglm/patches/fix-cflags.patch
new file mode 100644
index 000000000000..c74de6ea62d7
--- /dev/null
+++ b/srcpkgs/cglm/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: cglm-0.7.6/CMakeLists.txt
+===================================================================
+--- cglm-0.7.6.orig/CMakeLists.txt
++++ cglm-0.7.6/CMakeLists.txt
+@@ -25,7 +25,7 @@ if(MSVC)
+ 	add_definitions(-DNDEBUG -D_WINDOWS -D_USRDLL -DCGLM_EXPORTS -DCGLM_DLL)
+ 	add_compile_options(/W3 /Ox /Gy /Oi /TC)
+ else()
+-  add_compile_options(-Wall -Werror -O3)
++  add_compile_options(-Wall)
+ endif()
+ 
+ if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
diff --git a/srcpkgs/cglm/template b/srcpkgs/cglm/template
index f00a093edab9..311b4c79a7d3 100644
--- a/srcpkgs/cglm/template
+++ b/srcpkgs/cglm/template
@@ -9,6 +9,7 @@ license="MIT"
 homepage="https://github.com/recp/cglm"
 distfiles="https://github.com/recp/cglm/archive/v${version}.tar.gz"
 checksum=29ff8af4edc03697e36d3e6f99a80b884a80ee09d46055ce45765e5d6b2456d9
+patch_args=-Np1
 
 post_install() {
 	vlicense LICENSE

From 661a5bc28c64baa823cba2596f6215c0bf066cee 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: Sat, 27 Mar 2021 12:36:19 +0700
Subject: [PATCH 43/60] glyr: don't force Release build

---
 srcpkgs/glyr/patches/fix-cflags.patch | 12 ++++++++++++
 1 file changed, 12 insertions(+)
 create mode 100644 srcpkgs/glyr/patches/fix-cflags.patch

diff --git a/srcpkgs/glyr/patches/fix-cflags.patch b/srcpkgs/glyr/patches/fix-cflags.patch
new file mode 100644
index 000000000000..498ffe09a38f
--- /dev/null
+++ b/srcpkgs/glyr/patches/fix-cflags.patch
@@ -0,0 +1,12 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -60,7 +60,6 @@ exec_program(
+ IF(CMAKE_BUILD_TYPE STREQUAL "debug")
+     SET(GLYR_DEBUG TRUE)
+ ELSE()
+-    SET(CMAKE_BUILD_TYPE "release")
+     SET(GLYR_DEBUG FALSE)
+ ENDIF()
+ MESSAGE("-- Building Target: ${CMAKE_BUILD_TYPE}")

From 5561d36b2a44c6b1c85e541000813fc3f7d6edfb 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: Sat, 27 Mar 2021 12:41:50 +0700
Subject: [PATCH 44/60] hugin: remove -O3

---
 srcpkgs/hugin/patches/fix-cflags.patch | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
 create mode 100644 srcpkgs/hugin/patches/fix-cflags.patch

diff --git a/srcpkgs/hugin/patches/fix-cflags.patch b/srcpkgs/hugin/patches/fix-cflags.patch
new file mode 100644
index 000000000000..02fa56bef0e1
--- /dev/null
+++ b/srcpkgs/hugin/patches/fix-cflags.patch
@@ -0,0 +1,15 @@
+Index: src/celeste/CMakeLists.txt
+===================================================================
+--- src/celeste/CMakeLists.txt.orig
++++ src/celeste/CMakeLists.txt
+@@ -16,10 +16,6 @@
+ #    You should have received a copy of the GNU General Public License
+ #    along with Hugin  If not, see <http://www.gnu.org/licenses/>.
+  
+-IF(NOT WIN32)
+-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3")
+-ENDIF(NOT WIN32)
+-
+ # a list of all files belonging to celeste library
+ 
+ SET(CELESTE_SRC

From 3668b75d618258be9da499176d888446c1178525 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: Sat, 27 Mar 2021 13:05:27 +0700
Subject: [PATCH 45/60] ledger: don't overwrite CMAKE_BUILD_TYPE

---
 srcpkgs/ledger/patches/fix-cflags.patch | 12 ++++++++++++
 1 file changed, 12 insertions(+)
 create mode 100644 srcpkgs/ledger/patches/fix-cflags.patch

diff --git a/srcpkgs/ledger/patches/fix-cflags.patch b/srcpkgs/ledger/patches/fix-cflags.patch
new file mode 100644
index 000000000000..179ab79cd148
--- /dev/null
+++ b/srcpkgs/ledger/patches/fix-cflags.patch
@@ -0,0 +1,12 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -41,7 +41,6 @@ if (BUILD_DEBUG)
+   set(CMAKE_BUILD_TYPE Debug)
+   set(DEBUG_MODE 1)
+ else()
+-  set(CMAKE_BUILD_TYPE Release)
+   set(DEBUG_MODE 0)
+ endif()
+ 

From 62d0d120d86729293823521fa1a56a9e45a84c5c 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: Sat, 27 Mar 2021 13:18:24 +0700
Subject: [PATCH 46/60] libmygpo-qt: remove -ggdb3

---
 srcpkgs/libmygpo-qt/patches/fix-cflags.patch | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 srcpkgs/libmygpo-qt/patches/fix-cflags.patch

diff --git a/srcpkgs/libmygpo-qt/patches/fix-cflags.patch b/srcpkgs/libmygpo-qt/patches/fix-cflags.patch
new file mode 100644
index 000000000000..9940b6fc4323
--- /dev/null
+++ b/srcpkgs/libmygpo-qt/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -69,7 +69,7 @@ if (CMAKE_COMPILER_IS_GNUCXX)
+        -Wwrite-strings -Wpacked -Wformat-security -Wmissing-format-attribute
+        -Wold-style-cast -Woverloaded-virtual -Wnon-virtual-dtor  -Wall -Wextra
+        -Wformat=2 -Wundef -Wstack-protector -Wmissing-include-dirs
+-       -Winit-self -Wunsafe-loop-optimizations  -ggdb3 -fno-inline -DQT_STRICT_ITERATORS )
++       -Winit-self -Wunsafe-loop-optimizations  -fno-inline -DQT_STRICT_ITERATORS )
+     if ( NOT WIN32 )
+         add_definitions( -fvisibility=hidden )
+     endif()

From c82a9b95a019383b0c98fe4e52001c2fac703ffd 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: Sat, 27 Mar 2021 13:48:38 +0700
Subject: [PATCH 47/60] libogre: don't build vendored libraries

---
 srcpkgs/libogre/template | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/srcpkgs/libogre/template b/srcpkgs/libogre/template
index 784e3a648bac..6dd88ea08c73 100644
--- a/srcpkgs/libogre/template
+++ b/srcpkgs/libogre/template
@@ -3,11 +3,8 @@ pkgname=libogre
 version=1.12.9
 revision=1
 build_style=cmake
-configure_args="-DCMAKE_INSTALL_PREFIX=/usr \
-	-DOGRE_INSTALL_SAMPLES=TRUE \
-	-DOGRE_INSTALL_DOCS=TRUE \
-	-DOGRE_INSTALL_SAMPLES_SOURCE=TRUE \
-	-DCMAKE_BUILD_TYPE=Release"
+configure_args="-DOGRE_INSTALL_SAMPLES=TRUE -DOGRE_INSTALL_DOCS=TRUE
+ -DOGRE_INSTALL_SAMPLES_SOURCE=TRUE -DOGRE_BUILD_DEPENDENCIES=FALSE"
 hostmakedepends="pkg-config graphviz doxygen dejavu-fonts-ttf"
 makedepends="boost-devel freetype-devel libXaw-devel libXrandr-devel
  MesaLib-devel zziplib-devel libcppunit-devel glu-devel libatomic-devel

From 99426a9155cc9e0e3f3409fe4d03490c5a3400b6 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: Sat, 27 Mar 2021 13:52:50 +0700
Subject: [PATCH 48/60] libopenglrecorder: remove -O3

---
 srcpkgs/libopenglrecorder/patches/fix-cflags.patch | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 srcpkgs/libopenglrecorder/patches/fix-cflags.patch

diff --git a/srcpkgs/libopenglrecorder/patches/fix-cflags.patch b/srcpkgs/libopenglrecorder/patches/fix-cflags.patch
new file mode 100644
index 000000000000..7c48a0d2d822
--- /dev/null
+++ b/srcpkgs/libopenglrecorder/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -21,7 +21,7 @@ if (UNIX OR MINGW)
+     if (CMAKE_BUILD_TYPE MATCHES Debug)
+         add_definitions(-std=gnu++0x -O0)
+     else()
+-        add_definitions(-std=gnu++0x -O3)
++        add_definitions(-std=gnu++0x)
+     endif()
+ endif()
+ 

From 6d55110fff149ba2e2c24cc8e577976c57312190 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: Sat, 27 Mar 2021 13:55:41 +0700
Subject: [PATCH 49/60] libvidstab: remove -O3

---
 srcpkgs/libvidstab/patches/fix-cflags.patch | 39 +++++++++++++++++++++
 1 file changed, 39 insertions(+)
 create mode 100644 srcpkgs/libvidstab/patches/fix-cflags.patch

diff --git a/srcpkgs/libvidstab/patches/fix-cflags.patch b/srcpkgs/libvidstab/patches/fix-cflags.patch
new file mode 100644
index 000000000000..51c357efb101
--- /dev/null
+++ b/srcpkgs/libvidstab/patches/fix-cflags.patch
@@ -0,0 +1,39 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -25,7 +25,7 @@ else()
+     set(LIBSUFFIX "")
+ endif()
+ 
+-add_definitions( -Wall -O3 -g -Wno-pointer-sign -fPIC -std=gnu99)
++add_definitions( -Wall -Wno-pointer-sign -fPIC -std=gnu99)
+ # add_definitions(  -Wall -O0 -g -Wno-pointer-sign )
+ 
+ ### ORC is not used in any active code at the moment  ###
+Index: tests/CMakeLists.txt
+===================================================================
+--- tests/CMakeLists.txt.orig
++++ tests/CMakeLists.txt
+@@ -11,7 +11,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PAT
+ option(USE_OMP "use parallelization use OMP" ON)
+ 
+ #add_definitions( -Wall -O3 -Wno-pointer-sign -DTESTING  -std=gnu99)
+-add_definitions(  -Wall -O0 -g -Wno-pointer-sign -DTESTING -std=gnu99)
++add_definitions(  -Wall -Wno-pointer-sign -DTESTING -std=gnu99)
+ find_package(Orc)
+ if(ORC_FOUND)
+ add_definitions( -DUSE_ORC ${ORC_DEFINITIONS})
+Index: transcode/CMakeLists.txt
+===================================================================
+--- transcode/CMakeLists.txt.orig
++++ transcode/CMakeLists.txt
+@@ -9,7 +9,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PAT
+ set(TRANSCODE_ROOT ../../transcode)
+ 
+ 
+-add_definitions( -Wall -O3 -Wno-pointer-sign -DTRANSCODE -std=gnu99)
++add_definitions( -Wall -Wno-pointer-sign -DTRANSCODE -std=gnu99)
+ #add_definitions(  -Wall -O0 -g -Wno-pointer-sign )
+ # I tried it with 0.4.14
+ #  0.4.10 did not work (not all opcode implemented)

From 11c2ae01181768fb2e037c5d486bfef095ff1358 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: Sat, 27 Mar 2021 14:18:34 +0700
Subject: [PATCH 50/60] openlierox: don't overwrote CMAKE_BUILD_TYPE

---
 srcpkgs/openlierox/patches/fix-cflags.patch | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
 create mode 100644 srcpkgs/openlierox/patches/fix-cflags.patch

diff --git a/srcpkgs/openlierox/patches/fix-cflags.patch b/srcpkgs/openlierox/patches/fix-cflags.patch
new file mode 100644
index 000000000000..4fe6652fd0a2
--- /dev/null
+++ b/srcpkgs/openlierox/patches/fix-cflags.patch
@@ -0,0 +1,17 @@
+Index: CMakeOlxCommon.cmake
+===================================================================
+--- CMakeOlxCommon.cmake.orig
++++ CMakeOlxCommon.cmake
+@@ -36,12 +36,6 @@ OPTION(BREAKPAD "Google Breakpad support
+ OPTION(DISABLE_JOYSTICK "Disable joystick support" No)
+ OPTION(MINGW_CROSS_COMPILE "Cross-compile Windows .EXE using i686-w64-mingw32-gcc compiler" No)
+ 
+-IF (DEBUG)
+-	SET(CMAKE_BUILD_TYPE Debug)
+-ELSE (DEBUG)
+-	SET(CMAKE_BUILD_TYPE Release)
+-ENDIF (DEBUG)
+-
+ IF (DEDICATED_ONLY)
+ 	SET(X11 No)
+ 	SET(WITH_G15 No)

From 8dbe1e36b23347946dcc99bae0aeed1e0527e1a1 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: Sat, 27 Mar 2021 14:25:12 +0700
Subject: [PATCH 51/60] opensonic: don't overwrite CMAKE_BUILD_TYPE

---
 srcpkgs/opensonic/patches/fix-cflags.patch | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
 create mode 100644 srcpkgs/opensonic/patches/fix-cflags.patch

diff --git a/srcpkgs/opensonic/patches/fix-cflags.patch b/srcpkgs/opensonic/patches/fix-cflags.patch
new file mode 100644
index 000000000000..10d2c7c80e64
--- /dev/null
+++ b/srcpkgs/opensonic/patches/fix-cflags.patch
@@ -0,0 +1,17 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -25,12 +25,10 @@ SET(GAME_NAME "Open Sonic")
+ SET(GAME_VERSION "0.1.4")
+ SET(RTFM "Please read the user manual (readme.html) to get help.")
+ SET(ALLEGRO_RECOMMENDED_VERSION "4.4.1")
+-SET(CMAKE_BUILD_TYPE Release)
+ MESSAGE("${GAME_NAME} version ${GAME_VERSION}")
+ 
+ # configuring...
+ SET(DEFS "")
+-SET(CFLAGS_EXTRA "-g")
+ SET(CFLAGS "${CFLAGS} ${CMAKE_C_FLAGS}")
+ MESSAGE("Using CFLAGS='${CFLAGS}'")
+ 

From 785f0300ba870a39ed91f5c9c3c74387fa8f64ee 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: Sat, 27 Mar 2021 15:17:28 +0700
Subject: [PATCH 52/60] rocksdb: don't overwrite CMAKE_BUILD_TYPE

---
 srcpkgs/rocksdb/template | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/rocksdb/template b/srcpkgs/rocksdb/template
index e39329e5d6a6..5a6ca434f29b 100644
--- a/srcpkgs/rocksdb/template
+++ b/srcpkgs/rocksdb/template
@@ -3,8 +3,7 @@ pkgname=rocksdb
 version=5.18.3
 revision=2
 build_style=cmake
-configure_args="-DCMAKE_BUILD_TYPE=Release -DPORTABLE=1 -DWITH_TESTS=0
- -DUSE_RTTI=0 -DWITH_LZ4=1"
+configure_args="-DPORTABLE=1 -DWITH_TESTS=0 -DUSE_RTTI=0 -DWITH_LZ4=1"
 makedepends="liblz4-devel"
 short_desc="RocksDB is a embeddable, persistent key-value store for fast storage"
 maintainer="magenbluten <mb0@codemonkey.cc>"
@@ -12,6 +11,8 @@ license="GPL-2.0-or-later, Apache-2.0"
 homepage="https://github.com/facebook/rocksdb"
 distfiles="${homepage}/archive/v${version}.tar.gz"
 checksum=7fb6738263d3f2b360d7468cf2ebe333f3109f3ba1ff80115abd145d75287254
+CFLAGS=-DNDEBUG
+CXXFLAGS=-DNDEBUG
 
 if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
 	makedepends+=" libatomic-devel"

From 04a0e70a3af07534dc2091eb69b7f6530aa95355 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: Sat, 27 Mar 2021 15:19:47 +0700
Subject: [PATCH 53/60] rofs-filtered: hardening

---
 srcpkgs/rofs-filtered/patches/fix-cflags.patch | 13 +++++++++++++
 srcpkgs/rofs-filtered/template                 |  2 +-
 2 files changed, 14 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/rofs-filtered/patches/fix-cflags.patch

diff --git a/srcpkgs/rofs-filtered/patches/fix-cflags.patch b/srcpkgs/rofs-filtered/patches/fix-cflags.patch
new file mode 100644
index 000000000000..f64d3274f091
--- /dev/null
+++ b/srcpkgs/rofs-filtered/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -9,7 +9,7 @@ set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PA
+      "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
+ 
+ add_definitions(-D_GNU_SOURCE)
+-set(CMAKE_C_FLAGS "-Wall -std=c99")
++set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -std=c99")
+ 
+ # find fuse library
+ find_package (FUSE REQUIRED)
diff --git a/srcpkgs/rofs-filtered/template b/srcpkgs/rofs-filtered/template
index 332cd57a9902..e585877eaf59 100644
--- a/srcpkgs/rofs-filtered/template
+++ b/srcpkgs/rofs-filtered/template
@@ -1,7 +1,7 @@
 # Template file for 'rofs-filtered'
 pkgname=rofs-filtered
 version=1.7
-revision=1
+revision=2
 build_style=cmake
 makedepends="fuse-devel"
 short_desc="Filtered read only filesystem for FUSE"

From cc842a1fd8717d575944e8e02ce66ff28a1da3cb 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: Sat, 27 Mar 2021 15:40:26 +0700
Subject: [PATCH 54/60] seexpr-krita: don't overwrite CMAKE_BUILD_TYPE

---
 .../patches/cmake-build-type-none.patch       | 32 +++++++++++++++++++
 1 file changed, 32 insertions(+)
 create mode 100644 srcpkgs/seexpr-krita/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/seexpr-krita/patches/cmake-build-type-none.patch b/srcpkgs/seexpr-krita/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..94bb1f37db75
--- /dev/null
+++ b/srcpkgs/seexpr-krita/patches/cmake-build-type-none.patch
@@ -0,0 +1,32 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -42,14 +42,6 @@ endif()
+ 
+ ## Choose build options
+ # Disney specific method of choosing variant
+-if (${FLAVOR} STREQUAL "optimize")
+-    set(CMAKE_BUILD_TYPE "Release" CACHE STRING "type of build" FORCE)
+-endif()
+-
+-if (${FLAVOR} STREQUAL "debug")
+-    set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "type of build" FORCE)
+-endif()
+-
+ if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
+     execute_process(
+         COMMAND sh -c "echo `uname -s`-`uname -r | cut -d- -f1`-`uname -m`"
+@@ -212,12 +204,6 @@ else()
+ endif()
+ 
+ # Set to release if nothing else defined
+-if (NOT CMAKE_BUILD_TYPE)
+-  set(CMAKE_BUILD_TYPE "Release" CACHE STRING
+-      "Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel."
+-      FORCE)
+-endif()
+-
+ if (ENABLE_QT5)
+     find_package(Qt5 5.9.0 COMPONENTS Core Gui Widgets REQUIRED)
+     set_package_properties(Qt5 PROPERTIES

From 5680dfbb071d9dfa28701277f4cdd0a7c34e3b43 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: Sat, 27 Mar 2021 15:50:53 +0700
Subject: [PATCH 55/60] speed-dreams: hardening

---
 srcpkgs/speed-dreams/template | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/speed-dreams/template b/srcpkgs/speed-dreams/template
index 722f0c5ed87a..df7164f9c808 100644
--- a/srcpkgs/speed-dreams/template
+++ b/srcpkgs/speed-dreams/template
@@ -1,13 +1,13 @@
 # Template file for 'speed-dreams'
 pkgname=speed-dreams
 version=2.2.2
-revision=2
+revision=3
 archs="i686* x86_64* ppc64le*"
 _rev=r6553
 create_wrksrc=yes
 build_style=cmake
-configure_args="-DSD_BINDIR=/usr/bin -DSD_DATADIR=/usr/share/speed-dreams-2 -DSD_LIBDIR=/usr/lib/speed-dreams-2
- -DOPTION_OFFICIAL_ONLY=ON -DCMAKE_CXX_FLAGS=-fpermissive -DCMAKE_C_FLAGS=-fpermissive"
+configure_args="-DSD_BINDIR=/usr/bin -DSD_DATADIR=/usr/share/speed-dreams-2
+ -DSD_LIBDIR=/usr/lib/speed-dreams-2 -DOPTION_OFFICIAL_ONLY=ON"
 hostmakedepends="pkg-config"
 makedepends="freealut-devel libenet-devel libfreeglut-devel libjpeg-turbo-devel
  libpng-devel libvorbis-devel libXrandr-devel osg-devel plib-devel SDL2-devel
@@ -26,6 +26,8 @@ checksum="32aa55c17f8dafc1c54fb0d0b7b993d2688d431899cfc5db9eeece148c6887d0
  0b7b417d007ab3b7f0f4dcfdc868aafee1722150b81af519e1cd4c082b408183"
 nocross=yes
 replaces="speed-dreams-data>=0"
+CFLAGS=-fpermissive
+CXXFLAGS=-fpermissive
 
 if [ "$XBPS_TARGET_LIBC" = musl ]; then
 	broken="Segmentation fault"

From 3195112cadc86d7a610ca53d0e1c7ddac875c8f9 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: Sat, 27 Mar 2021 19:04:09 +0700
Subject: [PATCH 56/60] traverso: hardening

---
 .../patches/cmake-build-type-none.patch       | 28 +++++++++++++++++++
 srcpkgs/traverso/template                     |  2 +-
 2 files changed, 29 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/traverso/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/traverso/patches/cmake-build-type-none.patch b/srcpkgs/traverso/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..75b3fd941eb8
--- /dev/null
+++ b/srcpkgs/traverso/patches/cmake-build-type-none.patch
@@ -0,0 +1,28 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -65,13 +65,7 @@ SET(TRAVERSO_DEFINES -DSTATIC_BUILD)
+ 
+ #BUILD SETUP
+ #None, Debug, Release, .. or custom ones
+-IF(WANT_DEBUG)
+-  SET(CMAKE_BUILD_TYPE DEBUG)
+-  SET(WANT_TRAVERSO_DEBUG ON)
+-ELSE(WANT_DEBUG)
+-  SET(CMAKE_BUILD_TYPE RELEASE)
+-  LIST(APPEND TRAVERSO_DEFINES -DQT_NO_DEBUG)
+-ENDIF(WANT_DEBUG)
++LIST(APPEND TRAVERSO_DEFINES -DQT_NO_DEBUG)
+ 
+ 
+ IF(WANT_TRAVERSO_DEBUG)
+@@ -326,7 +320,7 @@ ${Qt5Xml_INCLUDE_DIRS}
+ ${Qt5Xml_INCLUDES}
+ )
+ 
+-set(CMAKE_CXX_FLAGS "-fPIC")
++set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
+ 
+ #Set up libraries to link with all found packages
+ LINK_LIBRARIES (
diff --git a/srcpkgs/traverso/template b/srcpkgs/traverso/template
index 105924d4f0c6..4b93460f63d7 100644
--- a/srcpkgs/traverso/template
+++ b/srcpkgs/traverso/template
@@ -1,7 +1,7 @@
 # Template file for 'traverso'
 pkgname=traverso
 version=0.49.6
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DWANT_MP3_ENCODE=ON -DDETECT_HOST_CPU_FEATURES=OFF"
 hostmakedepends="pkg-config qt5-qmake qt5-host-tools"

From acfd0cff0e4c1b2a581639b89042dfc01d91f925 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: Sat, 27 Mar 2021 19:08:11 +0700
Subject: [PATCH 57/60] xstarter: hardening

---
 .../patches/cmake-build-type-none.patch       | 22 +++++++++++++++++++
 srcpkgs/xstarter/template                     |  2 +-
 2 files changed, 23 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/xstarter/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/xstarter/patches/cmake-build-type-none.patch b/srcpkgs/xstarter/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..4f793e4c473c
--- /dev/null
+++ b/srcpkgs/xstarter/patches/cmake-build-type-none.patch
@@ -0,0 +1,22 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -5,16 +5,8 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
+ 
+ project(xstarter)
+ 
+-if(NOT CMAKE_BUILD_TYPE)
+-  set(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build (Debug or Release)" FORCE)
+-endif()
+-
+ set(PROJECT_VERSION "0.8.0")
+-if (CMAKE_BUILD_TYPE STREQUAL Debug)
+-  set(CMAKE_C_FLAGS "-g -Wall -pedantic")
+-else()
+-  set(CMAKE_C_FLAGS "-Wall -pedantic -O3")
+-endif()
++set(CMAKE_C_FLAGS "-Wall -pedantic ${CMAKE_C_FLAGS}")
+ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/bin")
+ 
+ set (CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
diff --git a/srcpkgs/xstarter/template b/srcpkgs/xstarter/template
index aa9a47e45e5c..4363d36e3c39 100644
--- a/srcpkgs/xstarter/template
+++ b/srcpkgs/xstarter/template
@@ -1,7 +1,7 @@
 # Template file for 'xstarter'
 pkgname=xstarter
 version=0.8.0
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="pkg-config"
 makedepends="glib-devel ncurses-devel"

From cadbcf0419a4028ca3cc180a6893149a9c1e8ac4 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: Sat, 27 Mar 2021 19:15:48 +0700
Subject: [PATCH 58/60] yabause-gtk: ignore -O3

---
 srcpkgs/yabause-gtk/patches/fix-cflags.patch | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 srcpkgs/yabause-gtk/patches/fix-cflags.patch

diff --git a/srcpkgs/yabause-gtk/patches/fix-cflags.patch b/srcpkgs/yabause-gtk/patches/fix-cflags.patch
new file mode 100644
index 000000000000..52c1cae61799
--- /dev/null
+++ b/srcpkgs/yabause-gtk/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: src/CMakeLists.txt
+===================================================================
+--- src/CMakeLists.txt.orig
++++ src/CMakeLists.txt
+@@ -659,7 +659,7 @@ else ()
+ 	set(yabause_SOURCES ${yabause_SOURCES} sock-dummy.c thr-dummy.c)
+ endif ()
+ 
+-set(YAB_OPTIMIZATION "-O3" CACHE STRING "Override optimization level")
++set(YAB_OPTIMIZATION "" CACHE STRING "Override optimization level")
+ 
+ if("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "i686")
+ 	set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${YAB_OPTIMIZATION} -march=i686 -msse")

From 43c7bef06eee1cc0929abda9654281244955f21c 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: Sat, 27 Mar 2021 19:26:47 +0700
Subject: [PATCH 59/60] ympd: hardening

---
 srcpkgs/ympd/patches/fix-cflags.patch | 13 +++++++++++++
 srcpkgs/ympd/template                 |  2 +-
 2 files changed, 14 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/ympd/patches/fix-cflags.patch

diff --git a/srcpkgs/ympd/patches/fix-cflags.patch b/srcpkgs/ympd/patches/fix-cflags.patch
new file mode 100644
index 000000000000..4720dd39e748
--- /dev/null
+++ b/srcpkgs/ympd/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -24,7 +24,7 @@ include_directories(${PROJECT_BINARY_DIR
+ 
+ include(CheckCSourceCompiles)
+ 
+-set(CMAKE_C_FLAGS "-std=gnu99 -Wall")
++set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99 -Wall")
+ set(CMAKE_C_FLAGS_DEBUG "-ggdb -pedantic")
+ if(WITH_IPV6)
+     set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS NS_ENABLE_IPV6)
diff --git a/srcpkgs/ympd/template b/srcpkgs/ympd/template
index 14437beb5384..450c079b2ca3 100644
--- a/srcpkgs/ympd/template
+++ b/srcpkgs/ympd/template
@@ -1,7 +1,7 @@
 # Template file for 'ympd'
 pkgname=ympd
 version=1.3.0
-revision=7
+revision=8
 build_style=cmake
 hostmakedepends="perl pkg-config"
 makedepends="libmpdclient-devel openssl-devel"

From 104d046023630c915dc95a571bc3442aa65c4217 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: Sat, 27 Mar 2021 19:29:31 +0700
Subject: [PATCH 60/60] z80ex: hardening

---
 srcpkgs/z80ex/patches/fix-cflags.patch | 13 +++++++++++++
 srcpkgs/z80ex/template                 |  2 +-
 2 files changed, 14 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/z80ex/patches/fix-cflags.patch

diff --git a/srcpkgs/z80ex/patches/fix-cflags.patch b/srcpkgs/z80ex/patches/fix-cflags.patch
new file mode 100644
index 000000000000..6743da255e5c
--- /dev/null
+++ b/srcpkgs/z80ex/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -11,7 +11,7 @@ option (OPSTEP_FAST_AND_ROUGH "Fast and
+ 
+ #ALL_CFLAGS := -fPIC -fno-common -ansi -pedantic -Wall -pipe -O2 -I. -I./include
+ if (CMAKE_COMPILER_IS_GNUCC)
+-    set (CMAKE_C_FLAGS "-fPIC -fno-common -ansi -pedantic -Wall -pipe -O2")
++    set (CMAKE_C_FLAGS "-fPIC -fno-common -ansi -pedantic -Wall -pipe ${CMAKE_C_FLAGS}")
+ endif ()
+ 
+ include_directories(BEFORE . include)
diff --git a/srcpkgs/z80ex/template b/srcpkgs/z80ex/template
index 00a24a6fb902..ae04241dcb5a 100644
--- a/srcpkgs/z80ex/template
+++ b/srcpkgs/z80ex/template
@@ -1,7 +1,7 @@
 # Template file for 'z80ex'
 pkgname=z80ex
 version=1.1.21
-revision=1
+revision=2
 build_style=cmake
 short_desc="ZiLOG Z80 CPU emulation library"
 maintainer="Diogo Leal <diogo@diogoleal.com>"

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: build-style/cmake: set CMAKE_BUILD_TYPE to None
  2021-03-14 13:19 [PR PATCH] [WIP] build-style/cmake: set CMAKE_BUILD_TYPE to None sgn
                   ` (22 preceding siblings ...)
  2021-03-27 12:30 ` sgn
@ 2021-03-27 12:33 ` sgn
  2021-03-28  3:40 ` [PR PATCH] [Updated] " sgn
                   ` (8 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: sgn @ 2021-03-27 12:33 UTC (permalink / raw)
  To: ml

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

New comment by sgn on void-packages repository

https://github.com/void-linux/void-packages/pull/29459#issuecomment-808725995

Comment:
Most patching are done.
Package that adds `-O2` and `-g` are ignored.
- `rspamd`, `yabause-gtk`, `yoshimi`, `zbackup`, `zig`, `zulucrypt` adds `-O3` but wasn't patched.

Would appreciate review from team.

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PR PATCH] [Updated] build-style/cmake: set CMAKE_BUILD_TYPE to None
  2021-03-14 13:19 [PR PATCH] [WIP] build-style/cmake: set CMAKE_BUILD_TYPE to None sgn
                   ` (23 preceding siblings ...)
  2021-03-27 12:33 ` sgn
@ 2021-03-28  3:40 ` sgn
  2021-03-28  3:50 ` sgn
                   ` (7 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: sgn @ 2021-03-28  3:40 UTC (permalink / raw)
  To: ml

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

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

https://github.com/sgn/void-packages cmake-build-type-to-None
https://github.com/void-linux/void-packages/pull/29459

build-style/cmake: set CMAKE_BUILD_TYPE to None
- I'm going to build all packages with `build_style=cmake` and fix them one by one before merging this in.

[ci skip]

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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-cmake-build-type-to-None-29459.patch --]
[-- Type: text/x-diff, Size: 116222 bytes --]

From c689c6f7b4e4dde56b163fd8a7435f106eed995b 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, 14 Mar 2021 20:18:03 +0700
Subject: [PATCH 01/62] build-style/cmake: set CMAKE_BUILD_TYPE to None

---
 common/build-style/cmake.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/build-style/cmake.sh b/common/build-style/cmake.sh
index 5100a96dfd7b..9d1a1a7a1941 100644
--- a/common/build-style/cmake.sh
+++ b/common/build-style/cmake.sh
@@ -52,7 +52,7 @@ _EOF
 		cmake_args+=" -DCMAKE_TOOLCHAIN_FILE=cross_${XBPS_CROSS_TRIPLET}.cmake"
 	fi
 	cmake_args+=" -DCMAKE_INSTALL_PREFIX=/usr"
-	cmake_args+=" -DCMAKE_BUILD_TYPE=Release"
+	cmake_args+=" -DCMAKE_BUILD_TYPE=None"
 	cmake_args+=" -DCMAKE_INSTALL_LIBDIR=lib${XBPS_TARGET_WORDSIZE}"
 
 	if [[ $build_helper = *"qemu"* ]]; then

From 9fd574422a1c9c3cb4c21e25dd4201d7cab1e2df 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: Mon, 15 Mar 2021 08:07:16 +0700
Subject: [PATCH 02/62] amdvlk: allow CMAKE_BUILD_TYPE=None

---
 .../patches/cmake-build-type-none.patch       | 60 +++++++++++++++++++
 1 file changed, 60 insertions(+)
 create mode 100644 srcpkgs/amdvlk/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/amdvlk/patches/cmake-build-type-none.patch b/srcpkgs/amdvlk/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..7a629e58548e
--- /dev/null
+++ b/srcpkgs/amdvlk/patches/cmake-build-type-none.patch
@@ -0,0 +1,60 @@
+Index: llvm-project/llvm/CMakeLists.txt
+===================================================================
+--- llvm-project/llvm/CMakeLists.txt.orig
++++ llvm-project/llvm/CMakeLists.txt
+@@ -251,11 +251,6 @@ endif()
+ 
+ string(TOUPPER "${CMAKE_BUILD_TYPE}" uppercase_CMAKE_BUILD_TYPE)
+ 
+-if (CMAKE_BUILD_TYPE AND
+-    NOT uppercase_CMAKE_BUILD_TYPE MATCHES "^(DEBUG|RELEASE|RELWITHDEBINFO|MINSIZEREL)$")
+-  message(FATAL_ERROR "Invalid value for CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
+-endif()
+-
+ set(LLVM_LIBDIR_SUFFIX "" CACHE STRING "Define suffix of library directory name (32/64)" )
+ 
+ set(LLVM_TOOLS_INSTALL_DIR "bin" CACHE STRING "Path for binary subdirectory (defaults to 'bin')")
+Index: pal/cmake/Modules/AmdCmakeHelper.cmake
+===================================================================
+--- pal/cmake/Modules/AmdCmakeHelper.cmake.orig
++++ pal/cmake/Modules/AmdCmakeHelper.cmake
+@@ -37,11 +37,6 @@ if (CMAKE_CONFIGURATION_TYPES)
+ else()
+     string(TOUPPER "${CMAKE_BUILD_TYPE}" capital_CMAKE_BUILD_TYPE)
+ 
+-    if (CMAKE_BUILD_TYPE AND
+-        NOT capital_CMAKE_BUILD_TYPE MATCHES "^(DEBUG|RELEASE|RELWITHDEBINFO|MINSIZEREL)$")
+-        message(FATAL_ERROR "Invalid value for CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
+-    endif()
+-
+     if(capital_CMAKE_BUILD_TYPE STREQUAL "DEBUG")
+         set(CMAKE_BUILD_TYPE_DEBUG ON)
+         set(CMAKE_BUILD_TYPE_RELEASE OFF)
+Index: xgl/CMakeLists.txt
+===================================================================
+--- xgl/CMakeLists.txt.orig
++++ xgl/CMakeLists.txt
+@@ -181,11 +181,6 @@ if (CMAKE_CONFIGURATION_TYPES)
+ else()
+     string(TOUPPER "${CMAKE_BUILD_TYPE}" capital_CMAKE_BUILD_TYPE)
+ 
+-    if (CMAKE_BUILD_TYPE AND
+-        NOT capital_CMAKE_BUILD_TYPE MATCHES "^(DEBUG|RELEASE|RELWITHDEBINFO|MINSIZEREL)$")
+-        message(FATAL_ERROR "Invalid value for CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
+-    endif()
+-
+     if(capital_CMAKE_BUILD_TYPE STREQUAL "DEBUG")
+         set(CMAKE_BUILD_TYPE_DEBUG ON)
+         set(CMAKE_BUILD_TYPE_RELEASE OFF)
+Index: xgl/icd/CMakeLists.txt
+===================================================================
+--- xgl/icd/CMakeLists.txt.orig
++++ xgl/icd/CMakeLists.txt
+@@ -84,7 +84,6 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Cl
+     endif()
+ 
+     if(CMAKE_BUILD_TYPE_RELEASE)
+-        target_compile_options(xgl PRIVATE -O3)
+         if(XGL_ENABLE_LTO)
+             if(${CMAKE_CXX_COMPILER_ID} MATCHES "GNU")
+                 execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION)

From dd120cf233fb6f92850b034f78b3135fa70208f0 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: Wed, 17 Mar 2021 06:24:04 +0700
Subject: [PATCH 03/62] eigen*: set CMAKE_BUILD_TYPE to Release

We're going to set default CMAKE_BUILD_TYPE to None soon. Those packages
are header only libraries, no need to waste time on patching.
---
 srcpkgs/eigen/template    | 1 +
 srcpkgs/eigen3.2/template | 1 +
 2 files changed, 2 insertions(+)

diff --git a/srcpkgs/eigen/template b/srcpkgs/eigen/template
index ee825e95f273..072228c16915 100644
--- a/srcpkgs/eigen/template
+++ b/srcpkgs/eigen/template
@@ -3,6 +3,7 @@ pkgname=eigen
 version=3.3.9
 revision=1
 build_style=cmake
+configure_args="-DCMAKE_BUILD_TYPE=Release"
 short_desc="C++ template library for linear algebra (version 3.x)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MPL-2.0, GPL-3.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
diff --git a/srcpkgs/eigen3.2/template b/srcpkgs/eigen3.2/template
index 5715fc1b3a19..7b710534b5e5 100644
--- a/srcpkgs/eigen3.2/template
+++ b/srcpkgs/eigen3.2/template
@@ -4,6 +4,7 @@ version=3.2.10
 revision=3
 wrksrc="eigen-${version}"
 build_style=cmake
+configure_args="-DCMAKE_BUILD_TYPE=Release"
 short_desc="C++ template library for linear algebra (version 3.x)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MPL-2.0, GPL-3.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"

From 9b9479f8ca54e6b305003131143bdc746dd72492 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: Wed, 17 Mar 2021 07:04:48 +0700
Subject: [PATCH 04/62] embree: don't ignore CXXFLAGS, fix build with ispc
 1.13+

---
 .../embree/patches/uintNN-is-part-of-ispc-1.13.patch | 12 ++++++++++++
 srcpkgs/embree/template                              |  6 ++----
 2 files changed, 14 insertions(+), 4 deletions(-)
 create mode 100644 srcpkgs/embree/patches/uintNN-is-part-of-ispc-1.13.patch

diff --git a/srcpkgs/embree/patches/uintNN-is-part-of-ispc-1.13.patch b/srcpkgs/embree/patches/uintNN-is-part-of-ispc-1.13.patch
new file mode 100644
index 000000000000..5d0b02f3b2e5
--- /dev/null
+++ b/srcpkgs/embree/patches/uintNN-is-part-of-ispc-1.13.patch
@@ -0,0 +1,12 @@
+Index: embree-2.17.7/tutorials/common/common.isph
+===================================================================
+--- embree-2.17.7.orig/tutorials/common/common.isph
++++ embree-2.17.7/tutorials/common/common.isph
+@@ -16,7 +16,3 @@
+ 
+ #pragma once
+ 
+-typedef unsigned int64 uint64;
+-typedef unsigned int32 uint32;
+-typedef unsigned int16 uint16;
+-typedef unsigned int8  uint8;
diff --git a/srcpkgs/embree/template b/srcpkgs/embree/template
index 0bc72f46b6d8..849ec3c26c1d 100644
--- a/srcpkgs/embree/template
+++ b/srcpkgs/embree/template
@@ -4,6 +4,7 @@ version=2.17.7
 revision=2
 archs="x86_64"
 build_style=cmake
+configure_args="-DTBB_ROOT=/usr -DEMBREE_IGNORE_CMAKE_CXX_FLAGS=OFF"
 hostmakedepends="ispc"
 makedepends="libfreeglut-devel libXmu-devel tbb-devel MesaLib-devel libpng-devel
  libopenexr-devel libjpeg-turbo-devel libmagick-devel"
@@ -13,10 +14,7 @@ license="Apache-2.0"
 homepage="https://embree.github.io/"
 distfiles="https://github.com/$pkgname/$pkgname/archive/v$version.tar.gz"
 checksum=c0694f287fa1fbb382aba3a895702e248d92f7e89c0e5f64aefee965482ec04c
-
-nopie=y
-
-configure_args="-DTBB_ROOT=/usr -DENABLE_TUTORIALS=OFF"
+patch_args=-Np1
 
 embree-devel_package() {
 	depends="${sourcepkg}>=${version}_${revision}"

From 9bb1bbe9f5bbc7f837dc83583cc4ceec4df18077 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: Wed, 17 Mar 2021 07:35:19 +0700
Subject: [PATCH 05/62] ettercap: remove libressl patch, CMAKE_BUILD_TYPE=None

---
 .../patches/allow-build-type-none.patch       | 24 ++++++++++++++
 srcpkgs/ettercap/patches/libressl.patch       | 31 -------------------
 srcpkgs/ettercap/template                     |  9 ++++--
 3 files changed, 31 insertions(+), 33 deletions(-)
 create mode 100644 srcpkgs/ettercap/patches/allow-build-type-none.patch
 delete mode 100644 srcpkgs/ettercap/patches/libressl.patch

diff --git a/srcpkgs/ettercap/patches/allow-build-type-none.patch b/srcpkgs/ettercap/patches/allow-build-type-none.patch
new file mode 100644
index 000000000000..324d75086b05
--- /dev/null
+++ b/srcpkgs/ettercap/patches/allow-build-type-none.patch
@@ -0,0 +1,24 @@
+Index: ettercap-0.8.3.1/CMakeLists.txt
+===================================================================
+--- ettercap-0.8.3.1.orig/CMakeLists.txt
++++ ettercap-0.8.3.1/CMakeLists.txt
+@@ -22,19 +22,6 @@ option(LIBRARY_BUILD "Build for libetter
+ option(INSTALL_DESKTOP "Install ettercap desktop files" ON)
+ 
+ 
+-set(VALID_BUILD_TYPES Debug Release RelWithDebInfo)
+-
+-if(NOT CMAKE_BUILD_TYPE)
+-  # Default to using "Release" as our build type.
+-  set(CMAKE_BUILD_TYPE "Release" CACHE STRING
+-    "Choose the type of build, options are: ${VALID_BUILD_TYPES}." FORCE)
+-endif()
+-list(FIND VALID_BUILD_TYPES ${CMAKE_BUILD_TYPE} contains_valid)
+-if(contains_valid EQUAL -1)
+-  message(FATAL_ERROR "Unknown CMAKE_BUILD_TYPE: '${CMAKE_BUILD_TYPE}'. Valid options are: ${VALID_BUILD_TYPES}")
+-endif()
+-unset(contains_valid)
+-
+ include(CMakeDependentOption)
+ 
+ # If SYSTEM_LIBS is set to off, then all SYSTEM_* options will be
diff --git a/srcpkgs/ettercap/patches/libressl.patch b/srcpkgs/ettercap/patches/libressl.patch
deleted file mode 100644
index 15e0d3c1c9e7..000000000000
--- a/srcpkgs/ettercap/patches/libressl.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From b2f7634c9dbc0ef68640f0571787d92300e9f9f9 Mon Sep 17 00:00:00 2001
-From: Stefan Strogin <stefan@steils.org>
-Date: Sat, 15 Aug 2020 07:18:31 +0300
-Subject: [PATCH] ec_sslwrap: fix compilation with LibreSSL
-
-Disable taking over SNI extension from ClientHello and SSL configuration
-operations until LibreSSL supports the required API.
-
-Fixes: https://github.com/Ettercap/ettercap/issues/1068
----
- src/ec_sslwrap.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git src/ec_sslwrap.c src/ec_sslwrap.c
-index b9f26a142..1e4c24fc1 100644
---- src/ec_sslwrap.c
-+++ src/ec_sslwrap.c
-@@ -71,11 +71,11 @@
- #define TLS_server_method SSLv23_server_method
- #endif
- 
--#if (OPENSSL_VERSION_NUMBER >= 0x10100000L)
-+#if (OPENSSL_VERSION_NUMBER >= 0x10100000L) && !defined(LIBRESSL_VERSION_NUMBER)
- #define HAVE_OPENSSL_1_1_0
- #endif
- 
--#if (OPENSSL_VERSION_NUMBER >= 0x10101000L)
-+#if (OPENSSL_VERSION_NUMBER >= 0x10101000L) && !defined(LIBRESSL_VERSION_NUMBER)
- #define HAVE_OPENSSL_1_1_1
- #endif
- 
diff --git a/srcpkgs/ettercap/template b/srcpkgs/ettercap/template
index 7fe4c340a079..611b4e9aded7 100644
--- a/srcpkgs/ettercap/template
+++ b/srcpkgs/ettercap/template
@@ -3,8 +3,8 @@ pkgname=ettercap
 version=0.8.3.1
 revision=2
 build_style=cmake
-configure_args="-DENABLE_GTK=OFF"
-hostmakedepends="flex"
+configure_args="-DENABLE_GTK=OFF -DBUNDLED_LIBS=OFF"
+hostmakedepends="flex pkg-config"
 makedepends="geoip-devel ncurses-devel openssl-devel libcurl-devel
  libltdl-devel libnet-devel libpcap-devel pcre-devel"
 conf_files="/etc/${pkgname}/etter.conf"
@@ -15,5 +15,10 @@ homepage="http://ettercap.github.com/ettercap/"
 distfiles="https://github.com/Ettercap/ettercap/archive/v${version}.tar.gz"
 checksum=d0c3ef88dfc284b61d3d5b64d946c1160fd04276b448519c1ae4438a9cdffaf3
 lib32disabled=yes
+patch_args=-Np1
 
 CFLAGS="-fcommon"
+
+post_extract() {
+	rm -rf bundled_deps
+}

From 92bffa64b0bab7210b0e48ead4e0b51de124e3b2 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: Wed, 17 Mar 2021 08:27:10 +0700
Subject: [PATCH 06/62] injeqt: disable coverage

---
 srcpkgs/injeqt/template | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/injeqt/template b/srcpkgs/injeqt/template
index 1e5777fc0f18..78eba09a0249 100644
--- a/srcpkgs/injeqt/template
+++ b/srcpkgs/injeqt/template
@@ -3,7 +3,8 @@ pkgname=injeqt
 version=1.2.0
 revision=2
 build_style=cmake
-hostmakedepends="pkg-config"
+configure_args="-DDISABLE_COVERAGE=ON"
+hostmakedepends="pkg-config qt5-qmake qt5-host-tools"
 makedepends="qt5-devel"
 short_desc="Dependency injection framework for Qt"
 maintainer="Jürgen Buchmüller <pullmoll@t-online.de>"
@@ -12,9 +13,6 @@ homepage="https://github.com/vogel/injeqt/"
 distfiles="https://github.com/vogel/${pkgname}/archive/${version}.tar.gz>${pkgname}-${version}.tar.gz"
 checksum=77540cedb0b26affe993dd18124d796059e34c80a51d9ae6433fdff1860db135
 
-if [ -n "$CROSS_BUILD" ]; then
-	hostmakedepends+=" qt5-host-tools qt5-devel"
-fi
 CXXFLAGS="-fno-lifetime-dse -Wno-error=cast-align"
 
 injeqt-devel_package() {

From 2b7b532cd36bc2eded2bc375bede1c1e68a46425 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: Wed, 17 Mar 2021 22:26:37 +0700
Subject: [PATCH 07/62] kindd: build with CMAKE_BUILD_TYPE=None

---
 srcpkgs/kindd/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/kindd/template b/srcpkgs/kindd/template
index e634b0f69bf6..4416041de58c 100644
--- a/srcpkgs/kindd/template
+++ b/srcpkgs/kindd/template
@@ -15,7 +15,7 @@ distfiles="${homepage}/archive/${version}.tar.gz"
 checksum=e596f1b1577ff3e83a779e6181252ae2f09731f513d17dd6b95cbc2cf204654f
 
 do_install() {
-	vbin release/kindd
+	vbin build/core/kindd
 	vinstall assets/appconf/kindd.svg 644 usr/share/pixmaps
 	vinstall assets/appconf/kindd.desktop 644 usr/share/applications
 }

From cf86cccf5f50b71c77a2afd19a559cc6104052c1 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: Thu, 18 Mar 2021 23:58:53 +0700
Subject: [PATCH 08/62] occt: allow CMAKE_BUILD_TYPE=None

---
 srcpkgs/occt/patches/cmake-build-type-none.patch | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 srcpkgs/occt/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/occt/patches/cmake-build-type-none.patch b/srcpkgs/occt/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..acb06fb55766
--- /dev/null
+++ b/srcpkgs/occt/patches/cmake-build-type-none.patch
@@ -0,0 +1,13 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -4,7 +4,7 @@ set (CMAKE_MODULE_PATH "${CMAKE_SOURCE_D
+ 
+ set (CMAKE_SUPPRESS_REGENERATION TRUE)
+ 
+-set (CMAKE_CONFIGURATION_TYPES Release Debug RelWithDebInfo CACHE INTERNAL "" FORCE)
++set (CMAKE_CONFIGURATION_TYPES None Release Debug RelWithDebInfo CACHE INTERNAL "" FORCE)
+ 
+ # macro: include patched file if it exists
+ macro (OCCT_INCLUDE_CMAKE_FILE BEING_INCLUDED_FILE)

From 171a154a92a9f35b5a665ef83be98ec2d82af395 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: Fri, 19 Mar 2021 23:07:05 +0700
Subject: [PATCH 09/62] renderdoc: devendor zstd, lz4

---
 .../patches/build-type-none-is-release.patch  | 12 ++++
 .../renderdoc/patches/qmake-no-rpath.patch    | 13 ++++
 .../renderdoc/patches/unvendor-zstd-lz4.patch | 68 +++++++++++++++++++
 srcpkgs/renderdoc/template                    | 15 ++--
 4 files changed, 99 insertions(+), 9 deletions(-)
 create mode 100644 srcpkgs/renderdoc/patches/build-type-none-is-release.patch
 create mode 100644 srcpkgs/renderdoc/patches/qmake-no-rpath.patch
 create mode 100644 srcpkgs/renderdoc/patches/unvendor-zstd-lz4.patch

diff --git a/srcpkgs/renderdoc/patches/build-type-none-is-release.patch b/srcpkgs/renderdoc/patches/build-type-none-is-release.patch
new file mode 100644
index 000000000000..f16b944bc12c
--- /dev/null
+++ b/srcpkgs/renderdoc/patches/build-type-none-is-release.patch
@@ -0,0 +1,12 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -315,6 +315,7 @@ set(RELEASE_MODE 0)
+ 
+ if(cmake_build_type_lower STREQUAL "release" OR
+    cmake_build_type_lower STREQUAL "relwithdebinfo" OR
++   cmake_build_type_lower STREQUAL "none" OR
+    cmake_build_type_lower STREQUAL "minsizerel")
+     add_definitions(-D_RELEASE)
+     message(STATUS "Building RenderDoc in Release mode: ${CMAKE_BUILD_TYPE}")
diff --git a/srcpkgs/renderdoc/patches/qmake-no-rpath.patch b/srcpkgs/renderdoc/patches/qmake-no-rpath.patch
new file mode 100644
index 000000000000..6e6325c53555
--- /dev/null
+++ b/srcpkgs/renderdoc/patches/qmake-no-rpath.patch
@@ -0,0 +1,13 @@
+Index: qrenderdoc/CMakeLists.txt
+===================================================================
+--- qrenderdoc/CMakeLists.txt.orig
++++ qrenderdoc/CMakeLists.txt
+@@ -144,7 +144,7 @@ endif()
+ # and finding dependencies from the cmake build
+ file(WRITE
+      ${CMAKE_BINARY_DIR}/qrenderdoc/qrenderdoc_cmake.pri
+-     "CONFIG+=${QMAKE_CONFIG}\n"
++     "CONFIG+=${QMAKE_CONFIG} no_qt_rpath\n"
+      "\n"
+      "QMAKE_CC=${CMAKE_C_COMPILER}\n"
+      "QMAKE_CXX=${CMAKE_CXX_COMPILER}\n"
diff --git a/srcpkgs/renderdoc/patches/unvendor-zstd-lz4.patch b/srcpkgs/renderdoc/patches/unvendor-zstd-lz4.patch
new file mode 100644
index 000000000000..d4003ded9161
--- /dev/null
+++ b/srcpkgs/renderdoc/patches/unvendor-zstd-lz4.patch
@@ -0,0 +1,68 @@
+Index: renderdoc/CMakeLists.txt
+===================================================================
+--- renderdoc/CMakeLists.txt.orig
++++ renderdoc/CMakeLists.txt
+@@ -213,54 +213,10 @@ set(sources
+     3rdparty/pugixml/pugixml.cpp
+     3rdparty/pugixml/pugixml.hpp
+     3rdparty/pugixml/pugiconfig.hpp
+-    3rdparty/lz4/lz4.c
+-    3rdparty/lz4/lz4.h
+     3rdparty/miniz/miniz.c
+     3rdparty/miniz/miniz.h
+     3rdparty/superluminal/superluminal.cpp
+     3rdparty/superluminal/superluminal.h
+-    3rdparty/zstd/bitstream.h
+-    3rdparty/zstd/compiler.h
+-    3rdparty/zstd/cpu.h
+-    3rdparty/zstd/debug.c
+-    3rdparty/zstd/debug.h
+-    3rdparty/zstd/entropy_common.c
+-    3rdparty/zstd/error_private.c
+-    3rdparty/zstd/error_private.h
+-    3rdparty/zstd/fse.h
+-    3rdparty/zstd/fse_compress.c
+-    3rdparty/zstd/fse_decompress.c
+-    3rdparty/zstd/hist.c
+-    3rdparty/zstd/hist.h
+-    3rdparty/zstd/huf.h
+-    3rdparty/zstd/huf_compress.c
+-    3rdparty/zstd/huf_decompress.c
+-    3rdparty/zstd/mem.h
+-    3rdparty/zstd/pool.c
+-    3rdparty/zstd/pool.h
+-    3rdparty/zstd/threading.c
+-    3rdparty/zstd/threading.h
+-    3rdparty/zstd/xxhash.c
+-    3rdparty/zstd/xxhash.h
+-    3rdparty/zstd/zstd.h
+-    3rdparty/zstd/zstd_common.c
+-    3rdparty/zstd/zstd_compress.c
+-    3rdparty/zstd/zstd_compress_internal.h
+-    3rdparty/zstd/zstd_decompress.c
+-    3rdparty/zstd/zstd_double_fast.c
+-    3rdparty/zstd/zstd_double_fast.h
+-    3rdparty/zstd/zstd_errors.h
+-    3rdparty/zstd/zstd_fast.c
+-    3rdparty/zstd/zstd_fast.h
+-    3rdparty/zstd/zstd_internal.h
+-    3rdparty/zstd/zstd_lazy.c
+-    3rdparty/zstd/zstd_lazy.h
+-    3rdparty/zstd/zstd_ldm.c
+-    3rdparty/zstd/zstd_ldm.h
+-    3rdparty/zstd/zstd_opt.c
+-    3rdparty/zstd/zstd_opt.h
+-    3rdparty/zstd/zstdmt_compress.c
+-    3rdparty/zstd/zstdmt_compress.h
+     3rdparty/stb/stb_image.h
+     3rdparty/stb/stb_image_write.h
+     3rdparty/stb/stb_image_resize.h
+@@ -271,6 +227,8 @@ set(sources
+     3rdparty/tinyfiledialogs/tinyfiledialogs.c
+     3rdparty/tinyfiledialogs/tinyfiledialogs.h)
+ 
++list(APPEND RDOC_LIBRARIES -llz4 -lzstd)
++
+ if(ANDROID)
+     list(APPEND sources
+         data/embedded_files.h
diff --git a/srcpkgs/renderdoc/template b/srcpkgs/renderdoc/template
index 7240e9ebc307..4615d45c52c9 100644
--- a/srcpkgs/renderdoc/template
+++ b/srcpkgs/renderdoc/template
@@ -1,13 +1,14 @@
 # Template file for 'renderdoc'
 pkgname=renderdoc
 version=1.12
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DENABLE_GL=ON -DENABLE_GLES=ON -DENABLE_QRENDERDOC=ON
  -DENABLE_RENDERDOCCMD=ON -DENABLE_VULKAN=ON -DENABLE_XCB=ON -DENABLE_XLIB=ON
  -DENABLE_PYRENDERDOC=ON"
-hostmakedepends="bison autoconf automake pkg-config python3"
+hostmakedepends="bison autoconf automake pkg-config python3 swig"
 makedepends="libX11-devel libxcb-devel xcb-util-keysyms-devel qt5-devel
+ libzstd-devel liblz4-devel
  qt5-svg-devel qt5-x11extras-devel pcre-devel python3-devel"
 short_desc="Stand-alone graphics debugging tool for Vulkan and OpenGL"
 maintainer="Urs Schulz <voidpkgs@ursschulz.de>"
@@ -19,19 +20,14 @@ checksum=4dece1b4cb859a76533b28fcd50e17321acfaa81c3435500a006c4a5ba15fddb
 if [ "$XBPS_TARGET_LIBC" = musl ]; then
 	makedepends+=" libexecinfo-devel"
 	LDLIBS="-lexecinfo"
+	broken="uses RTLD_DL_LINKMAP, RTLD_DEEPBIND, _r_debug"
 fi
 
 if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
 	makedepends+=" libatomic-devel"
 fi
 
-case "$XBPS_TARGET_MACHINE" in
-	*-musl) broken="uses RTLD_DL_LINKMAP, RTLD_DEEPBIND, _r_debug" ;;
-esac
-
-if [ "$CROSS_BUILD" ]; then
-	broken="Cross-compilation can't find python3 interpreter"
-fi
+nocross="Cross-compilation can't find python3 interpreter"
 
 post_patch() {
 	[ -z "$XBPS_TARGET_NO_ATOMIC8" ] && return 0
@@ -40,4 +36,5 @@ post_patch() {
 
 post_install() {
 	vlicense LICENSE.md
+	vlicense docs/credits_acknowledgements.rst
 }

From 32b23e957a268ba1fb7e8928f857d307ffa17d22 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: Sat, 20 Mar 2021 00:47:52 +0700
Subject: [PATCH 10/62] python3-occ: build with CMAKE_BUILD_TYPE=None

---
 srcpkgs/python3-occ/template | 1 +
 1 file changed, 1 insertion(+)

diff --git a/srcpkgs/python3-occ/template b/srcpkgs/python3-occ/template
index 705f37457943..3ea0ef5e6387 100644
--- a/srcpkgs/python3-occ/template
+++ b/srcpkgs/python3-occ/template
@@ -5,6 +5,7 @@ revision=1
 archs="i686* x86_64* armv7l* aarch64* ppc*"
 wrksrc="pythonocc-core-${version}"
 build_style=cmake
+configure_args="-DPYTHONOCC_BUILD_TYPE=None -DCMAKE_BUILD_TYPE=None"
 hostmakedepends="python3 swig"
 makedepends="python3-devel occt-devel freetype-devel swig"
 depends="python3 occt freetype"

From 8f22755805af2d5236a09f4e74855f794774c865 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: Fri, 19 Mar 2021 23:38:10 +0700
Subject: [PATCH 11/62] widelands: allow CMAKE_BUILD_TYPE=None

---
 srcpkgs/widelands-data                        |  1 -
 .../patches/cmake-build-type-none.patch       | 63 +++++++++++++++++++
 .../widelands/patches/fix-install-path.patch  | 40 ++++++++++++
 srcpkgs/widelands/template                    | 21 +------
 4 files changed, 105 insertions(+), 20 deletions(-)
 delete mode 120000 srcpkgs/widelands-data
 create mode 100644 srcpkgs/widelands/patches/cmake-build-type-none.patch
 create mode 100644 srcpkgs/widelands/patches/fix-install-path.patch

diff --git a/srcpkgs/widelands-data b/srcpkgs/widelands-data
deleted file mode 120000
index e9fbf89517f2..000000000000
--- a/srcpkgs/widelands-data
+++ /dev/null
@@ -1 +0,0 @@
-widelands
\ No newline at end of file
diff --git a/srcpkgs/widelands/patches/cmake-build-type-none.patch b/srcpkgs/widelands/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..3d210854741b
--- /dev/null
+++ b/srcpkgs/widelands/patches/cmake-build-type-none.patch
@@ -0,0 +1,63 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -202,7 +202,7 @@ elseif(CMAKE_BUILD_TYPE STREQUAL "RelWit
+   set(WL_DEBUG_FLAGS "-DNDEBUG -DNOPARACHUTE")
+   option(OPTION_ASAN "Build with AddressSanitizer" ON)
+ else()
+-  message(FATAL_ERROR "Unknown CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
++  set(WL_DEBUG_FLAGS "-DNDEBUG -DNOPARACHUTE")
+ endif()
+ 
+ wl_add_flag(WL_GENERIC_CXX_FLAGS "-std=c++11")
+@@ -353,7 +353,7 @@ endif (OPTION_BUILD_TESTS)
+ install (
+   FILES ${CMAKE_CURRENT_BINARY_DIR}/VERSION
+   DESTINATION ${WL_INSTALL_BASEDIR}
+-  CONFIGURATIONS Debug;Release
++  CONFIGURATIONS Debug
+   COMPONENT CoreVersionFile
+ )
+ 
+@@ -378,7 +378,6 @@ install(
+     data/txts
+     data/world
+   DESTINATION ${WL_INSTALL_DATADIR}
+-  CONFIGURATIONS Debug;Release
+   COMPONENT CoreDataFiles
+ )
+ 
+@@ -386,7 +385,6 @@ install(
+   DIRECTORY
+     data/maps
+   DESTINATION ${WL_INSTALL_DATADIR}
+-  CONFIGURATIONS Debug;Release
+   COMPONENT MapFiles
+ )
+ 
+@@ -395,7 +393,6 @@ install(
+     data/music
+     data/sound
+   DESTINATION ${WL_INSTALL_DATADIR}
+-  CONFIGURATIONS Debug;Release
+   COMPONENT MusicFiles
+ )
+ 
+@@ -405,7 +402,7 @@ install(
+     CREDITS
+     ChangeLog
+   DESTINATION ${WL_INSTALL_BASEDIR}
+-  CONFIGURATIONS Debug;Release
++  CONFIGURATIONS Debug
+   COMPONENT CoreLicenseFiles
+ )
+ 
+@@ -424,7 +421,6 @@ install(
+   DIRECTORY
+     ${CMAKE_CURRENT_BINARY_DIR}/locale/
+   DESTINATION ${WL_INSTALL_DATADIR}/locale
+-  CONFIGURATIONS Debug;Release
+   COMPONENT CoreLanguageFiles
+ )
+ 
diff --git a/srcpkgs/widelands/patches/fix-install-path.patch b/srcpkgs/widelands/patches/fix-install-path.patch
new file mode 100644
index 000000000000..6bb461389f03
--- /dev/null
+++ b/srcpkgs/widelands/patches/fix-install-path.patch
@@ -0,0 +1,40 @@
+Index: cmake/WlFunctions.cmake
+===================================================================
+--- cmake/WlFunctions.cmake.orig
++++ cmake/WlFunctions.cmake
+@@ -289,5 +289,5 @@ function(wl_binary NAME)
+ 
+   #Quoting the CMake documentation on DESTINATION:
+   #"If a relative path is given it is interpreted relative to the value of CMAKE_INSTALL_PREFIX"
+-  install(TARGETS ${NAME} DESTINATION "." COMPONENT ExecutableFiles)
++  install(TARGETS ${NAME} DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT ExecutableFiles)
+ endfunction()
+Index: xdg/CMakeLists.txt
+===================================================================
+--- xdg/CMakeLists.txt.orig
++++ xdg/CMakeLists.txt
+@@ -6,19 +6,19 @@ set(XDG_APPLICATION_ID "org.widelands.Wi
+ list(APPEND icon_sizes "16" "32" "48" "64" "128")
+ foreach (icon_size ${icon_sizes})
+   #install(FILES ${CMAKE_SOURCE_DIR}/data/images/logos/wl-ico-${icon_size}.png DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/${icon_size}x${icon_size}/apps RENAME ${XDG_APPLICATION_ID}.png)
+-  install(FILES ${CMAKE_SOURCE_DIR}/data/images/logos/wl-ico-${icon_size}.png DESTINATION ../share/icons/hicolor/${icon_size}x${icon_size}/apps RENAME ${XDG_APPLICATION_ID}.png)
++  install(FILES ${CMAKE_SOURCE_DIR}/data/images/logos/wl-ico-${icon_size}.png DESTINATION share/icons/hicolor/${icon_size}x${icon_size}/apps RENAME ${XDG_APPLICATION_ID}.png)
+ endforeach (icon_size ${icon_sizes})
+ #install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${CMAKE_PROJECT_NAME}.6           DESTINATION ${CMAKE_INSTALL_MANDIR}/man6)
+-install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${CMAKE_PROJECT_NAME}.6           DESTINATION ../share/man/man6)
++install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${CMAKE_PROJECT_NAME}.6           DESTINATION share/man/man6)
+ #install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${XDG_APPLICATION_ID}.desktop     DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications)
+-install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${XDG_APPLICATION_ID}.desktop     DESTINATION ../share/applications)
++install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${XDG_APPLICATION_ID}.desktop     DESTINATION share/applications)
+ #install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${XDG_APPLICATION_ID}.appdata.xml DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/metainfo)
+-install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${XDG_APPLICATION_ID}.appdata.xml DESTINATION ../share/metainfo)
++install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${XDG_APPLICATION_ID}.appdata.xml DESTINATION share/metainfo)
+ 
+ find_program(GTK_UPDATE_ICON_CACHE NAMES gtk-update-icon-cache)
+ if (GTK_UPDATE_ICON_CACHE)
+   #install(CODE "execute_process (COMMAND ${GTK_UPDATE_ICON_CACHE} -t -f ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor ||: )")
+-  install(CODE "execute_process (COMMAND ${GTK_UPDATE_ICON_CACHE} -t -f ${CMAKE_INSTALL_PREFIX}/../share/icons/hicolor ||: )")
++  install(CODE "execute_process (COMMAND ${GTK_UPDATE_ICON_CACHE} -t -f ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor ||: )")
+ else (GTK_UPDATE_ICON_CACHE)
+   message(WARNING "gtk-update-icon-cache not found!")
+ endif (GTK_UPDATE_ICON_CACHE)
diff --git a/srcpkgs/widelands/template b/srcpkgs/widelands/template
index 6cee85087ea7..cfa2c10993e0 100644
--- a/srcpkgs/widelands/template
+++ b/srcpkgs/widelands/template
@@ -1,7 +1,7 @@
 # Template file for 'widelands'
 pkgname=widelands
 version=21
-revision=3
+revision=4
 wrksrc="${pkgname}-build${version}"
 build_style=cmake
 configure_args="-DOPENGL_INCLUDE_DIR=${XBPS_CROSS_BASE}/usr/include
@@ -10,13 +10,13 @@ hostmakedepends="python3 pkg-config gettext"
 makedepends="boost-devel icu-devel minizip-devel gettext-devel
  glu-devel glew-devel SDL2-devel SDL2_gfx-devel SDL2_image-devel
  SDL2_net-devel SDL2_mixer-devel SDL2_ttf-devel"
-depends="${pkgname}-data-${version}_${revision}"
 short_desc="Real-time strategy game"
 maintainer="Jürgen Buchmüller <pullmoll@t-online.de>"
 license="GPL-2.0-or-later"
 homepage="http://www.widelands.org/"
 distfiles="https://github.com/widelands/widelands/archive/build${version}.tar.gz>${pkgname}-${version}.tar.gz"
 checksum=601e0e4c6f91b3fb0ece2cd1b83ecfb02344a1b9194fbb70ef3f70e06994e357
+replaces="widelands-data>=0"
 
 CXXFLAGS="-DU_USING_ICU_NAMESPACE=1"
 
@@ -29,22 +29,5 @@ if [ "$CROSS_BUILD" ]; then
 fi
 
 post_install() {
-	# For some reason the binary is installed as /usr/widelands - move it
-	vmkdir usr/bin
-	mv ${DESTDIR}/usr/${pkgname} ${DESTDIR}/usr/bin
-	vmkdir usr/share
-	mv ${DESTDIR}/share/* ${DESTDIR}/usr/share/
-	rmdir ${DESTDIR}/share
-
-	# Remove files not needed in the package
-	rm -f ${DESTDIR}/usr/COPYING ${DESTDIR}/usr/CREDITS ${DESTDIR}/usr/ChangeLog ${DESTDIR}/usr/VERSION
-
 	vinstall ${FILESDIR}/${pkgname}.desktop 644 usr/share/applications
 }
-
-widelands-data_package() {
-	short_desc+=" - data files"
-	pkg_install() {
-		vmove usr/share/widelands
-	}
-}

From ff6a2d313b3b823d3d590e83ed11bcd3f8c386f8 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: Sat, 20 Mar 2021 09:49:25 +0700
Subject: [PATCH 12/62] zziplib: fix SONAME when build with
 -DCMAKE_BUILD_TYPE=None

---
 .../cmake-build-type-none-soname.patch        | 35 +++++++++++++++++++
 srcpkgs/zziplib/template                      |  1 +
 2 files changed, 36 insertions(+)
 create mode 100644 srcpkgs/zziplib/patches/cmake-build-type-none-soname.patch

diff --git a/srcpkgs/zziplib/patches/cmake-build-type-none-soname.patch b/srcpkgs/zziplib/patches/cmake-build-type-none-soname.patch
new file mode 100644
index 000000000000..2d31b5b8a46a
--- /dev/null
+++ b/srcpkgs/zziplib/patches/cmake-build-type-none-soname.patch
@@ -0,0 +1,35 @@
+Index: zziplib-0.13.72/zzip/CMakeLists.txt
+===================================================================
+--- zziplib-0.13.72.orig/zzip/CMakeLists.txt
++++ zziplib-0.13.72/zzip/CMakeLists.txt
+@@ -190,15 +190,18 @@ target_include_directories (libzzipmmapp
+ endif()
+ 
+ set_target_properties(libzzip PROPERTIES OUTPUT_NAME "zzip" RELEASE_POSTFIX "-${RELNUM}")
++set_target_properties(libzzip PROPERTIES OUTPUT_NAME "zzip" NONE_POSTFIX "-${RELNUM}")
+ SET_TARGET_PROPERTIES(libzzip PROPERTIES VERSION ${VERNUM}.${FIXNUM} SOVERSION ${VERNUM})
+ 
+ if(ZZIPFSEEKO)
+ set_target_properties(libzzipfseeko PROPERTIES OUTPUT_NAME "zzipfseeko" RELEASE_POSTFIX "-${RELNUM}")
++set_target_properties(libzzipfseeko PROPERTIES OUTPUT_NAME "zzipfseeko" NONE_POSTFIX "-${RELNUM}")
+ SET_TARGET_PROPERTIES(libzzipfseeko PROPERTIES VERSION ${VERNUM}.${FIXNUM} SOVERSION ${VERNUM})
+ endif()
+ 
+ if(ZZIPMMAPPED)
+ set_target_properties(libzzipmmapped PROPERTIES OUTPUT_NAME "zzipmmapped" RELEASE_POSTFIX "-${RELNUM}")
++set_target_properties(libzzipmmapped PROPERTIES OUTPUT_NAME "zzipmmapped" NONE_POSTFIX "-${RELNUM}")
+ SET_TARGET_PROPERTIES(libzzipmmapped PROPERTIES VERSION ${VERNUM}.${FIXNUM} SOVERSION ${VERNUM})
+ endif()
+ 
+Index: zziplib-0.13.72/zzipwrap/CMakeLists.txt
+===================================================================
+--- zziplib-0.13.72.orig/zzipwrap/CMakeLists.txt
++++ zziplib-0.13.72/zzipwrap/CMakeLists.txt
+@@ -49,6 +49,7 @@ target_link_libraries(libzzipwrap libzzi
+ target_include_directories(libzzipwrap PRIVATE "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}")
+ 
+ set_target_properties(libzzipwrap PROPERTIES OUTPUT_NAME "zzipwrap" RELEASE_POSTFIX "-${RELNUM}")
++set_target_properties(libzzipwrap PROPERTIES OUTPUT_NAME "zzipwrap" NONE_POSTFIX "-${RELNUM}")
+ SET_TARGET_PROPERTIES(libzzipwrap PROPERTIES VERSION ${VERNUM}.${FIXNUM} SOVERSION ${VERNUM})
+ set_target_properties(libzzipwrap PROPERTIES DEFINE_SYMBOL "libzzip_EXPORTS")
+ 
diff --git a/srcpkgs/zziplib/template b/srcpkgs/zziplib/template
index ab5af234af62..2026f3e4a521 100644
--- a/srcpkgs/zziplib/template
+++ b/srcpkgs/zziplib/template
@@ -12,6 +12,7 @@ homepage="https://github.com/gdraheim/zziplib"
 changelog="https://raw.githubusercontent.com/gdraheim/zziplib/master/ChangeLog"
 distfiles="https://github.com/gdraheim/zziplib/archive/v${version}.tar.gz"
 checksum=93ef44bf1f1ea24fc66080426a469df82fa631d13ca3b2e4abaeab89538518dc
+patch_args=-Np1
 
 if [ "$CROSS_BUILD" ]; then
 	configure_args+=" -DZZIPTEST=OFF"

From 683601ccac10d3a34de4da8da7b8b1ff52c640a1 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, 21 Mar 2021 15:28:04 +0700
Subject: [PATCH 13/62] mellowplayer: fix build

---
 srcpkgs/mellowplayer/patches/no-werror.patch | 13 +++++++++++++
 srcpkgs/mellowplayer/template                | 13 +++++++------
 2 files changed, 20 insertions(+), 6 deletions(-)
 create mode 100644 srcpkgs/mellowplayer/patches/no-werror.patch

diff --git a/srcpkgs/mellowplayer/patches/no-werror.patch b/srcpkgs/mellowplayer/patches/no-werror.patch
new file mode 100644
index 000000000000..7e678453a123
--- /dev/null
+++ b/srcpkgs/mellowplayer/patches/no-werror.patch
@@ -0,0 +1,13 @@
+Index: MellowPlayer-3.6.6/src/3rdparty/boost/di.hpp
+===================================================================
+--- MellowPlayer-3.6.6.orig/src/3rdparty/boost/di.hpp
++++ MellowPlayer-3.6.6/src/3rdparty/boost/di.hpp
+@@ -67,7 +67,7 @@ BOOST_DI_CFG_FWD
+ #pragma clang diagnostic error "-Wundefined-internal"
+ #pragma clang diagnostic ignored "-Wmissing-field-initializers"
+ #elif defined(__GCC__)
+-#pragma GCC diagnostic error "-Wdeprecated-declarations"
++#pragma GCC diagnostic warning "-Wdeprecated-declarations"
+ #pragma GCC diagnostic push
+ #if (__GNUC__ < 6)
+ #pragma GCC diagnostic error "-Werror"
diff --git a/srcpkgs/mellowplayer/template b/srcpkgs/mellowplayer/template
index 2f8f13960ca6..cfd8a185556f 100644
--- a/srcpkgs/mellowplayer/template
+++ b/srcpkgs/mellowplayer/template
@@ -4,7 +4,7 @@ version=3.6.6
 revision=1
 wrksrc="MellowPlayer-${version}"
 build_style=cmake
-hostmakedepends="pkg-config qt5-tools qt5-qmake"
+hostmakedepends="pkg-config qt5-tools qt5-qmake qt5-host-tools"
 makedepends="qt5-declarative-devel qt5-quickcontrols2-devel
  qt5-plugin-mysql qt5-plugin-pgsql qt5-plugin-sqlite
  qt5-plugin-tds qt5-plugin-odbc
@@ -17,11 +17,12 @@ license="GPL-2.0-or-later"
 homepage="https://colinduquesnoy.gitlab.io/MellowPlayer/"
 distfiles="https://gitlab.com/ColinDuquesnoy/MellowPlayer/-/archive/${version}/MellowPlayer-${version}.tar.bz2"
 checksum=17b8b25ca6b3d27b223f8be6ad80186ae5bd17ce762eb04ecd8b0e82e687b327
+patch_args=-Np1
 
-if [ "$CROSS_BUILD" ]; then
-	hostmakedepends+=" qt5-host-tools"
+if [ "$XBPS_WORDSIZE" != "$XBPS_TARGET_WORDSIZE" ]; then
+	broken="webengine can be built only if word size matches"
 fi
 
-case "$XBPS_TARGET_MACHINE" in
-	arm*) broken="qt5-webengine not available" ;;
-esac
+if [ "$XBPS_TARGET_ENDIAN" != "le" ]; then
+	broken="webengine only supports little endian"
+fi

From 60020334799d647c47b7e3522988ef2153771c61 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, 21 Mar 2021 15:43:09 +0700
Subject: [PATCH 14/62] ispc: fix CMAKE_BUILD_TYPE=None

---
 .../ispc/patches/cmake-build-type-none.patch   | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
 create mode 100644 srcpkgs/ispc/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/ispc/patches/cmake-build-type-none.patch b/srcpkgs/ispc/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..411e353c7314
--- /dev/null
+++ b/srcpkgs/ispc/patches/cmake-build-type-none.patch
@@ -0,0 +1,18 @@
+Index: ispc-1.15.0/CMakeLists.txt
+===================================================================
+--- ispc-1.15.0.orig/CMakeLists.txt
++++ ispc-1.15.0/CMakeLists.txt
+@@ -157,13 +157,6 @@ set(OUTPUT_RELEASE Release/bin)
+ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin )
+ 
+ if(CMAKE_BUILD_TYPE)
+-    # Validate build type
+-    set(CONFIGURATION_TYPES "Debug;Release;RelWithDebInfo")
+-
+-    string(FIND "${CONFIGURATION_TYPES}" "${CMAKE_BUILD_TYPE}" MATCHED_CONFIG)
+-    if (${MATCHED_CONFIG} EQUAL -1)
+-         message(FATAL_ERROR "CMAKE_BUILD_TYPE (${CMAKE_BUILD_TYPE}) allows only the following values: ${CONFIGURATION_TYPES}")
+-    endif()
+ else(NOT CMAKE_BUILD_TYPE)
+     set(CMAKE_BUILD_TYPE "Release")
+     message(STATUS "Build type not specified: Use Release by default.")

From 2dc448572543022d1b9a9d1b7c94223afc236100 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, 21 Mar 2021 15:56:50 +0700
Subject: [PATCH 15/62] darktable: fix CMAKE_BUILD_TYPE=None

---
 .../darktable/patches/cmake-build-type-none.patch  | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
 create mode 100644 srcpkgs/darktable/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/darktable/patches/cmake-build-type-none.patch b/srcpkgs/darktable/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..7101f9c1a0e7
--- /dev/null
+++ b/srcpkgs/darktable/patches/cmake-build-type-none.patch
@@ -0,0 +1,14 @@
+Index: src/external/rawspeed/cmake/build-type.cmake
+===================================================================
+--- src/external/rawspeed/cmake/build-type.cmake.orig
++++ src/external/rawspeed/cmake/build-type.cmake
+@@ -27,9 +27,6 @@ string(TOUPPER "${RAWSPEED_SPECIAL_BUILD
+ 
+ # is this one of the known build types?
+ list (FIND CMAKE_CONFIGURATION_TYPES_UPPERCASE ${CMAKE_BUILD_TYPE_UPPERCASE} BUILD_TYPE_IS_KNOWN)
+-if (${BUILD_TYPE_IS_KNOWN} EQUAL -1)
+- message(SEND_ERROR "Unknown build type: ${CMAKE_BUILD_TYPE_UPPERCASE}. Please specify one of: ${CMAKE_CONFIGURATION_TYPES}")
+-endif()
+ 
+ # is this a special build?
+ list (FIND RAWSPEED_SPECIAL_BUILD_TYPES_UPPERCASE ${CMAKE_BUILD_TYPE_UPPERCASE} IS_SPECIAL_BUILD)

From 89f0037e1b4268045438e5592950680555172349 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, 21 Mar 2021 15:33:29 +0700
Subject: [PATCH 16/62] hedgewars: merge -data back

---
 srcpkgs/hedgewars-data                        |  1 -
 .../patches/cmake-build-type-none.patch       | 30 +++++++++++++++++++
 srcpkgs/hedgewars/template                    | 23 +++++---------
 3 files changed, 38 insertions(+), 16 deletions(-)
 delete mode 120000 srcpkgs/hedgewars-data
 create mode 100644 srcpkgs/hedgewars/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/hedgewars-data b/srcpkgs/hedgewars-data
deleted file mode 120000
index b57dc45ebadc..000000000000
--- a/srcpkgs/hedgewars-data
+++ /dev/null
@@ -1 +0,0 @@
-hedgewars
\ No newline at end of file
diff --git a/srcpkgs/hedgewars/patches/cmake-build-type-none.patch b/srcpkgs/hedgewars/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..b4e0c186717c
--- /dev/null
+++ b/srcpkgs/hedgewars/patches/cmake-build-type-none.patch
@@ -0,0 +1,30 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -54,7 +54,7 @@ option(NOVERSIONINFOUPDATE "Disable upda
+ 
+ 
+ if(BUILD_ENGINE_C AND NOT NOVIDEOREC)
+-    if((CMAKE_BUILD_TYPE STREQUAL "Release") OR (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo"))
++    if((CMAKE_BUILD_TYPE STREQUAL "Release") OR (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo") OR (CMAKE_BUILD_TYPE STREQUAL "None"))
+         message("NOTE: Video recorder support disabled. It's incompatible with BUILD_ENGINE_C")
+         set(BUILD_ENGINE_C ON CACHE STRING "Required for BUILD_ENGINE_JS" FORCE)
+     else()
+@@ -93,7 +93,7 @@ set(CPACK_PACKAGE_VERSION_MAJOR 1)
+ set(CPACK_PACKAGE_VERSION_MINOR 0)
+ set(CPACK_PACKAGE_VERSION_PATCH 0)
+ set(HEDGEWARS_PROTO_VER 59)
+-if((CMAKE_BUILD_TYPE STREQUAL "Release") OR (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo"))
++if((CMAKE_BUILD_TYPE STREQUAL "Release") OR (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo") OR (CMAKE_BUILD_TYPE STREQUAL "None"))
+     set(HEDGEWARS_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
+ else()
+     set(HEDGEWARS_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}-dev")
+@@ -114,6 +114,7 @@ include(${CMAKE_MODULE_PATH}/platform.cm
+ if(CMAKE_BUILD_TYPE)
+     if(NOT((CMAKE_BUILD_TYPE STREQUAL "Release") OR
+            (CMAKE_BUILD_TYPE STREQUAL "Debug") OR
++	   (CMAKE_BUILD_TYPE STREQUAL "None") OR
+            (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")))
+         set(CMAKE_BUILD_TYPE ${default_build_type} CACHE STRING "Build type (Debug/Release/RelWithDebInfo)" FORCE)
+         message(STATUS "Unknown build type ${CMAKE_BUILD_TYPE}, using default (${default_build_type})")
diff --git a/srcpkgs/hedgewars/template b/srcpkgs/hedgewars/template
index d2294cf572f5..f413a965ff2e 100644
--- a/srcpkgs/hedgewars/template
+++ b/srcpkgs/hedgewars/template
@@ -1,15 +1,15 @@
 # Template file for 'hedgewars'
 pkgname=hedgewars
 version=1.0.0
-revision=2
+revision=3
 wrksrc="${pkgname}-src-${version}"
 build_style=cmake
 configure_args="-DNOSERVER=1 -DDATA_INSTALL_DIR=/usr/share/${pkgname}
- -DPHYSFS_SYSTEM=1 -DCMAKE_VERBOSE_MAKEFILE=1 -DMINIMAL_FLAGS=1"
-hostmakedepends="lua51 pkg-config"
+ -DPHYSFS_SYSTEM=1 -DMINIMAL_FLAGS=1"
+hostmakedepends="lua51 pkg-config qt5-qmake qt5-host-tools"
 makedepends="ffmpeg-devel lua51-devel physfs-devel qt5-tools-devel SDL2_image-devel
  SDL2_mixer-devel SDL2_net-devel SDL2_ttf-devel"
-depends="hedgewars-data>=${version}_${revision} libfreeglut"
+depends="libfreeglut"
 short_desc="Funny turn-based artillery game, featuring fighting Hedgehogs!"
 maintainer="Jakub Skrzypnik <jot.skrzyp@gmail.com>"
 license="GPL-2.0-only"
@@ -18,10 +18,9 @@ distfiles="https://hedgewars.org/download/releases/hedgewars-src-${version}.tar.
 checksum=211634e61f2e4beecc3c98c6f749601fcd08321fda1ba969b3b3832a004f155b
 nopie_files="/usr/bin/hwengine"
 nocross="Needs investigation: fails to link hwengine"
-
-if [ -n "$CROSS_BUILD" ]; then
-	hostmakedepends+=" qt5-devel"
-fi
+replaces="hedgewars-data>=0"
+export CMAKE_GENERATOR="Unix Makefiles"
+make_cmd=make
 
 case $XBPS_TARGET_MACHINE in
 	x86_64*)
@@ -38,6 +37,7 @@ esac
 
 if [ -n "$_use_c_engine" ]; then
 	hostmakedepends+=" glew-devel libatomic-devel ghc clang"
+	makedepends+=" glew-devel libatomic-devel"
 	configure_args+=" -DBUILD_ENGINE_C=1"
 	nopie_files+=" /usr/bin/hedgewars"
 fi
@@ -56,10 +56,3 @@ pre_configure() {
 post_install() {
 	vinstall ${DESTDIR}/usr/share/hedgewars/Data/misc/hedgewars.desktop 644 usr/share/applications
 }
-
-hedgewars-data_package() {
-	short_desc+=" - data files"
-	pkg_install() {
-		vmove usr/share/hedgewars/Data
-	}
-}

From b44bb61ac2fd15650be2baaf146b7f612e45e9ad 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, 21 Mar 2021 16:41:58 +0700
Subject: [PATCH 17/62] mariadb: fix for CMAKE_BUILD_TYPE=None

---
 srcpkgs/mariadb/template | 32 ++++++++++++++------------------
 1 file changed, 14 insertions(+), 18 deletions(-)

diff --git a/srcpkgs/mariadb/template b/srcpkgs/mariadb/template
index 437ff757b383..78d5e2dbdbe8 100644
--- a/srcpkgs/mariadb/template
+++ b/srcpkgs/mariadb/template
@@ -34,35 +34,31 @@ replaces="mysql>=0"
 conf_files="/etc/mysql/my.cnf"
 system_accounts="mysql"
 mysql_homedir="/var/lib/mysql"
-CFLAGS="-w -fcommon"
+CFLAGS="-w -fcommon -DDBUG_OFF=1"
+CXXFLAGS="-DDBUG_OFF=1"
 
 pre_configure() {
 	# We need some host binaries before starting cross compilation.
 	if [ "$CROSS_BUILD" ]; then
+		mkdir -p build.native
 		# XXX still broken: jemalloc configure execs host bins.
-		CC= CXX= CPP= LD= AR= AS= RANLIB= CFLAGS= CXXFLAGS= LDFLAGS= cmake .
-		make comp_err comp_sql gen_lex_hash gen_lex_token
-		mkdir bin.host
-		cp extra/comp_err bin.host
-		cp scripts/comp_sql bin.host
-		cp sql/gen_lex_hash bin.host
-		cp sql/gen_lex_token bin.host
-		make clean
-		rm CMakeCache.txt
+		CC= CXX= CPP= LD= AR= AS= RANLIB= CFLAGS= CXXFLAGS= LDFLAGS= \
+			cmake -S . -B build.native
+		make -C build.native comp_err comp_sql gen_lex_hash gen_lex_token
 	fi
 }
 
 pre_build() {
 	if [ "$CROSS_BUILD" ]; then
 		# CMake complains if those binaries ain't in build
-		cp bin.host/comp_err ${wrksrc}/extra
-		cp bin.host/comp_err ${wrksrc}/build/extra
-		cp bin.host/comp_sql ${wrksrc}/scripts
-		cp bin.host/comp_sql ${wrksrc}/build/scripts
-		cp bin.host/gen_lex_hash ${wrksrc}/sql
-		cp bin.host/gen_lex_hash ${wrksrc}/build/sql
-		cp bin.host/gen_lex_token ${wrksrc}/sql
-		cp bin.host/gen_lex_token ${wrksrc}/build/sql
+		cp build.native/extra/comp_err ${wrksrc}/extra
+		cp build.native/extra/comp_err ${wrksrc}/build/extra
+		cp build.native/scripts/comp_sql ${wrksrc}/scripts
+		cp build.native/scripts/comp_sql ${wrksrc}/build/scripts
+		cp build.native/sql/gen_lex_hash ${wrksrc}/sql
+		cp build.native/sql/gen_lex_hash ${wrksrc}/build/sql
+		cp build.native/sql/gen_lex_token ${wrksrc}/sql
+		cp build.native/sql/gen_lex_token ${wrksrc}/build/sql
 		export PATH=${PATH}:${wrksrc}/extra:${wrksrc}/scripts:${wrksrc}/sql
 	fi
 	export LD_LIBRARY_PATH=${wrksrc}/build/storage/tokudb/ft-index/portability

From 5735a86cf720c0cb8dbd1c3957ed8b72b7d2c50e 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: Thu, 25 Mar 2021 07:58:28 +0700
Subject: [PATCH 18/62] EternalTerminal: remove -ggdb3

---
 .../EternalTerminal/patches/fix-cflags.patch    | 17 +++++++++++++++++
 srcpkgs/EternalTerminal/template                |  1 +
 2 files changed, 18 insertions(+)
 create mode 100644 srcpkgs/EternalTerminal/patches/fix-cflags.patch

diff --git a/srcpkgs/EternalTerminal/patches/fix-cflags.patch b/srcpkgs/EternalTerminal/patches/fix-cflags.patch
new file mode 100644
index 000000000000..e6fcd432f7e7
--- /dev/null
+++ b/srcpkgs/EternalTerminal/patches/fix-cflags.patch
@@ -0,0 +1,17 @@
+Index: EternalTerminal-et-v6.0.13/CMakeLists.txt
+===================================================================
+--- EternalTerminal-et-v6.0.13.orig/CMakeLists.txt
++++ EternalTerminal-et-v6.0.13/CMakeLists.txt
+@@ -26,12 +26,6 @@ if(DISABLE_CRASH_LOG)
+ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DELPP_DISABLE_DEFAULT_CRASH_HANDLING")
+ ENDIF(DISABLE_CRASH_LOG)
+ 
+-if(UNIX)
+-  # Enable debug info
+-  SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -ggdb3")
+-  SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -ggdb3")
+-endif()
+-
+ # Enable C++-11
+ set(CMAKE_CXX_STANDARD 11)
+ set(CMAKE_CXX_STANDARD_REQUIRED ON)
diff --git a/srcpkgs/EternalTerminal/template b/srcpkgs/EternalTerminal/template
index 7bac78d2ffd4..bc92e47743dd 100644
--- a/srcpkgs/EternalTerminal/template
+++ b/srcpkgs/EternalTerminal/template
@@ -13,6 +13,7 @@ homepage="https://eternalterminal.dev/"
 distfiles="https://github.com/MisterTea/EternalTerminal/archive/et-v${version}.tar.gz"
 checksum=728c3a444d666897c710e33fe473d8d289263a59574451b13aa53ec3c6ac88b3
 system_accounts="_eternal"
+patch_args=-Np1
 
 LDFLAGS="-lgflags"
 

From 75da83090a1fe2b92155b681800814596184a562 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: Thu, 25 Mar 2021 08:20:29 +0700
Subject: [PATCH 19/62] OTPClient: respect CFLAGS

---
 srcpkgs/OTPClient/patches/fix-cflags.patch | 17 +++++++++++++++++
 srcpkgs/OTPClient/template                 |  1 +
 2 files changed, 18 insertions(+)
 create mode 100644 srcpkgs/OTPClient/patches/fix-cflags.patch

diff --git a/srcpkgs/OTPClient/patches/fix-cflags.patch b/srcpkgs/OTPClient/patches/fix-cflags.patch
new file mode 100644
index 000000000000..ae70f441538f
--- /dev/null
+++ b/srcpkgs/OTPClient/patches/fix-cflags.patch
@@ -0,0 +1,17 @@
+Index: OTPClient-2.4.2/CMakeLists.txt
+===================================================================
+--- OTPClient-2.4.2.orig/CMakeLists.txt
++++ OTPClient-2.4.2/CMakeLists.txt
+@@ -11,11 +11,10 @@ option(BUILD_GUI "Build the GUI" ON)
+ option(BUILD_CLI "Build the CLI" ON)
+ 
+ set(CMAKE_C_STANDARD 11)
+-set(CMAKE_C_FLAGS "-Wall -Wextra -O3 -Wformat=2 -Wmissing-format-attribute -fstack-protector-strong -Wundef -Wmissing-format-attribute")
++set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wformat=2 -Wmissing-format-attribute -fstack-protector-strong -Wundef -Wmissing-format-attribute")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fdiagnostics-color=always -Wstrict-prototypes -Wunreachable-code")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wchar-subscripts -Wwrite-strings -Wpointer-arith -Wbad-function-cast -Wcast-align")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror=format-security -Werror=implicit-function-declaration -Wno-sign-compare")
+-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3")
+ if(CMAKE_COMPILER_IS_GNUCC)
+     set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pie -fPIE")
+ endif()
diff --git a/srcpkgs/OTPClient/template b/srcpkgs/OTPClient/template
index e8c0099850b7..f5af76e655a6 100644
--- a/srcpkgs/OTPClient/template
+++ b/srcpkgs/OTPClient/template
@@ -12,3 +12,4 @@ license="GPL-3.0-or-later"
 homepage="https://github.com/paolostivanin/OTPClient"
 distfiles="https://github.com/paolostivanin/OTPClient/archive/v${version}.tar.gz"
 checksum=74bc4312aa1cd336ca983434e3bed951c5ead327091e7708e3beb08508813495
+patch_args=-Np1

From 8a573dad4563832a5be63882e85ccfc5e21fa3a7 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: Thu, 25 Mar 2021 08:30:31 +0700
Subject: [PATCH 20/62] crex: hardening

---
 srcpkgs/crex/patches/fix-cflags.patch | 20 ++++++++++++++++++++
 srcpkgs/crex/template                 |  7 ++-----
 2 files changed, 22 insertions(+), 5 deletions(-)
 create mode 100644 srcpkgs/crex/patches/fix-cflags.patch

diff --git a/srcpkgs/crex/patches/fix-cflags.patch b/srcpkgs/crex/patches/fix-cflags.patch
new file mode 100644
index 000000000000..d191fb1e9ec0
--- /dev/null
+++ b/srcpkgs/crex/patches/fix-cflags.patch
@@ -0,0 +1,20 @@
+Index: crex-0.2.5/CMakeLists.txt
+===================================================================
+--- crex-0.2.5.orig/CMakeLists.txt
++++ crex-0.2.5/CMakeLists.txt
+@@ -13,9 +13,6 @@ endif(CCACHE_FOUND)
+ set (CMAKE_CXX_STANDARD 14)
+ set (CMAKE_CXX_STANDARD_REQUIRED ON)
+ 
+-set (CMAKE_CXX_FLAGS "-fdiagnostics-color=auto")
+-set (CMAKE_C_FLAGS "-fdiagnostics-color=auto")
+-
+ set (DEBUG_FLAGS "-Wpedantic -Wall -Wextra -Wcast-align -Wcast-qual -Wctor-dtor-privacy -Wdisabled-optimization -Wformat=2 -Winit-self -Wlogical-op -Wmissing-declarations -Wmissing-include-dirs -Wnoexcept -Wold-style-cast -Woverloaded-virtual -Wredundant-decls -Wshadow -Wsign-conversion -Wsign-promo -Wstrict-null-sentinel -Wstrict-overflow=5 -Wswitch-default -Wundef -Wno-unused -std=c++14 -g")
+ set (DEBUG_LINK_FLAGS "-fprofile-arcs -ftest-coverage -flto")
+ 
+@@ -56,4 +53,4 @@ target_link_libraries (
+   ${TARGET}
+ )
+ 
+-install (TARGETS ${TARGET} DESTINATION "/usr/local/bin")
++install (TARGETS ${TARGET} DESTINATION "/usr/bin")
diff --git a/srcpkgs/crex/template b/srcpkgs/crex/template
index a54697a93adc..2f455a0b0c72 100644
--- a/srcpkgs/crex/template
+++ b/srcpkgs/crex/template
@@ -1,7 +1,7 @@
 # Template file for 'crex'
 pkgname=crex
 version=0.2.5
-revision=1
+revision=2
 build_style=cmake
 short_desc="Explore, test, and check regular expressions in the terminal"
 maintainer="Piotr Wójcik <chocimier@tlen.pl>"
@@ -9,10 +9,7 @@ license="MIT"
 homepage="https://github.com/octobanana/crex"
 distfiles="https://github.com/octobanana/crex/archive/${version}.tar.gz"
 checksum=c6a166b7a1e696a7babeaf7c5728eece1624704a18357f827129fc95ef2ecc56
-
-pre_configure() {
-	sed -e 's|/local/|/|' -i CMakeLists.txt
-}
+patch_args=-Np1
 
 post_install() {
 	vlicense LICENSE

From ecda668710cf851e4718245351e8563769be8990 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: Thu, 25 Mar 2021 08:34:32 +0700
Subject: [PATCH 21/62] libbaseencode: hardening

---
 srcpkgs/libbaseencode/patches/fix-cflags.patch | 13 +++++++++++++
 srcpkgs/libbaseencode/template                 |  3 ++-
 2 files changed, 15 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/libbaseencode/patches/fix-cflags.patch

diff --git a/srcpkgs/libbaseencode/patches/fix-cflags.patch b/srcpkgs/libbaseencode/patches/fix-cflags.patch
new file mode 100644
index 000000000000..1bb86a0b15a4
--- /dev/null
+++ b/srcpkgs/libbaseencode/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: libbaseencode-1.0.9/CMakeLists.txt
+===================================================================
+--- libbaseencode-1.0.9.orig/CMakeLists.txt
++++ libbaseencode-1.0.9/CMakeLists.txt
+@@ -15,7 +15,7 @@ set(CMAKE_C_STANDARD 11)
+ set(BASEENCODE_HEADERS src/baseencode.h)
+ set(SOURCE_FILES src/base32.c src/base64.c)
+ 
+-set(CMAKE_C_FLAGS "-Wall -Werror -fPIC")
++set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Werror -fPIC")
+ 
+ add_library(${PROJECT_NAME} SHARED ${SOURCE_FILES})
+ 
diff --git a/srcpkgs/libbaseencode/template b/srcpkgs/libbaseencode/template
index 384a189224df..d5929ad7bb51 100644
--- a/srcpkgs/libbaseencode/template
+++ b/srcpkgs/libbaseencode/template
@@ -1,7 +1,7 @@
 # Template file for 'libbaseencode'
 pkgname=libbaseencode
 version=1.0.9
-revision=1
+revision=2
 build_style=cmake
 short_desc="Library for encoding decoding data use base32 or base64"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -9,6 +9,7 @@ license="Apache-2.0"
 homepage="https://github.com/paolostivanin/libbaseencode"
 distfiles="https://github.com/paolostivanin/libbaseencode/archive/v${version}.tar.gz"
 checksum=a183d7cf30d931b2a078d6f0ef64616b71ab26f9258e5f4e191778c7ace7175d
+patch_args=-Np1
 
 libbaseencode-devel_package() {
 	depends="libbaseencode-${version}_${revision}"

From 4982c8c6db267deb5d700ca8f87f56b274759c1a 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: Fri, 26 Mar 2021 08:46:56 +0700
Subject: [PATCH 22/62] bibletime: clean build flags

---
 srcpkgs/bibletime/patches/fix-cflags.patch | 13 +++++++++++++
 srcpkgs/bibletime/template                 |  1 +
 2 files changed, 14 insertions(+)
 create mode 100644 srcpkgs/bibletime/patches/fix-cflags.patch

diff --git a/srcpkgs/bibletime/patches/fix-cflags.patch b/srcpkgs/bibletime/patches/fix-cflags.patch
new file mode 100644
index 000000000000..480c5ca4ac1e
--- /dev/null
+++ b/srcpkgs/bibletime/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: bibletime-3.0/cmake/BTApplication.cmake
+===================================================================
+--- bibletime-3.0.orig/cmake/BTApplication.cmake
++++ bibletime-3.0/cmake/BTApplication.cmake
+@@ -41,7 +41,7 @@ IF(WIN32)
+     ADD_COMPILE_OPTIONS("/Zi")
+ ELSE()
+     ADD_COMPILE_OPTIONS(
+-        "-ggdb" "-Wall" "-Wextra"
++        "-Wall" "-Wextra" "-DNDEBUG" "-DQT_NO_DEBUG"
+         "$<$<STREQUAL:$<CONFIGURATION>,Release>:-O2>"
+         "$<$<STREQUAL:$<CONFIGURATION>,Release>:-DNDEBUG>"
+         "$<$<STREQUAL:$<CONFIGURATION>,Release>:-DQT_NO_DEBUG>"
diff --git a/srcpkgs/bibletime/template b/srcpkgs/bibletime/template
index 224881c45516..85bcc7f22f87 100644
--- a/srcpkgs/bibletime/template
+++ b/srcpkgs/bibletime/template
@@ -18,6 +18,7 @@ license="GPL-2.0-or-later"
 homepage="http://bibletime.info"
 distfiles="https://github.com/bibletime/bibletime/releases/download/v${version}/bibletime-${version}.tar.xz"
 checksum=d6beef62ad44b255e3dc4c5e89214bf01a0e85c9136073b0be12fca3d2b22622
+patch_args=-Np1
 
 pre_build() {
 	. /etc/profile.d/10_openjdk11.sh

From 1213f8e1f990cd0f68137ef10473c41a5eaee9db 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: Fri, 26 Mar 2021 08:54:25 +0700
Subject: [PATCH 23/62] boomerang: clean build flags

---
 srcpkgs/boomerang/patches/fix-cflags.patch | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
 create mode 100644 srcpkgs/boomerang/patches/fix-cflags.patch

diff --git a/srcpkgs/boomerang/patches/fix-cflags.patch b/srcpkgs/boomerang/patches/fix-cflags.patch
new file mode 100644
index 000000000000..eb59766c1c5b
--- /dev/null
+++ b/srcpkgs/boomerang/patches/fix-cflags.patch
@@ -0,0 +1,21 @@
+Index: cmake-scripts/boomerang-flags.cmake
+===================================================================
+--- cmake-scripts/boomerang-flags.cmake
++++ cmake-scripts/boomerang-flags.cmake
+@@ -104,16 +104,6 @@ endif ()
+ 
+ 
+ if (NOT MSVC)
+-    if ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
+-        BOOMERANG_ADD_COMPILE_FLAGS(-O0)
+-    elseif ("${CMAKE_BUILD_TYPE}" STREQUAL "RelWithDebInfo")
+-        # No special flags
+-    elseif ("${CMAKE_BUILD_TYPE}" STREQUAL "MinSizeRel")
+-        BOOMERANG_ADD_COMPILE_FLAGS(-Os)
+-    else () # Release
+-        BOOMERANG_ADD_COMPILE_FLAGS(-O3)
+-    endif ()
+-
+     if (BOOMERANG_ENABLE_COVERAGE)
+         set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fprofile-arcs -ftest-coverage")
+         set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage")

From fae83a69ca5e9b05bd7fdeb034f0e8920baa8fbc 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: Fri, 26 Mar 2021 08:58:11 +0700
Subject: [PATCH 24/62] catimg: don't change our build-type

---
 srcpkgs/catimg/patches/fix-cflags.patch | 12 ++++++++++++
 srcpkgs/catimg/template                 |  2 +-
 2 files changed, 13 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/catimg/patches/fix-cflags.patch

diff --git a/srcpkgs/catimg/patches/fix-cflags.patch b/srcpkgs/catimg/patches/fix-cflags.patch
new file mode 100644
index 000000000000..9b9f1074ef20
--- /dev/null
+++ b/srcpkgs/catimg/patches/fix-cflags.patch
@@ -0,0 +1,12 @@
+Index: catimg-2.7.0/CMakeLists.txt
+===================================================================
+--- catimg-2.7.0.orig/CMakeLists.txt
++++ catimg-2.7.0/CMakeLists.txt
+@@ -11,7 +11,6 @@ endif()
+ #set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wall -Wextra -g -std=c99 -Wno-unused-result")
+ #set(CMAKE_BUILD_TYPE Debug)
+ set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -Wall -Wextra -Os -std=c99 -Wno-unused-result")
+-set(CMAKE_BUILD_TYPE Release)
+ 
+ set(SRC ${PROJECT_SOURCE_DIR}/src)
+ 
diff --git a/srcpkgs/catimg/template b/srcpkgs/catimg/template
index 374351c45379..6fbc5f1d9140 100644
--- a/srcpkgs/catimg/template
+++ b/srcpkgs/catimg/template
@@ -9,7 +9,7 @@ license="MIT"
 homepage="https://github.com/posva/catimg"
 distfiles="https://github.com/posva/catimg/archive/${version}.tar.gz"
 checksum=3a6450316ff62fb07c3facb47ea208bf98f62abd02783e88c56f2a6508035139
-
+patch_args=-Np1
 CFLAGS="-fcommon"
 
 post_install() {

From 01de770c05704a74ffb1587ab0a546a4126a7e71 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: Fri, 26 Mar 2021 09:09:37 +0700
Subject: [PATCH 25/62] libcotp: fix build flags

---
 srcpkgs/libcotp/patches/fix-cflags.patch | 14 ++++++++++++++
 srcpkgs/libcotp/template                 |  1 +
 2 files changed, 15 insertions(+)
 create mode 100644 srcpkgs/libcotp/patches/fix-cflags.patch

diff --git a/srcpkgs/libcotp/patches/fix-cflags.patch b/srcpkgs/libcotp/patches/fix-cflags.patch
new file mode 100644
index 000000000000..397b3960e9f4
--- /dev/null
+++ b/srcpkgs/libcotp/patches/fix-cflags.patch
@@ -0,0 +1,14 @@
+Index: libcotp-1.2.2/CMakeLists.txt
+===================================================================
+--- libcotp-1.2.2.orig/CMakeLists.txt
++++ libcotp-1.2.2/CMakeLists.txt
+@@ -25,8 +25,7 @@ set(CMAKE_C_STANDARD 11)
+ set(COTP_HEADERS src/cotp.h)
+ set(SOURCE_FILES src/otp.c)
+ 
+-set(CMAKE_C_FLAGS "-Wall -Wextra -O3 -Wno-format-truncation -fstack-protector-strong -fPIC")
+-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3")
++set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wno-format-truncation -fstack-protector-strong -fPIC")
+ 
+ add_library(cotp SHARED ${SOURCE_FILES})
+ 
diff --git a/srcpkgs/libcotp/template b/srcpkgs/libcotp/template
index 9e147ff7deb6..88337290d1e8 100644
--- a/srcpkgs/libcotp/template
+++ b/srcpkgs/libcotp/template
@@ -11,6 +11,7 @@ license="Apache-2.0"
 homepage="https://github.com/paolostivanin/libcotp"
 distfiles="https://github.com/paolostivanin/libcotp/archive/v${version}.tar.gz"
 checksum=25b45ffa4aece5cc689503ebea7356a2f760c194f0c41805934495d2fe7165b1
+patch_args=-Np1
 
 libcotp-devel_package() {
 	depends="libcotp-${version}_${revision}"

From 41dc8700b9f6ba5e745a6b43b129cd0354327972 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: Fri, 26 Mar 2021 21:06:07 +0700
Subject: [PATCH 26/62] loudgain: hardening

---
 srcpkgs/loudgain/patches/fix-cflags.patch | 20 ++++++++++++++++++++
 srcpkgs/loudgain/template                 |  3 ++-
 2 files changed, 22 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/loudgain/patches/fix-cflags.patch

diff --git a/srcpkgs/loudgain/patches/fix-cflags.patch b/srcpkgs/loudgain/patches/fix-cflags.patch
new file mode 100644
index 000000000000..25b2c969bef4
--- /dev/null
+++ b/srcpkgs/loudgain/patches/fix-cflags.patch
@@ -0,0 +1,20 @@
+Index: loudgain-0.6.8/CMakeLists.txt
+===================================================================
+--- loudgain-0.6.8.orig/CMakeLists.txt
++++ loudgain-0.6.8/CMakeLists.txt
+@@ -69,12 +69,12 @@ TARGET_LINK_LIBRARIES(loudgain
+ )
+ 
+ SET_TARGET_PROPERTIES(loudgain PROPERTIES
+-  COMPILE_FLAGS "-Wall -pedantic -g"
++  COMPILE_FLAGS "-Wall -pedantic"
+ )
+ 
+-SET(CMAKE_C_FLAGS "-std=gnu99 -D_GNU_SOURCE")
++SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99 -D_GNU_SOURCE")
+ 
+-SET(CMAKE_CXX_FLAGS "-std=gnu++11 -D_GNU_SOURCE")
++SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11 -D_GNU_SOURCE")
+ 
+ INSTALL(TARGETS loudgain DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
+ 
diff --git a/srcpkgs/loudgain/template b/srcpkgs/loudgain/template
index f29167883439..00b2d20d27d6 100644
--- a/srcpkgs/loudgain/template
+++ b/srcpkgs/loudgain/template
@@ -1,7 +1,7 @@
 # Template file for 'loudgain'
 pkgname=loudgain
 version=0.6.8
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="pkg-config"
 makedepends="libebur128-devel taglib-devel ffmpeg-devel"
@@ -11,6 +11,7 @@ license="BSD-2-Clause"
 homepage="https://github.com/Moonbase59/loudgain"
 distfiles="https://github.com/Moonbase59/loudgain/archive/v${version}.tar.gz"
 checksum=1137c193ad941b366e87c5d84ccc95a7aa8571affc060db0bd1cf72c489aeaee
+patch_args=-Np1
 
 post_install() {
 	vlicense COPYING

From 6bf0e06ec0942f7d4a35081a00443f1a9667b4ed 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: Fri, 26 Mar 2021 21:14:31 +0700
Subject: [PATCH 27/62] masterpassword-cli: hardening

---
 srcpkgs/masterpassword-cli/patches/fix-cflags.patch | 13 +++++++++++++
 srcpkgs/masterpassword-cli/template                 |  2 +-
 2 files changed, 14 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/masterpassword-cli/patches/fix-cflags.patch

diff --git a/srcpkgs/masterpassword-cli/patches/fix-cflags.patch b/srcpkgs/masterpassword-cli/patches/fix-cflags.patch
new file mode 100644
index 000000000000..a303f6954544
--- /dev/null
+++ b/srcpkgs/masterpassword-cli/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: platform-independent/cli-c/CMakeLists.txt
+===================================================================
+--- platform-independent/cli-c/CMakeLists.txt.orig
++++ platform-independent/cli-c/CMakeLists.txt
+@@ -15,8 +15,6 @@ option( BUILD_MPW_BENCH         "C CLI M
+ option( BUILD_MPW_TESTS         "C Master Password algorithm test suite (needs: mpw_sodium, mpw_xml)." OFF )
+ 
+ # Default build flags.
+-set( CMAKE_BUILD_TYPE           Release )
+-set( CMAKE_C_FLAGS              "-O3" )
+ 
+ # Version.
+ file( READ                      "VERSION" mpw_version )
diff --git a/srcpkgs/masterpassword-cli/template b/srcpkgs/masterpassword-cli/template
index ee2b8d41ae4b..8536228a602b 100644
--- a/srcpkgs/masterpassword-cli/template
+++ b/srcpkgs/masterpassword-cli/template
@@ -1,7 +1,7 @@
 # Template file for 'masterpassword-cli'
 pkgname=masterpassword-cli
 version=2.6
-revision=5
+revision=6
 wrksrc=MasterPassword-${version}-cli-3
 build_wrksrc=platform-independent/cli-c
 build_style=cmake

From 60c4314fbff51a6facc93a4ffbfe010fbdece0f3 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: Fri, 26 Mar 2021 21:20:13 +0700
Subject: [PATCH 28/62] msg2: hardening

---
 srcpkgs/msg2/patches/fix-cflags.patch | 13 +++++++++++++
 srcpkgs/msg2/template                 |  2 +-
 2 files changed, 14 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/msg2/patches/fix-cflags.patch

diff --git a/srcpkgs/msg2/patches/fix-cflags.patch b/srcpkgs/msg2/patches/fix-cflags.patch
new file mode 100644
index 000000000000..64404bf44fcb
--- /dev/null
+++ b/srcpkgs/msg2/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -3,7 +3,7 @@ project(msg2)
+ 
+ # Flags
+ set(CMAKE_CXX_STANDARD 17)
+-set(CMAKE_CXX_FLAGS "-Os -pipe -fPIC -fno-plt -fstack-protector-strong -Wall -Wshadow -pedantic -Wno-parentheses -Wfatal-errors")
++set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pipe -fPIC -fno-plt -fstack-protector-strong -Wall -Wshadow -pedantic -Wno-parentheses -Wfatal-errors")
+ 
+ # Add source files
+ add_executable(msg2 main.cpp)
diff --git a/srcpkgs/msg2/template b/srcpkgs/msg2/template
index b4f77400bf22..473b3c4ec4d2 100644
--- a/srcpkgs/msg2/template
+++ b/srcpkgs/msg2/template
@@ -1,7 +1,7 @@
 # Template file for 'msg2'
 pkgname=msg2
 version=1.2.0
-revision=1
+revision=2
 build_style=cmake
 short_desc="Output a blue arrow and a white message on the commandline"
 maintainer="Orphaned <orphan@voidlinux.org>"

From 413a129dd97a1b14a31ea782f051ce8a217b6337 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: Fri, 26 Mar 2021 21:22:55 +0700
Subject: [PATCH 29/62] ippusbxd: fix cflags -O2 not -o2

---
 srcpkgs/ippusbxd/patches/fix-cflags.patch | 12 ++++++++++++
 srcpkgs/ippusbxd/template                 |  2 +-
 2 files changed, 13 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/ippusbxd/patches/fix-cflags.patch

diff --git a/srcpkgs/ippusbxd/patches/fix-cflags.patch b/srcpkgs/ippusbxd/patches/fix-cflags.patch
new file mode 100644
index 000000000000..5d36903c3ffd
--- /dev/null
+++ b/srcpkgs/ippusbxd/patches/fix-cflags.patch
@@ -0,0 +1,12 @@
+Index: src/CMakeLists.txt
+===================================================================
+--- src/CMakeLists.txt.orig
++++ src/CMakeLists.txt
+@@ -1,6 +1,6 @@
+ cmake_minimum_required(VERSION 2.6)
+ project(ippusbxd)
+-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -o2 -g -std=c99 -Wall -Wextra -pedantic -pedantic-errors")
++set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -Wall -Wextra -pedantic -pedantic-errors")
+ 
+ 
+ # Compiler specific configuration
diff --git a/srcpkgs/ippusbxd/template b/srcpkgs/ippusbxd/template
index ce4ff2ea9125..e81064e8b91d 100644
--- a/srcpkgs/ippusbxd/template
+++ b/srcpkgs/ippusbxd/template
@@ -1,7 +1,7 @@
 # Template file for 'ippusbxd'
 pkgname=ippusbxd
 version=1.34
-revision=1
+revision=2
 build_wrksrc=src
 build_style=cmake
 make_cmd=make

From 55b458203af4eb7560ca0af3613d403da7e504ac 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: Fri, 26 Mar 2021 21:34:52 +0700
Subject: [PATCH 30/62] tlsh: respect -g

---
 srcpkgs/tlsh/patches/fix-cflags.patch | 13 +++++++++++++
 srcpkgs/tlsh/template                 |  2 +-
 2 files changed, 14 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/tlsh/patches/fix-cflags.patch

diff --git a/srcpkgs/tlsh/patches/fix-cflags.patch b/srcpkgs/tlsh/patches/fix-cflags.patch
new file mode 100644
index 000000000000..8715563715c7
--- /dev/null
+++ b/srcpkgs/tlsh/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -125,7 +125,7 @@ if (CMAKE_BUILD_TYPE STREQUAL Debug)
+     endif()
+ else(CMAKE_BUILD_TYPE STREQUAL Debug)
+     if(CMAKE_COMPILER_IS_GNUCXX)
+-        set(CMAKE_CXX_FLAGS "-O2 -fvisibility=internal")  ## Remove TlshImpl symbols
++        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=internal")  ## Remove TlshImpl symbols
+     endif()
+     if(MSVC)
+         set(CMAKE_CXX_FLAGS "/O2")        ## Optimize
diff --git a/srcpkgs/tlsh/template b/srcpkgs/tlsh/template
index 7cb5c28b48b9..dfea27526e14 100644
--- a/srcpkgs/tlsh/template
+++ b/srcpkgs/tlsh/template
@@ -1,7 +1,7 @@
 # Template file for 'tlsh'
 pkgname=tlsh
 version=3.17.0
-revision=2
+revision=3
 build_style=cmake
 hostmakedepends="python3"
 makedepends="python3-devel"

From c3e8bd61ab43e6881d0b55a3b1105401b8e8c703 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: Fri, 26 Mar 2021 21:59:06 +0700
Subject: [PATCH 31/62] poppler: hardening + respect -g

---
 srcpkgs/poppler/patches/fix-cflags.patch | 21 +++++++++++++++++++++
 srcpkgs/poppler/template                 |  2 +-
 2 files changed, 22 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/poppler/patches/fix-cflags.patch

diff --git a/srcpkgs/poppler/patches/fix-cflags.patch b/srcpkgs/poppler/patches/fix-cflags.patch
new file mode 100644
index 000000000000..9e62b11010ba
--- /dev/null
+++ b/srcpkgs/poppler/patches/fix-cflags.patch
@@ -0,0 +1,21 @@
+Index: cmake/modules/PopplerMacros.cmake
+===================================================================
+--- cmake/modules/PopplerMacros.cmake.orig
++++ cmake/modules/PopplerMacros.cmake
+@@ -123,14 +123,14 @@ if(CMAKE_COMPILER_IS_GNUCXX)
+   set(DEFAULT_COMPILE_WARNINGS_EXTRA "${_warn} ${_warnx}")
+ 
+   set(_save_cxxflags "${CMAKE_CXX_FLAGS}")
+-  set(CMAKE_CXX_FLAGS                "-fno-exceptions -fno-check-new -fno-common -D_DEFAULT_SOURCE")
++  set(CMAKE_CXX_FLAGS                "-fno-exceptions -fno-check-new -fno-common -D_DEFAULT_SOURCE ${_save_cxxflags}")
+   set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g ${_save_cxxflags}")
+   set(CMAKE_CXX_FLAGS_RELEASE        "-O2 -DNDEBUG ${_save_cxxflags}")
+   set(CMAKE_CXX_FLAGS_DEBUG          "-g -O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline ${_save_cxxflags}")
+   set(CMAKE_CXX_FLAGS_DEBUGFULL      "-g3 -fno-inline ${_save_cxxflags}")
+   set(CMAKE_CXX_FLAGS_PROFILE        "-g3 -fno-inline -ftest-coverage -fprofile-arcs ${_save_cxxflags}")
+   set(_save_cflags "${CMAKE_C_FLAGS}")
+-  set(CMAKE_C_FLAGS                  "-std=c99 -D_DEFAULT_SOURCE")
++  set(CMAKE_C_FLAGS                  "-std=c99 -D_DEFAULT_SOURCE ${_save_cflags}")
+   set(CMAKE_C_FLAGS_RELWITHDEBINFO   "-O2 -g ${_save_cflags}")
+   set(CMAKE_C_FLAGS_RELEASE          "-O2 -DNDEBUG ${_save_cflags}")
+   set(CMAKE_C_FLAGS_DEBUG            "-g -O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline ${_save_cflags}")
diff --git a/srcpkgs/poppler/template b/srcpkgs/poppler/template
index ed0db8de7ab6..1aebd7f7e177 100644
--- a/srcpkgs/poppler/template
+++ b/srcpkgs/poppler/template
@@ -4,7 +4,7 @@
 #
 pkgname=poppler
 version=20.09.0
-revision=2
+revision=3
 build_style=cmake
 build_helper="gir"
 configure_args="-DENABLE_UNSTABLE_API_ABI_HEADERS=ON -DENABLE_CPP=ON

From 9b7d1a1c2e07cf59fdb0f46d301e4641ded854f5 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: Fri, 26 Mar 2021 21:59:29 +0700
Subject: [PATCH 32/62] poppler-qt5: hardening + respect -g

---
 srcpkgs/poppler-qt5/patches  | 1 +
 srcpkgs/poppler-qt5/template | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)
 create mode 120000 srcpkgs/poppler-qt5/patches

diff --git a/srcpkgs/poppler-qt5/patches b/srcpkgs/poppler-qt5/patches
new file mode 120000
index 000000000000..636e4ac2cbd9
--- /dev/null
+++ b/srcpkgs/poppler-qt5/patches
@@ -0,0 +1 @@
+../poppler/patches
\ No newline at end of file
diff --git a/srcpkgs/poppler-qt5/template b/srcpkgs/poppler-qt5/template
index 0dc45c05c58b..c2ec35dbbad3 100644
--- a/srcpkgs/poppler-qt5/template
+++ b/srcpkgs/poppler-qt5/template
@@ -5,7 +5,7 @@
 #
 pkgname=poppler-qt5
 version=20.09.0
-revision=1
+revision=2
 wrksrc="poppler-${version}"
 build_style=cmake
 configure_args="-DENABLE_UNSTABLE_API_ABI_HEADERS=ON -DENABLE_GLIB=OFF

From a30d7f9571b664cc781fcb717fdd80da01d00d4e 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: Sat, 27 Mar 2021 11:17:35 +0700
Subject: [PATCH 33/62] artyfx: remove -O1 -g

---
 srcpkgs/artyfx/patches/fix-avtk-cmake-sse.patch | 4 ++--
 srcpkgs/artyfx/patches/respect-our-cflags.patch | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/artyfx/patches/fix-avtk-cmake-sse.patch b/srcpkgs/artyfx/patches/fix-avtk-cmake-sse.patch
index 1a832155a566..47ef4dd9b84e 100644
--- a/srcpkgs/artyfx/patches/fix-avtk-cmake-sse.patch
+++ b/srcpkgs/artyfx/patches/fix-avtk-cmake-sse.patch
@@ -6,8 +6,8 @@
  
 -SET(CMAKE_C_FLAGS   "-fPIC -msse -msse2 -mfpmath=sse -g") # -fsanitize=address
 -SET(CMAKE_CXX_FLAGS "-fPIC -msse -msse2 -mfpmath=sse -g") # -fsanitize=address
-+SET(CMAKE_C_FLAGS   "${CMAKE_C_FLAGS} -fPIC -g") # -fsanitize=address
-+SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -g") # -fsanitize=address
++SET(CMAKE_C_FLAGS   "${CMAKE_C_FLAGS} -fPIC") # -fsanitize=address
++SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") # -fsanitize=address
 +
 +IF(BUILD_SSE)
 +	SET(CMAKE_C_FLAGS   "${CMAKE_C_FLAGS} -msse -msse2 -mfpmath=sse")
diff --git a/srcpkgs/artyfx/patches/respect-our-cflags.patch b/srcpkgs/artyfx/patches/respect-our-cflags.patch
index ee9155c7729e..7a32fd9df73b 100644
--- a/srcpkgs/artyfx/patches/respect-our-cflags.patch
+++ b/srcpkgs/artyfx/patches/respect-our-cflags.patch
@@ -10,8 +10,8 @@ Index: CMakeLists.txt
 -SET(CMAKE_C_FLAGS "-g -Wall -O1 -Wno-unused-variable")
 -SET(CMAKE_CXX_FLAGS "-g -Wall -O1 -Wno-unused-variable -ftree-vectorize")
 +SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fPIC -shared -L./src/avtk -Wl,--no-undefined")
-+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -Wall -O1 -Wno-unused-variable")
-+SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -Wall -O1 -Wno-unused-variable -ftree-vectorize")
++SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall  -Wno-unused-variable")
++SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall  -Wno-unused-variable -ftree-vectorize")
  
  
  # DSP sources

From deea7830ab5fd4e0e61446050e0c5668085bb802 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: Sat, 27 Mar 2021 11:27:28 +0700
Subject: [PATCH 34/62] coin3: build with CMAKE_BUILD_TYPE=None

---
 srcpkgs/coin3/template | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/coin3/template b/srcpkgs/coin3/template
index d5483ee048c3..8f7218c2e8c3 100644
--- a/srcpkgs/coin3/template
+++ b/srcpkgs/coin3/template
@@ -5,7 +5,7 @@ revision=1
 wrksrc="coin-Coin-${version}"
 build_style=cmake
 configure_args="-DCMAKE_INSTALL_INCLUDEDIR=/usr/include/Coin3
- -DCMAKE_BUILD_TYPE=Release -DCOIN_BUILD_TESTS=OFF -DCOIN_BUILD_DOCUMENTATION=ON"
+ -DCOIN_BUILD_TESTS=OFF -DCOIN_BUILD_DOCUMENTATION=ON"
 hostmakedepends="doxygen graphviz"
 makedepends="boost-devel glu-devel"
 short_desc="High-level 3D graphics toolkit"
@@ -15,6 +15,9 @@ homepage="https://coin3d.github.io/"
 distfiles="https://github.com/coin3d/coin/archive/Coin-${version}.tar.gz"
 checksum=b00d2a8e9d962397cf9bf0d9baa81bcecfbd16eef675a98c792f5cf49eb6e805
 
+CFLAGS=-DNDEBUG
+CXXFLAGS=-DNDEBUG
+
 if [ "$CROSS_BUILD" ]; then
 	# bypass runtime test (quote hashing is fine with gcc 9.3)
 	configure_args+=" -DHAVE_HASH_QUOTING_EXITCODE=0"

From cd2c26387ef78300525935a0dea677d8bc7afb30 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: Sat, 27 Mar 2021 11:46:46 +0700
Subject: [PATCH 35/62] conky: don't overwrite CMAKE_BUILD_TYPE

---
 srcpkgs/conky/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/conky/template b/srcpkgs/conky/template
index 8b95a628edfb..f05c7d4a1bf2 100644
--- a/srcpkgs/conky/template
+++ b/srcpkgs/conky/template
@@ -5,7 +5,7 @@ version=1.12.1
 revision=1
 build_style=cmake
 conf_files="/etc/conky/conky.conf /etc/conky/conky_no_x11.conf"
-configure_args="-DCMAKE_BUILD_TYPE=Release -DMAINTAINER_MODE=ON -DRELEASE=ON
+configure_args="-DMAINTAINER_MODE=ON -DRELEASE=ON
  -DDOC_PATH=share/doc/${pkgname} -DBUILD_X11=ON -DBUILD_CURL=ON -DBUILD_XDBE=ON
  -DBUILD_RSS=ON -DBUILD_WEATHER_METAR=ON -DBUILD_IMLIB2=ON -DBUILD_WLAN=ON
  -DBUILD_LUA_CAIRO=ON -DBUILD_LUA_IMLIB2=ON -DBUILD_LUA_RSVG=ON

From a75a7d99905f388bb90c45c850491e47d5f8ef79 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: Sat, 27 Mar 2021 11:46:46 +0700
Subject: [PATCH 36/62] conky-cli: don't overwrite CMAKE_BUILD_TYPE

---
 srcpkgs/conky-cli/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/conky-cli/template b/srcpkgs/conky-cli/template
index b61bdcca0504..7d512b65ab3e 100644
--- a/srcpkgs/conky-cli/template
+++ b/srcpkgs/conky-cli/template
@@ -6,7 +6,7 @@ revision=1
 wrksrc="${pkgname/-cli/}-${version}"
 build_style=cmake
 conf_files="/etc/conky/conky.conf /etc/conky/conky_no_x11.conf"
-configure_args="-DCMAKE_BUILD_TYPE=Release -DMAINTAINER_MODE=ON -DRELEASE=ON
+configure_args="-DMAINTAINER_MODE=ON -DRELEASE=ON
  -DDOC_PATH=share/doc/${pkgname} -DBUILD_X11=OFF -DBUILD_CURL=ON -DBUILD_XDBE=OFF
  -DBUILD_RSS=ON -DBUILD_WEATHER_METAR=OFF -DBUILD_IMLIB2=OFF -DBUILD_WLAN=ON
  -DBUILD_DOCS=ON"

From 9d1f975de97d04d6f522d58707eedbda43ea4fe7 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: Sat, 27 Mar 2021 11:48:25 +0700
Subject: [PATCH 37/62] crossguid: don't overwrite -O2

---
 srcpkgs/crossguid/fix-cflags.patch | 12 ++++++++++++
 1 file changed, 12 insertions(+)
 create mode 100644 srcpkgs/crossguid/fix-cflags.patch

diff --git a/srcpkgs/crossguid/fix-cflags.patch b/srcpkgs/crossguid/fix-cflags.patch
new file mode 100644
index 000000000000..983360a07ccf
--- /dev/null
+++ b/srcpkgs/crossguid/fix-cflags.patch
@@ -0,0 +1,12 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -2,7 +2,6 @@ cmake_minimum_required(VERSION 3.5.1)
+ project(CrossGuid)
+ 
+ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake")
+-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3")
+ 
+ option(XG_TESTS "Build test runner" ON)
+ 

From a15d53deb0e0797e0c6dc6aaeafd91a5a3b8cb4b 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: Sat, 27 Mar 2021 12:19:04 +0700
Subject: [PATCH 38/62] rapidjson: define -DNDEBUG

---
 srcpkgs/rapidjson/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/rapidjson/template b/srcpkgs/rapidjson/template
index 8597f8fb2706..99d92702cc9d 100644
--- a/srcpkgs/rapidjson/template
+++ b/srcpkgs/rapidjson/template
@@ -11,7 +11,7 @@ distfiles="https://github.com/miloyip/${pkgname}/archive/v${version}.tar.gz"
 checksum=bf7ced29704a1e696fbccf2a2b4ea068e7774fa37f6d7dd4039d0787f8bed98e
 
 # class-memaccess is required by https://github.com/Tencent/rapidjson/issues/1700
-CXXFLAGS="-Wno-type-limits -Wno-error=class-memaccess"
+CXXFLAGS="-Wno-type-limits -Wno-error=class-memaccess -DNDEBUG"
 
 post_patch() {
 	# Remove bin/jsonchecker, which is the JSON licensed files

From eddc6279bb03f41b96fabbc5ed6dc4fa72a87c9a 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: Sat, 27 Mar 2021 12:18:36 +0700
Subject: [PATCH 39/62] cura-engine: ignore -O3

---
 srcpkgs/cura-engine/patches/fix-cflags.patch | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 srcpkgs/cura-engine/patches/fix-cflags.patch

diff --git a/srcpkgs/cura-engine/patches/fix-cflags.patch b/srcpkgs/cura-engine/patches/fix-cflags.patch
new file mode 100644
index 000000000000..e48a665523b8
--- /dev/null
+++ b/srcpkgs/cura-engine/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -42,7 +42,7 @@ endif()
+ if(CMAKE_BUILD_TYPE_UPPER MATCHES "DEBUG")
+     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_DEBUG_INIT}")
+ else()
+-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELEASE_INIT}")
++    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DNDEBUG")
+ endif()
+ 
+ set(CMAKE_CXX_STANDARD 11)

From 43d33c989c6fa01be38651ebab40cbccb497a34f 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: Sat, 27 Mar 2021 12:22:29 +0700
Subject: [PATCH 40/62] dislocker: remove -O1

---
 srcpkgs/dislocker/patches/fix-cflags.patch | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 srcpkgs/dislocker/patches/fix-cflags.patch

diff --git a/srcpkgs/dislocker/patches/fix-cflags.patch b/srcpkgs/dislocker/patches/fix-cflags.patch
new file mode 100644
index 000000000000..1229efeeaf0c
--- /dev/null
+++ b/srcpkgs/dislocker/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: src/CMakeLists.txt
+===================================================================
+--- src/CMakeLists.txt.orig
++++ src/CMakeLists.txt
+@@ -71,7 +71,7 @@ if(NOT DEFINED WARN_FLAGS)
+ 	set (WARN_FLAGS "-Wall -Wextra" CACHE STRING "" FORCE)
+ endif()
+ if(NOT DEFINED HARDEN_FLAGS)
+-	set (HARDEN_FLAGS "-fstack-protector -fstrict-aliasing -D_FORTIFY_SOURCE=2 -O1" CACHE STRING "" FORCE)
++	set (HARDEN_FLAGS "-fstack-protector -fstrict-aliasing" CACHE STRING "" FORCE)
+ endif()
+ 
+ set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")

From 4d27494fe91d1c9a71a2db18abe0de00cf38fb5f 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: Sat, 27 Mar 2021 12:29:31 +0700
Subject: [PATCH 41/62] freeorion: remove -O3

---
 srcpkgs/freeorion/patches/fix-cflags.patch | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
 create mode 100644 srcpkgs/freeorion/patches/fix-cflags.patch

diff --git a/srcpkgs/freeorion/patches/fix-cflags.patch b/srcpkgs/freeorion/patches/fix-cflags.patch
new file mode 100644
index 000000000000..c66d54599556
--- /dev/null
+++ b/srcpkgs/freeorion/patches/fix-cflags.patch
@@ -0,0 +1,18 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -432,13 +432,6 @@ if(MSVC)
+     )
+ endif()
+ 
+-target_compile_options(freeorionparseobj
+-    PRIVATE
+-        $<$<CXX_COMPILER_ID:Clang>:-ftemplate-depth=512>
+-        $<$<CXX_COMPILER_ID:AppleClang>:-ftemplate-depth=512>
+-        $<$<AND:$<NOT:$<BOOL:${BUILD_TESTING}>>,$<CXX_COMPILER_ID:GNU>>:-O3>
+-)
+-
+ target_compile_definitions(freeorionparseobj
+     PUBLIC
+         -DBOOST_ALL_DYN_LINK

From b479c208d6e6968d1e04721c2d22d18564770ad8 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: Fri, 26 Mar 2021 09:01:12 +0700
Subject: [PATCH 42/62] cglm: fix build flags

---
 srcpkgs/cglm/patches/fix-cflags.patch | 13 +++++++++++++
 srcpkgs/cglm/template                 |  1 +
 2 files changed, 14 insertions(+)
 create mode 100644 srcpkgs/cglm/patches/fix-cflags.patch

diff --git a/srcpkgs/cglm/patches/fix-cflags.patch b/srcpkgs/cglm/patches/fix-cflags.patch
new file mode 100644
index 000000000000..c74de6ea62d7
--- /dev/null
+++ b/srcpkgs/cglm/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: cglm-0.7.6/CMakeLists.txt
+===================================================================
+--- cglm-0.7.6.orig/CMakeLists.txt
++++ cglm-0.7.6/CMakeLists.txt
+@@ -25,7 +25,7 @@ if(MSVC)
+ 	add_definitions(-DNDEBUG -D_WINDOWS -D_USRDLL -DCGLM_EXPORTS -DCGLM_DLL)
+ 	add_compile_options(/W3 /Ox /Gy /Oi /TC)
+ else()
+-  add_compile_options(-Wall -Werror -O3)
++  add_compile_options(-Wall)
+ endif()
+ 
+ if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
diff --git a/srcpkgs/cglm/template b/srcpkgs/cglm/template
index f00a093edab9..311b4c79a7d3 100644
--- a/srcpkgs/cglm/template
+++ b/srcpkgs/cglm/template
@@ -9,6 +9,7 @@ license="MIT"
 homepage="https://github.com/recp/cglm"
 distfiles="https://github.com/recp/cglm/archive/v${version}.tar.gz"
 checksum=29ff8af4edc03697e36d3e6f99a80b884a80ee09d46055ce45765e5d6b2456d9
+patch_args=-Np1
 
 post_install() {
 	vlicense LICENSE

From 661a5bc28c64baa823cba2596f6215c0bf066cee 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: Sat, 27 Mar 2021 12:36:19 +0700
Subject: [PATCH 43/62] glyr: don't force Release build

---
 srcpkgs/glyr/patches/fix-cflags.patch | 12 ++++++++++++
 1 file changed, 12 insertions(+)
 create mode 100644 srcpkgs/glyr/patches/fix-cflags.patch

diff --git a/srcpkgs/glyr/patches/fix-cflags.patch b/srcpkgs/glyr/patches/fix-cflags.patch
new file mode 100644
index 000000000000..498ffe09a38f
--- /dev/null
+++ b/srcpkgs/glyr/patches/fix-cflags.patch
@@ -0,0 +1,12 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -60,7 +60,6 @@ exec_program(
+ IF(CMAKE_BUILD_TYPE STREQUAL "debug")
+     SET(GLYR_DEBUG TRUE)
+ ELSE()
+-    SET(CMAKE_BUILD_TYPE "release")
+     SET(GLYR_DEBUG FALSE)
+ ENDIF()
+ MESSAGE("-- Building Target: ${CMAKE_BUILD_TYPE}")

From 5561d36b2a44c6b1c85e541000813fc3f7d6edfb 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: Sat, 27 Mar 2021 12:41:50 +0700
Subject: [PATCH 44/62] hugin: remove -O3

---
 srcpkgs/hugin/patches/fix-cflags.patch | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
 create mode 100644 srcpkgs/hugin/patches/fix-cflags.patch

diff --git a/srcpkgs/hugin/patches/fix-cflags.patch b/srcpkgs/hugin/patches/fix-cflags.patch
new file mode 100644
index 000000000000..02fa56bef0e1
--- /dev/null
+++ b/srcpkgs/hugin/patches/fix-cflags.patch
@@ -0,0 +1,15 @@
+Index: src/celeste/CMakeLists.txt
+===================================================================
+--- src/celeste/CMakeLists.txt.orig
++++ src/celeste/CMakeLists.txt
+@@ -16,10 +16,6 @@
+ #    You should have received a copy of the GNU General Public License
+ #    along with Hugin  If not, see <http://www.gnu.org/licenses/>.
+  
+-IF(NOT WIN32)
+-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3")
+-ENDIF(NOT WIN32)
+-
+ # a list of all files belonging to celeste library
+ 
+ SET(CELESTE_SRC

From 3668b75d618258be9da499176d888446c1178525 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: Sat, 27 Mar 2021 13:05:27 +0700
Subject: [PATCH 45/62] ledger: don't overwrite CMAKE_BUILD_TYPE

---
 srcpkgs/ledger/patches/fix-cflags.patch | 12 ++++++++++++
 1 file changed, 12 insertions(+)
 create mode 100644 srcpkgs/ledger/patches/fix-cflags.patch

diff --git a/srcpkgs/ledger/patches/fix-cflags.patch b/srcpkgs/ledger/patches/fix-cflags.patch
new file mode 100644
index 000000000000..179ab79cd148
--- /dev/null
+++ b/srcpkgs/ledger/patches/fix-cflags.patch
@@ -0,0 +1,12 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -41,7 +41,6 @@ if (BUILD_DEBUG)
+   set(CMAKE_BUILD_TYPE Debug)
+   set(DEBUG_MODE 1)
+ else()
+-  set(CMAKE_BUILD_TYPE Release)
+   set(DEBUG_MODE 0)
+ endif()
+ 

From 62d0d120d86729293823521fa1a56a9e45a84c5c 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: Sat, 27 Mar 2021 13:18:24 +0700
Subject: [PATCH 46/62] libmygpo-qt: remove -ggdb3

---
 srcpkgs/libmygpo-qt/patches/fix-cflags.patch | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 srcpkgs/libmygpo-qt/patches/fix-cflags.patch

diff --git a/srcpkgs/libmygpo-qt/patches/fix-cflags.patch b/srcpkgs/libmygpo-qt/patches/fix-cflags.patch
new file mode 100644
index 000000000000..9940b6fc4323
--- /dev/null
+++ b/srcpkgs/libmygpo-qt/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -69,7 +69,7 @@ if (CMAKE_COMPILER_IS_GNUCXX)
+        -Wwrite-strings -Wpacked -Wformat-security -Wmissing-format-attribute
+        -Wold-style-cast -Woverloaded-virtual -Wnon-virtual-dtor  -Wall -Wextra
+        -Wformat=2 -Wundef -Wstack-protector -Wmissing-include-dirs
+-       -Winit-self -Wunsafe-loop-optimizations  -ggdb3 -fno-inline -DQT_STRICT_ITERATORS )
++       -Winit-self -Wunsafe-loop-optimizations  -fno-inline -DQT_STRICT_ITERATORS )
+     if ( NOT WIN32 )
+         add_definitions( -fvisibility=hidden )
+     endif()

From c82a9b95a019383b0c98fe4e52001c2fac703ffd 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: Sat, 27 Mar 2021 13:48:38 +0700
Subject: [PATCH 47/62] libogre: don't build vendored libraries

---
 srcpkgs/libogre/template | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/srcpkgs/libogre/template b/srcpkgs/libogre/template
index 784e3a648bac..6dd88ea08c73 100644
--- a/srcpkgs/libogre/template
+++ b/srcpkgs/libogre/template
@@ -3,11 +3,8 @@ pkgname=libogre
 version=1.12.9
 revision=1
 build_style=cmake
-configure_args="-DCMAKE_INSTALL_PREFIX=/usr \
-	-DOGRE_INSTALL_SAMPLES=TRUE \
-	-DOGRE_INSTALL_DOCS=TRUE \
-	-DOGRE_INSTALL_SAMPLES_SOURCE=TRUE \
-	-DCMAKE_BUILD_TYPE=Release"
+configure_args="-DOGRE_INSTALL_SAMPLES=TRUE -DOGRE_INSTALL_DOCS=TRUE
+ -DOGRE_INSTALL_SAMPLES_SOURCE=TRUE -DOGRE_BUILD_DEPENDENCIES=FALSE"
 hostmakedepends="pkg-config graphviz doxygen dejavu-fonts-ttf"
 makedepends="boost-devel freetype-devel libXaw-devel libXrandr-devel
  MesaLib-devel zziplib-devel libcppunit-devel glu-devel libatomic-devel

From 99426a9155cc9e0e3f3409fe4d03490c5a3400b6 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: Sat, 27 Mar 2021 13:52:50 +0700
Subject: [PATCH 48/62] libopenglrecorder: remove -O3

---
 srcpkgs/libopenglrecorder/patches/fix-cflags.patch | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 srcpkgs/libopenglrecorder/patches/fix-cflags.patch

diff --git a/srcpkgs/libopenglrecorder/patches/fix-cflags.patch b/srcpkgs/libopenglrecorder/patches/fix-cflags.patch
new file mode 100644
index 000000000000..7c48a0d2d822
--- /dev/null
+++ b/srcpkgs/libopenglrecorder/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -21,7 +21,7 @@ if (UNIX OR MINGW)
+     if (CMAKE_BUILD_TYPE MATCHES Debug)
+         add_definitions(-std=gnu++0x -O0)
+     else()
+-        add_definitions(-std=gnu++0x -O3)
++        add_definitions(-std=gnu++0x)
+     endif()
+ endif()
+ 

From 6d55110fff149ba2e2c24cc8e577976c57312190 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: Sat, 27 Mar 2021 13:55:41 +0700
Subject: [PATCH 49/62] libvidstab: remove -O3

---
 srcpkgs/libvidstab/patches/fix-cflags.patch | 39 +++++++++++++++++++++
 1 file changed, 39 insertions(+)
 create mode 100644 srcpkgs/libvidstab/patches/fix-cflags.patch

diff --git a/srcpkgs/libvidstab/patches/fix-cflags.patch b/srcpkgs/libvidstab/patches/fix-cflags.patch
new file mode 100644
index 000000000000..51c357efb101
--- /dev/null
+++ b/srcpkgs/libvidstab/patches/fix-cflags.patch
@@ -0,0 +1,39 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -25,7 +25,7 @@ else()
+     set(LIBSUFFIX "")
+ endif()
+ 
+-add_definitions( -Wall -O3 -g -Wno-pointer-sign -fPIC -std=gnu99)
++add_definitions( -Wall -Wno-pointer-sign -fPIC -std=gnu99)
+ # add_definitions(  -Wall -O0 -g -Wno-pointer-sign )
+ 
+ ### ORC is not used in any active code at the moment  ###
+Index: tests/CMakeLists.txt
+===================================================================
+--- tests/CMakeLists.txt.orig
++++ tests/CMakeLists.txt
+@@ -11,7 +11,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PAT
+ option(USE_OMP "use parallelization use OMP" ON)
+ 
+ #add_definitions( -Wall -O3 -Wno-pointer-sign -DTESTING  -std=gnu99)
+-add_definitions(  -Wall -O0 -g -Wno-pointer-sign -DTESTING -std=gnu99)
++add_definitions(  -Wall -Wno-pointer-sign -DTESTING -std=gnu99)
+ find_package(Orc)
+ if(ORC_FOUND)
+ add_definitions( -DUSE_ORC ${ORC_DEFINITIONS})
+Index: transcode/CMakeLists.txt
+===================================================================
+--- transcode/CMakeLists.txt.orig
++++ transcode/CMakeLists.txt
+@@ -9,7 +9,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PAT
+ set(TRANSCODE_ROOT ../../transcode)
+ 
+ 
+-add_definitions( -Wall -O3 -Wno-pointer-sign -DTRANSCODE -std=gnu99)
++add_definitions( -Wall -Wno-pointer-sign -DTRANSCODE -std=gnu99)
+ #add_definitions(  -Wall -O0 -g -Wno-pointer-sign )
+ # I tried it with 0.4.14
+ #  0.4.10 did not work (not all opcode implemented)

From 11c2ae01181768fb2e037c5d486bfef095ff1358 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: Sat, 27 Mar 2021 14:18:34 +0700
Subject: [PATCH 50/62] openlierox: don't overwrote CMAKE_BUILD_TYPE

---
 srcpkgs/openlierox/patches/fix-cflags.patch | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
 create mode 100644 srcpkgs/openlierox/patches/fix-cflags.patch

diff --git a/srcpkgs/openlierox/patches/fix-cflags.patch b/srcpkgs/openlierox/patches/fix-cflags.patch
new file mode 100644
index 000000000000..4fe6652fd0a2
--- /dev/null
+++ b/srcpkgs/openlierox/patches/fix-cflags.patch
@@ -0,0 +1,17 @@
+Index: CMakeOlxCommon.cmake
+===================================================================
+--- CMakeOlxCommon.cmake.orig
++++ CMakeOlxCommon.cmake
+@@ -36,12 +36,6 @@ OPTION(BREAKPAD "Google Breakpad support
+ OPTION(DISABLE_JOYSTICK "Disable joystick support" No)
+ OPTION(MINGW_CROSS_COMPILE "Cross-compile Windows .EXE using i686-w64-mingw32-gcc compiler" No)
+ 
+-IF (DEBUG)
+-	SET(CMAKE_BUILD_TYPE Debug)
+-ELSE (DEBUG)
+-	SET(CMAKE_BUILD_TYPE Release)
+-ENDIF (DEBUG)
+-
+ IF (DEDICATED_ONLY)
+ 	SET(X11 No)
+ 	SET(WITH_G15 No)

From 8dbe1e36b23347946dcc99bae0aeed1e0527e1a1 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: Sat, 27 Mar 2021 14:25:12 +0700
Subject: [PATCH 51/62] opensonic: don't overwrite CMAKE_BUILD_TYPE

---
 srcpkgs/opensonic/patches/fix-cflags.patch | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
 create mode 100644 srcpkgs/opensonic/patches/fix-cflags.patch

diff --git a/srcpkgs/opensonic/patches/fix-cflags.patch b/srcpkgs/opensonic/patches/fix-cflags.patch
new file mode 100644
index 000000000000..10d2c7c80e64
--- /dev/null
+++ b/srcpkgs/opensonic/patches/fix-cflags.patch
@@ -0,0 +1,17 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -25,12 +25,10 @@ SET(GAME_NAME "Open Sonic")
+ SET(GAME_VERSION "0.1.4")
+ SET(RTFM "Please read the user manual (readme.html) to get help.")
+ SET(ALLEGRO_RECOMMENDED_VERSION "4.4.1")
+-SET(CMAKE_BUILD_TYPE Release)
+ MESSAGE("${GAME_NAME} version ${GAME_VERSION}")
+ 
+ # configuring...
+ SET(DEFS "")
+-SET(CFLAGS_EXTRA "-g")
+ SET(CFLAGS "${CFLAGS} ${CMAKE_C_FLAGS}")
+ MESSAGE("Using CFLAGS='${CFLAGS}'")
+ 

From 785f0300ba870a39ed91f5c9c3c74387fa8f64ee 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: Sat, 27 Mar 2021 15:17:28 +0700
Subject: [PATCH 52/62] rocksdb: don't overwrite CMAKE_BUILD_TYPE

---
 srcpkgs/rocksdb/template | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/rocksdb/template b/srcpkgs/rocksdb/template
index e39329e5d6a6..5a6ca434f29b 100644
--- a/srcpkgs/rocksdb/template
+++ b/srcpkgs/rocksdb/template
@@ -3,8 +3,7 @@ pkgname=rocksdb
 version=5.18.3
 revision=2
 build_style=cmake
-configure_args="-DCMAKE_BUILD_TYPE=Release -DPORTABLE=1 -DWITH_TESTS=0
- -DUSE_RTTI=0 -DWITH_LZ4=1"
+configure_args="-DPORTABLE=1 -DWITH_TESTS=0 -DUSE_RTTI=0 -DWITH_LZ4=1"
 makedepends="liblz4-devel"
 short_desc="RocksDB is a embeddable, persistent key-value store for fast storage"
 maintainer="magenbluten <mb0@codemonkey.cc>"
@@ -12,6 +11,8 @@ license="GPL-2.0-or-later, Apache-2.0"
 homepage="https://github.com/facebook/rocksdb"
 distfiles="${homepage}/archive/v${version}.tar.gz"
 checksum=7fb6738263d3f2b360d7468cf2ebe333f3109f3ba1ff80115abd145d75287254
+CFLAGS=-DNDEBUG
+CXXFLAGS=-DNDEBUG
 
 if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
 	makedepends+=" libatomic-devel"

From 04a0e70a3af07534dc2091eb69b7f6530aa95355 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: Sat, 27 Mar 2021 15:19:47 +0700
Subject: [PATCH 53/62] rofs-filtered: hardening

---
 srcpkgs/rofs-filtered/patches/fix-cflags.patch | 13 +++++++++++++
 srcpkgs/rofs-filtered/template                 |  2 +-
 2 files changed, 14 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/rofs-filtered/patches/fix-cflags.patch

diff --git a/srcpkgs/rofs-filtered/patches/fix-cflags.patch b/srcpkgs/rofs-filtered/patches/fix-cflags.patch
new file mode 100644
index 000000000000..f64d3274f091
--- /dev/null
+++ b/srcpkgs/rofs-filtered/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -9,7 +9,7 @@ set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PA
+      "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
+ 
+ add_definitions(-D_GNU_SOURCE)
+-set(CMAKE_C_FLAGS "-Wall -std=c99")
++set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -std=c99")
+ 
+ # find fuse library
+ find_package (FUSE REQUIRED)
diff --git a/srcpkgs/rofs-filtered/template b/srcpkgs/rofs-filtered/template
index 332cd57a9902..e585877eaf59 100644
--- a/srcpkgs/rofs-filtered/template
+++ b/srcpkgs/rofs-filtered/template
@@ -1,7 +1,7 @@
 # Template file for 'rofs-filtered'
 pkgname=rofs-filtered
 version=1.7
-revision=1
+revision=2
 build_style=cmake
 makedepends="fuse-devel"
 short_desc="Filtered read only filesystem for FUSE"

From cc842a1fd8717d575944e8e02ce66ff28a1da3cb 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: Sat, 27 Mar 2021 15:40:26 +0700
Subject: [PATCH 54/62] seexpr-krita: don't overwrite CMAKE_BUILD_TYPE

---
 .../patches/cmake-build-type-none.patch       | 32 +++++++++++++++++++
 1 file changed, 32 insertions(+)
 create mode 100644 srcpkgs/seexpr-krita/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/seexpr-krita/patches/cmake-build-type-none.patch b/srcpkgs/seexpr-krita/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..94bb1f37db75
--- /dev/null
+++ b/srcpkgs/seexpr-krita/patches/cmake-build-type-none.patch
@@ -0,0 +1,32 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -42,14 +42,6 @@ endif()
+ 
+ ## Choose build options
+ # Disney specific method of choosing variant
+-if (${FLAVOR} STREQUAL "optimize")
+-    set(CMAKE_BUILD_TYPE "Release" CACHE STRING "type of build" FORCE)
+-endif()
+-
+-if (${FLAVOR} STREQUAL "debug")
+-    set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "type of build" FORCE)
+-endif()
+-
+ if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
+     execute_process(
+         COMMAND sh -c "echo `uname -s`-`uname -r | cut -d- -f1`-`uname -m`"
+@@ -212,12 +204,6 @@ else()
+ endif()
+ 
+ # Set to release if nothing else defined
+-if (NOT CMAKE_BUILD_TYPE)
+-  set(CMAKE_BUILD_TYPE "Release" CACHE STRING
+-      "Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel."
+-      FORCE)
+-endif()
+-
+ if (ENABLE_QT5)
+     find_package(Qt5 5.9.0 COMPONENTS Core Gui Widgets REQUIRED)
+     set_package_properties(Qt5 PROPERTIES

From 5680dfbb071d9dfa28701277f4cdd0a7c34e3b43 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: Sat, 27 Mar 2021 15:50:53 +0700
Subject: [PATCH 55/62] speed-dreams: hardening

---
 srcpkgs/speed-dreams/template | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/speed-dreams/template b/srcpkgs/speed-dreams/template
index 722f0c5ed87a..df7164f9c808 100644
--- a/srcpkgs/speed-dreams/template
+++ b/srcpkgs/speed-dreams/template
@@ -1,13 +1,13 @@
 # Template file for 'speed-dreams'
 pkgname=speed-dreams
 version=2.2.2
-revision=2
+revision=3
 archs="i686* x86_64* ppc64le*"
 _rev=r6553
 create_wrksrc=yes
 build_style=cmake
-configure_args="-DSD_BINDIR=/usr/bin -DSD_DATADIR=/usr/share/speed-dreams-2 -DSD_LIBDIR=/usr/lib/speed-dreams-2
- -DOPTION_OFFICIAL_ONLY=ON -DCMAKE_CXX_FLAGS=-fpermissive -DCMAKE_C_FLAGS=-fpermissive"
+configure_args="-DSD_BINDIR=/usr/bin -DSD_DATADIR=/usr/share/speed-dreams-2
+ -DSD_LIBDIR=/usr/lib/speed-dreams-2 -DOPTION_OFFICIAL_ONLY=ON"
 hostmakedepends="pkg-config"
 makedepends="freealut-devel libenet-devel libfreeglut-devel libjpeg-turbo-devel
  libpng-devel libvorbis-devel libXrandr-devel osg-devel plib-devel SDL2-devel
@@ -26,6 +26,8 @@ checksum="32aa55c17f8dafc1c54fb0d0b7b993d2688d431899cfc5db9eeece148c6887d0
  0b7b417d007ab3b7f0f4dcfdc868aafee1722150b81af519e1cd4c082b408183"
 nocross=yes
 replaces="speed-dreams-data>=0"
+CFLAGS=-fpermissive
+CXXFLAGS=-fpermissive
 
 if [ "$XBPS_TARGET_LIBC" = musl ]; then
 	broken="Segmentation fault"

From 3195112cadc86d7a610ca53d0e1c7ddac875c8f9 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: Sat, 27 Mar 2021 19:04:09 +0700
Subject: [PATCH 56/62] traverso: hardening

---
 .../patches/cmake-build-type-none.patch       | 28 +++++++++++++++++++
 srcpkgs/traverso/template                     |  2 +-
 2 files changed, 29 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/traverso/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/traverso/patches/cmake-build-type-none.patch b/srcpkgs/traverso/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..75b3fd941eb8
--- /dev/null
+++ b/srcpkgs/traverso/patches/cmake-build-type-none.patch
@@ -0,0 +1,28 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -65,13 +65,7 @@ SET(TRAVERSO_DEFINES -DSTATIC_BUILD)
+ 
+ #BUILD SETUP
+ #None, Debug, Release, .. or custom ones
+-IF(WANT_DEBUG)
+-  SET(CMAKE_BUILD_TYPE DEBUG)
+-  SET(WANT_TRAVERSO_DEBUG ON)
+-ELSE(WANT_DEBUG)
+-  SET(CMAKE_BUILD_TYPE RELEASE)
+-  LIST(APPEND TRAVERSO_DEFINES -DQT_NO_DEBUG)
+-ENDIF(WANT_DEBUG)
++LIST(APPEND TRAVERSO_DEFINES -DQT_NO_DEBUG)
+ 
+ 
+ IF(WANT_TRAVERSO_DEBUG)
+@@ -326,7 +320,7 @@ ${Qt5Xml_INCLUDE_DIRS}
+ ${Qt5Xml_INCLUDES}
+ )
+ 
+-set(CMAKE_CXX_FLAGS "-fPIC")
++set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
+ 
+ #Set up libraries to link with all found packages
+ LINK_LIBRARIES (
diff --git a/srcpkgs/traverso/template b/srcpkgs/traverso/template
index 105924d4f0c6..4b93460f63d7 100644
--- a/srcpkgs/traverso/template
+++ b/srcpkgs/traverso/template
@@ -1,7 +1,7 @@
 # Template file for 'traverso'
 pkgname=traverso
 version=0.49.6
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DWANT_MP3_ENCODE=ON -DDETECT_HOST_CPU_FEATURES=OFF"
 hostmakedepends="pkg-config qt5-qmake qt5-host-tools"

From acfd0cff0e4c1b2a581639b89042dfc01d91f925 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: Sat, 27 Mar 2021 19:08:11 +0700
Subject: [PATCH 57/62] xstarter: hardening

---
 .../patches/cmake-build-type-none.patch       | 22 +++++++++++++++++++
 srcpkgs/xstarter/template                     |  2 +-
 2 files changed, 23 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/xstarter/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/xstarter/patches/cmake-build-type-none.patch b/srcpkgs/xstarter/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..4f793e4c473c
--- /dev/null
+++ b/srcpkgs/xstarter/patches/cmake-build-type-none.patch
@@ -0,0 +1,22 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -5,16 +5,8 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
+ 
+ project(xstarter)
+ 
+-if(NOT CMAKE_BUILD_TYPE)
+-  set(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build (Debug or Release)" FORCE)
+-endif()
+-
+ set(PROJECT_VERSION "0.8.0")
+-if (CMAKE_BUILD_TYPE STREQUAL Debug)
+-  set(CMAKE_C_FLAGS "-g -Wall -pedantic")
+-else()
+-  set(CMAKE_C_FLAGS "-Wall -pedantic -O3")
+-endif()
++set(CMAKE_C_FLAGS "-Wall -pedantic ${CMAKE_C_FLAGS}")
+ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/bin")
+ 
+ set (CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
diff --git a/srcpkgs/xstarter/template b/srcpkgs/xstarter/template
index aa9a47e45e5c..4363d36e3c39 100644
--- a/srcpkgs/xstarter/template
+++ b/srcpkgs/xstarter/template
@@ -1,7 +1,7 @@
 # Template file for 'xstarter'
 pkgname=xstarter
 version=0.8.0
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="pkg-config"
 makedepends="glib-devel ncurses-devel"

From cadbcf0419a4028ca3cc180a6893149a9c1e8ac4 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: Sat, 27 Mar 2021 19:15:48 +0700
Subject: [PATCH 58/62] yabause-gtk: ignore -O3

---
 srcpkgs/yabause-gtk/patches/fix-cflags.patch | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 srcpkgs/yabause-gtk/patches/fix-cflags.patch

diff --git a/srcpkgs/yabause-gtk/patches/fix-cflags.patch b/srcpkgs/yabause-gtk/patches/fix-cflags.patch
new file mode 100644
index 000000000000..52c1cae61799
--- /dev/null
+++ b/srcpkgs/yabause-gtk/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: src/CMakeLists.txt
+===================================================================
+--- src/CMakeLists.txt.orig
++++ src/CMakeLists.txt
+@@ -659,7 +659,7 @@ else ()
+ 	set(yabause_SOURCES ${yabause_SOURCES} sock-dummy.c thr-dummy.c)
+ endif ()
+ 
+-set(YAB_OPTIMIZATION "-O3" CACHE STRING "Override optimization level")
++set(YAB_OPTIMIZATION "" CACHE STRING "Override optimization level")
+ 
+ if("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "i686")
+ 	set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${YAB_OPTIMIZATION} -march=i686 -msse")

From 43c7bef06eee1cc0929abda9654281244955f21c 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: Sat, 27 Mar 2021 19:26:47 +0700
Subject: [PATCH 59/62] ympd: hardening

---
 srcpkgs/ympd/patches/fix-cflags.patch | 13 +++++++++++++
 srcpkgs/ympd/template                 |  2 +-
 2 files changed, 14 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/ympd/patches/fix-cflags.patch

diff --git a/srcpkgs/ympd/patches/fix-cflags.patch b/srcpkgs/ympd/patches/fix-cflags.patch
new file mode 100644
index 000000000000..4720dd39e748
--- /dev/null
+++ b/srcpkgs/ympd/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -24,7 +24,7 @@ include_directories(${PROJECT_BINARY_DIR
+ 
+ include(CheckCSourceCompiles)
+ 
+-set(CMAKE_C_FLAGS "-std=gnu99 -Wall")
++set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99 -Wall")
+ set(CMAKE_C_FLAGS_DEBUG "-ggdb -pedantic")
+ if(WITH_IPV6)
+     set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS NS_ENABLE_IPV6)
diff --git a/srcpkgs/ympd/template b/srcpkgs/ympd/template
index 14437beb5384..450c079b2ca3 100644
--- a/srcpkgs/ympd/template
+++ b/srcpkgs/ympd/template
@@ -1,7 +1,7 @@
 # Template file for 'ympd'
 pkgname=ympd
 version=1.3.0
-revision=7
+revision=8
 build_style=cmake
 hostmakedepends="perl pkg-config"
 makedepends="libmpdclient-devel openssl-devel"

From 104d046023630c915dc95a571bc3442aa65c4217 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: Sat, 27 Mar 2021 19:29:31 +0700
Subject: [PATCH 60/62] z80ex: hardening

---
 srcpkgs/z80ex/patches/fix-cflags.patch | 13 +++++++++++++
 srcpkgs/z80ex/template                 |  2 +-
 2 files changed, 14 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/z80ex/patches/fix-cflags.patch

diff --git a/srcpkgs/z80ex/patches/fix-cflags.patch b/srcpkgs/z80ex/patches/fix-cflags.patch
new file mode 100644
index 000000000000..6743da255e5c
--- /dev/null
+++ b/srcpkgs/z80ex/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -11,7 +11,7 @@ option (OPSTEP_FAST_AND_ROUGH "Fast and
+ 
+ #ALL_CFLAGS := -fPIC -fno-common -ansi -pedantic -Wall -pipe -O2 -I. -I./include
+ if (CMAKE_COMPILER_IS_GNUCC)
+-    set (CMAKE_C_FLAGS "-fPIC -fno-common -ansi -pedantic -Wall -pipe -O2")
++    set (CMAKE_C_FLAGS "-fPIC -fno-common -ansi -pedantic -Wall -pipe ${CMAKE_C_FLAGS}")
+ endif ()
+ 
+ include_directories(BEFORE . include)
diff --git a/srcpkgs/z80ex/template b/srcpkgs/z80ex/template
index 00a24a6fb902..ae04241dcb5a 100644
--- a/srcpkgs/z80ex/template
+++ b/srcpkgs/z80ex/template
@@ -1,7 +1,7 @@
 # Template file for 'z80ex'
 pkgname=z80ex
 version=1.1.21
-revision=1
+revision=2
 build_style=cmake
 short_desc="ZiLOG Z80 CPU emulation library"
 maintainer="Diogo Leal <diogo@diogoleal.com>"

From 04c81661ca3b05b901e484eb5ba1cef8d47ea981 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: Sat, 27 Mar 2021 19:17:13 +0700
Subject: [PATCH 61/62] scribus: don't overwrite cmake-build-type

---
 .../patches/cmake-build-type-none.patch       | 33 +++++++++++++++++++
 1 file changed, 33 insertions(+)
 create mode 100644 srcpkgs/scribus/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/scribus/patches/cmake-build-type-none.patch b/srcpkgs/scribus/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..670c83cc48f5
--- /dev/null
+++ b/srcpkgs/scribus/patches/cmake-build-type-none.patch
@@ -0,0 +1,33 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -35,11 +35,6 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON)
+ 
+ 
+ #RPATH setup - more below too
+-if (WANT_NORPATH OR WANT_DISTROBUILD)
+-	set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
+-else()
+-	set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
+-endif()
+ set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
+ set(CMAKE_SKIP_RULE_DEPENDENCY TRUE)
+ set(CMAKE_SKIP_BUILD_RPATH TRUE)
+@@ -309,16 +304,6 @@ include (CMakeLists_Directories.cmake)
+ #Convert our simpler command line option to the CMake style
+ #None, Debug, Release, .. or custom ones
+ # set(WANT_DEBUG ON)
+-if(WANT_DEBUG)
+-	set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Set Debug Build Type" FORCE)
+-endif()
+-if (WANT_RELEASEWITHDEBUG)
+-	set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING "Set Release with Debug Info Build Type" FORCE)
+-endif()
+-if(NOT WANT_DEBUG AND NOT WANT_RELEASEWITHDEBUG)
+-	set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Set Release Build Type" FORCE)
+-endif()
+-
+ 
+ 
+ #Based on our build type, setup our build options

From d92ccdffbdbf973d1a4efa093b188a06a5dc3a8d 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, 28 Mar 2021 10:39:04 +0700
Subject: [PATCH 62/62] yoshimi: cleanup, don't overwrite CMAKE_BUILD_TYPE

---
 srcpkgs/yoshimi/patches/fix-cflags.patch | 12 ++++++++++++
 srcpkgs/yoshimi/template                 | 13 +------------
 2 files changed, 13 insertions(+), 12 deletions(-)
 create mode 100644 srcpkgs/yoshimi/patches/fix-cflags.patch

diff --git a/srcpkgs/yoshimi/patches/fix-cflags.patch b/srcpkgs/yoshimi/patches/fix-cflags.patch
new file mode 100644
index 000000000000..4baeb82ef4e3
--- /dev/null
+++ b/srcpkgs/yoshimi/patches/fix-cflags.patch
@@ -0,0 +1,12 @@
+Index: src/CMakeLists.txt
+===================================================================
+--- src/CMakeLists.txt.orig
++++ src/CMakeLists.txt
+@@ -262,7 +262,6 @@ if (BuildForDebug)
+     set (CMAKE_CXX_FLAGS_DEBUG ${BuildOptionsDebug})
+     message (STATUS "DEBUG Build, flags: ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_DEBUG}")
+ else()
+-    set (CMAKE_BUILD_TYPE "Release")
+     set (CMAKE_CXX_FLAGS_RELEASE ${BuildOptionsRelease})
+     message (STATUS "RELEASE Build, flags: ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELEASE}")
+ endif ()
diff --git a/srcpkgs/yoshimi/template b/srcpkgs/yoshimi/template
index 0096f7f05710..64a6c9ad433f 100644
--- a/srcpkgs/yoshimi/template
+++ b/srcpkgs/yoshimi/template
@@ -4,6 +4,7 @@ version=1.7.4
 revision=2
 build_wrksrc=src
 build_style=cmake
+configure_args="-DCMAKE_INSTALL_DATAROOTDIR=/usr/share"
 hostmakedepends="pkg-config fltk"
 makedepends="boost-devel jack-devel fltk-devel fftw-devel mxml-devel cairo-devel
  lv2 readline-devel ncurses-devel"
@@ -17,15 +18,3 @@ checksum=27a8e33bda72aafae604e14841bed6373fc9e00ff70c98f1e13215d6a8808318
 case "$XBPS_TARGET_MACHINE" in
 	*-musl) makedepends+=" argp-standalone";;
 esac
-
-configure_args="-DCMAKE_INSTALL_DATAROOTDIR=/usr/share"
-
-pre_configure() {
-	sed -i 's|ncurses|ncursesw|g' CMakeLists.txt
-
-	case "$XBPS_TARGET_MACHINE" in
-		i686*) ;;
-		x86_64*) ;;
-		*) sed -i -e "s|-msse -msse2 -mfpmath=sse||g" CMakeLists.txt;;
-	esac
-}

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PR PATCH] [Updated] build-style/cmake: set CMAKE_BUILD_TYPE to None
  2021-03-14 13:19 [PR PATCH] [WIP] build-style/cmake: set CMAKE_BUILD_TYPE to None sgn
                   ` (24 preceding siblings ...)
  2021-03-28  3:40 ` [PR PATCH] [Updated] " sgn
@ 2021-03-28  3:50 ` sgn
  2021-03-28  3:53 ` sgn
                   ` (6 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: sgn @ 2021-03-28  3:50 UTC (permalink / raw)
  To: ml

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

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

https://github.com/sgn/void-packages cmake-build-type-to-None
https://github.com/void-linux/void-packages/pull/29459

build-style/cmake: set CMAKE_BUILD_TYPE to None
- I'm going to build all packages with `build_style=cmake` and fix them one by one before merging this in.

[ci skip]

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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-cmake-build-type-to-None-29459.patch --]
[-- Type: text/x-diff, Size: 119378 bytes --]

From c689c6f7b4e4dde56b163fd8a7435f106eed995b 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, 14 Mar 2021 20:18:03 +0700
Subject: [PATCH 01/64] build-style/cmake: set CMAKE_BUILD_TYPE to None

---
 common/build-style/cmake.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/build-style/cmake.sh b/common/build-style/cmake.sh
index 5100a96dfd7b..9d1a1a7a1941 100644
--- a/common/build-style/cmake.sh
+++ b/common/build-style/cmake.sh
@@ -52,7 +52,7 @@ _EOF
 		cmake_args+=" -DCMAKE_TOOLCHAIN_FILE=cross_${XBPS_CROSS_TRIPLET}.cmake"
 	fi
 	cmake_args+=" -DCMAKE_INSTALL_PREFIX=/usr"
-	cmake_args+=" -DCMAKE_BUILD_TYPE=Release"
+	cmake_args+=" -DCMAKE_BUILD_TYPE=None"
 	cmake_args+=" -DCMAKE_INSTALL_LIBDIR=lib${XBPS_TARGET_WORDSIZE}"
 
 	if [[ $build_helper = *"qemu"* ]]; then

From 9fd574422a1c9c3cb4c21e25dd4201d7cab1e2df 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: Mon, 15 Mar 2021 08:07:16 +0700
Subject: [PATCH 02/64] amdvlk: allow CMAKE_BUILD_TYPE=None

---
 .../patches/cmake-build-type-none.patch       | 60 +++++++++++++++++++
 1 file changed, 60 insertions(+)
 create mode 100644 srcpkgs/amdvlk/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/amdvlk/patches/cmake-build-type-none.patch b/srcpkgs/amdvlk/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..7a629e58548e
--- /dev/null
+++ b/srcpkgs/amdvlk/patches/cmake-build-type-none.patch
@@ -0,0 +1,60 @@
+Index: llvm-project/llvm/CMakeLists.txt
+===================================================================
+--- llvm-project/llvm/CMakeLists.txt.orig
++++ llvm-project/llvm/CMakeLists.txt
+@@ -251,11 +251,6 @@ endif()
+ 
+ string(TOUPPER "${CMAKE_BUILD_TYPE}" uppercase_CMAKE_BUILD_TYPE)
+ 
+-if (CMAKE_BUILD_TYPE AND
+-    NOT uppercase_CMAKE_BUILD_TYPE MATCHES "^(DEBUG|RELEASE|RELWITHDEBINFO|MINSIZEREL)$")
+-  message(FATAL_ERROR "Invalid value for CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
+-endif()
+-
+ set(LLVM_LIBDIR_SUFFIX "" CACHE STRING "Define suffix of library directory name (32/64)" )
+ 
+ set(LLVM_TOOLS_INSTALL_DIR "bin" CACHE STRING "Path for binary subdirectory (defaults to 'bin')")
+Index: pal/cmake/Modules/AmdCmakeHelper.cmake
+===================================================================
+--- pal/cmake/Modules/AmdCmakeHelper.cmake.orig
++++ pal/cmake/Modules/AmdCmakeHelper.cmake
+@@ -37,11 +37,6 @@ if (CMAKE_CONFIGURATION_TYPES)
+ else()
+     string(TOUPPER "${CMAKE_BUILD_TYPE}" capital_CMAKE_BUILD_TYPE)
+ 
+-    if (CMAKE_BUILD_TYPE AND
+-        NOT capital_CMAKE_BUILD_TYPE MATCHES "^(DEBUG|RELEASE|RELWITHDEBINFO|MINSIZEREL)$")
+-        message(FATAL_ERROR "Invalid value for CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
+-    endif()
+-
+     if(capital_CMAKE_BUILD_TYPE STREQUAL "DEBUG")
+         set(CMAKE_BUILD_TYPE_DEBUG ON)
+         set(CMAKE_BUILD_TYPE_RELEASE OFF)
+Index: xgl/CMakeLists.txt
+===================================================================
+--- xgl/CMakeLists.txt.orig
++++ xgl/CMakeLists.txt
+@@ -181,11 +181,6 @@ if (CMAKE_CONFIGURATION_TYPES)
+ else()
+     string(TOUPPER "${CMAKE_BUILD_TYPE}" capital_CMAKE_BUILD_TYPE)
+ 
+-    if (CMAKE_BUILD_TYPE AND
+-        NOT capital_CMAKE_BUILD_TYPE MATCHES "^(DEBUG|RELEASE|RELWITHDEBINFO|MINSIZEREL)$")
+-        message(FATAL_ERROR "Invalid value for CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
+-    endif()
+-
+     if(capital_CMAKE_BUILD_TYPE STREQUAL "DEBUG")
+         set(CMAKE_BUILD_TYPE_DEBUG ON)
+         set(CMAKE_BUILD_TYPE_RELEASE OFF)
+Index: xgl/icd/CMakeLists.txt
+===================================================================
+--- xgl/icd/CMakeLists.txt.orig
++++ xgl/icd/CMakeLists.txt
+@@ -84,7 +84,6 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Cl
+     endif()
+ 
+     if(CMAKE_BUILD_TYPE_RELEASE)
+-        target_compile_options(xgl PRIVATE -O3)
+         if(XGL_ENABLE_LTO)
+             if(${CMAKE_CXX_COMPILER_ID} MATCHES "GNU")
+                 execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION)

From dd120cf233fb6f92850b034f78b3135fa70208f0 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: Wed, 17 Mar 2021 06:24:04 +0700
Subject: [PATCH 03/64] eigen*: set CMAKE_BUILD_TYPE to Release

We're going to set default CMAKE_BUILD_TYPE to None soon. Those packages
are header only libraries, no need to waste time on patching.
---
 srcpkgs/eigen/template    | 1 +
 srcpkgs/eigen3.2/template | 1 +
 2 files changed, 2 insertions(+)

diff --git a/srcpkgs/eigen/template b/srcpkgs/eigen/template
index ee825e95f273..072228c16915 100644
--- a/srcpkgs/eigen/template
+++ b/srcpkgs/eigen/template
@@ -3,6 +3,7 @@ pkgname=eigen
 version=3.3.9
 revision=1
 build_style=cmake
+configure_args="-DCMAKE_BUILD_TYPE=Release"
 short_desc="C++ template library for linear algebra (version 3.x)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MPL-2.0, GPL-3.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
diff --git a/srcpkgs/eigen3.2/template b/srcpkgs/eigen3.2/template
index 5715fc1b3a19..7b710534b5e5 100644
--- a/srcpkgs/eigen3.2/template
+++ b/srcpkgs/eigen3.2/template
@@ -4,6 +4,7 @@ version=3.2.10
 revision=3
 wrksrc="eigen-${version}"
 build_style=cmake
+configure_args="-DCMAKE_BUILD_TYPE=Release"
 short_desc="C++ template library for linear algebra (version 3.x)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MPL-2.0, GPL-3.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"

From 9b9479f8ca54e6b305003131143bdc746dd72492 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: Wed, 17 Mar 2021 07:04:48 +0700
Subject: [PATCH 04/64] embree: don't ignore CXXFLAGS, fix build with ispc
 1.13+

---
 .../embree/patches/uintNN-is-part-of-ispc-1.13.patch | 12 ++++++++++++
 srcpkgs/embree/template                              |  6 ++----
 2 files changed, 14 insertions(+), 4 deletions(-)
 create mode 100644 srcpkgs/embree/patches/uintNN-is-part-of-ispc-1.13.patch

diff --git a/srcpkgs/embree/patches/uintNN-is-part-of-ispc-1.13.patch b/srcpkgs/embree/patches/uintNN-is-part-of-ispc-1.13.patch
new file mode 100644
index 000000000000..5d0b02f3b2e5
--- /dev/null
+++ b/srcpkgs/embree/patches/uintNN-is-part-of-ispc-1.13.patch
@@ -0,0 +1,12 @@
+Index: embree-2.17.7/tutorials/common/common.isph
+===================================================================
+--- embree-2.17.7.orig/tutorials/common/common.isph
++++ embree-2.17.7/tutorials/common/common.isph
+@@ -16,7 +16,3 @@
+ 
+ #pragma once
+ 
+-typedef unsigned int64 uint64;
+-typedef unsigned int32 uint32;
+-typedef unsigned int16 uint16;
+-typedef unsigned int8  uint8;
diff --git a/srcpkgs/embree/template b/srcpkgs/embree/template
index 0bc72f46b6d8..849ec3c26c1d 100644
--- a/srcpkgs/embree/template
+++ b/srcpkgs/embree/template
@@ -4,6 +4,7 @@ version=2.17.7
 revision=2
 archs="x86_64"
 build_style=cmake
+configure_args="-DTBB_ROOT=/usr -DEMBREE_IGNORE_CMAKE_CXX_FLAGS=OFF"
 hostmakedepends="ispc"
 makedepends="libfreeglut-devel libXmu-devel tbb-devel MesaLib-devel libpng-devel
  libopenexr-devel libjpeg-turbo-devel libmagick-devel"
@@ -13,10 +14,7 @@ license="Apache-2.0"
 homepage="https://embree.github.io/"
 distfiles="https://github.com/$pkgname/$pkgname/archive/v$version.tar.gz"
 checksum=c0694f287fa1fbb382aba3a895702e248d92f7e89c0e5f64aefee965482ec04c
-
-nopie=y
-
-configure_args="-DTBB_ROOT=/usr -DENABLE_TUTORIALS=OFF"
+patch_args=-Np1
 
 embree-devel_package() {
 	depends="${sourcepkg}>=${version}_${revision}"

From 9bb1bbe9f5bbc7f837dc83583cc4ceec4df18077 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: Wed, 17 Mar 2021 07:35:19 +0700
Subject: [PATCH 05/64] ettercap: remove libressl patch, CMAKE_BUILD_TYPE=None

---
 .../patches/allow-build-type-none.patch       | 24 ++++++++++++++
 srcpkgs/ettercap/patches/libressl.patch       | 31 -------------------
 srcpkgs/ettercap/template                     |  9 ++++--
 3 files changed, 31 insertions(+), 33 deletions(-)
 create mode 100644 srcpkgs/ettercap/patches/allow-build-type-none.patch
 delete mode 100644 srcpkgs/ettercap/patches/libressl.patch

diff --git a/srcpkgs/ettercap/patches/allow-build-type-none.patch b/srcpkgs/ettercap/patches/allow-build-type-none.patch
new file mode 100644
index 000000000000..324d75086b05
--- /dev/null
+++ b/srcpkgs/ettercap/patches/allow-build-type-none.patch
@@ -0,0 +1,24 @@
+Index: ettercap-0.8.3.1/CMakeLists.txt
+===================================================================
+--- ettercap-0.8.3.1.orig/CMakeLists.txt
++++ ettercap-0.8.3.1/CMakeLists.txt
+@@ -22,19 +22,6 @@ option(LIBRARY_BUILD "Build for libetter
+ option(INSTALL_DESKTOP "Install ettercap desktop files" ON)
+ 
+ 
+-set(VALID_BUILD_TYPES Debug Release RelWithDebInfo)
+-
+-if(NOT CMAKE_BUILD_TYPE)
+-  # Default to using "Release" as our build type.
+-  set(CMAKE_BUILD_TYPE "Release" CACHE STRING
+-    "Choose the type of build, options are: ${VALID_BUILD_TYPES}." FORCE)
+-endif()
+-list(FIND VALID_BUILD_TYPES ${CMAKE_BUILD_TYPE} contains_valid)
+-if(contains_valid EQUAL -1)
+-  message(FATAL_ERROR "Unknown CMAKE_BUILD_TYPE: '${CMAKE_BUILD_TYPE}'. Valid options are: ${VALID_BUILD_TYPES}")
+-endif()
+-unset(contains_valid)
+-
+ include(CMakeDependentOption)
+ 
+ # If SYSTEM_LIBS is set to off, then all SYSTEM_* options will be
diff --git a/srcpkgs/ettercap/patches/libressl.patch b/srcpkgs/ettercap/patches/libressl.patch
deleted file mode 100644
index 15e0d3c1c9e7..000000000000
--- a/srcpkgs/ettercap/patches/libressl.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From b2f7634c9dbc0ef68640f0571787d92300e9f9f9 Mon Sep 17 00:00:00 2001
-From: Stefan Strogin <stefan@steils.org>
-Date: Sat, 15 Aug 2020 07:18:31 +0300
-Subject: [PATCH] ec_sslwrap: fix compilation with LibreSSL
-
-Disable taking over SNI extension from ClientHello and SSL configuration
-operations until LibreSSL supports the required API.
-
-Fixes: https://github.com/Ettercap/ettercap/issues/1068
----
- src/ec_sslwrap.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git src/ec_sslwrap.c src/ec_sslwrap.c
-index b9f26a142..1e4c24fc1 100644
---- src/ec_sslwrap.c
-+++ src/ec_sslwrap.c
-@@ -71,11 +71,11 @@
- #define TLS_server_method SSLv23_server_method
- #endif
- 
--#if (OPENSSL_VERSION_NUMBER >= 0x10100000L)
-+#if (OPENSSL_VERSION_NUMBER >= 0x10100000L) && !defined(LIBRESSL_VERSION_NUMBER)
- #define HAVE_OPENSSL_1_1_0
- #endif
- 
--#if (OPENSSL_VERSION_NUMBER >= 0x10101000L)
-+#if (OPENSSL_VERSION_NUMBER >= 0x10101000L) && !defined(LIBRESSL_VERSION_NUMBER)
- #define HAVE_OPENSSL_1_1_1
- #endif
- 
diff --git a/srcpkgs/ettercap/template b/srcpkgs/ettercap/template
index 7fe4c340a079..611b4e9aded7 100644
--- a/srcpkgs/ettercap/template
+++ b/srcpkgs/ettercap/template
@@ -3,8 +3,8 @@ pkgname=ettercap
 version=0.8.3.1
 revision=2
 build_style=cmake
-configure_args="-DENABLE_GTK=OFF"
-hostmakedepends="flex"
+configure_args="-DENABLE_GTK=OFF -DBUNDLED_LIBS=OFF"
+hostmakedepends="flex pkg-config"
 makedepends="geoip-devel ncurses-devel openssl-devel libcurl-devel
  libltdl-devel libnet-devel libpcap-devel pcre-devel"
 conf_files="/etc/${pkgname}/etter.conf"
@@ -15,5 +15,10 @@ homepage="http://ettercap.github.com/ettercap/"
 distfiles="https://github.com/Ettercap/ettercap/archive/v${version}.tar.gz"
 checksum=d0c3ef88dfc284b61d3d5b64d946c1160fd04276b448519c1ae4438a9cdffaf3
 lib32disabled=yes
+patch_args=-Np1
 
 CFLAGS="-fcommon"
+
+post_extract() {
+	rm -rf bundled_deps
+}

From 92bffa64b0bab7210b0e48ead4e0b51de124e3b2 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: Wed, 17 Mar 2021 08:27:10 +0700
Subject: [PATCH 06/64] injeqt: disable coverage

---
 srcpkgs/injeqt/template | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/injeqt/template b/srcpkgs/injeqt/template
index 1e5777fc0f18..78eba09a0249 100644
--- a/srcpkgs/injeqt/template
+++ b/srcpkgs/injeqt/template
@@ -3,7 +3,8 @@ pkgname=injeqt
 version=1.2.0
 revision=2
 build_style=cmake
-hostmakedepends="pkg-config"
+configure_args="-DDISABLE_COVERAGE=ON"
+hostmakedepends="pkg-config qt5-qmake qt5-host-tools"
 makedepends="qt5-devel"
 short_desc="Dependency injection framework for Qt"
 maintainer="Jürgen Buchmüller <pullmoll@t-online.de>"
@@ -12,9 +13,6 @@ homepage="https://github.com/vogel/injeqt/"
 distfiles="https://github.com/vogel/${pkgname}/archive/${version}.tar.gz>${pkgname}-${version}.tar.gz"
 checksum=77540cedb0b26affe993dd18124d796059e34c80a51d9ae6433fdff1860db135
 
-if [ -n "$CROSS_BUILD" ]; then
-	hostmakedepends+=" qt5-host-tools qt5-devel"
-fi
 CXXFLAGS="-fno-lifetime-dse -Wno-error=cast-align"
 
 injeqt-devel_package() {

From 2b7b532cd36bc2eded2bc375bede1c1e68a46425 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: Wed, 17 Mar 2021 22:26:37 +0700
Subject: [PATCH 07/64] kindd: build with CMAKE_BUILD_TYPE=None

---
 srcpkgs/kindd/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/kindd/template b/srcpkgs/kindd/template
index e634b0f69bf6..4416041de58c 100644
--- a/srcpkgs/kindd/template
+++ b/srcpkgs/kindd/template
@@ -15,7 +15,7 @@ distfiles="${homepage}/archive/${version}.tar.gz"
 checksum=e596f1b1577ff3e83a779e6181252ae2f09731f513d17dd6b95cbc2cf204654f
 
 do_install() {
-	vbin release/kindd
+	vbin build/core/kindd
 	vinstall assets/appconf/kindd.svg 644 usr/share/pixmaps
 	vinstall assets/appconf/kindd.desktop 644 usr/share/applications
 }

From cf86cccf5f50b71c77a2afd19a559cc6104052c1 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: Thu, 18 Mar 2021 23:58:53 +0700
Subject: [PATCH 08/64] occt: allow CMAKE_BUILD_TYPE=None

---
 srcpkgs/occt/patches/cmake-build-type-none.patch | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 srcpkgs/occt/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/occt/patches/cmake-build-type-none.patch b/srcpkgs/occt/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..acb06fb55766
--- /dev/null
+++ b/srcpkgs/occt/patches/cmake-build-type-none.patch
@@ -0,0 +1,13 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -4,7 +4,7 @@ set (CMAKE_MODULE_PATH "${CMAKE_SOURCE_D
+ 
+ set (CMAKE_SUPPRESS_REGENERATION TRUE)
+ 
+-set (CMAKE_CONFIGURATION_TYPES Release Debug RelWithDebInfo CACHE INTERNAL "" FORCE)
++set (CMAKE_CONFIGURATION_TYPES None Release Debug RelWithDebInfo CACHE INTERNAL "" FORCE)
+ 
+ # macro: include patched file if it exists
+ macro (OCCT_INCLUDE_CMAKE_FILE BEING_INCLUDED_FILE)

From 171a154a92a9f35b5a665ef83be98ec2d82af395 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: Fri, 19 Mar 2021 23:07:05 +0700
Subject: [PATCH 09/64] renderdoc: devendor zstd, lz4

---
 .../patches/build-type-none-is-release.patch  | 12 ++++
 .../renderdoc/patches/qmake-no-rpath.patch    | 13 ++++
 .../renderdoc/patches/unvendor-zstd-lz4.patch | 68 +++++++++++++++++++
 srcpkgs/renderdoc/template                    | 15 ++--
 4 files changed, 99 insertions(+), 9 deletions(-)
 create mode 100644 srcpkgs/renderdoc/patches/build-type-none-is-release.patch
 create mode 100644 srcpkgs/renderdoc/patches/qmake-no-rpath.patch
 create mode 100644 srcpkgs/renderdoc/patches/unvendor-zstd-lz4.patch

diff --git a/srcpkgs/renderdoc/patches/build-type-none-is-release.patch b/srcpkgs/renderdoc/patches/build-type-none-is-release.patch
new file mode 100644
index 000000000000..f16b944bc12c
--- /dev/null
+++ b/srcpkgs/renderdoc/patches/build-type-none-is-release.patch
@@ -0,0 +1,12 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -315,6 +315,7 @@ set(RELEASE_MODE 0)
+ 
+ if(cmake_build_type_lower STREQUAL "release" OR
+    cmake_build_type_lower STREQUAL "relwithdebinfo" OR
++   cmake_build_type_lower STREQUAL "none" OR
+    cmake_build_type_lower STREQUAL "minsizerel")
+     add_definitions(-D_RELEASE)
+     message(STATUS "Building RenderDoc in Release mode: ${CMAKE_BUILD_TYPE}")
diff --git a/srcpkgs/renderdoc/patches/qmake-no-rpath.patch b/srcpkgs/renderdoc/patches/qmake-no-rpath.patch
new file mode 100644
index 000000000000..6e6325c53555
--- /dev/null
+++ b/srcpkgs/renderdoc/patches/qmake-no-rpath.patch
@@ -0,0 +1,13 @@
+Index: qrenderdoc/CMakeLists.txt
+===================================================================
+--- qrenderdoc/CMakeLists.txt.orig
++++ qrenderdoc/CMakeLists.txt
+@@ -144,7 +144,7 @@ endif()
+ # and finding dependencies from the cmake build
+ file(WRITE
+      ${CMAKE_BINARY_DIR}/qrenderdoc/qrenderdoc_cmake.pri
+-     "CONFIG+=${QMAKE_CONFIG}\n"
++     "CONFIG+=${QMAKE_CONFIG} no_qt_rpath\n"
+      "\n"
+      "QMAKE_CC=${CMAKE_C_COMPILER}\n"
+      "QMAKE_CXX=${CMAKE_CXX_COMPILER}\n"
diff --git a/srcpkgs/renderdoc/patches/unvendor-zstd-lz4.patch b/srcpkgs/renderdoc/patches/unvendor-zstd-lz4.patch
new file mode 100644
index 000000000000..d4003ded9161
--- /dev/null
+++ b/srcpkgs/renderdoc/patches/unvendor-zstd-lz4.patch
@@ -0,0 +1,68 @@
+Index: renderdoc/CMakeLists.txt
+===================================================================
+--- renderdoc/CMakeLists.txt.orig
++++ renderdoc/CMakeLists.txt
+@@ -213,54 +213,10 @@ set(sources
+     3rdparty/pugixml/pugixml.cpp
+     3rdparty/pugixml/pugixml.hpp
+     3rdparty/pugixml/pugiconfig.hpp
+-    3rdparty/lz4/lz4.c
+-    3rdparty/lz4/lz4.h
+     3rdparty/miniz/miniz.c
+     3rdparty/miniz/miniz.h
+     3rdparty/superluminal/superluminal.cpp
+     3rdparty/superluminal/superluminal.h
+-    3rdparty/zstd/bitstream.h
+-    3rdparty/zstd/compiler.h
+-    3rdparty/zstd/cpu.h
+-    3rdparty/zstd/debug.c
+-    3rdparty/zstd/debug.h
+-    3rdparty/zstd/entropy_common.c
+-    3rdparty/zstd/error_private.c
+-    3rdparty/zstd/error_private.h
+-    3rdparty/zstd/fse.h
+-    3rdparty/zstd/fse_compress.c
+-    3rdparty/zstd/fse_decompress.c
+-    3rdparty/zstd/hist.c
+-    3rdparty/zstd/hist.h
+-    3rdparty/zstd/huf.h
+-    3rdparty/zstd/huf_compress.c
+-    3rdparty/zstd/huf_decompress.c
+-    3rdparty/zstd/mem.h
+-    3rdparty/zstd/pool.c
+-    3rdparty/zstd/pool.h
+-    3rdparty/zstd/threading.c
+-    3rdparty/zstd/threading.h
+-    3rdparty/zstd/xxhash.c
+-    3rdparty/zstd/xxhash.h
+-    3rdparty/zstd/zstd.h
+-    3rdparty/zstd/zstd_common.c
+-    3rdparty/zstd/zstd_compress.c
+-    3rdparty/zstd/zstd_compress_internal.h
+-    3rdparty/zstd/zstd_decompress.c
+-    3rdparty/zstd/zstd_double_fast.c
+-    3rdparty/zstd/zstd_double_fast.h
+-    3rdparty/zstd/zstd_errors.h
+-    3rdparty/zstd/zstd_fast.c
+-    3rdparty/zstd/zstd_fast.h
+-    3rdparty/zstd/zstd_internal.h
+-    3rdparty/zstd/zstd_lazy.c
+-    3rdparty/zstd/zstd_lazy.h
+-    3rdparty/zstd/zstd_ldm.c
+-    3rdparty/zstd/zstd_ldm.h
+-    3rdparty/zstd/zstd_opt.c
+-    3rdparty/zstd/zstd_opt.h
+-    3rdparty/zstd/zstdmt_compress.c
+-    3rdparty/zstd/zstdmt_compress.h
+     3rdparty/stb/stb_image.h
+     3rdparty/stb/stb_image_write.h
+     3rdparty/stb/stb_image_resize.h
+@@ -271,6 +227,8 @@ set(sources
+     3rdparty/tinyfiledialogs/tinyfiledialogs.c
+     3rdparty/tinyfiledialogs/tinyfiledialogs.h)
+ 
++list(APPEND RDOC_LIBRARIES -llz4 -lzstd)
++
+ if(ANDROID)
+     list(APPEND sources
+         data/embedded_files.h
diff --git a/srcpkgs/renderdoc/template b/srcpkgs/renderdoc/template
index 7240e9ebc307..4615d45c52c9 100644
--- a/srcpkgs/renderdoc/template
+++ b/srcpkgs/renderdoc/template
@@ -1,13 +1,14 @@
 # Template file for 'renderdoc'
 pkgname=renderdoc
 version=1.12
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DENABLE_GL=ON -DENABLE_GLES=ON -DENABLE_QRENDERDOC=ON
  -DENABLE_RENDERDOCCMD=ON -DENABLE_VULKAN=ON -DENABLE_XCB=ON -DENABLE_XLIB=ON
  -DENABLE_PYRENDERDOC=ON"
-hostmakedepends="bison autoconf automake pkg-config python3"
+hostmakedepends="bison autoconf automake pkg-config python3 swig"
 makedepends="libX11-devel libxcb-devel xcb-util-keysyms-devel qt5-devel
+ libzstd-devel liblz4-devel
  qt5-svg-devel qt5-x11extras-devel pcre-devel python3-devel"
 short_desc="Stand-alone graphics debugging tool for Vulkan and OpenGL"
 maintainer="Urs Schulz <voidpkgs@ursschulz.de>"
@@ -19,19 +20,14 @@ checksum=4dece1b4cb859a76533b28fcd50e17321acfaa81c3435500a006c4a5ba15fddb
 if [ "$XBPS_TARGET_LIBC" = musl ]; then
 	makedepends+=" libexecinfo-devel"
 	LDLIBS="-lexecinfo"
+	broken="uses RTLD_DL_LINKMAP, RTLD_DEEPBIND, _r_debug"
 fi
 
 if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
 	makedepends+=" libatomic-devel"
 fi
 
-case "$XBPS_TARGET_MACHINE" in
-	*-musl) broken="uses RTLD_DL_LINKMAP, RTLD_DEEPBIND, _r_debug" ;;
-esac
-
-if [ "$CROSS_BUILD" ]; then
-	broken="Cross-compilation can't find python3 interpreter"
-fi
+nocross="Cross-compilation can't find python3 interpreter"
 
 post_patch() {
 	[ -z "$XBPS_TARGET_NO_ATOMIC8" ] && return 0
@@ -40,4 +36,5 @@ post_patch() {
 
 post_install() {
 	vlicense LICENSE.md
+	vlicense docs/credits_acknowledgements.rst
 }

From 32b23e957a268ba1fb7e8928f857d307ffa17d22 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: Sat, 20 Mar 2021 00:47:52 +0700
Subject: [PATCH 10/64] python3-occ: build with CMAKE_BUILD_TYPE=None

---
 srcpkgs/python3-occ/template | 1 +
 1 file changed, 1 insertion(+)

diff --git a/srcpkgs/python3-occ/template b/srcpkgs/python3-occ/template
index 705f37457943..3ea0ef5e6387 100644
--- a/srcpkgs/python3-occ/template
+++ b/srcpkgs/python3-occ/template
@@ -5,6 +5,7 @@ revision=1
 archs="i686* x86_64* armv7l* aarch64* ppc*"
 wrksrc="pythonocc-core-${version}"
 build_style=cmake
+configure_args="-DPYTHONOCC_BUILD_TYPE=None -DCMAKE_BUILD_TYPE=None"
 hostmakedepends="python3 swig"
 makedepends="python3-devel occt-devel freetype-devel swig"
 depends="python3 occt freetype"

From 8f22755805af2d5236a09f4e74855f794774c865 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: Fri, 19 Mar 2021 23:38:10 +0700
Subject: [PATCH 11/64] widelands: allow CMAKE_BUILD_TYPE=None

---
 srcpkgs/widelands-data                        |  1 -
 .../patches/cmake-build-type-none.patch       | 63 +++++++++++++++++++
 .../widelands/patches/fix-install-path.patch  | 40 ++++++++++++
 srcpkgs/widelands/template                    | 21 +------
 4 files changed, 105 insertions(+), 20 deletions(-)
 delete mode 120000 srcpkgs/widelands-data
 create mode 100644 srcpkgs/widelands/patches/cmake-build-type-none.patch
 create mode 100644 srcpkgs/widelands/patches/fix-install-path.patch

diff --git a/srcpkgs/widelands-data b/srcpkgs/widelands-data
deleted file mode 120000
index e9fbf89517f2..000000000000
--- a/srcpkgs/widelands-data
+++ /dev/null
@@ -1 +0,0 @@
-widelands
\ No newline at end of file
diff --git a/srcpkgs/widelands/patches/cmake-build-type-none.patch b/srcpkgs/widelands/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..3d210854741b
--- /dev/null
+++ b/srcpkgs/widelands/patches/cmake-build-type-none.patch
@@ -0,0 +1,63 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -202,7 +202,7 @@ elseif(CMAKE_BUILD_TYPE STREQUAL "RelWit
+   set(WL_DEBUG_FLAGS "-DNDEBUG -DNOPARACHUTE")
+   option(OPTION_ASAN "Build with AddressSanitizer" ON)
+ else()
+-  message(FATAL_ERROR "Unknown CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
++  set(WL_DEBUG_FLAGS "-DNDEBUG -DNOPARACHUTE")
+ endif()
+ 
+ wl_add_flag(WL_GENERIC_CXX_FLAGS "-std=c++11")
+@@ -353,7 +353,7 @@ endif (OPTION_BUILD_TESTS)
+ install (
+   FILES ${CMAKE_CURRENT_BINARY_DIR}/VERSION
+   DESTINATION ${WL_INSTALL_BASEDIR}
+-  CONFIGURATIONS Debug;Release
++  CONFIGURATIONS Debug
+   COMPONENT CoreVersionFile
+ )
+ 
+@@ -378,7 +378,6 @@ install(
+     data/txts
+     data/world
+   DESTINATION ${WL_INSTALL_DATADIR}
+-  CONFIGURATIONS Debug;Release
+   COMPONENT CoreDataFiles
+ )
+ 
+@@ -386,7 +385,6 @@ install(
+   DIRECTORY
+     data/maps
+   DESTINATION ${WL_INSTALL_DATADIR}
+-  CONFIGURATIONS Debug;Release
+   COMPONENT MapFiles
+ )
+ 
+@@ -395,7 +393,6 @@ install(
+     data/music
+     data/sound
+   DESTINATION ${WL_INSTALL_DATADIR}
+-  CONFIGURATIONS Debug;Release
+   COMPONENT MusicFiles
+ )
+ 
+@@ -405,7 +402,7 @@ install(
+     CREDITS
+     ChangeLog
+   DESTINATION ${WL_INSTALL_BASEDIR}
+-  CONFIGURATIONS Debug;Release
++  CONFIGURATIONS Debug
+   COMPONENT CoreLicenseFiles
+ )
+ 
+@@ -424,7 +421,6 @@ install(
+   DIRECTORY
+     ${CMAKE_CURRENT_BINARY_DIR}/locale/
+   DESTINATION ${WL_INSTALL_DATADIR}/locale
+-  CONFIGURATIONS Debug;Release
+   COMPONENT CoreLanguageFiles
+ )
+ 
diff --git a/srcpkgs/widelands/patches/fix-install-path.patch b/srcpkgs/widelands/patches/fix-install-path.patch
new file mode 100644
index 000000000000..6bb461389f03
--- /dev/null
+++ b/srcpkgs/widelands/patches/fix-install-path.patch
@@ -0,0 +1,40 @@
+Index: cmake/WlFunctions.cmake
+===================================================================
+--- cmake/WlFunctions.cmake.orig
++++ cmake/WlFunctions.cmake
+@@ -289,5 +289,5 @@ function(wl_binary NAME)
+ 
+   #Quoting the CMake documentation on DESTINATION:
+   #"If a relative path is given it is interpreted relative to the value of CMAKE_INSTALL_PREFIX"
+-  install(TARGETS ${NAME} DESTINATION "." COMPONENT ExecutableFiles)
++  install(TARGETS ${NAME} DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT ExecutableFiles)
+ endfunction()
+Index: xdg/CMakeLists.txt
+===================================================================
+--- xdg/CMakeLists.txt.orig
++++ xdg/CMakeLists.txt
+@@ -6,19 +6,19 @@ set(XDG_APPLICATION_ID "org.widelands.Wi
+ list(APPEND icon_sizes "16" "32" "48" "64" "128")
+ foreach (icon_size ${icon_sizes})
+   #install(FILES ${CMAKE_SOURCE_DIR}/data/images/logos/wl-ico-${icon_size}.png DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/${icon_size}x${icon_size}/apps RENAME ${XDG_APPLICATION_ID}.png)
+-  install(FILES ${CMAKE_SOURCE_DIR}/data/images/logos/wl-ico-${icon_size}.png DESTINATION ../share/icons/hicolor/${icon_size}x${icon_size}/apps RENAME ${XDG_APPLICATION_ID}.png)
++  install(FILES ${CMAKE_SOURCE_DIR}/data/images/logos/wl-ico-${icon_size}.png DESTINATION share/icons/hicolor/${icon_size}x${icon_size}/apps RENAME ${XDG_APPLICATION_ID}.png)
+ endforeach (icon_size ${icon_sizes})
+ #install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${CMAKE_PROJECT_NAME}.6           DESTINATION ${CMAKE_INSTALL_MANDIR}/man6)
+-install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${CMAKE_PROJECT_NAME}.6           DESTINATION ../share/man/man6)
++install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${CMAKE_PROJECT_NAME}.6           DESTINATION share/man/man6)
+ #install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${XDG_APPLICATION_ID}.desktop     DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications)
+-install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${XDG_APPLICATION_ID}.desktop     DESTINATION ../share/applications)
++install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${XDG_APPLICATION_ID}.desktop     DESTINATION share/applications)
+ #install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${XDG_APPLICATION_ID}.appdata.xml DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/metainfo)
+-install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${XDG_APPLICATION_ID}.appdata.xml DESTINATION ../share/metainfo)
++install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${XDG_APPLICATION_ID}.appdata.xml DESTINATION share/metainfo)
+ 
+ find_program(GTK_UPDATE_ICON_CACHE NAMES gtk-update-icon-cache)
+ if (GTK_UPDATE_ICON_CACHE)
+   #install(CODE "execute_process (COMMAND ${GTK_UPDATE_ICON_CACHE} -t -f ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor ||: )")
+-  install(CODE "execute_process (COMMAND ${GTK_UPDATE_ICON_CACHE} -t -f ${CMAKE_INSTALL_PREFIX}/../share/icons/hicolor ||: )")
++  install(CODE "execute_process (COMMAND ${GTK_UPDATE_ICON_CACHE} -t -f ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor ||: )")
+ else (GTK_UPDATE_ICON_CACHE)
+   message(WARNING "gtk-update-icon-cache not found!")
+ endif (GTK_UPDATE_ICON_CACHE)
diff --git a/srcpkgs/widelands/template b/srcpkgs/widelands/template
index 6cee85087ea7..cfa2c10993e0 100644
--- a/srcpkgs/widelands/template
+++ b/srcpkgs/widelands/template
@@ -1,7 +1,7 @@
 # Template file for 'widelands'
 pkgname=widelands
 version=21
-revision=3
+revision=4
 wrksrc="${pkgname}-build${version}"
 build_style=cmake
 configure_args="-DOPENGL_INCLUDE_DIR=${XBPS_CROSS_BASE}/usr/include
@@ -10,13 +10,13 @@ hostmakedepends="python3 pkg-config gettext"
 makedepends="boost-devel icu-devel minizip-devel gettext-devel
  glu-devel glew-devel SDL2-devel SDL2_gfx-devel SDL2_image-devel
  SDL2_net-devel SDL2_mixer-devel SDL2_ttf-devel"
-depends="${pkgname}-data-${version}_${revision}"
 short_desc="Real-time strategy game"
 maintainer="Jürgen Buchmüller <pullmoll@t-online.de>"
 license="GPL-2.0-or-later"
 homepage="http://www.widelands.org/"
 distfiles="https://github.com/widelands/widelands/archive/build${version}.tar.gz>${pkgname}-${version}.tar.gz"
 checksum=601e0e4c6f91b3fb0ece2cd1b83ecfb02344a1b9194fbb70ef3f70e06994e357
+replaces="widelands-data>=0"
 
 CXXFLAGS="-DU_USING_ICU_NAMESPACE=1"
 
@@ -29,22 +29,5 @@ if [ "$CROSS_BUILD" ]; then
 fi
 
 post_install() {
-	# For some reason the binary is installed as /usr/widelands - move it
-	vmkdir usr/bin
-	mv ${DESTDIR}/usr/${pkgname} ${DESTDIR}/usr/bin
-	vmkdir usr/share
-	mv ${DESTDIR}/share/* ${DESTDIR}/usr/share/
-	rmdir ${DESTDIR}/share
-
-	# Remove files not needed in the package
-	rm -f ${DESTDIR}/usr/COPYING ${DESTDIR}/usr/CREDITS ${DESTDIR}/usr/ChangeLog ${DESTDIR}/usr/VERSION
-
 	vinstall ${FILESDIR}/${pkgname}.desktop 644 usr/share/applications
 }
-
-widelands-data_package() {
-	short_desc+=" - data files"
-	pkg_install() {
-		vmove usr/share/widelands
-	}
-}

From ff6a2d313b3b823d3d590e83ed11bcd3f8c386f8 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: Sat, 20 Mar 2021 09:49:25 +0700
Subject: [PATCH 12/64] zziplib: fix SONAME when build with
 -DCMAKE_BUILD_TYPE=None

---
 .../cmake-build-type-none-soname.patch        | 35 +++++++++++++++++++
 srcpkgs/zziplib/template                      |  1 +
 2 files changed, 36 insertions(+)
 create mode 100644 srcpkgs/zziplib/patches/cmake-build-type-none-soname.patch

diff --git a/srcpkgs/zziplib/patches/cmake-build-type-none-soname.patch b/srcpkgs/zziplib/patches/cmake-build-type-none-soname.patch
new file mode 100644
index 000000000000..2d31b5b8a46a
--- /dev/null
+++ b/srcpkgs/zziplib/patches/cmake-build-type-none-soname.patch
@@ -0,0 +1,35 @@
+Index: zziplib-0.13.72/zzip/CMakeLists.txt
+===================================================================
+--- zziplib-0.13.72.orig/zzip/CMakeLists.txt
++++ zziplib-0.13.72/zzip/CMakeLists.txt
+@@ -190,15 +190,18 @@ target_include_directories (libzzipmmapp
+ endif()
+ 
+ set_target_properties(libzzip PROPERTIES OUTPUT_NAME "zzip" RELEASE_POSTFIX "-${RELNUM}")
++set_target_properties(libzzip PROPERTIES OUTPUT_NAME "zzip" NONE_POSTFIX "-${RELNUM}")
+ SET_TARGET_PROPERTIES(libzzip PROPERTIES VERSION ${VERNUM}.${FIXNUM} SOVERSION ${VERNUM})
+ 
+ if(ZZIPFSEEKO)
+ set_target_properties(libzzipfseeko PROPERTIES OUTPUT_NAME "zzipfseeko" RELEASE_POSTFIX "-${RELNUM}")
++set_target_properties(libzzipfseeko PROPERTIES OUTPUT_NAME "zzipfseeko" NONE_POSTFIX "-${RELNUM}")
+ SET_TARGET_PROPERTIES(libzzipfseeko PROPERTIES VERSION ${VERNUM}.${FIXNUM} SOVERSION ${VERNUM})
+ endif()
+ 
+ if(ZZIPMMAPPED)
+ set_target_properties(libzzipmmapped PROPERTIES OUTPUT_NAME "zzipmmapped" RELEASE_POSTFIX "-${RELNUM}")
++set_target_properties(libzzipmmapped PROPERTIES OUTPUT_NAME "zzipmmapped" NONE_POSTFIX "-${RELNUM}")
+ SET_TARGET_PROPERTIES(libzzipmmapped PROPERTIES VERSION ${VERNUM}.${FIXNUM} SOVERSION ${VERNUM})
+ endif()
+ 
+Index: zziplib-0.13.72/zzipwrap/CMakeLists.txt
+===================================================================
+--- zziplib-0.13.72.orig/zzipwrap/CMakeLists.txt
++++ zziplib-0.13.72/zzipwrap/CMakeLists.txt
+@@ -49,6 +49,7 @@ target_link_libraries(libzzipwrap libzzi
+ target_include_directories(libzzipwrap PRIVATE "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}")
+ 
+ set_target_properties(libzzipwrap PROPERTIES OUTPUT_NAME "zzipwrap" RELEASE_POSTFIX "-${RELNUM}")
++set_target_properties(libzzipwrap PROPERTIES OUTPUT_NAME "zzipwrap" NONE_POSTFIX "-${RELNUM}")
+ SET_TARGET_PROPERTIES(libzzipwrap PROPERTIES VERSION ${VERNUM}.${FIXNUM} SOVERSION ${VERNUM})
+ set_target_properties(libzzipwrap PROPERTIES DEFINE_SYMBOL "libzzip_EXPORTS")
+ 
diff --git a/srcpkgs/zziplib/template b/srcpkgs/zziplib/template
index ab5af234af62..2026f3e4a521 100644
--- a/srcpkgs/zziplib/template
+++ b/srcpkgs/zziplib/template
@@ -12,6 +12,7 @@ homepage="https://github.com/gdraheim/zziplib"
 changelog="https://raw.githubusercontent.com/gdraheim/zziplib/master/ChangeLog"
 distfiles="https://github.com/gdraheim/zziplib/archive/v${version}.tar.gz"
 checksum=93ef44bf1f1ea24fc66080426a469df82fa631d13ca3b2e4abaeab89538518dc
+patch_args=-Np1
 
 if [ "$CROSS_BUILD" ]; then
 	configure_args+=" -DZZIPTEST=OFF"

From 683601ccac10d3a34de4da8da7b8b1ff52c640a1 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, 21 Mar 2021 15:28:04 +0700
Subject: [PATCH 13/64] mellowplayer: fix build

---
 srcpkgs/mellowplayer/patches/no-werror.patch | 13 +++++++++++++
 srcpkgs/mellowplayer/template                | 13 +++++++------
 2 files changed, 20 insertions(+), 6 deletions(-)
 create mode 100644 srcpkgs/mellowplayer/patches/no-werror.patch

diff --git a/srcpkgs/mellowplayer/patches/no-werror.patch b/srcpkgs/mellowplayer/patches/no-werror.patch
new file mode 100644
index 000000000000..7e678453a123
--- /dev/null
+++ b/srcpkgs/mellowplayer/patches/no-werror.patch
@@ -0,0 +1,13 @@
+Index: MellowPlayer-3.6.6/src/3rdparty/boost/di.hpp
+===================================================================
+--- MellowPlayer-3.6.6.orig/src/3rdparty/boost/di.hpp
++++ MellowPlayer-3.6.6/src/3rdparty/boost/di.hpp
+@@ -67,7 +67,7 @@ BOOST_DI_CFG_FWD
+ #pragma clang diagnostic error "-Wundefined-internal"
+ #pragma clang diagnostic ignored "-Wmissing-field-initializers"
+ #elif defined(__GCC__)
+-#pragma GCC diagnostic error "-Wdeprecated-declarations"
++#pragma GCC diagnostic warning "-Wdeprecated-declarations"
+ #pragma GCC diagnostic push
+ #if (__GNUC__ < 6)
+ #pragma GCC diagnostic error "-Werror"
diff --git a/srcpkgs/mellowplayer/template b/srcpkgs/mellowplayer/template
index 2f8f13960ca6..cfd8a185556f 100644
--- a/srcpkgs/mellowplayer/template
+++ b/srcpkgs/mellowplayer/template
@@ -4,7 +4,7 @@ version=3.6.6
 revision=1
 wrksrc="MellowPlayer-${version}"
 build_style=cmake
-hostmakedepends="pkg-config qt5-tools qt5-qmake"
+hostmakedepends="pkg-config qt5-tools qt5-qmake qt5-host-tools"
 makedepends="qt5-declarative-devel qt5-quickcontrols2-devel
  qt5-plugin-mysql qt5-plugin-pgsql qt5-plugin-sqlite
  qt5-plugin-tds qt5-plugin-odbc
@@ -17,11 +17,12 @@ license="GPL-2.0-or-later"
 homepage="https://colinduquesnoy.gitlab.io/MellowPlayer/"
 distfiles="https://gitlab.com/ColinDuquesnoy/MellowPlayer/-/archive/${version}/MellowPlayer-${version}.tar.bz2"
 checksum=17b8b25ca6b3d27b223f8be6ad80186ae5bd17ce762eb04ecd8b0e82e687b327
+patch_args=-Np1
 
-if [ "$CROSS_BUILD" ]; then
-	hostmakedepends+=" qt5-host-tools"
+if [ "$XBPS_WORDSIZE" != "$XBPS_TARGET_WORDSIZE" ]; then
+	broken="webengine can be built only if word size matches"
 fi
 
-case "$XBPS_TARGET_MACHINE" in
-	arm*) broken="qt5-webengine not available" ;;
-esac
+if [ "$XBPS_TARGET_ENDIAN" != "le" ]; then
+	broken="webengine only supports little endian"
+fi

From 60020334799d647c47b7e3522988ef2153771c61 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, 21 Mar 2021 15:43:09 +0700
Subject: [PATCH 14/64] ispc: fix CMAKE_BUILD_TYPE=None

---
 .../ispc/patches/cmake-build-type-none.patch   | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
 create mode 100644 srcpkgs/ispc/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/ispc/patches/cmake-build-type-none.patch b/srcpkgs/ispc/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..411e353c7314
--- /dev/null
+++ b/srcpkgs/ispc/patches/cmake-build-type-none.patch
@@ -0,0 +1,18 @@
+Index: ispc-1.15.0/CMakeLists.txt
+===================================================================
+--- ispc-1.15.0.orig/CMakeLists.txt
++++ ispc-1.15.0/CMakeLists.txt
+@@ -157,13 +157,6 @@ set(OUTPUT_RELEASE Release/bin)
+ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin )
+ 
+ if(CMAKE_BUILD_TYPE)
+-    # Validate build type
+-    set(CONFIGURATION_TYPES "Debug;Release;RelWithDebInfo")
+-
+-    string(FIND "${CONFIGURATION_TYPES}" "${CMAKE_BUILD_TYPE}" MATCHED_CONFIG)
+-    if (${MATCHED_CONFIG} EQUAL -1)
+-         message(FATAL_ERROR "CMAKE_BUILD_TYPE (${CMAKE_BUILD_TYPE}) allows only the following values: ${CONFIGURATION_TYPES}")
+-    endif()
+ else(NOT CMAKE_BUILD_TYPE)
+     set(CMAKE_BUILD_TYPE "Release")
+     message(STATUS "Build type not specified: Use Release by default.")

From 2dc448572543022d1b9a9d1b7c94223afc236100 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, 21 Mar 2021 15:56:50 +0700
Subject: [PATCH 15/64] darktable: fix CMAKE_BUILD_TYPE=None

---
 .../darktable/patches/cmake-build-type-none.patch  | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
 create mode 100644 srcpkgs/darktable/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/darktable/patches/cmake-build-type-none.patch b/srcpkgs/darktable/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..7101f9c1a0e7
--- /dev/null
+++ b/srcpkgs/darktable/patches/cmake-build-type-none.patch
@@ -0,0 +1,14 @@
+Index: src/external/rawspeed/cmake/build-type.cmake
+===================================================================
+--- src/external/rawspeed/cmake/build-type.cmake.orig
++++ src/external/rawspeed/cmake/build-type.cmake
+@@ -27,9 +27,6 @@ string(TOUPPER "${RAWSPEED_SPECIAL_BUILD
+ 
+ # is this one of the known build types?
+ list (FIND CMAKE_CONFIGURATION_TYPES_UPPERCASE ${CMAKE_BUILD_TYPE_UPPERCASE} BUILD_TYPE_IS_KNOWN)
+-if (${BUILD_TYPE_IS_KNOWN} EQUAL -1)
+- message(SEND_ERROR "Unknown build type: ${CMAKE_BUILD_TYPE_UPPERCASE}. Please specify one of: ${CMAKE_CONFIGURATION_TYPES}")
+-endif()
+ 
+ # is this a special build?
+ list (FIND RAWSPEED_SPECIAL_BUILD_TYPES_UPPERCASE ${CMAKE_BUILD_TYPE_UPPERCASE} IS_SPECIAL_BUILD)

From 89f0037e1b4268045438e5592950680555172349 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, 21 Mar 2021 15:33:29 +0700
Subject: [PATCH 16/64] hedgewars: merge -data back

---
 srcpkgs/hedgewars-data                        |  1 -
 .../patches/cmake-build-type-none.patch       | 30 +++++++++++++++++++
 srcpkgs/hedgewars/template                    | 23 +++++---------
 3 files changed, 38 insertions(+), 16 deletions(-)
 delete mode 120000 srcpkgs/hedgewars-data
 create mode 100644 srcpkgs/hedgewars/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/hedgewars-data b/srcpkgs/hedgewars-data
deleted file mode 120000
index b57dc45ebadc..000000000000
--- a/srcpkgs/hedgewars-data
+++ /dev/null
@@ -1 +0,0 @@
-hedgewars
\ No newline at end of file
diff --git a/srcpkgs/hedgewars/patches/cmake-build-type-none.patch b/srcpkgs/hedgewars/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..b4e0c186717c
--- /dev/null
+++ b/srcpkgs/hedgewars/patches/cmake-build-type-none.patch
@@ -0,0 +1,30 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -54,7 +54,7 @@ option(NOVERSIONINFOUPDATE "Disable upda
+ 
+ 
+ if(BUILD_ENGINE_C AND NOT NOVIDEOREC)
+-    if((CMAKE_BUILD_TYPE STREQUAL "Release") OR (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo"))
++    if((CMAKE_BUILD_TYPE STREQUAL "Release") OR (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo") OR (CMAKE_BUILD_TYPE STREQUAL "None"))
+         message("NOTE: Video recorder support disabled. It's incompatible with BUILD_ENGINE_C")
+         set(BUILD_ENGINE_C ON CACHE STRING "Required for BUILD_ENGINE_JS" FORCE)
+     else()
+@@ -93,7 +93,7 @@ set(CPACK_PACKAGE_VERSION_MAJOR 1)
+ set(CPACK_PACKAGE_VERSION_MINOR 0)
+ set(CPACK_PACKAGE_VERSION_PATCH 0)
+ set(HEDGEWARS_PROTO_VER 59)
+-if((CMAKE_BUILD_TYPE STREQUAL "Release") OR (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo"))
++if((CMAKE_BUILD_TYPE STREQUAL "Release") OR (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo") OR (CMAKE_BUILD_TYPE STREQUAL "None"))
+     set(HEDGEWARS_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
+ else()
+     set(HEDGEWARS_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}-dev")
+@@ -114,6 +114,7 @@ include(${CMAKE_MODULE_PATH}/platform.cm
+ if(CMAKE_BUILD_TYPE)
+     if(NOT((CMAKE_BUILD_TYPE STREQUAL "Release") OR
+            (CMAKE_BUILD_TYPE STREQUAL "Debug") OR
++	   (CMAKE_BUILD_TYPE STREQUAL "None") OR
+            (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")))
+         set(CMAKE_BUILD_TYPE ${default_build_type} CACHE STRING "Build type (Debug/Release/RelWithDebInfo)" FORCE)
+         message(STATUS "Unknown build type ${CMAKE_BUILD_TYPE}, using default (${default_build_type})")
diff --git a/srcpkgs/hedgewars/template b/srcpkgs/hedgewars/template
index d2294cf572f5..f413a965ff2e 100644
--- a/srcpkgs/hedgewars/template
+++ b/srcpkgs/hedgewars/template
@@ -1,15 +1,15 @@
 # Template file for 'hedgewars'
 pkgname=hedgewars
 version=1.0.0
-revision=2
+revision=3
 wrksrc="${pkgname}-src-${version}"
 build_style=cmake
 configure_args="-DNOSERVER=1 -DDATA_INSTALL_DIR=/usr/share/${pkgname}
- -DPHYSFS_SYSTEM=1 -DCMAKE_VERBOSE_MAKEFILE=1 -DMINIMAL_FLAGS=1"
-hostmakedepends="lua51 pkg-config"
+ -DPHYSFS_SYSTEM=1 -DMINIMAL_FLAGS=1"
+hostmakedepends="lua51 pkg-config qt5-qmake qt5-host-tools"
 makedepends="ffmpeg-devel lua51-devel physfs-devel qt5-tools-devel SDL2_image-devel
  SDL2_mixer-devel SDL2_net-devel SDL2_ttf-devel"
-depends="hedgewars-data>=${version}_${revision} libfreeglut"
+depends="libfreeglut"
 short_desc="Funny turn-based artillery game, featuring fighting Hedgehogs!"
 maintainer="Jakub Skrzypnik <jot.skrzyp@gmail.com>"
 license="GPL-2.0-only"
@@ -18,10 +18,9 @@ distfiles="https://hedgewars.org/download/releases/hedgewars-src-${version}.tar.
 checksum=211634e61f2e4beecc3c98c6f749601fcd08321fda1ba969b3b3832a004f155b
 nopie_files="/usr/bin/hwengine"
 nocross="Needs investigation: fails to link hwengine"
-
-if [ -n "$CROSS_BUILD" ]; then
-	hostmakedepends+=" qt5-devel"
-fi
+replaces="hedgewars-data>=0"
+export CMAKE_GENERATOR="Unix Makefiles"
+make_cmd=make
 
 case $XBPS_TARGET_MACHINE in
 	x86_64*)
@@ -38,6 +37,7 @@ esac
 
 if [ -n "$_use_c_engine" ]; then
 	hostmakedepends+=" glew-devel libatomic-devel ghc clang"
+	makedepends+=" glew-devel libatomic-devel"
 	configure_args+=" -DBUILD_ENGINE_C=1"
 	nopie_files+=" /usr/bin/hedgewars"
 fi
@@ -56,10 +56,3 @@ pre_configure() {
 post_install() {
 	vinstall ${DESTDIR}/usr/share/hedgewars/Data/misc/hedgewars.desktop 644 usr/share/applications
 }
-
-hedgewars-data_package() {
-	short_desc+=" - data files"
-	pkg_install() {
-		vmove usr/share/hedgewars/Data
-	}
-}

From b44bb61ac2fd15650be2baaf146b7f612e45e9ad 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, 21 Mar 2021 16:41:58 +0700
Subject: [PATCH 17/64] mariadb: fix for CMAKE_BUILD_TYPE=None

---
 srcpkgs/mariadb/template | 32 ++++++++++++++------------------
 1 file changed, 14 insertions(+), 18 deletions(-)

diff --git a/srcpkgs/mariadb/template b/srcpkgs/mariadb/template
index 437ff757b383..78d5e2dbdbe8 100644
--- a/srcpkgs/mariadb/template
+++ b/srcpkgs/mariadb/template
@@ -34,35 +34,31 @@ replaces="mysql>=0"
 conf_files="/etc/mysql/my.cnf"
 system_accounts="mysql"
 mysql_homedir="/var/lib/mysql"
-CFLAGS="-w -fcommon"
+CFLAGS="-w -fcommon -DDBUG_OFF=1"
+CXXFLAGS="-DDBUG_OFF=1"
 
 pre_configure() {
 	# We need some host binaries before starting cross compilation.
 	if [ "$CROSS_BUILD" ]; then
+		mkdir -p build.native
 		# XXX still broken: jemalloc configure execs host bins.
-		CC= CXX= CPP= LD= AR= AS= RANLIB= CFLAGS= CXXFLAGS= LDFLAGS= cmake .
-		make comp_err comp_sql gen_lex_hash gen_lex_token
-		mkdir bin.host
-		cp extra/comp_err bin.host
-		cp scripts/comp_sql bin.host
-		cp sql/gen_lex_hash bin.host
-		cp sql/gen_lex_token bin.host
-		make clean
-		rm CMakeCache.txt
+		CC= CXX= CPP= LD= AR= AS= RANLIB= CFLAGS= CXXFLAGS= LDFLAGS= \
+			cmake -S . -B build.native
+		make -C build.native comp_err comp_sql gen_lex_hash gen_lex_token
 	fi
 }
 
 pre_build() {
 	if [ "$CROSS_BUILD" ]; then
 		# CMake complains if those binaries ain't in build
-		cp bin.host/comp_err ${wrksrc}/extra
-		cp bin.host/comp_err ${wrksrc}/build/extra
-		cp bin.host/comp_sql ${wrksrc}/scripts
-		cp bin.host/comp_sql ${wrksrc}/build/scripts
-		cp bin.host/gen_lex_hash ${wrksrc}/sql
-		cp bin.host/gen_lex_hash ${wrksrc}/build/sql
-		cp bin.host/gen_lex_token ${wrksrc}/sql
-		cp bin.host/gen_lex_token ${wrksrc}/build/sql
+		cp build.native/extra/comp_err ${wrksrc}/extra
+		cp build.native/extra/comp_err ${wrksrc}/build/extra
+		cp build.native/scripts/comp_sql ${wrksrc}/scripts
+		cp build.native/scripts/comp_sql ${wrksrc}/build/scripts
+		cp build.native/sql/gen_lex_hash ${wrksrc}/sql
+		cp build.native/sql/gen_lex_hash ${wrksrc}/build/sql
+		cp build.native/sql/gen_lex_token ${wrksrc}/sql
+		cp build.native/sql/gen_lex_token ${wrksrc}/build/sql
 		export PATH=${PATH}:${wrksrc}/extra:${wrksrc}/scripts:${wrksrc}/sql
 	fi
 	export LD_LIBRARY_PATH=${wrksrc}/build/storage/tokudb/ft-index/portability

From 5735a86cf720c0cb8dbd1c3957ed8b72b7d2c50e 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: Thu, 25 Mar 2021 07:58:28 +0700
Subject: [PATCH 18/64] EternalTerminal: remove -ggdb3

---
 .../EternalTerminal/patches/fix-cflags.patch    | 17 +++++++++++++++++
 srcpkgs/EternalTerminal/template                |  1 +
 2 files changed, 18 insertions(+)
 create mode 100644 srcpkgs/EternalTerminal/patches/fix-cflags.patch

diff --git a/srcpkgs/EternalTerminal/patches/fix-cflags.patch b/srcpkgs/EternalTerminal/patches/fix-cflags.patch
new file mode 100644
index 000000000000..e6fcd432f7e7
--- /dev/null
+++ b/srcpkgs/EternalTerminal/patches/fix-cflags.patch
@@ -0,0 +1,17 @@
+Index: EternalTerminal-et-v6.0.13/CMakeLists.txt
+===================================================================
+--- EternalTerminal-et-v6.0.13.orig/CMakeLists.txt
++++ EternalTerminal-et-v6.0.13/CMakeLists.txt
+@@ -26,12 +26,6 @@ if(DISABLE_CRASH_LOG)
+ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DELPP_DISABLE_DEFAULT_CRASH_HANDLING")
+ ENDIF(DISABLE_CRASH_LOG)
+ 
+-if(UNIX)
+-  # Enable debug info
+-  SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -ggdb3")
+-  SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -ggdb3")
+-endif()
+-
+ # Enable C++-11
+ set(CMAKE_CXX_STANDARD 11)
+ set(CMAKE_CXX_STANDARD_REQUIRED ON)
diff --git a/srcpkgs/EternalTerminal/template b/srcpkgs/EternalTerminal/template
index 7bac78d2ffd4..bc92e47743dd 100644
--- a/srcpkgs/EternalTerminal/template
+++ b/srcpkgs/EternalTerminal/template
@@ -13,6 +13,7 @@ homepage="https://eternalterminal.dev/"
 distfiles="https://github.com/MisterTea/EternalTerminal/archive/et-v${version}.tar.gz"
 checksum=728c3a444d666897c710e33fe473d8d289263a59574451b13aa53ec3c6ac88b3
 system_accounts="_eternal"
+patch_args=-Np1
 
 LDFLAGS="-lgflags"
 

From 75da83090a1fe2b92155b681800814596184a562 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: Thu, 25 Mar 2021 08:20:29 +0700
Subject: [PATCH 19/64] OTPClient: respect CFLAGS

---
 srcpkgs/OTPClient/patches/fix-cflags.patch | 17 +++++++++++++++++
 srcpkgs/OTPClient/template                 |  1 +
 2 files changed, 18 insertions(+)
 create mode 100644 srcpkgs/OTPClient/patches/fix-cflags.patch

diff --git a/srcpkgs/OTPClient/patches/fix-cflags.patch b/srcpkgs/OTPClient/patches/fix-cflags.patch
new file mode 100644
index 000000000000..ae70f441538f
--- /dev/null
+++ b/srcpkgs/OTPClient/patches/fix-cflags.patch
@@ -0,0 +1,17 @@
+Index: OTPClient-2.4.2/CMakeLists.txt
+===================================================================
+--- OTPClient-2.4.2.orig/CMakeLists.txt
++++ OTPClient-2.4.2/CMakeLists.txt
+@@ -11,11 +11,10 @@ option(BUILD_GUI "Build the GUI" ON)
+ option(BUILD_CLI "Build the CLI" ON)
+ 
+ set(CMAKE_C_STANDARD 11)
+-set(CMAKE_C_FLAGS "-Wall -Wextra -O3 -Wformat=2 -Wmissing-format-attribute -fstack-protector-strong -Wundef -Wmissing-format-attribute")
++set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wformat=2 -Wmissing-format-attribute -fstack-protector-strong -Wundef -Wmissing-format-attribute")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fdiagnostics-color=always -Wstrict-prototypes -Wunreachable-code")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wchar-subscripts -Wwrite-strings -Wpointer-arith -Wbad-function-cast -Wcast-align")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror=format-security -Werror=implicit-function-declaration -Wno-sign-compare")
+-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3")
+ if(CMAKE_COMPILER_IS_GNUCC)
+     set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pie -fPIE")
+ endif()
diff --git a/srcpkgs/OTPClient/template b/srcpkgs/OTPClient/template
index e8c0099850b7..f5af76e655a6 100644
--- a/srcpkgs/OTPClient/template
+++ b/srcpkgs/OTPClient/template
@@ -12,3 +12,4 @@ license="GPL-3.0-or-later"
 homepage="https://github.com/paolostivanin/OTPClient"
 distfiles="https://github.com/paolostivanin/OTPClient/archive/v${version}.tar.gz"
 checksum=74bc4312aa1cd336ca983434e3bed951c5ead327091e7708e3beb08508813495
+patch_args=-Np1

From 8a573dad4563832a5be63882e85ccfc5e21fa3a7 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: Thu, 25 Mar 2021 08:30:31 +0700
Subject: [PATCH 20/64] crex: hardening

---
 srcpkgs/crex/patches/fix-cflags.patch | 20 ++++++++++++++++++++
 srcpkgs/crex/template                 |  7 ++-----
 2 files changed, 22 insertions(+), 5 deletions(-)
 create mode 100644 srcpkgs/crex/patches/fix-cflags.patch

diff --git a/srcpkgs/crex/patches/fix-cflags.patch b/srcpkgs/crex/patches/fix-cflags.patch
new file mode 100644
index 000000000000..d191fb1e9ec0
--- /dev/null
+++ b/srcpkgs/crex/patches/fix-cflags.patch
@@ -0,0 +1,20 @@
+Index: crex-0.2.5/CMakeLists.txt
+===================================================================
+--- crex-0.2.5.orig/CMakeLists.txt
++++ crex-0.2.5/CMakeLists.txt
+@@ -13,9 +13,6 @@ endif(CCACHE_FOUND)
+ set (CMAKE_CXX_STANDARD 14)
+ set (CMAKE_CXX_STANDARD_REQUIRED ON)
+ 
+-set (CMAKE_CXX_FLAGS "-fdiagnostics-color=auto")
+-set (CMAKE_C_FLAGS "-fdiagnostics-color=auto")
+-
+ set (DEBUG_FLAGS "-Wpedantic -Wall -Wextra -Wcast-align -Wcast-qual -Wctor-dtor-privacy -Wdisabled-optimization -Wformat=2 -Winit-self -Wlogical-op -Wmissing-declarations -Wmissing-include-dirs -Wnoexcept -Wold-style-cast -Woverloaded-virtual -Wredundant-decls -Wshadow -Wsign-conversion -Wsign-promo -Wstrict-null-sentinel -Wstrict-overflow=5 -Wswitch-default -Wundef -Wno-unused -std=c++14 -g")
+ set (DEBUG_LINK_FLAGS "-fprofile-arcs -ftest-coverage -flto")
+ 
+@@ -56,4 +53,4 @@ target_link_libraries (
+   ${TARGET}
+ )
+ 
+-install (TARGETS ${TARGET} DESTINATION "/usr/local/bin")
++install (TARGETS ${TARGET} DESTINATION "/usr/bin")
diff --git a/srcpkgs/crex/template b/srcpkgs/crex/template
index a54697a93adc..2f455a0b0c72 100644
--- a/srcpkgs/crex/template
+++ b/srcpkgs/crex/template
@@ -1,7 +1,7 @@
 # Template file for 'crex'
 pkgname=crex
 version=0.2.5
-revision=1
+revision=2
 build_style=cmake
 short_desc="Explore, test, and check regular expressions in the terminal"
 maintainer="Piotr Wójcik <chocimier@tlen.pl>"
@@ -9,10 +9,7 @@ license="MIT"
 homepage="https://github.com/octobanana/crex"
 distfiles="https://github.com/octobanana/crex/archive/${version}.tar.gz"
 checksum=c6a166b7a1e696a7babeaf7c5728eece1624704a18357f827129fc95ef2ecc56
-
-pre_configure() {
-	sed -e 's|/local/|/|' -i CMakeLists.txt
-}
+patch_args=-Np1
 
 post_install() {
 	vlicense LICENSE

From ecda668710cf851e4718245351e8563769be8990 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: Thu, 25 Mar 2021 08:34:32 +0700
Subject: [PATCH 21/64] libbaseencode: hardening

---
 srcpkgs/libbaseencode/patches/fix-cflags.patch | 13 +++++++++++++
 srcpkgs/libbaseencode/template                 |  3 ++-
 2 files changed, 15 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/libbaseencode/patches/fix-cflags.patch

diff --git a/srcpkgs/libbaseencode/patches/fix-cflags.patch b/srcpkgs/libbaseencode/patches/fix-cflags.patch
new file mode 100644
index 000000000000..1bb86a0b15a4
--- /dev/null
+++ b/srcpkgs/libbaseencode/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: libbaseencode-1.0.9/CMakeLists.txt
+===================================================================
+--- libbaseencode-1.0.9.orig/CMakeLists.txt
++++ libbaseencode-1.0.9/CMakeLists.txt
+@@ -15,7 +15,7 @@ set(CMAKE_C_STANDARD 11)
+ set(BASEENCODE_HEADERS src/baseencode.h)
+ set(SOURCE_FILES src/base32.c src/base64.c)
+ 
+-set(CMAKE_C_FLAGS "-Wall -Werror -fPIC")
++set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Werror -fPIC")
+ 
+ add_library(${PROJECT_NAME} SHARED ${SOURCE_FILES})
+ 
diff --git a/srcpkgs/libbaseencode/template b/srcpkgs/libbaseencode/template
index 384a189224df..d5929ad7bb51 100644
--- a/srcpkgs/libbaseencode/template
+++ b/srcpkgs/libbaseencode/template
@@ -1,7 +1,7 @@
 # Template file for 'libbaseencode'
 pkgname=libbaseencode
 version=1.0.9
-revision=1
+revision=2
 build_style=cmake
 short_desc="Library for encoding decoding data use base32 or base64"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -9,6 +9,7 @@ license="Apache-2.0"
 homepage="https://github.com/paolostivanin/libbaseencode"
 distfiles="https://github.com/paolostivanin/libbaseencode/archive/v${version}.tar.gz"
 checksum=a183d7cf30d931b2a078d6f0ef64616b71ab26f9258e5f4e191778c7ace7175d
+patch_args=-Np1
 
 libbaseencode-devel_package() {
 	depends="libbaseencode-${version}_${revision}"

From 4982c8c6db267deb5d700ca8f87f56b274759c1a 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: Fri, 26 Mar 2021 08:46:56 +0700
Subject: [PATCH 22/64] bibletime: clean build flags

---
 srcpkgs/bibletime/patches/fix-cflags.patch | 13 +++++++++++++
 srcpkgs/bibletime/template                 |  1 +
 2 files changed, 14 insertions(+)
 create mode 100644 srcpkgs/bibletime/patches/fix-cflags.patch

diff --git a/srcpkgs/bibletime/patches/fix-cflags.patch b/srcpkgs/bibletime/patches/fix-cflags.patch
new file mode 100644
index 000000000000..480c5ca4ac1e
--- /dev/null
+++ b/srcpkgs/bibletime/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: bibletime-3.0/cmake/BTApplication.cmake
+===================================================================
+--- bibletime-3.0.orig/cmake/BTApplication.cmake
++++ bibletime-3.0/cmake/BTApplication.cmake
+@@ -41,7 +41,7 @@ IF(WIN32)
+     ADD_COMPILE_OPTIONS("/Zi")
+ ELSE()
+     ADD_COMPILE_OPTIONS(
+-        "-ggdb" "-Wall" "-Wextra"
++        "-Wall" "-Wextra" "-DNDEBUG" "-DQT_NO_DEBUG"
+         "$<$<STREQUAL:$<CONFIGURATION>,Release>:-O2>"
+         "$<$<STREQUAL:$<CONFIGURATION>,Release>:-DNDEBUG>"
+         "$<$<STREQUAL:$<CONFIGURATION>,Release>:-DQT_NO_DEBUG>"
diff --git a/srcpkgs/bibletime/template b/srcpkgs/bibletime/template
index 224881c45516..85bcc7f22f87 100644
--- a/srcpkgs/bibletime/template
+++ b/srcpkgs/bibletime/template
@@ -18,6 +18,7 @@ license="GPL-2.0-or-later"
 homepage="http://bibletime.info"
 distfiles="https://github.com/bibletime/bibletime/releases/download/v${version}/bibletime-${version}.tar.xz"
 checksum=d6beef62ad44b255e3dc4c5e89214bf01a0e85c9136073b0be12fca3d2b22622
+patch_args=-Np1
 
 pre_build() {
 	. /etc/profile.d/10_openjdk11.sh

From 1213f8e1f990cd0f68137ef10473c41a5eaee9db 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: Fri, 26 Mar 2021 08:54:25 +0700
Subject: [PATCH 23/64] boomerang: clean build flags

---
 srcpkgs/boomerang/patches/fix-cflags.patch | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
 create mode 100644 srcpkgs/boomerang/patches/fix-cflags.patch

diff --git a/srcpkgs/boomerang/patches/fix-cflags.patch b/srcpkgs/boomerang/patches/fix-cflags.patch
new file mode 100644
index 000000000000..eb59766c1c5b
--- /dev/null
+++ b/srcpkgs/boomerang/patches/fix-cflags.patch
@@ -0,0 +1,21 @@
+Index: cmake-scripts/boomerang-flags.cmake
+===================================================================
+--- cmake-scripts/boomerang-flags.cmake
++++ cmake-scripts/boomerang-flags.cmake
+@@ -104,16 +104,6 @@ endif ()
+ 
+ 
+ if (NOT MSVC)
+-    if ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
+-        BOOMERANG_ADD_COMPILE_FLAGS(-O0)
+-    elseif ("${CMAKE_BUILD_TYPE}" STREQUAL "RelWithDebInfo")
+-        # No special flags
+-    elseif ("${CMAKE_BUILD_TYPE}" STREQUAL "MinSizeRel")
+-        BOOMERANG_ADD_COMPILE_FLAGS(-Os)
+-    else () # Release
+-        BOOMERANG_ADD_COMPILE_FLAGS(-O3)
+-    endif ()
+-
+     if (BOOMERANG_ENABLE_COVERAGE)
+         set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fprofile-arcs -ftest-coverage")
+         set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage")

From fae83a69ca5e9b05bd7fdeb034f0e8920baa8fbc 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: Fri, 26 Mar 2021 08:58:11 +0700
Subject: [PATCH 24/64] catimg: don't change our build-type

---
 srcpkgs/catimg/patches/fix-cflags.patch | 12 ++++++++++++
 srcpkgs/catimg/template                 |  2 +-
 2 files changed, 13 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/catimg/patches/fix-cflags.patch

diff --git a/srcpkgs/catimg/patches/fix-cflags.patch b/srcpkgs/catimg/patches/fix-cflags.patch
new file mode 100644
index 000000000000..9b9f1074ef20
--- /dev/null
+++ b/srcpkgs/catimg/patches/fix-cflags.patch
@@ -0,0 +1,12 @@
+Index: catimg-2.7.0/CMakeLists.txt
+===================================================================
+--- catimg-2.7.0.orig/CMakeLists.txt
++++ catimg-2.7.0/CMakeLists.txt
+@@ -11,7 +11,6 @@ endif()
+ #set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wall -Wextra -g -std=c99 -Wno-unused-result")
+ #set(CMAKE_BUILD_TYPE Debug)
+ set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -Wall -Wextra -Os -std=c99 -Wno-unused-result")
+-set(CMAKE_BUILD_TYPE Release)
+ 
+ set(SRC ${PROJECT_SOURCE_DIR}/src)
+ 
diff --git a/srcpkgs/catimg/template b/srcpkgs/catimg/template
index 374351c45379..6fbc5f1d9140 100644
--- a/srcpkgs/catimg/template
+++ b/srcpkgs/catimg/template
@@ -9,7 +9,7 @@ license="MIT"
 homepage="https://github.com/posva/catimg"
 distfiles="https://github.com/posva/catimg/archive/${version}.tar.gz"
 checksum=3a6450316ff62fb07c3facb47ea208bf98f62abd02783e88c56f2a6508035139
-
+patch_args=-Np1
 CFLAGS="-fcommon"
 
 post_install() {

From 01de770c05704a74ffb1587ab0a546a4126a7e71 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: Fri, 26 Mar 2021 09:09:37 +0700
Subject: [PATCH 25/64] libcotp: fix build flags

---
 srcpkgs/libcotp/patches/fix-cflags.patch | 14 ++++++++++++++
 srcpkgs/libcotp/template                 |  1 +
 2 files changed, 15 insertions(+)
 create mode 100644 srcpkgs/libcotp/patches/fix-cflags.patch

diff --git a/srcpkgs/libcotp/patches/fix-cflags.patch b/srcpkgs/libcotp/patches/fix-cflags.patch
new file mode 100644
index 000000000000..397b3960e9f4
--- /dev/null
+++ b/srcpkgs/libcotp/patches/fix-cflags.patch
@@ -0,0 +1,14 @@
+Index: libcotp-1.2.2/CMakeLists.txt
+===================================================================
+--- libcotp-1.2.2.orig/CMakeLists.txt
++++ libcotp-1.2.2/CMakeLists.txt
+@@ -25,8 +25,7 @@ set(CMAKE_C_STANDARD 11)
+ set(COTP_HEADERS src/cotp.h)
+ set(SOURCE_FILES src/otp.c)
+ 
+-set(CMAKE_C_FLAGS "-Wall -Wextra -O3 -Wno-format-truncation -fstack-protector-strong -fPIC")
+-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3")
++set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wno-format-truncation -fstack-protector-strong -fPIC")
+ 
+ add_library(cotp SHARED ${SOURCE_FILES})
+ 
diff --git a/srcpkgs/libcotp/template b/srcpkgs/libcotp/template
index 9e147ff7deb6..88337290d1e8 100644
--- a/srcpkgs/libcotp/template
+++ b/srcpkgs/libcotp/template
@@ -11,6 +11,7 @@ license="Apache-2.0"
 homepage="https://github.com/paolostivanin/libcotp"
 distfiles="https://github.com/paolostivanin/libcotp/archive/v${version}.tar.gz"
 checksum=25b45ffa4aece5cc689503ebea7356a2f760c194f0c41805934495d2fe7165b1
+patch_args=-Np1
 
 libcotp-devel_package() {
 	depends="libcotp-${version}_${revision}"

From 41dc8700b9f6ba5e745a6b43b129cd0354327972 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: Fri, 26 Mar 2021 21:06:07 +0700
Subject: [PATCH 26/64] loudgain: hardening

---
 srcpkgs/loudgain/patches/fix-cflags.patch | 20 ++++++++++++++++++++
 srcpkgs/loudgain/template                 |  3 ++-
 2 files changed, 22 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/loudgain/patches/fix-cflags.patch

diff --git a/srcpkgs/loudgain/patches/fix-cflags.patch b/srcpkgs/loudgain/patches/fix-cflags.patch
new file mode 100644
index 000000000000..25b2c969bef4
--- /dev/null
+++ b/srcpkgs/loudgain/patches/fix-cflags.patch
@@ -0,0 +1,20 @@
+Index: loudgain-0.6.8/CMakeLists.txt
+===================================================================
+--- loudgain-0.6.8.orig/CMakeLists.txt
++++ loudgain-0.6.8/CMakeLists.txt
+@@ -69,12 +69,12 @@ TARGET_LINK_LIBRARIES(loudgain
+ )
+ 
+ SET_TARGET_PROPERTIES(loudgain PROPERTIES
+-  COMPILE_FLAGS "-Wall -pedantic -g"
++  COMPILE_FLAGS "-Wall -pedantic"
+ )
+ 
+-SET(CMAKE_C_FLAGS "-std=gnu99 -D_GNU_SOURCE")
++SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99 -D_GNU_SOURCE")
+ 
+-SET(CMAKE_CXX_FLAGS "-std=gnu++11 -D_GNU_SOURCE")
++SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11 -D_GNU_SOURCE")
+ 
+ INSTALL(TARGETS loudgain DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
+ 
diff --git a/srcpkgs/loudgain/template b/srcpkgs/loudgain/template
index f29167883439..00b2d20d27d6 100644
--- a/srcpkgs/loudgain/template
+++ b/srcpkgs/loudgain/template
@@ -1,7 +1,7 @@
 # Template file for 'loudgain'
 pkgname=loudgain
 version=0.6.8
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="pkg-config"
 makedepends="libebur128-devel taglib-devel ffmpeg-devel"
@@ -11,6 +11,7 @@ license="BSD-2-Clause"
 homepage="https://github.com/Moonbase59/loudgain"
 distfiles="https://github.com/Moonbase59/loudgain/archive/v${version}.tar.gz"
 checksum=1137c193ad941b366e87c5d84ccc95a7aa8571affc060db0bd1cf72c489aeaee
+patch_args=-Np1
 
 post_install() {
 	vlicense COPYING

From 6bf0e06ec0942f7d4a35081a00443f1a9667b4ed 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: Fri, 26 Mar 2021 21:14:31 +0700
Subject: [PATCH 27/64] masterpassword-cli: hardening

---
 srcpkgs/masterpassword-cli/patches/fix-cflags.patch | 13 +++++++++++++
 srcpkgs/masterpassword-cli/template                 |  2 +-
 2 files changed, 14 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/masterpassword-cli/patches/fix-cflags.patch

diff --git a/srcpkgs/masterpassword-cli/patches/fix-cflags.patch b/srcpkgs/masterpassword-cli/patches/fix-cflags.patch
new file mode 100644
index 000000000000..a303f6954544
--- /dev/null
+++ b/srcpkgs/masterpassword-cli/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: platform-independent/cli-c/CMakeLists.txt
+===================================================================
+--- platform-independent/cli-c/CMakeLists.txt.orig
++++ platform-independent/cli-c/CMakeLists.txt
+@@ -15,8 +15,6 @@ option( BUILD_MPW_BENCH         "C CLI M
+ option( BUILD_MPW_TESTS         "C Master Password algorithm test suite (needs: mpw_sodium, mpw_xml)." OFF )
+ 
+ # Default build flags.
+-set( CMAKE_BUILD_TYPE           Release )
+-set( CMAKE_C_FLAGS              "-O3" )
+ 
+ # Version.
+ file( READ                      "VERSION" mpw_version )
diff --git a/srcpkgs/masterpassword-cli/template b/srcpkgs/masterpassword-cli/template
index ee2b8d41ae4b..8536228a602b 100644
--- a/srcpkgs/masterpassword-cli/template
+++ b/srcpkgs/masterpassword-cli/template
@@ -1,7 +1,7 @@
 # Template file for 'masterpassword-cli'
 pkgname=masterpassword-cli
 version=2.6
-revision=5
+revision=6
 wrksrc=MasterPassword-${version}-cli-3
 build_wrksrc=platform-independent/cli-c
 build_style=cmake

From 60c4314fbff51a6facc93a4ffbfe010fbdece0f3 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: Fri, 26 Mar 2021 21:20:13 +0700
Subject: [PATCH 28/64] msg2: hardening

---
 srcpkgs/msg2/patches/fix-cflags.patch | 13 +++++++++++++
 srcpkgs/msg2/template                 |  2 +-
 2 files changed, 14 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/msg2/patches/fix-cflags.patch

diff --git a/srcpkgs/msg2/patches/fix-cflags.patch b/srcpkgs/msg2/patches/fix-cflags.patch
new file mode 100644
index 000000000000..64404bf44fcb
--- /dev/null
+++ b/srcpkgs/msg2/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -3,7 +3,7 @@ project(msg2)
+ 
+ # Flags
+ set(CMAKE_CXX_STANDARD 17)
+-set(CMAKE_CXX_FLAGS "-Os -pipe -fPIC -fno-plt -fstack-protector-strong -Wall -Wshadow -pedantic -Wno-parentheses -Wfatal-errors")
++set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pipe -fPIC -fno-plt -fstack-protector-strong -Wall -Wshadow -pedantic -Wno-parentheses -Wfatal-errors")
+ 
+ # Add source files
+ add_executable(msg2 main.cpp)
diff --git a/srcpkgs/msg2/template b/srcpkgs/msg2/template
index b4f77400bf22..473b3c4ec4d2 100644
--- a/srcpkgs/msg2/template
+++ b/srcpkgs/msg2/template
@@ -1,7 +1,7 @@
 # Template file for 'msg2'
 pkgname=msg2
 version=1.2.0
-revision=1
+revision=2
 build_style=cmake
 short_desc="Output a blue arrow and a white message on the commandline"
 maintainer="Orphaned <orphan@voidlinux.org>"

From 413a129dd97a1b14a31ea782f051ce8a217b6337 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: Fri, 26 Mar 2021 21:22:55 +0700
Subject: [PATCH 29/64] ippusbxd: fix cflags -O2 not -o2

---
 srcpkgs/ippusbxd/patches/fix-cflags.patch | 12 ++++++++++++
 srcpkgs/ippusbxd/template                 |  2 +-
 2 files changed, 13 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/ippusbxd/patches/fix-cflags.patch

diff --git a/srcpkgs/ippusbxd/patches/fix-cflags.patch b/srcpkgs/ippusbxd/patches/fix-cflags.patch
new file mode 100644
index 000000000000..5d36903c3ffd
--- /dev/null
+++ b/srcpkgs/ippusbxd/patches/fix-cflags.patch
@@ -0,0 +1,12 @@
+Index: src/CMakeLists.txt
+===================================================================
+--- src/CMakeLists.txt.orig
++++ src/CMakeLists.txt
+@@ -1,6 +1,6 @@
+ cmake_minimum_required(VERSION 2.6)
+ project(ippusbxd)
+-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -o2 -g -std=c99 -Wall -Wextra -pedantic -pedantic-errors")
++set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -Wall -Wextra -pedantic -pedantic-errors")
+ 
+ 
+ # Compiler specific configuration
diff --git a/srcpkgs/ippusbxd/template b/srcpkgs/ippusbxd/template
index ce4ff2ea9125..e81064e8b91d 100644
--- a/srcpkgs/ippusbxd/template
+++ b/srcpkgs/ippusbxd/template
@@ -1,7 +1,7 @@
 # Template file for 'ippusbxd'
 pkgname=ippusbxd
 version=1.34
-revision=1
+revision=2
 build_wrksrc=src
 build_style=cmake
 make_cmd=make

From 55b458203af4eb7560ca0af3613d403da7e504ac 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: Fri, 26 Mar 2021 21:34:52 +0700
Subject: [PATCH 30/64] tlsh: respect -g

---
 srcpkgs/tlsh/patches/fix-cflags.patch | 13 +++++++++++++
 srcpkgs/tlsh/template                 |  2 +-
 2 files changed, 14 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/tlsh/patches/fix-cflags.patch

diff --git a/srcpkgs/tlsh/patches/fix-cflags.patch b/srcpkgs/tlsh/patches/fix-cflags.patch
new file mode 100644
index 000000000000..8715563715c7
--- /dev/null
+++ b/srcpkgs/tlsh/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -125,7 +125,7 @@ if (CMAKE_BUILD_TYPE STREQUAL Debug)
+     endif()
+ else(CMAKE_BUILD_TYPE STREQUAL Debug)
+     if(CMAKE_COMPILER_IS_GNUCXX)
+-        set(CMAKE_CXX_FLAGS "-O2 -fvisibility=internal")  ## Remove TlshImpl symbols
++        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=internal")  ## Remove TlshImpl symbols
+     endif()
+     if(MSVC)
+         set(CMAKE_CXX_FLAGS "/O2")        ## Optimize
diff --git a/srcpkgs/tlsh/template b/srcpkgs/tlsh/template
index 7cb5c28b48b9..dfea27526e14 100644
--- a/srcpkgs/tlsh/template
+++ b/srcpkgs/tlsh/template
@@ -1,7 +1,7 @@
 # Template file for 'tlsh'
 pkgname=tlsh
 version=3.17.0
-revision=2
+revision=3
 build_style=cmake
 hostmakedepends="python3"
 makedepends="python3-devel"

From c3e8bd61ab43e6881d0b55a3b1105401b8e8c703 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: Fri, 26 Mar 2021 21:59:06 +0700
Subject: [PATCH 31/64] poppler: hardening + respect -g

---
 srcpkgs/poppler/patches/fix-cflags.patch | 21 +++++++++++++++++++++
 srcpkgs/poppler/template                 |  2 +-
 2 files changed, 22 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/poppler/patches/fix-cflags.patch

diff --git a/srcpkgs/poppler/patches/fix-cflags.patch b/srcpkgs/poppler/patches/fix-cflags.patch
new file mode 100644
index 000000000000..9e62b11010ba
--- /dev/null
+++ b/srcpkgs/poppler/patches/fix-cflags.patch
@@ -0,0 +1,21 @@
+Index: cmake/modules/PopplerMacros.cmake
+===================================================================
+--- cmake/modules/PopplerMacros.cmake.orig
++++ cmake/modules/PopplerMacros.cmake
+@@ -123,14 +123,14 @@ if(CMAKE_COMPILER_IS_GNUCXX)
+   set(DEFAULT_COMPILE_WARNINGS_EXTRA "${_warn} ${_warnx}")
+ 
+   set(_save_cxxflags "${CMAKE_CXX_FLAGS}")
+-  set(CMAKE_CXX_FLAGS                "-fno-exceptions -fno-check-new -fno-common -D_DEFAULT_SOURCE")
++  set(CMAKE_CXX_FLAGS                "-fno-exceptions -fno-check-new -fno-common -D_DEFAULT_SOURCE ${_save_cxxflags}")
+   set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g ${_save_cxxflags}")
+   set(CMAKE_CXX_FLAGS_RELEASE        "-O2 -DNDEBUG ${_save_cxxflags}")
+   set(CMAKE_CXX_FLAGS_DEBUG          "-g -O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline ${_save_cxxflags}")
+   set(CMAKE_CXX_FLAGS_DEBUGFULL      "-g3 -fno-inline ${_save_cxxflags}")
+   set(CMAKE_CXX_FLAGS_PROFILE        "-g3 -fno-inline -ftest-coverage -fprofile-arcs ${_save_cxxflags}")
+   set(_save_cflags "${CMAKE_C_FLAGS}")
+-  set(CMAKE_C_FLAGS                  "-std=c99 -D_DEFAULT_SOURCE")
++  set(CMAKE_C_FLAGS                  "-std=c99 -D_DEFAULT_SOURCE ${_save_cflags}")
+   set(CMAKE_C_FLAGS_RELWITHDEBINFO   "-O2 -g ${_save_cflags}")
+   set(CMAKE_C_FLAGS_RELEASE          "-O2 -DNDEBUG ${_save_cflags}")
+   set(CMAKE_C_FLAGS_DEBUG            "-g -O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline ${_save_cflags}")
diff --git a/srcpkgs/poppler/template b/srcpkgs/poppler/template
index ed0db8de7ab6..1aebd7f7e177 100644
--- a/srcpkgs/poppler/template
+++ b/srcpkgs/poppler/template
@@ -4,7 +4,7 @@
 #
 pkgname=poppler
 version=20.09.0
-revision=2
+revision=3
 build_style=cmake
 build_helper="gir"
 configure_args="-DENABLE_UNSTABLE_API_ABI_HEADERS=ON -DENABLE_CPP=ON

From 9b7d1a1c2e07cf59fdb0f46d301e4641ded854f5 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: Fri, 26 Mar 2021 21:59:29 +0700
Subject: [PATCH 32/64] poppler-qt5: hardening + respect -g

---
 srcpkgs/poppler-qt5/patches  | 1 +
 srcpkgs/poppler-qt5/template | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)
 create mode 120000 srcpkgs/poppler-qt5/patches

diff --git a/srcpkgs/poppler-qt5/patches b/srcpkgs/poppler-qt5/patches
new file mode 120000
index 000000000000..636e4ac2cbd9
--- /dev/null
+++ b/srcpkgs/poppler-qt5/patches
@@ -0,0 +1 @@
+../poppler/patches
\ No newline at end of file
diff --git a/srcpkgs/poppler-qt5/template b/srcpkgs/poppler-qt5/template
index 0dc45c05c58b..c2ec35dbbad3 100644
--- a/srcpkgs/poppler-qt5/template
+++ b/srcpkgs/poppler-qt5/template
@@ -5,7 +5,7 @@
 #
 pkgname=poppler-qt5
 version=20.09.0
-revision=1
+revision=2
 wrksrc="poppler-${version}"
 build_style=cmake
 configure_args="-DENABLE_UNSTABLE_API_ABI_HEADERS=ON -DENABLE_GLIB=OFF

From a30d7f9571b664cc781fcb717fdd80da01d00d4e 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: Sat, 27 Mar 2021 11:17:35 +0700
Subject: [PATCH 33/64] artyfx: remove -O1 -g

---
 srcpkgs/artyfx/patches/fix-avtk-cmake-sse.patch | 4 ++--
 srcpkgs/artyfx/patches/respect-our-cflags.patch | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/artyfx/patches/fix-avtk-cmake-sse.patch b/srcpkgs/artyfx/patches/fix-avtk-cmake-sse.patch
index 1a832155a566..47ef4dd9b84e 100644
--- a/srcpkgs/artyfx/patches/fix-avtk-cmake-sse.patch
+++ b/srcpkgs/artyfx/patches/fix-avtk-cmake-sse.patch
@@ -6,8 +6,8 @@
  
 -SET(CMAKE_C_FLAGS   "-fPIC -msse -msse2 -mfpmath=sse -g") # -fsanitize=address
 -SET(CMAKE_CXX_FLAGS "-fPIC -msse -msse2 -mfpmath=sse -g") # -fsanitize=address
-+SET(CMAKE_C_FLAGS   "${CMAKE_C_FLAGS} -fPIC -g") # -fsanitize=address
-+SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -g") # -fsanitize=address
++SET(CMAKE_C_FLAGS   "${CMAKE_C_FLAGS} -fPIC") # -fsanitize=address
++SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") # -fsanitize=address
 +
 +IF(BUILD_SSE)
 +	SET(CMAKE_C_FLAGS   "${CMAKE_C_FLAGS} -msse -msse2 -mfpmath=sse")
diff --git a/srcpkgs/artyfx/patches/respect-our-cflags.patch b/srcpkgs/artyfx/patches/respect-our-cflags.patch
index ee9155c7729e..7a32fd9df73b 100644
--- a/srcpkgs/artyfx/patches/respect-our-cflags.patch
+++ b/srcpkgs/artyfx/patches/respect-our-cflags.patch
@@ -10,8 +10,8 @@ Index: CMakeLists.txt
 -SET(CMAKE_C_FLAGS "-g -Wall -O1 -Wno-unused-variable")
 -SET(CMAKE_CXX_FLAGS "-g -Wall -O1 -Wno-unused-variable -ftree-vectorize")
 +SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fPIC -shared -L./src/avtk -Wl,--no-undefined")
-+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -Wall -O1 -Wno-unused-variable")
-+SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -Wall -O1 -Wno-unused-variable -ftree-vectorize")
++SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall  -Wno-unused-variable")
++SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall  -Wno-unused-variable -ftree-vectorize")
  
  
  # DSP sources

From deea7830ab5fd4e0e61446050e0c5668085bb802 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: Sat, 27 Mar 2021 11:27:28 +0700
Subject: [PATCH 34/64] coin3: build with CMAKE_BUILD_TYPE=None

---
 srcpkgs/coin3/template | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/coin3/template b/srcpkgs/coin3/template
index d5483ee048c3..8f7218c2e8c3 100644
--- a/srcpkgs/coin3/template
+++ b/srcpkgs/coin3/template
@@ -5,7 +5,7 @@ revision=1
 wrksrc="coin-Coin-${version}"
 build_style=cmake
 configure_args="-DCMAKE_INSTALL_INCLUDEDIR=/usr/include/Coin3
- -DCMAKE_BUILD_TYPE=Release -DCOIN_BUILD_TESTS=OFF -DCOIN_BUILD_DOCUMENTATION=ON"
+ -DCOIN_BUILD_TESTS=OFF -DCOIN_BUILD_DOCUMENTATION=ON"
 hostmakedepends="doxygen graphviz"
 makedepends="boost-devel glu-devel"
 short_desc="High-level 3D graphics toolkit"
@@ -15,6 +15,9 @@ homepage="https://coin3d.github.io/"
 distfiles="https://github.com/coin3d/coin/archive/Coin-${version}.tar.gz"
 checksum=b00d2a8e9d962397cf9bf0d9baa81bcecfbd16eef675a98c792f5cf49eb6e805
 
+CFLAGS=-DNDEBUG
+CXXFLAGS=-DNDEBUG
+
 if [ "$CROSS_BUILD" ]; then
 	# bypass runtime test (quote hashing is fine with gcc 9.3)
 	configure_args+=" -DHAVE_HASH_QUOTING_EXITCODE=0"

From cd2c26387ef78300525935a0dea677d8bc7afb30 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: Sat, 27 Mar 2021 11:46:46 +0700
Subject: [PATCH 35/64] conky: don't overwrite CMAKE_BUILD_TYPE

---
 srcpkgs/conky/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/conky/template b/srcpkgs/conky/template
index 8b95a628edfb..f05c7d4a1bf2 100644
--- a/srcpkgs/conky/template
+++ b/srcpkgs/conky/template
@@ -5,7 +5,7 @@ version=1.12.1
 revision=1
 build_style=cmake
 conf_files="/etc/conky/conky.conf /etc/conky/conky_no_x11.conf"
-configure_args="-DCMAKE_BUILD_TYPE=Release -DMAINTAINER_MODE=ON -DRELEASE=ON
+configure_args="-DMAINTAINER_MODE=ON -DRELEASE=ON
  -DDOC_PATH=share/doc/${pkgname} -DBUILD_X11=ON -DBUILD_CURL=ON -DBUILD_XDBE=ON
  -DBUILD_RSS=ON -DBUILD_WEATHER_METAR=ON -DBUILD_IMLIB2=ON -DBUILD_WLAN=ON
  -DBUILD_LUA_CAIRO=ON -DBUILD_LUA_IMLIB2=ON -DBUILD_LUA_RSVG=ON

From a75a7d99905f388bb90c45c850491e47d5f8ef79 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: Sat, 27 Mar 2021 11:46:46 +0700
Subject: [PATCH 36/64] conky-cli: don't overwrite CMAKE_BUILD_TYPE

---
 srcpkgs/conky-cli/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/conky-cli/template b/srcpkgs/conky-cli/template
index b61bdcca0504..7d512b65ab3e 100644
--- a/srcpkgs/conky-cli/template
+++ b/srcpkgs/conky-cli/template
@@ -6,7 +6,7 @@ revision=1
 wrksrc="${pkgname/-cli/}-${version}"
 build_style=cmake
 conf_files="/etc/conky/conky.conf /etc/conky/conky_no_x11.conf"
-configure_args="-DCMAKE_BUILD_TYPE=Release -DMAINTAINER_MODE=ON -DRELEASE=ON
+configure_args="-DMAINTAINER_MODE=ON -DRELEASE=ON
  -DDOC_PATH=share/doc/${pkgname} -DBUILD_X11=OFF -DBUILD_CURL=ON -DBUILD_XDBE=OFF
  -DBUILD_RSS=ON -DBUILD_WEATHER_METAR=OFF -DBUILD_IMLIB2=OFF -DBUILD_WLAN=ON
  -DBUILD_DOCS=ON"

From 9d1f975de97d04d6f522d58707eedbda43ea4fe7 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: Sat, 27 Mar 2021 11:48:25 +0700
Subject: [PATCH 37/64] crossguid: don't overwrite -O2

---
 srcpkgs/crossguid/fix-cflags.patch | 12 ++++++++++++
 1 file changed, 12 insertions(+)
 create mode 100644 srcpkgs/crossguid/fix-cflags.patch

diff --git a/srcpkgs/crossguid/fix-cflags.patch b/srcpkgs/crossguid/fix-cflags.patch
new file mode 100644
index 000000000000..983360a07ccf
--- /dev/null
+++ b/srcpkgs/crossguid/fix-cflags.patch
@@ -0,0 +1,12 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -2,7 +2,6 @@ cmake_minimum_required(VERSION 3.5.1)
+ project(CrossGuid)
+ 
+ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake")
+-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3")
+ 
+ option(XG_TESTS "Build test runner" ON)
+ 

From a15d53deb0e0797e0c6dc6aaeafd91a5a3b8cb4b 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: Sat, 27 Mar 2021 12:19:04 +0700
Subject: [PATCH 38/64] rapidjson: define -DNDEBUG

---
 srcpkgs/rapidjson/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/rapidjson/template b/srcpkgs/rapidjson/template
index 8597f8fb2706..99d92702cc9d 100644
--- a/srcpkgs/rapidjson/template
+++ b/srcpkgs/rapidjson/template
@@ -11,7 +11,7 @@ distfiles="https://github.com/miloyip/${pkgname}/archive/v${version}.tar.gz"
 checksum=bf7ced29704a1e696fbccf2a2b4ea068e7774fa37f6d7dd4039d0787f8bed98e
 
 # class-memaccess is required by https://github.com/Tencent/rapidjson/issues/1700
-CXXFLAGS="-Wno-type-limits -Wno-error=class-memaccess"
+CXXFLAGS="-Wno-type-limits -Wno-error=class-memaccess -DNDEBUG"
 
 post_patch() {
 	# Remove bin/jsonchecker, which is the JSON licensed files

From eddc6279bb03f41b96fabbc5ed6dc4fa72a87c9a 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: Sat, 27 Mar 2021 12:18:36 +0700
Subject: [PATCH 39/64] cura-engine: ignore -O3

---
 srcpkgs/cura-engine/patches/fix-cflags.patch | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 srcpkgs/cura-engine/patches/fix-cflags.patch

diff --git a/srcpkgs/cura-engine/patches/fix-cflags.patch b/srcpkgs/cura-engine/patches/fix-cflags.patch
new file mode 100644
index 000000000000..e48a665523b8
--- /dev/null
+++ b/srcpkgs/cura-engine/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -42,7 +42,7 @@ endif()
+ if(CMAKE_BUILD_TYPE_UPPER MATCHES "DEBUG")
+     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_DEBUG_INIT}")
+ else()
+-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELEASE_INIT}")
++    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DNDEBUG")
+ endif()
+ 
+ set(CMAKE_CXX_STANDARD 11)

From 43d33c989c6fa01be38651ebab40cbccb497a34f 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: Sat, 27 Mar 2021 12:22:29 +0700
Subject: [PATCH 40/64] dislocker: remove -O1

---
 srcpkgs/dislocker/patches/fix-cflags.patch | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 srcpkgs/dislocker/patches/fix-cflags.patch

diff --git a/srcpkgs/dislocker/patches/fix-cflags.patch b/srcpkgs/dislocker/patches/fix-cflags.patch
new file mode 100644
index 000000000000..1229efeeaf0c
--- /dev/null
+++ b/srcpkgs/dislocker/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: src/CMakeLists.txt
+===================================================================
+--- src/CMakeLists.txt.orig
++++ src/CMakeLists.txt
+@@ -71,7 +71,7 @@ if(NOT DEFINED WARN_FLAGS)
+ 	set (WARN_FLAGS "-Wall -Wextra" CACHE STRING "" FORCE)
+ endif()
+ if(NOT DEFINED HARDEN_FLAGS)
+-	set (HARDEN_FLAGS "-fstack-protector -fstrict-aliasing -D_FORTIFY_SOURCE=2 -O1" CACHE STRING "" FORCE)
++	set (HARDEN_FLAGS "-fstack-protector -fstrict-aliasing" CACHE STRING "" FORCE)
+ endif()
+ 
+ set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")

From 4d27494fe91d1c9a71a2db18abe0de00cf38fb5f 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: Sat, 27 Mar 2021 12:29:31 +0700
Subject: [PATCH 41/64] freeorion: remove -O3

---
 srcpkgs/freeorion/patches/fix-cflags.patch | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
 create mode 100644 srcpkgs/freeorion/patches/fix-cflags.patch

diff --git a/srcpkgs/freeorion/patches/fix-cflags.patch b/srcpkgs/freeorion/patches/fix-cflags.patch
new file mode 100644
index 000000000000..c66d54599556
--- /dev/null
+++ b/srcpkgs/freeorion/patches/fix-cflags.patch
@@ -0,0 +1,18 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -432,13 +432,6 @@ if(MSVC)
+     )
+ endif()
+ 
+-target_compile_options(freeorionparseobj
+-    PRIVATE
+-        $<$<CXX_COMPILER_ID:Clang>:-ftemplate-depth=512>
+-        $<$<CXX_COMPILER_ID:AppleClang>:-ftemplate-depth=512>
+-        $<$<AND:$<NOT:$<BOOL:${BUILD_TESTING}>>,$<CXX_COMPILER_ID:GNU>>:-O3>
+-)
+-
+ target_compile_definitions(freeorionparseobj
+     PUBLIC
+         -DBOOST_ALL_DYN_LINK

From b479c208d6e6968d1e04721c2d22d18564770ad8 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: Fri, 26 Mar 2021 09:01:12 +0700
Subject: [PATCH 42/64] cglm: fix build flags

---
 srcpkgs/cglm/patches/fix-cflags.patch | 13 +++++++++++++
 srcpkgs/cglm/template                 |  1 +
 2 files changed, 14 insertions(+)
 create mode 100644 srcpkgs/cglm/patches/fix-cflags.patch

diff --git a/srcpkgs/cglm/patches/fix-cflags.patch b/srcpkgs/cglm/patches/fix-cflags.patch
new file mode 100644
index 000000000000..c74de6ea62d7
--- /dev/null
+++ b/srcpkgs/cglm/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: cglm-0.7.6/CMakeLists.txt
+===================================================================
+--- cglm-0.7.6.orig/CMakeLists.txt
++++ cglm-0.7.6/CMakeLists.txt
+@@ -25,7 +25,7 @@ if(MSVC)
+ 	add_definitions(-DNDEBUG -D_WINDOWS -D_USRDLL -DCGLM_EXPORTS -DCGLM_DLL)
+ 	add_compile_options(/W3 /Ox /Gy /Oi /TC)
+ else()
+-  add_compile_options(-Wall -Werror -O3)
++  add_compile_options(-Wall)
+ endif()
+ 
+ if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
diff --git a/srcpkgs/cglm/template b/srcpkgs/cglm/template
index f00a093edab9..311b4c79a7d3 100644
--- a/srcpkgs/cglm/template
+++ b/srcpkgs/cglm/template
@@ -9,6 +9,7 @@ license="MIT"
 homepage="https://github.com/recp/cglm"
 distfiles="https://github.com/recp/cglm/archive/v${version}.tar.gz"
 checksum=29ff8af4edc03697e36d3e6f99a80b884a80ee09d46055ce45765e5d6b2456d9
+patch_args=-Np1
 
 post_install() {
 	vlicense LICENSE

From 661a5bc28c64baa823cba2596f6215c0bf066cee 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: Sat, 27 Mar 2021 12:36:19 +0700
Subject: [PATCH 43/64] glyr: don't force Release build

---
 srcpkgs/glyr/patches/fix-cflags.patch | 12 ++++++++++++
 1 file changed, 12 insertions(+)
 create mode 100644 srcpkgs/glyr/patches/fix-cflags.patch

diff --git a/srcpkgs/glyr/patches/fix-cflags.patch b/srcpkgs/glyr/patches/fix-cflags.patch
new file mode 100644
index 000000000000..498ffe09a38f
--- /dev/null
+++ b/srcpkgs/glyr/patches/fix-cflags.patch
@@ -0,0 +1,12 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -60,7 +60,6 @@ exec_program(
+ IF(CMAKE_BUILD_TYPE STREQUAL "debug")
+     SET(GLYR_DEBUG TRUE)
+ ELSE()
+-    SET(CMAKE_BUILD_TYPE "release")
+     SET(GLYR_DEBUG FALSE)
+ ENDIF()
+ MESSAGE("-- Building Target: ${CMAKE_BUILD_TYPE}")

From 5561d36b2a44c6b1c85e541000813fc3f7d6edfb 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: Sat, 27 Mar 2021 12:41:50 +0700
Subject: [PATCH 44/64] hugin: remove -O3

---
 srcpkgs/hugin/patches/fix-cflags.patch | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
 create mode 100644 srcpkgs/hugin/patches/fix-cflags.patch

diff --git a/srcpkgs/hugin/patches/fix-cflags.patch b/srcpkgs/hugin/patches/fix-cflags.patch
new file mode 100644
index 000000000000..02fa56bef0e1
--- /dev/null
+++ b/srcpkgs/hugin/patches/fix-cflags.patch
@@ -0,0 +1,15 @@
+Index: src/celeste/CMakeLists.txt
+===================================================================
+--- src/celeste/CMakeLists.txt.orig
++++ src/celeste/CMakeLists.txt
+@@ -16,10 +16,6 @@
+ #    You should have received a copy of the GNU General Public License
+ #    along with Hugin  If not, see <http://www.gnu.org/licenses/>.
+  
+-IF(NOT WIN32)
+-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3")
+-ENDIF(NOT WIN32)
+-
+ # a list of all files belonging to celeste library
+ 
+ SET(CELESTE_SRC

From 3668b75d618258be9da499176d888446c1178525 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: Sat, 27 Mar 2021 13:05:27 +0700
Subject: [PATCH 45/64] ledger: don't overwrite CMAKE_BUILD_TYPE

---
 srcpkgs/ledger/patches/fix-cflags.patch | 12 ++++++++++++
 1 file changed, 12 insertions(+)
 create mode 100644 srcpkgs/ledger/patches/fix-cflags.patch

diff --git a/srcpkgs/ledger/patches/fix-cflags.patch b/srcpkgs/ledger/patches/fix-cflags.patch
new file mode 100644
index 000000000000..179ab79cd148
--- /dev/null
+++ b/srcpkgs/ledger/patches/fix-cflags.patch
@@ -0,0 +1,12 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -41,7 +41,6 @@ if (BUILD_DEBUG)
+   set(CMAKE_BUILD_TYPE Debug)
+   set(DEBUG_MODE 1)
+ else()
+-  set(CMAKE_BUILD_TYPE Release)
+   set(DEBUG_MODE 0)
+ endif()
+ 

From 62d0d120d86729293823521fa1a56a9e45a84c5c 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: Sat, 27 Mar 2021 13:18:24 +0700
Subject: [PATCH 46/64] libmygpo-qt: remove -ggdb3

---
 srcpkgs/libmygpo-qt/patches/fix-cflags.patch | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 srcpkgs/libmygpo-qt/patches/fix-cflags.patch

diff --git a/srcpkgs/libmygpo-qt/patches/fix-cflags.patch b/srcpkgs/libmygpo-qt/patches/fix-cflags.patch
new file mode 100644
index 000000000000..9940b6fc4323
--- /dev/null
+++ b/srcpkgs/libmygpo-qt/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -69,7 +69,7 @@ if (CMAKE_COMPILER_IS_GNUCXX)
+        -Wwrite-strings -Wpacked -Wformat-security -Wmissing-format-attribute
+        -Wold-style-cast -Woverloaded-virtual -Wnon-virtual-dtor  -Wall -Wextra
+        -Wformat=2 -Wundef -Wstack-protector -Wmissing-include-dirs
+-       -Winit-self -Wunsafe-loop-optimizations  -ggdb3 -fno-inline -DQT_STRICT_ITERATORS )
++       -Winit-self -Wunsafe-loop-optimizations  -fno-inline -DQT_STRICT_ITERATORS )
+     if ( NOT WIN32 )
+         add_definitions( -fvisibility=hidden )
+     endif()

From c82a9b95a019383b0c98fe4e52001c2fac703ffd 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: Sat, 27 Mar 2021 13:48:38 +0700
Subject: [PATCH 47/64] libogre: don't build vendored libraries

---
 srcpkgs/libogre/template | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/srcpkgs/libogre/template b/srcpkgs/libogre/template
index 784e3a648bac..6dd88ea08c73 100644
--- a/srcpkgs/libogre/template
+++ b/srcpkgs/libogre/template
@@ -3,11 +3,8 @@ pkgname=libogre
 version=1.12.9
 revision=1
 build_style=cmake
-configure_args="-DCMAKE_INSTALL_PREFIX=/usr \
-	-DOGRE_INSTALL_SAMPLES=TRUE \
-	-DOGRE_INSTALL_DOCS=TRUE \
-	-DOGRE_INSTALL_SAMPLES_SOURCE=TRUE \
-	-DCMAKE_BUILD_TYPE=Release"
+configure_args="-DOGRE_INSTALL_SAMPLES=TRUE -DOGRE_INSTALL_DOCS=TRUE
+ -DOGRE_INSTALL_SAMPLES_SOURCE=TRUE -DOGRE_BUILD_DEPENDENCIES=FALSE"
 hostmakedepends="pkg-config graphviz doxygen dejavu-fonts-ttf"
 makedepends="boost-devel freetype-devel libXaw-devel libXrandr-devel
  MesaLib-devel zziplib-devel libcppunit-devel glu-devel libatomic-devel

From 99426a9155cc9e0e3f3409fe4d03490c5a3400b6 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: Sat, 27 Mar 2021 13:52:50 +0700
Subject: [PATCH 48/64] libopenglrecorder: remove -O3

---
 srcpkgs/libopenglrecorder/patches/fix-cflags.patch | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 srcpkgs/libopenglrecorder/patches/fix-cflags.patch

diff --git a/srcpkgs/libopenglrecorder/patches/fix-cflags.patch b/srcpkgs/libopenglrecorder/patches/fix-cflags.patch
new file mode 100644
index 000000000000..7c48a0d2d822
--- /dev/null
+++ b/srcpkgs/libopenglrecorder/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -21,7 +21,7 @@ if (UNIX OR MINGW)
+     if (CMAKE_BUILD_TYPE MATCHES Debug)
+         add_definitions(-std=gnu++0x -O0)
+     else()
+-        add_definitions(-std=gnu++0x -O3)
++        add_definitions(-std=gnu++0x)
+     endif()
+ endif()
+ 

From 6d55110fff149ba2e2c24cc8e577976c57312190 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: Sat, 27 Mar 2021 13:55:41 +0700
Subject: [PATCH 49/64] libvidstab: remove -O3

---
 srcpkgs/libvidstab/patches/fix-cflags.patch | 39 +++++++++++++++++++++
 1 file changed, 39 insertions(+)
 create mode 100644 srcpkgs/libvidstab/patches/fix-cflags.patch

diff --git a/srcpkgs/libvidstab/patches/fix-cflags.patch b/srcpkgs/libvidstab/patches/fix-cflags.patch
new file mode 100644
index 000000000000..51c357efb101
--- /dev/null
+++ b/srcpkgs/libvidstab/patches/fix-cflags.patch
@@ -0,0 +1,39 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -25,7 +25,7 @@ else()
+     set(LIBSUFFIX "")
+ endif()
+ 
+-add_definitions( -Wall -O3 -g -Wno-pointer-sign -fPIC -std=gnu99)
++add_definitions( -Wall -Wno-pointer-sign -fPIC -std=gnu99)
+ # add_definitions(  -Wall -O0 -g -Wno-pointer-sign )
+ 
+ ### ORC is not used in any active code at the moment  ###
+Index: tests/CMakeLists.txt
+===================================================================
+--- tests/CMakeLists.txt.orig
++++ tests/CMakeLists.txt
+@@ -11,7 +11,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PAT
+ option(USE_OMP "use parallelization use OMP" ON)
+ 
+ #add_definitions( -Wall -O3 -Wno-pointer-sign -DTESTING  -std=gnu99)
+-add_definitions(  -Wall -O0 -g -Wno-pointer-sign -DTESTING -std=gnu99)
++add_definitions(  -Wall -Wno-pointer-sign -DTESTING -std=gnu99)
+ find_package(Orc)
+ if(ORC_FOUND)
+ add_definitions( -DUSE_ORC ${ORC_DEFINITIONS})
+Index: transcode/CMakeLists.txt
+===================================================================
+--- transcode/CMakeLists.txt.orig
++++ transcode/CMakeLists.txt
+@@ -9,7 +9,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PAT
+ set(TRANSCODE_ROOT ../../transcode)
+ 
+ 
+-add_definitions( -Wall -O3 -Wno-pointer-sign -DTRANSCODE -std=gnu99)
++add_definitions( -Wall -Wno-pointer-sign -DTRANSCODE -std=gnu99)
+ #add_definitions(  -Wall -O0 -g -Wno-pointer-sign )
+ # I tried it with 0.4.14
+ #  0.4.10 did not work (not all opcode implemented)

From 11c2ae01181768fb2e037c5d486bfef095ff1358 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: Sat, 27 Mar 2021 14:18:34 +0700
Subject: [PATCH 50/64] openlierox: don't overwrote CMAKE_BUILD_TYPE

---
 srcpkgs/openlierox/patches/fix-cflags.patch | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
 create mode 100644 srcpkgs/openlierox/patches/fix-cflags.patch

diff --git a/srcpkgs/openlierox/patches/fix-cflags.patch b/srcpkgs/openlierox/patches/fix-cflags.patch
new file mode 100644
index 000000000000..4fe6652fd0a2
--- /dev/null
+++ b/srcpkgs/openlierox/patches/fix-cflags.patch
@@ -0,0 +1,17 @@
+Index: CMakeOlxCommon.cmake
+===================================================================
+--- CMakeOlxCommon.cmake.orig
++++ CMakeOlxCommon.cmake
+@@ -36,12 +36,6 @@ OPTION(BREAKPAD "Google Breakpad support
+ OPTION(DISABLE_JOYSTICK "Disable joystick support" No)
+ OPTION(MINGW_CROSS_COMPILE "Cross-compile Windows .EXE using i686-w64-mingw32-gcc compiler" No)
+ 
+-IF (DEBUG)
+-	SET(CMAKE_BUILD_TYPE Debug)
+-ELSE (DEBUG)
+-	SET(CMAKE_BUILD_TYPE Release)
+-ENDIF (DEBUG)
+-
+ IF (DEDICATED_ONLY)
+ 	SET(X11 No)
+ 	SET(WITH_G15 No)

From 8dbe1e36b23347946dcc99bae0aeed1e0527e1a1 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: Sat, 27 Mar 2021 14:25:12 +0700
Subject: [PATCH 51/64] opensonic: don't overwrite CMAKE_BUILD_TYPE

---
 srcpkgs/opensonic/patches/fix-cflags.patch | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
 create mode 100644 srcpkgs/opensonic/patches/fix-cflags.patch

diff --git a/srcpkgs/opensonic/patches/fix-cflags.patch b/srcpkgs/opensonic/patches/fix-cflags.patch
new file mode 100644
index 000000000000..10d2c7c80e64
--- /dev/null
+++ b/srcpkgs/opensonic/patches/fix-cflags.patch
@@ -0,0 +1,17 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -25,12 +25,10 @@ SET(GAME_NAME "Open Sonic")
+ SET(GAME_VERSION "0.1.4")
+ SET(RTFM "Please read the user manual (readme.html) to get help.")
+ SET(ALLEGRO_RECOMMENDED_VERSION "4.4.1")
+-SET(CMAKE_BUILD_TYPE Release)
+ MESSAGE("${GAME_NAME} version ${GAME_VERSION}")
+ 
+ # configuring...
+ SET(DEFS "")
+-SET(CFLAGS_EXTRA "-g")
+ SET(CFLAGS "${CFLAGS} ${CMAKE_C_FLAGS}")
+ MESSAGE("Using CFLAGS='${CFLAGS}'")
+ 

From 785f0300ba870a39ed91f5c9c3c74387fa8f64ee 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: Sat, 27 Mar 2021 15:17:28 +0700
Subject: [PATCH 52/64] rocksdb: don't overwrite CMAKE_BUILD_TYPE

---
 srcpkgs/rocksdb/template | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/rocksdb/template b/srcpkgs/rocksdb/template
index e39329e5d6a6..5a6ca434f29b 100644
--- a/srcpkgs/rocksdb/template
+++ b/srcpkgs/rocksdb/template
@@ -3,8 +3,7 @@ pkgname=rocksdb
 version=5.18.3
 revision=2
 build_style=cmake
-configure_args="-DCMAKE_BUILD_TYPE=Release -DPORTABLE=1 -DWITH_TESTS=0
- -DUSE_RTTI=0 -DWITH_LZ4=1"
+configure_args="-DPORTABLE=1 -DWITH_TESTS=0 -DUSE_RTTI=0 -DWITH_LZ4=1"
 makedepends="liblz4-devel"
 short_desc="RocksDB is a embeddable, persistent key-value store for fast storage"
 maintainer="magenbluten <mb0@codemonkey.cc>"
@@ -12,6 +11,8 @@ license="GPL-2.0-or-later, Apache-2.0"
 homepage="https://github.com/facebook/rocksdb"
 distfiles="${homepage}/archive/v${version}.tar.gz"
 checksum=7fb6738263d3f2b360d7468cf2ebe333f3109f3ba1ff80115abd145d75287254
+CFLAGS=-DNDEBUG
+CXXFLAGS=-DNDEBUG
 
 if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
 	makedepends+=" libatomic-devel"

From 04a0e70a3af07534dc2091eb69b7f6530aa95355 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: Sat, 27 Mar 2021 15:19:47 +0700
Subject: [PATCH 53/64] rofs-filtered: hardening

---
 srcpkgs/rofs-filtered/patches/fix-cflags.patch | 13 +++++++++++++
 srcpkgs/rofs-filtered/template                 |  2 +-
 2 files changed, 14 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/rofs-filtered/patches/fix-cflags.patch

diff --git a/srcpkgs/rofs-filtered/patches/fix-cflags.patch b/srcpkgs/rofs-filtered/patches/fix-cflags.patch
new file mode 100644
index 000000000000..f64d3274f091
--- /dev/null
+++ b/srcpkgs/rofs-filtered/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -9,7 +9,7 @@ set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PA
+      "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
+ 
+ add_definitions(-D_GNU_SOURCE)
+-set(CMAKE_C_FLAGS "-Wall -std=c99")
++set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -std=c99")
+ 
+ # find fuse library
+ find_package (FUSE REQUIRED)
diff --git a/srcpkgs/rofs-filtered/template b/srcpkgs/rofs-filtered/template
index 332cd57a9902..e585877eaf59 100644
--- a/srcpkgs/rofs-filtered/template
+++ b/srcpkgs/rofs-filtered/template
@@ -1,7 +1,7 @@
 # Template file for 'rofs-filtered'
 pkgname=rofs-filtered
 version=1.7
-revision=1
+revision=2
 build_style=cmake
 makedepends="fuse-devel"
 short_desc="Filtered read only filesystem for FUSE"

From cc842a1fd8717d575944e8e02ce66ff28a1da3cb 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: Sat, 27 Mar 2021 15:40:26 +0700
Subject: [PATCH 54/64] seexpr-krita: don't overwrite CMAKE_BUILD_TYPE

---
 .../patches/cmake-build-type-none.patch       | 32 +++++++++++++++++++
 1 file changed, 32 insertions(+)
 create mode 100644 srcpkgs/seexpr-krita/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/seexpr-krita/patches/cmake-build-type-none.patch b/srcpkgs/seexpr-krita/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..94bb1f37db75
--- /dev/null
+++ b/srcpkgs/seexpr-krita/patches/cmake-build-type-none.patch
@@ -0,0 +1,32 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -42,14 +42,6 @@ endif()
+ 
+ ## Choose build options
+ # Disney specific method of choosing variant
+-if (${FLAVOR} STREQUAL "optimize")
+-    set(CMAKE_BUILD_TYPE "Release" CACHE STRING "type of build" FORCE)
+-endif()
+-
+-if (${FLAVOR} STREQUAL "debug")
+-    set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "type of build" FORCE)
+-endif()
+-
+ if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
+     execute_process(
+         COMMAND sh -c "echo `uname -s`-`uname -r | cut -d- -f1`-`uname -m`"
+@@ -212,12 +204,6 @@ else()
+ endif()
+ 
+ # Set to release if nothing else defined
+-if (NOT CMAKE_BUILD_TYPE)
+-  set(CMAKE_BUILD_TYPE "Release" CACHE STRING
+-      "Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel."
+-      FORCE)
+-endif()
+-
+ if (ENABLE_QT5)
+     find_package(Qt5 5.9.0 COMPONENTS Core Gui Widgets REQUIRED)
+     set_package_properties(Qt5 PROPERTIES

From 5680dfbb071d9dfa28701277f4cdd0a7c34e3b43 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: Sat, 27 Mar 2021 15:50:53 +0700
Subject: [PATCH 55/64] speed-dreams: hardening

---
 srcpkgs/speed-dreams/template | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/speed-dreams/template b/srcpkgs/speed-dreams/template
index 722f0c5ed87a..df7164f9c808 100644
--- a/srcpkgs/speed-dreams/template
+++ b/srcpkgs/speed-dreams/template
@@ -1,13 +1,13 @@
 # Template file for 'speed-dreams'
 pkgname=speed-dreams
 version=2.2.2
-revision=2
+revision=3
 archs="i686* x86_64* ppc64le*"
 _rev=r6553
 create_wrksrc=yes
 build_style=cmake
-configure_args="-DSD_BINDIR=/usr/bin -DSD_DATADIR=/usr/share/speed-dreams-2 -DSD_LIBDIR=/usr/lib/speed-dreams-2
- -DOPTION_OFFICIAL_ONLY=ON -DCMAKE_CXX_FLAGS=-fpermissive -DCMAKE_C_FLAGS=-fpermissive"
+configure_args="-DSD_BINDIR=/usr/bin -DSD_DATADIR=/usr/share/speed-dreams-2
+ -DSD_LIBDIR=/usr/lib/speed-dreams-2 -DOPTION_OFFICIAL_ONLY=ON"
 hostmakedepends="pkg-config"
 makedepends="freealut-devel libenet-devel libfreeglut-devel libjpeg-turbo-devel
  libpng-devel libvorbis-devel libXrandr-devel osg-devel plib-devel SDL2-devel
@@ -26,6 +26,8 @@ checksum="32aa55c17f8dafc1c54fb0d0b7b993d2688d431899cfc5db9eeece148c6887d0
  0b7b417d007ab3b7f0f4dcfdc868aafee1722150b81af519e1cd4c082b408183"
 nocross=yes
 replaces="speed-dreams-data>=0"
+CFLAGS=-fpermissive
+CXXFLAGS=-fpermissive
 
 if [ "$XBPS_TARGET_LIBC" = musl ]; then
 	broken="Segmentation fault"

From 3195112cadc86d7a610ca53d0e1c7ddac875c8f9 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: Sat, 27 Mar 2021 19:04:09 +0700
Subject: [PATCH 56/64] traverso: hardening

---
 .../patches/cmake-build-type-none.patch       | 28 +++++++++++++++++++
 srcpkgs/traverso/template                     |  2 +-
 2 files changed, 29 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/traverso/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/traverso/patches/cmake-build-type-none.patch b/srcpkgs/traverso/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..75b3fd941eb8
--- /dev/null
+++ b/srcpkgs/traverso/patches/cmake-build-type-none.patch
@@ -0,0 +1,28 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -65,13 +65,7 @@ SET(TRAVERSO_DEFINES -DSTATIC_BUILD)
+ 
+ #BUILD SETUP
+ #None, Debug, Release, .. or custom ones
+-IF(WANT_DEBUG)
+-  SET(CMAKE_BUILD_TYPE DEBUG)
+-  SET(WANT_TRAVERSO_DEBUG ON)
+-ELSE(WANT_DEBUG)
+-  SET(CMAKE_BUILD_TYPE RELEASE)
+-  LIST(APPEND TRAVERSO_DEFINES -DQT_NO_DEBUG)
+-ENDIF(WANT_DEBUG)
++LIST(APPEND TRAVERSO_DEFINES -DQT_NO_DEBUG)
+ 
+ 
+ IF(WANT_TRAVERSO_DEBUG)
+@@ -326,7 +320,7 @@ ${Qt5Xml_INCLUDE_DIRS}
+ ${Qt5Xml_INCLUDES}
+ )
+ 
+-set(CMAKE_CXX_FLAGS "-fPIC")
++set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
+ 
+ #Set up libraries to link with all found packages
+ LINK_LIBRARIES (
diff --git a/srcpkgs/traverso/template b/srcpkgs/traverso/template
index 105924d4f0c6..4b93460f63d7 100644
--- a/srcpkgs/traverso/template
+++ b/srcpkgs/traverso/template
@@ -1,7 +1,7 @@
 # Template file for 'traverso'
 pkgname=traverso
 version=0.49.6
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DWANT_MP3_ENCODE=ON -DDETECT_HOST_CPU_FEATURES=OFF"
 hostmakedepends="pkg-config qt5-qmake qt5-host-tools"

From acfd0cff0e4c1b2a581639b89042dfc01d91f925 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: Sat, 27 Mar 2021 19:08:11 +0700
Subject: [PATCH 57/64] xstarter: hardening

---
 .../patches/cmake-build-type-none.patch       | 22 +++++++++++++++++++
 srcpkgs/xstarter/template                     |  2 +-
 2 files changed, 23 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/xstarter/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/xstarter/patches/cmake-build-type-none.patch b/srcpkgs/xstarter/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..4f793e4c473c
--- /dev/null
+++ b/srcpkgs/xstarter/patches/cmake-build-type-none.patch
@@ -0,0 +1,22 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -5,16 +5,8 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
+ 
+ project(xstarter)
+ 
+-if(NOT CMAKE_BUILD_TYPE)
+-  set(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build (Debug or Release)" FORCE)
+-endif()
+-
+ set(PROJECT_VERSION "0.8.0")
+-if (CMAKE_BUILD_TYPE STREQUAL Debug)
+-  set(CMAKE_C_FLAGS "-g -Wall -pedantic")
+-else()
+-  set(CMAKE_C_FLAGS "-Wall -pedantic -O3")
+-endif()
++set(CMAKE_C_FLAGS "-Wall -pedantic ${CMAKE_C_FLAGS}")
+ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/bin")
+ 
+ set (CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
diff --git a/srcpkgs/xstarter/template b/srcpkgs/xstarter/template
index aa9a47e45e5c..4363d36e3c39 100644
--- a/srcpkgs/xstarter/template
+++ b/srcpkgs/xstarter/template
@@ -1,7 +1,7 @@
 # Template file for 'xstarter'
 pkgname=xstarter
 version=0.8.0
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="pkg-config"
 makedepends="glib-devel ncurses-devel"

From cadbcf0419a4028ca3cc180a6893149a9c1e8ac4 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: Sat, 27 Mar 2021 19:15:48 +0700
Subject: [PATCH 58/64] yabause-gtk: ignore -O3

---
 srcpkgs/yabause-gtk/patches/fix-cflags.patch | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 srcpkgs/yabause-gtk/patches/fix-cflags.patch

diff --git a/srcpkgs/yabause-gtk/patches/fix-cflags.patch b/srcpkgs/yabause-gtk/patches/fix-cflags.patch
new file mode 100644
index 000000000000..52c1cae61799
--- /dev/null
+++ b/srcpkgs/yabause-gtk/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: src/CMakeLists.txt
+===================================================================
+--- src/CMakeLists.txt.orig
++++ src/CMakeLists.txt
+@@ -659,7 +659,7 @@ else ()
+ 	set(yabause_SOURCES ${yabause_SOURCES} sock-dummy.c thr-dummy.c)
+ endif ()
+ 
+-set(YAB_OPTIMIZATION "-O3" CACHE STRING "Override optimization level")
++set(YAB_OPTIMIZATION "" CACHE STRING "Override optimization level")
+ 
+ if("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "i686")
+ 	set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${YAB_OPTIMIZATION} -march=i686 -msse")

From 43c7bef06eee1cc0929abda9654281244955f21c 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: Sat, 27 Mar 2021 19:26:47 +0700
Subject: [PATCH 59/64] ympd: hardening

---
 srcpkgs/ympd/patches/fix-cflags.patch | 13 +++++++++++++
 srcpkgs/ympd/template                 |  2 +-
 2 files changed, 14 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/ympd/patches/fix-cflags.patch

diff --git a/srcpkgs/ympd/patches/fix-cflags.patch b/srcpkgs/ympd/patches/fix-cflags.patch
new file mode 100644
index 000000000000..4720dd39e748
--- /dev/null
+++ b/srcpkgs/ympd/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -24,7 +24,7 @@ include_directories(${PROJECT_BINARY_DIR
+ 
+ include(CheckCSourceCompiles)
+ 
+-set(CMAKE_C_FLAGS "-std=gnu99 -Wall")
++set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99 -Wall")
+ set(CMAKE_C_FLAGS_DEBUG "-ggdb -pedantic")
+ if(WITH_IPV6)
+     set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS NS_ENABLE_IPV6)
diff --git a/srcpkgs/ympd/template b/srcpkgs/ympd/template
index 14437beb5384..450c079b2ca3 100644
--- a/srcpkgs/ympd/template
+++ b/srcpkgs/ympd/template
@@ -1,7 +1,7 @@
 # Template file for 'ympd'
 pkgname=ympd
 version=1.3.0
-revision=7
+revision=8
 build_style=cmake
 hostmakedepends="perl pkg-config"
 makedepends="libmpdclient-devel openssl-devel"

From 104d046023630c915dc95a571bc3442aa65c4217 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: Sat, 27 Mar 2021 19:29:31 +0700
Subject: [PATCH 60/64] z80ex: hardening

---
 srcpkgs/z80ex/patches/fix-cflags.patch | 13 +++++++++++++
 srcpkgs/z80ex/template                 |  2 +-
 2 files changed, 14 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/z80ex/patches/fix-cflags.patch

diff --git a/srcpkgs/z80ex/patches/fix-cflags.patch b/srcpkgs/z80ex/patches/fix-cflags.patch
new file mode 100644
index 000000000000..6743da255e5c
--- /dev/null
+++ b/srcpkgs/z80ex/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -11,7 +11,7 @@ option (OPSTEP_FAST_AND_ROUGH "Fast and
+ 
+ #ALL_CFLAGS := -fPIC -fno-common -ansi -pedantic -Wall -pipe -O2 -I. -I./include
+ if (CMAKE_COMPILER_IS_GNUCC)
+-    set (CMAKE_C_FLAGS "-fPIC -fno-common -ansi -pedantic -Wall -pipe -O2")
++    set (CMAKE_C_FLAGS "-fPIC -fno-common -ansi -pedantic -Wall -pipe ${CMAKE_C_FLAGS}")
+ endif ()
+ 
+ include_directories(BEFORE . include)
diff --git a/srcpkgs/z80ex/template b/srcpkgs/z80ex/template
index 00a24a6fb902..ae04241dcb5a 100644
--- a/srcpkgs/z80ex/template
+++ b/srcpkgs/z80ex/template
@@ -1,7 +1,7 @@
 # Template file for 'z80ex'
 pkgname=z80ex
 version=1.1.21
-revision=1
+revision=2
 build_style=cmake
 short_desc="ZiLOG Z80 CPU emulation library"
 maintainer="Diogo Leal <diogo@diogoleal.com>"

From 04c81661ca3b05b901e484eb5ba1cef8d47ea981 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: Sat, 27 Mar 2021 19:17:13 +0700
Subject: [PATCH 61/64] scribus: don't overwrite cmake-build-type

---
 .../patches/cmake-build-type-none.patch       | 33 +++++++++++++++++++
 1 file changed, 33 insertions(+)
 create mode 100644 srcpkgs/scribus/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/scribus/patches/cmake-build-type-none.patch b/srcpkgs/scribus/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..670c83cc48f5
--- /dev/null
+++ b/srcpkgs/scribus/patches/cmake-build-type-none.patch
@@ -0,0 +1,33 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -35,11 +35,6 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON)
+ 
+ 
+ #RPATH setup - more below too
+-if (WANT_NORPATH OR WANT_DISTROBUILD)
+-	set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
+-else()
+-	set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
+-endif()
+ set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
+ set(CMAKE_SKIP_RULE_DEPENDENCY TRUE)
+ set(CMAKE_SKIP_BUILD_RPATH TRUE)
+@@ -309,16 +304,6 @@ include (CMakeLists_Directories.cmake)
+ #Convert our simpler command line option to the CMake style
+ #None, Debug, Release, .. or custom ones
+ # set(WANT_DEBUG ON)
+-if(WANT_DEBUG)
+-	set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Set Debug Build Type" FORCE)
+-endif()
+-if (WANT_RELEASEWITHDEBUG)
+-	set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING "Set Release with Debug Info Build Type" FORCE)
+-endif()
+-if(NOT WANT_DEBUG AND NOT WANT_RELEASEWITHDEBUG)
+-	set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Set Release Build Type" FORCE)
+-endif()
+-
+ 
+ 
+ #Based on our build type, setup our build options

From d92ccdffbdbf973d1a4efa093b188a06a5dc3a8d 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, 28 Mar 2021 10:39:04 +0700
Subject: [PATCH 62/64] yoshimi: cleanup, don't overwrite CMAKE_BUILD_TYPE

---
 srcpkgs/yoshimi/patches/fix-cflags.patch | 12 ++++++++++++
 srcpkgs/yoshimi/template                 | 13 +------------
 2 files changed, 13 insertions(+), 12 deletions(-)
 create mode 100644 srcpkgs/yoshimi/patches/fix-cflags.patch

diff --git a/srcpkgs/yoshimi/patches/fix-cflags.patch b/srcpkgs/yoshimi/patches/fix-cflags.patch
new file mode 100644
index 000000000000..4baeb82ef4e3
--- /dev/null
+++ b/srcpkgs/yoshimi/patches/fix-cflags.patch
@@ -0,0 +1,12 @@
+Index: src/CMakeLists.txt
+===================================================================
+--- src/CMakeLists.txt.orig
++++ src/CMakeLists.txt
+@@ -262,7 +262,6 @@ if (BuildForDebug)
+     set (CMAKE_CXX_FLAGS_DEBUG ${BuildOptionsDebug})
+     message (STATUS "DEBUG Build, flags: ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_DEBUG}")
+ else()
+-    set (CMAKE_BUILD_TYPE "Release")
+     set (CMAKE_CXX_FLAGS_RELEASE ${BuildOptionsRelease})
+     message (STATUS "RELEASE Build, flags: ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELEASE}")
+ endif ()
diff --git a/srcpkgs/yoshimi/template b/srcpkgs/yoshimi/template
index 0096f7f05710..64a6c9ad433f 100644
--- a/srcpkgs/yoshimi/template
+++ b/srcpkgs/yoshimi/template
@@ -4,6 +4,7 @@ version=1.7.4
 revision=2
 build_wrksrc=src
 build_style=cmake
+configure_args="-DCMAKE_INSTALL_DATAROOTDIR=/usr/share"
 hostmakedepends="pkg-config fltk"
 makedepends="boost-devel jack-devel fltk-devel fftw-devel mxml-devel cairo-devel
  lv2 readline-devel ncurses-devel"
@@ -17,15 +18,3 @@ checksum=27a8e33bda72aafae604e14841bed6373fc9e00ff70c98f1e13215d6a8808318
 case "$XBPS_TARGET_MACHINE" in
 	*-musl) makedepends+=" argp-standalone";;
 esac
-
-configure_args="-DCMAKE_INSTALL_DATAROOTDIR=/usr/share"
-
-pre_configure() {
-	sed -i 's|ncurses|ncursesw|g' CMakeLists.txt
-
-	case "$XBPS_TARGET_MACHINE" in
-		i686*) ;;
-		x86_64*) ;;
-		*) sed -i -e "s|-msse -msse2 -mfpmath=sse||g" CMakeLists.txt;;
-	esac
-}

From 6983b960cbdcbca1660b1bc2ebc0d7990caaadaf 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, 28 Mar 2021 10:49:25 +0700
Subject: [PATCH 63/64] zulucrypt: remove -O3

---
 srcpkgs/zulucrypt/patches/fix-cflags.patch | 26 ++++++++++++++++++++++
 1 file changed, 26 insertions(+)
 create mode 100644 srcpkgs/zulucrypt/patches/fix-cflags.patch

diff --git a/srcpkgs/zulucrypt/patches/fix-cflags.patch b/srcpkgs/zulucrypt/patches/fix-cflags.patch
new file mode 100644
index 000000000000..d77c539c6c13
--- /dev/null
+++ b/srcpkgs/zulucrypt/patches/fix-cflags.patch
@@ -0,0 +1,26 @@
+Index: external_libraries/tcplay/CMakeLists.txt
+===================================================================
+--- external_libraries/tcplay/CMakeLists.txt.orig
++++ external_libraries/tcplay/CMakeLists.txt
+@@ -13,7 +13,7 @@ set (SRCS_LINUX  crypto-gcrypt.c)
+ set (CFLAGS_LINUX  "-D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE")
+ set (CFLAGS_WARN "-w")
+ set (CFLAGS_DEBUG  "-O0 -g3 -DDEBUG")
+-set (CFLAGS_OPT    "-O3")
++set (CFLAGS_OPT    "")
+ set (CFLAGS_VER    "-DMAJ_VER=${VERSION_MAJOR} -DMIN_VER=${VERSION_MINOR}")
+ set (CFLAGS_COMMON "-std=c99 -fPIC  ${CFLAGS_LINUX} ${CFLAGS_WARN} ${CFLAGS_VER}")
+ if ($ENV{DEBUG})
+Index: external_libraries/tcplay/Makefile.classic
+===================================================================
+--- external_libraries/tcplay/Makefile.classic.orig
++++ external_libraries/tcplay/Makefile.classic
+@@ -47,8 +47,6 @@ COMMON_CFLAGS= $(WARNFLAGS) -fPIC $(VER_
+ 
+ ifeq ($(DEBUG), yes)
+   COMMON_CFLAGS+= -O0 -g -DDEBUG
+-else
+-  COMMON_CFLAGS+= -O3
+ endif
+ 
+ ifeq (${SYSTEM}, linux)

From d95105d13a7e881eb1657b074c23aab7af632c66 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, 28 Mar 2021 10:43:24 +0700
Subject: [PATCH 64/64] zbackup: don't overwrite CMAKE_BUILD_TYPE

---
 .../patches/cmake-build-type-none.patch       | 26 +++++++++++++++++++
 1 file changed, 26 insertions(+)
 create mode 100644 srcpkgs/zbackup/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/zbackup/patches/cmake-build-type-none.patch b/srcpkgs/zbackup/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..6d6ebc8e124d
--- /dev/null
+++ b/srcpkgs/zbackup/patches/cmake-build-type-none.patch
@@ -0,0 +1,26 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -6,8 +6,6 @@ project( zbackup )
+ 
+ set( CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" )
+ 
+-set( CMAKE_BUILD_TYPE Release )
+-
+ find_package( ZLIB REQUIRED )
+ include_directories( ${ZLIB_INCLUDE_DIRS} )
+ 
+Index: tartool/CMakeLists.txt
+===================================================================
+--- tartool/CMakeLists.txt.orig
++++ tartool/CMakeLists.txt
+@@ -4,8 +4,6 @@
+ cmake_minimum_required( VERSION 2.6.0 )
+ project( tartool )
+ 
+-set( CMAKE_BUILD_TYPE Release )
+-
+ add_executable( tartool tartool.cc ../file.cc ../dir.cc )
+ 
+ install( TARGETS tartool DESTINATION bin )

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PR PATCH] [Updated] build-style/cmake: set CMAKE_BUILD_TYPE to None
  2021-03-14 13:19 [PR PATCH] [WIP] build-style/cmake: set CMAKE_BUILD_TYPE to None sgn
                   ` (25 preceding siblings ...)
  2021-03-28  3:50 ` sgn
@ 2021-03-28  3:53 ` sgn
  2021-03-28  3:54 ` sgn
                   ` (5 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: sgn @ 2021-03-28  3:53 UTC (permalink / raw)
  To: ml

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

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

https://github.com/sgn/void-packages cmake-build-type-to-None
https://github.com/void-linux/void-packages/pull/29459

build-style/cmake: set CMAKE_BUILD_TYPE to None
- I'm going to build all packages with `build_style=cmake` and fix them one by one before merging this in.

[ci skip]

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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-cmake-build-type-to-None-29459.patch --]
[-- Type: text/x-diff, Size: 119334 bytes --]

From 3cc7e3b966778c3ac31f22bb26a8543d6d0d2d2a 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, 14 Mar 2021 20:18:03 +0700
Subject: [PATCH 01/64] build-style/cmake: set CMAKE_BUILD_TYPE to None

---
 common/build-style/cmake.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/build-style/cmake.sh b/common/build-style/cmake.sh
index 5100a96dfd7b..9d1a1a7a1941 100644
--- a/common/build-style/cmake.sh
+++ b/common/build-style/cmake.sh
@@ -52,7 +52,7 @@ _EOF
 		cmake_args+=" -DCMAKE_TOOLCHAIN_FILE=cross_${XBPS_CROSS_TRIPLET}.cmake"
 	fi
 	cmake_args+=" -DCMAKE_INSTALL_PREFIX=/usr"
-	cmake_args+=" -DCMAKE_BUILD_TYPE=Release"
+	cmake_args+=" -DCMAKE_BUILD_TYPE=None"
 	cmake_args+=" -DCMAKE_INSTALL_LIBDIR=lib${XBPS_TARGET_WORDSIZE}"
 
 	if [[ $build_helper = *"qemu"* ]]; then

From 787b9dfc68dd371af87477287282976842d0c4d2 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: Mon, 15 Mar 2021 08:07:16 +0700
Subject: [PATCH 02/64] amdvlk: allow CMAKE_BUILD_TYPE=None

---
 .../patches/cmake-build-type-none.patch       | 60 +++++++++++++++++++
 1 file changed, 60 insertions(+)
 create mode 100644 srcpkgs/amdvlk/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/amdvlk/patches/cmake-build-type-none.patch b/srcpkgs/amdvlk/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..7a629e58548e
--- /dev/null
+++ b/srcpkgs/amdvlk/patches/cmake-build-type-none.patch
@@ -0,0 +1,60 @@
+Index: llvm-project/llvm/CMakeLists.txt
+===================================================================
+--- llvm-project/llvm/CMakeLists.txt.orig
++++ llvm-project/llvm/CMakeLists.txt
+@@ -251,11 +251,6 @@ endif()
+ 
+ string(TOUPPER "${CMAKE_BUILD_TYPE}" uppercase_CMAKE_BUILD_TYPE)
+ 
+-if (CMAKE_BUILD_TYPE AND
+-    NOT uppercase_CMAKE_BUILD_TYPE MATCHES "^(DEBUG|RELEASE|RELWITHDEBINFO|MINSIZEREL)$")
+-  message(FATAL_ERROR "Invalid value for CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
+-endif()
+-
+ set(LLVM_LIBDIR_SUFFIX "" CACHE STRING "Define suffix of library directory name (32/64)" )
+ 
+ set(LLVM_TOOLS_INSTALL_DIR "bin" CACHE STRING "Path for binary subdirectory (defaults to 'bin')")
+Index: pal/cmake/Modules/AmdCmakeHelper.cmake
+===================================================================
+--- pal/cmake/Modules/AmdCmakeHelper.cmake.orig
++++ pal/cmake/Modules/AmdCmakeHelper.cmake
+@@ -37,11 +37,6 @@ if (CMAKE_CONFIGURATION_TYPES)
+ else()
+     string(TOUPPER "${CMAKE_BUILD_TYPE}" capital_CMAKE_BUILD_TYPE)
+ 
+-    if (CMAKE_BUILD_TYPE AND
+-        NOT capital_CMAKE_BUILD_TYPE MATCHES "^(DEBUG|RELEASE|RELWITHDEBINFO|MINSIZEREL)$")
+-        message(FATAL_ERROR "Invalid value for CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
+-    endif()
+-
+     if(capital_CMAKE_BUILD_TYPE STREQUAL "DEBUG")
+         set(CMAKE_BUILD_TYPE_DEBUG ON)
+         set(CMAKE_BUILD_TYPE_RELEASE OFF)
+Index: xgl/CMakeLists.txt
+===================================================================
+--- xgl/CMakeLists.txt.orig
++++ xgl/CMakeLists.txt
+@@ -181,11 +181,6 @@ if (CMAKE_CONFIGURATION_TYPES)
+ else()
+     string(TOUPPER "${CMAKE_BUILD_TYPE}" capital_CMAKE_BUILD_TYPE)
+ 
+-    if (CMAKE_BUILD_TYPE AND
+-        NOT capital_CMAKE_BUILD_TYPE MATCHES "^(DEBUG|RELEASE|RELWITHDEBINFO|MINSIZEREL)$")
+-        message(FATAL_ERROR "Invalid value for CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
+-    endif()
+-
+     if(capital_CMAKE_BUILD_TYPE STREQUAL "DEBUG")
+         set(CMAKE_BUILD_TYPE_DEBUG ON)
+         set(CMAKE_BUILD_TYPE_RELEASE OFF)
+Index: xgl/icd/CMakeLists.txt
+===================================================================
+--- xgl/icd/CMakeLists.txt.orig
++++ xgl/icd/CMakeLists.txt
+@@ -84,7 +84,6 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Cl
+     endif()
+ 
+     if(CMAKE_BUILD_TYPE_RELEASE)
+-        target_compile_options(xgl PRIVATE -O3)
+         if(XGL_ENABLE_LTO)
+             if(${CMAKE_CXX_COMPILER_ID} MATCHES "GNU")
+                 execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION)

From ed3f21f52a93d4f91c0f76b5164904b53d843184 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: Wed, 17 Mar 2021 06:24:04 +0700
Subject: [PATCH 03/64] eigen*: set CMAKE_BUILD_TYPE to Release

We're going to set default CMAKE_BUILD_TYPE to None soon. Those packages
are header only libraries, no need to waste time on patching.
---
 srcpkgs/eigen/template    | 1 +
 srcpkgs/eigen3.2/template | 1 +
 2 files changed, 2 insertions(+)

diff --git a/srcpkgs/eigen/template b/srcpkgs/eigen/template
index ee825e95f273..072228c16915 100644
--- a/srcpkgs/eigen/template
+++ b/srcpkgs/eigen/template
@@ -3,6 +3,7 @@ pkgname=eigen
 version=3.3.9
 revision=1
 build_style=cmake
+configure_args="-DCMAKE_BUILD_TYPE=Release"
 short_desc="C++ template library for linear algebra (version 3.x)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MPL-2.0, GPL-3.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
diff --git a/srcpkgs/eigen3.2/template b/srcpkgs/eigen3.2/template
index 5715fc1b3a19..7b710534b5e5 100644
--- a/srcpkgs/eigen3.2/template
+++ b/srcpkgs/eigen3.2/template
@@ -4,6 +4,7 @@ version=3.2.10
 revision=3
 wrksrc="eigen-${version}"
 build_style=cmake
+configure_args="-DCMAKE_BUILD_TYPE=Release"
 short_desc="C++ template library for linear algebra (version 3.x)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MPL-2.0, GPL-3.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"

From 6c9a7ad24cb0e2476e88aa3064a79694c97911fb 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: Wed, 17 Mar 2021 07:04:48 +0700
Subject: [PATCH 04/64] embree: don't ignore CXXFLAGS, fix build with ispc
 1.13+

---
 .../embree/patches/uintNN-is-part-of-ispc-1.13.patch | 12 ++++++++++++
 srcpkgs/embree/template                              |  6 ++----
 2 files changed, 14 insertions(+), 4 deletions(-)
 create mode 100644 srcpkgs/embree/patches/uintNN-is-part-of-ispc-1.13.patch

diff --git a/srcpkgs/embree/patches/uintNN-is-part-of-ispc-1.13.patch b/srcpkgs/embree/patches/uintNN-is-part-of-ispc-1.13.patch
new file mode 100644
index 000000000000..5d0b02f3b2e5
--- /dev/null
+++ b/srcpkgs/embree/patches/uintNN-is-part-of-ispc-1.13.patch
@@ -0,0 +1,12 @@
+Index: embree-2.17.7/tutorials/common/common.isph
+===================================================================
+--- embree-2.17.7.orig/tutorials/common/common.isph
++++ embree-2.17.7/tutorials/common/common.isph
+@@ -16,7 +16,3 @@
+ 
+ #pragma once
+ 
+-typedef unsigned int64 uint64;
+-typedef unsigned int32 uint32;
+-typedef unsigned int16 uint16;
+-typedef unsigned int8  uint8;
diff --git a/srcpkgs/embree/template b/srcpkgs/embree/template
index 0bc72f46b6d8..849ec3c26c1d 100644
--- a/srcpkgs/embree/template
+++ b/srcpkgs/embree/template
@@ -4,6 +4,7 @@ version=2.17.7
 revision=2
 archs="x86_64"
 build_style=cmake
+configure_args="-DTBB_ROOT=/usr -DEMBREE_IGNORE_CMAKE_CXX_FLAGS=OFF"
 hostmakedepends="ispc"
 makedepends="libfreeglut-devel libXmu-devel tbb-devel MesaLib-devel libpng-devel
  libopenexr-devel libjpeg-turbo-devel libmagick-devel"
@@ -13,10 +14,7 @@ license="Apache-2.0"
 homepage="https://embree.github.io/"
 distfiles="https://github.com/$pkgname/$pkgname/archive/v$version.tar.gz"
 checksum=c0694f287fa1fbb382aba3a895702e248d92f7e89c0e5f64aefee965482ec04c
-
-nopie=y
-
-configure_args="-DTBB_ROOT=/usr -DENABLE_TUTORIALS=OFF"
+patch_args=-Np1
 
 embree-devel_package() {
 	depends="${sourcepkg}>=${version}_${revision}"

From eb98e5b12ecc7034962ea038027febdbad95face 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: Wed, 17 Mar 2021 07:35:19 +0700
Subject: [PATCH 05/64] ettercap: remove libressl patch, CMAKE_BUILD_TYPE=None

---
 .../patches/allow-build-type-none.patch       | 24 ++++++++++++++
 srcpkgs/ettercap/patches/libressl.patch       | 31 -------------------
 srcpkgs/ettercap/template                     |  9 ++++--
 3 files changed, 31 insertions(+), 33 deletions(-)
 create mode 100644 srcpkgs/ettercap/patches/allow-build-type-none.patch
 delete mode 100644 srcpkgs/ettercap/patches/libressl.patch

diff --git a/srcpkgs/ettercap/patches/allow-build-type-none.patch b/srcpkgs/ettercap/patches/allow-build-type-none.patch
new file mode 100644
index 000000000000..324d75086b05
--- /dev/null
+++ b/srcpkgs/ettercap/patches/allow-build-type-none.patch
@@ -0,0 +1,24 @@
+Index: ettercap-0.8.3.1/CMakeLists.txt
+===================================================================
+--- ettercap-0.8.3.1.orig/CMakeLists.txt
++++ ettercap-0.8.3.1/CMakeLists.txt
+@@ -22,19 +22,6 @@ option(LIBRARY_BUILD "Build for libetter
+ option(INSTALL_DESKTOP "Install ettercap desktop files" ON)
+ 
+ 
+-set(VALID_BUILD_TYPES Debug Release RelWithDebInfo)
+-
+-if(NOT CMAKE_BUILD_TYPE)
+-  # Default to using "Release" as our build type.
+-  set(CMAKE_BUILD_TYPE "Release" CACHE STRING
+-    "Choose the type of build, options are: ${VALID_BUILD_TYPES}." FORCE)
+-endif()
+-list(FIND VALID_BUILD_TYPES ${CMAKE_BUILD_TYPE} contains_valid)
+-if(contains_valid EQUAL -1)
+-  message(FATAL_ERROR "Unknown CMAKE_BUILD_TYPE: '${CMAKE_BUILD_TYPE}'. Valid options are: ${VALID_BUILD_TYPES}")
+-endif()
+-unset(contains_valid)
+-
+ include(CMakeDependentOption)
+ 
+ # If SYSTEM_LIBS is set to off, then all SYSTEM_* options will be
diff --git a/srcpkgs/ettercap/patches/libressl.patch b/srcpkgs/ettercap/patches/libressl.patch
deleted file mode 100644
index 15e0d3c1c9e7..000000000000
--- a/srcpkgs/ettercap/patches/libressl.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From b2f7634c9dbc0ef68640f0571787d92300e9f9f9 Mon Sep 17 00:00:00 2001
-From: Stefan Strogin <stefan@steils.org>
-Date: Sat, 15 Aug 2020 07:18:31 +0300
-Subject: [PATCH] ec_sslwrap: fix compilation with LibreSSL
-
-Disable taking over SNI extension from ClientHello and SSL configuration
-operations until LibreSSL supports the required API.
-
-Fixes: https://github.com/Ettercap/ettercap/issues/1068
----
- src/ec_sslwrap.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git src/ec_sslwrap.c src/ec_sslwrap.c
-index b9f26a142..1e4c24fc1 100644
---- src/ec_sslwrap.c
-+++ src/ec_sslwrap.c
-@@ -71,11 +71,11 @@
- #define TLS_server_method SSLv23_server_method
- #endif
- 
--#if (OPENSSL_VERSION_NUMBER >= 0x10100000L)
-+#if (OPENSSL_VERSION_NUMBER >= 0x10100000L) && !defined(LIBRESSL_VERSION_NUMBER)
- #define HAVE_OPENSSL_1_1_0
- #endif
- 
--#if (OPENSSL_VERSION_NUMBER >= 0x10101000L)
-+#if (OPENSSL_VERSION_NUMBER >= 0x10101000L) && !defined(LIBRESSL_VERSION_NUMBER)
- #define HAVE_OPENSSL_1_1_1
- #endif
- 
diff --git a/srcpkgs/ettercap/template b/srcpkgs/ettercap/template
index 7fe4c340a079..611b4e9aded7 100644
--- a/srcpkgs/ettercap/template
+++ b/srcpkgs/ettercap/template
@@ -3,8 +3,8 @@ pkgname=ettercap
 version=0.8.3.1
 revision=2
 build_style=cmake
-configure_args="-DENABLE_GTK=OFF"
-hostmakedepends="flex"
+configure_args="-DENABLE_GTK=OFF -DBUNDLED_LIBS=OFF"
+hostmakedepends="flex pkg-config"
 makedepends="geoip-devel ncurses-devel openssl-devel libcurl-devel
  libltdl-devel libnet-devel libpcap-devel pcre-devel"
 conf_files="/etc/${pkgname}/etter.conf"
@@ -15,5 +15,10 @@ homepage="http://ettercap.github.com/ettercap/"
 distfiles="https://github.com/Ettercap/ettercap/archive/v${version}.tar.gz"
 checksum=d0c3ef88dfc284b61d3d5b64d946c1160fd04276b448519c1ae4438a9cdffaf3
 lib32disabled=yes
+patch_args=-Np1
 
 CFLAGS="-fcommon"
+
+post_extract() {
+	rm -rf bundled_deps
+}

From 2dab7d0b759055e6f687ff2e759fe7f53b7f02f0 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: Wed, 17 Mar 2021 08:27:10 +0700
Subject: [PATCH 06/64] injeqt: disable coverage

---
 srcpkgs/injeqt/template | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/injeqt/template b/srcpkgs/injeqt/template
index 1e5777fc0f18..78eba09a0249 100644
--- a/srcpkgs/injeqt/template
+++ b/srcpkgs/injeqt/template
@@ -3,7 +3,8 @@ pkgname=injeqt
 version=1.2.0
 revision=2
 build_style=cmake
-hostmakedepends="pkg-config"
+configure_args="-DDISABLE_COVERAGE=ON"
+hostmakedepends="pkg-config qt5-qmake qt5-host-tools"
 makedepends="qt5-devel"
 short_desc="Dependency injection framework for Qt"
 maintainer="Jürgen Buchmüller <pullmoll@t-online.de>"
@@ -12,9 +13,6 @@ homepage="https://github.com/vogel/injeqt/"
 distfiles="https://github.com/vogel/${pkgname}/archive/${version}.tar.gz>${pkgname}-${version}.tar.gz"
 checksum=77540cedb0b26affe993dd18124d796059e34c80a51d9ae6433fdff1860db135
 
-if [ -n "$CROSS_BUILD" ]; then
-	hostmakedepends+=" qt5-host-tools qt5-devel"
-fi
 CXXFLAGS="-fno-lifetime-dse -Wno-error=cast-align"
 
 injeqt-devel_package() {

From 8d4f5b3210b84785b994e4e1e9bc2cdc43478003 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: Wed, 17 Mar 2021 22:26:37 +0700
Subject: [PATCH 07/64] kindd: build with CMAKE_BUILD_TYPE=None

---
 srcpkgs/kindd/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/kindd/template b/srcpkgs/kindd/template
index e634b0f69bf6..4416041de58c 100644
--- a/srcpkgs/kindd/template
+++ b/srcpkgs/kindd/template
@@ -15,7 +15,7 @@ distfiles="${homepage}/archive/${version}.tar.gz"
 checksum=e596f1b1577ff3e83a779e6181252ae2f09731f513d17dd6b95cbc2cf204654f
 
 do_install() {
-	vbin release/kindd
+	vbin build/core/kindd
 	vinstall assets/appconf/kindd.svg 644 usr/share/pixmaps
 	vinstall assets/appconf/kindd.desktop 644 usr/share/applications
 }

From cb3ad0df55b139c7fa5691cf7d48b8286ad3c025 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: Thu, 18 Mar 2021 23:58:53 +0700
Subject: [PATCH 08/64] occt: allow CMAKE_BUILD_TYPE=None

---
 srcpkgs/occt/patches/cmake-build-type-none.patch | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 srcpkgs/occt/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/occt/patches/cmake-build-type-none.patch b/srcpkgs/occt/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..acb06fb55766
--- /dev/null
+++ b/srcpkgs/occt/patches/cmake-build-type-none.patch
@@ -0,0 +1,13 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -4,7 +4,7 @@ set (CMAKE_MODULE_PATH "${CMAKE_SOURCE_D
+ 
+ set (CMAKE_SUPPRESS_REGENERATION TRUE)
+ 
+-set (CMAKE_CONFIGURATION_TYPES Release Debug RelWithDebInfo CACHE INTERNAL "" FORCE)
++set (CMAKE_CONFIGURATION_TYPES None Release Debug RelWithDebInfo CACHE INTERNAL "" FORCE)
+ 
+ # macro: include patched file if it exists
+ macro (OCCT_INCLUDE_CMAKE_FILE BEING_INCLUDED_FILE)

From ce9f8a2d147c6661920eb4269b20e7d7e930b533 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: Fri, 19 Mar 2021 23:07:05 +0700
Subject: [PATCH 09/64] renderdoc: devendor zstd, lz4

---
 .../patches/build-type-none-is-release.patch  | 12 ++++
 .../renderdoc/patches/qmake-no-rpath.patch    | 13 ++++
 .../renderdoc/patches/unvendor-zstd-lz4.patch | 68 +++++++++++++++++++
 srcpkgs/renderdoc/template                    | 15 ++--
 4 files changed, 99 insertions(+), 9 deletions(-)
 create mode 100644 srcpkgs/renderdoc/patches/build-type-none-is-release.patch
 create mode 100644 srcpkgs/renderdoc/patches/qmake-no-rpath.patch
 create mode 100644 srcpkgs/renderdoc/patches/unvendor-zstd-lz4.patch

diff --git a/srcpkgs/renderdoc/patches/build-type-none-is-release.patch b/srcpkgs/renderdoc/patches/build-type-none-is-release.patch
new file mode 100644
index 000000000000..f16b944bc12c
--- /dev/null
+++ b/srcpkgs/renderdoc/patches/build-type-none-is-release.patch
@@ -0,0 +1,12 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -315,6 +315,7 @@ set(RELEASE_MODE 0)
+ 
+ if(cmake_build_type_lower STREQUAL "release" OR
+    cmake_build_type_lower STREQUAL "relwithdebinfo" OR
++   cmake_build_type_lower STREQUAL "none" OR
+    cmake_build_type_lower STREQUAL "minsizerel")
+     add_definitions(-D_RELEASE)
+     message(STATUS "Building RenderDoc in Release mode: ${CMAKE_BUILD_TYPE}")
diff --git a/srcpkgs/renderdoc/patches/qmake-no-rpath.patch b/srcpkgs/renderdoc/patches/qmake-no-rpath.patch
new file mode 100644
index 000000000000..6e6325c53555
--- /dev/null
+++ b/srcpkgs/renderdoc/patches/qmake-no-rpath.patch
@@ -0,0 +1,13 @@
+Index: qrenderdoc/CMakeLists.txt
+===================================================================
+--- qrenderdoc/CMakeLists.txt.orig
++++ qrenderdoc/CMakeLists.txt
+@@ -144,7 +144,7 @@ endif()
+ # and finding dependencies from the cmake build
+ file(WRITE
+      ${CMAKE_BINARY_DIR}/qrenderdoc/qrenderdoc_cmake.pri
+-     "CONFIG+=${QMAKE_CONFIG}\n"
++     "CONFIG+=${QMAKE_CONFIG} no_qt_rpath\n"
+      "\n"
+      "QMAKE_CC=${CMAKE_C_COMPILER}\n"
+      "QMAKE_CXX=${CMAKE_CXX_COMPILER}\n"
diff --git a/srcpkgs/renderdoc/patches/unvendor-zstd-lz4.patch b/srcpkgs/renderdoc/patches/unvendor-zstd-lz4.patch
new file mode 100644
index 000000000000..d4003ded9161
--- /dev/null
+++ b/srcpkgs/renderdoc/patches/unvendor-zstd-lz4.patch
@@ -0,0 +1,68 @@
+Index: renderdoc/CMakeLists.txt
+===================================================================
+--- renderdoc/CMakeLists.txt.orig
++++ renderdoc/CMakeLists.txt
+@@ -213,54 +213,10 @@ set(sources
+     3rdparty/pugixml/pugixml.cpp
+     3rdparty/pugixml/pugixml.hpp
+     3rdparty/pugixml/pugiconfig.hpp
+-    3rdparty/lz4/lz4.c
+-    3rdparty/lz4/lz4.h
+     3rdparty/miniz/miniz.c
+     3rdparty/miniz/miniz.h
+     3rdparty/superluminal/superluminal.cpp
+     3rdparty/superluminal/superluminal.h
+-    3rdparty/zstd/bitstream.h
+-    3rdparty/zstd/compiler.h
+-    3rdparty/zstd/cpu.h
+-    3rdparty/zstd/debug.c
+-    3rdparty/zstd/debug.h
+-    3rdparty/zstd/entropy_common.c
+-    3rdparty/zstd/error_private.c
+-    3rdparty/zstd/error_private.h
+-    3rdparty/zstd/fse.h
+-    3rdparty/zstd/fse_compress.c
+-    3rdparty/zstd/fse_decompress.c
+-    3rdparty/zstd/hist.c
+-    3rdparty/zstd/hist.h
+-    3rdparty/zstd/huf.h
+-    3rdparty/zstd/huf_compress.c
+-    3rdparty/zstd/huf_decompress.c
+-    3rdparty/zstd/mem.h
+-    3rdparty/zstd/pool.c
+-    3rdparty/zstd/pool.h
+-    3rdparty/zstd/threading.c
+-    3rdparty/zstd/threading.h
+-    3rdparty/zstd/xxhash.c
+-    3rdparty/zstd/xxhash.h
+-    3rdparty/zstd/zstd.h
+-    3rdparty/zstd/zstd_common.c
+-    3rdparty/zstd/zstd_compress.c
+-    3rdparty/zstd/zstd_compress_internal.h
+-    3rdparty/zstd/zstd_decompress.c
+-    3rdparty/zstd/zstd_double_fast.c
+-    3rdparty/zstd/zstd_double_fast.h
+-    3rdparty/zstd/zstd_errors.h
+-    3rdparty/zstd/zstd_fast.c
+-    3rdparty/zstd/zstd_fast.h
+-    3rdparty/zstd/zstd_internal.h
+-    3rdparty/zstd/zstd_lazy.c
+-    3rdparty/zstd/zstd_lazy.h
+-    3rdparty/zstd/zstd_ldm.c
+-    3rdparty/zstd/zstd_ldm.h
+-    3rdparty/zstd/zstd_opt.c
+-    3rdparty/zstd/zstd_opt.h
+-    3rdparty/zstd/zstdmt_compress.c
+-    3rdparty/zstd/zstdmt_compress.h
+     3rdparty/stb/stb_image.h
+     3rdparty/stb/stb_image_write.h
+     3rdparty/stb/stb_image_resize.h
+@@ -271,6 +227,8 @@ set(sources
+     3rdparty/tinyfiledialogs/tinyfiledialogs.c
+     3rdparty/tinyfiledialogs/tinyfiledialogs.h)
+ 
++list(APPEND RDOC_LIBRARIES -llz4 -lzstd)
++
+ if(ANDROID)
+     list(APPEND sources
+         data/embedded_files.h
diff --git a/srcpkgs/renderdoc/template b/srcpkgs/renderdoc/template
index 7240e9ebc307..4615d45c52c9 100644
--- a/srcpkgs/renderdoc/template
+++ b/srcpkgs/renderdoc/template
@@ -1,13 +1,14 @@
 # Template file for 'renderdoc'
 pkgname=renderdoc
 version=1.12
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DENABLE_GL=ON -DENABLE_GLES=ON -DENABLE_QRENDERDOC=ON
  -DENABLE_RENDERDOCCMD=ON -DENABLE_VULKAN=ON -DENABLE_XCB=ON -DENABLE_XLIB=ON
  -DENABLE_PYRENDERDOC=ON"
-hostmakedepends="bison autoconf automake pkg-config python3"
+hostmakedepends="bison autoconf automake pkg-config python3 swig"
 makedepends="libX11-devel libxcb-devel xcb-util-keysyms-devel qt5-devel
+ libzstd-devel liblz4-devel
  qt5-svg-devel qt5-x11extras-devel pcre-devel python3-devel"
 short_desc="Stand-alone graphics debugging tool for Vulkan and OpenGL"
 maintainer="Urs Schulz <voidpkgs@ursschulz.de>"
@@ -19,19 +20,14 @@ checksum=4dece1b4cb859a76533b28fcd50e17321acfaa81c3435500a006c4a5ba15fddb
 if [ "$XBPS_TARGET_LIBC" = musl ]; then
 	makedepends+=" libexecinfo-devel"
 	LDLIBS="-lexecinfo"
+	broken="uses RTLD_DL_LINKMAP, RTLD_DEEPBIND, _r_debug"
 fi
 
 if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
 	makedepends+=" libatomic-devel"
 fi
 
-case "$XBPS_TARGET_MACHINE" in
-	*-musl) broken="uses RTLD_DL_LINKMAP, RTLD_DEEPBIND, _r_debug" ;;
-esac
-
-if [ "$CROSS_BUILD" ]; then
-	broken="Cross-compilation can't find python3 interpreter"
-fi
+nocross="Cross-compilation can't find python3 interpreter"
 
 post_patch() {
 	[ -z "$XBPS_TARGET_NO_ATOMIC8" ] && return 0
@@ -40,4 +36,5 @@ post_patch() {
 
 post_install() {
 	vlicense LICENSE.md
+	vlicense docs/credits_acknowledgements.rst
 }

From afd5e743a33c4bd0fcc71624dbe73675e0d77fb9 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: Sat, 20 Mar 2021 00:47:52 +0700
Subject: [PATCH 10/64] python3-occ: build with CMAKE_BUILD_TYPE=None

---
 srcpkgs/python3-occ/template | 1 +
 1 file changed, 1 insertion(+)

diff --git a/srcpkgs/python3-occ/template b/srcpkgs/python3-occ/template
index 705f37457943..3ea0ef5e6387 100644
--- a/srcpkgs/python3-occ/template
+++ b/srcpkgs/python3-occ/template
@@ -5,6 +5,7 @@ revision=1
 archs="i686* x86_64* armv7l* aarch64* ppc*"
 wrksrc="pythonocc-core-${version}"
 build_style=cmake
+configure_args="-DPYTHONOCC_BUILD_TYPE=None -DCMAKE_BUILD_TYPE=None"
 hostmakedepends="python3 swig"
 makedepends="python3-devel occt-devel freetype-devel swig"
 depends="python3 occt freetype"

From 8c94db176853a0c53da72846a68ef9ea21ed6701 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: Fri, 19 Mar 2021 23:38:10 +0700
Subject: [PATCH 11/64] widelands: allow CMAKE_BUILD_TYPE=None

---
 srcpkgs/widelands-data                        |  1 -
 .../patches/cmake-build-type-none.patch       | 63 +++++++++++++++++++
 .../widelands/patches/fix-install-path.patch  | 40 ++++++++++++
 srcpkgs/widelands/template                    | 21 +------
 4 files changed, 105 insertions(+), 20 deletions(-)
 delete mode 120000 srcpkgs/widelands-data
 create mode 100644 srcpkgs/widelands/patches/cmake-build-type-none.patch
 create mode 100644 srcpkgs/widelands/patches/fix-install-path.patch

diff --git a/srcpkgs/widelands-data b/srcpkgs/widelands-data
deleted file mode 120000
index e9fbf89517f2..000000000000
--- a/srcpkgs/widelands-data
+++ /dev/null
@@ -1 +0,0 @@
-widelands
\ No newline at end of file
diff --git a/srcpkgs/widelands/patches/cmake-build-type-none.patch b/srcpkgs/widelands/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..3d210854741b
--- /dev/null
+++ b/srcpkgs/widelands/patches/cmake-build-type-none.patch
@@ -0,0 +1,63 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -202,7 +202,7 @@ elseif(CMAKE_BUILD_TYPE STREQUAL "RelWit
+   set(WL_DEBUG_FLAGS "-DNDEBUG -DNOPARACHUTE")
+   option(OPTION_ASAN "Build with AddressSanitizer" ON)
+ else()
+-  message(FATAL_ERROR "Unknown CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
++  set(WL_DEBUG_FLAGS "-DNDEBUG -DNOPARACHUTE")
+ endif()
+ 
+ wl_add_flag(WL_GENERIC_CXX_FLAGS "-std=c++11")
+@@ -353,7 +353,7 @@ endif (OPTION_BUILD_TESTS)
+ install (
+   FILES ${CMAKE_CURRENT_BINARY_DIR}/VERSION
+   DESTINATION ${WL_INSTALL_BASEDIR}
+-  CONFIGURATIONS Debug;Release
++  CONFIGURATIONS Debug
+   COMPONENT CoreVersionFile
+ )
+ 
+@@ -378,7 +378,6 @@ install(
+     data/txts
+     data/world
+   DESTINATION ${WL_INSTALL_DATADIR}
+-  CONFIGURATIONS Debug;Release
+   COMPONENT CoreDataFiles
+ )
+ 
+@@ -386,7 +385,6 @@ install(
+   DIRECTORY
+     data/maps
+   DESTINATION ${WL_INSTALL_DATADIR}
+-  CONFIGURATIONS Debug;Release
+   COMPONENT MapFiles
+ )
+ 
+@@ -395,7 +393,6 @@ install(
+     data/music
+     data/sound
+   DESTINATION ${WL_INSTALL_DATADIR}
+-  CONFIGURATIONS Debug;Release
+   COMPONENT MusicFiles
+ )
+ 
+@@ -405,7 +402,7 @@ install(
+     CREDITS
+     ChangeLog
+   DESTINATION ${WL_INSTALL_BASEDIR}
+-  CONFIGURATIONS Debug;Release
++  CONFIGURATIONS Debug
+   COMPONENT CoreLicenseFiles
+ )
+ 
+@@ -424,7 +421,6 @@ install(
+   DIRECTORY
+     ${CMAKE_CURRENT_BINARY_DIR}/locale/
+   DESTINATION ${WL_INSTALL_DATADIR}/locale
+-  CONFIGURATIONS Debug;Release
+   COMPONENT CoreLanguageFiles
+ )
+ 
diff --git a/srcpkgs/widelands/patches/fix-install-path.patch b/srcpkgs/widelands/patches/fix-install-path.patch
new file mode 100644
index 000000000000..6bb461389f03
--- /dev/null
+++ b/srcpkgs/widelands/patches/fix-install-path.patch
@@ -0,0 +1,40 @@
+Index: cmake/WlFunctions.cmake
+===================================================================
+--- cmake/WlFunctions.cmake.orig
++++ cmake/WlFunctions.cmake
+@@ -289,5 +289,5 @@ function(wl_binary NAME)
+ 
+   #Quoting the CMake documentation on DESTINATION:
+   #"If a relative path is given it is interpreted relative to the value of CMAKE_INSTALL_PREFIX"
+-  install(TARGETS ${NAME} DESTINATION "." COMPONENT ExecutableFiles)
++  install(TARGETS ${NAME} DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT ExecutableFiles)
+ endfunction()
+Index: xdg/CMakeLists.txt
+===================================================================
+--- xdg/CMakeLists.txt.orig
++++ xdg/CMakeLists.txt
+@@ -6,19 +6,19 @@ set(XDG_APPLICATION_ID "org.widelands.Wi
+ list(APPEND icon_sizes "16" "32" "48" "64" "128")
+ foreach (icon_size ${icon_sizes})
+   #install(FILES ${CMAKE_SOURCE_DIR}/data/images/logos/wl-ico-${icon_size}.png DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/${icon_size}x${icon_size}/apps RENAME ${XDG_APPLICATION_ID}.png)
+-  install(FILES ${CMAKE_SOURCE_DIR}/data/images/logos/wl-ico-${icon_size}.png DESTINATION ../share/icons/hicolor/${icon_size}x${icon_size}/apps RENAME ${XDG_APPLICATION_ID}.png)
++  install(FILES ${CMAKE_SOURCE_DIR}/data/images/logos/wl-ico-${icon_size}.png DESTINATION share/icons/hicolor/${icon_size}x${icon_size}/apps RENAME ${XDG_APPLICATION_ID}.png)
+ endforeach (icon_size ${icon_sizes})
+ #install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${CMAKE_PROJECT_NAME}.6           DESTINATION ${CMAKE_INSTALL_MANDIR}/man6)
+-install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${CMAKE_PROJECT_NAME}.6           DESTINATION ../share/man/man6)
++install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${CMAKE_PROJECT_NAME}.6           DESTINATION share/man/man6)
+ #install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${XDG_APPLICATION_ID}.desktop     DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications)
+-install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${XDG_APPLICATION_ID}.desktop     DESTINATION ../share/applications)
++install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${XDG_APPLICATION_ID}.desktop     DESTINATION share/applications)
+ #install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${XDG_APPLICATION_ID}.appdata.xml DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/metainfo)
+-install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${XDG_APPLICATION_ID}.appdata.xml DESTINATION ../share/metainfo)
++install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${XDG_APPLICATION_ID}.appdata.xml DESTINATION share/metainfo)
+ 
+ find_program(GTK_UPDATE_ICON_CACHE NAMES gtk-update-icon-cache)
+ if (GTK_UPDATE_ICON_CACHE)
+   #install(CODE "execute_process (COMMAND ${GTK_UPDATE_ICON_CACHE} -t -f ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor ||: )")
+-  install(CODE "execute_process (COMMAND ${GTK_UPDATE_ICON_CACHE} -t -f ${CMAKE_INSTALL_PREFIX}/../share/icons/hicolor ||: )")
++  install(CODE "execute_process (COMMAND ${GTK_UPDATE_ICON_CACHE} -t -f ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor ||: )")
+ else (GTK_UPDATE_ICON_CACHE)
+   message(WARNING "gtk-update-icon-cache not found!")
+ endif (GTK_UPDATE_ICON_CACHE)
diff --git a/srcpkgs/widelands/template b/srcpkgs/widelands/template
index 6cee85087ea7..cfa2c10993e0 100644
--- a/srcpkgs/widelands/template
+++ b/srcpkgs/widelands/template
@@ -1,7 +1,7 @@
 # Template file for 'widelands'
 pkgname=widelands
 version=21
-revision=3
+revision=4
 wrksrc="${pkgname}-build${version}"
 build_style=cmake
 configure_args="-DOPENGL_INCLUDE_DIR=${XBPS_CROSS_BASE}/usr/include
@@ -10,13 +10,13 @@ hostmakedepends="python3 pkg-config gettext"
 makedepends="boost-devel icu-devel minizip-devel gettext-devel
  glu-devel glew-devel SDL2-devel SDL2_gfx-devel SDL2_image-devel
  SDL2_net-devel SDL2_mixer-devel SDL2_ttf-devel"
-depends="${pkgname}-data-${version}_${revision}"
 short_desc="Real-time strategy game"
 maintainer="Jürgen Buchmüller <pullmoll@t-online.de>"
 license="GPL-2.0-or-later"
 homepage="http://www.widelands.org/"
 distfiles="https://github.com/widelands/widelands/archive/build${version}.tar.gz>${pkgname}-${version}.tar.gz"
 checksum=601e0e4c6f91b3fb0ece2cd1b83ecfb02344a1b9194fbb70ef3f70e06994e357
+replaces="widelands-data>=0"
 
 CXXFLAGS="-DU_USING_ICU_NAMESPACE=1"
 
@@ -29,22 +29,5 @@ if [ "$CROSS_BUILD" ]; then
 fi
 
 post_install() {
-	# For some reason the binary is installed as /usr/widelands - move it
-	vmkdir usr/bin
-	mv ${DESTDIR}/usr/${pkgname} ${DESTDIR}/usr/bin
-	vmkdir usr/share
-	mv ${DESTDIR}/share/* ${DESTDIR}/usr/share/
-	rmdir ${DESTDIR}/share
-
-	# Remove files not needed in the package
-	rm -f ${DESTDIR}/usr/COPYING ${DESTDIR}/usr/CREDITS ${DESTDIR}/usr/ChangeLog ${DESTDIR}/usr/VERSION
-
 	vinstall ${FILESDIR}/${pkgname}.desktop 644 usr/share/applications
 }
-
-widelands-data_package() {
-	short_desc+=" - data files"
-	pkg_install() {
-		vmove usr/share/widelands
-	}
-}

From 726575d47d33a165d9f3c42359df8e1cf1a6fc57 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: Sat, 20 Mar 2021 09:49:25 +0700
Subject: [PATCH 12/64] zziplib: fix SONAME when build with
 -DCMAKE_BUILD_TYPE=None

---
 .../cmake-build-type-none-soname.patch        | 35 +++++++++++++++++++
 srcpkgs/zziplib/template                      |  1 +
 2 files changed, 36 insertions(+)
 create mode 100644 srcpkgs/zziplib/patches/cmake-build-type-none-soname.patch

diff --git a/srcpkgs/zziplib/patches/cmake-build-type-none-soname.patch b/srcpkgs/zziplib/patches/cmake-build-type-none-soname.patch
new file mode 100644
index 000000000000..2d31b5b8a46a
--- /dev/null
+++ b/srcpkgs/zziplib/patches/cmake-build-type-none-soname.patch
@@ -0,0 +1,35 @@
+Index: zziplib-0.13.72/zzip/CMakeLists.txt
+===================================================================
+--- zziplib-0.13.72.orig/zzip/CMakeLists.txt
++++ zziplib-0.13.72/zzip/CMakeLists.txt
+@@ -190,15 +190,18 @@ target_include_directories (libzzipmmapp
+ endif()
+ 
+ set_target_properties(libzzip PROPERTIES OUTPUT_NAME "zzip" RELEASE_POSTFIX "-${RELNUM}")
++set_target_properties(libzzip PROPERTIES OUTPUT_NAME "zzip" NONE_POSTFIX "-${RELNUM}")
+ SET_TARGET_PROPERTIES(libzzip PROPERTIES VERSION ${VERNUM}.${FIXNUM} SOVERSION ${VERNUM})
+ 
+ if(ZZIPFSEEKO)
+ set_target_properties(libzzipfseeko PROPERTIES OUTPUT_NAME "zzipfseeko" RELEASE_POSTFIX "-${RELNUM}")
++set_target_properties(libzzipfseeko PROPERTIES OUTPUT_NAME "zzipfseeko" NONE_POSTFIX "-${RELNUM}")
+ SET_TARGET_PROPERTIES(libzzipfseeko PROPERTIES VERSION ${VERNUM}.${FIXNUM} SOVERSION ${VERNUM})
+ endif()
+ 
+ if(ZZIPMMAPPED)
+ set_target_properties(libzzipmmapped PROPERTIES OUTPUT_NAME "zzipmmapped" RELEASE_POSTFIX "-${RELNUM}")
++set_target_properties(libzzipmmapped PROPERTIES OUTPUT_NAME "zzipmmapped" NONE_POSTFIX "-${RELNUM}")
+ SET_TARGET_PROPERTIES(libzzipmmapped PROPERTIES VERSION ${VERNUM}.${FIXNUM} SOVERSION ${VERNUM})
+ endif()
+ 
+Index: zziplib-0.13.72/zzipwrap/CMakeLists.txt
+===================================================================
+--- zziplib-0.13.72.orig/zzipwrap/CMakeLists.txt
++++ zziplib-0.13.72/zzipwrap/CMakeLists.txt
+@@ -49,6 +49,7 @@ target_link_libraries(libzzipwrap libzzi
+ target_include_directories(libzzipwrap PRIVATE "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}")
+ 
+ set_target_properties(libzzipwrap PROPERTIES OUTPUT_NAME "zzipwrap" RELEASE_POSTFIX "-${RELNUM}")
++set_target_properties(libzzipwrap PROPERTIES OUTPUT_NAME "zzipwrap" NONE_POSTFIX "-${RELNUM}")
+ SET_TARGET_PROPERTIES(libzzipwrap PROPERTIES VERSION ${VERNUM}.${FIXNUM} SOVERSION ${VERNUM})
+ set_target_properties(libzzipwrap PROPERTIES DEFINE_SYMBOL "libzzip_EXPORTS")
+ 
diff --git a/srcpkgs/zziplib/template b/srcpkgs/zziplib/template
index ab5af234af62..2026f3e4a521 100644
--- a/srcpkgs/zziplib/template
+++ b/srcpkgs/zziplib/template
@@ -12,6 +12,7 @@ homepage="https://github.com/gdraheim/zziplib"
 changelog="https://raw.githubusercontent.com/gdraheim/zziplib/master/ChangeLog"
 distfiles="https://github.com/gdraheim/zziplib/archive/v${version}.tar.gz"
 checksum=93ef44bf1f1ea24fc66080426a469df82fa631d13ca3b2e4abaeab89538518dc
+patch_args=-Np1
 
 if [ "$CROSS_BUILD" ]; then
 	configure_args+=" -DZZIPTEST=OFF"

From 788780b89a95f5b604d1f06839e54dc111811aa1 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, 21 Mar 2021 15:28:04 +0700
Subject: [PATCH 13/64] mellowplayer: fix build

---
 srcpkgs/mellowplayer/patches/no-werror.patch | 13 +++++++++++++
 srcpkgs/mellowplayer/template                | 13 +++++++------
 2 files changed, 20 insertions(+), 6 deletions(-)
 create mode 100644 srcpkgs/mellowplayer/patches/no-werror.patch

diff --git a/srcpkgs/mellowplayer/patches/no-werror.patch b/srcpkgs/mellowplayer/patches/no-werror.patch
new file mode 100644
index 000000000000..7e678453a123
--- /dev/null
+++ b/srcpkgs/mellowplayer/patches/no-werror.patch
@@ -0,0 +1,13 @@
+Index: MellowPlayer-3.6.6/src/3rdparty/boost/di.hpp
+===================================================================
+--- MellowPlayer-3.6.6.orig/src/3rdparty/boost/di.hpp
++++ MellowPlayer-3.6.6/src/3rdparty/boost/di.hpp
+@@ -67,7 +67,7 @@ BOOST_DI_CFG_FWD
+ #pragma clang diagnostic error "-Wundefined-internal"
+ #pragma clang diagnostic ignored "-Wmissing-field-initializers"
+ #elif defined(__GCC__)
+-#pragma GCC diagnostic error "-Wdeprecated-declarations"
++#pragma GCC diagnostic warning "-Wdeprecated-declarations"
+ #pragma GCC diagnostic push
+ #if (__GNUC__ < 6)
+ #pragma GCC diagnostic error "-Werror"
diff --git a/srcpkgs/mellowplayer/template b/srcpkgs/mellowplayer/template
index 2f8f13960ca6..cfd8a185556f 100644
--- a/srcpkgs/mellowplayer/template
+++ b/srcpkgs/mellowplayer/template
@@ -4,7 +4,7 @@ version=3.6.6
 revision=1
 wrksrc="MellowPlayer-${version}"
 build_style=cmake
-hostmakedepends="pkg-config qt5-tools qt5-qmake"
+hostmakedepends="pkg-config qt5-tools qt5-qmake qt5-host-tools"
 makedepends="qt5-declarative-devel qt5-quickcontrols2-devel
  qt5-plugin-mysql qt5-plugin-pgsql qt5-plugin-sqlite
  qt5-plugin-tds qt5-plugin-odbc
@@ -17,11 +17,12 @@ license="GPL-2.0-or-later"
 homepage="https://colinduquesnoy.gitlab.io/MellowPlayer/"
 distfiles="https://gitlab.com/ColinDuquesnoy/MellowPlayer/-/archive/${version}/MellowPlayer-${version}.tar.bz2"
 checksum=17b8b25ca6b3d27b223f8be6ad80186ae5bd17ce762eb04ecd8b0e82e687b327
+patch_args=-Np1
 
-if [ "$CROSS_BUILD" ]; then
-	hostmakedepends+=" qt5-host-tools"
+if [ "$XBPS_WORDSIZE" != "$XBPS_TARGET_WORDSIZE" ]; then
+	broken="webengine can be built only if word size matches"
 fi
 
-case "$XBPS_TARGET_MACHINE" in
-	arm*) broken="qt5-webengine not available" ;;
-esac
+if [ "$XBPS_TARGET_ENDIAN" != "le" ]; then
+	broken="webengine only supports little endian"
+fi

From 82c17331775250c0edfdeb92e6292f53a974454a 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, 21 Mar 2021 15:43:09 +0700
Subject: [PATCH 14/64] ispc: fix CMAKE_BUILD_TYPE=None

---
 .../ispc/patches/cmake-build-type-none.patch   | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
 create mode 100644 srcpkgs/ispc/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/ispc/patches/cmake-build-type-none.patch b/srcpkgs/ispc/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..411e353c7314
--- /dev/null
+++ b/srcpkgs/ispc/patches/cmake-build-type-none.patch
@@ -0,0 +1,18 @@
+Index: ispc-1.15.0/CMakeLists.txt
+===================================================================
+--- ispc-1.15.0.orig/CMakeLists.txt
++++ ispc-1.15.0/CMakeLists.txt
+@@ -157,13 +157,6 @@ set(OUTPUT_RELEASE Release/bin)
+ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin )
+ 
+ if(CMAKE_BUILD_TYPE)
+-    # Validate build type
+-    set(CONFIGURATION_TYPES "Debug;Release;RelWithDebInfo")
+-
+-    string(FIND "${CONFIGURATION_TYPES}" "${CMAKE_BUILD_TYPE}" MATCHED_CONFIG)
+-    if (${MATCHED_CONFIG} EQUAL -1)
+-         message(FATAL_ERROR "CMAKE_BUILD_TYPE (${CMAKE_BUILD_TYPE}) allows only the following values: ${CONFIGURATION_TYPES}")
+-    endif()
+ else(NOT CMAKE_BUILD_TYPE)
+     set(CMAKE_BUILD_TYPE "Release")
+     message(STATUS "Build type not specified: Use Release by default.")

From 9d83ee550ef1bb0b189f6611233c3aa3f0b24468 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, 21 Mar 2021 15:56:50 +0700
Subject: [PATCH 15/64] darktable: fix CMAKE_BUILD_TYPE=None

---
 .../darktable/patches/cmake-build-type-none.patch  | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
 create mode 100644 srcpkgs/darktable/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/darktable/patches/cmake-build-type-none.patch b/srcpkgs/darktable/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..7101f9c1a0e7
--- /dev/null
+++ b/srcpkgs/darktable/patches/cmake-build-type-none.patch
@@ -0,0 +1,14 @@
+Index: src/external/rawspeed/cmake/build-type.cmake
+===================================================================
+--- src/external/rawspeed/cmake/build-type.cmake.orig
++++ src/external/rawspeed/cmake/build-type.cmake
+@@ -27,9 +27,6 @@ string(TOUPPER "${RAWSPEED_SPECIAL_BUILD
+ 
+ # is this one of the known build types?
+ list (FIND CMAKE_CONFIGURATION_TYPES_UPPERCASE ${CMAKE_BUILD_TYPE_UPPERCASE} BUILD_TYPE_IS_KNOWN)
+-if (${BUILD_TYPE_IS_KNOWN} EQUAL -1)
+- message(SEND_ERROR "Unknown build type: ${CMAKE_BUILD_TYPE_UPPERCASE}. Please specify one of: ${CMAKE_CONFIGURATION_TYPES}")
+-endif()
+ 
+ # is this a special build?
+ list (FIND RAWSPEED_SPECIAL_BUILD_TYPES_UPPERCASE ${CMAKE_BUILD_TYPE_UPPERCASE} IS_SPECIAL_BUILD)

From 6c58109beec94dcf8d9d092101ae2b797139251b 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, 21 Mar 2021 15:33:29 +0700
Subject: [PATCH 16/64] hedgewars: merge -data back

---
 srcpkgs/hedgewars-data                        |  1 -
 .../patches/cmake-build-type-none.patch       | 30 +++++++++++++++++++
 srcpkgs/hedgewars/template                    | 23 +++++---------
 3 files changed, 38 insertions(+), 16 deletions(-)
 delete mode 120000 srcpkgs/hedgewars-data
 create mode 100644 srcpkgs/hedgewars/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/hedgewars-data b/srcpkgs/hedgewars-data
deleted file mode 120000
index b57dc45ebadc..000000000000
--- a/srcpkgs/hedgewars-data
+++ /dev/null
@@ -1 +0,0 @@
-hedgewars
\ No newline at end of file
diff --git a/srcpkgs/hedgewars/patches/cmake-build-type-none.patch b/srcpkgs/hedgewars/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..b4e0c186717c
--- /dev/null
+++ b/srcpkgs/hedgewars/patches/cmake-build-type-none.patch
@@ -0,0 +1,30 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -54,7 +54,7 @@ option(NOVERSIONINFOUPDATE "Disable upda
+ 
+ 
+ if(BUILD_ENGINE_C AND NOT NOVIDEOREC)
+-    if((CMAKE_BUILD_TYPE STREQUAL "Release") OR (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo"))
++    if((CMAKE_BUILD_TYPE STREQUAL "Release") OR (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo") OR (CMAKE_BUILD_TYPE STREQUAL "None"))
+         message("NOTE: Video recorder support disabled. It's incompatible with BUILD_ENGINE_C")
+         set(BUILD_ENGINE_C ON CACHE STRING "Required for BUILD_ENGINE_JS" FORCE)
+     else()
+@@ -93,7 +93,7 @@ set(CPACK_PACKAGE_VERSION_MAJOR 1)
+ set(CPACK_PACKAGE_VERSION_MINOR 0)
+ set(CPACK_PACKAGE_VERSION_PATCH 0)
+ set(HEDGEWARS_PROTO_VER 59)
+-if((CMAKE_BUILD_TYPE STREQUAL "Release") OR (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo"))
++if((CMAKE_BUILD_TYPE STREQUAL "Release") OR (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo") OR (CMAKE_BUILD_TYPE STREQUAL "None"))
+     set(HEDGEWARS_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
+ else()
+     set(HEDGEWARS_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}-dev")
+@@ -114,6 +114,7 @@ include(${CMAKE_MODULE_PATH}/platform.cm
+ if(CMAKE_BUILD_TYPE)
+     if(NOT((CMAKE_BUILD_TYPE STREQUAL "Release") OR
+            (CMAKE_BUILD_TYPE STREQUAL "Debug") OR
++	   (CMAKE_BUILD_TYPE STREQUAL "None") OR
+            (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")))
+         set(CMAKE_BUILD_TYPE ${default_build_type} CACHE STRING "Build type (Debug/Release/RelWithDebInfo)" FORCE)
+         message(STATUS "Unknown build type ${CMAKE_BUILD_TYPE}, using default (${default_build_type})")
diff --git a/srcpkgs/hedgewars/template b/srcpkgs/hedgewars/template
index d2294cf572f5..f413a965ff2e 100644
--- a/srcpkgs/hedgewars/template
+++ b/srcpkgs/hedgewars/template
@@ -1,15 +1,15 @@
 # Template file for 'hedgewars'
 pkgname=hedgewars
 version=1.0.0
-revision=2
+revision=3
 wrksrc="${pkgname}-src-${version}"
 build_style=cmake
 configure_args="-DNOSERVER=1 -DDATA_INSTALL_DIR=/usr/share/${pkgname}
- -DPHYSFS_SYSTEM=1 -DCMAKE_VERBOSE_MAKEFILE=1 -DMINIMAL_FLAGS=1"
-hostmakedepends="lua51 pkg-config"
+ -DPHYSFS_SYSTEM=1 -DMINIMAL_FLAGS=1"
+hostmakedepends="lua51 pkg-config qt5-qmake qt5-host-tools"
 makedepends="ffmpeg-devel lua51-devel physfs-devel qt5-tools-devel SDL2_image-devel
  SDL2_mixer-devel SDL2_net-devel SDL2_ttf-devel"
-depends="hedgewars-data>=${version}_${revision} libfreeglut"
+depends="libfreeglut"
 short_desc="Funny turn-based artillery game, featuring fighting Hedgehogs!"
 maintainer="Jakub Skrzypnik <jot.skrzyp@gmail.com>"
 license="GPL-2.0-only"
@@ -18,10 +18,9 @@ distfiles="https://hedgewars.org/download/releases/hedgewars-src-${version}.tar.
 checksum=211634e61f2e4beecc3c98c6f749601fcd08321fda1ba969b3b3832a004f155b
 nopie_files="/usr/bin/hwengine"
 nocross="Needs investigation: fails to link hwengine"
-
-if [ -n "$CROSS_BUILD" ]; then
-	hostmakedepends+=" qt5-devel"
-fi
+replaces="hedgewars-data>=0"
+export CMAKE_GENERATOR="Unix Makefiles"
+make_cmd=make
 
 case $XBPS_TARGET_MACHINE in
 	x86_64*)
@@ -38,6 +37,7 @@ esac
 
 if [ -n "$_use_c_engine" ]; then
 	hostmakedepends+=" glew-devel libatomic-devel ghc clang"
+	makedepends+=" glew-devel libatomic-devel"
 	configure_args+=" -DBUILD_ENGINE_C=1"
 	nopie_files+=" /usr/bin/hedgewars"
 fi
@@ -56,10 +56,3 @@ pre_configure() {
 post_install() {
 	vinstall ${DESTDIR}/usr/share/hedgewars/Data/misc/hedgewars.desktop 644 usr/share/applications
 }
-
-hedgewars-data_package() {
-	short_desc+=" - data files"
-	pkg_install() {
-		vmove usr/share/hedgewars/Data
-	}
-}

From 80124e3f4e8494f07b65486b3ea9ad38fb2ae925 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, 21 Mar 2021 16:41:58 +0700
Subject: [PATCH 17/64] mariadb: fix for CMAKE_BUILD_TYPE=None

---
 srcpkgs/mariadb/template | 32 ++++++++++++++------------------
 1 file changed, 14 insertions(+), 18 deletions(-)

diff --git a/srcpkgs/mariadb/template b/srcpkgs/mariadb/template
index 437ff757b383..78d5e2dbdbe8 100644
--- a/srcpkgs/mariadb/template
+++ b/srcpkgs/mariadb/template
@@ -34,35 +34,31 @@ replaces="mysql>=0"
 conf_files="/etc/mysql/my.cnf"
 system_accounts="mysql"
 mysql_homedir="/var/lib/mysql"
-CFLAGS="-w -fcommon"
+CFLAGS="-w -fcommon -DDBUG_OFF=1"
+CXXFLAGS="-DDBUG_OFF=1"
 
 pre_configure() {
 	# We need some host binaries before starting cross compilation.
 	if [ "$CROSS_BUILD" ]; then
+		mkdir -p build.native
 		# XXX still broken: jemalloc configure execs host bins.
-		CC= CXX= CPP= LD= AR= AS= RANLIB= CFLAGS= CXXFLAGS= LDFLAGS= cmake .
-		make comp_err comp_sql gen_lex_hash gen_lex_token
-		mkdir bin.host
-		cp extra/comp_err bin.host
-		cp scripts/comp_sql bin.host
-		cp sql/gen_lex_hash bin.host
-		cp sql/gen_lex_token bin.host
-		make clean
-		rm CMakeCache.txt
+		CC= CXX= CPP= LD= AR= AS= RANLIB= CFLAGS= CXXFLAGS= LDFLAGS= \
+			cmake -S . -B build.native
+		make -C build.native comp_err comp_sql gen_lex_hash gen_lex_token
 	fi
 }
 
 pre_build() {
 	if [ "$CROSS_BUILD" ]; then
 		# CMake complains if those binaries ain't in build
-		cp bin.host/comp_err ${wrksrc}/extra
-		cp bin.host/comp_err ${wrksrc}/build/extra
-		cp bin.host/comp_sql ${wrksrc}/scripts
-		cp bin.host/comp_sql ${wrksrc}/build/scripts
-		cp bin.host/gen_lex_hash ${wrksrc}/sql
-		cp bin.host/gen_lex_hash ${wrksrc}/build/sql
-		cp bin.host/gen_lex_token ${wrksrc}/sql
-		cp bin.host/gen_lex_token ${wrksrc}/build/sql
+		cp build.native/extra/comp_err ${wrksrc}/extra
+		cp build.native/extra/comp_err ${wrksrc}/build/extra
+		cp build.native/scripts/comp_sql ${wrksrc}/scripts
+		cp build.native/scripts/comp_sql ${wrksrc}/build/scripts
+		cp build.native/sql/gen_lex_hash ${wrksrc}/sql
+		cp build.native/sql/gen_lex_hash ${wrksrc}/build/sql
+		cp build.native/sql/gen_lex_token ${wrksrc}/sql
+		cp build.native/sql/gen_lex_token ${wrksrc}/build/sql
 		export PATH=${PATH}:${wrksrc}/extra:${wrksrc}/scripts:${wrksrc}/sql
 	fi
 	export LD_LIBRARY_PATH=${wrksrc}/build/storage/tokudb/ft-index/portability

From 52f92667dbe95fa97456fd440e0e7b629df95366 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: Thu, 25 Mar 2021 07:58:28 +0700
Subject: [PATCH 18/64] EternalTerminal: remove -ggdb3

---
 .../EternalTerminal/patches/fix-cflags.patch    | 17 +++++++++++++++++
 srcpkgs/EternalTerminal/template                |  1 +
 2 files changed, 18 insertions(+)
 create mode 100644 srcpkgs/EternalTerminal/patches/fix-cflags.patch

diff --git a/srcpkgs/EternalTerminal/patches/fix-cflags.patch b/srcpkgs/EternalTerminal/patches/fix-cflags.patch
new file mode 100644
index 000000000000..e6fcd432f7e7
--- /dev/null
+++ b/srcpkgs/EternalTerminal/patches/fix-cflags.patch
@@ -0,0 +1,17 @@
+Index: EternalTerminal-et-v6.0.13/CMakeLists.txt
+===================================================================
+--- EternalTerminal-et-v6.0.13.orig/CMakeLists.txt
++++ EternalTerminal-et-v6.0.13/CMakeLists.txt
+@@ -26,12 +26,6 @@ if(DISABLE_CRASH_LOG)
+ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DELPP_DISABLE_DEFAULT_CRASH_HANDLING")
+ ENDIF(DISABLE_CRASH_LOG)
+ 
+-if(UNIX)
+-  # Enable debug info
+-  SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -ggdb3")
+-  SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -ggdb3")
+-endif()
+-
+ # Enable C++-11
+ set(CMAKE_CXX_STANDARD 11)
+ set(CMAKE_CXX_STANDARD_REQUIRED ON)
diff --git a/srcpkgs/EternalTerminal/template b/srcpkgs/EternalTerminal/template
index 7bac78d2ffd4..bc92e47743dd 100644
--- a/srcpkgs/EternalTerminal/template
+++ b/srcpkgs/EternalTerminal/template
@@ -13,6 +13,7 @@ homepage="https://eternalterminal.dev/"
 distfiles="https://github.com/MisterTea/EternalTerminal/archive/et-v${version}.tar.gz"
 checksum=728c3a444d666897c710e33fe473d8d289263a59574451b13aa53ec3c6ac88b3
 system_accounts="_eternal"
+patch_args=-Np1
 
 LDFLAGS="-lgflags"
 

From 9e9ab52094ef9e867fd5548c0811637a2b8f1379 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: Thu, 25 Mar 2021 08:20:29 +0700
Subject: [PATCH 19/64] OTPClient: respect CFLAGS

---
 srcpkgs/OTPClient/patches/fix-cflags.patch | 17 +++++++++++++++++
 srcpkgs/OTPClient/template                 |  1 +
 2 files changed, 18 insertions(+)
 create mode 100644 srcpkgs/OTPClient/patches/fix-cflags.patch

diff --git a/srcpkgs/OTPClient/patches/fix-cflags.patch b/srcpkgs/OTPClient/patches/fix-cflags.patch
new file mode 100644
index 000000000000..ae70f441538f
--- /dev/null
+++ b/srcpkgs/OTPClient/patches/fix-cflags.patch
@@ -0,0 +1,17 @@
+Index: OTPClient-2.4.2/CMakeLists.txt
+===================================================================
+--- OTPClient-2.4.2.orig/CMakeLists.txt
++++ OTPClient-2.4.2/CMakeLists.txt
+@@ -11,11 +11,10 @@ option(BUILD_GUI "Build the GUI" ON)
+ option(BUILD_CLI "Build the CLI" ON)
+ 
+ set(CMAKE_C_STANDARD 11)
+-set(CMAKE_C_FLAGS "-Wall -Wextra -O3 -Wformat=2 -Wmissing-format-attribute -fstack-protector-strong -Wundef -Wmissing-format-attribute")
++set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wformat=2 -Wmissing-format-attribute -fstack-protector-strong -Wundef -Wmissing-format-attribute")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fdiagnostics-color=always -Wstrict-prototypes -Wunreachable-code")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wchar-subscripts -Wwrite-strings -Wpointer-arith -Wbad-function-cast -Wcast-align")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror=format-security -Werror=implicit-function-declaration -Wno-sign-compare")
+-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3")
+ if(CMAKE_COMPILER_IS_GNUCC)
+     set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pie -fPIE")
+ endif()
diff --git a/srcpkgs/OTPClient/template b/srcpkgs/OTPClient/template
index e8c0099850b7..f5af76e655a6 100644
--- a/srcpkgs/OTPClient/template
+++ b/srcpkgs/OTPClient/template
@@ -12,3 +12,4 @@ license="GPL-3.0-or-later"
 homepage="https://github.com/paolostivanin/OTPClient"
 distfiles="https://github.com/paolostivanin/OTPClient/archive/v${version}.tar.gz"
 checksum=74bc4312aa1cd336ca983434e3bed951c5ead327091e7708e3beb08508813495
+patch_args=-Np1

From bb3e018479d51f68780e64c3bbe677d0126b8647 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: Thu, 25 Mar 2021 08:30:31 +0700
Subject: [PATCH 20/64] crex: hardening

---
 srcpkgs/crex/patches/fix-cflags.patch | 20 ++++++++++++++++++++
 srcpkgs/crex/template                 |  7 ++-----
 2 files changed, 22 insertions(+), 5 deletions(-)
 create mode 100644 srcpkgs/crex/patches/fix-cflags.patch

diff --git a/srcpkgs/crex/patches/fix-cflags.patch b/srcpkgs/crex/patches/fix-cflags.patch
new file mode 100644
index 000000000000..d191fb1e9ec0
--- /dev/null
+++ b/srcpkgs/crex/patches/fix-cflags.patch
@@ -0,0 +1,20 @@
+Index: crex-0.2.5/CMakeLists.txt
+===================================================================
+--- crex-0.2.5.orig/CMakeLists.txt
++++ crex-0.2.5/CMakeLists.txt
+@@ -13,9 +13,6 @@ endif(CCACHE_FOUND)
+ set (CMAKE_CXX_STANDARD 14)
+ set (CMAKE_CXX_STANDARD_REQUIRED ON)
+ 
+-set (CMAKE_CXX_FLAGS "-fdiagnostics-color=auto")
+-set (CMAKE_C_FLAGS "-fdiagnostics-color=auto")
+-
+ set (DEBUG_FLAGS "-Wpedantic -Wall -Wextra -Wcast-align -Wcast-qual -Wctor-dtor-privacy -Wdisabled-optimization -Wformat=2 -Winit-self -Wlogical-op -Wmissing-declarations -Wmissing-include-dirs -Wnoexcept -Wold-style-cast -Woverloaded-virtual -Wredundant-decls -Wshadow -Wsign-conversion -Wsign-promo -Wstrict-null-sentinel -Wstrict-overflow=5 -Wswitch-default -Wundef -Wno-unused -std=c++14 -g")
+ set (DEBUG_LINK_FLAGS "-fprofile-arcs -ftest-coverage -flto")
+ 
+@@ -56,4 +53,4 @@ target_link_libraries (
+   ${TARGET}
+ )
+ 
+-install (TARGETS ${TARGET} DESTINATION "/usr/local/bin")
++install (TARGETS ${TARGET} DESTINATION "/usr/bin")
diff --git a/srcpkgs/crex/template b/srcpkgs/crex/template
index a54697a93adc..2f455a0b0c72 100644
--- a/srcpkgs/crex/template
+++ b/srcpkgs/crex/template
@@ -1,7 +1,7 @@
 # Template file for 'crex'
 pkgname=crex
 version=0.2.5
-revision=1
+revision=2
 build_style=cmake
 short_desc="Explore, test, and check regular expressions in the terminal"
 maintainer="Piotr Wójcik <chocimier@tlen.pl>"
@@ -9,10 +9,7 @@ license="MIT"
 homepage="https://github.com/octobanana/crex"
 distfiles="https://github.com/octobanana/crex/archive/${version}.tar.gz"
 checksum=c6a166b7a1e696a7babeaf7c5728eece1624704a18357f827129fc95ef2ecc56
-
-pre_configure() {
-	sed -e 's|/local/|/|' -i CMakeLists.txt
-}
+patch_args=-Np1
 
 post_install() {
 	vlicense LICENSE

From 13db16ac214e02af93585d8795b075fdd1e872b1 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: Thu, 25 Mar 2021 08:34:32 +0700
Subject: [PATCH 21/64] libbaseencode: hardening

---
 srcpkgs/libbaseencode/patches/fix-cflags.patch | 13 +++++++++++++
 srcpkgs/libbaseencode/template                 |  3 ++-
 2 files changed, 15 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/libbaseencode/patches/fix-cflags.patch

diff --git a/srcpkgs/libbaseencode/patches/fix-cflags.patch b/srcpkgs/libbaseencode/patches/fix-cflags.patch
new file mode 100644
index 000000000000..1bb86a0b15a4
--- /dev/null
+++ b/srcpkgs/libbaseencode/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: libbaseencode-1.0.9/CMakeLists.txt
+===================================================================
+--- libbaseencode-1.0.9.orig/CMakeLists.txt
++++ libbaseencode-1.0.9/CMakeLists.txt
+@@ -15,7 +15,7 @@ set(CMAKE_C_STANDARD 11)
+ set(BASEENCODE_HEADERS src/baseencode.h)
+ set(SOURCE_FILES src/base32.c src/base64.c)
+ 
+-set(CMAKE_C_FLAGS "-Wall -Werror -fPIC")
++set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Werror -fPIC")
+ 
+ add_library(${PROJECT_NAME} SHARED ${SOURCE_FILES})
+ 
diff --git a/srcpkgs/libbaseencode/template b/srcpkgs/libbaseencode/template
index 384a189224df..d5929ad7bb51 100644
--- a/srcpkgs/libbaseencode/template
+++ b/srcpkgs/libbaseencode/template
@@ -1,7 +1,7 @@
 # Template file for 'libbaseencode'
 pkgname=libbaseencode
 version=1.0.9
-revision=1
+revision=2
 build_style=cmake
 short_desc="Library for encoding decoding data use base32 or base64"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -9,6 +9,7 @@ license="Apache-2.0"
 homepage="https://github.com/paolostivanin/libbaseencode"
 distfiles="https://github.com/paolostivanin/libbaseencode/archive/v${version}.tar.gz"
 checksum=a183d7cf30d931b2a078d6f0ef64616b71ab26f9258e5f4e191778c7ace7175d
+patch_args=-Np1
 
 libbaseencode-devel_package() {
 	depends="libbaseencode-${version}_${revision}"

From a0c7b43d7c569bdc9fc35f5d3cd9218d11be558e 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: Fri, 26 Mar 2021 08:46:56 +0700
Subject: [PATCH 22/64] bibletime: clean build flags

---
 srcpkgs/bibletime/patches/fix-cflags.patch | 13 +++++++++++++
 srcpkgs/bibletime/template                 |  1 +
 2 files changed, 14 insertions(+)
 create mode 100644 srcpkgs/bibletime/patches/fix-cflags.patch

diff --git a/srcpkgs/bibletime/patches/fix-cflags.patch b/srcpkgs/bibletime/patches/fix-cflags.patch
new file mode 100644
index 000000000000..480c5ca4ac1e
--- /dev/null
+++ b/srcpkgs/bibletime/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: bibletime-3.0/cmake/BTApplication.cmake
+===================================================================
+--- bibletime-3.0.orig/cmake/BTApplication.cmake
++++ bibletime-3.0/cmake/BTApplication.cmake
+@@ -41,7 +41,7 @@ IF(WIN32)
+     ADD_COMPILE_OPTIONS("/Zi")
+ ELSE()
+     ADD_COMPILE_OPTIONS(
+-        "-ggdb" "-Wall" "-Wextra"
++        "-Wall" "-Wextra" "-DNDEBUG" "-DQT_NO_DEBUG"
+         "$<$<STREQUAL:$<CONFIGURATION>,Release>:-O2>"
+         "$<$<STREQUAL:$<CONFIGURATION>,Release>:-DNDEBUG>"
+         "$<$<STREQUAL:$<CONFIGURATION>,Release>:-DQT_NO_DEBUG>"
diff --git a/srcpkgs/bibletime/template b/srcpkgs/bibletime/template
index 224881c45516..85bcc7f22f87 100644
--- a/srcpkgs/bibletime/template
+++ b/srcpkgs/bibletime/template
@@ -18,6 +18,7 @@ license="GPL-2.0-or-later"
 homepage="http://bibletime.info"
 distfiles="https://github.com/bibletime/bibletime/releases/download/v${version}/bibletime-${version}.tar.xz"
 checksum=d6beef62ad44b255e3dc4c5e89214bf01a0e85c9136073b0be12fca3d2b22622
+patch_args=-Np1
 
 pre_build() {
 	. /etc/profile.d/10_openjdk11.sh

From 69f3474615c92360bfebbec338659dc74fc0e279 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: Fri, 26 Mar 2021 08:54:25 +0700
Subject: [PATCH 23/64] boomerang: clean build flags

---
 srcpkgs/boomerang/patches/fix-cflags.patch | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
 create mode 100644 srcpkgs/boomerang/patches/fix-cflags.patch

diff --git a/srcpkgs/boomerang/patches/fix-cflags.patch b/srcpkgs/boomerang/patches/fix-cflags.patch
new file mode 100644
index 000000000000..eb59766c1c5b
--- /dev/null
+++ b/srcpkgs/boomerang/patches/fix-cflags.patch
@@ -0,0 +1,21 @@
+Index: cmake-scripts/boomerang-flags.cmake
+===================================================================
+--- cmake-scripts/boomerang-flags.cmake
++++ cmake-scripts/boomerang-flags.cmake
+@@ -104,16 +104,6 @@ endif ()
+ 
+ 
+ if (NOT MSVC)
+-    if ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
+-        BOOMERANG_ADD_COMPILE_FLAGS(-O0)
+-    elseif ("${CMAKE_BUILD_TYPE}" STREQUAL "RelWithDebInfo")
+-        # No special flags
+-    elseif ("${CMAKE_BUILD_TYPE}" STREQUAL "MinSizeRel")
+-        BOOMERANG_ADD_COMPILE_FLAGS(-Os)
+-    else () # Release
+-        BOOMERANG_ADD_COMPILE_FLAGS(-O3)
+-    endif ()
+-
+     if (BOOMERANG_ENABLE_COVERAGE)
+         set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fprofile-arcs -ftest-coverage")
+         set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage")

From bf46ecfc45425de178ee69dcd07ec13537f0a8ea 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: Fri, 26 Mar 2021 08:58:11 +0700
Subject: [PATCH 24/64] catimg: don't change our build-type

---
 srcpkgs/catimg/patches/fix-cflags.patch | 12 ++++++++++++
 srcpkgs/catimg/template                 |  2 +-
 2 files changed, 13 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/catimg/patches/fix-cflags.patch

diff --git a/srcpkgs/catimg/patches/fix-cflags.patch b/srcpkgs/catimg/patches/fix-cflags.patch
new file mode 100644
index 000000000000..9b9f1074ef20
--- /dev/null
+++ b/srcpkgs/catimg/patches/fix-cflags.patch
@@ -0,0 +1,12 @@
+Index: catimg-2.7.0/CMakeLists.txt
+===================================================================
+--- catimg-2.7.0.orig/CMakeLists.txt
++++ catimg-2.7.0/CMakeLists.txt
+@@ -11,7 +11,6 @@ endif()
+ #set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wall -Wextra -g -std=c99 -Wno-unused-result")
+ #set(CMAKE_BUILD_TYPE Debug)
+ set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -Wall -Wextra -Os -std=c99 -Wno-unused-result")
+-set(CMAKE_BUILD_TYPE Release)
+ 
+ set(SRC ${PROJECT_SOURCE_DIR}/src)
+ 
diff --git a/srcpkgs/catimg/template b/srcpkgs/catimg/template
index 374351c45379..6fbc5f1d9140 100644
--- a/srcpkgs/catimg/template
+++ b/srcpkgs/catimg/template
@@ -9,7 +9,7 @@ license="MIT"
 homepage="https://github.com/posva/catimg"
 distfiles="https://github.com/posva/catimg/archive/${version}.tar.gz"
 checksum=3a6450316ff62fb07c3facb47ea208bf98f62abd02783e88c56f2a6508035139
-
+patch_args=-Np1
 CFLAGS="-fcommon"
 
 post_install() {

From 252f3d16916f78f23f1723fb416840ee7e3f1c81 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: Fri, 26 Mar 2021 09:09:37 +0700
Subject: [PATCH 25/64] libcotp: fix build flags

---
 srcpkgs/libcotp/patches/fix-cflags.patch | 14 ++++++++++++++
 srcpkgs/libcotp/template                 |  1 +
 2 files changed, 15 insertions(+)
 create mode 100644 srcpkgs/libcotp/patches/fix-cflags.patch

diff --git a/srcpkgs/libcotp/patches/fix-cflags.patch b/srcpkgs/libcotp/patches/fix-cflags.patch
new file mode 100644
index 000000000000..397b3960e9f4
--- /dev/null
+++ b/srcpkgs/libcotp/patches/fix-cflags.patch
@@ -0,0 +1,14 @@
+Index: libcotp-1.2.2/CMakeLists.txt
+===================================================================
+--- libcotp-1.2.2.orig/CMakeLists.txt
++++ libcotp-1.2.2/CMakeLists.txt
+@@ -25,8 +25,7 @@ set(CMAKE_C_STANDARD 11)
+ set(COTP_HEADERS src/cotp.h)
+ set(SOURCE_FILES src/otp.c)
+ 
+-set(CMAKE_C_FLAGS "-Wall -Wextra -O3 -Wno-format-truncation -fstack-protector-strong -fPIC")
+-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3")
++set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wno-format-truncation -fstack-protector-strong -fPIC")
+ 
+ add_library(cotp SHARED ${SOURCE_FILES})
+ 
diff --git a/srcpkgs/libcotp/template b/srcpkgs/libcotp/template
index 9e147ff7deb6..88337290d1e8 100644
--- a/srcpkgs/libcotp/template
+++ b/srcpkgs/libcotp/template
@@ -11,6 +11,7 @@ license="Apache-2.0"
 homepage="https://github.com/paolostivanin/libcotp"
 distfiles="https://github.com/paolostivanin/libcotp/archive/v${version}.tar.gz"
 checksum=25b45ffa4aece5cc689503ebea7356a2f760c194f0c41805934495d2fe7165b1
+patch_args=-Np1
 
 libcotp-devel_package() {
 	depends="libcotp-${version}_${revision}"

From 06fe3261c6d07a1eff4a72f0cbe1d71b1501702c 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: Fri, 26 Mar 2021 21:06:07 +0700
Subject: [PATCH 26/64] loudgain: hardening

---
 srcpkgs/loudgain/patches/fix-cflags.patch | 20 ++++++++++++++++++++
 srcpkgs/loudgain/template                 |  3 ++-
 2 files changed, 22 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/loudgain/patches/fix-cflags.patch

diff --git a/srcpkgs/loudgain/patches/fix-cflags.patch b/srcpkgs/loudgain/patches/fix-cflags.patch
new file mode 100644
index 000000000000..25b2c969bef4
--- /dev/null
+++ b/srcpkgs/loudgain/patches/fix-cflags.patch
@@ -0,0 +1,20 @@
+Index: loudgain-0.6.8/CMakeLists.txt
+===================================================================
+--- loudgain-0.6.8.orig/CMakeLists.txt
++++ loudgain-0.6.8/CMakeLists.txt
+@@ -69,12 +69,12 @@ TARGET_LINK_LIBRARIES(loudgain
+ )
+ 
+ SET_TARGET_PROPERTIES(loudgain PROPERTIES
+-  COMPILE_FLAGS "-Wall -pedantic -g"
++  COMPILE_FLAGS "-Wall -pedantic"
+ )
+ 
+-SET(CMAKE_C_FLAGS "-std=gnu99 -D_GNU_SOURCE")
++SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99 -D_GNU_SOURCE")
+ 
+-SET(CMAKE_CXX_FLAGS "-std=gnu++11 -D_GNU_SOURCE")
++SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11 -D_GNU_SOURCE")
+ 
+ INSTALL(TARGETS loudgain DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
+ 
diff --git a/srcpkgs/loudgain/template b/srcpkgs/loudgain/template
index f29167883439..00b2d20d27d6 100644
--- a/srcpkgs/loudgain/template
+++ b/srcpkgs/loudgain/template
@@ -1,7 +1,7 @@
 # Template file for 'loudgain'
 pkgname=loudgain
 version=0.6.8
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="pkg-config"
 makedepends="libebur128-devel taglib-devel ffmpeg-devel"
@@ -11,6 +11,7 @@ license="BSD-2-Clause"
 homepage="https://github.com/Moonbase59/loudgain"
 distfiles="https://github.com/Moonbase59/loudgain/archive/v${version}.tar.gz"
 checksum=1137c193ad941b366e87c5d84ccc95a7aa8571affc060db0bd1cf72c489aeaee
+patch_args=-Np1
 
 post_install() {
 	vlicense COPYING

From 26bfb4b7bbab04b27cf8d4e066365730732c87a6 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: Fri, 26 Mar 2021 21:14:31 +0700
Subject: [PATCH 27/64] masterpassword-cli: hardening

---
 srcpkgs/masterpassword-cli/patches/fix-cflags.patch | 13 +++++++++++++
 srcpkgs/masterpassword-cli/template                 |  2 +-
 2 files changed, 14 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/masterpassword-cli/patches/fix-cflags.patch

diff --git a/srcpkgs/masterpassword-cli/patches/fix-cflags.patch b/srcpkgs/masterpassword-cli/patches/fix-cflags.patch
new file mode 100644
index 000000000000..a303f6954544
--- /dev/null
+++ b/srcpkgs/masterpassword-cli/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: platform-independent/cli-c/CMakeLists.txt
+===================================================================
+--- platform-independent/cli-c/CMakeLists.txt.orig
++++ platform-independent/cli-c/CMakeLists.txt
+@@ -15,8 +15,6 @@ option( BUILD_MPW_BENCH         "C CLI M
+ option( BUILD_MPW_TESTS         "C Master Password algorithm test suite (needs: mpw_sodium, mpw_xml)." OFF )
+ 
+ # Default build flags.
+-set( CMAKE_BUILD_TYPE           Release )
+-set( CMAKE_C_FLAGS              "-O3" )
+ 
+ # Version.
+ file( READ                      "VERSION" mpw_version )
diff --git a/srcpkgs/masterpassword-cli/template b/srcpkgs/masterpassword-cli/template
index ee2b8d41ae4b..8536228a602b 100644
--- a/srcpkgs/masterpassword-cli/template
+++ b/srcpkgs/masterpassword-cli/template
@@ -1,7 +1,7 @@
 # Template file for 'masterpassword-cli'
 pkgname=masterpassword-cli
 version=2.6
-revision=5
+revision=6
 wrksrc=MasterPassword-${version}-cli-3
 build_wrksrc=platform-independent/cli-c
 build_style=cmake

From df10ecb33dddef861d78297b4a6aeacfafe00e3a 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: Fri, 26 Mar 2021 21:20:13 +0700
Subject: [PATCH 28/64] msg2: hardening

---
 srcpkgs/msg2/patches/fix-cflags.patch | 13 +++++++++++++
 srcpkgs/msg2/template                 |  2 +-
 2 files changed, 14 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/msg2/patches/fix-cflags.patch

diff --git a/srcpkgs/msg2/patches/fix-cflags.patch b/srcpkgs/msg2/patches/fix-cflags.patch
new file mode 100644
index 000000000000..64404bf44fcb
--- /dev/null
+++ b/srcpkgs/msg2/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -3,7 +3,7 @@ project(msg2)
+ 
+ # Flags
+ set(CMAKE_CXX_STANDARD 17)
+-set(CMAKE_CXX_FLAGS "-Os -pipe -fPIC -fno-plt -fstack-protector-strong -Wall -Wshadow -pedantic -Wno-parentheses -Wfatal-errors")
++set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pipe -fPIC -fno-plt -fstack-protector-strong -Wall -Wshadow -pedantic -Wno-parentheses -Wfatal-errors")
+ 
+ # Add source files
+ add_executable(msg2 main.cpp)
diff --git a/srcpkgs/msg2/template b/srcpkgs/msg2/template
index b4f77400bf22..473b3c4ec4d2 100644
--- a/srcpkgs/msg2/template
+++ b/srcpkgs/msg2/template
@@ -1,7 +1,7 @@
 # Template file for 'msg2'
 pkgname=msg2
 version=1.2.0
-revision=1
+revision=2
 build_style=cmake
 short_desc="Output a blue arrow and a white message on the commandline"
 maintainer="Orphaned <orphan@voidlinux.org>"

From ba4736b1ab503e388fa2974fee7f6fe2c50a1c44 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: Fri, 26 Mar 2021 21:22:55 +0700
Subject: [PATCH 29/64] ippusbxd: fix cflags -O2 not -o2

---
 srcpkgs/ippusbxd/patches/fix-cflags.patch | 12 ++++++++++++
 srcpkgs/ippusbxd/template                 |  2 +-
 2 files changed, 13 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/ippusbxd/patches/fix-cflags.patch

diff --git a/srcpkgs/ippusbxd/patches/fix-cflags.patch b/srcpkgs/ippusbxd/patches/fix-cflags.patch
new file mode 100644
index 000000000000..5d36903c3ffd
--- /dev/null
+++ b/srcpkgs/ippusbxd/patches/fix-cflags.patch
@@ -0,0 +1,12 @@
+Index: src/CMakeLists.txt
+===================================================================
+--- src/CMakeLists.txt.orig
++++ src/CMakeLists.txt
+@@ -1,6 +1,6 @@
+ cmake_minimum_required(VERSION 2.6)
+ project(ippusbxd)
+-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -o2 -g -std=c99 -Wall -Wextra -pedantic -pedantic-errors")
++set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -Wall -Wextra -pedantic -pedantic-errors")
+ 
+ 
+ # Compiler specific configuration
diff --git a/srcpkgs/ippusbxd/template b/srcpkgs/ippusbxd/template
index ce4ff2ea9125..e81064e8b91d 100644
--- a/srcpkgs/ippusbxd/template
+++ b/srcpkgs/ippusbxd/template
@@ -1,7 +1,7 @@
 # Template file for 'ippusbxd'
 pkgname=ippusbxd
 version=1.34
-revision=1
+revision=2
 build_wrksrc=src
 build_style=cmake
 make_cmd=make

From 06e3702ae03a246a2e076eb3855b7f77f68dfb37 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: Fri, 26 Mar 2021 21:34:52 +0700
Subject: [PATCH 30/64] tlsh: respect -g

---
 srcpkgs/tlsh/patches/fix-cflags.patch | 13 +++++++++++++
 srcpkgs/tlsh/template                 |  1 +
 2 files changed, 14 insertions(+)
 create mode 100644 srcpkgs/tlsh/patches/fix-cflags.patch

diff --git a/srcpkgs/tlsh/patches/fix-cflags.patch b/srcpkgs/tlsh/patches/fix-cflags.patch
new file mode 100644
index 000000000000..8715563715c7
--- /dev/null
+++ b/srcpkgs/tlsh/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -125,7 +125,7 @@ if (CMAKE_BUILD_TYPE STREQUAL Debug)
+     endif()
+ else(CMAKE_BUILD_TYPE STREQUAL Debug)
+     if(CMAKE_COMPILER_IS_GNUCXX)
+-        set(CMAKE_CXX_FLAGS "-O2 -fvisibility=internal")  ## Remove TlshImpl symbols
++        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=internal")  ## Remove TlshImpl symbols
+     endif()
+     if(MSVC)
+         set(CMAKE_CXX_FLAGS "/O2")        ## Optimize
diff --git a/srcpkgs/tlsh/template b/srcpkgs/tlsh/template
index 1f96834107cc..5df590d857c0 100644
--- a/srcpkgs/tlsh/template
+++ b/srcpkgs/tlsh/template
@@ -2,6 +2,7 @@
 pkgname=tlsh
 version=3.19.1
 revision=1
+revision=2
 build_style=cmake
 hostmakedepends="python3"
 makedepends="python3-devel"

From 1ae77853d0b654c3e60eeb28eaac2210135fdf4f 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: Fri, 26 Mar 2021 21:59:06 +0700
Subject: [PATCH 31/64] poppler: hardening + respect -g

---
 srcpkgs/poppler/patches/fix-cflags.patch | 21 +++++++++++++++++++++
 srcpkgs/poppler/template                 |  2 +-
 2 files changed, 22 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/poppler/patches/fix-cflags.patch

diff --git a/srcpkgs/poppler/patches/fix-cflags.patch b/srcpkgs/poppler/patches/fix-cflags.patch
new file mode 100644
index 000000000000..9e62b11010ba
--- /dev/null
+++ b/srcpkgs/poppler/patches/fix-cflags.patch
@@ -0,0 +1,21 @@
+Index: cmake/modules/PopplerMacros.cmake
+===================================================================
+--- cmake/modules/PopplerMacros.cmake.orig
++++ cmake/modules/PopplerMacros.cmake
+@@ -123,14 +123,14 @@ if(CMAKE_COMPILER_IS_GNUCXX)
+   set(DEFAULT_COMPILE_WARNINGS_EXTRA "${_warn} ${_warnx}")
+ 
+   set(_save_cxxflags "${CMAKE_CXX_FLAGS}")
+-  set(CMAKE_CXX_FLAGS                "-fno-exceptions -fno-check-new -fno-common -D_DEFAULT_SOURCE")
++  set(CMAKE_CXX_FLAGS                "-fno-exceptions -fno-check-new -fno-common -D_DEFAULT_SOURCE ${_save_cxxflags}")
+   set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g ${_save_cxxflags}")
+   set(CMAKE_CXX_FLAGS_RELEASE        "-O2 -DNDEBUG ${_save_cxxflags}")
+   set(CMAKE_CXX_FLAGS_DEBUG          "-g -O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline ${_save_cxxflags}")
+   set(CMAKE_CXX_FLAGS_DEBUGFULL      "-g3 -fno-inline ${_save_cxxflags}")
+   set(CMAKE_CXX_FLAGS_PROFILE        "-g3 -fno-inline -ftest-coverage -fprofile-arcs ${_save_cxxflags}")
+   set(_save_cflags "${CMAKE_C_FLAGS}")
+-  set(CMAKE_C_FLAGS                  "-std=c99 -D_DEFAULT_SOURCE")
++  set(CMAKE_C_FLAGS                  "-std=c99 -D_DEFAULT_SOURCE ${_save_cflags}")
+   set(CMAKE_C_FLAGS_RELWITHDEBINFO   "-O2 -g ${_save_cflags}")
+   set(CMAKE_C_FLAGS_RELEASE          "-O2 -DNDEBUG ${_save_cflags}")
+   set(CMAKE_C_FLAGS_DEBUG            "-g -O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline ${_save_cflags}")
diff --git a/srcpkgs/poppler/template b/srcpkgs/poppler/template
index ed0db8de7ab6..1aebd7f7e177 100644
--- a/srcpkgs/poppler/template
+++ b/srcpkgs/poppler/template
@@ -4,7 +4,7 @@
 #
 pkgname=poppler
 version=20.09.0
-revision=2
+revision=3
 build_style=cmake
 build_helper="gir"
 configure_args="-DENABLE_UNSTABLE_API_ABI_HEADERS=ON -DENABLE_CPP=ON

From 8aee7a43547075368182ae768d64b42be679e715 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: Fri, 26 Mar 2021 21:59:29 +0700
Subject: [PATCH 32/64] poppler-qt5: hardening + respect -g

---
 srcpkgs/poppler-qt5/patches  | 1 +
 srcpkgs/poppler-qt5/template | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)
 create mode 120000 srcpkgs/poppler-qt5/patches

diff --git a/srcpkgs/poppler-qt5/patches b/srcpkgs/poppler-qt5/patches
new file mode 120000
index 000000000000..636e4ac2cbd9
--- /dev/null
+++ b/srcpkgs/poppler-qt5/patches
@@ -0,0 +1 @@
+../poppler/patches
\ No newline at end of file
diff --git a/srcpkgs/poppler-qt5/template b/srcpkgs/poppler-qt5/template
index 0dc45c05c58b..c2ec35dbbad3 100644
--- a/srcpkgs/poppler-qt5/template
+++ b/srcpkgs/poppler-qt5/template
@@ -5,7 +5,7 @@
 #
 pkgname=poppler-qt5
 version=20.09.0
-revision=1
+revision=2
 wrksrc="poppler-${version}"
 build_style=cmake
 configure_args="-DENABLE_UNSTABLE_API_ABI_HEADERS=ON -DENABLE_GLIB=OFF

From ac38c53aae1e29d713a05addce87b95e3e313733 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: Sat, 27 Mar 2021 11:17:35 +0700
Subject: [PATCH 33/64] artyfx: remove -O1 -g

---
 srcpkgs/artyfx/patches/fix-avtk-cmake-sse.patch | 4 ++--
 srcpkgs/artyfx/patches/respect-our-cflags.patch | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/artyfx/patches/fix-avtk-cmake-sse.patch b/srcpkgs/artyfx/patches/fix-avtk-cmake-sse.patch
index 1a832155a566..47ef4dd9b84e 100644
--- a/srcpkgs/artyfx/patches/fix-avtk-cmake-sse.patch
+++ b/srcpkgs/artyfx/patches/fix-avtk-cmake-sse.patch
@@ -6,8 +6,8 @@
  
 -SET(CMAKE_C_FLAGS   "-fPIC -msse -msse2 -mfpmath=sse -g") # -fsanitize=address
 -SET(CMAKE_CXX_FLAGS "-fPIC -msse -msse2 -mfpmath=sse -g") # -fsanitize=address
-+SET(CMAKE_C_FLAGS   "${CMAKE_C_FLAGS} -fPIC -g") # -fsanitize=address
-+SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -g") # -fsanitize=address
++SET(CMAKE_C_FLAGS   "${CMAKE_C_FLAGS} -fPIC") # -fsanitize=address
++SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") # -fsanitize=address
 +
 +IF(BUILD_SSE)
 +	SET(CMAKE_C_FLAGS   "${CMAKE_C_FLAGS} -msse -msse2 -mfpmath=sse")
diff --git a/srcpkgs/artyfx/patches/respect-our-cflags.patch b/srcpkgs/artyfx/patches/respect-our-cflags.patch
index ee9155c7729e..7a32fd9df73b 100644
--- a/srcpkgs/artyfx/patches/respect-our-cflags.patch
+++ b/srcpkgs/artyfx/patches/respect-our-cflags.patch
@@ -10,8 +10,8 @@ Index: CMakeLists.txt
 -SET(CMAKE_C_FLAGS "-g -Wall -O1 -Wno-unused-variable")
 -SET(CMAKE_CXX_FLAGS "-g -Wall -O1 -Wno-unused-variable -ftree-vectorize")
 +SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fPIC -shared -L./src/avtk -Wl,--no-undefined")
-+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -Wall -O1 -Wno-unused-variable")
-+SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -Wall -O1 -Wno-unused-variable -ftree-vectorize")
++SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall  -Wno-unused-variable")
++SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall  -Wno-unused-variable -ftree-vectorize")
  
  
  # DSP sources

From 62b0cbc6a85dada677befcd9f9b76204fcfd74e6 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: Sat, 27 Mar 2021 11:27:28 +0700
Subject: [PATCH 34/64] coin3: build with CMAKE_BUILD_TYPE=None

---
 srcpkgs/coin3/template | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/coin3/template b/srcpkgs/coin3/template
index d5483ee048c3..8f7218c2e8c3 100644
--- a/srcpkgs/coin3/template
+++ b/srcpkgs/coin3/template
@@ -5,7 +5,7 @@ revision=1
 wrksrc="coin-Coin-${version}"
 build_style=cmake
 configure_args="-DCMAKE_INSTALL_INCLUDEDIR=/usr/include/Coin3
- -DCMAKE_BUILD_TYPE=Release -DCOIN_BUILD_TESTS=OFF -DCOIN_BUILD_DOCUMENTATION=ON"
+ -DCOIN_BUILD_TESTS=OFF -DCOIN_BUILD_DOCUMENTATION=ON"
 hostmakedepends="doxygen graphviz"
 makedepends="boost-devel glu-devel"
 short_desc="High-level 3D graphics toolkit"
@@ -15,6 +15,9 @@ homepage="https://coin3d.github.io/"
 distfiles="https://github.com/coin3d/coin/archive/Coin-${version}.tar.gz"
 checksum=b00d2a8e9d962397cf9bf0d9baa81bcecfbd16eef675a98c792f5cf49eb6e805
 
+CFLAGS=-DNDEBUG
+CXXFLAGS=-DNDEBUG
+
 if [ "$CROSS_BUILD" ]; then
 	# bypass runtime test (quote hashing is fine with gcc 9.3)
 	configure_args+=" -DHAVE_HASH_QUOTING_EXITCODE=0"

From 5e58fe98640176b01ba0e20517fff3c5a1ab86b7 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: Sat, 27 Mar 2021 11:46:46 +0700
Subject: [PATCH 35/64] conky: don't overwrite CMAKE_BUILD_TYPE

---
 srcpkgs/conky/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/conky/template b/srcpkgs/conky/template
index 8b95a628edfb..f05c7d4a1bf2 100644
--- a/srcpkgs/conky/template
+++ b/srcpkgs/conky/template
@@ -5,7 +5,7 @@ version=1.12.1
 revision=1
 build_style=cmake
 conf_files="/etc/conky/conky.conf /etc/conky/conky_no_x11.conf"
-configure_args="-DCMAKE_BUILD_TYPE=Release -DMAINTAINER_MODE=ON -DRELEASE=ON
+configure_args="-DMAINTAINER_MODE=ON -DRELEASE=ON
  -DDOC_PATH=share/doc/${pkgname} -DBUILD_X11=ON -DBUILD_CURL=ON -DBUILD_XDBE=ON
  -DBUILD_RSS=ON -DBUILD_WEATHER_METAR=ON -DBUILD_IMLIB2=ON -DBUILD_WLAN=ON
  -DBUILD_LUA_CAIRO=ON -DBUILD_LUA_IMLIB2=ON -DBUILD_LUA_RSVG=ON

From caf51543d59a6f048c9057977dfebbefa6ce183d 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: Sat, 27 Mar 2021 11:46:46 +0700
Subject: [PATCH 36/64] conky-cli: don't overwrite CMAKE_BUILD_TYPE

---
 srcpkgs/conky-cli/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/conky-cli/template b/srcpkgs/conky-cli/template
index b61bdcca0504..7d512b65ab3e 100644
--- a/srcpkgs/conky-cli/template
+++ b/srcpkgs/conky-cli/template
@@ -6,7 +6,7 @@ revision=1
 wrksrc="${pkgname/-cli/}-${version}"
 build_style=cmake
 conf_files="/etc/conky/conky.conf /etc/conky/conky_no_x11.conf"
-configure_args="-DCMAKE_BUILD_TYPE=Release -DMAINTAINER_MODE=ON -DRELEASE=ON
+configure_args="-DMAINTAINER_MODE=ON -DRELEASE=ON
  -DDOC_PATH=share/doc/${pkgname} -DBUILD_X11=OFF -DBUILD_CURL=ON -DBUILD_XDBE=OFF
  -DBUILD_RSS=ON -DBUILD_WEATHER_METAR=OFF -DBUILD_IMLIB2=OFF -DBUILD_WLAN=ON
  -DBUILD_DOCS=ON"

From 0c4ab71b8e3ad99ff3cdd1371f1818d38b2280f0 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: Sat, 27 Mar 2021 11:48:25 +0700
Subject: [PATCH 37/64] crossguid: don't overwrite -O2

---
 srcpkgs/crossguid/fix-cflags.patch | 12 ++++++++++++
 1 file changed, 12 insertions(+)
 create mode 100644 srcpkgs/crossguid/fix-cflags.patch

diff --git a/srcpkgs/crossguid/fix-cflags.patch b/srcpkgs/crossguid/fix-cflags.patch
new file mode 100644
index 000000000000..983360a07ccf
--- /dev/null
+++ b/srcpkgs/crossguid/fix-cflags.patch
@@ -0,0 +1,12 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -2,7 +2,6 @@ cmake_minimum_required(VERSION 3.5.1)
+ project(CrossGuid)
+ 
+ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake")
+-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3")
+ 
+ option(XG_TESTS "Build test runner" ON)
+ 

From 08a624f258bf87c33d55d3da98dbc94e23d31d30 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: Sat, 27 Mar 2021 12:19:04 +0700
Subject: [PATCH 38/64] rapidjson: define -DNDEBUG

---
 srcpkgs/rapidjson/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/rapidjson/template b/srcpkgs/rapidjson/template
index 8597f8fb2706..99d92702cc9d 100644
--- a/srcpkgs/rapidjson/template
+++ b/srcpkgs/rapidjson/template
@@ -11,7 +11,7 @@ distfiles="https://github.com/miloyip/${pkgname}/archive/v${version}.tar.gz"
 checksum=bf7ced29704a1e696fbccf2a2b4ea068e7774fa37f6d7dd4039d0787f8bed98e
 
 # class-memaccess is required by https://github.com/Tencent/rapidjson/issues/1700
-CXXFLAGS="-Wno-type-limits -Wno-error=class-memaccess"
+CXXFLAGS="-Wno-type-limits -Wno-error=class-memaccess -DNDEBUG"
 
 post_patch() {
 	# Remove bin/jsonchecker, which is the JSON licensed files

From 4991790de1af4d9c9503fd96578c50c1415f1317 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: Sat, 27 Mar 2021 12:18:36 +0700
Subject: [PATCH 39/64] cura-engine: ignore -O3

---
 srcpkgs/cura-engine/patches/fix-cflags.patch | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 srcpkgs/cura-engine/patches/fix-cflags.patch

diff --git a/srcpkgs/cura-engine/patches/fix-cflags.patch b/srcpkgs/cura-engine/patches/fix-cflags.patch
new file mode 100644
index 000000000000..e48a665523b8
--- /dev/null
+++ b/srcpkgs/cura-engine/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -42,7 +42,7 @@ endif()
+ if(CMAKE_BUILD_TYPE_UPPER MATCHES "DEBUG")
+     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_DEBUG_INIT}")
+ else()
+-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELEASE_INIT}")
++    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DNDEBUG")
+ endif()
+ 
+ set(CMAKE_CXX_STANDARD 11)

From 990473961cdc768118943d0642389b24802446e3 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: Sat, 27 Mar 2021 12:22:29 +0700
Subject: [PATCH 40/64] dislocker: remove -O1

---
 srcpkgs/dislocker/patches/fix-cflags.patch | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 srcpkgs/dislocker/patches/fix-cflags.patch

diff --git a/srcpkgs/dislocker/patches/fix-cflags.patch b/srcpkgs/dislocker/patches/fix-cflags.patch
new file mode 100644
index 000000000000..1229efeeaf0c
--- /dev/null
+++ b/srcpkgs/dislocker/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: src/CMakeLists.txt
+===================================================================
+--- src/CMakeLists.txt.orig
++++ src/CMakeLists.txt
+@@ -71,7 +71,7 @@ if(NOT DEFINED WARN_FLAGS)
+ 	set (WARN_FLAGS "-Wall -Wextra" CACHE STRING "" FORCE)
+ endif()
+ if(NOT DEFINED HARDEN_FLAGS)
+-	set (HARDEN_FLAGS "-fstack-protector -fstrict-aliasing -D_FORTIFY_SOURCE=2 -O1" CACHE STRING "" FORCE)
++	set (HARDEN_FLAGS "-fstack-protector -fstrict-aliasing" CACHE STRING "" FORCE)
+ endif()
+ 
+ set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")

From 56b00cfa20092a8186bee75131541666ab9dcb98 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: Sat, 27 Mar 2021 12:29:31 +0700
Subject: [PATCH 41/64] freeorion: remove -O3

---
 srcpkgs/freeorion/patches/fix-cflags.patch | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
 create mode 100644 srcpkgs/freeorion/patches/fix-cflags.patch

diff --git a/srcpkgs/freeorion/patches/fix-cflags.patch b/srcpkgs/freeorion/patches/fix-cflags.patch
new file mode 100644
index 000000000000..c66d54599556
--- /dev/null
+++ b/srcpkgs/freeorion/patches/fix-cflags.patch
@@ -0,0 +1,18 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -432,13 +432,6 @@ if(MSVC)
+     )
+ endif()
+ 
+-target_compile_options(freeorionparseobj
+-    PRIVATE
+-        $<$<CXX_COMPILER_ID:Clang>:-ftemplate-depth=512>
+-        $<$<CXX_COMPILER_ID:AppleClang>:-ftemplate-depth=512>
+-        $<$<AND:$<NOT:$<BOOL:${BUILD_TESTING}>>,$<CXX_COMPILER_ID:GNU>>:-O3>
+-)
+-
+ target_compile_definitions(freeorionparseobj
+     PUBLIC
+         -DBOOST_ALL_DYN_LINK

From cf303ba9a06eae9be7aeb291f5a2e4230e140caf 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: Fri, 26 Mar 2021 09:01:12 +0700
Subject: [PATCH 42/64] cglm: fix build flags

---
 srcpkgs/cglm/patches/fix-cflags.patch | 13 +++++++++++++
 srcpkgs/cglm/template                 |  1 +
 2 files changed, 14 insertions(+)
 create mode 100644 srcpkgs/cglm/patches/fix-cflags.patch

diff --git a/srcpkgs/cglm/patches/fix-cflags.patch b/srcpkgs/cglm/patches/fix-cflags.patch
new file mode 100644
index 000000000000..c74de6ea62d7
--- /dev/null
+++ b/srcpkgs/cglm/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: cglm-0.7.6/CMakeLists.txt
+===================================================================
+--- cglm-0.7.6.orig/CMakeLists.txt
++++ cglm-0.7.6/CMakeLists.txt
+@@ -25,7 +25,7 @@ if(MSVC)
+ 	add_definitions(-DNDEBUG -D_WINDOWS -D_USRDLL -DCGLM_EXPORTS -DCGLM_DLL)
+ 	add_compile_options(/W3 /Ox /Gy /Oi /TC)
+ else()
+-  add_compile_options(-Wall -Werror -O3)
++  add_compile_options(-Wall)
+ endif()
+ 
+ if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
diff --git a/srcpkgs/cglm/template b/srcpkgs/cglm/template
index f00a093edab9..311b4c79a7d3 100644
--- a/srcpkgs/cglm/template
+++ b/srcpkgs/cglm/template
@@ -9,6 +9,7 @@ license="MIT"
 homepage="https://github.com/recp/cglm"
 distfiles="https://github.com/recp/cglm/archive/v${version}.tar.gz"
 checksum=29ff8af4edc03697e36d3e6f99a80b884a80ee09d46055ce45765e5d6b2456d9
+patch_args=-Np1
 
 post_install() {
 	vlicense LICENSE

From 8f4704a4c93bed78f1e40d1d3a547b7fe2fce492 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: Sat, 27 Mar 2021 12:36:19 +0700
Subject: [PATCH 43/64] glyr: don't force Release build

---
 srcpkgs/glyr/patches/fix-cflags.patch | 12 ++++++++++++
 1 file changed, 12 insertions(+)
 create mode 100644 srcpkgs/glyr/patches/fix-cflags.patch

diff --git a/srcpkgs/glyr/patches/fix-cflags.patch b/srcpkgs/glyr/patches/fix-cflags.patch
new file mode 100644
index 000000000000..498ffe09a38f
--- /dev/null
+++ b/srcpkgs/glyr/patches/fix-cflags.patch
@@ -0,0 +1,12 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -60,7 +60,6 @@ exec_program(
+ IF(CMAKE_BUILD_TYPE STREQUAL "debug")
+     SET(GLYR_DEBUG TRUE)
+ ELSE()
+-    SET(CMAKE_BUILD_TYPE "release")
+     SET(GLYR_DEBUG FALSE)
+ ENDIF()
+ MESSAGE("-- Building Target: ${CMAKE_BUILD_TYPE}")

From 73dee710a647f5697229ef3c0d3bf45c0e64d612 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: Sat, 27 Mar 2021 12:41:50 +0700
Subject: [PATCH 44/64] hugin: remove -O3

---
 srcpkgs/hugin/patches/fix-cflags.patch | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
 create mode 100644 srcpkgs/hugin/patches/fix-cflags.patch

diff --git a/srcpkgs/hugin/patches/fix-cflags.patch b/srcpkgs/hugin/patches/fix-cflags.patch
new file mode 100644
index 000000000000..02fa56bef0e1
--- /dev/null
+++ b/srcpkgs/hugin/patches/fix-cflags.patch
@@ -0,0 +1,15 @@
+Index: src/celeste/CMakeLists.txt
+===================================================================
+--- src/celeste/CMakeLists.txt.orig
++++ src/celeste/CMakeLists.txt
+@@ -16,10 +16,6 @@
+ #    You should have received a copy of the GNU General Public License
+ #    along with Hugin  If not, see <http://www.gnu.org/licenses/>.
+  
+-IF(NOT WIN32)
+-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3")
+-ENDIF(NOT WIN32)
+-
+ # a list of all files belonging to celeste library
+ 
+ SET(CELESTE_SRC

From b18cb1193ffe95ba7253c7410266b7c2404b3124 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: Sat, 27 Mar 2021 13:05:27 +0700
Subject: [PATCH 45/64] ledger: don't overwrite CMAKE_BUILD_TYPE

---
 srcpkgs/ledger/patches/fix-cflags.patch | 12 ++++++++++++
 1 file changed, 12 insertions(+)
 create mode 100644 srcpkgs/ledger/patches/fix-cflags.patch

diff --git a/srcpkgs/ledger/patches/fix-cflags.patch b/srcpkgs/ledger/patches/fix-cflags.patch
new file mode 100644
index 000000000000..179ab79cd148
--- /dev/null
+++ b/srcpkgs/ledger/patches/fix-cflags.patch
@@ -0,0 +1,12 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -41,7 +41,6 @@ if (BUILD_DEBUG)
+   set(CMAKE_BUILD_TYPE Debug)
+   set(DEBUG_MODE 1)
+ else()
+-  set(CMAKE_BUILD_TYPE Release)
+   set(DEBUG_MODE 0)
+ endif()
+ 

From bd0e02ba2dcc674e79d987798571a3f9d4383215 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: Sat, 27 Mar 2021 13:18:24 +0700
Subject: [PATCH 46/64] libmygpo-qt: remove -ggdb3

---
 srcpkgs/libmygpo-qt/patches/fix-cflags.patch | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 srcpkgs/libmygpo-qt/patches/fix-cflags.patch

diff --git a/srcpkgs/libmygpo-qt/patches/fix-cflags.patch b/srcpkgs/libmygpo-qt/patches/fix-cflags.patch
new file mode 100644
index 000000000000..9940b6fc4323
--- /dev/null
+++ b/srcpkgs/libmygpo-qt/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -69,7 +69,7 @@ if (CMAKE_COMPILER_IS_GNUCXX)
+        -Wwrite-strings -Wpacked -Wformat-security -Wmissing-format-attribute
+        -Wold-style-cast -Woverloaded-virtual -Wnon-virtual-dtor  -Wall -Wextra
+        -Wformat=2 -Wundef -Wstack-protector -Wmissing-include-dirs
+-       -Winit-self -Wunsafe-loop-optimizations  -ggdb3 -fno-inline -DQT_STRICT_ITERATORS )
++       -Winit-self -Wunsafe-loop-optimizations  -fno-inline -DQT_STRICT_ITERATORS )
+     if ( NOT WIN32 )
+         add_definitions( -fvisibility=hidden )
+     endif()

From d76b6124f18c2dfeb3f6a4caf37a166c3fb09330 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: Sat, 27 Mar 2021 13:48:38 +0700
Subject: [PATCH 47/64] libogre: don't build vendored libraries

---
 srcpkgs/libogre/template | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/srcpkgs/libogre/template b/srcpkgs/libogre/template
index 784e3a648bac..6dd88ea08c73 100644
--- a/srcpkgs/libogre/template
+++ b/srcpkgs/libogre/template
@@ -3,11 +3,8 @@ pkgname=libogre
 version=1.12.9
 revision=1
 build_style=cmake
-configure_args="-DCMAKE_INSTALL_PREFIX=/usr \
-	-DOGRE_INSTALL_SAMPLES=TRUE \
-	-DOGRE_INSTALL_DOCS=TRUE \
-	-DOGRE_INSTALL_SAMPLES_SOURCE=TRUE \
-	-DCMAKE_BUILD_TYPE=Release"
+configure_args="-DOGRE_INSTALL_SAMPLES=TRUE -DOGRE_INSTALL_DOCS=TRUE
+ -DOGRE_INSTALL_SAMPLES_SOURCE=TRUE -DOGRE_BUILD_DEPENDENCIES=FALSE"
 hostmakedepends="pkg-config graphviz doxygen dejavu-fonts-ttf"
 makedepends="boost-devel freetype-devel libXaw-devel libXrandr-devel
  MesaLib-devel zziplib-devel libcppunit-devel glu-devel libatomic-devel

From e1a2cfc1b044b10b79ddd75b5e5bbd0fbe77bcf9 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: Sat, 27 Mar 2021 13:52:50 +0700
Subject: [PATCH 48/64] libopenglrecorder: remove -O3

---
 srcpkgs/libopenglrecorder/patches/fix-cflags.patch | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 srcpkgs/libopenglrecorder/patches/fix-cflags.patch

diff --git a/srcpkgs/libopenglrecorder/patches/fix-cflags.patch b/srcpkgs/libopenglrecorder/patches/fix-cflags.patch
new file mode 100644
index 000000000000..7c48a0d2d822
--- /dev/null
+++ b/srcpkgs/libopenglrecorder/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -21,7 +21,7 @@ if (UNIX OR MINGW)
+     if (CMAKE_BUILD_TYPE MATCHES Debug)
+         add_definitions(-std=gnu++0x -O0)
+     else()
+-        add_definitions(-std=gnu++0x -O3)
++        add_definitions(-std=gnu++0x)
+     endif()
+ endif()
+ 

From adb29ba44aa3143c71327c5fe347cbfddb3816bb 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: Sat, 27 Mar 2021 13:55:41 +0700
Subject: [PATCH 49/64] libvidstab: remove -O3

---
 srcpkgs/libvidstab/patches/fix-cflags.patch | 39 +++++++++++++++++++++
 1 file changed, 39 insertions(+)
 create mode 100644 srcpkgs/libvidstab/patches/fix-cflags.patch

diff --git a/srcpkgs/libvidstab/patches/fix-cflags.patch b/srcpkgs/libvidstab/patches/fix-cflags.patch
new file mode 100644
index 000000000000..51c357efb101
--- /dev/null
+++ b/srcpkgs/libvidstab/patches/fix-cflags.patch
@@ -0,0 +1,39 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -25,7 +25,7 @@ else()
+     set(LIBSUFFIX "")
+ endif()
+ 
+-add_definitions( -Wall -O3 -g -Wno-pointer-sign -fPIC -std=gnu99)
++add_definitions( -Wall -Wno-pointer-sign -fPIC -std=gnu99)
+ # add_definitions(  -Wall -O0 -g -Wno-pointer-sign )
+ 
+ ### ORC is not used in any active code at the moment  ###
+Index: tests/CMakeLists.txt
+===================================================================
+--- tests/CMakeLists.txt.orig
++++ tests/CMakeLists.txt
+@@ -11,7 +11,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PAT
+ option(USE_OMP "use parallelization use OMP" ON)
+ 
+ #add_definitions( -Wall -O3 -Wno-pointer-sign -DTESTING  -std=gnu99)
+-add_definitions(  -Wall -O0 -g -Wno-pointer-sign -DTESTING -std=gnu99)
++add_definitions(  -Wall -Wno-pointer-sign -DTESTING -std=gnu99)
+ find_package(Orc)
+ if(ORC_FOUND)
+ add_definitions( -DUSE_ORC ${ORC_DEFINITIONS})
+Index: transcode/CMakeLists.txt
+===================================================================
+--- transcode/CMakeLists.txt.orig
++++ transcode/CMakeLists.txt
+@@ -9,7 +9,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PAT
+ set(TRANSCODE_ROOT ../../transcode)
+ 
+ 
+-add_definitions( -Wall -O3 -Wno-pointer-sign -DTRANSCODE -std=gnu99)
++add_definitions( -Wall -Wno-pointer-sign -DTRANSCODE -std=gnu99)
+ #add_definitions(  -Wall -O0 -g -Wno-pointer-sign )
+ # I tried it with 0.4.14
+ #  0.4.10 did not work (not all opcode implemented)

From 6ab3a3cab4ec5c293f0832172c3b03b3be5c312e 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: Sat, 27 Mar 2021 14:18:34 +0700
Subject: [PATCH 50/64] openlierox: don't overwrote CMAKE_BUILD_TYPE

---
 srcpkgs/openlierox/patches/fix-cflags.patch | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
 create mode 100644 srcpkgs/openlierox/patches/fix-cflags.patch

diff --git a/srcpkgs/openlierox/patches/fix-cflags.patch b/srcpkgs/openlierox/patches/fix-cflags.patch
new file mode 100644
index 000000000000..4fe6652fd0a2
--- /dev/null
+++ b/srcpkgs/openlierox/patches/fix-cflags.patch
@@ -0,0 +1,17 @@
+Index: CMakeOlxCommon.cmake
+===================================================================
+--- CMakeOlxCommon.cmake.orig
++++ CMakeOlxCommon.cmake
+@@ -36,12 +36,6 @@ OPTION(BREAKPAD "Google Breakpad support
+ OPTION(DISABLE_JOYSTICK "Disable joystick support" No)
+ OPTION(MINGW_CROSS_COMPILE "Cross-compile Windows .EXE using i686-w64-mingw32-gcc compiler" No)
+ 
+-IF (DEBUG)
+-	SET(CMAKE_BUILD_TYPE Debug)
+-ELSE (DEBUG)
+-	SET(CMAKE_BUILD_TYPE Release)
+-ENDIF (DEBUG)
+-
+ IF (DEDICATED_ONLY)
+ 	SET(X11 No)
+ 	SET(WITH_G15 No)

From 023e2038f71e66cfc4e27a5ca66b8b994a7517b1 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: Sat, 27 Mar 2021 14:25:12 +0700
Subject: [PATCH 51/64] opensonic: don't overwrite CMAKE_BUILD_TYPE

---
 srcpkgs/opensonic/patches/fix-cflags.patch | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
 create mode 100644 srcpkgs/opensonic/patches/fix-cflags.patch

diff --git a/srcpkgs/opensonic/patches/fix-cflags.patch b/srcpkgs/opensonic/patches/fix-cflags.patch
new file mode 100644
index 000000000000..10d2c7c80e64
--- /dev/null
+++ b/srcpkgs/opensonic/patches/fix-cflags.patch
@@ -0,0 +1,17 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -25,12 +25,10 @@ SET(GAME_NAME "Open Sonic")
+ SET(GAME_VERSION "0.1.4")
+ SET(RTFM "Please read the user manual (readme.html) to get help.")
+ SET(ALLEGRO_RECOMMENDED_VERSION "4.4.1")
+-SET(CMAKE_BUILD_TYPE Release)
+ MESSAGE("${GAME_NAME} version ${GAME_VERSION}")
+ 
+ # configuring...
+ SET(DEFS "")
+-SET(CFLAGS_EXTRA "-g")
+ SET(CFLAGS "${CFLAGS} ${CMAKE_C_FLAGS}")
+ MESSAGE("Using CFLAGS='${CFLAGS}'")
+ 

From 1c28e25378861136ec3ddfdad4a444c84471bb04 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: Sat, 27 Mar 2021 15:17:28 +0700
Subject: [PATCH 52/64] rocksdb: don't overwrite CMAKE_BUILD_TYPE

---
 srcpkgs/rocksdb/template | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/rocksdb/template b/srcpkgs/rocksdb/template
index e39329e5d6a6..5a6ca434f29b 100644
--- a/srcpkgs/rocksdb/template
+++ b/srcpkgs/rocksdb/template
@@ -3,8 +3,7 @@ pkgname=rocksdb
 version=5.18.3
 revision=2
 build_style=cmake
-configure_args="-DCMAKE_BUILD_TYPE=Release -DPORTABLE=1 -DWITH_TESTS=0
- -DUSE_RTTI=0 -DWITH_LZ4=1"
+configure_args="-DPORTABLE=1 -DWITH_TESTS=0 -DUSE_RTTI=0 -DWITH_LZ4=1"
 makedepends="liblz4-devel"
 short_desc="RocksDB is a embeddable, persistent key-value store for fast storage"
 maintainer="magenbluten <mb0@codemonkey.cc>"
@@ -12,6 +11,8 @@ license="GPL-2.0-or-later, Apache-2.0"
 homepage="https://github.com/facebook/rocksdb"
 distfiles="${homepage}/archive/v${version}.tar.gz"
 checksum=7fb6738263d3f2b360d7468cf2ebe333f3109f3ba1ff80115abd145d75287254
+CFLAGS=-DNDEBUG
+CXXFLAGS=-DNDEBUG
 
 if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
 	makedepends+=" libatomic-devel"

From d8b2bc24378ad0dd87176e0961f34c2468b6eb8d 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: Sat, 27 Mar 2021 15:19:47 +0700
Subject: [PATCH 53/64] rofs-filtered: hardening

---
 srcpkgs/rofs-filtered/patches/fix-cflags.patch | 13 +++++++++++++
 srcpkgs/rofs-filtered/template                 |  2 +-
 2 files changed, 14 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/rofs-filtered/patches/fix-cflags.patch

diff --git a/srcpkgs/rofs-filtered/patches/fix-cflags.patch b/srcpkgs/rofs-filtered/patches/fix-cflags.patch
new file mode 100644
index 000000000000..f64d3274f091
--- /dev/null
+++ b/srcpkgs/rofs-filtered/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -9,7 +9,7 @@ set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PA
+      "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
+ 
+ add_definitions(-D_GNU_SOURCE)
+-set(CMAKE_C_FLAGS "-Wall -std=c99")
++set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -std=c99")
+ 
+ # find fuse library
+ find_package (FUSE REQUIRED)
diff --git a/srcpkgs/rofs-filtered/template b/srcpkgs/rofs-filtered/template
index 332cd57a9902..e585877eaf59 100644
--- a/srcpkgs/rofs-filtered/template
+++ b/srcpkgs/rofs-filtered/template
@@ -1,7 +1,7 @@
 # Template file for 'rofs-filtered'
 pkgname=rofs-filtered
 version=1.7
-revision=1
+revision=2
 build_style=cmake
 makedepends="fuse-devel"
 short_desc="Filtered read only filesystem for FUSE"

From fa9f2ec55c5593ecd66b26fabf907d701a98441e 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: Sat, 27 Mar 2021 15:40:26 +0700
Subject: [PATCH 54/64] seexpr-krita: don't overwrite CMAKE_BUILD_TYPE

---
 .../patches/cmake-build-type-none.patch       | 32 +++++++++++++++++++
 1 file changed, 32 insertions(+)
 create mode 100644 srcpkgs/seexpr-krita/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/seexpr-krita/patches/cmake-build-type-none.patch b/srcpkgs/seexpr-krita/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..94bb1f37db75
--- /dev/null
+++ b/srcpkgs/seexpr-krita/patches/cmake-build-type-none.patch
@@ -0,0 +1,32 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -42,14 +42,6 @@ endif()
+ 
+ ## Choose build options
+ # Disney specific method of choosing variant
+-if (${FLAVOR} STREQUAL "optimize")
+-    set(CMAKE_BUILD_TYPE "Release" CACHE STRING "type of build" FORCE)
+-endif()
+-
+-if (${FLAVOR} STREQUAL "debug")
+-    set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "type of build" FORCE)
+-endif()
+-
+ if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
+     execute_process(
+         COMMAND sh -c "echo `uname -s`-`uname -r | cut -d- -f1`-`uname -m`"
+@@ -212,12 +204,6 @@ else()
+ endif()
+ 
+ # Set to release if nothing else defined
+-if (NOT CMAKE_BUILD_TYPE)
+-  set(CMAKE_BUILD_TYPE "Release" CACHE STRING
+-      "Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel."
+-      FORCE)
+-endif()
+-
+ if (ENABLE_QT5)
+     find_package(Qt5 5.9.0 COMPONENTS Core Gui Widgets REQUIRED)
+     set_package_properties(Qt5 PROPERTIES

From 96f1b6fcc5e79b75490aaecdc958c08ff7cf8e68 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: Sat, 27 Mar 2021 15:50:53 +0700
Subject: [PATCH 55/64] speed-dreams: hardening

---
 srcpkgs/speed-dreams/template | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/speed-dreams/template b/srcpkgs/speed-dreams/template
index 722f0c5ed87a..df7164f9c808 100644
--- a/srcpkgs/speed-dreams/template
+++ b/srcpkgs/speed-dreams/template
@@ -1,13 +1,13 @@
 # Template file for 'speed-dreams'
 pkgname=speed-dreams
 version=2.2.2
-revision=2
+revision=3
 archs="i686* x86_64* ppc64le*"
 _rev=r6553
 create_wrksrc=yes
 build_style=cmake
-configure_args="-DSD_BINDIR=/usr/bin -DSD_DATADIR=/usr/share/speed-dreams-2 -DSD_LIBDIR=/usr/lib/speed-dreams-2
- -DOPTION_OFFICIAL_ONLY=ON -DCMAKE_CXX_FLAGS=-fpermissive -DCMAKE_C_FLAGS=-fpermissive"
+configure_args="-DSD_BINDIR=/usr/bin -DSD_DATADIR=/usr/share/speed-dreams-2
+ -DSD_LIBDIR=/usr/lib/speed-dreams-2 -DOPTION_OFFICIAL_ONLY=ON"
 hostmakedepends="pkg-config"
 makedepends="freealut-devel libenet-devel libfreeglut-devel libjpeg-turbo-devel
  libpng-devel libvorbis-devel libXrandr-devel osg-devel plib-devel SDL2-devel
@@ -26,6 +26,8 @@ checksum="32aa55c17f8dafc1c54fb0d0b7b993d2688d431899cfc5db9eeece148c6887d0
  0b7b417d007ab3b7f0f4dcfdc868aafee1722150b81af519e1cd4c082b408183"
 nocross=yes
 replaces="speed-dreams-data>=0"
+CFLAGS=-fpermissive
+CXXFLAGS=-fpermissive
 
 if [ "$XBPS_TARGET_LIBC" = musl ]; then
 	broken="Segmentation fault"

From e9a04e50205312c38c1b2faf5908b674d85cc603 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: Sat, 27 Mar 2021 19:04:09 +0700
Subject: [PATCH 56/64] traverso: hardening

---
 .../patches/cmake-build-type-none.patch       | 28 +++++++++++++++++++
 srcpkgs/traverso/template                     |  2 +-
 2 files changed, 29 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/traverso/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/traverso/patches/cmake-build-type-none.patch b/srcpkgs/traverso/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..75b3fd941eb8
--- /dev/null
+++ b/srcpkgs/traverso/patches/cmake-build-type-none.patch
@@ -0,0 +1,28 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -65,13 +65,7 @@ SET(TRAVERSO_DEFINES -DSTATIC_BUILD)
+ 
+ #BUILD SETUP
+ #None, Debug, Release, .. or custom ones
+-IF(WANT_DEBUG)
+-  SET(CMAKE_BUILD_TYPE DEBUG)
+-  SET(WANT_TRAVERSO_DEBUG ON)
+-ELSE(WANT_DEBUG)
+-  SET(CMAKE_BUILD_TYPE RELEASE)
+-  LIST(APPEND TRAVERSO_DEFINES -DQT_NO_DEBUG)
+-ENDIF(WANT_DEBUG)
++LIST(APPEND TRAVERSO_DEFINES -DQT_NO_DEBUG)
+ 
+ 
+ IF(WANT_TRAVERSO_DEBUG)
+@@ -326,7 +320,7 @@ ${Qt5Xml_INCLUDE_DIRS}
+ ${Qt5Xml_INCLUDES}
+ )
+ 
+-set(CMAKE_CXX_FLAGS "-fPIC")
++set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
+ 
+ #Set up libraries to link with all found packages
+ LINK_LIBRARIES (
diff --git a/srcpkgs/traverso/template b/srcpkgs/traverso/template
index 105924d4f0c6..4b93460f63d7 100644
--- a/srcpkgs/traverso/template
+++ b/srcpkgs/traverso/template
@@ -1,7 +1,7 @@
 # Template file for 'traverso'
 pkgname=traverso
 version=0.49.6
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DWANT_MP3_ENCODE=ON -DDETECT_HOST_CPU_FEATURES=OFF"
 hostmakedepends="pkg-config qt5-qmake qt5-host-tools"

From d8099af5c3ec6a2b449a10e97f7a1114f474cc3d 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: Sat, 27 Mar 2021 19:08:11 +0700
Subject: [PATCH 57/64] xstarter: hardening

---
 .../patches/cmake-build-type-none.patch       | 22 +++++++++++++++++++
 srcpkgs/xstarter/template                     |  2 +-
 2 files changed, 23 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/xstarter/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/xstarter/patches/cmake-build-type-none.patch b/srcpkgs/xstarter/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..4f793e4c473c
--- /dev/null
+++ b/srcpkgs/xstarter/patches/cmake-build-type-none.patch
@@ -0,0 +1,22 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -5,16 +5,8 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
+ 
+ project(xstarter)
+ 
+-if(NOT CMAKE_BUILD_TYPE)
+-  set(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build (Debug or Release)" FORCE)
+-endif()
+-
+ set(PROJECT_VERSION "0.8.0")
+-if (CMAKE_BUILD_TYPE STREQUAL Debug)
+-  set(CMAKE_C_FLAGS "-g -Wall -pedantic")
+-else()
+-  set(CMAKE_C_FLAGS "-Wall -pedantic -O3")
+-endif()
++set(CMAKE_C_FLAGS "-Wall -pedantic ${CMAKE_C_FLAGS}")
+ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/bin")
+ 
+ set (CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
diff --git a/srcpkgs/xstarter/template b/srcpkgs/xstarter/template
index aa9a47e45e5c..4363d36e3c39 100644
--- a/srcpkgs/xstarter/template
+++ b/srcpkgs/xstarter/template
@@ -1,7 +1,7 @@
 # Template file for 'xstarter'
 pkgname=xstarter
 version=0.8.0
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="pkg-config"
 makedepends="glib-devel ncurses-devel"

From 3ccc901009fbec6e735559c5305652985aca2b32 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: Sat, 27 Mar 2021 19:15:48 +0700
Subject: [PATCH 58/64] yabause-gtk: ignore -O3

---
 srcpkgs/yabause-gtk/patches/fix-cflags.patch | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 srcpkgs/yabause-gtk/patches/fix-cflags.patch

diff --git a/srcpkgs/yabause-gtk/patches/fix-cflags.patch b/srcpkgs/yabause-gtk/patches/fix-cflags.patch
new file mode 100644
index 000000000000..52c1cae61799
--- /dev/null
+++ b/srcpkgs/yabause-gtk/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: src/CMakeLists.txt
+===================================================================
+--- src/CMakeLists.txt.orig
++++ src/CMakeLists.txt
+@@ -659,7 +659,7 @@ else ()
+ 	set(yabause_SOURCES ${yabause_SOURCES} sock-dummy.c thr-dummy.c)
+ endif ()
+ 
+-set(YAB_OPTIMIZATION "-O3" CACHE STRING "Override optimization level")
++set(YAB_OPTIMIZATION "" CACHE STRING "Override optimization level")
+ 
+ if("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "i686")
+ 	set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${YAB_OPTIMIZATION} -march=i686 -msse")

From 74b945bb8aa631470b6f9fbf691053aba84d95a5 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: Sat, 27 Mar 2021 19:26:47 +0700
Subject: [PATCH 59/64] ympd: hardening

---
 srcpkgs/ympd/patches/fix-cflags.patch | 13 +++++++++++++
 srcpkgs/ympd/template                 |  2 +-
 2 files changed, 14 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/ympd/patches/fix-cflags.patch

diff --git a/srcpkgs/ympd/patches/fix-cflags.patch b/srcpkgs/ympd/patches/fix-cflags.patch
new file mode 100644
index 000000000000..4720dd39e748
--- /dev/null
+++ b/srcpkgs/ympd/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -24,7 +24,7 @@ include_directories(${PROJECT_BINARY_DIR
+ 
+ include(CheckCSourceCompiles)
+ 
+-set(CMAKE_C_FLAGS "-std=gnu99 -Wall")
++set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99 -Wall")
+ set(CMAKE_C_FLAGS_DEBUG "-ggdb -pedantic")
+ if(WITH_IPV6)
+     set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS NS_ENABLE_IPV6)
diff --git a/srcpkgs/ympd/template b/srcpkgs/ympd/template
index 14437beb5384..450c079b2ca3 100644
--- a/srcpkgs/ympd/template
+++ b/srcpkgs/ympd/template
@@ -1,7 +1,7 @@
 # Template file for 'ympd'
 pkgname=ympd
 version=1.3.0
-revision=7
+revision=8
 build_style=cmake
 hostmakedepends="perl pkg-config"
 makedepends="libmpdclient-devel openssl-devel"

From d04863967110a5446ab006ce62a7b899de41344b 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: Sat, 27 Mar 2021 19:29:31 +0700
Subject: [PATCH 60/64] z80ex: hardening

---
 srcpkgs/z80ex/patches/fix-cflags.patch | 13 +++++++++++++
 srcpkgs/z80ex/template                 |  2 +-
 2 files changed, 14 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/z80ex/patches/fix-cflags.patch

diff --git a/srcpkgs/z80ex/patches/fix-cflags.patch b/srcpkgs/z80ex/patches/fix-cflags.patch
new file mode 100644
index 000000000000..6743da255e5c
--- /dev/null
+++ b/srcpkgs/z80ex/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -11,7 +11,7 @@ option (OPSTEP_FAST_AND_ROUGH "Fast and
+ 
+ #ALL_CFLAGS := -fPIC -fno-common -ansi -pedantic -Wall -pipe -O2 -I. -I./include
+ if (CMAKE_COMPILER_IS_GNUCC)
+-    set (CMAKE_C_FLAGS "-fPIC -fno-common -ansi -pedantic -Wall -pipe -O2")
++    set (CMAKE_C_FLAGS "-fPIC -fno-common -ansi -pedantic -Wall -pipe ${CMAKE_C_FLAGS}")
+ endif ()
+ 
+ include_directories(BEFORE . include)
diff --git a/srcpkgs/z80ex/template b/srcpkgs/z80ex/template
index 00a24a6fb902..ae04241dcb5a 100644
--- a/srcpkgs/z80ex/template
+++ b/srcpkgs/z80ex/template
@@ -1,7 +1,7 @@
 # Template file for 'z80ex'
 pkgname=z80ex
 version=1.1.21
-revision=1
+revision=2
 build_style=cmake
 short_desc="ZiLOG Z80 CPU emulation library"
 maintainer="Diogo Leal <diogo@diogoleal.com>"

From 652c9126952f4f305709df6bc022cf354e7f3853 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: Sat, 27 Mar 2021 19:17:13 +0700
Subject: [PATCH 61/64] scribus: don't overwrite cmake-build-type

---
 .../patches/cmake-build-type-none.patch       | 33 +++++++++++++++++++
 1 file changed, 33 insertions(+)
 create mode 100644 srcpkgs/scribus/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/scribus/patches/cmake-build-type-none.patch b/srcpkgs/scribus/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..670c83cc48f5
--- /dev/null
+++ b/srcpkgs/scribus/patches/cmake-build-type-none.patch
@@ -0,0 +1,33 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -35,11 +35,6 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON)
+ 
+ 
+ #RPATH setup - more below too
+-if (WANT_NORPATH OR WANT_DISTROBUILD)
+-	set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
+-else()
+-	set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
+-endif()
+ set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
+ set(CMAKE_SKIP_RULE_DEPENDENCY TRUE)
+ set(CMAKE_SKIP_BUILD_RPATH TRUE)
+@@ -309,16 +304,6 @@ include (CMakeLists_Directories.cmake)
+ #Convert our simpler command line option to the CMake style
+ #None, Debug, Release, .. or custom ones
+ # set(WANT_DEBUG ON)
+-if(WANT_DEBUG)
+-	set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Set Debug Build Type" FORCE)
+-endif()
+-if (WANT_RELEASEWITHDEBUG)
+-	set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING "Set Release with Debug Info Build Type" FORCE)
+-endif()
+-if(NOT WANT_DEBUG AND NOT WANT_RELEASEWITHDEBUG)
+-	set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Set Release Build Type" FORCE)
+-endif()
+-
+ 
+ 
+ #Based on our build type, setup our build options

From 53a3b7c0f26c6ee3733398de568504527403fb78 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, 28 Mar 2021 10:39:04 +0700
Subject: [PATCH 62/64] yoshimi: cleanup, don't overwrite CMAKE_BUILD_TYPE

---
 srcpkgs/yoshimi/patches/fix-cflags.patch | 12 ++++++++++++
 srcpkgs/yoshimi/template                 | 13 +------------
 2 files changed, 13 insertions(+), 12 deletions(-)
 create mode 100644 srcpkgs/yoshimi/patches/fix-cflags.patch

diff --git a/srcpkgs/yoshimi/patches/fix-cflags.patch b/srcpkgs/yoshimi/patches/fix-cflags.patch
new file mode 100644
index 000000000000..4baeb82ef4e3
--- /dev/null
+++ b/srcpkgs/yoshimi/patches/fix-cflags.patch
@@ -0,0 +1,12 @@
+Index: src/CMakeLists.txt
+===================================================================
+--- src/CMakeLists.txt.orig
++++ src/CMakeLists.txt
+@@ -262,7 +262,6 @@ if (BuildForDebug)
+     set (CMAKE_CXX_FLAGS_DEBUG ${BuildOptionsDebug})
+     message (STATUS "DEBUG Build, flags: ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_DEBUG}")
+ else()
+-    set (CMAKE_BUILD_TYPE "Release")
+     set (CMAKE_CXX_FLAGS_RELEASE ${BuildOptionsRelease})
+     message (STATUS "RELEASE Build, flags: ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELEASE}")
+ endif ()
diff --git a/srcpkgs/yoshimi/template b/srcpkgs/yoshimi/template
index 0096f7f05710..64a6c9ad433f 100644
--- a/srcpkgs/yoshimi/template
+++ b/srcpkgs/yoshimi/template
@@ -4,6 +4,7 @@ version=1.7.4
 revision=2
 build_wrksrc=src
 build_style=cmake
+configure_args="-DCMAKE_INSTALL_DATAROOTDIR=/usr/share"
 hostmakedepends="pkg-config fltk"
 makedepends="boost-devel jack-devel fltk-devel fftw-devel mxml-devel cairo-devel
  lv2 readline-devel ncurses-devel"
@@ -17,15 +18,3 @@ checksum=27a8e33bda72aafae604e14841bed6373fc9e00ff70c98f1e13215d6a8808318
 case "$XBPS_TARGET_MACHINE" in
 	*-musl) makedepends+=" argp-standalone";;
 esac
-
-configure_args="-DCMAKE_INSTALL_DATAROOTDIR=/usr/share"
-
-pre_configure() {
-	sed -i 's|ncurses|ncursesw|g' CMakeLists.txt
-
-	case "$XBPS_TARGET_MACHINE" in
-		i686*) ;;
-		x86_64*) ;;
-		*) sed -i -e "s|-msse -msse2 -mfpmath=sse||g" CMakeLists.txt;;
-	esac
-}

From 0746f95d9fe51142162b2c9954377170f49e6f21 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, 28 Mar 2021 10:49:25 +0700
Subject: [PATCH 63/64] zulucrypt: remove -O3

---
 srcpkgs/zulucrypt/patches/fix-cflags.patch | 26 ++++++++++++++++++++++
 1 file changed, 26 insertions(+)
 create mode 100644 srcpkgs/zulucrypt/patches/fix-cflags.patch

diff --git a/srcpkgs/zulucrypt/patches/fix-cflags.patch b/srcpkgs/zulucrypt/patches/fix-cflags.patch
new file mode 100644
index 000000000000..d77c539c6c13
--- /dev/null
+++ b/srcpkgs/zulucrypt/patches/fix-cflags.patch
@@ -0,0 +1,26 @@
+Index: external_libraries/tcplay/CMakeLists.txt
+===================================================================
+--- external_libraries/tcplay/CMakeLists.txt.orig
++++ external_libraries/tcplay/CMakeLists.txt
+@@ -13,7 +13,7 @@ set (SRCS_LINUX  crypto-gcrypt.c)
+ set (CFLAGS_LINUX  "-D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE")
+ set (CFLAGS_WARN "-w")
+ set (CFLAGS_DEBUG  "-O0 -g3 -DDEBUG")
+-set (CFLAGS_OPT    "-O3")
++set (CFLAGS_OPT    "")
+ set (CFLAGS_VER    "-DMAJ_VER=${VERSION_MAJOR} -DMIN_VER=${VERSION_MINOR}")
+ set (CFLAGS_COMMON "-std=c99 -fPIC  ${CFLAGS_LINUX} ${CFLAGS_WARN} ${CFLAGS_VER}")
+ if ($ENV{DEBUG})
+Index: external_libraries/tcplay/Makefile.classic
+===================================================================
+--- external_libraries/tcplay/Makefile.classic.orig
++++ external_libraries/tcplay/Makefile.classic
+@@ -47,8 +47,6 @@ COMMON_CFLAGS= $(WARNFLAGS) -fPIC $(VER_
+ 
+ ifeq ($(DEBUG), yes)
+   COMMON_CFLAGS+= -O0 -g -DDEBUG
+-else
+-  COMMON_CFLAGS+= -O3
+ endif
+ 
+ ifeq (${SYSTEM}, linux)

From b7f331027935ec794fca1948d8d8decfd1ce85b9 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, 28 Mar 2021 10:43:24 +0700
Subject: [PATCH 64/64] zbackup: don't overwrite CMAKE_BUILD_TYPE

---
 .../patches/cmake-build-type-none.patch       | 26 +++++++++++++++++++
 1 file changed, 26 insertions(+)
 create mode 100644 srcpkgs/zbackup/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/zbackup/patches/cmake-build-type-none.patch b/srcpkgs/zbackup/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..6d6ebc8e124d
--- /dev/null
+++ b/srcpkgs/zbackup/patches/cmake-build-type-none.patch
@@ -0,0 +1,26 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -6,8 +6,6 @@ project( zbackup )
+ 
+ set( CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" )
+ 
+-set( CMAKE_BUILD_TYPE Release )
+-
+ find_package( ZLIB REQUIRED )
+ include_directories( ${ZLIB_INCLUDE_DIRS} )
+ 
+Index: tartool/CMakeLists.txt
+===================================================================
+--- tartool/CMakeLists.txt.orig
++++ tartool/CMakeLists.txt
+@@ -4,8 +4,6 @@
+ cmake_minimum_required( VERSION 2.6.0 )
+ project( tartool )
+ 
+-set( CMAKE_BUILD_TYPE Release )
+-
+ add_executable( tartool tartool.cc ../file.cc ../dir.cc )
+ 
+ install( TARGETS tartool DESTINATION bin )

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: build-style/cmake: set CMAKE_BUILD_TYPE to None
  2021-03-14 13:19 [PR PATCH] [WIP] build-style/cmake: set CMAKE_BUILD_TYPE to None sgn
                   ` (26 preceding siblings ...)
  2021-03-28  3:53 ` sgn
@ 2021-03-28  3:54 ` sgn
  2021-03-29  0:48 ` [PR PATCH] [Updated] " sgn
                   ` (4 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: sgn @ 2021-03-28  3:54 UTC (permalink / raw)
  To: ml

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

New comment by sgn on void-packages repository

https://github.com/void-linux/void-packages/pull/29459#issuecomment-808839929

Comment:
@void-linux/pkg-committers please have a look. I expect to push this out next weekend if no major change required.

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PR PATCH] [Updated] build-style/cmake: set CMAKE_BUILD_TYPE to None
  2021-03-14 13:19 [PR PATCH] [WIP] build-style/cmake: set CMAKE_BUILD_TYPE to None sgn
                   ` (27 preceding siblings ...)
  2021-03-28  3:54 ` sgn
@ 2021-03-29  0:48 ` sgn
  2021-03-29 15:30 ` sgn
                   ` (3 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: sgn @ 2021-03-29  0:48 UTC (permalink / raw)
  To: ml

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

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

https://github.com/sgn/void-packages cmake-build-type-to-None
https://github.com/void-linux/void-packages/pull/29459

build-style/cmake: set CMAKE_BUILD_TYPE to None
- I'm going to build all packages with `build_style=cmake` and fix them one by one before merging this in.

[ci skip]

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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-cmake-build-type-to-None-29459.patch --]
[-- Type: text/x-diff, Size: 119975 bytes --]

From ff649d7663d7dfd8da37a81fdbd8b0d5781752d8 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, 14 Mar 2021 20:18:03 +0700
Subject: [PATCH 01/64] build-style/cmake: set CMAKE_BUILD_TYPE to None

- CMAKE_BUILD_TYPE=Release will force -O3 instead of respecting our
  CFLAGS and CXXFLAGS
- Theoretically, we could patch cmake to always use -O2 instead,
  however, patching will break users' expectation when compiling their
  our code.
- RelWithDebInfo could be another option if it's acceptable to always
  have debug symbol available.
- However, some projects ignore all CFLAGS and CXXFLAGS;
- Some other projects relies on CMAKE_BUILD_TYPE=Release to install to
  correct location and/or disable coverage.
- To get away with -O3, we need patching either ways, let's go with
  CMAKE_BUILD_TYPE=None, and patch all problematic softwares.
---
 common/build-style/cmake.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/build-style/cmake.sh b/common/build-style/cmake.sh
index 5100a96dfd7b..9d1a1a7a1941 100644
--- a/common/build-style/cmake.sh
+++ b/common/build-style/cmake.sh
@@ -52,7 +52,7 @@ _EOF
 		cmake_args+=" -DCMAKE_TOOLCHAIN_FILE=cross_${XBPS_CROSS_TRIPLET}.cmake"
 	fi
 	cmake_args+=" -DCMAKE_INSTALL_PREFIX=/usr"
-	cmake_args+=" -DCMAKE_BUILD_TYPE=Release"
+	cmake_args+=" -DCMAKE_BUILD_TYPE=None"
 	cmake_args+=" -DCMAKE_INSTALL_LIBDIR=lib${XBPS_TARGET_WORDSIZE}"
 
 	if [[ $build_helper = *"qemu"* ]]; then

From 9483af4ad12087ba0ea0da67a31d47f8934b3e24 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: Mon, 15 Mar 2021 08:07:16 +0700
Subject: [PATCH 02/64] amdvlk: allow CMAKE_BUILD_TYPE=None

---
 .../patches/cmake-build-type-none.patch       | 60 +++++++++++++++++++
 1 file changed, 60 insertions(+)
 create mode 100644 srcpkgs/amdvlk/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/amdvlk/patches/cmake-build-type-none.patch b/srcpkgs/amdvlk/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..7a629e58548e
--- /dev/null
+++ b/srcpkgs/amdvlk/patches/cmake-build-type-none.patch
@@ -0,0 +1,60 @@
+Index: llvm-project/llvm/CMakeLists.txt
+===================================================================
+--- llvm-project/llvm/CMakeLists.txt.orig
++++ llvm-project/llvm/CMakeLists.txt
+@@ -251,11 +251,6 @@ endif()
+ 
+ string(TOUPPER "${CMAKE_BUILD_TYPE}" uppercase_CMAKE_BUILD_TYPE)
+ 
+-if (CMAKE_BUILD_TYPE AND
+-    NOT uppercase_CMAKE_BUILD_TYPE MATCHES "^(DEBUG|RELEASE|RELWITHDEBINFO|MINSIZEREL)$")
+-  message(FATAL_ERROR "Invalid value for CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
+-endif()
+-
+ set(LLVM_LIBDIR_SUFFIX "" CACHE STRING "Define suffix of library directory name (32/64)" )
+ 
+ set(LLVM_TOOLS_INSTALL_DIR "bin" CACHE STRING "Path for binary subdirectory (defaults to 'bin')")
+Index: pal/cmake/Modules/AmdCmakeHelper.cmake
+===================================================================
+--- pal/cmake/Modules/AmdCmakeHelper.cmake.orig
++++ pal/cmake/Modules/AmdCmakeHelper.cmake
+@@ -37,11 +37,6 @@ if (CMAKE_CONFIGURATION_TYPES)
+ else()
+     string(TOUPPER "${CMAKE_BUILD_TYPE}" capital_CMAKE_BUILD_TYPE)
+ 
+-    if (CMAKE_BUILD_TYPE AND
+-        NOT capital_CMAKE_BUILD_TYPE MATCHES "^(DEBUG|RELEASE|RELWITHDEBINFO|MINSIZEREL)$")
+-        message(FATAL_ERROR "Invalid value for CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
+-    endif()
+-
+     if(capital_CMAKE_BUILD_TYPE STREQUAL "DEBUG")
+         set(CMAKE_BUILD_TYPE_DEBUG ON)
+         set(CMAKE_BUILD_TYPE_RELEASE OFF)
+Index: xgl/CMakeLists.txt
+===================================================================
+--- xgl/CMakeLists.txt.orig
++++ xgl/CMakeLists.txt
+@@ -181,11 +181,6 @@ if (CMAKE_CONFIGURATION_TYPES)
+ else()
+     string(TOUPPER "${CMAKE_BUILD_TYPE}" capital_CMAKE_BUILD_TYPE)
+ 
+-    if (CMAKE_BUILD_TYPE AND
+-        NOT capital_CMAKE_BUILD_TYPE MATCHES "^(DEBUG|RELEASE|RELWITHDEBINFO|MINSIZEREL)$")
+-        message(FATAL_ERROR "Invalid value for CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
+-    endif()
+-
+     if(capital_CMAKE_BUILD_TYPE STREQUAL "DEBUG")
+         set(CMAKE_BUILD_TYPE_DEBUG ON)
+         set(CMAKE_BUILD_TYPE_RELEASE OFF)
+Index: xgl/icd/CMakeLists.txt
+===================================================================
+--- xgl/icd/CMakeLists.txt.orig
++++ xgl/icd/CMakeLists.txt
+@@ -84,7 +84,6 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Cl
+     endif()
+ 
+     if(CMAKE_BUILD_TYPE_RELEASE)
+-        target_compile_options(xgl PRIVATE -O3)
+         if(XGL_ENABLE_LTO)
+             if(${CMAKE_CXX_COMPILER_ID} MATCHES "GNU")
+                 execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION)

From 2fb2a1904aba9bec7ef268d86e55aff96bedd81b 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: Wed, 17 Mar 2021 06:24:04 +0700
Subject: [PATCH 03/64] eigen*: set CMAKE_BUILD_TYPE to Release

We're going to set default CMAKE_BUILD_TYPE to None soon. Those packages
are header only libraries, no need to waste time on patching.
---
 srcpkgs/eigen/template    | 1 +
 srcpkgs/eigen3.2/template | 1 +
 2 files changed, 2 insertions(+)

diff --git a/srcpkgs/eigen/template b/srcpkgs/eigen/template
index ee825e95f273..072228c16915 100644
--- a/srcpkgs/eigen/template
+++ b/srcpkgs/eigen/template
@@ -3,6 +3,7 @@ pkgname=eigen
 version=3.3.9
 revision=1
 build_style=cmake
+configure_args="-DCMAKE_BUILD_TYPE=Release"
 short_desc="C++ template library for linear algebra (version 3.x)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MPL-2.0, GPL-3.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
diff --git a/srcpkgs/eigen3.2/template b/srcpkgs/eigen3.2/template
index 5715fc1b3a19..7b710534b5e5 100644
--- a/srcpkgs/eigen3.2/template
+++ b/srcpkgs/eigen3.2/template
@@ -4,6 +4,7 @@ version=3.2.10
 revision=3
 wrksrc="eigen-${version}"
 build_style=cmake
+configure_args="-DCMAKE_BUILD_TYPE=Release"
 short_desc="C++ template library for linear algebra (version 3.x)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MPL-2.0, GPL-3.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"

From 850846ce2cd0d3bcb09a6278de224831921bd3ef 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: Wed, 17 Mar 2021 07:04:48 +0700
Subject: [PATCH 04/64] embree: don't ignore CXXFLAGS, fix build with ispc
 1.13+

---
 .../embree/patches/uintNN-is-part-of-ispc-1.13.patch | 12 ++++++++++++
 srcpkgs/embree/template                              |  6 ++----
 2 files changed, 14 insertions(+), 4 deletions(-)
 create mode 100644 srcpkgs/embree/patches/uintNN-is-part-of-ispc-1.13.patch

diff --git a/srcpkgs/embree/patches/uintNN-is-part-of-ispc-1.13.patch b/srcpkgs/embree/patches/uintNN-is-part-of-ispc-1.13.patch
new file mode 100644
index 000000000000..5d0b02f3b2e5
--- /dev/null
+++ b/srcpkgs/embree/patches/uintNN-is-part-of-ispc-1.13.patch
@@ -0,0 +1,12 @@
+Index: embree-2.17.7/tutorials/common/common.isph
+===================================================================
+--- embree-2.17.7.orig/tutorials/common/common.isph
++++ embree-2.17.7/tutorials/common/common.isph
+@@ -16,7 +16,3 @@
+ 
+ #pragma once
+ 
+-typedef unsigned int64 uint64;
+-typedef unsigned int32 uint32;
+-typedef unsigned int16 uint16;
+-typedef unsigned int8  uint8;
diff --git a/srcpkgs/embree/template b/srcpkgs/embree/template
index 0bc72f46b6d8..849ec3c26c1d 100644
--- a/srcpkgs/embree/template
+++ b/srcpkgs/embree/template
@@ -4,6 +4,7 @@ version=2.17.7
 revision=2
 archs="x86_64"
 build_style=cmake
+configure_args="-DTBB_ROOT=/usr -DEMBREE_IGNORE_CMAKE_CXX_FLAGS=OFF"
 hostmakedepends="ispc"
 makedepends="libfreeglut-devel libXmu-devel tbb-devel MesaLib-devel libpng-devel
  libopenexr-devel libjpeg-turbo-devel libmagick-devel"
@@ -13,10 +14,7 @@ license="Apache-2.0"
 homepage="https://embree.github.io/"
 distfiles="https://github.com/$pkgname/$pkgname/archive/v$version.tar.gz"
 checksum=c0694f287fa1fbb382aba3a895702e248d92f7e89c0e5f64aefee965482ec04c
-
-nopie=y
-
-configure_args="-DTBB_ROOT=/usr -DENABLE_TUTORIALS=OFF"
+patch_args=-Np1
 
 embree-devel_package() {
 	depends="${sourcepkg}>=${version}_${revision}"

From ce041ae786a5c5fb0cd7695dea7ecb428fd6495f 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: Wed, 17 Mar 2021 07:35:19 +0700
Subject: [PATCH 05/64] ettercap: remove libressl patch, CMAKE_BUILD_TYPE=None

---
 .../patches/allow-build-type-none.patch       | 24 ++++++++++++++
 srcpkgs/ettercap/patches/libressl.patch       | 31 -------------------
 srcpkgs/ettercap/template                     |  9 ++++--
 3 files changed, 31 insertions(+), 33 deletions(-)
 create mode 100644 srcpkgs/ettercap/patches/allow-build-type-none.patch
 delete mode 100644 srcpkgs/ettercap/patches/libressl.patch

diff --git a/srcpkgs/ettercap/patches/allow-build-type-none.patch b/srcpkgs/ettercap/patches/allow-build-type-none.patch
new file mode 100644
index 000000000000..324d75086b05
--- /dev/null
+++ b/srcpkgs/ettercap/patches/allow-build-type-none.patch
@@ -0,0 +1,24 @@
+Index: ettercap-0.8.3.1/CMakeLists.txt
+===================================================================
+--- ettercap-0.8.3.1.orig/CMakeLists.txt
++++ ettercap-0.8.3.1/CMakeLists.txt
+@@ -22,19 +22,6 @@ option(LIBRARY_BUILD "Build for libetter
+ option(INSTALL_DESKTOP "Install ettercap desktop files" ON)
+ 
+ 
+-set(VALID_BUILD_TYPES Debug Release RelWithDebInfo)
+-
+-if(NOT CMAKE_BUILD_TYPE)
+-  # Default to using "Release" as our build type.
+-  set(CMAKE_BUILD_TYPE "Release" CACHE STRING
+-    "Choose the type of build, options are: ${VALID_BUILD_TYPES}." FORCE)
+-endif()
+-list(FIND VALID_BUILD_TYPES ${CMAKE_BUILD_TYPE} contains_valid)
+-if(contains_valid EQUAL -1)
+-  message(FATAL_ERROR "Unknown CMAKE_BUILD_TYPE: '${CMAKE_BUILD_TYPE}'. Valid options are: ${VALID_BUILD_TYPES}")
+-endif()
+-unset(contains_valid)
+-
+ include(CMakeDependentOption)
+ 
+ # If SYSTEM_LIBS is set to off, then all SYSTEM_* options will be
diff --git a/srcpkgs/ettercap/patches/libressl.patch b/srcpkgs/ettercap/patches/libressl.patch
deleted file mode 100644
index 15e0d3c1c9e7..000000000000
--- a/srcpkgs/ettercap/patches/libressl.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From b2f7634c9dbc0ef68640f0571787d92300e9f9f9 Mon Sep 17 00:00:00 2001
-From: Stefan Strogin <stefan@steils.org>
-Date: Sat, 15 Aug 2020 07:18:31 +0300
-Subject: [PATCH] ec_sslwrap: fix compilation with LibreSSL
-
-Disable taking over SNI extension from ClientHello and SSL configuration
-operations until LibreSSL supports the required API.
-
-Fixes: https://github.com/Ettercap/ettercap/issues/1068
----
- src/ec_sslwrap.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git src/ec_sslwrap.c src/ec_sslwrap.c
-index b9f26a142..1e4c24fc1 100644
---- src/ec_sslwrap.c
-+++ src/ec_sslwrap.c
-@@ -71,11 +71,11 @@
- #define TLS_server_method SSLv23_server_method
- #endif
- 
--#if (OPENSSL_VERSION_NUMBER >= 0x10100000L)
-+#if (OPENSSL_VERSION_NUMBER >= 0x10100000L) && !defined(LIBRESSL_VERSION_NUMBER)
- #define HAVE_OPENSSL_1_1_0
- #endif
- 
--#if (OPENSSL_VERSION_NUMBER >= 0x10101000L)
-+#if (OPENSSL_VERSION_NUMBER >= 0x10101000L) && !defined(LIBRESSL_VERSION_NUMBER)
- #define HAVE_OPENSSL_1_1_1
- #endif
- 
diff --git a/srcpkgs/ettercap/template b/srcpkgs/ettercap/template
index 7fe4c340a079..611b4e9aded7 100644
--- a/srcpkgs/ettercap/template
+++ b/srcpkgs/ettercap/template
@@ -3,8 +3,8 @@ pkgname=ettercap
 version=0.8.3.1
 revision=2
 build_style=cmake
-configure_args="-DENABLE_GTK=OFF"
-hostmakedepends="flex"
+configure_args="-DENABLE_GTK=OFF -DBUNDLED_LIBS=OFF"
+hostmakedepends="flex pkg-config"
 makedepends="geoip-devel ncurses-devel openssl-devel libcurl-devel
  libltdl-devel libnet-devel libpcap-devel pcre-devel"
 conf_files="/etc/${pkgname}/etter.conf"
@@ -15,5 +15,10 @@ homepage="http://ettercap.github.com/ettercap/"
 distfiles="https://github.com/Ettercap/ettercap/archive/v${version}.tar.gz"
 checksum=d0c3ef88dfc284b61d3d5b64d946c1160fd04276b448519c1ae4438a9cdffaf3
 lib32disabled=yes
+patch_args=-Np1
 
 CFLAGS="-fcommon"
+
+post_extract() {
+	rm -rf bundled_deps
+}

From a5054545b831202ab003632b20a2fe281baecc01 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: Wed, 17 Mar 2021 08:27:10 +0700
Subject: [PATCH 06/64] injeqt: disable coverage

---
 srcpkgs/injeqt/template | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/injeqt/template b/srcpkgs/injeqt/template
index 1e5777fc0f18..78eba09a0249 100644
--- a/srcpkgs/injeqt/template
+++ b/srcpkgs/injeqt/template
@@ -3,7 +3,8 @@ pkgname=injeqt
 version=1.2.0
 revision=2
 build_style=cmake
-hostmakedepends="pkg-config"
+configure_args="-DDISABLE_COVERAGE=ON"
+hostmakedepends="pkg-config qt5-qmake qt5-host-tools"
 makedepends="qt5-devel"
 short_desc="Dependency injection framework for Qt"
 maintainer="Jürgen Buchmüller <pullmoll@t-online.de>"
@@ -12,9 +13,6 @@ homepage="https://github.com/vogel/injeqt/"
 distfiles="https://github.com/vogel/${pkgname}/archive/${version}.tar.gz>${pkgname}-${version}.tar.gz"
 checksum=77540cedb0b26affe993dd18124d796059e34c80a51d9ae6433fdff1860db135
 
-if [ -n "$CROSS_BUILD" ]; then
-	hostmakedepends+=" qt5-host-tools qt5-devel"
-fi
 CXXFLAGS="-fno-lifetime-dse -Wno-error=cast-align"
 
 injeqt-devel_package() {

From 312e82e0623fbae76578d2883efb4002a53afb10 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: Wed, 17 Mar 2021 22:26:37 +0700
Subject: [PATCH 07/64] kindd: build with CMAKE_BUILD_TYPE=None

---
 srcpkgs/kindd/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/kindd/template b/srcpkgs/kindd/template
index e634b0f69bf6..4416041de58c 100644
--- a/srcpkgs/kindd/template
+++ b/srcpkgs/kindd/template
@@ -15,7 +15,7 @@ distfiles="${homepage}/archive/${version}.tar.gz"
 checksum=e596f1b1577ff3e83a779e6181252ae2f09731f513d17dd6b95cbc2cf204654f
 
 do_install() {
-	vbin release/kindd
+	vbin build/core/kindd
 	vinstall assets/appconf/kindd.svg 644 usr/share/pixmaps
 	vinstall assets/appconf/kindd.desktop 644 usr/share/applications
 }

From 6493fd3aced1bc12bef300e14b037c89146737a4 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: Thu, 18 Mar 2021 23:58:53 +0700
Subject: [PATCH 08/64] occt: allow CMAKE_BUILD_TYPE=None

---
 srcpkgs/occt/patches/cmake-build-type-none.patch | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 srcpkgs/occt/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/occt/patches/cmake-build-type-none.patch b/srcpkgs/occt/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..acb06fb55766
--- /dev/null
+++ b/srcpkgs/occt/patches/cmake-build-type-none.patch
@@ -0,0 +1,13 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -4,7 +4,7 @@ set (CMAKE_MODULE_PATH "${CMAKE_SOURCE_D
+ 
+ set (CMAKE_SUPPRESS_REGENERATION TRUE)
+ 
+-set (CMAKE_CONFIGURATION_TYPES Release Debug RelWithDebInfo CACHE INTERNAL "" FORCE)
++set (CMAKE_CONFIGURATION_TYPES None Release Debug RelWithDebInfo CACHE INTERNAL "" FORCE)
+ 
+ # macro: include patched file if it exists
+ macro (OCCT_INCLUDE_CMAKE_FILE BEING_INCLUDED_FILE)

From c42ca35fa6571cd7bb0b02231d136618f61f07ff 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: Fri, 19 Mar 2021 23:07:05 +0700
Subject: [PATCH 09/64] renderdoc: devendor zstd, lz4

---
 .../patches/build-type-none-is-release.patch  | 12 ++++
 .../renderdoc/patches/qmake-no-rpath.patch    | 13 ++++
 .../renderdoc/patches/unvendor-zstd-lz4.patch | 68 +++++++++++++++++++
 srcpkgs/renderdoc/template                    | 15 ++--
 4 files changed, 99 insertions(+), 9 deletions(-)
 create mode 100644 srcpkgs/renderdoc/patches/build-type-none-is-release.patch
 create mode 100644 srcpkgs/renderdoc/patches/qmake-no-rpath.patch
 create mode 100644 srcpkgs/renderdoc/patches/unvendor-zstd-lz4.patch

diff --git a/srcpkgs/renderdoc/patches/build-type-none-is-release.patch b/srcpkgs/renderdoc/patches/build-type-none-is-release.patch
new file mode 100644
index 000000000000..f16b944bc12c
--- /dev/null
+++ b/srcpkgs/renderdoc/patches/build-type-none-is-release.patch
@@ -0,0 +1,12 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -315,6 +315,7 @@ set(RELEASE_MODE 0)
+ 
+ if(cmake_build_type_lower STREQUAL "release" OR
+    cmake_build_type_lower STREQUAL "relwithdebinfo" OR
++   cmake_build_type_lower STREQUAL "none" OR
+    cmake_build_type_lower STREQUAL "minsizerel")
+     add_definitions(-D_RELEASE)
+     message(STATUS "Building RenderDoc in Release mode: ${CMAKE_BUILD_TYPE}")
diff --git a/srcpkgs/renderdoc/patches/qmake-no-rpath.patch b/srcpkgs/renderdoc/patches/qmake-no-rpath.patch
new file mode 100644
index 000000000000..6e6325c53555
--- /dev/null
+++ b/srcpkgs/renderdoc/patches/qmake-no-rpath.patch
@@ -0,0 +1,13 @@
+Index: qrenderdoc/CMakeLists.txt
+===================================================================
+--- qrenderdoc/CMakeLists.txt.orig
++++ qrenderdoc/CMakeLists.txt
+@@ -144,7 +144,7 @@ endif()
+ # and finding dependencies from the cmake build
+ file(WRITE
+      ${CMAKE_BINARY_DIR}/qrenderdoc/qrenderdoc_cmake.pri
+-     "CONFIG+=${QMAKE_CONFIG}\n"
++     "CONFIG+=${QMAKE_CONFIG} no_qt_rpath\n"
+      "\n"
+      "QMAKE_CC=${CMAKE_C_COMPILER}\n"
+      "QMAKE_CXX=${CMAKE_CXX_COMPILER}\n"
diff --git a/srcpkgs/renderdoc/patches/unvendor-zstd-lz4.patch b/srcpkgs/renderdoc/patches/unvendor-zstd-lz4.patch
new file mode 100644
index 000000000000..d4003ded9161
--- /dev/null
+++ b/srcpkgs/renderdoc/patches/unvendor-zstd-lz4.patch
@@ -0,0 +1,68 @@
+Index: renderdoc/CMakeLists.txt
+===================================================================
+--- renderdoc/CMakeLists.txt.orig
++++ renderdoc/CMakeLists.txt
+@@ -213,54 +213,10 @@ set(sources
+     3rdparty/pugixml/pugixml.cpp
+     3rdparty/pugixml/pugixml.hpp
+     3rdparty/pugixml/pugiconfig.hpp
+-    3rdparty/lz4/lz4.c
+-    3rdparty/lz4/lz4.h
+     3rdparty/miniz/miniz.c
+     3rdparty/miniz/miniz.h
+     3rdparty/superluminal/superluminal.cpp
+     3rdparty/superluminal/superluminal.h
+-    3rdparty/zstd/bitstream.h
+-    3rdparty/zstd/compiler.h
+-    3rdparty/zstd/cpu.h
+-    3rdparty/zstd/debug.c
+-    3rdparty/zstd/debug.h
+-    3rdparty/zstd/entropy_common.c
+-    3rdparty/zstd/error_private.c
+-    3rdparty/zstd/error_private.h
+-    3rdparty/zstd/fse.h
+-    3rdparty/zstd/fse_compress.c
+-    3rdparty/zstd/fse_decompress.c
+-    3rdparty/zstd/hist.c
+-    3rdparty/zstd/hist.h
+-    3rdparty/zstd/huf.h
+-    3rdparty/zstd/huf_compress.c
+-    3rdparty/zstd/huf_decompress.c
+-    3rdparty/zstd/mem.h
+-    3rdparty/zstd/pool.c
+-    3rdparty/zstd/pool.h
+-    3rdparty/zstd/threading.c
+-    3rdparty/zstd/threading.h
+-    3rdparty/zstd/xxhash.c
+-    3rdparty/zstd/xxhash.h
+-    3rdparty/zstd/zstd.h
+-    3rdparty/zstd/zstd_common.c
+-    3rdparty/zstd/zstd_compress.c
+-    3rdparty/zstd/zstd_compress_internal.h
+-    3rdparty/zstd/zstd_decompress.c
+-    3rdparty/zstd/zstd_double_fast.c
+-    3rdparty/zstd/zstd_double_fast.h
+-    3rdparty/zstd/zstd_errors.h
+-    3rdparty/zstd/zstd_fast.c
+-    3rdparty/zstd/zstd_fast.h
+-    3rdparty/zstd/zstd_internal.h
+-    3rdparty/zstd/zstd_lazy.c
+-    3rdparty/zstd/zstd_lazy.h
+-    3rdparty/zstd/zstd_ldm.c
+-    3rdparty/zstd/zstd_ldm.h
+-    3rdparty/zstd/zstd_opt.c
+-    3rdparty/zstd/zstd_opt.h
+-    3rdparty/zstd/zstdmt_compress.c
+-    3rdparty/zstd/zstdmt_compress.h
+     3rdparty/stb/stb_image.h
+     3rdparty/stb/stb_image_write.h
+     3rdparty/stb/stb_image_resize.h
+@@ -271,6 +227,8 @@ set(sources
+     3rdparty/tinyfiledialogs/tinyfiledialogs.c
+     3rdparty/tinyfiledialogs/tinyfiledialogs.h)
+ 
++list(APPEND RDOC_LIBRARIES -llz4 -lzstd)
++
+ if(ANDROID)
+     list(APPEND sources
+         data/embedded_files.h
diff --git a/srcpkgs/renderdoc/template b/srcpkgs/renderdoc/template
index 7240e9ebc307..4615d45c52c9 100644
--- a/srcpkgs/renderdoc/template
+++ b/srcpkgs/renderdoc/template
@@ -1,13 +1,14 @@
 # Template file for 'renderdoc'
 pkgname=renderdoc
 version=1.12
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DENABLE_GL=ON -DENABLE_GLES=ON -DENABLE_QRENDERDOC=ON
  -DENABLE_RENDERDOCCMD=ON -DENABLE_VULKAN=ON -DENABLE_XCB=ON -DENABLE_XLIB=ON
  -DENABLE_PYRENDERDOC=ON"
-hostmakedepends="bison autoconf automake pkg-config python3"
+hostmakedepends="bison autoconf automake pkg-config python3 swig"
 makedepends="libX11-devel libxcb-devel xcb-util-keysyms-devel qt5-devel
+ libzstd-devel liblz4-devel
  qt5-svg-devel qt5-x11extras-devel pcre-devel python3-devel"
 short_desc="Stand-alone graphics debugging tool for Vulkan and OpenGL"
 maintainer="Urs Schulz <voidpkgs@ursschulz.de>"
@@ -19,19 +20,14 @@ checksum=4dece1b4cb859a76533b28fcd50e17321acfaa81c3435500a006c4a5ba15fddb
 if [ "$XBPS_TARGET_LIBC" = musl ]; then
 	makedepends+=" libexecinfo-devel"
 	LDLIBS="-lexecinfo"
+	broken="uses RTLD_DL_LINKMAP, RTLD_DEEPBIND, _r_debug"
 fi
 
 if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
 	makedepends+=" libatomic-devel"
 fi
 
-case "$XBPS_TARGET_MACHINE" in
-	*-musl) broken="uses RTLD_DL_LINKMAP, RTLD_DEEPBIND, _r_debug" ;;
-esac
-
-if [ "$CROSS_BUILD" ]; then
-	broken="Cross-compilation can't find python3 interpreter"
-fi
+nocross="Cross-compilation can't find python3 interpreter"
 
 post_patch() {
 	[ -z "$XBPS_TARGET_NO_ATOMIC8" ] && return 0
@@ -40,4 +36,5 @@ post_patch() {
 
 post_install() {
 	vlicense LICENSE.md
+	vlicense docs/credits_acknowledgements.rst
 }

From e70da6e955d10802f16f1774a0ee9a96c4637036 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: Sat, 20 Mar 2021 00:47:52 +0700
Subject: [PATCH 10/64] python3-occ: build with CMAKE_BUILD_TYPE=None

---
 srcpkgs/python3-occ/template | 1 +
 1 file changed, 1 insertion(+)

diff --git a/srcpkgs/python3-occ/template b/srcpkgs/python3-occ/template
index 705f37457943..3ea0ef5e6387 100644
--- a/srcpkgs/python3-occ/template
+++ b/srcpkgs/python3-occ/template
@@ -5,6 +5,7 @@ revision=1
 archs="i686* x86_64* armv7l* aarch64* ppc*"
 wrksrc="pythonocc-core-${version}"
 build_style=cmake
+configure_args="-DPYTHONOCC_BUILD_TYPE=None -DCMAKE_BUILD_TYPE=None"
 hostmakedepends="python3 swig"
 makedepends="python3-devel occt-devel freetype-devel swig"
 depends="python3 occt freetype"

From cc7f438fa7d33eca626cc30d29cd6ee19346f18d 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: Fri, 19 Mar 2021 23:38:10 +0700
Subject: [PATCH 11/64] widelands: allow CMAKE_BUILD_TYPE=None

---
 srcpkgs/widelands-data                        |  1 -
 .../patches/cmake-build-type-none.patch       | 63 +++++++++++++++++++
 .../widelands/patches/fix-install-path.patch  | 40 ++++++++++++
 srcpkgs/widelands/template                    | 21 +------
 4 files changed, 105 insertions(+), 20 deletions(-)
 delete mode 120000 srcpkgs/widelands-data
 create mode 100644 srcpkgs/widelands/patches/cmake-build-type-none.patch
 create mode 100644 srcpkgs/widelands/patches/fix-install-path.patch

diff --git a/srcpkgs/widelands-data b/srcpkgs/widelands-data
deleted file mode 120000
index e9fbf89517f2..000000000000
--- a/srcpkgs/widelands-data
+++ /dev/null
@@ -1 +0,0 @@
-widelands
\ No newline at end of file
diff --git a/srcpkgs/widelands/patches/cmake-build-type-none.patch b/srcpkgs/widelands/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..3d210854741b
--- /dev/null
+++ b/srcpkgs/widelands/patches/cmake-build-type-none.patch
@@ -0,0 +1,63 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -202,7 +202,7 @@ elseif(CMAKE_BUILD_TYPE STREQUAL "RelWit
+   set(WL_DEBUG_FLAGS "-DNDEBUG -DNOPARACHUTE")
+   option(OPTION_ASAN "Build with AddressSanitizer" ON)
+ else()
+-  message(FATAL_ERROR "Unknown CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
++  set(WL_DEBUG_FLAGS "-DNDEBUG -DNOPARACHUTE")
+ endif()
+ 
+ wl_add_flag(WL_GENERIC_CXX_FLAGS "-std=c++11")
+@@ -353,7 +353,7 @@ endif (OPTION_BUILD_TESTS)
+ install (
+   FILES ${CMAKE_CURRENT_BINARY_DIR}/VERSION
+   DESTINATION ${WL_INSTALL_BASEDIR}
+-  CONFIGURATIONS Debug;Release
++  CONFIGURATIONS Debug
+   COMPONENT CoreVersionFile
+ )
+ 
+@@ -378,7 +378,6 @@ install(
+     data/txts
+     data/world
+   DESTINATION ${WL_INSTALL_DATADIR}
+-  CONFIGURATIONS Debug;Release
+   COMPONENT CoreDataFiles
+ )
+ 
+@@ -386,7 +385,6 @@ install(
+   DIRECTORY
+     data/maps
+   DESTINATION ${WL_INSTALL_DATADIR}
+-  CONFIGURATIONS Debug;Release
+   COMPONENT MapFiles
+ )
+ 
+@@ -395,7 +393,6 @@ install(
+     data/music
+     data/sound
+   DESTINATION ${WL_INSTALL_DATADIR}
+-  CONFIGURATIONS Debug;Release
+   COMPONENT MusicFiles
+ )
+ 
+@@ -405,7 +402,7 @@ install(
+     CREDITS
+     ChangeLog
+   DESTINATION ${WL_INSTALL_BASEDIR}
+-  CONFIGURATIONS Debug;Release
++  CONFIGURATIONS Debug
+   COMPONENT CoreLicenseFiles
+ )
+ 
+@@ -424,7 +421,6 @@ install(
+   DIRECTORY
+     ${CMAKE_CURRENT_BINARY_DIR}/locale/
+   DESTINATION ${WL_INSTALL_DATADIR}/locale
+-  CONFIGURATIONS Debug;Release
+   COMPONENT CoreLanguageFiles
+ )
+ 
diff --git a/srcpkgs/widelands/patches/fix-install-path.patch b/srcpkgs/widelands/patches/fix-install-path.patch
new file mode 100644
index 000000000000..6bb461389f03
--- /dev/null
+++ b/srcpkgs/widelands/patches/fix-install-path.patch
@@ -0,0 +1,40 @@
+Index: cmake/WlFunctions.cmake
+===================================================================
+--- cmake/WlFunctions.cmake.orig
++++ cmake/WlFunctions.cmake
+@@ -289,5 +289,5 @@ function(wl_binary NAME)
+ 
+   #Quoting the CMake documentation on DESTINATION:
+   #"If a relative path is given it is interpreted relative to the value of CMAKE_INSTALL_PREFIX"
+-  install(TARGETS ${NAME} DESTINATION "." COMPONENT ExecutableFiles)
++  install(TARGETS ${NAME} DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT ExecutableFiles)
+ endfunction()
+Index: xdg/CMakeLists.txt
+===================================================================
+--- xdg/CMakeLists.txt.orig
++++ xdg/CMakeLists.txt
+@@ -6,19 +6,19 @@ set(XDG_APPLICATION_ID "org.widelands.Wi
+ list(APPEND icon_sizes "16" "32" "48" "64" "128")
+ foreach (icon_size ${icon_sizes})
+   #install(FILES ${CMAKE_SOURCE_DIR}/data/images/logos/wl-ico-${icon_size}.png DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/${icon_size}x${icon_size}/apps RENAME ${XDG_APPLICATION_ID}.png)
+-  install(FILES ${CMAKE_SOURCE_DIR}/data/images/logos/wl-ico-${icon_size}.png DESTINATION ../share/icons/hicolor/${icon_size}x${icon_size}/apps RENAME ${XDG_APPLICATION_ID}.png)
++  install(FILES ${CMAKE_SOURCE_DIR}/data/images/logos/wl-ico-${icon_size}.png DESTINATION share/icons/hicolor/${icon_size}x${icon_size}/apps RENAME ${XDG_APPLICATION_ID}.png)
+ endforeach (icon_size ${icon_sizes})
+ #install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${CMAKE_PROJECT_NAME}.6           DESTINATION ${CMAKE_INSTALL_MANDIR}/man6)
+-install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${CMAKE_PROJECT_NAME}.6           DESTINATION ../share/man/man6)
++install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${CMAKE_PROJECT_NAME}.6           DESTINATION share/man/man6)
+ #install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${XDG_APPLICATION_ID}.desktop     DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications)
+-install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${XDG_APPLICATION_ID}.desktop     DESTINATION ../share/applications)
++install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${XDG_APPLICATION_ID}.desktop     DESTINATION share/applications)
+ #install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${XDG_APPLICATION_ID}.appdata.xml DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/metainfo)
+-install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${XDG_APPLICATION_ID}.appdata.xml DESTINATION ../share/metainfo)
++install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${XDG_APPLICATION_ID}.appdata.xml DESTINATION share/metainfo)
+ 
+ find_program(GTK_UPDATE_ICON_CACHE NAMES gtk-update-icon-cache)
+ if (GTK_UPDATE_ICON_CACHE)
+   #install(CODE "execute_process (COMMAND ${GTK_UPDATE_ICON_CACHE} -t -f ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor ||: )")
+-  install(CODE "execute_process (COMMAND ${GTK_UPDATE_ICON_CACHE} -t -f ${CMAKE_INSTALL_PREFIX}/../share/icons/hicolor ||: )")
++  install(CODE "execute_process (COMMAND ${GTK_UPDATE_ICON_CACHE} -t -f ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor ||: )")
+ else (GTK_UPDATE_ICON_CACHE)
+   message(WARNING "gtk-update-icon-cache not found!")
+ endif (GTK_UPDATE_ICON_CACHE)
diff --git a/srcpkgs/widelands/template b/srcpkgs/widelands/template
index 6cee85087ea7..cfa2c10993e0 100644
--- a/srcpkgs/widelands/template
+++ b/srcpkgs/widelands/template
@@ -1,7 +1,7 @@
 # Template file for 'widelands'
 pkgname=widelands
 version=21
-revision=3
+revision=4
 wrksrc="${pkgname}-build${version}"
 build_style=cmake
 configure_args="-DOPENGL_INCLUDE_DIR=${XBPS_CROSS_BASE}/usr/include
@@ -10,13 +10,13 @@ hostmakedepends="python3 pkg-config gettext"
 makedepends="boost-devel icu-devel minizip-devel gettext-devel
  glu-devel glew-devel SDL2-devel SDL2_gfx-devel SDL2_image-devel
  SDL2_net-devel SDL2_mixer-devel SDL2_ttf-devel"
-depends="${pkgname}-data-${version}_${revision}"
 short_desc="Real-time strategy game"
 maintainer="Jürgen Buchmüller <pullmoll@t-online.de>"
 license="GPL-2.0-or-later"
 homepage="http://www.widelands.org/"
 distfiles="https://github.com/widelands/widelands/archive/build${version}.tar.gz>${pkgname}-${version}.tar.gz"
 checksum=601e0e4c6f91b3fb0ece2cd1b83ecfb02344a1b9194fbb70ef3f70e06994e357
+replaces="widelands-data>=0"
 
 CXXFLAGS="-DU_USING_ICU_NAMESPACE=1"
 
@@ -29,22 +29,5 @@ if [ "$CROSS_BUILD" ]; then
 fi
 
 post_install() {
-	# For some reason the binary is installed as /usr/widelands - move it
-	vmkdir usr/bin
-	mv ${DESTDIR}/usr/${pkgname} ${DESTDIR}/usr/bin
-	vmkdir usr/share
-	mv ${DESTDIR}/share/* ${DESTDIR}/usr/share/
-	rmdir ${DESTDIR}/share
-
-	# Remove files not needed in the package
-	rm -f ${DESTDIR}/usr/COPYING ${DESTDIR}/usr/CREDITS ${DESTDIR}/usr/ChangeLog ${DESTDIR}/usr/VERSION
-
 	vinstall ${FILESDIR}/${pkgname}.desktop 644 usr/share/applications
 }
-
-widelands-data_package() {
-	short_desc+=" - data files"
-	pkg_install() {
-		vmove usr/share/widelands
-	}
-}

From 08d6fec077008549323829317ca2656e7230814d 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: Sat, 20 Mar 2021 09:49:25 +0700
Subject: [PATCH 12/64] zziplib: fix SONAME when build with
 -DCMAKE_BUILD_TYPE=None

---
 .../cmake-build-type-none-soname.patch        | 35 +++++++++++++++++++
 srcpkgs/zziplib/template                      |  1 +
 2 files changed, 36 insertions(+)
 create mode 100644 srcpkgs/zziplib/patches/cmake-build-type-none-soname.patch

diff --git a/srcpkgs/zziplib/patches/cmake-build-type-none-soname.patch b/srcpkgs/zziplib/patches/cmake-build-type-none-soname.patch
new file mode 100644
index 000000000000..2d31b5b8a46a
--- /dev/null
+++ b/srcpkgs/zziplib/patches/cmake-build-type-none-soname.patch
@@ -0,0 +1,35 @@
+Index: zziplib-0.13.72/zzip/CMakeLists.txt
+===================================================================
+--- zziplib-0.13.72.orig/zzip/CMakeLists.txt
++++ zziplib-0.13.72/zzip/CMakeLists.txt
+@@ -190,15 +190,18 @@ target_include_directories (libzzipmmapp
+ endif()
+ 
+ set_target_properties(libzzip PROPERTIES OUTPUT_NAME "zzip" RELEASE_POSTFIX "-${RELNUM}")
++set_target_properties(libzzip PROPERTIES OUTPUT_NAME "zzip" NONE_POSTFIX "-${RELNUM}")
+ SET_TARGET_PROPERTIES(libzzip PROPERTIES VERSION ${VERNUM}.${FIXNUM} SOVERSION ${VERNUM})
+ 
+ if(ZZIPFSEEKO)
+ set_target_properties(libzzipfseeko PROPERTIES OUTPUT_NAME "zzipfseeko" RELEASE_POSTFIX "-${RELNUM}")
++set_target_properties(libzzipfseeko PROPERTIES OUTPUT_NAME "zzipfseeko" NONE_POSTFIX "-${RELNUM}")
+ SET_TARGET_PROPERTIES(libzzipfseeko PROPERTIES VERSION ${VERNUM}.${FIXNUM} SOVERSION ${VERNUM})
+ endif()
+ 
+ if(ZZIPMMAPPED)
+ set_target_properties(libzzipmmapped PROPERTIES OUTPUT_NAME "zzipmmapped" RELEASE_POSTFIX "-${RELNUM}")
++set_target_properties(libzzipmmapped PROPERTIES OUTPUT_NAME "zzipmmapped" NONE_POSTFIX "-${RELNUM}")
+ SET_TARGET_PROPERTIES(libzzipmmapped PROPERTIES VERSION ${VERNUM}.${FIXNUM} SOVERSION ${VERNUM})
+ endif()
+ 
+Index: zziplib-0.13.72/zzipwrap/CMakeLists.txt
+===================================================================
+--- zziplib-0.13.72.orig/zzipwrap/CMakeLists.txt
++++ zziplib-0.13.72/zzipwrap/CMakeLists.txt
+@@ -49,6 +49,7 @@ target_link_libraries(libzzipwrap libzzi
+ target_include_directories(libzzipwrap PRIVATE "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}")
+ 
+ set_target_properties(libzzipwrap PROPERTIES OUTPUT_NAME "zzipwrap" RELEASE_POSTFIX "-${RELNUM}")
++set_target_properties(libzzipwrap PROPERTIES OUTPUT_NAME "zzipwrap" NONE_POSTFIX "-${RELNUM}")
+ SET_TARGET_PROPERTIES(libzzipwrap PROPERTIES VERSION ${VERNUM}.${FIXNUM} SOVERSION ${VERNUM})
+ set_target_properties(libzzipwrap PROPERTIES DEFINE_SYMBOL "libzzip_EXPORTS")
+ 
diff --git a/srcpkgs/zziplib/template b/srcpkgs/zziplib/template
index ab5af234af62..2026f3e4a521 100644
--- a/srcpkgs/zziplib/template
+++ b/srcpkgs/zziplib/template
@@ -12,6 +12,7 @@ homepage="https://github.com/gdraheim/zziplib"
 changelog="https://raw.githubusercontent.com/gdraheim/zziplib/master/ChangeLog"
 distfiles="https://github.com/gdraheim/zziplib/archive/v${version}.tar.gz"
 checksum=93ef44bf1f1ea24fc66080426a469df82fa631d13ca3b2e4abaeab89538518dc
+patch_args=-Np1
 
 if [ "$CROSS_BUILD" ]; then
 	configure_args+=" -DZZIPTEST=OFF"

From 7ec4f63a9003e16d254baa508454051ff01449d5 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, 21 Mar 2021 15:28:04 +0700
Subject: [PATCH 13/64] mellowplayer: fix build

---
 srcpkgs/mellowplayer/patches/no-werror.patch | 13 +++++++++++++
 srcpkgs/mellowplayer/template                | 13 +++++++------
 2 files changed, 20 insertions(+), 6 deletions(-)
 create mode 100644 srcpkgs/mellowplayer/patches/no-werror.patch

diff --git a/srcpkgs/mellowplayer/patches/no-werror.patch b/srcpkgs/mellowplayer/patches/no-werror.patch
new file mode 100644
index 000000000000..7e678453a123
--- /dev/null
+++ b/srcpkgs/mellowplayer/patches/no-werror.patch
@@ -0,0 +1,13 @@
+Index: MellowPlayer-3.6.6/src/3rdparty/boost/di.hpp
+===================================================================
+--- MellowPlayer-3.6.6.orig/src/3rdparty/boost/di.hpp
++++ MellowPlayer-3.6.6/src/3rdparty/boost/di.hpp
+@@ -67,7 +67,7 @@ BOOST_DI_CFG_FWD
+ #pragma clang diagnostic error "-Wundefined-internal"
+ #pragma clang diagnostic ignored "-Wmissing-field-initializers"
+ #elif defined(__GCC__)
+-#pragma GCC diagnostic error "-Wdeprecated-declarations"
++#pragma GCC diagnostic warning "-Wdeprecated-declarations"
+ #pragma GCC diagnostic push
+ #if (__GNUC__ < 6)
+ #pragma GCC diagnostic error "-Werror"
diff --git a/srcpkgs/mellowplayer/template b/srcpkgs/mellowplayer/template
index 2f8f13960ca6..cfd8a185556f 100644
--- a/srcpkgs/mellowplayer/template
+++ b/srcpkgs/mellowplayer/template
@@ -4,7 +4,7 @@ version=3.6.6
 revision=1
 wrksrc="MellowPlayer-${version}"
 build_style=cmake
-hostmakedepends="pkg-config qt5-tools qt5-qmake"
+hostmakedepends="pkg-config qt5-tools qt5-qmake qt5-host-tools"
 makedepends="qt5-declarative-devel qt5-quickcontrols2-devel
  qt5-plugin-mysql qt5-plugin-pgsql qt5-plugin-sqlite
  qt5-plugin-tds qt5-plugin-odbc
@@ -17,11 +17,12 @@ license="GPL-2.0-or-later"
 homepage="https://colinduquesnoy.gitlab.io/MellowPlayer/"
 distfiles="https://gitlab.com/ColinDuquesnoy/MellowPlayer/-/archive/${version}/MellowPlayer-${version}.tar.bz2"
 checksum=17b8b25ca6b3d27b223f8be6ad80186ae5bd17ce762eb04ecd8b0e82e687b327
+patch_args=-Np1
 
-if [ "$CROSS_BUILD" ]; then
-	hostmakedepends+=" qt5-host-tools"
+if [ "$XBPS_WORDSIZE" != "$XBPS_TARGET_WORDSIZE" ]; then
+	broken="webengine can be built only if word size matches"
 fi
 
-case "$XBPS_TARGET_MACHINE" in
-	arm*) broken="qt5-webengine not available" ;;
-esac
+if [ "$XBPS_TARGET_ENDIAN" != "le" ]; then
+	broken="webengine only supports little endian"
+fi

From ff823e97cc558cd0afd8321e6d38fcda0be767e9 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, 21 Mar 2021 15:43:09 +0700
Subject: [PATCH 14/64] ispc: fix CMAKE_BUILD_TYPE=None

---
 .../ispc/patches/cmake-build-type-none.patch   | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
 create mode 100644 srcpkgs/ispc/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/ispc/patches/cmake-build-type-none.patch b/srcpkgs/ispc/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..411e353c7314
--- /dev/null
+++ b/srcpkgs/ispc/patches/cmake-build-type-none.patch
@@ -0,0 +1,18 @@
+Index: ispc-1.15.0/CMakeLists.txt
+===================================================================
+--- ispc-1.15.0.orig/CMakeLists.txt
++++ ispc-1.15.0/CMakeLists.txt
+@@ -157,13 +157,6 @@ set(OUTPUT_RELEASE Release/bin)
+ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin )
+ 
+ if(CMAKE_BUILD_TYPE)
+-    # Validate build type
+-    set(CONFIGURATION_TYPES "Debug;Release;RelWithDebInfo")
+-
+-    string(FIND "${CONFIGURATION_TYPES}" "${CMAKE_BUILD_TYPE}" MATCHED_CONFIG)
+-    if (${MATCHED_CONFIG} EQUAL -1)
+-         message(FATAL_ERROR "CMAKE_BUILD_TYPE (${CMAKE_BUILD_TYPE}) allows only the following values: ${CONFIGURATION_TYPES}")
+-    endif()
+ else(NOT CMAKE_BUILD_TYPE)
+     set(CMAKE_BUILD_TYPE "Release")
+     message(STATUS "Build type not specified: Use Release by default.")

From 7afc415af2bbb8e74fbc30b43271a23b92ed597d 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, 21 Mar 2021 15:56:50 +0700
Subject: [PATCH 15/64] darktable: fix CMAKE_BUILD_TYPE=None

---
 .../darktable/patches/cmake-build-type-none.patch  | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
 create mode 100644 srcpkgs/darktable/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/darktable/patches/cmake-build-type-none.patch b/srcpkgs/darktable/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..7101f9c1a0e7
--- /dev/null
+++ b/srcpkgs/darktable/patches/cmake-build-type-none.patch
@@ -0,0 +1,14 @@
+Index: src/external/rawspeed/cmake/build-type.cmake
+===================================================================
+--- src/external/rawspeed/cmake/build-type.cmake.orig
++++ src/external/rawspeed/cmake/build-type.cmake
+@@ -27,9 +27,6 @@ string(TOUPPER "${RAWSPEED_SPECIAL_BUILD
+ 
+ # is this one of the known build types?
+ list (FIND CMAKE_CONFIGURATION_TYPES_UPPERCASE ${CMAKE_BUILD_TYPE_UPPERCASE} BUILD_TYPE_IS_KNOWN)
+-if (${BUILD_TYPE_IS_KNOWN} EQUAL -1)
+- message(SEND_ERROR "Unknown build type: ${CMAKE_BUILD_TYPE_UPPERCASE}. Please specify one of: ${CMAKE_CONFIGURATION_TYPES}")
+-endif()
+ 
+ # is this a special build?
+ list (FIND RAWSPEED_SPECIAL_BUILD_TYPES_UPPERCASE ${CMAKE_BUILD_TYPE_UPPERCASE} IS_SPECIAL_BUILD)

From efc70d0ff15f2f0bdf4c9b2ca4ae566dfad93dfd 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, 21 Mar 2021 15:33:29 +0700
Subject: [PATCH 16/64] hedgewars: merge -data back

---
 srcpkgs/hedgewars-data                        |  1 -
 .../patches/cmake-build-type-none.patch       | 30 +++++++++++++++++++
 srcpkgs/hedgewars/template                    | 23 +++++---------
 3 files changed, 38 insertions(+), 16 deletions(-)
 delete mode 120000 srcpkgs/hedgewars-data
 create mode 100644 srcpkgs/hedgewars/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/hedgewars-data b/srcpkgs/hedgewars-data
deleted file mode 120000
index b57dc45ebadc..000000000000
--- a/srcpkgs/hedgewars-data
+++ /dev/null
@@ -1 +0,0 @@
-hedgewars
\ No newline at end of file
diff --git a/srcpkgs/hedgewars/patches/cmake-build-type-none.patch b/srcpkgs/hedgewars/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..b4e0c186717c
--- /dev/null
+++ b/srcpkgs/hedgewars/patches/cmake-build-type-none.patch
@@ -0,0 +1,30 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -54,7 +54,7 @@ option(NOVERSIONINFOUPDATE "Disable upda
+ 
+ 
+ if(BUILD_ENGINE_C AND NOT NOVIDEOREC)
+-    if((CMAKE_BUILD_TYPE STREQUAL "Release") OR (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo"))
++    if((CMAKE_BUILD_TYPE STREQUAL "Release") OR (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo") OR (CMAKE_BUILD_TYPE STREQUAL "None"))
+         message("NOTE: Video recorder support disabled. It's incompatible with BUILD_ENGINE_C")
+         set(BUILD_ENGINE_C ON CACHE STRING "Required for BUILD_ENGINE_JS" FORCE)
+     else()
+@@ -93,7 +93,7 @@ set(CPACK_PACKAGE_VERSION_MAJOR 1)
+ set(CPACK_PACKAGE_VERSION_MINOR 0)
+ set(CPACK_PACKAGE_VERSION_PATCH 0)
+ set(HEDGEWARS_PROTO_VER 59)
+-if((CMAKE_BUILD_TYPE STREQUAL "Release") OR (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo"))
++if((CMAKE_BUILD_TYPE STREQUAL "Release") OR (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo") OR (CMAKE_BUILD_TYPE STREQUAL "None"))
+     set(HEDGEWARS_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
+ else()
+     set(HEDGEWARS_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}-dev")
+@@ -114,6 +114,7 @@ include(${CMAKE_MODULE_PATH}/platform.cm
+ if(CMAKE_BUILD_TYPE)
+     if(NOT((CMAKE_BUILD_TYPE STREQUAL "Release") OR
+            (CMAKE_BUILD_TYPE STREQUAL "Debug") OR
++	   (CMAKE_BUILD_TYPE STREQUAL "None") OR
+            (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")))
+         set(CMAKE_BUILD_TYPE ${default_build_type} CACHE STRING "Build type (Debug/Release/RelWithDebInfo)" FORCE)
+         message(STATUS "Unknown build type ${CMAKE_BUILD_TYPE}, using default (${default_build_type})")
diff --git a/srcpkgs/hedgewars/template b/srcpkgs/hedgewars/template
index d2294cf572f5..f413a965ff2e 100644
--- a/srcpkgs/hedgewars/template
+++ b/srcpkgs/hedgewars/template
@@ -1,15 +1,15 @@
 # Template file for 'hedgewars'
 pkgname=hedgewars
 version=1.0.0
-revision=2
+revision=3
 wrksrc="${pkgname}-src-${version}"
 build_style=cmake
 configure_args="-DNOSERVER=1 -DDATA_INSTALL_DIR=/usr/share/${pkgname}
- -DPHYSFS_SYSTEM=1 -DCMAKE_VERBOSE_MAKEFILE=1 -DMINIMAL_FLAGS=1"
-hostmakedepends="lua51 pkg-config"
+ -DPHYSFS_SYSTEM=1 -DMINIMAL_FLAGS=1"
+hostmakedepends="lua51 pkg-config qt5-qmake qt5-host-tools"
 makedepends="ffmpeg-devel lua51-devel physfs-devel qt5-tools-devel SDL2_image-devel
  SDL2_mixer-devel SDL2_net-devel SDL2_ttf-devel"
-depends="hedgewars-data>=${version}_${revision} libfreeglut"
+depends="libfreeglut"
 short_desc="Funny turn-based artillery game, featuring fighting Hedgehogs!"
 maintainer="Jakub Skrzypnik <jot.skrzyp@gmail.com>"
 license="GPL-2.0-only"
@@ -18,10 +18,9 @@ distfiles="https://hedgewars.org/download/releases/hedgewars-src-${version}.tar.
 checksum=211634e61f2e4beecc3c98c6f749601fcd08321fda1ba969b3b3832a004f155b
 nopie_files="/usr/bin/hwengine"
 nocross="Needs investigation: fails to link hwengine"
-
-if [ -n "$CROSS_BUILD" ]; then
-	hostmakedepends+=" qt5-devel"
-fi
+replaces="hedgewars-data>=0"
+export CMAKE_GENERATOR="Unix Makefiles"
+make_cmd=make
 
 case $XBPS_TARGET_MACHINE in
 	x86_64*)
@@ -38,6 +37,7 @@ esac
 
 if [ -n "$_use_c_engine" ]; then
 	hostmakedepends+=" glew-devel libatomic-devel ghc clang"
+	makedepends+=" glew-devel libatomic-devel"
 	configure_args+=" -DBUILD_ENGINE_C=1"
 	nopie_files+=" /usr/bin/hedgewars"
 fi
@@ -56,10 +56,3 @@ pre_configure() {
 post_install() {
 	vinstall ${DESTDIR}/usr/share/hedgewars/Data/misc/hedgewars.desktop 644 usr/share/applications
 }
-
-hedgewars-data_package() {
-	short_desc+=" - data files"
-	pkg_install() {
-		vmove usr/share/hedgewars/Data
-	}
-}

From d4925256a420c0098ee0afe79e93b20ac49316a2 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, 21 Mar 2021 16:41:58 +0700
Subject: [PATCH 17/64] mariadb: fix for CMAKE_BUILD_TYPE=None

---
 srcpkgs/mariadb/template | 32 ++++++++++++++------------------
 1 file changed, 14 insertions(+), 18 deletions(-)

diff --git a/srcpkgs/mariadb/template b/srcpkgs/mariadb/template
index 437ff757b383..78d5e2dbdbe8 100644
--- a/srcpkgs/mariadb/template
+++ b/srcpkgs/mariadb/template
@@ -34,35 +34,31 @@ replaces="mysql>=0"
 conf_files="/etc/mysql/my.cnf"
 system_accounts="mysql"
 mysql_homedir="/var/lib/mysql"
-CFLAGS="-w -fcommon"
+CFLAGS="-w -fcommon -DDBUG_OFF=1"
+CXXFLAGS="-DDBUG_OFF=1"
 
 pre_configure() {
 	# We need some host binaries before starting cross compilation.
 	if [ "$CROSS_BUILD" ]; then
+		mkdir -p build.native
 		# XXX still broken: jemalloc configure execs host bins.
-		CC= CXX= CPP= LD= AR= AS= RANLIB= CFLAGS= CXXFLAGS= LDFLAGS= cmake .
-		make comp_err comp_sql gen_lex_hash gen_lex_token
-		mkdir bin.host
-		cp extra/comp_err bin.host
-		cp scripts/comp_sql bin.host
-		cp sql/gen_lex_hash bin.host
-		cp sql/gen_lex_token bin.host
-		make clean
-		rm CMakeCache.txt
+		CC= CXX= CPP= LD= AR= AS= RANLIB= CFLAGS= CXXFLAGS= LDFLAGS= \
+			cmake -S . -B build.native
+		make -C build.native comp_err comp_sql gen_lex_hash gen_lex_token
 	fi
 }
 
 pre_build() {
 	if [ "$CROSS_BUILD" ]; then
 		# CMake complains if those binaries ain't in build
-		cp bin.host/comp_err ${wrksrc}/extra
-		cp bin.host/comp_err ${wrksrc}/build/extra
-		cp bin.host/comp_sql ${wrksrc}/scripts
-		cp bin.host/comp_sql ${wrksrc}/build/scripts
-		cp bin.host/gen_lex_hash ${wrksrc}/sql
-		cp bin.host/gen_lex_hash ${wrksrc}/build/sql
-		cp bin.host/gen_lex_token ${wrksrc}/sql
-		cp bin.host/gen_lex_token ${wrksrc}/build/sql
+		cp build.native/extra/comp_err ${wrksrc}/extra
+		cp build.native/extra/comp_err ${wrksrc}/build/extra
+		cp build.native/scripts/comp_sql ${wrksrc}/scripts
+		cp build.native/scripts/comp_sql ${wrksrc}/build/scripts
+		cp build.native/sql/gen_lex_hash ${wrksrc}/sql
+		cp build.native/sql/gen_lex_hash ${wrksrc}/build/sql
+		cp build.native/sql/gen_lex_token ${wrksrc}/sql
+		cp build.native/sql/gen_lex_token ${wrksrc}/build/sql
 		export PATH=${PATH}:${wrksrc}/extra:${wrksrc}/scripts:${wrksrc}/sql
 	fi
 	export LD_LIBRARY_PATH=${wrksrc}/build/storage/tokudb/ft-index/portability

From d816fba19ac0943c2c7d2f4654bfacdabce7f29a 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: Thu, 25 Mar 2021 07:58:28 +0700
Subject: [PATCH 18/64] EternalTerminal: remove -ggdb3

---
 .../EternalTerminal/patches/fix-cflags.patch    | 17 +++++++++++++++++
 srcpkgs/EternalTerminal/template                |  1 +
 2 files changed, 18 insertions(+)
 create mode 100644 srcpkgs/EternalTerminal/patches/fix-cflags.patch

diff --git a/srcpkgs/EternalTerminal/patches/fix-cflags.patch b/srcpkgs/EternalTerminal/patches/fix-cflags.patch
new file mode 100644
index 000000000000..e6fcd432f7e7
--- /dev/null
+++ b/srcpkgs/EternalTerminal/patches/fix-cflags.patch
@@ -0,0 +1,17 @@
+Index: EternalTerminal-et-v6.0.13/CMakeLists.txt
+===================================================================
+--- EternalTerminal-et-v6.0.13.orig/CMakeLists.txt
++++ EternalTerminal-et-v6.0.13/CMakeLists.txt
+@@ -26,12 +26,6 @@ if(DISABLE_CRASH_LOG)
+ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DELPP_DISABLE_DEFAULT_CRASH_HANDLING")
+ ENDIF(DISABLE_CRASH_LOG)
+ 
+-if(UNIX)
+-  # Enable debug info
+-  SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -ggdb3")
+-  SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -ggdb3")
+-endif()
+-
+ # Enable C++-11
+ set(CMAKE_CXX_STANDARD 11)
+ set(CMAKE_CXX_STANDARD_REQUIRED ON)
diff --git a/srcpkgs/EternalTerminal/template b/srcpkgs/EternalTerminal/template
index 7bac78d2ffd4..bc92e47743dd 100644
--- a/srcpkgs/EternalTerminal/template
+++ b/srcpkgs/EternalTerminal/template
@@ -13,6 +13,7 @@ homepage="https://eternalterminal.dev/"
 distfiles="https://github.com/MisterTea/EternalTerminal/archive/et-v${version}.tar.gz"
 checksum=728c3a444d666897c710e33fe473d8d289263a59574451b13aa53ec3c6ac88b3
 system_accounts="_eternal"
+patch_args=-Np1
 
 LDFLAGS="-lgflags"
 

From 9029b9f0bc455dc6e8d3e4accf8318cebfcbb903 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: Thu, 25 Mar 2021 08:20:29 +0700
Subject: [PATCH 19/64] OTPClient: respect CFLAGS

---
 srcpkgs/OTPClient/patches/fix-cflags.patch | 17 +++++++++++++++++
 srcpkgs/OTPClient/template                 |  1 +
 2 files changed, 18 insertions(+)
 create mode 100644 srcpkgs/OTPClient/patches/fix-cflags.patch

diff --git a/srcpkgs/OTPClient/patches/fix-cflags.patch b/srcpkgs/OTPClient/patches/fix-cflags.patch
new file mode 100644
index 000000000000..ae70f441538f
--- /dev/null
+++ b/srcpkgs/OTPClient/patches/fix-cflags.patch
@@ -0,0 +1,17 @@
+Index: OTPClient-2.4.2/CMakeLists.txt
+===================================================================
+--- OTPClient-2.4.2.orig/CMakeLists.txt
++++ OTPClient-2.4.2/CMakeLists.txt
+@@ -11,11 +11,10 @@ option(BUILD_GUI "Build the GUI" ON)
+ option(BUILD_CLI "Build the CLI" ON)
+ 
+ set(CMAKE_C_STANDARD 11)
+-set(CMAKE_C_FLAGS "-Wall -Wextra -O3 -Wformat=2 -Wmissing-format-attribute -fstack-protector-strong -Wundef -Wmissing-format-attribute")
++set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wformat=2 -Wmissing-format-attribute -fstack-protector-strong -Wundef -Wmissing-format-attribute")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fdiagnostics-color=always -Wstrict-prototypes -Wunreachable-code")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wchar-subscripts -Wwrite-strings -Wpointer-arith -Wbad-function-cast -Wcast-align")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror=format-security -Werror=implicit-function-declaration -Wno-sign-compare")
+-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3")
+ if(CMAKE_COMPILER_IS_GNUCC)
+     set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pie -fPIE")
+ endif()
diff --git a/srcpkgs/OTPClient/template b/srcpkgs/OTPClient/template
index e8c0099850b7..f5af76e655a6 100644
--- a/srcpkgs/OTPClient/template
+++ b/srcpkgs/OTPClient/template
@@ -12,3 +12,4 @@ license="GPL-3.0-or-later"
 homepage="https://github.com/paolostivanin/OTPClient"
 distfiles="https://github.com/paolostivanin/OTPClient/archive/v${version}.tar.gz"
 checksum=74bc4312aa1cd336ca983434e3bed951c5ead327091e7708e3beb08508813495
+patch_args=-Np1

From 2d2c201decac0a1aa6678ca1c3d9e585b01a7fa9 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: Thu, 25 Mar 2021 08:30:31 +0700
Subject: [PATCH 20/64] crex: hardening

---
 srcpkgs/crex/patches/fix-cflags.patch | 20 ++++++++++++++++++++
 srcpkgs/crex/template                 |  7 ++-----
 2 files changed, 22 insertions(+), 5 deletions(-)
 create mode 100644 srcpkgs/crex/patches/fix-cflags.patch

diff --git a/srcpkgs/crex/patches/fix-cflags.patch b/srcpkgs/crex/patches/fix-cflags.patch
new file mode 100644
index 000000000000..d191fb1e9ec0
--- /dev/null
+++ b/srcpkgs/crex/patches/fix-cflags.patch
@@ -0,0 +1,20 @@
+Index: crex-0.2.5/CMakeLists.txt
+===================================================================
+--- crex-0.2.5.orig/CMakeLists.txt
++++ crex-0.2.5/CMakeLists.txt
+@@ -13,9 +13,6 @@ endif(CCACHE_FOUND)
+ set (CMAKE_CXX_STANDARD 14)
+ set (CMAKE_CXX_STANDARD_REQUIRED ON)
+ 
+-set (CMAKE_CXX_FLAGS "-fdiagnostics-color=auto")
+-set (CMAKE_C_FLAGS "-fdiagnostics-color=auto")
+-
+ set (DEBUG_FLAGS "-Wpedantic -Wall -Wextra -Wcast-align -Wcast-qual -Wctor-dtor-privacy -Wdisabled-optimization -Wformat=2 -Winit-self -Wlogical-op -Wmissing-declarations -Wmissing-include-dirs -Wnoexcept -Wold-style-cast -Woverloaded-virtual -Wredundant-decls -Wshadow -Wsign-conversion -Wsign-promo -Wstrict-null-sentinel -Wstrict-overflow=5 -Wswitch-default -Wundef -Wno-unused -std=c++14 -g")
+ set (DEBUG_LINK_FLAGS "-fprofile-arcs -ftest-coverage -flto")
+ 
+@@ -56,4 +53,4 @@ target_link_libraries (
+   ${TARGET}
+ )
+ 
+-install (TARGETS ${TARGET} DESTINATION "/usr/local/bin")
++install (TARGETS ${TARGET} DESTINATION "/usr/bin")
diff --git a/srcpkgs/crex/template b/srcpkgs/crex/template
index a54697a93adc..2f455a0b0c72 100644
--- a/srcpkgs/crex/template
+++ b/srcpkgs/crex/template
@@ -1,7 +1,7 @@
 # Template file for 'crex'
 pkgname=crex
 version=0.2.5
-revision=1
+revision=2
 build_style=cmake
 short_desc="Explore, test, and check regular expressions in the terminal"
 maintainer="Piotr Wójcik <chocimier@tlen.pl>"
@@ -9,10 +9,7 @@ license="MIT"
 homepage="https://github.com/octobanana/crex"
 distfiles="https://github.com/octobanana/crex/archive/${version}.tar.gz"
 checksum=c6a166b7a1e696a7babeaf7c5728eece1624704a18357f827129fc95ef2ecc56
-
-pre_configure() {
-	sed -e 's|/local/|/|' -i CMakeLists.txt
-}
+patch_args=-Np1
 
 post_install() {
 	vlicense LICENSE

From c7f09b91f5f1dff9f12e16fa95bf09b08d58f084 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: Thu, 25 Mar 2021 08:34:32 +0700
Subject: [PATCH 21/64] libbaseencode: hardening

---
 srcpkgs/libbaseencode/patches/fix-cflags.patch | 13 +++++++++++++
 srcpkgs/libbaseencode/template                 |  3 ++-
 2 files changed, 15 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/libbaseencode/patches/fix-cflags.patch

diff --git a/srcpkgs/libbaseencode/patches/fix-cflags.patch b/srcpkgs/libbaseencode/patches/fix-cflags.patch
new file mode 100644
index 000000000000..1bb86a0b15a4
--- /dev/null
+++ b/srcpkgs/libbaseencode/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: libbaseencode-1.0.9/CMakeLists.txt
+===================================================================
+--- libbaseencode-1.0.9.orig/CMakeLists.txt
++++ libbaseencode-1.0.9/CMakeLists.txt
+@@ -15,7 +15,7 @@ set(CMAKE_C_STANDARD 11)
+ set(BASEENCODE_HEADERS src/baseencode.h)
+ set(SOURCE_FILES src/base32.c src/base64.c)
+ 
+-set(CMAKE_C_FLAGS "-Wall -Werror -fPIC")
++set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Werror -fPIC")
+ 
+ add_library(${PROJECT_NAME} SHARED ${SOURCE_FILES})
+ 
diff --git a/srcpkgs/libbaseencode/template b/srcpkgs/libbaseencode/template
index 384a189224df..d5929ad7bb51 100644
--- a/srcpkgs/libbaseencode/template
+++ b/srcpkgs/libbaseencode/template
@@ -1,7 +1,7 @@
 # Template file for 'libbaseencode'
 pkgname=libbaseencode
 version=1.0.9
-revision=1
+revision=2
 build_style=cmake
 short_desc="Library for encoding decoding data use base32 or base64"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -9,6 +9,7 @@ license="Apache-2.0"
 homepage="https://github.com/paolostivanin/libbaseencode"
 distfiles="https://github.com/paolostivanin/libbaseencode/archive/v${version}.tar.gz"
 checksum=a183d7cf30d931b2a078d6f0ef64616b71ab26f9258e5f4e191778c7ace7175d
+patch_args=-Np1
 
 libbaseencode-devel_package() {
 	depends="libbaseencode-${version}_${revision}"

From e8ceb84be06fd00c3b5e0abcf0fbed6e9bbae9d9 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: Fri, 26 Mar 2021 08:46:56 +0700
Subject: [PATCH 22/64] bibletime: clean build flags

---
 srcpkgs/bibletime/patches/fix-cflags.patch | 13 +++++++++++++
 srcpkgs/bibletime/template                 |  1 +
 2 files changed, 14 insertions(+)
 create mode 100644 srcpkgs/bibletime/patches/fix-cflags.patch

diff --git a/srcpkgs/bibletime/patches/fix-cflags.patch b/srcpkgs/bibletime/patches/fix-cflags.patch
new file mode 100644
index 000000000000..480c5ca4ac1e
--- /dev/null
+++ b/srcpkgs/bibletime/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: bibletime-3.0/cmake/BTApplication.cmake
+===================================================================
+--- bibletime-3.0.orig/cmake/BTApplication.cmake
++++ bibletime-3.0/cmake/BTApplication.cmake
+@@ -41,7 +41,7 @@ IF(WIN32)
+     ADD_COMPILE_OPTIONS("/Zi")
+ ELSE()
+     ADD_COMPILE_OPTIONS(
+-        "-ggdb" "-Wall" "-Wextra"
++        "-Wall" "-Wextra" "-DNDEBUG" "-DQT_NO_DEBUG"
+         "$<$<STREQUAL:$<CONFIGURATION>,Release>:-O2>"
+         "$<$<STREQUAL:$<CONFIGURATION>,Release>:-DNDEBUG>"
+         "$<$<STREQUAL:$<CONFIGURATION>,Release>:-DQT_NO_DEBUG>"
diff --git a/srcpkgs/bibletime/template b/srcpkgs/bibletime/template
index 224881c45516..85bcc7f22f87 100644
--- a/srcpkgs/bibletime/template
+++ b/srcpkgs/bibletime/template
@@ -18,6 +18,7 @@ license="GPL-2.0-or-later"
 homepage="http://bibletime.info"
 distfiles="https://github.com/bibletime/bibletime/releases/download/v${version}/bibletime-${version}.tar.xz"
 checksum=d6beef62ad44b255e3dc4c5e89214bf01a0e85c9136073b0be12fca3d2b22622
+patch_args=-Np1
 
 pre_build() {
 	. /etc/profile.d/10_openjdk11.sh

From 1f1792385fffba4b9ea588988f4a7aa488106345 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: Fri, 26 Mar 2021 08:54:25 +0700
Subject: [PATCH 23/64] boomerang: clean build flags

---
 srcpkgs/boomerang/patches/fix-cflags.patch | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
 create mode 100644 srcpkgs/boomerang/patches/fix-cflags.patch

diff --git a/srcpkgs/boomerang/patches/fix-cflags.patch b/srcpkgs/boomerang/patches/fix-cflags.patch
new file mode 100644
index 000000000000..eb59766c1c5b
--- /dev/null
+++ b/srcpkgs/boomerang/patches/fix-cflags.patch
@@ -0,0 +1,21 @@
+Index: cmake-scripts/boomerang-flags.cmake
+===================================================================
+--- cmake-scripts/boomerang-flags.cmake
++++ cmake-scripts/boomerang-flags.cmake
+@@ -104,16 +104,6 @@ endif ()
+ 
+ 
+ if (NOT MSVC)
+-    if ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
+-        BOOMERANG_ADD_COMPILE_FLAGS(-O0)
+-    elseif ("${CMAKE_BUILD_TYPE}" STREQUAL "RelWithDebInfo")
+-        # No special flags
+-    elseif ("${CMAKE_BUILD_TYPE}" STREQUAL "MinSizeRel")
+-        BOOMERANG_ADD_COMPILE_FLAGS(-Os)
+-    else () # Release
+-        BOOMERANG_ADD_COMPILE_FLAGS(-O3)
+-    endif ()
+-
+     if (BOOMERANG_ENABLE_COVERAGE)
+         set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fprofile-arcs -ftest-coverage")
+         set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage")

From a59a6723c1c850e8cc0bcf028a77765fedfb89d1 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: Fri, 26 Mar 2021 08:58:11 +0700
Subject: [PATCH 24/64] catimg: don't change our build-type

---
 srcpkgs/catimg/patches/fix-cflags.patch | 12 ++++++++++++
 srcpkgs/catimg/template                 |  2 +-
 2 files changed, 13 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/catimg/patches/fix-cflags.patch

diff --git a/srcpkgs/catimg/patches/fix-cflags.patch b/srcpkgs/catimg/patches/fix-cflags.patch
new file mode 100644
index 000000000000..9b9f1074ef20
--- /dev/null
+++ b/srcpkgs/catimg/patches/fix-cflags.patch
@@ -0,0 +1,12 @@
+Index: catimg-2.7.0/CMakeLists.txt
+===================================================================
+--- catimg-2.7.0.orig/CMakeLists.txt
++++ catimg-2.7.0/CMakeLists.txt
+@@ -11,7 +11,6 @@ endif()
+ #set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wall -Wextra -g -std=c99 -Wno-unused-result")
+ #set(CMAKE_BUILD_TYPE Debug)
+ set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -Wall -Wextra -Os -std=c99 -Wno-unused-result")
+-set(CMAKE_BUILD_TYPE Release)
+ 
+ set(SRC ${PROJECT_SOURCE_DIR}/src)
+ 
diff --git a/srcpkgs/catimg/template b/srcpkgs/catimg/template
index 374351c45379..6fbc5f1d9140 100644
--- a/srcpkgs/catimg/template
+++ b/srcpkgs/catimg/template
@@ -9,7 +9,7 @@ license="MIT"
 homepage="https://github.com/posva/catimg"
 distfiles="https://github.com/posva/catimg/archive/${version}.tar.gz"
 checksum=3a6450316ff62fb07c3facb47ea208bf98f62abd02783e88c56f2a6508035139
-
+patch_args=-Np1
 CFLAGS="-fcommon"
 
 post_install() {

From 453b6cfef5b21c92f87b587990d83041f07c9343 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: Fri, 26 Mar 2021 09:09:37 +0700
Subject: [PATCH 25/64] libcotp: fix build flags

---
 srcpkgs/libcotp/patches/fix-cflags.patch | 14 ++++++++++++++
 srcpkgs/libcotp/template                 |  1 +
 2 files changed, 15 insertions(+)
 create mode 100644 srcpkgs/libcotp/patches/fix-cflags.patch

diff --git a/srcpkgs/libcotp/patches/fix-cflags.patch b/srcpkgs/libcotp/patches/fix-cflags.patch
new file mode 100644
index 000000000000..397b3960e9f4
--- /dev/null
+++ b/srcpkgs/libcotp/patches/fix-cflags.patch
@@ -0,0 +1,14 @@
+Index: libcotp-1.2.2/CMakeLists.txt
+===================================================================
+--- libcotp-1.2.2.orig/CMakeLists.txt
++++ libcotp-1.2.2/CMakeLists.txt
+@@ -25,8 +25,7 @@ set(CMAKE_C_STANDARD 11)
+ set(COTP_HEADERS src/cotp.h)
+ set(SOURCE_FILES src/otp.c)
+ 
+-set(CMAKE_C_FLAGS "-Wall -Wextra -O3 -Wno-format-truncation -fstack-protector-strong -fPIC")
+-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3")
++set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wno-format-truncation -fstack-protector-strong -fPIC")
+ 
+ add_library(cotp SHARED ${SOURCE_FILES})
+ 
diff --git a/srcpkgs/libcotp/template b/srcpkgs/libcotp/template
index 9e147ff7deb6..88337290d1e8 100644
--- a/srcpkgs/libcotp/template
+++ b/srcpkgs/libcotp/template
@@ -11,6 +11,7 @@ license="Apache-2.0"
 homepage="https://github.com/paolostivanin/libcotp"
 distfiles="https://github.com/paolostivanin/libcotp/archive/v${version}.tar.gz"
 checksum=25b45ffa4aece5cc689503ebea7356a2f760c194f0c41805934495d2fe7165b1
+patch_args=-Np1
 
 libcotp-devel_package() {
 	depends="libcotp-${version}_${revision}"

From 85a4ea69993615e634437d889abec12ea94f2646 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: Fri, 26 Mar 2021 21:06:07 +0700
Subject: [PATCH 26/64] loudgain: hardening

---
 srcpkgs/loudgain/patches/fix-cflags.patch | 20 ++++++++++++++++++++
 srcpkgs/loudgain/template                 |  3 ++-
 2 files changed, 22 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/loudgain/patches/fix-cflags.patch

diff --git a/srcpkgs/loudgain/patches/fix-cflags.patch b/srcpkgs/loudgain/patches/fix-cflags.patch
new file mode 100644
index 000000000000..25b2c969bef4
--- /dev/null
+++ b/srcpkgs/loudgain/patches/fix-cflags.patch
@@ -0,0 +1,20 @@
+Index: loudgain-0.6.8/CMakeLists.txt
+===================================================================
+--- loudgain-0.6.8.orig/CMakeLists.txt
++++ loudgain-0.6.8/CMakeLists.txt
+@@ -69,12 +69,12 @@ TARGET_LINK_LIBRARIES(loudgain
+ )
+ 
+ SET_TARGET_PROPERTIES(loudgain PROPERTIES
+-  COMPILE_FLAGS "-Wall -pedantic -g"
++  COMPILE_FLAGS "-Wall -pedantic"
+ )
+ 
+-SET(CMAKE_C_FLAGS "-std=gnu99 -D_GNU_SOURCE")
++SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99 -D_GNU_SOURCE")
+ 
+-SET(CMAKE_CXX_FLAGS "-std=gnu++11 -D_GNU_SOURCE")
++SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11 -D_GNU_SOURCE")
+ 
+ INSTALL(TARGETS loudgain DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
+ 
diff --git a/srcpkgs/loudgain/template b/srcpkgs/loudgain/template
index f29167883439..00b2d20d27d6 100644
--- a/srcpkgs/loudgain/template
+++ b/srcpkgs/loudgain/template
@@ -1,7 +1,7 @@
 # Template file for 'loudgain'
 pkgname=loudgain
 version=0.6.8
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="pkg-config"
 makedepends="libebur128-devel taglib-devel ffmpeg-devel"
@@ -11,6 +11,7 @@ license="BSD-2-Clause"
 homepage="https://github.com/Moonbase59/loudgain"
 distfiles="https://github.com/Moonbase59/loudgain/archive/v${version}.tar.gz"
 checksum=1137c193ad941b366e87c5d84ccc95a7aa8571affc060db0bd1cf72c489aeaee
+patch_args=-Np1
 
 post_install() {
 	vlicense COPYING

From 0836441f60f5121df8ca6de06bd3a3bfb74eaf57 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: Fri, 26 Mar 2021 21:14:31 +0700
Subject: [PATCH 27/64] masterpassword-cli: hardening

---
 srcpkgs/masterpassword-cli/patches/fix-cflags.patch | 13 +++++++++++++
 srcpkgs/masterpassword-cli/template                 |  2 +-
 2 files changed, 14 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/masterpassword-cli/patches/fix-cflags.patch

diff --git a/srcpkgs/masterpassword-cli/patches/fix-cflags.patch b/srcpkgs/masterpassword-cli/patches/fix-cflags.patch
new file mode 100644
index 000000000000..a303f6954544
--- /dev/null
+++ b/srcpkgs/masterpassword-cli/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: platform-independent/cli-c/CMakeLists.txt
+===================================================================
+--- platform-independent/cli-c/CMakeLists.txt.orig
++++ platform-independent/cli-c/CMakeLists.txt
+@@ -15,8 +15,6 @@ option( BUILD_MPW_BENCH         "C CLI M
+ option( BUILD_MPW_TESTS         "C Master Password algorithm test suite (needs: mpw_sodium, mpw_xml)." OFF )
+ 
+ # Default build flags.
+-set( CMAKE_BUILD_TYPE           Release )
+-set( CMAKE_C_FLAGS              "-O3" )
+ 
+ # Version.
+ file( READ                      "VERSION" mpw_version )
diff --git a/srcpkgs/masterpassword-cli/template b/srcpkgs/masterpassword-cli/template
index ee2b8d41ae4b..8536228a602b 100644
--- a/srcpkgs/masterpassword-cli/template
+++ b/srcpkgs/masterpassword-cli/template
@@ -1,7 +1,7 @@
 # Template file for 'masterpassword-cli'
 pkgname=masterpassword-cli
 version=2.6
-revision=5
+revision=6
 wrksrc=MasterPassword-${version}-cli-3
 build_wrksrc=platform-independent/cli-c
 build_style=cmake

From 59c42cc779c47ef2be723922f9d78419d9c3b24c 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: Fri, 26 Mar 2021 21:20:13 +0700
Subject: [PATCH 28/64] msg2: hardening

---
 srcpkgs/msg2/patches/fix-cflags.patch | 13 +++++++++++++
 srcpkgs/msg2/template                 |  2 +-
 2 files changed, 14 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/msg2/patches/fix-cflags.patch

diff --git a/srcpkgs/msg2/patches/fix-cflags.patch b/srcpkgs/msg2/patches/fix-cflags.patch
new file mode 100644
index 000000000000..64404bf44fcb
--- /dev/null
+++ b/srcpkgs/msg2/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -3,7 +3,7 @@ project(msg2)
+ 
+ # Flags
+ set(CMAKE_CXX_STANDARD 17)
+-set(CMAKE_CXX_FLAGS "-Os -pipe -fPIC -fno-plt -fstack-protector-strong -Wall -Wshadow -pedantic -Wno-parentheses -Wfatal-errors")
++set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pipe -fPIC -fno-plt -fstack-protector-strong -Wall -Wshadow -pedantic -Wno-parentheses -Wfatal-errors")
+ 
+ # Add source files
+ add_executable(msg2 main.cpp)
diff --git a/srcpkgs/msg2/template b/srcpkgs/msg2/template
index b4f77400bf22..473b3c4ec4d2 100644
--- a/srcpkgs/msg2/template
+++ b/srcpkgs/msg2/template
@@ -1,7 +1,7 @@
 # Template file for 'msg2'
 pkgname=msg2
 version=1.2.0
-revision=1
+revision=2
 build_style=cmake
 short_desc="Output a blue arrow and a white message on the commandline"
 maintainer="Orphaned <orphan@voidlinux.org>"

From 5d826046170f9e847f3153be26f0ec40c5dd4f86 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: Fri, 26 Mar 2021 21:22:55 +0700
Subject: [PATCH 29/64] ippusbxd: fix cflags -O2 not -o2

---
 srcpkgs/ippusbxd/patches/fix-cflags.patch | 12 ++++++++++++
 srcpkgs/ippusbxd/template                 |  2 +-
 2 files changed, 13 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/ippusbxd/patches/fix-cflags.patch

diff --git a/srcpkgs/ippusbxd/patches/fix-cflags.patch b/srcpkgs/ippusbxd/patches/fix-cflags.patch
new file mode 100644
index 000000000000..5d36903c3ffd
--- /dev/null
+++ b/srcpkgs/ippusbxd/patches/fix-cflags.patch
@@ -0,0 +1,12 @@
+Index: src/CMakeLists.txt
+===================================================================
+--- src/CMakeLists.txt.orig
++++ src/CMakeLists.txt
+@@ -1,6 +1,6 @@
+ cmake_minimum_required(VERSION 2.6)
+ project(ippusbxd)
+-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -o2 -g -std=c99 -Wall -Wextra -pedantic -pedantic-errors")
++set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -Wall -Wextra -pedantic -pedantic-errors")
+ 
+ 
+ # Compiler specific configuration
diff --git a/srcpkgs/ippusbxd/template b/srcpkgs/ippusbxd/template
index ce4ff2ea9125..e81064e8b91d 100644
--- a/srcpkgs/ippusbxd/template
+++ b/srcpkgs/ippusbxd/template
@@ -1,7 +1,7 @@
 # Template file for 'ippusbxd'
 pkgname=ippusbxd
 version=1.34
-revision=1
+revision=2
 build_wrksrc=src
 build_style=cmake
 make_cmd=make

From 4ffde7a20d90de291b5f50301ae97a67eb117133 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: Fri, 26 Mar 2021 21:34:52 +0700
Subject: [PATCH 30/64] tlsh: respect -g

---
 srcpkgs/tlsh/patches/fix-cflags.patch | 13 +++++++++++++
 srcpkgs/tlsh/template                 |  1 +
 2 files changed, 14 insertions(+)
 create mode 100644 srcpkgs/tlsh/patches/fix-cflags.patch

diff --git a/srcpkgs/tlsh/patches/fix-cflags.patch b/srcpkgs/tlsh/patches/fix-cflags.patch
new file mode 100644
index 000000000000..8715563715c7
--- /dev/null
+++ b/srcpkgs/tlsh/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -125,7 +125,7 @@ if (CMAKE_BUILD_TYPE STREQUAL Debug)
+     endif()
+ else(CMAKE_BUILD_TYPE STREQUAL Debug)
+     if(CMAKE_COMPILER_IS_GNUCXX)
+-        set(CMAKE_CXX_FLAGS "-O2 -fvisibility=internal")  ## Remove TlshImpl symbols
++        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=internal")  ## Remove TlshImpl symbols
+     endif()
+     if(MSVC)
+         set(CMAKE_CXX_FLAGS "/O2")        ## Optimize
diff --git a/srcpkgs/tlsh/template b/srcpkgs/tlsh/template
index 1f96834107cc..5df590d857c0 100644
--- a/srcpkgs/tlsh/template
+++ b/srcpkgs/tlsh/template
@@ -2,6 +2,7 @@
 pkgname=tlsh
 version=3.19.1
 revision=1
+revision=2
 build_style=cmake
 hostmakedepends="python3"
 makedepends="python3-devel"

From 25df2e0b64569c288dc218dd16f8b38d01f8855f 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: Fri, 26 Mar 2021 21:59:06 +0700
Subject: [PATCH 31/64] poppler: hardening + respect -g

---
 srcpkgs/poppler/patches/fix-cflags.patch | 21 +++++++++++++++++++++
 srcpkgs/poppler/template                 |  2 +-
 2 files changed, 22 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/poppler/patches/fix-cflags.patch

diff --git a/srcpkgs/poppler/patches/fix-cflags.patch b/srcpkgs/poppler/patches/fix-cflags.patch
new file mode 100644
index 000000000000..9e62b11010ba
--- /dev/null
+++ b/srcpkgs/poppler/patches/fix-cflags.patch
@@ -0,0 +1,21 @@
+Index: cmake/modules/PopplerMacros.cmake
+===================================================================
+--- cmake/modules/PopplerMacros.cmake.orig
++++ cmake/modules/PopplerMacros.cmake
+@@ -123,14 +123,14 @@ if(CMAKE_COMPILER_IS_GNUCXX)
+   set(DEFAULT_COMPILE_WARNINGS_EXTRA "${_warn} ${_warnx}")
+ 
+   set(_save_cxxflags "${CMAKE_CXX_FLAGS}")
+-  set(CMAKE_CXX_FLAGS                "-fno-exceptions -fno-check-new -fno-common -D_DEFAULT_SOURCE")
++  set(CMAKE_CXX_FLAGS                "-fno-exceptions -fno-check-new -fno-common -D_DEFAULT_SOURCE ${_save_cxxflags}")
+   set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g ${_save_cxxflags}")
+   set(CMAKE_CXX_FLAGS_RELEASE        "-O2 -DNDEBUG ${_save_cxxflags}")
+   set(CMAKE_CXX_FLAGS_DEBUG          "-g -O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline ${_save_cxxflags}")
+   set(CMAKE_CXX_FLAGS_DEBUGFULL      "-g3 -fno-inline ${_save_cxxflags}")
+   set(CMAKE_CXX_FLAGS_PROFILE        "-g3 -fno-inline -ftest-coverage -fprofile-arcs ${_save_cxxflags}")
+   set(_save_cflags "${CMAKE_C_FLAGS}")
+-  set(CMAKE_C_FLAGS                  "-std=c99 -D_DEFAULT_SOURCE")
++  set(CMAKE_C_FLAGS                  "-std=c99 -D_DEFAULT_SOURCE ${_save_cflags}")
+   set(CMAKE_C_FLAGS_RELWITHDEBINFO   "-O2 -g ${_save_cflags}")
+   set(CMAKE_C_FLAGS_RELEASE          "-O2 -DNDEBUG ${_save_cflags}")
+   set(CMAKE_C_FLAGS_DEBUG            "-g -O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline ${_save_cflags}")
diff --git a/srcpkgs/poppler/template b/srcpkgs/poppler/template
index ed0db8de7ab6..1aebd7f7e177 100644
--- a/srcpkgs/poppler/template
+++ b/srcpkgs/poppler/template
@@ -4,7 +4,7 @@
 #
 pkgname=poppler
 version=20.09.0
-revision=2
+revision=3
 build_style=cmake
 build_helper="gir"
 configure_args="-DENABLE_UNSTABLE_API_ABI_HEADERS=ON -DENABLE_CPP=ON

From 13aa6260314e5d36e24b8f165b8ab7d96b059e92 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: Fri, 26 Mar 2021 21:59:29 +0700
Subject: [PATCH 32/64] poppler-qt5: hardening + respect -g

---
 srcpkgs/poppler-qt5/patches  | 1 +
 srcpkgs/poppler-qt5/template | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)
 create mode 120000 srcpkgs/poppler-qt5/patches

diff --git a/srcpkgs/poppler-qt5/patches b/srcpkgs/poppler-qt5/patches
new file mode 120000
index 000000000000..636e4ac2cbd9
--- /dev/null
+++ b/srcpkgs/poppler-qt5/patches
@@ -0,0 +1 @@
+../poppler/patches
\ No newline at end of file
diff --git a/srcpkgs/poppler-qt5/template b/srcpkgs/poppler-qt5/template
index 0dc45c05c58b..c2ec35dbbad3 100644
--- a/srcpkgs/poppler-qt5/template
+++ b/srcpkgs/poppler-qt5/template
@@ -5,7 +5,7 @@
 #
 pkgname=poppler-qt5
 version=20.09.0
-revision=1
+revision=2
 wrksrc="poppler-${version}"
 build_style=cmake
 configure_args="-DENABLE_UNSTABLE_API_ABI_HEADERS=ON -DENABLE_GLIB=OFF

From 1b2ebec15915460df43838db546de0479f1bd9d8 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: Sat, 27 Mar 2021 11:17:35 +0700
Subject: [PATCH 33/64] artyfx: remove -O1 -g

---
 srcpkgs/artyfx/patches/fix-avtk-cmake-sse.patch | 4 ++--
 srcpkgs/artyfx/patches/respect-our-cflags.patch | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/artyfx/patches/fix-avtk-cmake-sse.patch b/srcpkgs/artyfx/patches/fix-avtk-cmake-sse.patch
index 1a832155a566..47ef4dd9b84e 100644
--- a/srcpkgs/artyfx/patches/fix-avtk-cmake-sse.patch
+++ b/srcpkgs/artyfx/patches/fix-avtk-cmake-sse.patch
@@ -6,8 +6,8 @@
  
 -SET(CMAKE_C_FLAGS   "-fPIC -msse -msse2 -mfpmath=sse -g") # -fsanitize=address
 -SET(CMAKE_CXX_FLAGS "-fPIC -msse -msse2 -mfpmath=sse -g") # -fsanitize=address
-+SET(CMAKE_C_FLAGS   "${CMAKE_C_FLAGS} -fPIC -g") # -fsanitize=address
-+SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -g") # -fsanitize=address
++SET(CMAKE_C_FLAGS   "${CMAKE_C_FLAGS} -fPIC") # -fsanitize=address
++SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") # -fsanitize=address
 +
 +IF(BUILD_SSE)
 +	SET(CMAKE_C_FLAGS   "${CMAKE_C_FLAGS} -msse -msse2 -mfpmath=sse")
diff --git a/srcpkgs/artyfx/patches/respect-our-cflags.patch b/srcpkgs/artyfx/patches/respect-our-cflags.patch
index ee9155c7729e..7a32fd9df73b 100644
--- a/srcpkgs/artyfx/patches/respect-our-cflags.patch
+++ b/srcpkgs/artyfx/patches/respect-our-cflags.patch
@@ -10,8 +10,8 @@ Index: CMakeLists.txt
 -SET(CMAKE_C_FLAGS "-g -Wall -O1 -Wno-unused-variable")
 -SET(CMAKE_CXX_FLAGS "-g -Wall -O1 -Wno-unused-variable -ftree-vectorize")
 +SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fPIC -shared -L./src/avtk -Wl,--no-undefined")
-+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -Wall -O1 -Wno-unused-variable")
-+SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -Wall -O1 -Wno-unused-variable -ftree-vectorize")
++SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall  -Wno-unused-variable")
++SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall  -Wno-unused-variable -ftree-vectorize")
  
  
  # DSP sources

From cbf5361358a156802f93eb364d23d7556e356b8a 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: Sat, 27 Mar 2021 11:27:28 +0700
Subject: [PATCH 34/64] coin3: build with CMAKE_BUILD_TYPE=None

---
 srcpkgs/coin3/template | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/coin3/template b/srcpkgs/coin3/template
index d5483ee048c3..8f7218c2e8c3 100644
--- a/srcpkgs/coin3/template
+++ b/srcpkgs/coin3/template
@@ -5,7 +5,7 @@ revision=1
 wrksrc="coin-Coin-${version}"
 build_style=cmake
 configure_args="-DCMAKE_INSTALL_INCLUDEDIR=/usr/include/Coin3
- -DCMAKE_BUILD_TYPE=Release -DCOIN_BUILD_TESTS=OFF -DCOIN_BUILD_DOCUMENTATION=ON"
+ -DCOIN_BUILD_TESTS=OFF -DCOIN_BUILD_DOCUMENTATION=ON"
 hostmakedepends="doxygen graphviz"
 makedepends="boost-devel glu-devel"
 short_desc="High-level 3D graphics toolkit"
@@ -15,6 +15,9 @@ homepage="https://coin3d.github.io/"
 distfiles="https://github.com/coin3d/coin/archive/Coin-${version}.tar.gz"
 checksum=b00d2a8e9d962397cf9bf0d9baa81bcecfbd16eef675a98c792f5cf49eb6e805
 
+CFLAGS=-DNDEBUG
+CXXFLAGS=-DNDEBUG
+
 if [ "$CROSS_BUILD" ]; then
 	# bypass runtime test (quote hashing is fine with gcc 9.3)
 	configure_args+=" -DHAVE_HASH_QUOTING_EXITCODE=0"

From 81c18fd6f2505dca599c4266d2dcf132fd31a48d 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: Sat, 27 Mar 2021 11:46:46 +0700
Subject: [PATCH 35/64] conky: don't overwrite CMAKE_BUILD_TYPE

---
 srcpkgs/conky/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/conky/template b/srcpkgs/conky/template
index 8b95a628edfb..f05c7d4a1bf2 100644
--- a/srcpkgs/conky/template
+++ b/srcpkgs/conky/template
@@ -5,7 +5,7 @@ version=1.12.1
 revision=1
 build_style=cmake
 conf_files="/etc/conky/conky.conf /etc/conky/conky_no_x11.conf"
-configure_args="-DCMAKE_BUILD_TYPE=Release -DMAINTAINER_MODE=ON -DRELEASE=ON
+configure_args="-DMAINTAINER_MODE=ON -DRELEASE=ON
  -DDOC_PATH=share/doc/${pkgname} -DBUILD_X11=ON -DBUILD_CURL=ON -DBUILD_XDBE=ON
  -DBUILD_RSS=ON -DBUILD_WEATHER_METAR=ON -DBUILD_IMLIB2=ON -DBUILD_WLAN=ON
  -DBUILD_LUA_CAIRO=ON -DBUILD_LUA_IMLIB2=ON -DBUILD_LUA_RSVG=ON

From e47a21ac36ad274caf03e7a385d544b8b00ba314 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: Sat, 27 Mar 2021 11:46:46 +0700
Subject: [PATCH 36/64] conky-cli: don't overwrite CMAKE_BUILD_TYPE

---
 srcpkgs/conky-cli/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/conky-cli/template b/srcpkgs/conky-cli/template
index b61bdcca0504..7d512b65ab3e 100644
--- a/srcpkgs/conky-cli/template
+++ b/srcpkgs/conky-cli/template
@@ -6,7 +6,7 @@ revision=1
 wrksrc="${pkgname/-cli/}-${version}"
 build_style=cmake
 conf_files="/etc/conky/conky.conf /etc/conky/conky_no_x11.conf"
-configure_args="-DCMAKE_BUILD_TYPE=Release -DMAINTAINER_MODE=ON -DRELEASE=ON
+configure_args="-DMAINTAINER_MODE=ON -DRELEASE=ON
  -DDOC_PATH=share/doc/${pkgname} -DBUILD_X11=OFF -DBUILD_CURL=ON -DBUILD_XDBE=OFF
  -DBUILD_RSS=ON -DBUILD_WEATHER_METAR=OFF -DBUILD_IMLIB2=OFF -DBUILD_WLAN=ON
  -DBUILD_DOCS=ON"

From 31fc360a2269eea64962a66589012b2782b6be6f 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: Sat, 27 Mar 2021 11:48:25 +0700
Subject: [PATCH 37/64] crossguid: don't overwrite -O2

---
 srcpkgs/crossguid/fix-cflags.patch | 12 ++++++++++++
 1 file changed, 12 insertions(+)
 create mode 100644 srcpkgs/crossguid/fix-cflags.patch

diff --git a/srcpkgs/crossguid/fix-cflags.patch b/srcpkgs/crossguid/fix-cflags.patch
new file mode 100644
index 000000000000..983360a07ccf
--- /dev/null
+++ b/srcpkgs/crossguid/fix-cflags.patch
@@ -0,0 +1,12 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -2,7 +2,6 @@ cmake_minimum_required(VERSION 3.5.1)
+ project(CrossGuid)
+ 
+ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake")
+-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3")
+ 
+ option(XG_TESTS "Build test runner" ON)
+ 

From 7937d14bbd8829452dbdd4fbc8d5e90d82413444 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: Sat, 27 Mar 2021 12:19:04 +0700
Subject: [PATCH 38/64] rapidjson: define -DNDEBUG

---
 srcpkgs/rapidjson/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/rapidjson/template b/srcpkgs/rapidjson/template
index 8597f8fb2706..99d92702cc9d 100644
--- a/srcpkgs/rapidjson/template
+++ b/srcpkgs/rapidjson/template
@@ -11,7 +11,7 @@ distfiles="https://github.com/miloyip/${pkgname}/archive/v${version}.tar.gz"
 checksum=bf7ced29704a1e696fbccf2a2b4ea068e7774fa37f6d7dd4039d0787f8bed98e
 
 # class-memaccess is required by https://github.com/Tencent/rapidjson/issues/1700
-CXXFLAGS="-Wno-type-limits -Wno-error=class-memaccess"
+CXXFLAGS="-Wno-type-limits -Wno-error=class-memaccess -DNDEBUG"
 
 post_patch() {
 	# Remove bin/jsonchecker, which is the JSON licensed files

From 1979278a393fbd70b45a08529afe7b0b6d40065f 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: Sat, 27 Mar 2021 12:18:36 +0700
Subject: [PATCH 39/64] cura-engine: ignore -O3

---
 srcpkgs/cura-engine/patches/fix-cflags.patch | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 srcpkgs/cura-engine/patches/fix-cflags.patch

diff --git a/srcpkgs/cura-engine/patches/fix-cflags.patch b/srcpkgs/cura-engine/patches/fix-cflags.patch
new file mode 100644
index 000000000000..e48a665523b8
--- /dev/null
+++ b/srcpkgs/cura-engine/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -42,7 +42,7 @@ endif()
+ if(CMAKE_BUILD_TYPE_UPPER MATCHES "DEBUG")
+     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_DEBUG_INIT}")
+ else()
+-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELEASE_INIT}")
++    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DNDEBUG")
+ endif()
+ 
+ set(CMAKE_CXX_STANDARD 11)

From 76ddbb4f7b707d34ac1ba125930242fbd4fdf96a 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: Sat, 27 Mar 2021 12:22:29 +0700
Subject: [PATCH 40/64] dislocker: remove -O1

---
 srcpkgs/dislocker/patches/fix-cflags.patch | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 srcpkgs/dislocker/patches/fix-cflags.patch

diff --git a/srcpkgs/dislocker/patches/fix-cflags.patch b/srcpkgs/dislocker/patches/fix-cflags.patch
new file mode 100644
index 000000000000..1229efeeaf0c
--- /dev/null
+++ b/srcpkgs/dislocker/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: src/CMakeLists.txt
+===================================================================
+--- src/CMakeLists.txt.orig
++++ src/CMakeLists.txt
+@@ -71,7 +71,7 @@ if(NOT DEFINED WARN_FLAGS)
+ 	set (WARN_FLAGS "-Wall -Wextra" CACHE STRING "" FORCE)
+ endif()
+ if(NOT DEFINED HARDEN_FLAGS)
+-	set (HARDEN_FLAGS "-fstack-protector -fstrict-aliasing -D_FORTIFY_SOURCE=2 -O1" CACHE STRING "" FORCE)
++	set (HARDEN_FLAGS "-fstack-protector -fstrict-aliasing" CACHE STRING "" FORCE)
+ endif()
+ 
+ set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")

From a3ec0b1afff882576fcf1aed58ef420f1bc71aea 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: Sat, 27 Mar 2021 12:29:31 +0700
Subject: [PATCH 41/64] freeorion: remove -O3

---
 srcpkgs/freeorion/patches/fix-cflags.patch | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
 create mode 100644 srcpkgs/freeorion/patches/fix-cflags.patch

diff --git a/srcpkgs/freeorion/patches/fix-cflags.patch b/srcpkgs/freeorion/patches/fix-cflags.patch
new file mode 100644
index 000000000000..c66d54599556
--- /dev/null
+++ b/srcpkgs/freeorion/patches/fix-cflags.patch
@@ -0,0 +1,18 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -432,13 +432,6 @@ if(MSVC)
+     )
+ endif()
+ 
+-target_compile_options(freeorionparseobj
+-    PRIVATE
+-        $<$<CXX_COMPILER_ID:Clang>:-ftemplate-depth=512>
+-        $<$<CXX_COMPILER_ID:AppleClang>:-ftemplate-depth=512>
+-        $<$<AND:$<NOT:$<BOOL:${BUILD_TESTING}>>,$<CXX_COMPILER_ID:GNU>>:-O3>
+-)
+-
+ target_compile_definitions(freeorionparseobj
+     PUBLIC
+         -DBOOST_ALL_DYN_LINK

From 500b2e5c88efc790ca83a9aaa630a7b37dd7f290 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: Fri, 26 Mar 2021 09:01:12 +0700
Subject: [PATCH 42/64] cglm: fix build flags

---
 srcpkgs/cglm/patches/fix-cflags.patch | 13 +++++++++++++
 srcpkgs/cglm/template                 |  1 +
 2 files changed, 14 insertions(+)
 create mode 100644 srcpkgs/cglm/patches/fix-cflags.patch

diff --git a/srcpkgs/cglm/patches/fix-cflags.patch b/srcpkgs/cglm/patches/fix-cflags.patch
new file mode 100644
index 000000000000..c74de6ea62d7
--- /dev/null
+++ b/srcpkgs/cglm/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: cglm-0.7.6/CMakeLists.txt
+===================================================================
+--- cglm-0.7.6.orig/CMakeLists.txt
++++ cglm-0.7.6/CMakeLists.txt
+@@ -25,7 +25,7 @@ if(MSVC)
+ 	add_definitions(-DNDEBUG -D_WINDOWS -D_USRDLL -DCGLM_EXPORTS -DCGLM_DLL)
+ 	add_compile_options(/W3 /Ox /Gy /Oi /TC)
+ else()
+-  add_compile_options(-Wall -Werror -O3)
++  add_compile_options(-Wall)
+ endif()
+ 
+ if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
diff --git a/srcpkgs/cglm/template b/srcpkgs/cglm/template
index f00a093edab9..311b4c79a7d3 100644
--- a/srcpkgs/cglm/template
+++ b/srcpkgs/cglm/template
@@ -9,6 +9,7 @@ license="MIT"
 homepage="https://github.com/recp/cglm"
 distfiles="https://github.com/recp/cglm/archive/v${version}.tar.gz"
 checksum=29ff8af4edc03697e36d3e6f99a80b884a80ee09d46055ce45765e5d6b2456d9
+patch_args=-Np1
 
 post_install() {
 	vlicense LICENSE

From bd8c490b13eec55d777460fac86eefb9a39af47c 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: Sat, 27 Mar 2021 12:36:19 +0700
Subject: [PATCH 43/64] glyr: don't force Release build

---
 srcpkgs/glyr/patches/fix-cflags.patch | 12 ++++++++++++
 1 file changed, 12 insertions(+)
 create mode 100644 srcpkgs/glyr/patches/fix-cflags.patch

diff --git a/srcpkgs/glyr/patches/fix-cflags.patch b/srcpkgs/glyr/patches/fix-cflags.patch
new file mode 100644
index 000000000000..498ffe09a38f
--- /dev/null
+++ b/srcpkgs/glyr/patches/fix-cflags.patch
@@ -0,0 +1,12 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -60,7 +60,6 @@ exec_program(
+ IF(CMAKE_BUILD_TYPE STREQUAL "debug")
+     SET(GLYR_DEBUG TRUE)
+ ELSE()
+-    SET(CMAKE_BUILD_TYPE "release")
+     SET(GLYR_DEBUG FALSE)
+ ENDIF()
+ MESSAGE("-- Building Target: ${CMAKE_BUILD_TYPE}")

From 92c364e7f591ac2c30593562f6b5dc30f23476b9 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: Sat, 27 Mar 2021 12:41:50 +0700
Subject: [PATCH 44/64] hugin: remove -O3

---
 srcpkgs/hugin/patches/fix-cflags.patch | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
 create mode 100644 srcpkgs/hugin/patches/fix-cflags.patch

diff --git a/srcpkgs/hugin/patches/fix-cflags.patch b/srcpkgs/hugin/patches/fix-cflags.patch
new file mode 100644
index 000000000000..02fa56bef0e1
--- /dev/null
+++ b/srcpkgs/hugin/patches/fix-cflags.patch
@@ -0,0 +1,15 @@
+Index: src/celeste/CMakeLists.txt
+===================================================================
+--- src/celeste/CMakeLists.txt.orig
++++ src/celeste/CMakeLists.txt
+@@ -16,10 +16,6 @@
+ #    You should have received a copy of the GNU General Public License
+ #    along with Hugin  If not, see <http://www.gnu.org/licenses/>.
+  
+-IF(NOT WIN32)
+-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3")
+-ENDIF(NOT WIN32)
+-
+ # a list of all files belonging to celeste library
+ 
+ SET(CELESTE_SRC

From a57ba9a07c3eade450916be5f319ede2d7ef4720 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: Sat, 27 Mar 2021 13:05:27 +0700
Subject: [PATCH 45/64] ledger: don't overwrite CMAKE_BUILD_TYPE

---
 srcpkgs/ledger/patches/fix-cflags.patch | 12 ++++++++++++
 1 file changed, 12 insertions(+)
 create mode 100644 srcpkgs/ledger/patches/fix-cflags.patch

diff --git a/srcpkgs/ledger/patches/fix-cflags.patch b/srcpkgs/ledger/patches/fix-cflags.patch
new file mode 100644
index 000000000000..179ab79cd148
--- /dev/null
+++ b/srcpkgs/ledger/patches/fix-cflags.patch
@@ -0,0 +1,12 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -41,7 +41,6 @@ if (BUILD_DEBUG)
+   set(CMAKE_BUILD_TYPE Debug)
+   set(DEBUG_MODE 1)
+ else()
+-  set(CMAKE_BUILD_TYPE Release)
+   set(DEBUG_MODE 0)
+ endif()
+ 

From e28fcdb159b5a51e7b14e5612ab9530dd6459d9d 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: Sat, 27 Mar 2021 13:18:24 +0700
Subject: [PATCH 46/64] libmygpo-qt: remove -ggdb3

---
 srcpkgs/libmygpo-qt/patches/fix-cflags.patch | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 srcpkgs/libmygpo-qt/patches/fix-cflags.patch

diff --git a/srcpkgs/libmygpo-qt/patches/fix-cflags.patch b/srcpkgs/libmygpo-qt/patches/fix-cflags.patch
new file mode 100644
index 000000000000..9940b6fc4323
--- /dev/null
+++ b/srcpkgs/libmygpo-qt/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -69,7 +69,7 @@ if (CMAKE_COMPILER_IS_GNUCXX)
+        -Wwrite-strings -Wpacked -Wformat-security -Wmissing-format-attribute
+        -Wold-style-cast -Woverloaded-virtual -Wnon-virtual-dtor  -Wall -Wextra
+        -Wformat=2 -Wundef -Wstack-protector -Wmissing-include-dirs
+-       -Winit-self -Wunsafe-loop-optimizations  -ggdb3 -fno-inline -DQT_STRICT_ITERATORS )
++       -Winit-self -Wunsafe-loop-optimizations  -fno-inline -DQT_STRICT_ITERATORS )
+     if ( NOT WIN32 )
+         add_definitions( -fvisibility=hidden )
+     endif()

From fbb174c7581f218d622882d1bd5cf00aa7958558 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: Sat, 27 Mar 2021 13:48:38 +0700
Subject: [PATCH 47/64] libogre: don't build vendored libraries

---
 srcpkgs/libogre/template | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/srcpkgs/libogre/template b/srcpkgs/libogre/template
index 784e3a648bac..6dd88ea08c73 100644
--- a/srcpkgs/libogre/template
+++ b/srcpkgs/libogre/template
@@ -3,11 +3,8 @@ pkgname=libogre
 version=1.12.9
 revision=1
 build_style=cmake
-configure_args="-DCMAKE_INSTALL_PREFIX=/usr \
-	-DOGRE_INSTALL_SAMPLES=TRUE \
-	-DOGRE_INSTALL_DOCS=TRUE \
-	-DOGRE_INSTALL_SAMPLES_SOURCE=TRUE \
-	-DCMAKE_BUILD_TYPE=Release"
+configure_args="-DOGRE_INSTALL_SAMPLES=TRUE -DOGRE_INSTALL_DOCS=TRUE
+ -DOGRE_INSTALL_SAMPLES_SOURCE=TRUE -DOGRE_BUILD_DEPENDENCIES=FALSE"
 hostmakedepends="pkg-config graphviz doxygen dejavu-fonts-ttf"
 makedepends="boost-devel freetype-devel libXaw-devel libXrandr-devel
  MesaLib-devel zziplib-devel libcppunit-devel glu-devel libatomic-devel

From 578fb032ce932a1681b6562ca0a3138c2020c16d 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: Sat, 27 Mar 2021 13:52:50 +0700
Subject: [PATCH 48/64] libopenglrecorder: remove -O3

---
 srcpkgs/libopenglrecorder/patches/fix-cflags.patch | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 srcpkgs/libopenglrecorder/patches/fix-cflags.patch

diff --git a/srcpkgs/libopenglrecorder/patches/fix-cflags.patch b/srcpkgs/libopenglrecorder/patches/fix-cflags.patch
new file mode 100644
index 000000000000..7c48a0d2d822
--- /dev/null
+++ b/srcpkgs/libopenglrecorder/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -21,7 +21,7 @@ if (UNIX OR MINGW)
+     if (CMAKE_BUILD_TYPE MATCHES Debug)
+         add_definitions(-std=gnu++0x -O0)
+     else()
+-        add_definitions(-std=gnu++0x -O3)
++        add_definitions(-std=gnu++0x)
+     endif()
+ endif()
+ 

From 1cf34bef261868f706c2f0aaf45636529d9254bc 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: Sat, 27 Mar 2021 13:55:41 +0700
Subject: [PATCH 49/64] libvidstab: remove -O3

---
 srcpkgs/libvidstab/patches/fix-cflags.patch | 39 +++++++++++++++++++++
 1 file changed, 39 insertions(+)
 create mode 100644 srcpkgs/libvidstab/patches/fix-cflags.patch

diff --git a/srcpkgs/libvidstab/patches/fix-cflags.patch b/srcpkgs/libvidstab/patches/fix-cflags.patch
new file mode 100644
index 000000000000..51c357efb101
--- /dev/null
+++ b/srcpkgs/libvidstab/patches/fix-cflags.patch
@@ -0,0 +1,39 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -25,7 +25,7 @@ else()
+     set(LIBSUFFIX "")
+ endif()
+ 
+-add_definitions( -Wall -O3 -g -Wno-pointer-sign -fPIC -std=gnu99)
++add_definitions( -Wall -Wno-pointer-sign -fPIC -std=gnu99)
+ # add_definitions(  -Wall -O0 -g -Wno-pointer-sign )
+ 
+ ### ORC is not used in any active code at the moment  ###
+Index: tests/CMakeLists.txt
+===================================================================
+--- tests/CMakeLists.txt.orig
++++ tests/CMakeLists.txt
+@@ -11,7 +11,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PAT
+ option(USE_OMP "use parallelization use OMP" ON)
+ 
+ #add_definitions( -Wall -O3 -Wno-pointer-sign -DTESTING  -std=gnu99)
+-add_definitions(  -Wall -O0 -g -Wno-pointer-sign -DTESTING -std=gnu99)
++add_definitions(  -Wall -Wno-pointer-sign -DTESTING -std=gnu99)
+ find_package(Orc)
+ if(ORC_FOUND)
+ add_definitions( -DUSE_ORC ${ORC_DEFINITIONS})
+Index: transcode/CMakeLists.txt
+===================================================================
+--- transcode/CMakeLists.txt.orig
++++ transcode/CMakeLists.txt
+@@ -9,7 +9,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PAT
+ set(TRANSCODE_ROOT ../../transcode)
+ 
+ 
+-add_definitions( -Wall -O3 -Wno-pointer-sign -DTRANSCODE -std=gnu99)
++add_definitions( -Wall -Wno-pointer-sign -DTRANSCODE -std=gnu99)
+ #add_definitions(  -Wall -O0 -g -Wno-pointer-sign )
+ # I tried it with 0.4.14
+ #  0.4.10 did not work (not all opcode implemented)

From b2aa692be6670d789c2287c17230bd93cd322cee 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: Sat, 27 Mar 2021 14:18:34 +0700
Subject: [PATCH 50/64] openlierox: don't overwrote CMAKE_BUILD_TYPE

---
 srcpkgs/openlierox/patches/fix-cflags.patch | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
 create mode 100644 srcpkgs/openlierox/patches/fix-cflags.patch

diff --git a/srcpkgs/openlierox/patches/fix-cflags.patch b/srcpkgs/openlierox/patches/fix-cflags.patch
new file mode 100644
index 000000000000..4fe6652fd0a2
--- /dev/null
+++ b/srcpkgs/openlierox/patches/fix-cflags.patch
@@ -0,0 +1,17 @@
+Index: CMakeOlxCommon.cmake
+===================================================================
+--- CMakeOlxCommon.cmake.orig
++++ CMakeOlxCommon.cmake
+@@ -36,12 +36,6 @@ OPTION(BREAKPAD "Google Breakpad support
+ OPTION(DISABLE_JOYSTICK "Disable joystick support" No)
+ OPTION(MINGW_CROSS_COMPILE "Cross-compile Windows .EXE using i686-w64-mingw32-gcc compiler" No)
+ 
+-IF (DEBUG)
+-	SET(CMAKE_BUILD_TYPE Debug)
+-ELSE (DEBUG)
+-	SET(CMAKE_BUILD_TYPE Release)
+-ENDIF (DEBUG)
+-
+ IF (DEDICATED_ONLY)
+ 	SET(X11 No)
+ 	SET(WITH_G15 No)

From 8a8d0be6cf33378d947301da6505b8db995dc9b9 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: Sat, 27 Mar 2021 14:25:12 +0700
Subject: [PATCH 51/64] opensonic: don't overwrite CMAKE_BUILD_TYPE

---
 srcpkgs/opensonic/patches/fix-cflags.patch | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
 create mode 100644 srcpkgs/opensonic/patches/fix-cflags.patch

diff --git a/srcpkgs/opensonic/patches/fix-cflags.patch b/srcpkgs/opensonic/patches/fix-cflags.patch
new file mode 100644
index 000000000000..10d2c7c80e64
--- /dev/null
+++ b/srcpkgs/opensonic/patches/fix-cflags.patch
@@ -0,0 +1,17 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -25,12 +25,10 @@ SET(GAME_NAME "Open Sonic")
+ SET(GAME_VERSION "0.1.4")
+ SET(RTFM "Please read the user manual (readme.html) to get help.")
+ SET(ALLEGRO_RECOMMENDED_VERSION "4.4.1")
+-SET(CMAKE_BUILD_TYPE Release)
+ MESSAGE("${GAME_NAME} version ${GAME_VERSION}")
+ 
+ # configuring...
+ SET(DEFS "")
+-SET(CFLAGS_EXTRA "-g")
+ SET(CFLAGS "${CFLAGS} ${CMAKE_C_FLAGS}")
+ MESSAGE("Using CFLAGS='${CFLAGS}'")
+ 

From 8ce19eed561cd3b98eccfd3811c39c49f2bb10c1 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: Sat, 27 Mar 2021 15:17:28 +0700
Subject: [PATCH 52/64] rocksdb: don't overwrite CMAKE_BUILD_TYPE

---
 srcpkgs/rocksdb/template | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/rocksdb/template b/srcpkgs/rocksdb/template
index e39329e5d6a6..5a6ca434f29b 100644
--- a/srcpkgs/rocksdb/template
+++ b/srcpkgs/rocksdb/template
@@ -3,8 +3,7 @@ pkgname=rocksdb
 version=5.18.3
 revision=2
 build_style=cmake
-configure_args="-DCMAKE_BUILD_TYPE=Release -DPORTABLE=1 -DWITH_TESTS=0
- -DUSE_RTTI=0 -DWITH_LZ4=1"
+configure_args="-DPORTABLE=1 -DWITH_TESTS=0 -DUSE_RTTI=0 -DWITH_LZ4=1"
 makedepends="liblz4-devel"
 short_desc="RocksDB is a embeddable, persistent key-value store for fast storage"
 maintainer="magenbluten <mb0@codemonkey.cc>"
@@ -12,6 +11,8 @@ license="GPL-2.0-or-later, Apache-2.0"
 homepage="https://github.com/facebook/rocksdb"
 distfiles="${homepage}/archive/v${version}.tar.gz"
 checksum=7fb6738263d3f2b360d7468cf2ebe333f3109f3ba1ff80115abd145d75287254
+CFLAGS=-DNDEBUG
+CXXFLAGS=-DNDEBUG
 
 if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
 	makedepends+=" libatomic-devel"

From c0af229536ce2eab9922215768ecc0a4ce136552 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: Sat, 27 Mar 2021 15:19:47 +0700
Subject: [PATCH 53/64] rofs-filtered: hardening

---
 srcpkgs/rofs-filtered/patches/fix-cflags.patch | 13 +++++++++++++
 srcpkgs/rofs-filtered/template                 |  2 +-
 2 files changed, 14 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/rofs-filtered/patches/fix-cflags.patch

diff --git a/srcpkgs/rofs-filtered/patches/fix-cflags.patch b/srcpkgs/rofs-filtered/patches/fix-cflags.patch
new file mode 100644
index 000000000000..f64d3274f091
--- /dev/null
+++ b/srcpkgs/rofs-filtered/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -9,7 +9,7 @@ set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PA
+      "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
+ 
+ add_definitions(-D_GNU_SOURCE)
+-set(CMAKE_C_FLAGS "-Wall -std=c99")
++set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -std=c99")
+ 
+ # find fuse library
+ find_package (FUSE REQUIRED)
diff --git a/srcpkgs/rofs-filtered/template b/srcpkgs/rofs-filtered/template
index 332cd57a9902..e585877eaf59 100644
--- a/srcpkgs/rofs-filtered/template
+++ b/srcpkgs/rofs-filtered/template
@@ -1,7 +1,7 @@
 # Template file for 'rofs-filtered'
 pkgname=rofs-filtered
 version=1.7
-revision=1
+revision=2
 build_style=cmake
 makedepends="fuse-devel"
 short_desc="Filtered read only filesystem for FUSE"

From fd9d1f1ba429d4aa2ef93cf7cf0ffbebee1ff332 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: Sat, 27 Mar 2021 15:40:26 +0700
Subject: [PATCH 54/64] seexpr-krita: don't overwrite CMAKE_BUILD_TYPE

---
 .../patches/cmake-build-type-none.patch       | 32 +++++++++++++++++++
 1 file changed, 32 insertions(+)
 create mode 100644 srcpkgs/seexpr-krita/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/seexpr-krita/patches/cmake-build-type-none.patch b/srcpkgs/seexpr-krita/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..94bb1f37db75
--- /dev/null
+++ b/srcpkgs/seexpr-krita/patches/cmake-build-type-none.patch
@@ -0,0 +1,32 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -42,14 +42,6 @@ endif()
+ 
+ ## Choose build options
+ # Disney specific method of choosing variant
+-if (${FLAVOR} STREQUAL "optimize")
+-    set(CMAKE_BUILD_TYPE "Release" CACHE STRING "type of build" FORCE)
+-endif()
+-
+-if (${FLAVOR} STREQUAL "debug")
+-    set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "type of build" FORCE)
+-endif()
+-
+ if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
+     execute_process(
+         COMMAND sh -c "echo `uname -s`-`uname -r | cut -d- -f1`-`uname -m`"
+@@ -212,12 +204,6 @@ else()
+ endif()
+ 
+ # Set to release if nothing else defined
+-if (NOT CMAKE_BUILD_TYPE)
+-  set(CMAKE_BUILD_TYPE "Release" CACHE STRING
+-      "Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel."
+-      FORCE)
+-endif()
+-
+ if (ENABLE_QT5)
+     find_package(Qt5 5.9.0 COMPONENTS Core Gui Widgets REQUIRED)
+     set_package_properties(Qt5 PROPERTIES

From 0118ec928dc0dd2216f40236e34d09b03d3842fd 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: Sat, 27 Mar 2021 15:50:53 +0700
Subject: [PATCH 55/64] speed-dreams: hardening

---
 srcpkgs/speed-dreams/template | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/speed-dreams/template b/srcpkgs/speed-dreams/template
index 722f0c5ed87a..df7164f9c808 100644
--- a/srcpkgs/speed-dreams/template
+++ b/srcpkgs/speed-dreams/template
@@ -1,13 +1,13 @@
 # Template file for 'speed-dreams'
 pkgname=speed-dreams
 version=2.2.2
-revision=2
+revision=3
 archs="i686* x86_64* ppc64le*"
 _rev=r6553
 create_wrksrc=yes
 build_style=cmake
-configure_args="-DSD_BINDIR=/usr/bin -DSD_DATADIR=/usr/share/speed-dreams-2 -DSD_LIBDIR=/usr/lib/speed-dreams-2
- -DOPTION_OFFICIAL_ONLY=ON -DCMAKE_CXX_FLAGS=-fpermissive -DCMAKE_C_FLAGS=-fpermissive"
+configure_args="-DSD_BINDIR=/usr/bin -DSD_DATADIR=/usr/share/speed-dreams-2
+ -DSD_LIBDIR=/usr/lib/speed-dreams-2 -DOPTION_OFFICIAL_ONLY=ON"
 hostmakedepends="pkg-config"
 makedepends="freealut-devel libenet-devel libfreeglut-devel libjpeg-turbo-devel
  libpng-devel libvorbis-devel libXrandr-devel osg-devel plib-devel SDL2-devel
@@ -26,6 +26,8 @@ checksum="32aa55c17f8dafc1c54fb0d0b7b993d2688d431899cfc5db9eeece148c6887d0
  0b7b417d007ab3b7f0f4dcfdc868aafee1722150b81af519e1cd4c082b408183"
 nocross=yes
 replaces="speed-dreams-data>=0"
+CFLAGS=-fpermissive
+CXXFLAGS=-fpermissive
 
 if [ "$XBPS_TARGET_LIBC" = musl ]; then
 	broken="Segmentation fault"

From a732a518b222ab0ed5b9c47cab51687282e72d04 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: Sat, 27 Mar 2021 19:04:09 +0700
Subject: [PATCH 56/64] traverso: hardening

---
 .../patches/cmake-build-type-none.patch       | 28 +++++++++++++++++++
 srcpkgs/traverso/template                     |  2 +-
 2 files changed, 29 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/traverso/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/traverso/patches/cmake-build-type-none.patch b/srcpkgs/traverso/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..75b3fd941eb8
--- /dev/null
+++ b/srcpkgs/traverso/patches/cmake-build-type-none.patch
@@ -0,0 +1,28 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -65,13 +65,7 @@ SET(TRAVERSO_DEFINES -DSTATIC_BUILD)
+ 
+ #BUILD SETUP
+ #None, Debug, Release, .. or custom ones
+-IF(WANT_DEBUG)
+-  SET(CMAKE_BUILD_TYPE DEBUG)
+-  SET(WANT_TRAVERSO_DEBUG ON)
+-ELSE(WANT_DEBUG)
+-  SET(CMAKE_BUILD_TYPE RELEASE)
+-  LIST(APPEND TRAVERSO_DEFINES -DQT_NO_DEBUG)
+-ENDIF(WANT_DEBUG)
++LIST(APPEND TRAVERSO_DEFINES -DQT_NO_DEBUG)
+ 
+ 
+ IF(WANT_TRAVERSO_DEBUG)
+@@ -326,7 +320,7 @@ ${Qt5Xml_INCLUDE_DIRS}
+ ${Qt5Xml_INCLUDES}
+ )
+ 
+-set(CMAKE_CXX_FLAGS "-fPIC")
++set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
+ 
+ #Set up libraries to link with all found packages
+ LINK_LIBRARIES (
diff --git a/srcpkgs/traverso/template b/srcpkgs/traverso/template
index 105924d4f0c6..4b93460f63d7 100644
--- a/srcpkgs/traverso/template
+++ b/srcpkgs/traverso/template
@@ -1,7 +1,7 @@
 # Template file for 'traverso'
 pkgname=traverso
 version=0.49.6
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DWANT_MP3_ENCODE=ON -DDETECT_HOST_CPU_FEATURES=OFF"
 hostmakedepends="pkg-config qt5-qmake qt5-host-tools"

From 84f673546205e8a24328f49ea854f8d402766453 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: Sat, 27 Mar 2021 19:08:11 +0700
Subject: [PATCH 57/64] xstarter: hardening

---
 .../patches/cmake-build-type-none.patch       | 22 +++++++++++++++++++
 srcpkgs/xstarter/template                     |  2 +-
 2 files changed, 23 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/xstarter/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/xstarter/patches/cmake-build-type-none.patch b/srcpkgs/xstarter/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..4f793e4c473c
--- /dev/null
+++ b/srcpkgs/xstarter/patches/cmake-build-type-none.patch
@@ -0,0 +1,22 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -5,16 +5,8 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
+ 
+ project(xstarter)
+ 
+-if(NOT CMAKE_BUILD_TYPE)
+-  set(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build (Debug or Release)" FORCE)
+-endif()
+-
+ set(PROJECT_VERSION "0.8.0")
+-if (CMAKE_BUILD_TYPE STREQUAL Debug)
+-  set(CMAKE_C_FLAGS "-g -Wall -pedantic")
+-else()
+-  set(CMAKE_C_FLAGS "-Wall -pedantic -O3")
+-endif()
++set(CMAKE_C_FLAGS "-Wall -pedantic ${CMAKE_C_FLAGS}")
+ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/bin")
+ 
+ set (CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
diff --git a/srcpkgs/xstarter/template b/srcpkgs/xstarter/template
index aa9a47e45e5c..4363d36e3c39 100644
--- a/srcpkgs/xstarter/template
+++ b/srcpkgs/xstarter/template
@@ -1,7 +1,7 @@
 # Template file for 'xstarter'
 pkgname=xstarter
 version=0.8.0
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="pkg-config"
 makedepends="glib-devel ncurses-devel"

From 8c2b0b3543230066165264e79bcfa4c6d26d3d9f 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: Sat, 27 Mar 2021 19:15:48 +0700
Subject: [PATCH 58/64] yabause-gtk: ignore -O3

---
 srcpkgs/yabause-gtk/patches/fix-cflags.patch | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 srcpkgs/yabause-gtk/patches/fix-cflags.patch

diff --git a/srcpkgs/yabause-gtk/patches/fix-cflags.patch b/srcpkgs/yabause-gtk/patches/fix-cflags.patch
new file mode 100644
index 000000000000..52c1cae61799
--- /dev/null
+++ b/srcpkgs/yabause-gtk/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: src/CMakeLists.txt
+===================================================================
+--- src/CMakeLists.txt.orig
++++ src/CMakeLists.txt
+@@ -659,7 +659,7 @@ else ()
+ 	set(yabause_SOURCES ${yabause_SOURCES} sock-dummy.c thr-dummy.c)
+ endif ()
+ 
+-set(YAB_OPTIMIZATION "-O3" CACHE STRING "Override optimization level")
++set(YAB_OPTIMIZATION "" CACHE STRING "Override optimization level")
+ 
+ if("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "i686")
+ 	set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${YAB_OPTIMIZATION} -march=i686 -msse")

From 505194ce2af0779c98fab5d9532c4046a03a505d 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: Sat, 27 Mar 2021 19:26:47 +0700
Subject: [PATCH 59/64] ympd: hardening

---
 srcpkgs/ympd/patches/fix-cflags.patch | 13 +++++++++++++
 srcpkgs/ympd/template                 |  2 +-
 2 files changed, 14 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/ympd/patches/fix-cflags.patch

diff --git a/srcpkgs/ympd/patches/fix-cflags.patch b/srcpkgs/ympd/patches/fix-cflags.patch
new file mode 100644
index 000000000000..4720dd39e748
--- /dev/null
+++ b/srcpkgs/ympd/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -24,7 +24,7 @@ include_directories(${PROJECT_BINARY_DIR
+ 
+ include(CheckCSourceCompiles)
+ 
+-set(CMAKE_C_FLAGS "-std=gnu99 -Wall")
++set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99 -Wall")
+ set(CMAKE_C_FLAGS_DEBUG "-ggdb -pedantic")
+ if(WITH_IPV6)
+     set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS NS_ENABLE_IPV6)
diff --git a/srcpkgs/ympd/template b/srcpkgs/ympd/template
index 14437beb5384..450c079b2ca3 100644
--- a/srcpkgs/ympd/template
+++ b/srcpkgs/ympd/template
@@ -1,7 +1,7 @@
 # Template file for 'ympd'
 pkgname=ympd
 version=1.3.0
-revision=7
+revision=8
 build_style=cmake
 hostmakedepends="perl pkg-config"
 makedepends="libmpdclient-devel openssl-devel"

From 7ac2db38ca43d02a1ec87a45f7cc0f5f800793a7 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: Sat, 27 Mar 2021 19:29:31 +0700
Subject: [PATCH 60/64] z80ex: hardening

---
 srcpkgs/z80ex/patches/fix-cflags.patch | 13 +++++++++++++
 srcpkgs/z80ex/template                 |  2 +-
 2 files changed, 14 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/z80ex/patches/fix-cflags.patch

diff --git a/srcpkgs/z80ex/patches/fix-cflags.patch b/srcpkgs/z80ex/patches/fix-cflags.patch
new file mode 100644
index 000000000000..6743da255e5c
--- /dev/null
+++ b/srcpkgs/z80ex/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -11,7 +11,7 @@ option (OPSTEP_FAST_AND_ROUGH "Fast and
+ 
+ #ALL_CFLAGS := -fPIC -fno-common -ansi -pedantic -Wall -pipe -O2 -I. -I./include
+ if (CMAKE_COMPILER_IS_GNUCC)
+-    set (CMAKE_C_FLAGS "-fPIC -fno-common -ansi -pedantic -Wall -pipe -O2")
++    set (CMAKE_C_FLAGS "-fPIC -fno-common -ansi -pedantic -Wall -pipe ${CMAKE_C_FLAGS}")
+ endif ()
+ 
+ include_directories(BEFORE . include)
diff --git a/srcpkgs/z80ex/template b/srcpkgs/z80ex/template
index 00a24a6fb902..ae04241dcb5a 100644
--- a/srcpkgs/z80ex/template
+++ b/srcpkgs/z80ex/template
@@ -1,7 +1,7 @@
 # Template file for 'z80ex'
 pkgname=z80ex
 version=1.1.21
-revision=1
+revision=2
 build_style=cmake
 short_desc="ZiLOG Z80 CPU emulation library"
 maintainer="Diogo Leal <diogo@diogoleal.com>"

From ea5b600b95edf980221014a22f17619031738448 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: Sat, 27 Mar 2021 19:17:13 +0700
Subject: [PATCH 61/64] scribus: don't overwrite cmake-build-type

---
 .../patches/cmake-build-type-none.patch       | 33 +++++++++++++++++++
 1 file changed, 33 insertions(+)
 create mode 100644 srcpkgs/scribus/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/scribus/patches/cmake-build-type-none.patch b/srcpkgs/scribus/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..670c83cc48f5
--- /dev/null
+++ b/srcpkgs/scribus/patches/cmake-build-type-none.patch
@@ -0,0 +1,33 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -35,11 +35,6 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON)
+ 
+ 
+ #RPATH setup - more below too
+-if (WANT_NORPATH OR WANT_DISTROBUILD)
+-	set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
+-else()
+-	set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
+-endif()
+ set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
+ set(CMAKE_SKIP_RULE_DEPENDENCY TRUE)
+ set(CMAKE_SKIP_BUILD_RPATH TRUE)
+@@ -309,16 +304,6 @@ include (CMakeLists_Directories.cmake)
+ #Convert our simpler command line option to the CMake style
+ #None, Debug, Release, .. or custom ones
+ # set(WANT_DEBUG ON)
+-if(WANT_DEBUG)
+-	set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Set Debug Build Type" FORCE)
+-endif()
+-if (WANT_RELEASEWITHDEBUG)
+-	set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING "Set Release with Debug Info Build Type" FORCE)
+-endif()
+-if(NOT WANT_DEBUG AND NOT WANT_RELEASEWITHDEBUG)
+-	set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Set Release Build Type" FORCE)
+-endif()
+-
+ 
+ 
+ #Based on our build type, setup our build options

From af414263676701ad8b49b4cdccf07f4f07ae3cc7 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, 28 Mar 2021 10:39:04 +0700
Subject: [PATCH 62/64] yoshimi: cleanup, don't overwrite CMAKE_BUILD_TYPE

---
 srcpkgs/yoshimi/patches/fix-cflags.patch | 12 ++++++++++++
 srcpkgs/yoshimi/template                 | 13 +------------
 2 files changed, 13 insertions(+), 12 deletions(-)
 create mode 100644 srcpkgs/yoshimi/patches/fix-cflags.patch

diff --git a/srcpkgs/yoshimi/patches/fix-cflags.patch b/srcpkgs/yoshimi/patches/fix-cflags.patch
new file mode 100644
index 000000000000..4baeb82ef4e3
--- /dev/null
+++ b/srcpkgs/yoshimi/patches/fix-cflags.patch
@@ -0,0 +1,12 @@
+Index: src/CMakeLists.txt
+===================================================================
+--- src/CMakeLists.txt.orig
++++ src/CMakeLists.txt
+@@ -262,7 +262,6 @@ if (BuildForDebug)
+     set (CMAKE_CXX_FLAGS_DEBUG ${BuildOptionsDebug})
+     message (STATUS "DEBUG Build, flags: ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_DEBUG}")
+ else()
+-    set (CMAKE_BUILD_TYPE "Release")
+     set (CMAKE_CXX_FLAGS_RELEASE ${BuildOptionsRelease})
+     message (STATUS "RELEASE Build, flags: ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELEASE}")
+ endif ()
diff --git a/srcpkgs/yoshimi/template b/srcpkgs/yoshimi/template
index 0096f7f05710..64a6c9ad433f 100644
--- a/srcpkgs/yoshimi/template
+++ b/srcpkgs/yoshimi/template
@@ -4,6 +4,7 @@ version=1.7.4
 revision=2
 build_wrksrc=src
 build_style=cmake
+configure_args="-DCMAKE_INSTALL_DATAROOTDIR=/usr/share"
 hostmakedepends="pkg-config fltk"
 makedepends="boost-devel jack-devel fltk-devel fftw-devel mxml-devel cairo-devel
  lv2 readline-devel ncurses-devel"
@@ -17,15 +18,3 @@ checksum=27a8e33bda72aafae604e14841bed6373fc9e00ff70c98f1e13215d6a8808318
 case "$XBPS_TARGET_MACHINE" in
 	*-musl) makedepends+=" argp-standalone";;
 esac
-
-configure_args="-DCMAKE_INSTALL_DATAROOTDIR=/usr/share"
-
-pre_configure() {
-	sed -i 's|ncurses|ncursesw|g' CMakeLists.txt
-
-	case "$XBPS_TARGET_MACHINE" in
-		i686*) ;;
-		x86_64*) ;;
-		*) sed -i -e "s|-msse -msse2 -mfpmath=sse||g" CMakeLists.txt;;
-	esac
-}

From fedcdb07d83ba692ba414c7d4b8627d14948010e 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, 28 Mar 2021 10:49:25 +0700
Subject: [PATCH 63/64] zulucrypt: remove -O3

---
 srcpkgs/zulucrypt/patches/fix-cflags.patch | 26 ++++++++++++++++++++++
 1 file changed, 26 insertions(+)
 create mode 100644 srcpkgs/zulucrypt/patches/fix-cflags.patch

diff --git a/srcpkgs/zulucrypt/patches/fix-cflags.patch b/srcpkgs/zulucrypt/patches/fix-cflags.patch
new file mode 100644
index 000000000000..d77c539c6c13
--- /dev/null
+++ b/srcpkgs/zulucrypt/patches/fix-cflags.patch
@@ -0,0 +1,26 @@
+Index: external_libraries/tcplay/CMakeLists.txt
+===================================================================
+--- external_libraries/tcplay/CMakeLists.txt.orig
++++ external_libraries/tcplay/CMakeLists.txt
+@@ -13,7 +13,7 @@ set (SRCS_LINUX  crypto-gcrypt.c)
+ set (CFLAGS_LINUX  "-D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE")
+ set (CFLAGS_WARN "-w")
+ set (CFLAGS_DEBUG  "-O0 -g3 -DDEBUG")
+-set (CFLAGS_OPT    "-O3")
++set (CFLAGS_OPT    "")
+ set (CFLAGS_VER    "-DMAJ_VER=${VERSION_MAJOR} -DMIN_VER=${VERSION_MINOR}")
+ set (CFLAGS_COMMON "-std=c99 -fPIC  ${CFLAGS_LINUX} ${CFLAGS_WARN} ${CFLAGS_VER}")
+ if ($ENV{DEBUG})
+Index: external_libraries/tcplay/Makefile.classic
+===================================================================
+--- external_libraries/tcplay/Makefile.classic.orig
++++ external_libraries/tcplay/Makefile.classic
+@@ -47,8 +47,6 @@ COMMON_CFLAGS= $(WARNFLAGS) -fPIC $(VER_
+ 
+ ifeq ($(DEBUG), yes)
+   COMMON_CFLAGS+= -O0 -g -DDEBUG
+-else
+-  COMMON_CFLAGS+= -O3
+ endif
+ 
+ ifeq (${SYSTEM}, linux)

From 08e63d5eab2507d5b0dff774fd5aef0247f806d7 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, 28 Mar 2021 10:43:24 +0700
Subject: [PATCH 64/64] zbackup: don't overwrite CMAKE_BUILD_TYPE

---
 .../patches/cmake-build-type-none.patch       | 26 +++++++++++++++++++
 1 file changed, 26 insertions(+)
 create mode 100644 srcpkgs/zbackup/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/zbackup/patches/cmake-build-type-none.patch b/srcpkgs/zbackup/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..6d6ebc8e124d
--- /dev/null
+++ b/srcpkgs/zbackup/patches/cmake-build-type-none.patch
@@ -0,0 +1,26 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -6,8 +6,6 @@ project( zbackup )
+ 
+ set( CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" )
+ 
+-set( CMAKE_BUILD_TYPE Release )
+-
+ find_package( ZLIB REQUIRED )
+ include_directories( ${ZLIB_INCLUDE_DIRS} )
+ 
+Index: tartool/CMakeLists.txt
+===================================================================
+--- tartool/CMakeLists.txt.orig
++++ tartool/CMakeLists.txt
+@@ -4,8 +4,6 @@
+ cmake_minimum_required( VERSION 2.6.0 )
+ project( tartool )
+ 
+-set( CMAKE_BUILD_TYPE Release )
+-
+ add_executable( tartool tartool.cc ../file.cc ../dir.cc )
+ 
+ install( TARGETS tartool DESTINATION bin )

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PR PATCH] [Updated] build-style/cmake: set CMAKE_BUILD_TYPE to None
  2021-03-14 13:19 [PR PATCH] [WIP] build-style/cmake: set CMAKE_BUILD_TYPE to None sgn
                   ` (28 preceding siblings ...)
  2021-03-29  0:48 ` [PR PATCH] [Updated] " sgn
@ 2021-03-29 15:30 ` sgn
  2021-04-03  3:00 ` sgn
                   ` (2 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: sgn @ 2021-03-29 15:30 UTC (permalink / raw)
  To: ml

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

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

https://github.com/sgn/void-packages cmake-build-type-to-None
https://github.com/void-linux/void-packages/pull/29459

build-style/cmake: set CMAKE_BUILD_TYPE to None
- I'm going to build all packages with `build_style=cmake` and fix them one by one before merging this in.

[ci skip]

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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-cmake-build-type-to-None-29459.patch --]
[-- Type: text/x-diff, Size: 119661 bytes --]

From ff649d7663d7dfd8da37a81fdbd8b0d5781752d8 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, 14 Mar 2021 20:18:03 +0700
Subject: [PATCH 01/63] build-style/cmake: set CMAKE_BUILD_TYPE to None

- CMAKE_BUILD_TYPE=Release will force -O3 instead of respecting our
  CFLAGS and CXXFLAGS
- Theoretically, we could patch cmake to always use -O2 instead,
  however, patching will break users' expectation when compiling their
  our code.
- RelWithDebInfo could be another option if it's acceptable to always
  have debug symbol available.
- However, some projects ignore all CFLAGS and CXXFLAGS;
- Some other projects relies on CMAKE_BUILD_TYPE=Release to install to
  correct location and/or disable coverage.
- To get away with -O3, we need patching either ways, let's go with
  CMAKE_BUILD_TYPE=None, and patch all problematic softwares.
---
 common/build-style/cmake.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/build-style/cmake.sh b/common/build-style/cmake.sh
index 5100a96dfd7b..9d1a1a7a1941 100644
--- a/common/build-style/cmake.sh
+++ b/common/build-style/cmake.sh
@@ -52,7 +52,7 @@ _EOF
 		cmake_args+=" -DCMAKE_TOOLCHAIN_FILE=cross_${XBPS_CROSS_TRIPLET}.cmake"
 	fi
 	cmake_args+=" -DCMAKE_INSTALL_PREFIX=/usr"
-	cmake_args+=" -DCMAKE_BUILD_TYPE=Release"
+	cmake_args+=" -DCMAKE_BUILD_TYPE=None"
 	cmake_args+=" -DCMAKE_INSTALL_LIBDIR=lib${XBPS_TARGET_WORDSIZE}"
 
 	if [[ $build_helper = *"qemu"* ]]; then

From 9483af4ad12087ba0ea0da67a31d47f8934b3e24 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: Mon, 15 Mar 2021 08:07:16 +0700
Subject: [PATCH 02/63] amdvlk: allow CMAKE_BUILD_TYPE=None

---
 .../patches/cmake-build-type-none.patch       | 60 +++++++++++++++++++
 1 file changed, 60 insertions(+)
 create mode 100644 srcpkgs/amdvlk/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/amdvlk/patches/cmake-build-type-none.patch b/srcpkgs/amdvlk/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..7a629e58548e
--- /dev/null
+++ b/srcpkgs/amdvlk/patches/cmake-build-type-none.patch
@@ -0,0 +1,60 @@
+Index: llvm-project/llvm/CMakeLists.txt
+===================================================================
+--- llvm-project/llvm/CMakeLists.txt.orig
++++ llvm-project/llvm/CMakeLists.txt
+@@ -251,11 +251,6 @@ endif()
+ 
+ string(TOUPPER "${CMAKE_BUILD_TYPE}" uppercase_CMAKE_BUILD_TYPE)
+ 
+-if (CMAKE_BUILD_TYPE AND
+-    NOT uppercase_CMAKE_BUILD_TYPE MATCHES "^(DEBUG|RELEASE|RELWITHDEBINFO|MINSIZEREL)$")
+-  message(FATAL_ERROR "Invalid value for CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
+-endif()
+-
+ set(LLVM_LIBDIR_SUFFIX "" CACHE STRING "Define suffix of library directory name (32/64)" )
+ 
+ set(LLVM_TOOLS_INSTALL_DIR "bin" CACHE STRING "Path for binary subdirectory (defaults to 'bin')")
+Index: pal/cmake/Modules/AmdCmakeHelper.cmake
+===================================================================
+--- pal/cmake/Modules/AmdCmakeHelper.cmake.orig
++++ pal/cmake/Modules/AmdCmakeHelper.cmake
+@@ -37,11 +37,6 @@ if (CMAKE_CONFIGURATION_TYPES)
+ else()
+     string(TOUPPER "${CMAKE_BUILD_TYPE}" capital_CMAKE_BUILD_TYPE)
+ 
+-    if (CMAKE_BUILD_TYPE AND
+-        NOT capital_CMAKE_BUILD_TYPE MATCHES "^(DEBUG|RELEASE|RELWITHDEBINFO|MINSIZEREL)$")
+-        message(FATAL_ERROR "Invalid value for CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
+-    endif()
+-
+     if(capital_CMAKE_BUILD_TYPE STREQUAL "DEBUG")
+         set(CMAKE_BUILD_TYPE_DEBUG ON)
+         set(CMAKE_BUILD_TYPE_RELEASE OFF)
+Index: xgl/CMakeLists.txt
+===================================================================
+--- xgl/CMakeLists.txt.orig
++++ xgl/CMakeLists.txt
+@@ -181,11 +181,6 @@ if (CMAKE_CONFIGURATION_TYPES)
+ else()
+     string(TOUPPER "${CMAKE_BUILD_TYPE}" capital_CMAKE_BUILD_TYPE)
+ 
+-    if (CMAKE_BUILD_TYPE AND
+-        NOT capital_CMAKE_BUILD_TYPE MATCHES "^(DEBUG|RELEASE|RELWITHDEBINFO|MINSIZEREL)$")
+-        message(FATAL_ERROR "Invalid value for CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
+-    endif()
+-
+     if(capital_CMAKE_BUILD_TYPE STREQUAL "DEBUG")
+         set(CMAKE_BUILD_TYPE_DEBUG ON)
+         set(CMAKE_BUILD_TYPE_RELEASE OFF)
+Index: xgl/icd/CMakeLists.txt
+===================================================================
+--- xgl/icd/CMakeLists.txt.orig
++++ xgl/icd/CMakeLists.txt
+@@ -84,7 +84,6 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Cl
+     endif()
+ 
+     if(CMAKE_BUILD_TYPE_RELEASE)
+-        target_compile_options(xgl PRIVATE -O3)
+         if(XGL_ENABLE_LTO)
+             if(${CMAKE_CXX_COMPILER_ID} MATCHES "GNU")
+                 execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION)

From 2fb2a1904aba9bec7ef268d86e55aff96bedd81b 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: Wed, 17 Mar 2021 06:24:04 +0700
Subject: [PATCH 03/63] eigen*: set CMAKE_BUILD_TYPE to Release

We're going to set default CMAKE_BUILD_TYPE to None soon. Those packages
are header only libraries, no need to waste time on patching.
---
 srcpkgs/eigen/template    | 1 +
 srcpkgs/eigen3.2/template | 1 +
 2 files changed, 2 insertions(+)

diff --git a/srcpkgs/eigen/template b/srcpkgs/eigen/template
index ee825e95f273..072228c16915 100644
--- a/srcpkgs/eigen/template
+++ b/srcpkgs/eigen/template
@@ -3,6 +3,7 @@ pkgname=eigen
 version=3.3.9
 revision=1
 build_style=cmake
+configure_args="-DCMAKE_BUILD_TYPE=Release"
 short_desc="C++ template library for linear algebra (version 3.x)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MPL-2.0, GPL-3.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
diff --git a/srcpkgs/eigen3.2/template b/srcpkgs/eigen3.2/template
index 5715fc1b3a19..7b710534b5e5 100644
--- a/srcpkgs/eigen3.2/template
+++ b/srcpkgs/eigen3.2/template
@@ -4,6 +4,7 @@ version=3.2.10
 revision=3
 wrksrc="eigen-${version}"
 build_style=cmake
+configure_args="-DCMAKE_BUILD_TYPE=Release"
 short_desc="C++ template library for linear algebra (version 3.x)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MPL-2.0, GPL-3.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"

From 850846ce2cd0d3bcb09a6278de224831921bd3ef 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: Wed, 17 Mar 2021 07:04:48 +0700
Subject: [PATCH 04/63] embree: don't ignore CXXFLAGS, fix build with ispc
 1.13+

---
 .../embree/patches/uintNN-is-part-of-ispc-1.13.patch | 12 ++++++++++++
 srcpkgs/embree/template                              |  6 ++----
 2 files changed, 14 insertions(+), 4 deletions(-)
 create mode 100644 srcpkgs/embree/patches/uintNN-is-part-of-ispc-1.13.patch

diff --git a/srcpkgs/embree/patches/uintNN-is-part-of-ispc-1.13.patch b/srcpkgs/embree/patches/uintNN-is-part-of-ispc-1.13.patch
new file mode 100644
index 000000000000..5d0b02f3b2e5
--- /dev/null
+++ b/srcpkgs/embree/patches/uintNN-is-part-of-ispc-1.13.patch
@@ -0,0 +1,12 @@
+Index: embree-2.17.7/tutorials/common/common.isph
+===================================================================
+--- embree-2.17.7.orig/tutorials/common/common.isph
++++ embree-2.17.7/tutorials/common/common.isph
+@@ -16,7 +16,3 @@
+ 
+ #pragma once
+ 
+-typedef unsigned int64 uint64;
+-typedef unsigned int32 uint32;
+-typedef unsigned int16 uint16;
+-typedef unsigned int8  uint8;
diff --git a/srcpkgs/embree/template b/srcpkgs/embree/template
index 0bc72f46b6d8..849ec3c26c1d 100644
--- a/srcpkgs/embree/template
+++ b/srcpkgs/embree/template
@@ -4,6 +4,7 @@ version=2.17.7
 revision=2
 archs="x86_64"
 build_style=cmake
+configure_args="-DTBB_ROOT=/usr -DEMBREE_IGNORE_CMAKE_CXX_FLAGS=OFF"
 hostmakedepends="ispc"
 makedepends="libfreeglut-devel libXmu-devel tbb-devel MesaLib-devel libpng-devel
  libopenexr-devel libjpeg-turbo-devel libmagick-devel"
@@ -13,10 +14,7 @@ license="Apache-2.0"
 homepage="https://embree.github.io/"
 distfiles="https://github.com/$pkgname/$pkgname/archive/v$version.tar.gz"
 checksum=c0694f287fa1fbb382aba3a895702e248d92f7e89c0e5f64aefee965482ec04c
-
-nopie=y
-
-configure_args="-DTBB_ROOT=/usr -DENABLE_TUTORIALS=OFF"
+patch_args=-Np1
 
 embree-devel_package() {
 	depends="${sourcepkg}>=${version}_${revision}"

From ce041ae786a5c5fb0cd7695dea7ecb428fd6495f 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: Wed, 17 Mar 2021 07:35:19 +0700
Subject: [PATCH 05/63] ettercap: remove libressl patch, CMAKE_BUILD_TYPE=None

---
 .../patches/allow-build-type-none.patch       | 24 ++++++++++++++
 srcpkgs/ettercap/patches/libressl.patch       | 31 -------------------
 srcpkgs/ettercap/template                     |  9 ++++--
 3 files changed, 31 insertions(+), 33 deletions(-)
 create mode 100644 srcpkgs/ettercap/patches/allow-build-type-none.patch
 delete mode 100644 srcpkgs/ettercap/patches/libressl.patch

diff --git a/srcpkgs/ettercap/patches/allow-build-type-none.patch b/srcpkgs/ettercap/patches/allow-build-type-none.patch
new file mode 100644
index 000000000000..324d75086b05
--- /dev/null
+++ b/srcpkgs/ettercap/patches/allow-build-type-none.patch
@@ -0,0 +1,24 @@
+Index: ettercap-0.8.3.1/CMakeLists.txt
+===================================================================
+--- ettercap-0.8.3.1.orig/CMakeLists.txt
++++ ettercap-0.8.3.1/CMakeLists.txt
+@@ -22,19 +22,6 @@ option(LIBRARY_BUILD "Build for libetter
+ option(INSTALL_DESKTOP "Install ettercap desktop files" ON)
+ 
+ 
+-set(VALID_BUILD_TYPES Debug Release RelWithDebInfo)
+-
+-if(NOT CMAKE_BUILD_TYPE)
+-  # Default to using "Release" as our build type.
+-  set(CMAKE_BUILD_TYPE "Release" CACHE STRING
+-    "Choose the type of build, options are: ${VALID_BUILD_TYPES}." FORCE)
+-endif()
+-list(FIND VALID_BUILD_TYPES ${CMAKE_BUILD_TYPE} contains_valid)
+-if(contains_valid EQUAL -1)
+-  message(FATAL_ERROR "Unknown CMAKE_BUILD_TYPE: '${CMAKE_BUILD_TYPE}'. Valid options are: ${VALID_BUILD_TYPES}")
+-endif()
+-unset(contains_valid)
+-
+ include(CMakeDependentOption)
+ 
+ # If SYSTEM_LIBS is set to off, then all SYSTEM_* options will be
diff --git a/srcpkgs/ettercap/patches/libressl.patch b/srcpkgs/ettercap/patches/libressl.patch
deleted file mode 100644
index 15e0d3c1c9e7..000000000000
--- a/srcpkgs/ettercap/patches/libressl.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From b2f7634c9dbc0ef68640f0571787d92300e9f9f9 Mon Sep 17 00:00:00 2001
-From: Stefan Strogin <stefan@steils.org>
-Date: Sat, 15 Aug 2020 07:18:31 +0300
-Subject: [PATCH] ec_sslwrap: fix compilation with LibreSSL
-
-Disable taking over SNI extension from ClientHello and SSL configuration
-operations until LibreSSL supports the required API.
-
-Fixes: https://github.com/Ettercap/ettercap/issues/1068
----
- src/ec_sslwrap.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git src/ec_sslwrap.c src/ec_sslwrap.c
-index b9f26a142..1e4c24fc1 100644
---- src/ec_sslwrap.c
-+++ src/ec_sslwrap.c
-@@ -71,11 +71,11 @@
- #define TLS_server_method SSLv23_server_method
- #endif
- 
--#if (OPENSSL_VERSION_NUMBER >= 0x10100000L)
-+#if (OPENSSL_VERSION_NUMBER >= 0x10100000L) && !defined(LIBRESSL_VERSION_NUMBER)
- #define HAVE_OPENSSL_1_1_0
- #endif
- 
--#if (OPENSSL_VERSION_NUMBER >= 0x10101000L)
-+#if (OPENSSL_VERSION_NUMBER >= 0x10101000L) && !defined(LIBRESSL_VERSION_NUMBER)
- #define HAVE_OPENSSL_1_1_1
- #endif
- 
diff --git a/srcpkgs/ettercap/template b/srcpkgs/ettercap/template
index 7fe4c340a079..611b4e9aded7 100644
--- a/srcpkgs/ettercap/template
+++ b/srcpkgs/ettercap/template
@@ -3,8 +3,8 @@ pkgname=ettercap
 version=0.8.3.1
 revision=2
 build_style=cmake
-configure_args="-DENABLE_GTK=OFF"
-hostmakedepends="flex"
+configure_args="-DENABLE_GTK=OFF -DBUNDLED_LIBS=OFF"
+hostmakedepends="flex pkg-config"
 makedepends="geoip-devel ncurses-devel openssl-devel libcurl-devel
  libltdl-devel libnet-devel libpcap-devel pcre-devel"
 conf_files="/etc/${pkgname}/etter.conf"
@@ -15,5 +15,10 @@ homepage="http://ettercap.github.com/ettercap/"
 distfiles="https://github.com/Ettercap/ettercap/archive/v${version}.tar.gz"
 checksum=d0c3ef88dfc284b61d3d5b64d946c1160fd04276b448519c1ae4438a9cdffaf3
 lib32disabled=yes
+patch_args=-Np1
 
 CFLAGS="-fcommon"
+
+post_extract() {
+	rm -rf bundled_deps
+}

From a5054545b831202ab003632b20a2fe281baecc01 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: Wed, 17 Mar 2021 08:27:10 +0700
Subject: [PATCH 06/63] injeqt: disable coverage

---
 srcpkgs/injeqt/template | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/injeqt/template b/srcpkgs/injeqt/template
index 1e5777fc0f18..78eba09a0249 100644
--- a/srcpkgs/injeqt/template
+++ b/srcpkgs/injeqt/template
@@ -3,7 +3,8 @@ pkgname=injeqt
 version=1.2.0
 revision=2
 build_style=cmake
-hostmakedepends="pkg-config"
+configure_args="-DDISABLE_COVERAGE=ON"
+hostmakedepends="pkg-config qt5-qmake qt5-host-tools"
 makedepends="qt5-devel"
 short_desc="Dependency injection framework for Qt"
 maintainer="Jürgen Buchmüller <pullmoll@t-online.de>"
@@ -12,9 +13,6 @@ homepage="https://github.com/vogel/injeqt/"
 distfiles="https://github.com/vogel/${pkgname}/archive/${version}.tar.gz>${pkgname}-${version}.tar.gz"
 checksum=77540cedb0b26affe993dd18124d796059e34c80a51d9ae6433fdff1860db135
 
-if [ -n "$CROSS_BUILD" ]; then
-	hostmakedepends+=" qt5-host-tools qt5-devel"
-fi
 CXXFLAGS="-fno-lifetime-dse -Wno-error=cast-align"
 
 injeqt-devel_package() {

From 312e82e0623fbae76578d2883efb4002a53afb10 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: Wed, 17 Mar 2021 22:26:37 +0700
Subject: [PATCH 07/63] kindd: build with CMAKE_BUILD_TYPE=None

---
 srcpkgs/kindd/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/kindd/template b/srcpkgs/kindd/template
index e634b0f69bf6..4416041de58c 100644
--- a/srcpkgs/kindd/template
+++ b/srcpkgs/kindd/template
@@ -15,7 +15,7 @@ distfiles="${homepage}/archive/${version}.tar.gz"
 checksum=e596f1b1577ff3e83a779e6181252ae2f09731f513d17dd6b95cbc2cf204654f
 
 do_install() {
-	vbin release/kindd
+	vbin build/core/kindd
 	vinstall assets/appconf/kindd.svg 644 usr/share/pixmaps
 	vinstall assets/appconf/kindd.desktop 644 usr/share/applications
 }

From 6493fd3aced1bc12bef300e14b037c89146737a4 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: Thu, 18 Mar 2021 23:58:53 +0700
Subject: [PATCH 08/63] occt: allow CMAKE_BUILD_TYPE=None

---
 srcpkgs/occt/patches/cmake-build-type-none.patch | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 srcpkgs/occt/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/occt/patches/cmake-build-type-none.patch b/srcpkgs/occt/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..acb06fb55766
--- /dev/null
+++ b/srcpkgs/occt/patches/cmake-build-type-none.patch
@@ -0,0 +1,13 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -4,7 +4,7 @@ set (CMAKE_MODULE_PATH "${CMAKE_SOURCE_D
+ 
+ set (CMAKE_SUPPRESS_REGENERATION TRUE)
+ 
+-set (CMAKE_CONFIGURATION_TYPES Release Debug RelWithDebInfo CACHE INTERNAL "" FORCE)
++set (CMAKE_CONFIGURATION_TYPES None Release Debug RelWithDebInfo CACHE INTERNAL "" FORCE)
+ 
+ # macro: include patched file if it exists
+ macro (OCCT_INCLUDE_CMAKE_FILE BEING_INCLUDED_FILE)

From c42ca35fa6571cd7bb0b02231d136618f61f07ff 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: Fri, 19 Mar 2021 23:07:05 +0700
Subject: [PATCH 09/63] renderdoc: devendor zstd, lz4

---
 .../patches/build-type-none-is-release.patch  | 12 ++++
 .../renderdoc/patches/qmake-no-rpath.patch    | 13 ++++
 .../renderdoc/patches/unvendor-zstd-lz4.patch | 68 +++++++++++++++++++
 srcpkgs/renderdoc/template                    | 15 ++--
 4 files changed, 99 insertions(+), 9 deletions(-)
 create mode 100644 srcpkgs/renderdoc/patches/build-type-none-is-release.patch
 create mode 100644 srcpkgs/renderdoc/patches/qmake-no-rpath.patch
 create mode 100644 srcpkgs/renderdoc/patches/unvendor-zstd-lz4.patch

diff --git a/srcpkgs/renderdoc/patches/build-type-none-is-release.patch b/srcpkgs/renderdoc/patches/build-type-none-is-release.patch
new file mode 100644
index 000000000000..f16b944bc12c
--- /dev/null
+++ b/srcpkgs/renderdoc/patches/build-type-none-is-release.patch
@@ -0,0 +1,12 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -315,6 +315,7 @@ set(RELEASE_MODE 0)
+ 
+ if(cmake_build_type_lower STREQUAL "release" OR
+    cmake_build_type_lower STREQUAL "relwithdebinfo" OR
++   cmake_build_type_lower STREQUAL "none" OR
+    cmake_build_type_lower STREQUAL "minsizerel")
+     add_definitions(-D_RELEASE)
+     message(STATUS "Building RenderDoc in Release mode: ${CMAKE_BUILD_TYPE}")
diff --git a/srcpkgs/renderdoc/patches/qmake-no-rpath.patch b/srcpkgs/renderdoc/patches/qmake-no-rpath.patch
new file mode 100644
index 000000000000..6e6325c53555
--- /dev/null
+++ b/srcpkgs/renderdoc/patches/qmake-no-rpath.patch
@@ -0,0 +1,13 @@
+Index: qrenderdoc/CMakeLists.txt
+===================================================================
+--- qrenderdoc/CMakeLists.txt.orig
++++ qrenderdoc/CMakeLists.txt
+@@ -144,7 +144,7 @@ endif()
+ # and finding dependencies from the cmake build
+ file(WRITE
+      ${CMAKE_BINARY_DIR}/qrenderdoc/qrenderdoc_cmake.pri
+-     "CONFIG+=${QMAKE_CONFIG}\n"
++     "CONFIG+=${QMAKE_CONFIG} no_qt_rpath\n"
+      "\n"
+      "QMAKE_CC=${CMAKE_C_COMPILER}\n"
+      "QMAKE_CXX=${CMAKE_CXX_COMPILER}\n"
diff --git a/srcpkgs/renderdoc/patches/unvendor-zstd-lz4.patch b/srcpkgs/renderdoc/patches/unvendor-zstd-lz4.patch
new file mode 100644
index 000000000000..d4003ded9161
--- /dev/null
+++ b/srcpkgs/renderdoc/patches/unvendor-zstd-lz4.patch
@@ -0,0 +1,68 @@
+Index: renderdoc/CMakeLists.txt
+===================================================================
+--- renderdoc/CMakeLists.txt.orig
++++ renderdoc/CMakeLists.txt
+@@ -213,54 +213,10 @@ set(sources
+     3rdparty/pugixml/pugixml.cpp
+     3rdparty/pugixml/pugixml.hpp
+     3rdparty/pugixml/pugiconfig.hpp
+-    3rdparty/lz4/lz4.c
+-    3rdparty/lz4/lz4.h
+     3rdparty/miniz/miniz.c
+     3rdparty/miniz/miniz.h
+     3rdparty/superluminal/superluminal.cpp
+     3rdparty/superluminal/superluminal.h
+-    3rdparty/zstd/bitstream.h
+-    3rdparty/zstd/compiler.h
+-    3rdparty/zstd/cpu.h
+-    3rdparty/zstd/debug.c
+-    3rdparty/zstd/debug.h
+-    3rdparty/zstd/entropy_common.c
+-    3rdparty/zstd/error_private.c
+-    3rdparty/zstd/error_private.h
+-    3rdparty/zstd/fse.h
+-    3rdparty/zstd/fse_compress.c
+-    3rdparty/zstd/fse_decompress.c
+-    3rdparty/zstd/hist.c
+-    3rdparty/zstd/hist.h
+-    3rdparty/zstd/huf.h
+-    3rdparty/zstd/huf_compress.c
+-    3rdparty/zstd/huf_decompress.c
+-    3rdparty/zstd/mem.h
+-    3rdparty/zstd/pool.c
+-    3rdparty/zstd/pool.h
+-    3rdparty/zstd/threading.c
+-    3rdparty/zstd/threading.h
+-    3rdparty/zstd/xxhash.c
+-    3rdparty/zstd/xxhash.h
+-    3rdparty/zstd/zstd.h
+-    3rdparty/zstd/zstd_common.c
+-    3rdparty/zstd/zstd_compress.c
+-    3rdparty/zstd/zstd_compress_internal.h
+-    3rdparty/zstd/zstd_decompress.c
+-    3rdparty/zstd/zstd_double_fast.c
+-    3rdparty/zstd/zstd_double_fast.h
+-    3rdparty/zstd/zstd_errors.h
+-    3rdparty/zstd/zstd_fast.c
+-    3rdparty/zstd/zstd_fast.h
+-    3rdparty/zstd/zstd_internal.h
+-    3rdparty/zstd/zstd_lazy.c
+-    3rdparty/zstd/zstd_lazy.h
+-    3rdparty/zstd/zstd_ldm.c
+-    3rdparty/zstd/zstd_ldm.h
+-    3rdparty/zstd/zstd_opt.c
+-    3rdparty/zstd/zstd_opt.h
+-    3rdparty/zstd/zstdmt_compress.c
+-    3rdparty/zstd/zstdmt_compress.h
+     3rdparty/stb/stb_image.h
+     3rdparty/stb/stb_image_write.h
+     3rdparty/stb/stb_image_resize.h
+@@ -271,6 +227,8 @@ set(sources
+     3rdparty/tinyfiledialogs/tinyfiledialogs.c
+     3rdparty/tinyfiledialogs/tinyfiledialogs.h)
+ 
++list(APPEND RDOC_LIBRARIES -llz4 -lzstd)
++
+ if(ANDROID)
+     list(APPEND sources
+         data/embedded_files.h
diff --git a/srcpkgs/renderdoc/template b/srcpkgs/renderdoc/template
index 7240e9ebc307..4615d45c52c9 100644
--- a/srcpkgs/renderdoc/template
+++ b/srcpkgs/renderdoc/template
@@ -1,13 +1,14 @@
 # Template file for 'renderdoc'
 pkgname=renderdoc
 version=1.12
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DENABLE_GL=ON -DENABLE_GLES=ON -DENABLE_QRENDERDOC=ON
  -DENABLE_RENDERDOCCMD=ON -DENABLE_VULKAN=ON -DENABLE_XCB=ON -DENABLE_XLIB=ON
  -DENABLE_PYRENDERDOC=ON"
-hostmakedepends="bison autoconf automake pkg-config python3"
+hostmakedepends="bison autoconf automake pkg-config python3 swig"
 makedepends="libX11-devel libxcb-devel xcb-util-keysyms-devel qt5-devel
+ libzstd-devel liblz4-devel
  qt5-svg-devel qt5-x11extras-devel pcre-devel python3-devel"
 short_desc="Stand-alone graphics debugging tool for Vulkan and OpenGL"
 maintainer="Urs Schulz <voidpkgs@ursschulz.de>"
@@ -19,19 +20,14 @@ checksum=4dece1b4cb859a76533b28fcd50e17321acfaa81c3435500a006c4a5ba15fddb
 if [ "$XBPS_TARGET_LIBC" = musl ]; then
 	makedepends+=" libexecinfo-devel"
 	LDLIBS="-lexecinfo"
+	broken="uses RTLD_DL_LINKMAP, RTLD_DEEPBIND, _r_debug"
 fi
 
 if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
 	makedepends+=" libatomic-devel"
 fi
 
-case "$XBPS_TARGET_MACHINE" in
-	*-musl) broken="uses RTLD_DL_LINKMAP, RTLD_DEEPBIND, _r_debug" ;;
-esac
-
-if [ "$CROSS_BUILD" ]; then
-	broken="Cross-compilation can't find python3 interpreter"
-fi
+nocross="Cross-compilation can't find python3 interpreter"
 
 post_patch() {
 	[ -z "$XBPS_TARGET_NO_ATOMIC8" ] && return 0
@@ -40,4 +36,5 @@ post_patch() {
 
 post_install() {
 	vlicense LICENSE.md
+	vlicense docs/credits_acknowledgements.rst
 }

From e70da6e955d10802f16f1774a0ee9a96c4637036 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: Sat, 20 Mar 2021 00:47:52 +0700
Subject: [PATCH 10/63] python3-occ: build with CMAKE_BUILD_TYPE=None

---
 srcpkgs/python3-occ/template | 1 +
 1 file changed, 1 insertion(+)

diff --git a/srcpkgs/python3-occ/template b/srcpkgs/python3-occ/template
index 705f37457943..3ea0ef5e6387 100644
--- a/srcpkgs/python3-occ/template
+++ b/srcpkgs/python3-occ/template
@@ -5,6 +5,7 @@ revision=1
 archs="i686* x86_64* armv7l* aarch64* ppc*"
 wrksrc="pythonocc-core-${version}"
 build_style=cmake
+configure_args="-DPYTHONOCC_BUILD_TYPE=None -DCMAKE_BUILD_TYPE=None"
 hostmakedepends="python3 swig"
 makedepends="python3-devel occt-devel freetype-devel swig"
 depends="python3 occt freetype"

From cc7f438fa7d33eca626cc30d29cd6ee19346f18d 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: Fri, 19 Mar 2021 23:38:10 +0700
Subject: [PATCH 11/63] widelands: allow CMAKE_BUILD_TYPE=None

---
 srcpkgs/widelands-data                        |  1 -
 .../patches/cmake-build-type-none.patch       | 63 +++++++++++++++++++
 .../widelands/patches/fix-install-path.patch  | 40 ++++++++++++
 srcpkgs/widelands/template                    | 21 +------
 4 files changed, 105 insertions(+), 20 deletions(-)
 delete mode 120000 srcpkgs/widelands-data
 create mode 100644 srcpkgs/widelands/patches/cmake-build-type-none.patch
 create mode 100644 srcpkgs/widelands/patches/fix-install-path.patch

diff --git a/srcpkgs/widelands-data b/srcpkgs/widelands-data
deleted file mode 120000
index e9fbf89517f2..000000000000
--- a/srcpkgs/widelands-data
+++ /dev/null
@@ -1 +0,0 @@
-widelands
\ No newline at end of file
diff --git a/srcpkgs/widelands/patches/cmake-build-type-none.patch b/srcpkgs/widelands/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..3d210854741b
--- /dev/null
+++ b/srcpkgs/widelands/patches/cmake-build-type-none.patch
@@ -0,0 +1,63 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -202,7 +202,7 @@ elseif(CMAKE_BUILD_TYPE STREQUAL "RelWit
+   set(WL_DEBUG_FLAGS "-DNDEBUG -DNOPARACHUTE")
+   option(OPTION_ASAN "Build with AddressSanitizer" ON)
+ else()
+-  message(FATAL_ERROR "Unknown CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
++  set(WL_DEBUG_FLAGS "-DNDEBUG -DNOPARACHUTE")
+ endif()
+ 
+ wl_add_flag(WL_GENERIC_CXX_FLAGS "-std=c++11")
+@@ -353,7 +353,7 @@ endif (OPTION_BUILD_TESTS)
+ install (
+   FILES ${CMAKE_CURRENT_BINARY_DIR}/VERSION
+   DESTINATION ${WL_INSTALL_BASEDIR}
+-  CONFIGURATIONS Debug;Release
++  CONFIGURATIONS Debug
+   COMPONENT CoreVersionFile
+ )
+ 
+@@ -378,7 +378,6 @@ install(
+     data/txts
+     data/world
+   DESTINATION ${WL_INSTALL_DATADIR}
+-  CONFIGURATIONS Debug;Release
+   COMPONENT CoreDataFiles
+ )
+ 
+@@ -386,7 +385,6 @@ install(
+   DIRECTORY
+     data/maps
+   DESTINATION ${WL_INSTALL_DATADIR}
+-  CONFIGURATIONS Debug;Release
+   COMPONENT MapFiles
+ )
+ 
+@@ -395,7 +393,6 @@ install(
+     data/music
+     data/sound
+   DESTINATION ${WL_INSTALL_DATADIR}
+-  CONFIGURATIONS Debug;Release
+   COMPONENT MusicFiles
+ )
+ 
+@@ -405,7 +402,7 @@ install(
+     CREDITS
+     ChangeLog
+   DESTINATION ${WL_INSTALL_BASEDIR}
+-  CONFIGURATIONS Debug;Release
++  CONFIGURATIONS Debug
+   COMPONENT CoreLicenseFiles
+ )
+ 
+@@ -424,7 +421,6 @@ install(
+   DIRECTORY
+     ${CMAKE_CURRENT_BINARY_DIR}/locale/
+   DESTINATION ${WL_INSTALL_DATADIR}/locale
+-  CONFIGURATIONS Debug;Release
+   COMPONENT CoreLanguageFiles
+ )
+ 
diff --git a/srcpkgs/widelands/patches/fix-install-path.patch b/srcpkgs/widelands/patches/fix-install-path.patch
new file mode 100644
index 000000000000..6bb461389f03
--- /dev/null
+++ b/srcpkgs/widelands/patches/fix-install-path.patch
@@ -0,0 +1,40 @@
+Index: cmake/WlFunctions.cmake
+===================================================================
+--- cmake/WlFunctions.cmake.orig
++++ cmake/WlFunctions.cmake
+@@ -289,5 +289,5 @@ function(wl_binary NAME)
+ 
+   #Quoting the CMake documentation on DESTINATION:
+   #"If a relative path is given it is interpreted relative to the value of CMAKE_INSTALL_PREFIX"
+-  install(TARGETS ${NAME} DESTINATION "." COMPONENT ExecutableFiles)
++  install(TARGETS ${NAME} DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT ExecutableFiles)
+ endfunction()
+Index: xdg/CMakeLists.txt
+===================================================================
+--- xdg/CMakeLists.txt.orig
++++ xdg/CMakeLists.txt
+@@ -6,19 +6,19 @@ set(XDG_APPLICATION_ID "org.widelands.Wi
+ list(APPEND icon_sizes "16" "32" "48" "64" "128")
+ foreach (icon_size ${icon_sizes})
+   #install(FILES ${CMAKE_SOURCE_DIR}/data/images/logos/wl-ico-${icon_size}.png DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/${icon_size}x${icon_size}/apps RENAME ${XDG_APPLICATION_ID}.png)
+-  install(FILES ${CMAKE_SOURCE_DIR}/data/images/logos/wl-ico-${icon_size}.png DESTINATION ../share/icons/hicolor/${icon_size}x${icon_size}/apps RENAME ${XDG_APPLICATION_ID}.png)
++  install(FILES ${CMAKE_SOURCE_DIR}/data/images/logos/wl-ico-${icon_size}.png DESTINATION share/icons/hicolor/${icon_size}x${icon_size}/apps RENAME ${XDG_APPLICATION_ID}.png)
+ endforeach (icon_size ${icon_sizes})
+ #install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${CMAKE_PROJECT_NAME}.6           DESTINATION ${CMAKE_INSTALL_MANDIR}/man6)
+-install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${CMAKE_PROJECT_NAME}.6           DESTINATION ../share/man/man6)
++install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${CMAKE_PROJECT_NAME}.6           DESTINATION share/man/man6)
+ #install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${XDG_APPLICATION_ID}.desktop     DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications)
+-install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${XDG_APPLICATION_ID}.desktop     DESTINATION ../share/applications)
++install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${XDG_APPLICATION_ID}.desktop     DESTINATION share/applications)
+ #install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${XDG_APPLICATION_ID}.appdata.xml DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/metainfo)
+-install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${XDG_APPLICATION_ID}.appdata.xml DESTINATION ../share/metainfo)
++install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${XDG_APPLICATION_ID}.appdata.xml DESTINATION share/metainfo)
+ 
+ find_program(GTK_UPDATE_ICON_CACHE NAMES gtk-update-icon-cache)
+ if (GTK_UPDATE_ICON_CACHE)
+   #install(CODE "execute_process (COMMAND ${GTK_UPDATE_ICON_CACHE} -t -f ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor ||: )")
+-  install(CODE "execute_process (COMMAND ${GTK_UPDATE_ICON_CACHE} -t -f ${CMAKE_INSTALL_PREFIX}/../share/icons/hicolor ||: )")
++  install(CODE "execute_process (COMMAND ${GTK_UPDATE_ICON_CACHE} -t -f ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor ||: )")
+ else (GTK_UPDATE_ICON_CACHE)
+   message(WARNING "gtk-update-icon-cache not found!")
+ endif (GTK_UPDATE_ICON_CACHE)
diff --git a/srcpkgs/widelands/template b/srcpkgs/widelands/template
index 6cee85087ea7..cfa2c10993e0 100644
--- a/srcpkgs/widelands/template
+++ b/srcpkgs/widelands/template
@@ -1,7 +1,7 @@
 # Template file for 'widelands'
 pkgname=widelands
 version=21
-revision=3
+revision=4
 wrksrc="${pkgname}-build${version}"
 build_style=cmake
 configure_args="-DOPENGL_INCLUDE_DIR=${XBPS_CROSS_BASE}/usr/include
@@ -10,13 +10,13 @@ hostmakedepends="python3 pkg-config gettext"
 makedepends="boost-devel icu-devel minizip-devel gettext-devel
  glu-devel glew-devel SDL2-devel SDL2_gfx-devel SDL2_image-devel
  SDL2_net-devel SDL2_mixer-devel SDL2_ttf-devel"
-depends="${pkgname}-data-${version}_${revision}"
 short_desc="Real-time strategy game"
 maintainer="Jürgen Buchmüller <pullmoll@t-online.de>"
 license="GPL-2.0-or-later"
 homepage="http://www.widelands.org/"
 distfiles="https://github.com/widelands/widelands/archive/build${version}.tar.gz>${pkgname}-${version}.tar.gz"
 checksum=601e0e4c6f91b3fb0ece2cd1b83ecfb02344a1b9194fbb70ef3f70e06994e357
+replaces="widelands-data>=0"
 
 CXXFLAGS="-DU_USING_ICU_NAMESPACE=1"
 
@@ -29,22 +29,5 @@ if [ "$CROSS_BUILD" ]; then
 fi
 
 post_install() {
-	# For some reason the binary is installed as /usr/widelands - move it
-	vmkdir usr/bin
-	mv ${DESTDIR}/usr/${pkgname} ${DESTDIR}/usr/bin
-	vmkdir usr/share
-	mv ${DESTDIR}/share/* ${DESTDIR}/usr/share/
-	rmdir ${DESTDIR}/share
-
-	# Remove files not needed in the package
-	rm -f ${DESTDIR}/usr/COPYING ${DESTDIR}/usr/CREDITS ${DESTDIR}/usr/ChangeLog ${DESTDIR}/usr/VERSION
-
 	vinstall ${FILESDIR}/${pkgname}.desktop 644 usr/share/applications
 }
-
-widelands-data_package() {
-	short_desc+=" - data files"
-	pkg_install() {
-		vmove usr/share/widelands
-	}
-}

From 08d6fec077008549323829317ca2656e7230814d 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: Sat, 20 Mar 2021 09:49:25 +0700
Subject: [PATCH 12/63] zziplib: fix SONAME when build with
 -DCMAKE_BUILD_TYPE=None

---
 .../cmake-build-type-none-soname.patch        | 35 +++++++++++++++++++
 srcpkgs/zziplib/template                      |  1 +
 2 files changed, 36 insertions(+)
 create mode 100644 srcpkgs/zziplib/patches/cmake-build-type-none-soname.patch

diff --git a/srcpkgs/zziplib/patches/cmake-build-type-none-soname.patch b/srcpkgs/zziplib/patches/cmake-build-type-none-soname.patch
new file mode 100644
index 000000000000..2d31b5b8a46a
--- /dev/null
+++ b/srcpkgs/zziplib/patches/cmake-build-type-none-soname.patch
@@ -0,0 +1,35 @@
+Index: zziplib-0.13.72/zzip/CMakeLists.txt
+===================================================================
+--- zziplib-0.13.72.orig/zzip/CMakeLists.txt
++++ zziplib-0.13.72/zzip/CMakeLists.txt
+@@ -190,15 +190,18 @@ target_include_directories (libzzipmmapp
+ endif()
+ 
+ set_target_properties(libzzip PROPERTIES OUTPUT_NAME "zzip" RELEASE_POSTFIX "-${RELNUM}")
++set_target_properties(libzzip PROPERTIES OUTPUT_NAME "zzip" NONE_POSTFIX "-${RELNUM}")
+ SET_TARGET_PROPERTIES(libzzip PROPERTIES VERSION ${VERNUM}.${FIXNUM} SOVERSION ${VERNUM})
+ 
+ if(ZZIPFSEEKO)
+ set_target_properties(libzzipfseeko PROPERTIES OUTPUT_NAME "zzipfseeko" RELEASE_POSTFIX "-${RELNUM}")
++set_target_properties(libzzipfseeko PROPERTIES OUTPUT_NAME "zzipfseeko" NONE_POSTFIX "-${RELNUM}")
+ SET_TARGET_PROPERTIES(libzzipfseeko PROPERTIES VERSION ${VERNUM}.${FIXNUM} SOVERSION ${VERNUM})
+ endif()
+ 
+ if(ZZIPMMAPPED)
+ set_target_properties(libzzipmmapped PROPERTIES OUTPUT_NAME "zzipmmapped" RELEASE_POSTFIX "-${RELNUM}")
++set_target_properties(libzzipmmapped PROPERTIES OUTPUT_NAME "zzipmmapped" NONE_POSTFIX "-${RELNUM}")
+ SET_TARGET_PROPERTIES(libzzipmmapped PROPERTIES VERSION ${VERNUM}.${FIXNUM} SOVERSION ${VERNUM})
+ endif()
+ 
+Index: zziplib-0.13.72/zzipwrap/CMakeLists.txt
+===================================================================
+--- zziplib-0.13.72.orig/zzipwrap/CMakeLists.txt
++++ zziplib-0.13.72/zzipwrap/CMakeLists.txt
+@@ -49,6 +49,7 @@ target_link_libraries(libzzipwrap libzzi
+ target_include_directories(libzzipwrap PRIVATE "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}")
+ 
+ set_target_properties(libzzipwrap PROPERTIES OUTPUT_NAME "zzipwrap" RELEASE_POSTFIX "-${RELNUM}")
++set_target_properties(libzzipwrap PROPERTIES OUTPUT_NAME "zzipwrap" NONE_POSTFIX "-${RELNUM}")
+ SET_TARGET_PROPERTIES(libzzipwrap PROPERTIES VERSION ${VERNUM}.${FIXNUM} SOVERSION ${VERNUM})
+ set_target_properties(libzzipwrap PROPERTIES DEFINE_SYMBOL "libzzip_EXPORTS")
+ 
diff --git a/srcpkgs/zziplib/template b/srcpkgs/zziplib/template
index ab5af234af62..2026f3e4a521 100644
--- a/srcpkgs/zziplib/template
+++ b/srcpkgs/zziplib/template
@@ -12,6 +12,7 @@ homepage="https://github.com/gdraheim/zziplib"
 changelog="https://raw.githubusercontent.com/gdraheim/zziplib/master/ChangeLog"
 distfiles="https://github.com/gdraheim/zziplib/archive/v${version}.tar.gz"
 checksum=93ef44bf1f1ea24fc66080426a469df82fa631d13ca3b2e4abaeab89538518dc
+patch_args=-Np1
 
 if [ "$CROSS_BUILD" ]; then
 	configure_args+=" -DZZIPTEST=OFF"

From 7ec4f63a9003e16d254baa508454051ff01449d5 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, 21 Mar 2021 15:28:04 +0700
Subject: [PATCH 13/63] mellowplayer: fix build

---
 srcpkgs/mellowplayer/patches/no-werror.patch | 13 +++++++++++++
 srcpkgs/mellowplayer/template                | 13 +++++++------
 2 files changed, 20 insertions(+), 6 deletions(-)
 create mode 100644 srcpkgs/mellowplayer/patches/no-werror.patch

diff --git a/srcpkgs/mellowplayer/patches/no-werror.patch b/srcpkgs/mellowplayer/patches/no-werror.patch
new file mode 100644
index 000000000000..7e678453a123
--- /dev/null
+++ b/srcpkgs/mellowplayer/patches/no-werror.patch
@@ -0,0 +1,13 @@
+Index: MellowPlayer-3.6.6/src/3rdparty/boost/di.hpp
+===================================================================
+--- MellowPlayer-3.6.6.orig/src/3rdparty/boost/di.hpp
++++ MellowPlayer-3.6.6/src/3rdparty/boost/di.hpp
+@@ -67,7 +67,7 @@ BOOST_DI_CFG_FWD
+ #pragma clang diagnostic error "-Wundefined-internal"
+ #pragma clang diagnostic ignored "-Wmissing-field-initializers"
+ #elif defined(__GCC__)
+-#pragma GCC diagnostic error "-Wdeprecated-declarations"
++#pragma GCC diagnostic warning "-Wdeprecated-declarations"
+ #pragma GCC diagnostic push
+ #if (__GNUC__ < 6)
+ #pragma GCC diagnostic error "-Werror"
diff --git a/srcpkgs/mellowplayer/template b/srcpkgs/mellowplayer/template
index 2f8f13960ca6..cfd8a185556f 100644
--- a/srcpkgs/mellowplayer/template
+++ b/srcpkgs/mellowplayer/template
@@ -4,7 +4,7 @@ version=3.6.6
 revision=1
 wrksrc="MellowPlayer-${version}"
 build_style=cmake
-hostmakedepends="pkg-config qt5-tools qt5-qmake"
+hostmakedepends="pkg-config qt5-tools qt5-qmake qt5-host-tools"
 makedepends="qt5-declarative-devel qt5-quickcontrols2-devel
  qt5-plugin-mysql qt5-plugin-pgsql qt5-plugin-sqlite
  qt5-plugin-tds qt5-plugin-odbc
@@ -17,11 +17,12 @@ license="GPL-2.0-or-later"
 homepage="https://colinduquesnoy.gitlab.io/MellowPlayer/"
 distfiles="https://gitlab.com/ColinDuquesnoy/MellowPlayer/-/archive/${version}/MellowPlayer-${version}.tar.bz2"
 checksum=17b8b25ca6b3d27b223f8be6ad80186ae5bd17ce762eb04ecd8b0e82e687b327
+patch_args=-Np1
 
-if [ "$CROSS_BUILD" ]; then
-	hostmakedepends+=" qt5-host-tools"
+if [ "$XBPS_WORDSIZE" != "$XBPS_TARGET_WORDSIZE" ]; then
+	broken="webengine can be built only if word size matches"
 fi
 
-case "$XBPS_TARGET_MACHINE" in
-	arm*) broken="qt5-webengine not available" ;;
-esac
+if [ "$XBPS_TARGET_ENDIAN" != "le" ]; then
+	broken="webengine only supports little endian"
+fi

From ff823e97cc558cd0afd8321e6d38fcda0be767e9 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, 21 Mar 2021 15:43:09 +0700
Subject: [PATCH 14/63] ispc: fix CMAKE_BUILD_TYPE=None

---
 .../ispc/patches/cmake-build-type-none.patch   | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
 create mode 100644 srcpkgs/ispc/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/ispc/patches/cmake-build-type-none.patch b/srcpkgs/ispc/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..411e353c7314
--- /dev/null
+++ b/srcpkgs/ispc/patches/cmake-build-type-none.patch
@@ -0,0 +1,18 @@
+Index: ispc-1.15.0/CMakeLists.txt
+===================================================================
+--- ispc-1.15.0.orig/CMakeLists.txt
++++ ispc-1.15.0/CMakeLists.txt
+@@ -157,13 +157,6 @@ set(OUTPUT_RELEASE Release/bin)
+ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin )
+ 
+ if(CMAKE_BUILD_TYPE)
+-    # Validate build type
+-    set(CONFIGURATION_TYPES "Debug;Release;RelWithDebInfo")
+-
+-    string(FIND "${CONFIGURATION_TYPES}" "${CMAKE_BUILD_TYPE}" MATCHED_CONFIG)
+-    if (${MATCHED_CONFIG} EQUAL -1)
+-         message(FATAL_ERROR "CMAKE_BUILD_TYPE (${CMAKE_BUILD_TYPE}) allows only the following values: ${CONFIGURATION_TYPES}")
+-    endif()
+ else(NOT CMAKE_BUILD_TYPE)
+     set(CMAKE_BUILD_TYPE "Release")
+     message(STATUS "Build type not specified: Use Release by default.")

From 7afc415af2bbb8e74fbc30b43271a23b92ed597d 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, 21 Mar 2021 15:56:50 +0700
Subject: [PATCH 15/63] darktable: fix CMAKE_BUILD_TYPE=None

---
 .../darktable/patches/cmake-build-type-none.patch  | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
 create mode 100644 srcpkgs/darktable/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/darktable/patches/cmake-build-type-none.patch b/srcpkgs/darktable/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..7101f9c1a0e7
--- /dev/null
+++ b/srcpkgs/darktable/patches/cmake-build-type-none.patch
@@ -0,0 +1,14 @@
+Index: src/external/rawspeed/cmake/build-type.cmake
+===================================================================
+--- src/external/rawspeed/cmake/build-type.cmake.orig
++++ src/external/rawspeed/cmake/build-type.cmake
+@@ -27,9 +27,6 @@ string(TOUPPER "${RAWSPEED_SPECIAL_BUILD
+ 
+ # is this one of the known build types?
+ list (FIND CMAKE_CONFIGURATION_TYPES_UPPERCASE ${CMAKE_BUILD_TYPE_UPPERCASE} BUILD_TYPE_IS_KNOWN)
+-if (${BUILD_TYPE_IS_KNOWN} EQUAL -1)
+- message(SEND_ERROR "Unknown build type: ${CMAKE_BUILD_TYPE_UPPERCASE}. Please specify one of: ${CMAKE_CONFIGURATION_TYPES}")
+-endif()
+ 
+ # is this a special build?
+ list (FIND RAWSPEED_SPECIAL_BUILD_TYPES_UPPERCASE ${CMAKE_BUILD_TYPE_UPPERCASE} IS_SPECIAL_BUILD)

From de0e13b432549e30a4b22581a54ed88e4b8c2afa 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, 21 Mar 2021 15:33:29 +0700
Subject: [PATCH 16/63] hedgewars: merge -data back

---
 srcpkgs/hedgewars-data                        |  1 -
 .../patches/cmake-build-type-none.patch       | 30 +++++++++++++++++++
 srcpkgs/hedgewars/template                    | 23 +++++---------
 3 files changed, 38 insertions(+), 16 deletions(-)
 delete mode 120000 srcpkgs/hedgewars-data
 create mode 100644 srcpkgs/hedgewars/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/hedgewars-data b/srcpkgs/hedgewars-data
deleted file mode 120000
index b57dc45ebadc..000000000000
--- a/srcpkgs/hedgewars-data
+++ /dev/null
@@ -1 +0,0 @@
-hedgewars
\ No newline at end of file
diff --git a/srcpkgs/hedgewars/patches/cmake-build-type-none.patch b/srcpkgs/hedgewars/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..b4e0c186717c
--- /dev/null
+++ b/srcpkgs/hedgewars/patches/cmake-build-type-none.patch
@@ -0,0 +1,30 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -54,7 +54,7 @@ option(NOVERSIONINFOUPDATE "Disable upda
+ 
+ 
+ if(BUILD_ENGINE_C AND NOT NOVIDEOREC)
+-    if((CMAKE_BUILD_TYPE STREQUAL "Release") OR (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo"))
++    if((CMAKE_BUILD_TYPE STREQUAL "Release") OR (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo") OR (CMAKE_BUILD_TYPE STREQUAL "None"))
+         message("NOTE: Video recorder support disabled. It's incompatible with BUILD_ENGINE_C")
+         set(BUILD_ENGINE_C ON CACHE STRING "Required for BUILD_ENGINE_JS" FORCE)
+     else()
+@@ -93,7 +93,7 @@ set(CPACK_PACKAGE_VERSION_MAJOR 1)
+ set(CPACK_PACKAGE_VERSION_MINOR 0)
+ set(CPACK_PACKAGE_VERSION_PATCH 0)
+ set(HEDGEWARS_PROTO_VER 59)
+-if((CMAKE_BUILD_TYPE STREQUAL "Release") OR (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo"))
++if((CMAKE_BUILD_TYPE STREQUAL "Release") OR (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo") OR (CMAKE_BUILD_TYPE STREQUAL "None"))
+     set(HEDGEWARS_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
+ else()
+     set(HEDGEWARS_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}-dev")
+@@ -114,6 +114,7 @@ include(${CMAKE_MODULE_PATH}/platform.cm
+ if(CMAKE_BUILD_TYPE)
+     if(NOT((CMAKE_BUILD_TYPE STREQUAL "Release") OR
+            (CMAKE_BUILD_TYPE STREQUAL "Debug") OR
++	   (CMAKE_BUILD_TYPE STREQUAL "None") OR
+            (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")))
+         set(CMAKE_BUILD_TYPE ${default_build_type} CACHE STRING "Build type (Debug/Release/RelWithDebInfo)" FORCE)
+         message(STATUS "Unknown build type ${CMAKE_BUILD_TYPE}, using default (${default_build_type})")
diff --git a/srcpkgs/hedgewars/template b/srcpkgs/hedgewars/template
index d2294cf572f5..aed3c03caf89 100644
--- a/srcpkgs/hedgewars/template
+++ b/srcpkgs/hedgewars/template
@@ -1,15 +1,16 @@
 # Template file for 'hedgewars'
 pkgname=hedgewars
 version=1.0.0
-revision=2
+revision=3
 wrksrc="${pkgname}-src-${version}"
 build_style=cmake
 configure_args="-DNOSERVER=1 -DDATA_INSTALL_DIR=/usr/share/${pkgname}
- -DPHYSFS_SYSTEM=1 -DCMAKE_VERBOSE_MAKEFILE=1 -DMINIMAL_FLAGS=1"
-hostmakedepends="lua51 pkg-config"
+ -DPHYSFS_SYSTEM=1 -DMINIMAL_FLAGS=1"
+make_cmd=make
+hostmakedepends="lua51 pkg-config qt5-qmake qt5-host-tools"
 makedepends="ffmpeg-devel lua51-devel physfs-devel qt5-tools-devel SDL2_image-devel
  SDL2_mixer-devel SDL2_net-devel SDL2_ttf-devel"
-depends="hedgewars-data>=${version}_${revision} libfreeglut"
+depends="libfreeglut"
 short_desc="Funny turn-based artillery game, featuring fighting Hedgehogs!"
 maintainer="Jakub Skrzypnik <jot.skrzyp@gmail.com>"
 license="GPL-2.0-only"
@@ -18,10 +19,8 @@ distfiles="https://hedgewars.org/download/releases/hedgewars-src-${version}.tar.
 checksum=211634e61f2e4beecc3c98c6f749601fcd08321fda1ba969b3b3832a004f155b
 nopie_files="/usr/bin/hwengine"
 nocross="Needs investigation: fails to link hwengine"
-
-if [ -n "$CROSS_BUILD" ]; then
-	hostmakedepends+=" qt5-devel"
-fi
+replaces="hedgewars-data>=0"
+export CMAKE_GENERATOR="Unix Makefiles"
 
 case $XBPS_TARGET_MACHINE in
 	x86_64*)
@@ -38,6 +37,7 @@ esac
 
 if [ -n "$_use_c_engine" ]; then
 	hostmakedepends+=" glew-devel libatomic-devel ghc clang"
+	makedepends+=" glew-devel libatomic-devel"
 	configure_args+=" -DBUILD_ENGINE_C=1"
 	nopie_files+=" /usr/bin/hedgewars"
 fi
@@ -56,10 +56,3 @@ pre_configure() {
 post_install() {
 	vinstall ${DESTDIR}/usr/share/hedgewars/Data/misc/hedgewars.desktop 644 usr/share/applications
 }
-
-hedgewars-data_package() {
-	short_desc+=" - data files"
-	pkg_install() {
-		vmove usr/share/hedgewars/Data
-	}
-}

From 259a9dac397fca1008f6e42a492d678bb960e727 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, 21 Mar 2021 16:41:58 +0700
Subject: [PATCH 17/63] mariadb: fix for CMAKE_BUILD_TYPE=None

---
 srcpkgs/mariadb/template | 32 ++++++++++++++------------------
 1 file changed, 14 insertions(+), 18 deletions(-)

diff --git a/srcpkgs/mariadb/template b/srcpkgs/mariadb/template
index 437ff757b383..78d5e2dbdbe8 100644
--- a/srcpkgs/mariadb/template
+++ b/srcpkgs/mariadb/template
@@ -34,35 +34,31 @@ replaces="mysql>=0"
 conf_files="/etc/mysql/my.cnf"
 system_accounts="mysql"
 mysql_homedir="/var/lib/mysql"
-CFLAGS="-w -fcommon"
+CFLAGS="-w -fcommon -DDBUG_OFF=1"
+CXXFLAGS="-DDBUG_OFF=1"
 
 pre_configure() {
 	# We need some host binaries before starting cross compilation.
 	if [ "$CROSS_BUILD" ]; then
+		mkdir -p build.native
 		# XXX still broken: jemalloc configure execs host bins.
-		CC= CXX= CPP= LD= AR= AS= RANLIB= CFLAGS= CXXFLAGS= LDFLAGS= cmake .
-		make comp_err comp_sql gen_lex_hash gen_lex_token
-		mkdir bin.host
-		cp extra/comp_err bin.host
-		cp scripts/comp_sql bin.host
-		cp sql/gen_lex_hash bin.host
-		cp sql/gen_lex_token bin.host
-		make clean
-		rm CMakeCache.txt
+		CC= CXX= CPP= LD= AR= AS= RANLIB= CFLAGS= CXXFLAGS= LDFLAGS= \
+			cmake -S . -B build.native
+		make -C build.native comp_err comp_sql gen_lex_hash gen_lex_token
 	fi
 }
 
 pre_build() {
 	if [ "$CROSS_BUILD" ]; then
 		# CMake complains if those binaries ain't in build
-		cp bin.host/comp_err ${wrksrc}/extra
-		cp bin.host/comp_err ${wrksrc}/build/extra
-		cp bin.host/comp_sql ${wrksrc}/scripts
-		cp bin.host/comp_sql ${wrksrc}/build/scripts
-		cp bin.host/gen_lex_hash ${wrksrc}/sql
-		cp bin.host/gen_lex_hash ${wrksrc}/build/sql
-		cp bin.host/gen_lex_token ${wrksrc}/sql
-		cp bin.host/gen_lex_token ${wrksrc}/build/sql
+		cp build.native/extra/comp_err ${wrksrc}/extra
+		cp build.native/extra/comp_err ${wrksrc}/build/extra
+		cp build.native/scripts/comp_sql ${wrksrc}/scripts
+		cp build.native/scripts/comp_sql ${wrksrc}/build/scripts
+		cp build.native/sql/gen_lex_hash ${wrksrc}/sql
+		cp build.native/sql/gen_lex_hash ${wrksrc}/build/sql
+		cp build.native/sql/gen_lex_token ${wrksrc}/sql
+		cp build.native/sql/gen_lex_token ${wrksrc}/build/sql
 		export PATH=${PATH}:${wrksrc}/extra:${wrksrc}/scripts:${wrksrc}/sql
 	fi
 	export LD_LIBRARY_PATH=${wrksrc}/build/storage/tokudb/ft-index/portability

From ccd02a0cd0206a2fa606102d1f4e5a2503dee2a9 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: Thu, 25 Mar 2021 07:58:28 +0700
Subject: [PATCH 18/63] EternalTerminal: remove -ggdb3

---
 .../EternalTerminal/patches/fix-cflags.patch    | 17 +++++++++++++++++
 srcpkgs/EternalTerminal/template                |  1 +
 2 files changed, 18 insertions(+)
 create mode 100644 srcpkgs/EternalTerminal/patches/fix-cflags.patch

diff --git a/srcpkgs/EternalTerminal/patches/fix-cflags.patch b/srcpkgs/EternalTerminal/patches/fix-cflags.patch
new file mode 100644
index 000000000000..e6fcd432f7e7
--- /dev/null
+++ b/srcpkgs/EternalTerminal/patches/fix-cflags.patch
@@ -0,0 +1,17 @@
+Index: EternalTerminal-et-v6.0.13/CMakeLists.txt
+===================================================================
+--- EternalTerminal-et-v6.0.13.orig/CMakeLists.txt
++++ EternalTerminal-et-v6.0.13/CMakeLists.txt
+@@ -26,12 +26,6 @@ if(DISABLE_CRASH_LOG)
+ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DELPP_DISABLE_DEFAULT_CRASH_HANDLING")
+ ENDIF(DISABLE_CRASH_LOG)
+ 
+-if(UNIX)
+-  # Enable debug info
+-  SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -ggdb3")
+-  SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -ggdb3")
+-endif()
+-
+ # Enable C++-11
+ set(CMAKE_CXX_STANDARD 11)
+ set(CMAKE_CXX_STANDARD_REQUIRED ON)
diff --git a/srcpkgs/EternalTerminal/template b/srcpkgs/EternalTerminal/template
index 7bac78d2ffd4..bc92e47743dd 100644
--- a/srcpkgs/EternalTerminal/template
+++ b/srcpkgs/EternalTerminal/template
@@ -13,6 +13,7 @@ homepage="https://eternalterminal.dev/"
 distfiles="https://github.com/MisterTea/EternalTerminal/archive/et-v${version}.tar.gz"
 checksum=728c3a444d666897c710e33fe473d8d289263a59574451b13aa53ec3c6ac88b3
 system_accounts="_eternal"
+patch_args=-Np1
 
 LDFLAGS="-lgflags"
 

From 8b3f8dc3ebb6d90313fdd223da5665e5073f3740 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: Thu, 25 Mar 2021 08:20:29 +0700
Subject: [PATCH 19/63] OTPClient: respect CFLAGS

---
 srcpkgs/OTPClient/patches/fix-cflags.patch | 17 +++++++++++++++++
 srcpkgs/OTPClient/template                 |  1 +
 2 files changed, 18 insertions(+)
 create mode 100644 srcpkgs/OTPClient/patches/fix-cflags.patch

diff --git a/srcpkgs/OTPClient/patches/fix-cflags.patch b/srcpkgs/OTPClient/patches/fix-cflags.patch
new file mode 100644
index 000000000000..ae70f441538f
--- /dev/null
+++ b/srcpkgs/OTPClient/patches/fix-cflags.patch
@@ -0,0 +1,17 @@
+Index: OTPClient-2.4.2/CMakeLists.txt
+===================================================================
+--- OTPClient-2.4.2.orig/CMakeLists.txt
++++ OTPClient-2.4.2/CMakeLists.txt
+@@ -11,11 +11,10 @@ option(BUILD_GUI "Build the GUI" ON)
+ option(BUILD_CLI "Build the CLI" ON)
+ 
+ set(CMAKE_C_STANDARD 11)
+-set(CMAKE_C_FLAGS "-Wall -Wextra -O3 -Wformat=2 -Wmissing-format-attribute -fstack-protector-strong -Wundef -Wmissing-format-attribute")
++set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wformat=2 -Wmissing-format-attribute -fstack-protector-strong -Wundef -Wmissing-format-attribute")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fdiagnostics-color=always -Wstrict-prototypes -Wunreachable-code")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wchar-subscripts -Wwrite-strings -Wpointer-arith -Wbad-function-cast -Wcast-align")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror=format-security -Werror=implicit-function-declaration -Wno-sign-compare")
+-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3")
+ if(CMAKE_COMPILER_IS_GNUCC)
+     set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pie -fPIE")
+ endif()
diff --git a/srcpkgs/OTPClient/template b/srcpkgs/OTPClient/template
index e8c0099850b7..f5af76e655a6 100644
--- a/srcpkgs/OTPClient/template
+++ b/srcpkgs/OTPClient/template
@@ -12,3 +12,4 @@ license="GPL-3.0-or-later"
 homepage="https://github.com/paolostivanin/OTPClient"
 distfiles="https://github.com/paolostivanin/OTPClient/archive/v${version}.tar.gz"
 checksum=74bc4312aa1cd336ca983434e3bed951c5ead327091e7708e3beb08508813495
+patch_args=-Np1

From 65952bd4f2a646b8ffb67e00ad7963afc86bef1f 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: Thu, 25 Mar 2021 08:30:31 +0700
Subject: [PATCH 20/63] crex: hardening

---
 srcpkgs/crex/patches/fix-cflags.patch | 20 ++++++++++++++++++++
 srcpkgs/crex/template                 |  7 ++-----
 2 files changed, 22 insertions(+), 5 deletions(-)
 create mode 100644 srcpkgs/crex/patches/fix-cflags.patch

diff --git a/srcpkgs/crex/patches/fix-cflags.patch b/srcpkgs/crex/patches/fix-cflags.patch
new file mode 100644
index 000000000000..d191fb1e9ec0
--- /dev/null
+++ b/srcpkgs/crex/patches/fix-cflags.patch
@@ -0,0 +1,20 @@
+Index: crex-0.2.5/CMakeLists.txt
+===================================================================
+--- crex-0.2.5.orig/CMakeLists.txt
++++ crex-0.2.5/CMakeLists.txt
+@@ -13,9 +13,6 @@ endif(CCACHE_FOUND)
+ set (CMAKE_CXX_STANDARD 14)
+ set (CMAKE_CXX_STANDARD_REQUIRED ON)
+ 
+-set (CMAKE_CXX_FLAGS "-fdiagnostics-color=auto")
+-set (CMAKE_C_FLAGS "-fdiagnostics-color=auto")
+-
+ set (DEBUG_FLAGS "-Wpedantic -Wall -Wextra -Wcast-align -Wcast-qual -Wctor-dtor-privacy -Wdisabled-optimization -Wformat=2 -Winit-self -Wlogical-op -Wmissing-declarations -Wmissing-include-dirs -Wnoexcept -Wold-style-cast -Woverloaded-virtual -Wredundant-decls -Wshadow -Wsign-conversion -Wsign-promo -Wstrict-null-sentinel -Wstrict-overflow=5 -Wswitch-default -Wundef -Wno-unused -std=c++14 -g")
+ set (DEBUG_LINK_FLAGS "-fprofile-arcs -ftest-coverage -flto")
+ 
+@@ -56,4 +53,4 @@ target_link_libraries (
+   ${TARGET}
+ )
+ 
+-install (TARGETS ${TARGET} DESTINATION "/usr/local/bin")
++install (TARGETS ${TARGET} DESTINATION "/usr/bin")
diff --git a/srcpkgs/crex/template b/srcpkgs/crex/template
index a54697a93adc..2f455a0b0c72 100644
--- a/srcpkgs/crex/template
+++ b/srcpkgs/crex/template
@@ -1,7 +1,7 @@
 # Template file for 'crex'
 pkgname=crex
 version=0.2.5
-revision=1
+revision=2
 build_style=cmake
 short_desc="Explore, test, and check regular expressions in the terminal"
 maintainer="Piotr Wójcik <chocimier@tlen.pl>"
@@ -9,10 +9,7 @@ license="MIT"
 homepage="https://github.com/octobanana/crex"
 distfiles="https://github.com/octobanana/crex/archive/${version}.tar.gz"
 checksum=c6a166b7a1e696a7babeaf7c5728eece1624704a18357f827129fc95ef2ecc56
-
-pre_configure() {
-	sed -e 's|/local/|/|' -i CMakeLists.txt
-}
+patch_args=-Np1
 
 post_install() {
 	vlicense LICENSE

From 887f95aa40dc367612fdabf22cfb0021b5b07219 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: Thu, 25 Mar 2021 08:34:32 +0700
Subject: [PATCH 21/63] libbaseencode: hardening

---
 srcpkgs/libbaseencode/patches/fix-cflags.patch | 13 +++++++++++++
 srcpkgs/libbaseencode/template                 |  3 ++-
 2 files changed, 15 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/libbaseencode/patches/fix-cflags.patch

diff --git a/srcpkgs/libbaseencode/patches/fix-cflags.patch b/srcpkgs/libbaseencode/patches/fix-cflags.patch
new file mode 100644
index 000000000000..1bb86a0b15a4
--- /dev/null
+++ b/srcpkgs/libbaseencode/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: libbaseencode-1.0.9/CMakeLists.txt
+===================================================================
+--- libbaseencode-1.0.9.orig/CMakeLists.txt
++++ libbaseencode-1.0.9/CMakeLists.txt
+@@ -15,7 +15,7 @@ set(CMAKE_C_STANDARD 11)
+ set(BASEENCODE_HEADERS src/baseencode.h)
+ set(SOURCE_FILES src/base32.c src/base64.c)
+ 
+-set(CMAKE_C_FLAGS "-Wall -Werror -fPIC")
++set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Werror -fPIC")
+ 
+ add_library(${PROJECT_NAME} SHARED ${SOURCE_FILES})
+ 
diff --git a/srcpkgs/libbaseencode/template b/srcpkgs/libbaseencode/template
index 384a189224df..d5929ad7bb51 100644
--- a/srcpkgs/libbaseencode/template
+++ b/srcpkgs/libbaseencode/template
@@ -1,7 +1,7 @@
 # Template file for 'libbaseencode'
 pkgname=libbaseencode
 version=1.0.9
-revision=1
+revision=2
 build_style=cmake
 short_desc="Library for encoding decoding data use base32 or base64"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -9,6 +9,7 @@ license="Apache-2.0"
 homepage="https://github.com/paolostivanin/libbaseencode"
 distfiles="https://github.com/paolostivanin/libbaseencode/archive/v${version}.tar.gz"
 checksum=a183d7cf30d931b2a078d6f0ef64616b71ab26f9258e5f4e191778c7ace7175d
+patch_args=-Np1
 
 libbaseencode-devel_package() {
 	depends="libbaseencode-${version}_${revision}"

From 82e6483add8668070ac032675314ad9741d07529 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: Fri, 26 Mar 2021 08:46:56 +0700
Subject: [PATCH 22/63] bibletime: clean build flags

---
 srcpkgs/bibletime/patches/fix-cflags.patch | 13 +++++++++++++
 srcpkgs/bibletime/template                 |  1 +
 2 files changed, 14 insertions(+)
 create mode 100644 srcpkgs/bibletime/patches/fix-cflags.patch

diff --git a/srcpkgs/bibletime/patches/fix-cflags.patch b/srcpkgs/bibletime/patches/fix-cflags.patch
new file mode 100644
index 000000000000..480c5ca4ac1e
--- /dev/null
+++ b/srcpkgs/bibletime/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: bibletime-3.0/cmake/BTApplication.cmake
+===================================================================
+--- bibletime-3.0.orig/cmake/BTApplication.cmake
++++ bibletime-3.0/cmake/BTApplication.cmake
+@@ -41,7 +41,7 @@ IF(WIN32)
+     ADD_COMPILE_OPTIONS("/Zi")
+ ELSE()
+     ADD_COMPILE_OPTIONS(
+-        "-ggdb" "-Wall" "-Wextra"
++        "-Wall" "-Wextra" "-DNDEBUG" "-DQT_NO_DEBUG"
+         "$<$<STREQUAL:$<CONFIGURATION>,Release>:-O2>"
+         "$<$<STREQUAL:$<CONFIGURATION>,Release>:-DNDEBUG>"
+         "$<$<STREQUAL:$<CONFIGURATION>,Release>:-DQT_NO_DEBUG>"
diff --git a/srcpkgs/bibletime/template b/srcpkgs/bibletime/template
index 224881c45516..85bcc7f22f87 100644
--- a/srcpkgs/bibletime/template
+++ b/srcpkgs/bibletime/template
@@ -18,6 +18,7 @@ license="GPL-2.0-or-later"
 homepage="http://bibletime.info"
 distfiles="https://github.com/bibletime/bibletime/releases/download/v${version}/bibletime-${version}.tar.xz"
 checksum=d6beef62ad44b255e3dc4c5e89214bf01a0e85c9136073b0be12fca3d2b22622
+patch_args=-Np1
 
 pre_build() {
 	. /etc/profile.d/10_openjdk11.sh

From 80744005a08e114d542f43697229da2981572753 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: Fri, 26 Mar 2021 08:54:25 +0700
Subject: [PATCH 23/63] boomerang: clean build flags

---
 srcpkgs/boomerang/patches/fix-cflags.patch | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
 create mode 100644 srcpkgs/boomerang/patches/fix-cflags.patch

diff --git a/srcpkgs/boomerang/patches/fix-cflags.patch b/srcpkgs/boomerang/patches/fix-cflags.patch
new file mode 100644
index 000000000000..eb59766c1c5b
--- /dev/null
+++ b/srcpkgs/boomerang/patches/fix-cflags.patch
@@ -0,0 +1,21 @@
+Index: cmake-scripts/boomerang-flags.cmake
+===================================================================
+--- cmake-scripts/boomerang-flags.cmake
++++ cmake-scripts/boomerang-flags.cmake
+@@ -104,16 +104,6 @@ endif ()
+ 
+ 
+ if (NOT MSVC)
+-    if ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
+-        BOOMERANG_ADD_COMPILE_FLAGS(-O0)
+-    elseif ("${CMAKE_BUILD_TYPE}" STREQUAL "RelWithDebInfo")
+-        # No special flags
+-    elseif ("${CMAKE_BUILD_TYPE}" STREQUAL "MinSizeRel")
+-        BOOMERANG_ADD_COMPILE_FLAGS(-Os)
+-    else () # Release
+-        BOOMERANG_ADD_COMPILE_FLAGS(-O3)
+-    endif ()
+-
+     if (BOOMERANG_ENABLE_COVERAGE)
+         set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fprofile-arcs -ftest-coverage")
+         set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage")

From 82522cbe0736d59a7590cc3c79c90c3da8b11fb5 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: Fri, 26 Mar 2021 08:58:11 +0700
Subject: [PATCH 24/63] catimg: don't change our build-type

---
 srcpkgs/catimg/patches/fix-cflags.patch | 12 ++++++++++++
 srcpkgs/catimg/template                 |  2 +-
 2 files changed, 13 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/catimg/patches/fix-cflags.patch

diff --git a/srcpkgs/catimg/patches/fix-cflags.patch b/srcpkgs/catimg/patches/fix-cflags.patch
new file mode 100644
index 000000000000..9b9f1074ef20
--- /dev/null
+++ b/srcpkgs/catimg/patches/fix-cflags.patch
@@ -0,0 +1,12 @@
+Index: catimg-2.7.0/CMakeLists.txt
+===================================================================
+--- catimg-2.7.0.orig/CMakeLists.txt
++++ catimg-2.7.0/CMakeLists.txt
+@@ -11,7 +11,6 @@ endif()
+ #set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wall -Wextra -g -std=c99 -Wno-unused-result")
+ #set(CMAKE_BUILD_TYPE Debug)
+ set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -Wall -Wextra -Os -std=c99 -Wno-unused-result")
+-set(CMAKE_BUILD_TYPE Release)
+ 
+ set(SRC ${PROJECT_SOURCE_DIR}/src)
+ 
diff --git a/srcpkgs/catimg/template b/srcpkgs/catimg/template
index 374351c45379..6fbc5f1d9140 100644
--- a/srcpkgs/catimg/template
+++ b/srcpkgs/catimg/template
@@ -9,7 +9,7 @@ license="MIT"
 homepage="https://github.com/posva/catimg"
 distfiles="https://github.com/posva/catimg/archive/${version}.tar.gz"
 checksum=3a6450316ff62fb07c3facb47ea208bf98f62abd02783e88c56f2a6508035139
-
+patch_args=-Np1
 CFLAGS="-fcommon"
 
 post_install() {

From 005521962975a2d84fb6f06dd7ad78e880664e55 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: Fri, 26 Mar 2021 09:09:37 +0700
Subject: [PATCH 25/63] libcotp: fix build flags

---
 srcpkgs/libcotp/patches/fix-cflags.patch | 14 ++++++++++++++
 srcpkgs/libcotp/template                 |  1 +
 2 files changed, 15 insertions(+)
 create mode 100644 srcpkgs/libcotp/patches/fix-cflags.patch

diff --git a/srcpkgs/libcotp/patches/fix-cflags.patch b/srcpkgs/libcotp/patches/fix-cflags.patch
new file mode 100644
index 000000000000..397b3960e9f4
--- /dev/null
+++ b/srcpkgs/libcotp/patches/fix-cflags.patch
@@ -0,0 +1,14 @@
+Index: libcotp-1.2.2/CMakeLists.txt
+===================================================================
+--- libcotp-1.2.2.orig/CMakeLists.txt
++++ libcotp-1.2.2/CMakeLists.txt
+@@ -25,8 +25,7 @@ set(CMAKE_C_STANDARD 11)
+ set(COTP_HEADERS src/cotp.h)
+ set(SOURCE_FILES src/otp.c)
+ 
+-set(CMAKE_C_FLAGS "-Wall -Wextra -O3 -Wno-format-truncation -fstack-protector-strong -fPIC")
+-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3")
++set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wno-format-truncation -fstack-protector-strong -fPIC")
+ 
+ add_library(cotp SHARED ${SOURCE_FILES})
+ 
diff --git a/srcpkgs/libcotp/template b/srcpkgs/libcotp/template
index 9e147ff7deb6..88337290d1e8 100644
--- a/srcpkgs/libcotp/template
+++ b/srcpkgs/libcotp/template
@@ -11,6 +11,7 @@ license="Apache-2.0"
 homepage="https://github.com/paolostivanin/libcotp"
 distfiles="https://github.com/paolostivanin/libcotp/archive/v${version}.tar.gz"
 checksum=25b45ffa4aece5cc689503ebea7356a2f760c194f0c41805934495d2fe7165b1
+patch_args=-Np1
 
 libcotp-devel_package() {
 	depends="libcotp-${version}_${revision}"

From da11b324d4749315715004b736e388a5a23e047f 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: Fri, 26 Mar 2021 21:06:07 +0700
Subject: [PATCH 26/63] loudgain: hardening

---
 srcpkgs/loudgain/patches/fix-cflags.patch | 20 ++++++++++++++++++++
 srcpkgs/loudgain/template                 |  3 ++-
 2 files changed, 22 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/loudgain/patches/fix-cflags.patch

diff --git a/srcpkgs/loudgain/patches/fix-cflags.patch b/srcpkgs/loudgain/patches/fix-cflags.patch
new file mode 100644
index 000000000000..25b2c969bef4
--- /dev/null
+++ b/srcpkgs/loudgain/patches/fix-cflags.patch
@@ -0,0 +1,20 @@
+Index: loudgain-0.6.8/CMakeLists.txt
+===================================================================
+--- loudgain-0.6.8.orig/CMakeLists.txt
++++ loudgain-0.6.8/CMakeLists.txt
+@@ -69,12 +69,12 @@ TARGET_LINK_LIBRARIES(loudgain
+ )
+ 
+ SET_TARGET_PROPERTIES(loudgain PROPERTIES
+-  COMPILE_FLAGS "-Wall -pedantic -g"
++  COMPILE_FLAGS "-Wall -pedantic"
+ )
+ 
+-SET(CMAKE_C_FLAGS "-std=gnu99 -D_GNU_SOURCE")
++SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99 -D_GNU_SOURCE")
+ 
+-SET(CMAKE_CXX_FLAGS "-std=gnu++11 -D_GNU_SOURCE")
++SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11 -D_GNU_SOURCE")
+ 
+ INSTALL(TARGETS loudgain DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
+ 
diff --git a/srcpkgs/loudgain/template b/srcpkgs/loudgain/template
index f29167883439..00b2d20d27d6 100644
--- a/srcpkgs/loudgain/template
+++ b/srcpkgs/loudgain/template
@@ -1,7 +1,7 @@
 # Template file for 'loudgain'
 pkgname=loudgain
 version=0.6.8
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="pkg-config"
 makedepends="libebur128-devel taglib-devel ffmpeg-devel"
@@ -11,6 +11,7 @@ license="BSD-2-Clause"
 homepage="https://github.com/Moonbase59/loudgain"
 distfiles="https://github.com/Moonbase59/loudgain/archive/v${version}.tar.gz"
 checksum=1137c193ad941b366e87c5d84ccc95a7aa8571affc060db0bd1cf72c489aeaee
+patch_args=-Np1
 
 post_install() {
 	vlicense COPYING

From 4b6845dcbf28b5e176f7f97aaa7f544a4addfe2f 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: Fri, 26 Mar 2021 21:20:13 +0700
Subject: [PATCH 27/63] msg2: hardening

---
 srcpkgs/msg2/patches/fix-cflags.patch | 13 +++++++++++++
 srcpkgs/msg2/template                 |  2 +-
 2 files changed, 14 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/msg2/patches/fix-cflags.patch

diff --git a/srcpkgs/msg2/patches/fix-cflags.patch b/srcpkgs/msg2/patches/fix-cflags.patch
new file mode 100644
index 000000000000..64404bf44fcb
--- /dev/null
+++ b/srcpkgs/msg2/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -3,7 +3,7 @@ project(msg2)
+ 
+ # Flags
+ set(CMAKE_CXX_STANDARD 17)
+-set(CMAKE_CXX_FLAGS "-Os -pipe -fPIC -fno-plt -fstack-protector-strong -Wall -Wshadow -pedantic -Wno-parentheses -Wfatal-errors")
++set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pipe -fPIC -fno-plt -fstack-protector-strong -Wall -Wshadow -pedantic -Wno-parentheses -Wfatal-errors")
+ 
+ # Add source files
+ add_executable(msg2 main.cpp)
diff --git a/srcpkgs/msg2/template b/srcpkgs/msg2/template
index b4f77400bf22..473b3c4ec4d2 100644
--- a/srcpkgs/msg2/template
+++ b/srcpkgs/msg2/template
@@ -1,7 +1,7 @@
 # Template file for 'msg2'
 pkgname=msg2
 version=1.2.0
-revision=1
+revision=2
 build_style=cmake
 short_desc="Output a blue arrow and a white message on the commandline"
 maintainer="Orphaned <orphan@voidlinux.org>"

From 457a79489dbd1dcfd542173c1c8cd7713c4261ff 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: Fri, 26 Mar 2021 21:22:55 +0700
Subject: [PATCH 28/63] ippusbxd: fix cflags -O2 not -o2

---
 srcpkgs/ippusbxd/patches/fix-cflags.patch | 12 ++++++++++++
 srcpkgs/ippusbxd/template                 |  2 +-
 2 files changed, 13 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/ippusbxd/patches/fix-cflags.patch

diff --git a/srcpkgs/ippusbxd/patches/fix-cflags.patch b/srcpkgs/ippusbxd/patches/fix-cflags.patch
new file mode 100644
index 000000000000..5d36903c3ffd
--- /dev/null
+++ b/srcpkgs/ippusbxd/patches/fix-cflags.patch
@@ -0,0 +1,12 @@
+Index: src/CMakeLists.txt
+===================================================================
+--- src/CMakeLists.txt.orig
++++ src/CMakeLists.txt
+@@ -1,6 +1,6 @@
+ cmake_minimum_required(VERSION 2.6)
+ project(ippusbxd)
+-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -o2 -g -std=c99 -Wall -Wextra -pedantic -pedantic-errors")
++set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -Wall -Wextra -pedantic -pedantic-errors")
+ 
+ 
+ # Compiler specific configuration
diff --git a/srcpkgs/ippusbxd/template b/srcpkgs/ippusbxd/template
index ce4ff2ea9125..e81064e8b91d 100644
--- a/srcpkgs/ippusbxd/template
+++ b/srcpkgs/ippusbxd/template
@@ -1,7 +1,7 @@
 # Template file for 'ippusbxd'
 pkgname=ippusbxd
 version=1.34
-revision=1
+revision=2
 build_wrksrc=src
 build_style=cmake
 make_cmd=make

From bb14166e1919c364b2946af9cb93288bc461a9de 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: Fri, 26 Mar 2021 21:34:52 +0700
Subject: [PATCH 29/63] tlsh: respect -g + hardening

---
 srcpkgs/tlsh/patches/fix-cflags.patch | 13 +++++++++++++
 srcpkgs/tlsh/template                 |  2 +-
 2 files changed, 14 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/tlsh/patches/fix-cflags.patch

diff --git a/srcpkgs/tlsh/patches/fix-cflags.patch b/srcpkgs/tlsh/patches/fix-cflags.patch
new file mode 100644
index 000000000000..8715563715c7
--- /dev/null
+++ b/srcpkgs/tlsh/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -125,7 +125,7 @@ if (CMAKE_BUILD_TYPE STREQUAL Debug)
+     endif()
+ else(CMAKE_BUILD_TYPE STREQUAL Debug)
+     if(CMAKE_COMPILER_IS_GNUCXX)
+-        set(CMAKE_CXX_FLAGS "-O2 -fvisibility=internal")  ## Remove TlshImpl symbols
++        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=internal")  ## Remove TlshImpl symbols
+     endif()
+     if(MSVC)
+         set(CMAKE_CXX_FLAGS "/O2")        ## Optimize
diff --git a/srcpkgs/tlsh/template b/srcpkgs/tlsh/template
index 1f96834107cc..4ee1ccdc728a 100644
--- a/srcpkgs/tlsh/template
+++ b/srcpkgs/tlsh/template
@@ -1,7 +1,7 @@
 # Template file for 'tlsh'
 pkgname=tlsh
 version=3.19.1
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="python3"
 makedepends="python3-devel"

From e09265b35754118cdb93949016df844bf4d5fc36 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: Fri, 26 Mar 2021 21:59:06 +0700
Subject: [PATCH 30/63] poppler: hardening + respect -g

---
 srcpkgs/poppler/patches/fix-cflags.patch | 21 +++++++++++++++++++++
 srcpkgs/poppler/template                 |  2 +-
 2 files changed, 22 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/poppler/patches/fix-cflags.patch

diff --git a/srcpkgs/poppler/patches/fix-cflags.patch b/srcpkgs/poppler/patches/fix-cflags.patch
new file mode 100644
index 000000000000..9e62b11010ba
--- /dev/null
+++ b/srcpkgs/poppler/patches/fix-cflags.patch
@@ -0,0 +1,21 @@
+Index: cmake/modules/PopplerMacros.cmake
+===================================================================
+--- cmake/modules/PopplerMacros.cmake.orig
++++ cmake/modules/PopplerMacros.cmake
+@@ -123,14 +123,14 @@ if(CMAKE_COMPILER_IS_GNUCXX)
+   set(DEFAULT_COMPILE_WARNINGS_EXTRA "${_warn} ${_warnx}")
+ 
+   set(_save_cxxflags "${CMAKE_CXX_FLAGS}")
+-  set(CMAKE_CXX_FLAGS                "-fno-exceptions -fno-check-new -fno-common -D_DEFAULT_SOURCE")
++  set(CMAKE_CXX_FLAGS                "-fno-exceptions -fno-check-new -fno-common -D_DEFAULT_SOURCE ${_save_cxxflags}")
+   set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g ${_save_cxxflags}")
+   set(CMAKE_CXX_FLAGS_RELEASE        "-O2 -DNDEBUG ${_save_cxxflags}")
+   set(CMAKE_CXX_FLAGS_DEBUG          "-g -O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline ${_save_cxxflags}")
+   set(CMAKE_CXX_FLAGS_DEBUGFULL      "-g3 -fno-inline ${_save_cxxflags}")
+   set(CMAKE_CXX_FLAGS_PROFILE        "-g3 -fno-inline -ftest-coverage -fprofile-arcs ${_save_cxxflags}")
+   set(_save_cflags "${CMAKE_C_FLAGS}")
+-  set(CMAKE_C_FLAGS                  "-std=c99 -D_DEFAULT_SOURCE")
++  set(CMAKE_C_FLAGS                  "-std=c99 -D_DEFAULT_SOURCE ${_save_cflags}")
+   set(CMAKE_C_FLAGS_RELWITHDEBINFO   "-O2 -g ${_save_cflags}")
+   set(CMAKE_C_FLAGS_RELEASE          "-O2 -DNDEBUG ${_save_cflags}")
+   set(CMAKE_C_FLAGS_DEBUG            "-g -O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline ${_save_cflags}")
diff --git a/srcpkgs/poppler/template b/srcpkgs/poppler/template
index ed0db8de7ab6..1aebd7f7e177 100644
--- a/srcpkgs/poppler/template
+++ b/srcpkgs/poppler/template
@@ -4,7 +4,7 @@
 #
 pkgname=poppler
 version=20.09.0
-revision=2
+revision=3
 build_style=cmake
 build_helper="gir"
 configure_args="-DENABLE_UNSTABLE_API_ABI_HEADERS=ON -DENABLE_CPP=ON

From be4521f6c282b750024d014245c6090e55046414 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: Fri, 26 Mar 2021 21:59:29 +0700
Subject: [PATCH 31/63] poppler-qt5: hardening + respect -g

---
 srcpkgs/poppler-qt5/patches  | 1 +
 srcpkgs/poppler-qt5/template | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)
 create mode 120000 srcpkgs/poppler-qt5/patches

diff --git a/srcpkgs/poppler-qt5/patches b/srcpkgs/poppler-qt5/patches
new file mode 120000
index 000000000000..636e4ac2cbd9
--- /dev/null
+++ b/srcpkgs/poppler-qt5/patches
@@ -0,0 +1 @@
+../poppler/patches
\ No newline at end of file
diff --git a/srcpkgs/poppler-qt5/template b/srcpkgs/poppler-qt5/template
index 0dc45c05c58b..c2ec35dbbad3 100644
--- a/srcpkgs/poppler-qt5/template
+++ b/srcpkgs/poppler-qt5/template
@@ -5,7 +5,7 @@
 #
 pkgname=poppler-qt5
 version=20.09.0
-revision=1
+revision=2
 wrksrc="poppler-${version}"
 build_style=cmake
 configure_args="-DENABLE_UNSTABLE_API_ABI_HEADERS=ON -DENABLE_GLIB=OFF

From 23d40858f9429e41cc153852cd8cda6f2b43e807 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: Sat, 27 Mar 2021 11:17:35 +0700
Subject: [PATCH 32/63] artyfx: remove -O1 -g

---
 srcpkgs/artyfx/patches/fix-avtk-cmake-sse.patch | 4 ++--
 srcpkgs/artyfx/patches/respect-our-cflags.patch | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/artyfx/patches/fix-avtk-cmake-sse.patch b/srcpkgs/artyfx/patches/fix-avtk-cmake-sse.patch
index 1a832155a566..47ef4dd9b84e 100644
--- a/srcpkgs/artyfx/patches/fix-avtk-cmake-sse.patch
+++ b/srcpkgs/artyfx/patches/fix-avtk-cmake-sse.patch
@@ -6,8 +6,8 @@
  
 -SET(CMAKE_C_FLAGS   "-fPIC -msse -msse2 -mfpmath=sse -g") # -fsanitize=address
 -SET(CMAKE_CXX_FLAGS "-fPIC -msse -msse2 -mfpmath=sse -g") # -fsanitize=address
-+SET(CMAKE_C_FLAGS   "${CMAKE_C_FLAGS} -fPIC -g") # -fsanitize=address
-+SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -g") # -fsanitize=address
++SET(CMAKE_C_FLAGS   "${CMAKE_C_FLAGS} -fPIC") # -fsanitize=address
++SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") # -fsanitize=address
 +
 +IF(BUILD_SSE)
 +	SET(CMAKE_C_FLAGS   "${CMAKE_C_FLAGS} -msse -msse2 -mfpmath=sse")
diff --git a/srcpkgs/artyfx/patches/respect-our-cflags.patch b/srcpkgs/artyfx/patches/respect-our-cflags.patch
index ee9155c7729e..7a32fd9df73b 100644
--- a/srcpkgs/artyfx/patches/respect-our-cflags.patch
+++ b/srcpkgs/artyfx/patches/respect-our-cflags.patch
@@ -10,8 +10,8 @@ Index: CMakeLists.txt
 -SET(CMAKE_C_FLAGS "-g -Wall -O1 -Wno-unused-variable")
 -SET(CMAKE_CXX_FLAGS "-g -Wall -O1 -Wno-unused-variable -ftree-vectorize")
 +SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fPIC -shared -L./src/avtk -Wl,--no-undefined")
-+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -Wall -O1 -Wno-unused-variable")
-+SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -Wall -O1 -Wno-unused-variable -ftree-vectorize")
++SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall  -Wno-unused-variable")
++SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall  -Wno-unused-variable -ftree-vectorize")
  
  
  # DSP sources

From 1cec1a24c86d14d6194fecac4dabb27140779f7c 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: Sat, 27 Mar 2021 11:27:28 +0700
Subject: [PATCH 33/63] coin3: build with CMAKE_BUILD_TYPE=None

---
 srcpkgs/coin3/template | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/coin3/template b/srcpkgs/coin3/template
index d5483ee048c3..8f7218c2e8c3 100644
--- a/srcpkgs/coin3/template
+++ b/srcpkgs/coin3/template
@@ -5,7 +5,7 @@ revision=1
 wrksrc="coin-Coin-${version}"
 build_style=cmake
 configure_args="-DCMAKE_INSTALL_INCLUDEDIR=/usr/include/Coin3
- -DCMAKE_BUILD_TYPE=Release -DCOIN_BUILD_TESTS=OFF -DCOIN_BUILD_DOCUMENTATION=ON"
+ -DCOIN_BUILD_TESTS=OFF -DCOIN_BUILD_DOCUMENTATION=ON"
 hostmakedepends="doxygen graphviz"
 makedepends="boost-devel glu-devel"
 short_desc="High-level 3D graphics toolkit"
@@ -15,6 +15,9 @@ homepage="https://coin3d.github.io/"
 distfiles="https://github.com/coin3d/coin/archive/Coin-${version}.tar.gz"
 checksum=b00d2a8e9d962397cf9bf0d9baa81bcecfbd16eef675a98c792f5cf49eb6e805
 
+CFLAGS=-DNDEBUG
+CXXFLAGS=-DNDEBUG
+
 if [ "$CROSS_BUILD" ]; then
 	# bypass runtime test (quote hashing is fine with gcc 9.3)
 	configure_args+=" -DHAVE_HASH_QUOTING_EXITCODE=0"

From 88fa5991500f881b15ee77e78f14333b67311f32 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: Sat, 27 Mar 2021 11:46:46 +0700
Subject: [PATCH 34/63] conky: don't overwrite CMAKE_BUILD_TYPE

---
 srcpkgs/conky/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/conky/template b/srcpkgs/conky/template
index 8b95a628edfb..f05c7d4a1bf2 100644
--- a/srcpkgs/conky/template
+++ b/srcpkgs/conky/template
@@ -5,7 +5,7 @@ version=1.12.1
 revision=1
 build_style=cmake
 conf_files="/etc/conky/conky.conf /etc/conky/conky_no_x11.conf"
-configure_args="-DCMAKE_BUILD_TYPE=Release -DMAINTAINER_MODE=ON -DRELEASE=ON
+configure_args="-DMAINTAINER_MODE=ON -DRELEASE=ON
  -DDOC_PATH=share/doc/${pkgname} -DBUILD_X11=ON -DBUILD_CURL=ON -DBUILD_XDBE=ON
  -DBUILD_RSS=ON -DBUILD_WEATHER_METAR=ON -DBUILD_IMLIB2=ON -DBUILD_WLAN=ON
  -DBUILD_LUA_CAIRO=ON -DBUILD_LUA_IMLIB2=ON -DBUILD_LUA_RSVG=ON

From 75c1e8299f518b88a1d63ed834151a4fc2de4e72 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: Sat, 27 Mar 2021 11:46:46 +0700
Subject: [PATCH 35/63] conky-cli: don't overwrite CMAKE_BUILD_TYPE

---
 srcpkgs/conky-cli/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/conky-cli/template b/srcpkgs/conky-cli/template
index b61bdcca0504..7d512b65ab3e 100644
--- a/srcpkgs/conky-cli/template
+++ b/srcpkgs/conky-cli/template
@@ -6,7 +6,7 @@ revision=1
 wrksrc="${pkgname/-cli/}-${version}"
 build_style=cmake
 conf_files="/etc/conky/conky.conf /etc/conky/conky_no_x11.conf"
-configure_args="-DCMAKE_BUILD_TYPE=Release -DMAINTAINER_MODE=ON -DRELEASE=ON
+configure_args="-DMAINTAINER_MODE=ON -DRELEASE=ON
  -DDOC_PATH=share/doc/${pkgname} -DBUILD_X11=OFF -DBUILD_CURL=ON -DBUILD_XDBE=OFF
  -DBUILD_RSS=ON -DBUILD_WEATHER_METAR=OFF -DBUILD_IMLIB2=OFF -DBUILD_WLAN=ON
  -DBUILD_DOCS=ON"

From cc0e200175f02622a64771712a344ceda28eba5f 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: Sat, 27 Mar 2021 11:48:25 +0700
Subject: [PATCH 36/63] crossguid: don't overwrite -O2

---
 srcpkgs/crossguid/fix-cflags.patch | 12 ++++++++++++
 1 file changed, 12 insertions(+)
 create mode 100644 srcpkgs/crossguid/fix-cflags.patch

diff --git a/srcpkgs/crossguid/fix-cflags.patch b/srcpkgs/crossguid/fix-cflags.patch
new file mode 100644
index 000000000000..983360a07ccf
--- /dev/null
+++ b/srcpkgs/crossguid/fix-cflags.patch
@@ -0,0 +1,12 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -2,7 +2,6 @@ cmake_minimum_required(VERSION 3.5.1)
+ project(CrossGuid)
+ 
+ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake")
+-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3")
+ 
+ option(XG_TESTS "Build test runner" ON)
+ 

From 8e28fd8d35abcfed472356359e7b01ee8ae35185 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: Sat, 27 Mar 2021 12:19:04 +0700
Subject: [PATCH 37/63] rapidjson: define -DNDEBUG

---
 srcpkgs/rapidjson/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/rapidjson/template b/srcpkgs/rapidjson/template
index 8597f8fb2706..99d92702cc9d 100644
--- a/srcpkgs/rapidjson/template
+++ b/srcpkgs/rapidjson/template
@@ -11,7 +11,7 @@ distfiles="https://github.com/miloyip/${pkgname}/archive/v${version}.tar.gz"
 checksum=bf7ced29704a1e696fbccf2a2b4ea068e7774fa37f6d7dd4039d0787f8bed98e
 
 # class-memaccess is required by https://github.com/Tencent/rapidjson/issues/1700
-CXXFLAGS="-Wno-type-limits -Wno-error=class-memaccess"
+CXXFLAGS="-Wno-type-limits -Wno-error=class-memaccess -DNDEBUG"
 
 post_patch() {
 	# Remove bin/jsonchecker, which is the JSON licensed files

From b05717437742c9bd920def09755b6a385455e008 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: Sat, 27 Mar 2021 12:18:36 +0700
Subject: [PATCH 38/63] cura-engine: ignore -O3

---
 srcpkgs/cura-engine/patches/fix-cflags.patch | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 srcpkgs/cura-engine/patches/fix-cflags.patch

diff --git a/srcpkgs/cura-engine/patches/fix-cflags.patch b/srcpkgs/cura-engine/patches/fix-cflags.patch
new file mode 100644
index 000000000000..e48a665523b8
--- /dev/null
+++ b/srcpkgs/cura-engine/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -42,7 +42,7 @@ endif()
+ if(CMAKE_BUILD_TYPE_UPPER MATCHES "DEBUG")
+     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_DEBUG_INIT}")
+ else()
+-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELEASE_INIT}")
++    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DNDEBUG")
+ endif()
+ 
+ set(CMAKE_CXX_STANDARD 11)

From 7044df1f6d85a31f98b5548fc6497801a6068772 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: Sat, 27 Mar 2021 12:22:29 +0700
Subject: [PATCH 39/63] dislocker: remove -O1

---
 srcpkgs/dislocker/patches/fix-cflags.patch | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 srcpkgs/dislocker/patches/fix-cflags.patch

diff --git a/srcpkgs/dislocker/patches/fix-cflags.patch b/srcpkgs/dislocker/patches/fix-cflags.patch
new file mode 100644
index 000000000000..1229efeeaf0c
--- /dev/null
+++ b/srcpkgs/dislocker/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: src/CMakeLists.txt
+===================================================================
+--- src/CMakeLists.txt.orig
++++ src/CMakeLists.txt
+@@ -71,7 +71,7 @@ if(NOT DEFINED WARN_FLAGS)
+ 	set (WARN_FLAGS "-Wall -Wextra" CACHE STRING "" FORCE)
+ endif()
+ if(NOT DEFINED HARDEN_FLAGS)
+-	set (HARDEN_FLAGS "-fstack-protector -fstrict-aliasing -D_FORTIFY_SOURCE=2 -O1" CACHE STRING "" FORCE)
++	set (HARDEN_FLAGS "-fstack-protector -fstrict-aliasing" CACHE STRING "" FORCE)
+ endif()
+ 
+ set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")

From ed3b755b0a3a3955954a0d0e58a0be0c80c193fd 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: Sat, 27 Mar 2021 12:29:31 +0700
Subject: [PATCH 40/63] freeorion: remove -O3

---
 srcpkgs/freeorion/patches/fix-cflags.patch | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
 create mode 100644 srcpkgs/freeorion/patches/fix-cflags.patch

diff --git a/srcpkgs/freeorion/patches/fix-cflags.patch b/srcpkgs/freeorion/patches/fix-cflags.patch
new file mode 100644
index 000000000000..c66d54599556
--- /dev/null
+++ b/srcpkgs/freeorion/patches/fix-cflags.patch
@@ -0,0 +1,18 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -432,13 +432,6 @@ if(MSVC)
+     )
+ endif()
+ 
+-target_compile_options(freeorionparseobj
+-    PRIVATE
+-        $<$<CXX_COMPILER_ID:Clang>:-ftemplate-depth=512>
+-        $<$<CXX_COMPILER_ID:AppleClang>:-ftemplate-depth=512>
+-        $<$<AND:$<NOT:$<BOOL:${BUILD_TESTING}>>,$<CXX_COMPILER_ID:GNU>>:-O3>
+-)
+-
+ target_compile_definitions(freeorionparseobj
+     PUBLIC
+         -DBOOST_ALL_DYN_LINK

From da77fe33bf31fde5f6cbf1cafc23ab74a3e5d814 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: Fri, 26 Mar 2021 09:01:12 +0700
Subject: [PATCH 41/63] cglm: fix build flags

---
 srcpkgs/cglm/patches/fix-cflags.patch | 13 +++++++++++++
 srcpkgs/cglm/template                 |  1 +
 2 files changed, 14 insertions(+)
 create mode 100644 srcpkgs/cglm/patches/fix-cflags.patch

diff --git a/srcpkgs/cglm/patches/fix-cflags.patch b/srcpkgs/cglm/patches/fix-cflags.patch
new file mode 100644
index 000000000000..c74de6ea62d7
--- /dev/null
+++ b/srcpkgs/cglm/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: cglm-0.7.6/CMakeLists.txt
+===================================================================
+--- cglm-0.7.6.orig/CMakeLists.txt
++++ cglm-0.7.6/CMakeLists.txt
+@@ -25,7 +25,7 @@ if(MSVC)
+ 	add_definitions(-DNDEBUG -D_WINDOWS -D_USRDLL -DCGLM_EXPORTS -DCGLM_DLL)
+ 	add_compile_options(/W3 /Ox /Gy /Oi /TC)
+ else()
+-  add_compile_options(-Wall -Werror -O3)
++  add_compile_options(-Wall)
+ endif()
+ 
+ if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
diff --git a/srcpkgs/cglm/template b/srcpkgs/cglm/template
index f00a093edab9..311b4c79a7d3 100644
--- a/srcpkgs/cglm/template
+++ b/srcpkgs/cglm/template
@@ -9,6 +9,7 @@ license="MIT"
 homepage="https://github.com/recp/cglm"
 distfiles="https://github.com/recp/cglm/archive/v${version}.tar.gz"
 checksum=29ff8af4edc03697e36d3e6f99a80b884a80ee09d46055ce45765e5d6b2456d9
+patch_args=-Np1
 
 post_install() {
 	vlicense LICENSE

From 95e6b7370f82da6005d053fe2410740ec2ba93bb 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: Sat, 27 Mar 2021 12:36:19 +0700
Subject: [PATCH 42/63] glyr: don't force Release build

---
 srcpkgs/glyr/patches/fix-cflags.patch | 12 ++++++++++++
 1 file changed, 12 insertions(+)
 create mode 100644 srcpkgs/glyr/patches/fix-cflags.patch

diff --git a/srcpkgs/glyr/patches/fix-cflags.patch b/srcpkgs/glyr/patches/fix-cflags.patch
new file mode 100644
index 000000000000..498ffe09a38f
--- /dev/null
+++ b/srcpkgs/glyr/patches/fix-cflags.patch
@@ -0,0 +1,12 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -60,7 +60,6 @@ exec_program(
+ IF(CMAKE_BUILD_TYPE STREQUAL "debug")
+     SET(GLYR_DEBUG TRUE)
+ ELSE()
+-    SET(CMAKE_BUILD_TYPE "release")
+     SET(GLYR_DEBUG FALSE)
+ ENDIF()
+ MESSAGE("-- Building Target: ${CMAKE_BUILD_TYPE}")

From b02a7a4121837080153479ee0fdfd211421922dc 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: Sat, 27 Mar 2021 12:41:50 +0700
Subject: [PATCH 43/63] hugin: remove -O3

---
 srcpkgs/hugin/patches/fix-cflags.patch | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
 create mode 100644 srcpkgs/hugin/patches/fix-cflags.patch

diff --git a/srcpkgs/hugin/patches/fix-cflags.patch b/srcpkgs/hugin/patches/fix-cflags.patch
new file mode 100644
index 000000000000..02fa56bef0e1
--- /dev/null
+++ b/srcpkgs/hugin/patches/fix-cflags.patch
@@ -0,0 +1,15 @@
+Index: src/celeste/CMakeLists.txt
+===================================================================
+--- src/celeste/CMakeLists.txt.orig
++++ src/celeste/CMakeLists.txt
+@@ -16,10 +16,6 @@
+ #    You should have received a copy of the GNU General Public License
+ #    along with Hugin  If not, see <http://www.gnu.org/licenses/>.
+  
+-IF(NOT WIN32)
+-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3")
+-ENDIF(NOT WIN32)
+-
+ # a list of all files belonging to celeste library
+ 
+ SET(CELESTE_SRC

From 647fbd3ad7aef80016b639581ed64cf98417353a 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: Sat, 27 Mar 2021 13:05:27 +0700
Subject: [PATCH 44/63] ledger: don't overwrite CMAKE_BUILD_TYPE

---
 srcpkgs/ledger/patches/fix-cflags.patch | 12 ++++++++++++
 1 file changed, 12 insertions(+)
 create mode 100644 srcpkgs/ledger/patches/fix-cflags.patch

diff --git a/srcpkgs/ledger/patches/fix-cflags.patch b/srcpkgs/ledger/patches/fix-cflags.patch
new file mode 100644
index 000000000000..179ab79cd148
--- /dev/null
+++ b/srcpkgs/ledger/patches/fix-cflags.patch
@@ -0,0 +1,12 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -41,7 +41,6 @@ if (BUILD_DEBUG)
+   set(CMAKE_BUILD_TYPE Debug)
+   set(DEBUG_MODE 1)
+ else()
+-  set(CMAKE_BUILD_TYPE Release)
+   set(DEBUG_MODE 0)
+ endif()
+ 

From c96d5caa90ae2229c50785ef24d8c47a1d5fb034 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: Sat, 27 Mar 2021 13:18:24 +0700
Subject: [PATCH 45/63] libmygpo-qt: remove -ggdb3

---
 srcpkgs/libmygpo-qt/patches/fix-cflags.patch | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 srcpkgs/libmygpo-qt/patches/fix-cflags.patch

diff --git a/srcpkgs/libmygpo-qt/patches/fix-cflags.patch b/srcpkgs/libmygpo-qt/patches/fix-cflags.patch
new file mode 100644
index 000000000000..9940b6fc4323
--- /dev/null
+++ b/srcpkgs/libmygpo-qt/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -69,7 +69,7 @@ if (CMAKE_COMPILER_IS_GNUCXX)
+        -Wwrite-strings -Wpacked -Wformat-security -Wmissing-format-attribute
+        -Wold-style-cast -Woverloaded-virtual -Wnon-virtual-dtor  -Wall -Wextra
+        -Wformat=2 -Wundef -Wstack-protector -Wmissing-include-dirs
+-       -Winit-self -Wunsafe-loop-optimizations  -ggdb3 -fno-inline -DQT_STRICT_ITERATORS )
++       -Winit-self -Wunsafe-loop-optimizations  -fno-inline -DQT_STRICT_ITERATORS )
+     if ( NOT WIN32 )
+         add_definitions( -fvisibility=hidden )
+     endif()

From 3b9f68d2a3f1062e1b79756b08219c147f01370d 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: Sat, 27 Mar 2021 13:48:38 +0700
Subject: [PATCH 46/63] libogre: don't build vendored libraries

---
 srcpkgs/libogre/template | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/libogre/template b/srcpkgs/libogre/template
index 784e3a648bac..df60f7b4f542 100644
--- a/srcpkgs/libogre/template
+++ b/srcpkgs/libogre/template
@@ -1,25 +1,22 @@
-# Template file for 'ogre'
+# Template file for 'libogre'
 pkgname=libogre
 version=1.12.9
 revision=1
+wrksrc=ogre-$version
 build_style=cmake
-configure_args="-DCMAKE_INSTALL_PREFIX=/usr \
-	-DOGRE_INSTALL_SAMPLES=TRUE \
-	-DOGRE_INSTALL_DOCS=TRUE \
-	-DOGRE_INSTALL_SAMPLES_SOURCE=TRUE \
-	-DCMAKE_BUILD_TYPE=Release"
+configure_args="-DOGRE_INSTALL_SAMPLES=TRUE -DOGRE_INSTALL_DOCS=TRUE
+ -DOGRE_INSTALL_SAMPLES_SOURCE=TRUE -DOGRE_BUILD_DEPENDENCIES=FALSE"
+make_build_target="all OgreDoc"
 hostmakedepends="pkg-config graphviz doxygen dejavu-fonts-ttf"
 makedepends="boost-devel freetype-devel libXaw-devel libXrandr-devel
  MesaLib-devel zziplib-devel libcppunit-devel glu-devel libatomic-devel
  freeimage-devel pugixml-devel python3-devel"
 short_desc="Scene-oriented, flexible 3D engine"
 maintainer="Enno Boland <gottox@voidlinux.org>"
-homepage="http://www.ogre3d.org"
 license="MIT"
+homepage="http://www.ogre3d.org"
 distfiles="https://github.com/OGRECave/ogre/archive/v$version.tar.gz"
 checksum=028e7d0bbfce8fd254e1102666b07b7cbb9379321e88885d82feee5e061342aa
-make_build_target="all OgreDoc"
-wrksrc=ogre-$version
 
 pre_configure() {
 	if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then

From ba845229a96705c5994c795e3fac65460a165322 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: Sat, 27 Mar 2021 13:52:50 +0700
Subject: [PATCH 47/63] libopenglrecorder: remove -O3

---
 srcpkgs/libopenglrecorder/patches/fix-cflags.patch | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 srcpkgs/libopenglrecorder/patches/fix-cflags.patch

diff --git a/srcpkgs/libopenglrecorder/patches/fix-cflags.patch b/srcpkgs/libopenglrecorder/patches/fix-cflags.patch
new file mode 100644
index 000000000000..7c48a0d2d822
--- /dev/null
+++ b/srcpkgs/libopenglrecorder/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -21,7 +21,7 @@ if (UNIX OR MINGW)
+     if (CMAKE_BUILD_TYPE MATCHES Debug)
+         add_definitions(-std=gnu++0x -O0)
+     else()
+-        add_definitions(-std=gnu++0x -O3)
++        add_definitions(-std=gnu++0x)
+     endif()
+ endif()
+ 

From 957eb74a1260eff19133a5a1cd9ce023a14ef308 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: Sat, 27 Mar 2021 13:55:41 +0700
Subject: [PATCH 48/63] libvidstab: remove -O3

---
 srcpkgs/libvidstab/patches/fix-cflags.patch | 39 +++++++++++++++++++++
 1 file changed, 39 insertions(+)
 create mode 100644 srcpkgs/libvidstab/patches/fix-cflags.patch

diff --git a/srcpkgs/libvidstab/patches/fix-cflags.patch b/srcpkgs/libvidstab/patches/fix-cflags.patch
new file mode 100644
index 000000000000..51c357efb101
--- /dev/null
+++ b/srcpkgs/libvidstab/patches/fix-cflags.patch
@@ -0,0 +1,39 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -25,7 +25,7 @@ else()
+     set(LIBSUFFIX "")
+ endif()
+ 
+-add_definitions( -Wall -O3 -g -Wno-pointer-sign -fPIC -std=gnu99)
++add_definitions( -Wall -Wno-pointer-sign -fPIC -std=gnu99)
+ # add_definitions(  -Wall -O0 -g -Wno-pointer-sign )
+ 
+ ### ORC is not used in any active code at the moment  ###
+Index: tests/CMakeLists.txt
+===================================================================
+--- tests/CMakeLists.txt.orig
++++ tests/CMakeLists.txt
+@@ -11,7 +11,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PAT
+ option(USE_OMP "use parallelization use OMP" ON)
+ 
+ #add_definitions( -Wall -O3 -Wno-pointer-sign -DTESTING  -std=gnu99)
+-add_definitions(  -Wall -O0 -g -Wno-pointer-sign -DTESTING -std=gnu99)
++add_definitions(  -Wall -Wno-pointer-sign -DTESTING -std=gnu99)
+ find_package(Orc)
+ if(ORC_FOUND)
+ add_definitions( -DUSE_ORC ${ORC_DEFINITIONS})
+Index: transcode/CMakeLists.txt
+===================================================================
+--- transcode/CMakeLists.txt.orig
++++ transcode/CMakeLists.txt
+@@ -9,7 +9,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PAT
+ set(TRANSCODE_ROOT ../../transcode)
+ 
+ 
+-add_definitions( -Wall -O3 -Wno-pointer-sign -DTRANSCODE -std=gnu99)
++add_definitions( -Wall -Wno-pointer-sign -DTRANSCODE -std=gnu99)
+ #add_definitions(  -Wall -O0 -g -Wno-pointer-sign )
+ # I tried it with 0.4.14
+ #  0.4.10 did not work (not all opcode implemented)

From b6dbaf31f446d08a9dae63841d0613c5027d2413 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: Sat, 27 Mar 2021 14:18:34 +0700
Subject: [PATCH 49/63] openlierox: don't overwrote CMAKE_BUILD_TYPE

---
 srcpkgs/openlierox/patches/fix-cflags.patch | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
 create mode 100644 srcpkgs/openlierox/patches/fix-cflags.patch

diff --git a/srcpkgs/openlierox/patches/fix-cflags.patch b/srcpkgs/openlierox/patches/fix-cflags.patch
new file mode 100644
index 000000000000..4fe6652fd0a2
--- /dev/null
+++ b/srcpkgs/openlierox/patches/fix-cflags.patch
@@ -0,0 +1,17 @@
+Index: CMakeOlxCommon.cmake
+===================================================================
+--- CMakeOlxCommon.cmake.orig
++++ CMakeOlxCommon.cmake
+@@ -36,12 +36,6 @@ OPTION(BREAKPAD "Google Breakpad support
+ OPTION(DISABLE_JOYSTICK "Disable joystick support" No)
+ OPTION(MINGW_CROSS_COMPILE "Cross-compile Windows .EXE using i686-w64-mingw32-gcc compiler" No)
+ 
+-IF (DEBUG)
+-	SET(CMAKE_BUILD_TYPE Debug)
+-ELSE (DEBUG)
+-	SET(CMAKE_BUILD_TYPE Release)
+-ENDIF (DEBUG)
+-
+ IF (DEDICATED_ONLY)
+ 	SET(X11 No)
+ 	SET(WITH_G15 No)

From 76a7cc0c06bf4dac183d84c910a26efe00b3cc4a 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: Sat, 27 Mar 2021 14:25:12 +0700
Subject: [PATCH 50/63] opensonic: don't overwrite CMAKE_BUILD_TYPE

---
 srcpkgs/opensonic/patches/fix-cflags.patch | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
 create mode 100644 srcpkgs/opensonic/patches/fix-cflags.patch

diff --git a/srcpkgs/opensonic/patches/fix-cflags.patch b/srcpkgs/opensonic/patches/fix-cflags.patch
new file mode 100644
index 000000000000..10d2c7c80e64
--- /dev/null
+++ b/srcpkgs/opensonic/patches/fix-cflags.patch
@@ -0,0 +1,17 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -25,12 +25,10 @@ SET(GAME_NAME "Open Sonic")
+ SET(GAME_VERSION "0.1.4")
+ SET(RTFM "Please read the user manual (readme.html) to get help.")
+ SET(ALLEGRO_RECOMMENDED_VERSION "4.4.1")
+-SET(CMAKE_BUILD_TYPE Release)
+ MESSAGE("${GAME_NAME} version ${GAME_VERSION}")
+ 
+ # configuring...
+ SET(DEFS "")
+-SET(CFLAGS_EXTRA "-g")
+ SET(CFLAGS "${CFLAGS} ${CMAKE_C_FLAGS}")
+ MESSAGE("Using CFLAGS='${CFLAGS}'")
+ 

From 6cb159084add16a4ab3ff27d754500e736f07ffe 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: Sat, 27 Mar 2021 15:17:28 +0700
Subject: [PATCH 51/63] rocksdb: don't overwrite CMAKE_BUILD_TYPE

---
 srcpkgs/rocksdb/template | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/rocksdb/template b/srcpkgs/rocksdb/template
index e39329e5d6a6..2ae7db40ab91 100644
--- a/srcpkgs/rocksdb/template
+++ b/srcpkgs/rocksdb/template
@@ -3,15 +3,16 @@ pkgname=rocksdb
 version=5.18.3
 revision=2
 build_style=cmake
-configure_args="-DCMAKE_BUILD_TYPE=Release -DPORTABLE=1 -DWITH_TESTS=0
- -DUSE_RTTI=0 -DWITH_LZ4=1"
+configure_args="-DPORTABLE=1 -DWITH_TESTS=0 -DUSE_RTTI=0 -DWITH_LZ4=1"
 makedepends="liblz4-devel"
 short_desc="RocksDB is a embeddable, persistent key-value store for fast storage"
 maintainer="magenbluten <mb0@codemonkey.cc>"
-license="GPL-2.0-or-later, Apache-2.0"
+license="GPL-2.0-or-later, Apache-2.0, BSD-3-Clause"
 homepage="https://github.com/facebook/rocksdb"
 distfiles="${homepage}/archive/v${version}.tar.gz"
 checksum=7fb6738263d3f2b360d7468cf2ebe333f3109f3ba1ff80115abd145d75287254
+CFLAGS=-DNDEBUG
+CXXFLAGS=-DNDEBUG
 
 if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
 	makedepends+=" libatomic-devel"

From 64f609b09e33b80049e20a93f821ca965adb43a0 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: Sat, 27 Mar 2021 15:40:26 +0700
Subject: [PATCH 52/63] seexpr-krita: don't overwrite CMAKE_BUILD_TYPE

---
 .../patches/cmake-build-type-none.patch       | 32 +++++++++++++++++++
 1 file changed, 32 insertions(+)
 create mode 100644 srcpkgs/seexpr-krita/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/seexpr-krita/patches/cmake-build-type-none.patch b/srcpkgs/seexpr-krita/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..94bb1f37db75
--- /dev/null
+++ b/srcpkgs/seexpr-krita/patches/cmake-build-type-none.patch
@@ -0,0 +1,32 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -42,14 +42,6 @@ endif()
+ 
+ ## Choose build options
+ # Disney specific method of choosing variant
+-if (${FLAVOR} STREQUAL "optimize")
+-    set(CMAKE_BUILD_TYPE "Release" CACHE STRING "type of build" FORCE)
+-endif()
+-
+-if (${FLAVOR} STREQUAL "debug")
+-    set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "type of build" FORCE)
+-endif()
+-
+ if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
+     execute_process(
+         COMMAND sh -c "echo `uname -s`-`uname -r | cut -d- -f1`-`uname -m`"
+@@ -212,12 +204,6 @@ else()
+ endif()
+ 
+ # Set to release if nothing else defined
+-if (NOT CMAKE_BUILD_TYPE)
+-  set(CMAKE_BUILD_TYPE "Release" CACHE STRING
+-      "Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel."
+-      FORCE)
+-endif()
+-
+ if (ENABLE_QT5)
+     find_package(Qt5 5.9.0 COMPONENTS Core Gui Widgets REQUIRED)
+     set_package_properties(Qt5 PROPERTIES

From 5cca94248ae372068f7e0672e9a1cbcbd9f2ca74 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: Sat, 27 Mar 2021 15:50:53 +0700
Subject: [PATCH 53/63] speed-dreams: hardening

---
 srcpkgs/speed-dreams/template | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/speed-dreams/template b/srcpkgs/speed-dreams/template
index 722f0c5ed87a..df7164f9c808 100644
--- a/srcpkgs/speed-dreams/template
+++ b/srcpkgs/speed-dreams/template
@@ -1,13 +1,13 @@
 # Template file for 'speed-dreams'
 pkgname=speed-dreams
 version=2.2.2
-revision=2
+revision=3
 archs="i686* x86_64* ppc64le*"
 _rev=r6553
 create_wrksrc=yes
 build_style=cmake
-configure_args="-DSD_BINDIR=/usr/bin -DSD_DATADIR=/usr/share/speed-dreams-2 -DSD_LIBDIR=/usr/lib/speed-dreams-2
- -DOPTION_OFFICIAL_ONLY=ON -DCMAKE_CXX_FLAGS=-fpermissive -DCMAKE_C_FLAGS=-fpermissive"
+configure_args="-DSD_BINDIR=/usr/bin -DSD_DATADIR=/usr/share/speed-dreams-2
+ -DSD_LIBDIR=/usr/lib/speed-dreams-2 -DOPTION_OFFICIAL_ONLY=ON"
 hostmakedepends="pkg-config"
 makedepends="freealut-devel libenet-devel libfreeglut-devel libjpeg-turbo-devel
  libpng-devel libvorbis-devel libXrandr-devel osg-devel plib-devel SDL2-devel
@@ -26,6 +26,8 @@ checksum="32aa55c17f8dafc1c54fb0d0b7b993d2688d431899cfc5db9eeece148c6887d0
  0b7b417d007ab3b7f0f4dcfdc868aafee1722150b81af519e1cd4c082b408183"
 nocross=yes
 replaces="speed-dreams-data>=0"
+CFLAGS=-fpermissive
+CXXFLAGS=-fpermissive
 
 if [ "$XBPS_TARGET_LIBC" = musl ]; then
 	broken="Segmentation fault"

From 33c241063bc436ab6632f465f404578f5810d795 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: Sat, 27 Mar 2021 19:04:09 +0700
Subject: [PATCH 54/63] traverso: hardening

---
 .../patches/cmake-build-type-none.patch       | 28 +++++++++++++++++++
 srcpkgs/traverso/template                     |  2 +-
 2 files changed, 29 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/traverso/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/traverso/patches/cmake-build-type-none.patch b/srcpkgs/traverso/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..75b3fd941eb8
--- /dev/null
+++ b/srcpkgs/traverso/patches/cmake-build-type-none.patch
@@ -0,0 +1,28 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -65,13 +65,7 @@ SET(TRAVERSO_DEFINES -DSTATIC_BUILD)
+ 
+ #BUILD SETUP
+ #None, Debug, Release, .. or custom ones
+-IF(WANT_DEBUG)
+-  SET(CMAKE_BUILD_TYPE DEBUG)
+-  SET(WANT_TRAVERSO_DEBUG ON)
+-ELSE(WANT_DEBUG)
+-  SET(CMAKE_BUILD_TYPE RELEASE)
+-  LIST(APPEND TRAVERSO_DEFINES -DQT_NO_DEBUG)
+-ENDIF(WANT_DEBUG)
++LIST(APPEND TRAVERSO_DEFINES -DQT_NO_DEBUG)
+ 
+ 
+ IF(WANT_TRAVERSO_DEBUG)
+@@ -326,7 +320,7 @@ ${Qt5Xml_INCLUDE_DIRS}
+ ${Qt5Xml_INCLUDES}
+ )
+ 
+-set(CMAKE_CXX_FLAGS "-fPIC")
++set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
+ 
+ #Set up libraries to link with all found packages
+ LINK_LIBRARIES (
diff --git a/srcpkgs/traverso/template b/srcpkgs/traverso/template
index 105924d4f0c6..4b93460f63d7 100644
--- a/srcpkgs/traverso/template
+++ b/srcpkgs/traverso/template
@@ -1,7 +1,7 @@
 # Template file for 'traverso'
 pkgname=traverso
 version=0.49.6
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DWANT_MP3_ENCODE=ON -DDETECT_HOST_CPU_FEATURES=OFF"
 hostmakedepends="pkg-config qt5-qmake qt5-host-tools"

From 32b1ef338340e12d47c21ee70c58406e7a4d0911 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: Sat, 27 Mar 2021 19:08:11 +0700
Subject: [PATCH 55/63] xstarter: hardening

---
 .../patches/cmake-build-type-none.patch       | 22 +++++++++++++++++++
 srcpkgs/xstarter/template                     |  2 +-
 2 files changed, 23 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/xstarter/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/xstarter/patches/cmake-build-type-none.patch b/srcpkgs/xstarter/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..4f793e4c473c
--- /dev/null
+++ b/srcpkgs/xstarter/patches/cmake-build-type-none.patch
@@ -0,0 +1,22 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -5,16 +5,8 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
+ 
+ project(xstarter)
+ 
+-if(NOT CMAKE_BUILD_TYPE)
+-  set(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build (Debug or Release)" FORCE)
+-endif()
+-
+ set(PROJECT_VERSION "0.8.0")
+-if (CMAKE_BUILD_TYPE STREQUAL Debug)
+-  set(CMAKE_C_FLAGS "-g -Wall -pedantic")
+-else()
+-  set(CMAKE_C_FLAGS "-Wall -pedantic -O3")
+-endif()
++set(CMAKE_C_FLAGS "-Wall -pedantic ${CMAKE_C_FLAGS}")
+ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/bin")
+ 
+ set (CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
diff --git a/srcpkgs/xstarter/template b/srcpkgs/xstarter/template
index aa9a47e45e5c..4363d36e3c39 100644
--- a/srcpkgs/xstarter/template
+++ b/srcpkgs/xstarter/template
@@ -1,7 +1,7 @@
 # Template file for 'xstarter'
 pkgname=xstarter
 version=0.8.0
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="pkg-config"
 makedepends="glib-devel ncurses-devel"

From 7b156a5d14abafcfcde61d4081ffa9591eab58d6 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: Sat, 27 Mar 2021 19:15:48 +0700
Subject: [PATCH 56/63] yabause-gtk: ignore -O3

---
 srcpkgs/yabause-gtk/patches/fix-cflags.patch | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 srcpkgs/yabause-gtk/patches/fix-cflags.patch

diff --git a/srcpkgs/yabause-gtk/patches/fix-cflags.patch b/srcpkgs/yabause-gtk/patches/fix-cflags.patch
new file mode 100644
index 000000000000..52c1cae61799
--- /dev/null
+++ b/srcpkgs/yabause-gtk/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: src/CMakeLists.txt
+===================================================================
+--- src/CMakeLists.txt.orig
++++ src/CMakeLists.txt
+@@ -659,7 +659,7 @@ else ()
+ 	set(yabause_SOURCES ${yabause_SOURCES} sock-dummy.c thr-dummy.c)
+ endif ()
+ 
+-set(YAB_OPTIMIZATION "-O3" CACHE STRING "Override optimization level")
++set(YAB_OPTIMIZATION "" CACHE STRING "Override optimization level")
+ 
+ if("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "i686")
+ 	set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${YAB_OPTIMIZATION} -march=i686 -msse")

From c01a362e33c139e883625630f16fc1d82ef8c489 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: Sat, 27 Mar 2021 19:26:47 +0700
Subject: [PATCH 57/63] ympd: hardening

---
 srcpkgs/ympd/patches/fix-cflags.patch | 13 +++++++++++++
 srcpkgs/ympd/template                 |  2 +-
 2 files changed, 14 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/ympd/patches/fix-cflags.patch

diff --git a/srcpkgs/ympd/patches/fix-cflags.patch b/srcpkgs/ympd/patches/fix-cflags.patch
new file mode 100644
index 000000000000..4720dd39e748
--- /dev/null
+++ b/srcpkgs/ympd/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -24,7 +24,7 @@ include_directories(${PROJECT_BINARY_DIR
+ 
+ include(CheckCSourceCompiles)
+ 
+-set(CMAKE_C_FLAGS "-std=gnu99 -Wall")
++set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99 -Wall")
+ set(CMAKE_C_FLAGS_DEBUG "-ggdb -pedantic")
+ if(WITH_IPV6)
+     set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS NS_ENABLE_IPV6)
diff --git a/srcpkgs/ympd/template b/srcpkgs/ympd/template
index 14437beb5384..450c079b2ca3 100644
--- a/srcpkgs/ympd/template
+++ b/srcpkgs/ympd/template
@@ -1,7 +1,7 @@
 # Template file for 'ympd'
 pkgname=ympd
 version=1.3.0
-revision=7
+revision=8
 build_style=cmake
 hostmakedepends="perl pkg-config"
 makedepends="libmpdclient-devel openssl-devel"

From cf5189b6f3ca1b132131047000e2421ec9accaf9 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: Sat, 27 Mar 2021 19:29:31 +0700
Subject: [PATCH 58/63] z80ex: hardening

---
 srcpkgs/z80ex/patches/fix-cflags.patch | 13 +++++++++++++
 srcpkgs/z80ex/template                 |  4 ++--
 2 files changed, 15 insertions(+), 2 deletions(-)
 create mode 100644 srcpkgs/z80ex/patches/fix-cflags.patch

diff --git a/srcpkgs/z80ex/patches/fix-cflags.patch b/srcpkgs/z80ex/patches/fix-cflags.patch
new file mode 100644
index 000000000000..6743da255e5c
--- /dev/null
+++ b/srcpkgs/z80ex/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -11,7 +11,7 @@ option (OPSTEP_FAST_AND_ROUGH "Fast and
+ 
+ #ALL_CFLAGS := -fPIC -fno-common -ansi -pedantic -Wall -pipe -O2 -I. -I./include
+ if (CMAKE_COMPILER_IS_GNUCC)
+-    set (CMAKE_C_FLAGS "-fPIC -fno-common -ansi -pedantic -Wall -pipe -O2")
++    set (CMAKE_C_FLAGS "-fPIC -fno-common -ansi -pedantic -Wall -pipe ${CMAKE_C_FLAGS}")
+ endif ()
+ 
+ include_directories(BEFORE . include)
diff --git a/srcpkgs/z80ex/template b/srcpkgs/z80ex/template
index 00a24a6fb902..5437f53d33d5 100644
--- a/srcpkgs/z80ex/template
+++ b/srcpkgs/z80ex/template
@@ -1,11 +1,11 @@
 # Template file for 'z80ex'
 pkgname=z80ex
 version=1.1.21
-revision=1
+revision=2
 build_style=cmake
 short_desc="ZiLOG Z80 CPU emulation library"
 maintainer="Diogo Leal <diogo@diogoleal.com>"
-license="GPL-2"
+license="GPL-2.0-only"
 homepage="https://sourceforge.net/projects/z80ex/"
 distfiles="${SOURCEFORGE_SITE}/project/z80ex/z80ex/${version}/z80ex-${version}.tar.gz"
 checksum=6f5e521d068a614b41e10180ad4ae45b1bc258ec28c962543feb9078856c2530

From c002e0829ba8689e9096cc551919ce7cfa4a8a60 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: Sat, 27 Mar 2021 19:17:13 +0700
Subject: [PATCH 59/63] scribus: don't overwrite cmake-build-type

---
 .../patches/cmake-build-type-none.patch       | 33 +++++++++++++++++++
 1 file changed, 33 insertions(+)
 create mode 100644 srcpkgs/scribus/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/scribus/patches/cmake-build-type-none.patch b/srcpkgs/scribus/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..670c83cc48f5
--- /dev/null
+++ b/srcpkgs/scribus/patches/cmake-build-type-none.patch
@@ -0,0 +1,33 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -35,11 +35,6 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON)
+ 
+ 
+ #RPATH setup - more below too
+-if (WANT_NORPATH OR WANT_DISTROBUILD)
+-	set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
+-else()
+-	set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
+-endif()
+ set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
+ set(CMAKE_SKIP_RULE_DEPENDENCY TRUE)
+ set(CMAKE_SKIP_BUILD_RPATH TRUE)
+@@ -309,16 +304,6 @@ include (CMakeLists_Directories.cmake)
+ #Convert our simpler command line option to the CMake style
+ #None, Debug, Release, .. or custom ones
+ # set(WANT_DEBUG ON)
+-if(WANT_DEBUG)
+-	set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Set Debug Build Type" FORCE)
+-endif()
+-if (WANT_RELEASEWITHDEBUG)
+-	set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING "Set Release with Debug Info Build Type" FORCE)
+-endif()
+-if(NOT WANT_DEBUG AND NOT WANT_RELEASEWITHDEBUG)
+-	set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Set Release Build Type" FORCE)
+-endif()
+-
+ 
+ 
+ #Based on our build type, setup our build options

From 7df96ac1ab56f9cc581aa8eae41e886a637dfdb8 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, 28 Mar 2021 10:39:04 +0700
Subject: [PATCH 60/63] yoshimi: cleanup, don't overwrite CMAKE_BUILD_TYPE

---
 srcpkgs/yoshimi/patches/fix-cflags.patch | 12 ++++++++++++
 srcpkgs/yoshimi/template                 | 13 +------------
 2 files changed, 13 insertions(+), 12 deletions(-)
 create mode 100644 srcpkgs/yoshimi/patches/fix-cflags.patch

diff --git a/srcpkgs/yoshimi/patches/fix-cflags.patch b/srcpkgs/yoshimi/patches/fix-cflags.patch
new file mode 100644
index 000000000000..4baeb82ef4e3
--- /dev/null
+++ b/srcpkgs/yoshimi/patches/fix-cflags.patch
@@ -0,0 +1,12 @@
+Index: src/CMakeLists.txt
+===================================================================
+--- src/CMakeLists.txt.orig
++++ src/CMakeLists.txt
+@@ -262,7 +262,6 @@ if (BuildForDebug)
+     set (CMAKE_CXX_FLAGS_DEBUG ${BuildOptionsDebug})
+     message (STATUS "DEBUG Build, flags: ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_DEBUG}")
+ else()
+-    set (CMAKE_BUILD_TYPE "Release")
+     set (CMAKE_CXX_FLAGS_RELEASE ${BuildOptionsRelease})
+     message (STATUS "RELEASE Build, flags: ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELEASE}")
+ endif ()
diff --git a/srcpkgs/yoshimi/template b/srcpkgs/yoshimi/template
index 0096f7f05710..64a6c9ad433f 100644
--- a/srcpkgs/yoshimi/template
+++ b/srcpkgs/yoshimi/template
@@ -4,6 +4,7 @@ version=1.7.4
 revision=2
 build_wrksrc=src
 build_style=cmake
+configure_args="-DCMAKE_INSTALL_DATAROOTDIR=/usr/share"
 hostmakedepends="pkg-config fltk"
 makedepends="boost-devel jack-devel fltk-devel fftw-devel mxml-devel cairo-devel
  lv2 readline-devel ncurses-devel"
@@ -17,15 +18,3 @@ checksum=27a8e33bda72aafae604e14841bed6373fc9e00ff70c98f1e13215d6a8808318
 case "$XBPS_TARGET_MACHINE" in
 	*-musl) makedepends+=" argp-standalone";;
 esac
-
-configure_args="-DCMAKE_INSTALL_DATAROOTDIR=/usr/share"
-
-pre_configure() {
-	sed -i 's|ncurses|ncursesw|g' CMakeLists.txt
-
-	case "$XBPS_TARGET_MACHINE" in
-		i686*) ;;
-		x86_64*) ;;
-		*) sed -i -e "s|-msse -msse2 -mfpmath=sse||g" CMakeLists.txt;;
-	esac
-}

From caaf0e8cd34aa2a90b51b93a71f735b5d75d0f56 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, 28 Mar 2021 10:49:25 +0700
Subject: [PATCH 61/63] zulucrypt: remove -O3

---
 srcpkgs/zulucrypt/patches/fix-cflags.patch | 26 ++++++++++++++++++++++
 1 file changed, 26 insertions(+)
 create mode 100644 srcpkgs/zulucrypt/patches/fix-cflags.patch

diff --git a/srcpkgs/zulucrypt/patches/fix-cflags.patch b/srcpkgs/zulucrypt/patches/fix-cflags.patch
new file mode 100644
index 000000000000..d77c539c6c13
--- /dev/null
+++ b/srcpkgs/zulucrypt/patches/fix-cflags.patch
@@ -0,0 +1,26 @@
+Index: external_libraries/tcplay/CMakeLists.txt
+===================================================================
+--- external_libraries/tcplay/CMakeLists.txt.orig
++++ external_libraries/tcplay/CMakeLists.txt
+@@ -13,7 +13,7 @@ set (SRCS_LINUX  crypto-gcrypt.c)
+ set (CFLAGS_LINUX  "-D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE")
+ set (CFLAGS_WARN "-w")
+ set (CFLAGS_DEBUG  "-O0 -g3 -DDEBUG")
+-set (CFLAGS_OPT    "-O3")
++set (CFLAGS_OPT    "")
+ set (CFLAGS_VER    "-DMAJ_VER=${VERSION_MAJOR} -DMIN_VER=${VERSION_MINOR}")
+ set (CFLAGS_COMMON "-std=c99 -fPIC  ${CFLAGS_LINUX} ${CFLAGS_WARN} ${CFLAGS_VER}")
+ if ($ENV{DEBUG})
+Index: external_libraries/tcplay/Makefile.classic
+===================================================================
+--- external_libraries/tcplay/Makefile.classic.orig
++++ external_libraries/tcplay/Makefile.classic
+@@ -47,8 +47,6 @@ COMMON_CFLAGS= $(WARNFLAGS) -fPIC $(VER_
+ 
+ ifeq ($(DEBUG), yes)
+   COMMON_CFLAGS+= -O0 -g -DDEBUG
+-else
+-  COMMON_CFLAGS+= -O3
+ endif
+ 
+ ifeq (${SYSTEM}, linux)

From 54af259f67b368e8e9e25a859f1693609145927d 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, 28 Mar 2021 10:43:24 +0700
Subject: [PATCH 62/63] zbackup: don't overwrite CMAKE_BUILD_TYPE

---
 .../patches/cmake-build-type-none.patch       | 26 +++++++++++++++++++
 1 file changed, 26 insertions(+)
 create mode 100644 srcpkgs/zbackup/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/zbackup/patches/cmake-build-type-none.patch b/srcpkgs/zbackup/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..6d6ebc8e124d
--- /dev/null
+++ b/srcpkgs/zbackup/patches/cmake-build-type-none.patch
@@ -0,0 +1,26 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -6,8 +6,6 @@ project( zbackup )
+ 
+ set( CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" )
+ 
+-set( CMAKE_BUILD_TYPE Release )
+-
+ find_package( ZLIB REQUIRED )
+ include_directories( ${ZLIB_INCLUDE_DIRS} )
+ 
+Index: tartool/CMakeLists.txt
+===================================================================
+--- tartool/CMakeLists.txt.orig
++++ tartool/CMakeLists.txt
+@@ -4,8 +4,6 @@
+ cmake_minimum_required( VERSION 2.6.0 )
+ project( tartool )
+ 
+-set( CMAKE_BUILD_TYPE Release )
+-
+ add_executable( tartool tartool.cc ../file.cc ../dir.cc )
+ 
+ install( TARGETS tartool DESTINATION bin )

From 4dff671d67020c2dd7dad4f921daf745e843511a 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: Sat, 27 Mar 2021 15:19:47 +0700
Subject: [PATCH 63/63] rofs-filtered: hardening

---
 srcpkgs/rofs-filtered/patches/fix-cflags.patch | 13 +++++++++++++
 srcpkgs/rofs-filtered/template                 | 10 +++-------
 2 files changed, 16 insertions(+), 7 deletions(-)
 create mode 100644 srcpkgs/rofs-filtered/patches/fix-cflags.patch

diff --git a/srcpkgs/rofs-filtered/patches/fix-cflags.patch b/srcpkgs/rofs-filtered/patches/fix-cflags.patch
new file mode 100644
index 000000000000..b77600f66784
--- /dev/null
+++ b/srcpkgs/rofs-filtered/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -9,7 +9,7 @@ set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PA
+      "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
+ 
+ add_definitions(-D_GNU_SOURCE)
+-set(CMAKE_C_FLAGS "-Wall -std=c99")
++set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC -Wall -std=c99")
+ 
+ # find fuse library
+ find_package (FUSE REQUIRED)
diff --git a/srcpkgs/rofs-filtered/template b/srcpkgs/rofs-filtered/template
index 332cd57a9902..2bb8a2304312 100644
--- a/srcpkgs/rofs-filtered/template
+++ b/srcpkgs/rofs-filtered/template
@@ -1,17 +1,13 @@
 # Template file for 'rofs-filtered'
 pkgname=rofs-filtered
 version=1.7
-revision=1
+revision=2
+wrksrc="${pkgname}-rel-${version}"
 build_style=cmake
 makedepends="fuse-devel"
 short_desc="Filtered read only filesystem for FUSE"
 maintainer="Alexander Gehrke <void@qwertyuiop.de>"
-license="GPL-2"
+license="GPL-2.0-or-later"
 homepage="https://github.com/gburca/rofs-filtered"
 distfiles="https://github.com/gburca/rofs-filtered/archive/rel-${version}.tar.gz"
 checksum=d66066dfd0274a2fb7b71dd929445377dd23100b9fa43e3888dbe3fc7e8228e8
-wrksrc="${pkgname}-rel-${version}"
-
-pre_configure() {
-	sed -i -e 's/CMAKE_C_FLAGS "/CMAKE_C_FLAGS "-fPIC /' ${wrksrc}/CMakeLists.txt
-}

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PR PATCH] [Updated] build-style/cmake: set CMAKE_BUILD_TYPE to None
  2021-03-14 13:19 [PR PATCH] [WIP] build-style/cmake: set CMAKE_BUILD_TYPE to None sgn
                   ` (29 preceding siblings ...)
  2021-03-29 15:30 ` sgn
@ 2021-04-03  3:00 ` sgn
  2021-04-03  3:13 ` sgn
  2021-04-03  3:13 ` [PR PATCH] [Merged]: " sgn
  32 siblings, 0 replies; 34+ messages in thread
From: sgn @ 2021-04-03  3:00 UTC (permalink / raw)
  To: ml

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

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

https://github.com/sgn/void-packages cmake-build-type-to-None
https://github.com/void-linux/void-packages/pull/29459

build-style/cmake: set CMAKE_BUILD_TYPE to None
- I'm going to build all packages with `build_style=cmake` and fix them one by one before merging this in.

[ci skip]

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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-cmake-build-type-to-None-29459.patch --]
[-- Type: text/x-diff, Size: 118136 bytes --]

From 457ab774d6159a1bb13baeb4484ba1b6de271a1e 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: Mon, 15 Mar 2021 08:07:16 +0700
Subject: [PATCH 01/62] amdvlk: allow CMAKE_BUILD_TYPE=None

---
 .../patches/cmake-build-type-none.patch       | 60 +++++++++++++++++++
 1 file changed, 60 insertions(+)
 create mode 100644 srcpkgs/amdvlk/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/amdvlk/patches/cmake-build-type-none.patch b/srcpkgs/amdvlk/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..7a629e58548e
--- /dev/null
+++ b/srcpkgs/amdvlk/patches/cmake-build-type-none.patch
@@ -0,0 +1,60 @@
+Index: llvm-project/llvm/CMakeLists.txt
+===================================================================
+--- llvm-project/llvm/CMakeLists.txt.orig
++++ llvm-project/llvm/CMakeLists.txt
+@@ -251,11 +251,6 @@ endif()
+ 
+ string(TOUPPER "${CMAKE_BUILD_TYPE}" uppercase_CMAKE_BUILD_TYPE)
+ 
+-if (CMAKE_BUILD_TYPE AND
+-    NOT uppercase_CMAKE_BUILD_TYPE MATCHES "^(DEBUG|RELEASE|RELWITHDEBINFO|MINSIZEREL)$")
+-  message(FATAL_ERROR "Invalid value for CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
+-endif()
+-
+ set(LLVM_LIBDIR_SUFFIX "" CACHE STRING "Define suffix of library directory name (32/64)" )
+ 
+ set(LLVM_TOOLS_INSTALL_DIR "bin" CACHE STRING "Path for binary subdirectory (defaults to 'bin')")
+Index: pal/cmake/Modules/AmdCmakeHelper.cmake
+===================================================================
+--- pal/cmake/Modules/AmdCmakeHelper.cmake.orig
++++ pal/cmake/Modules/AmdCmakeHelper.cmake
+@@ -37,11 +37,6 @@ if (CMAKE_CONFIGURATION_TYPES)
+ else()
+     string(TOUPPER "${CMAKE_BUILD_TYPE}" capital_CMAKE_BUILD_TYPE)
+ 
+-    if (CMAKE_BUILD_TYPE AND
+-        NOT capital_CMAKE_BUILD_TYPE MATCHES "^(DEBUG|RELEASE|RELWITHDEBINFO|MINSIZEREL)$")
+-        message(FATAL_ERROR "Invalid value for CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
+-    endif()
+-
+     if(capital_CMAKE_BUILD_TYPE STREQUAL "DEBUG")
+         set(CMAKE_BUILD_TYPE_DEBUG ON)
+         set(CMAKE_BUILD_TYPE_RELEASE OFF)
+Index: xgl/CMakeLists.txt
+===================================================================
+--- xgl/CMakeLists.txt.orig
++++ xgl/CMakeLists.txt
+@@ -181,11 +181,6 @@ if (CMAKE_CONFIGURATION_TYPES)
+ else()
+     string(TOUPPER "${CMAKE_BUILD_TYPE}" capital_CMAKE_BUILD_TYPE)
+ 
+-    if (CMAKE_BUILD_TYPE AND
+-        NOT capital_CMAKE_BUILD_TYPE MATCHES "^(DEBUG|RELEASE|RELWITHDEBINFO|MINSIZEREL)$")
+-        message(FATAL_ERROR "Invalid value for CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
+-    endif()
+-
+     if(capital_CMAKE_BUILD_TYPE STREQUAL "DEBUG")
+         set(CMAKE_BUILD_TYPE_DEBUG ON)
+         set(CMAKE_BUILD_TYPE_RELEASE OFF)
+Index: xgl/icd/CMakeLists.txt
+===================================================================
+--- xgl/icd/CMakeLists.txt.orig
++++ xgl/icd/CMakeLists.txt
+@@ -84,7 +84,6 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Cl
+     endif()
+ 
+     if(CMAKE_BUILD_TYPE_RELEASE)
+-        target_compile_options(xgl PRIVATE -O3)
+         if(XGL_ENABLE_LTO)
+             if(${CMAKE_CXX_COMPILER_ID} MATCHES "GNU")
+                 execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION)

From e9a347f8b7fa13f6d172f042416255f8dfbd113e 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: Wed, 17 Mar 2021 06:24:04 +0700
Subject: [PATCH 02/62] eigen*: set CMAKE_BUILD_TYPE to Release

We're going to set default CMAKE_BUILD_TYPE to None soon. Those packages
are header only libraries, no need to waste time on patching.
---
 srcpkgs/eigen/template    | 1 +
 srcpkgs/eigen3.2/template | 1 +
 2 files changed, 2 insertions(+)

diff --git a/srcpkgs/eigen/template b/srcpkgs/eigen/template
index ee825e95f273..072228c16915 100644
--- a/srcpkgs/eigen/template
+++ b/srcpkgs/eigen/template
@@ -3,6 +3,7 @@ pkgname=eigen
 version=3.3.9
 revision=1
 build_style=cmake
+configure_args="-DCMAKE_BUILD_TYPE=Release"
 short_desc="C++ template library for linear algebra (version 3.x)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MPL-2.0, GPL-3.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
diff --git a/srcpkgs/eigen3.2/template b/srcpkgs/eigen3.2/template
index 5715fc1b3a19..7b710534b5e5 100644
--- a/srcpkgs/eigen3.2/template
+++ b/srcpkgs/eigen3.2/template
@@ -4,6 +4,7 @@ version=3.2.10
 revision=3
 wrksrc="eigen-${version}"
 build_style=cmake
+configure_args="-DCMAKE_BUILD_TYPE=Release"
 short_desc="C++ template library for linear algebra (version 3.x)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MPL-2.0, GPL-3.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"

From 38598687384b5823b983140f4baf805f60f38bba 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: Wed, 17 Mar 2021 07:04:48 +0700
Subject: [PATCH 03/62] embree: don't ignore CXXFLAGS, fix build with ispc
 1.13+

---
 .../embree/patches/uintNN-is-part-of-ispc-1.13.patch | 12 ++++++++++++
 srcpkgs/embree/template                              |  6 ++----
 2 files changed, 14 insertions(+), 4 deletions(-)
 create mode 100644 srcpkgs/embree/patches/uintNN-is-part-of-ispc-1.13.patch

diff --git a/srcpkgs/embree/patches/uintNN-is-part-of-ispc-1.13.patch b/srcpkgs/embree/patches/uintNN-is-part-of-ispc-1.13.patch
new file mode 100644
index 000000000000..5d0b02f3b2e5
--- /dev/null
+++ b/srcpkgs/embree/patches/uintNN-is-part-of-ispc-1.13.patch
@@ -0,0 +1,12 @@
+Index: embree-2.17.7/tutorials/common/common.isph
+===================================================================
+--- embree-2.17.7.orig/tutorials/common/common.isph
++++ embree-2.17.7/tutorials/common/common.isph
+@@ -16,7 +16,3 @@
+ 
+ #pragma once
+ 
+-typedef unsigned int64 uint64;
+-typedef unsigned int32 uint32;
+-typedef unsigned int16 uint16;
+-typedef unsigned int8  uint8;
diff --git a/srcpkgs/embree/template b/srcpkgs/embree/template
index 0bc72f46b6d8..849ec3c26c1d 100644
--- a/srcpkgs/embree/template
+++ b/srcpkgs/embree/template
@@ -4,6 +4,7 @@ version=2.17.7
 revision=2
 archs="x86_64"
 build_style=cmake
+configure_args="-DTBB_ROOT=/usr -DEMBREE_IGNORE_CMAKE_CXX_FLAGS=OFF"
 hostmakedepends="ispc"
 makedepends="libfreeglut-devel libXmu-devel tbb-devel MesaLib-devel libpng-devel
  libopenexr-devel libjpeg-turbo-devel libmagick-devel"
@@ -13,10 +14,7 @@ license="Apache-2.0"
 homepage="https://embree.github.io/"
 distfiles="https://github.com/$pkgname/$pkgname/archive/v$version.tar.gz"
 checksum=c0694f287fa1fbb382aba3a895702e248d92f7e89c0e5f64aefee965482ec04c
-
-nopie=y
-
-configure_args="-DTBB_ROOT=/usr -DENABLE_TUTORIALS=OFF"
+patch_args=-Np1
 
 embree-devel_package() {
 	depends="${sourcepkg}>=${version}_${revision}"

From 73ad795e5d36a0df404aaa574d1df9e221adb4a3 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: Wed, 17 Mar 2021 07:35:19 +0700
Subject: [PATCH 04/62] ettercap: remove libressl patch, CMAKE_BUILD_TYPE=None

---
 .../patches/allow-build-type-none.patch       | 24 ++++++++++++++
 srcpkgs/ettercap/patches/libressl.patch       | 31 -------------------
 srcpkgs/ettercap/template                     |  9 ++++--
 3 files changed, 31 insertions(+), 33 deletions(-)
 create mode 100644 srcpkgs/ettercap/patches/allow-build-type-none.patch
 delete mode 100644 srcpkgs/ettercap/patches/libressl.patch

diff --git a/srcpkgs/ettercap/patches/allow-build-type-none.patch b/srcpkgs/ettercap/patches/allow-build-type-none.patch
new file mode 100644
index 000000000000..324d75086b05
--- /dev/null
+++ b/srcpkgs/ettercap/patches/allow-build-type-none.patch
@@ -0,0 +1,24 @@
+Index: ettercap-0.8.3.1/CMakeLists.txt
+===================================================================
+--- ettercap-0.8.3.1.orig/CMakeLists.txt
++++ ettercap-0.8.3.1/CMakeLists.txt
+@@ -22,19 +22,6 @@ option(LIBRARY_BUILD "Build for libetter
+ option(INSTALL_DESKTOP "Install ettercap desktop files" ON)
+ 
+ 
+-set(VALID_BUILD_TYPES Debug Release RelWithDebInfo)
+-
+-if(NOT CMAKE_BUILD_TYPE)
+-  # Default to using "Release" as our build type.
+-  set(CMAKE_BUILD_TYPE "Release" CACHE STRING
+-    "Choose the type of build, options are: ${VALID_BUILD_TYPES}." FORCE)
+-endif()
+-list(FIND VALID_BUILD_TYPES ${CMAKE_BUILD_TYPE} contains_valid)
+-if(contains_valid EQUAL -1)
+-  message(FATAL_ERROR "Unknown CMAKE_BUILD_TYPE: '${CMAKE_BUILD_TYPE}'. Valid options are: ${VALID_BUILD_TYPES}")
+-endif()
+-unset(contains_valid)
+-
+ include(CMakeDependentOption)
+ 
+ # If SYSTEM_LIBS is set to off, then all SYSTEM_* options will be
diff --git a/srcpkgs/ettercap/patches/libressl.patch b/srcpkgs/ettercap/patches/libressl.patch
deleted file mode 100644
index 15e0d3c1c9e7..000000000000
--- a/srcpkgs/ettercap/patches/libressl.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From b2f7634c9dbc0ef68640f0571787d92300e9f9f9 Mon Sep 17 00:00:00 2001
-From: Stefan Strogin <stefan@steils.org>
-Date: Sat, 15 Aug 2020 07:18:31 +0300
-Subject: [PATCH] ec_sslwrap: fix compilation with LibreSSL
-
-Disable taking over SNI extension from ClientHello and SSL configuration
-operations until LibreSSL supports the required API.
-
-Fixes: https://github.com/Ettercap/ettercap/issues/1068
----
- src/ec_sslwrap.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git src/ec_sslwrap.c src/ec_sslwrap.c
-index b9f26a142..1e4c24fc1 100644
---- src/ec_sslwrap.c
-+++ src/ec_sslwrap.c
-@@ -71,11 +71,11 @@
- #define TLS_server_method SSLv23_server_method
- #endif
- 
--#if (OPENSSL_VERSION_NUMBER >= 0x10100000L)
-+#if (OPENSSL_VERSION_NUMBER >= 0x10100000L) && !defined(LIBRESSL_VERSION_NUMBER)
- #define HAVE_OPENSSL_1_1_0
- #endif
- 
--#if (OPENSSL_VERSION_NUMBER >= 0x10101000L)
-+#if (OPENSSL_VERSION_NUMBER >= 0x10101000L) && !defined(LIBRESSL_VERSION_NUMBER)
- #define HAVE_OPENSSL_1_1_1
- #endif
- 
diff --git a/srcpkgs/ettercap/template b/srcpkgs/ettercap/template
index 7fe4c340a079..611b4e9aded7 100644
--- a/srcpkgs/ettercap/template
+++ b/srcpkgs/ettercap/template
@@ -3,8 +3,8 @@ pkgname=ettercap
 version=0.8.3.1
 revision=2
 build_style=cmake
-configure_args="-DENABLE_GTK=OFF"
-hostmakedepends="flex"
+configure_args="-DENABLE_GTK=OFF -DBUNDLED_LIBS=OFF"
+hostmakedepends="flex pkg-config"
 makedepends="geoip-devel ncurses-devel openssl-devel libcurl-devel
  libltdl-devel libnet-devel libpcap-devel pcre-devel"
 conf_files="/etc/${pkgname}/etter.conf"
@@ -15,5 +15,10 @@ homepage="http://ettercap.github.com/ettercap/"
 distfiles="https://github.com/Ettercap/ettercap/archive/v${version}.tar.gz"
 checksum=d0c3ef88dfc284b61d3d5b64d946c1160fd04276b448519c1ae4438a9cdffaf3
 lib32disabled=yes
+patch_args=-Np1
 
 CFLAGS="-fcommon"
+
+post_extract() {
+	rm -rf bundled_deps
+}

From 82b3b169aab197a6cdf21a2122d595d758f203aa 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: Wed, 17 Mar 2021 08:27:10 +0700
Subject: [PATCH 05/62] injeqt: disable coverage

---
 srcpkgs/injeqt/template | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/injeqt/template b/srcpkgs/injeqt/template
index 1e5777fc0f18..78eba09a0249 100644
--- a/srcpkgs/injeqt/template
+++ b/srcpkgs/injeqt/template
@@ -3,7 +3,8 @@ pkgname=injeqt
 version=1.2.0
 revision=2
 build_style=cmake
-hostmakedepends="pkg-config"
+configure_args="-DDISABLE_COVERAGE=ON"
+hostmakedepends="pkg-config qt5-qmake qt5-host-tools"
 makedepends="qt5-devel"
 short_desc="Dependency injection framework for Qt"
 maintainer="Jürgen Buchmüller <pullmoll@t-online.de>"
@@ -12,9 +13,6 @@ homepage="https://github.com/vogel/injeqt/"
 distfiles="https://github.com/vogel/${pkgname}/archive/${version}.tar.gz>${pkgname}-${version}.tar.gz"
 checksum=77540cedb0b26affe993dd18124d796059e34c80a51d9ae6433fdff1860db135
 
-if [ -n "$CROSS_BUILD" ]; then
-	hostmakedepends+=" qt5-host-tools qt5-devel"
-fi
 CXXFLAGS="-fno-lifetime-dse -Wno-error=cast-align"
 
 injeqt-devel_package() {

From e4a86c00f8fcc80cdb53137f01d8a3583de40370 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: Wed, 17 Mar 2021 22:26:37 +0700
Subject: [PATCH 06/62] kindd: build with CMAKE_BUILD_TYPE=None

---
 srcpkgs/kindd/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/kindd/template b/srcpkgs/kindd/template
index e634b0f69bf6..4416041de58c 100644
--- a/srcpkgs/kindd/template
+++ b/srcpkgs/kindd/template
@@ -15,7 +15,7 @@ distfiles="${homepage}/archive/${version}.tar.gz"
 checksum=e596f1b1577ff3e83a779e6181252ae2f09731f513d17dd6b95cbc2cf204654f
 
 do_install() {
-	vbin release/kindd
+	vbin build/core/kindd
 	vinstall assets/appconf/kindd.svg 644 usr/share/pixmaps
 	vinstall assets/appconf/kindd.desktop 644 usr/share/applications
 }

From a33f8fcc81df65723398fa039ddc8f93f9bbf887 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: Thu, 18 Mar 2021 23:58:53 +0700
Subject: [PATCH 07/62] occt: allow CMAKE_BUILD_TYPE=None

---
 srcpkgs/occt/patches/cmake-build-type-none.patch | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 srcpkgs/occt/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/occt/patches/cmake-build-type-none.patch b/srcpkgs/occt/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..acb06fb55766
--- /dev/null
+++ b/srcpkgs/occt/patches/cmake-build-type-none.patch
@@ -0,0 +1,13 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -4,7 +4,7 @@ set (CMAKE_MODULE_PATH "${CMAKE_SOURCE_D
+ 
+ set (CMAKE_SUPPRESS_REGENERATION TRUE)
+ 
+-set (CMAKE_CONFIGURATION_TYPES Release Debug RelWithDebInfo CACHE INTERNAL "" FORCE)
++set (CMAKE_CONFIGURATION_TYPES None Release Debug RelWithDebInfo CACHE INTERNAL "" FORCE)
+ 
+ # macro: include patched file if it exists
+ macro (OCCT_INCLUDE_CMAKE_FILE BEING_INCLUDED_FILE)

From 67300645af6eac41f07e2ca8e689f4a8cf861d02 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: Fri, 19 Mar 2021 23:07:05 +0700
Subject: [PATCH 08/62] renderdoc: devendor zstd, lz4

---
 .../patches/build-type-none-is-release.patch  | 12 ++++
 .../renderdoc/patches/qmake-no-rpath.patch    | 13 ++++
 .../renderdoc/patches/unvendor-zstd-lz4.patch | 68 +++++++++++++++++++
 srcpkgs/renderdoc/template                    | 15 ++--
 4 files changed, 99 insertions(+), 9 deletions(-)
 create mode 100644 srcpkgs/renderdoc/patches/build-type-none-is-release.patch
 create mode 100644 srcpkgs/renderdoc/patches/qmake-no-rpath.patch
 create mode 100644 srcpkgs/renderdoc/patches/unvendor-zstd-lz4.patch

diff --git a/srcpkgs/renderdoc/patches/build-type-none-is-release.patch b/srcpkgs/renderdoc/patches/build-type-none-is-release.patch
new file mode 100644
index 000000000000..f16b944bc12c
--- /dev/null
+++ b/srcpkgs/renderdoc/patches/build-type-none-is-release.patch
@@ -0,0 +1,12 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -315,6 +315,7 @@ set(RELEASE_MODE 0)
+ 
+ if(cmake_build_type_lower STREQUAL "release" OR
+    cmake_build_type_lower STREQUAL "relwithdebinfo" OR
++   cmake_build_type_lower STREQUAL "none" OR
+    cmake_build_type_lower STREQUAL "minsizerel")
+     add_definitions(-D_RELEASE)
+     message(STATUS "Building RenderDoc in Release mode: ${CMAKE_BUILD_TYPE}")
diff --git a/srcpkgs/renderdoc/patches/qmake-no-rpath.patch b/srcpkgs/renderdoc/patches/qmake-no-rpath.patch
new file mode 100644
index 000000000000..6e6325c53555
--- /dev/null
+++ b/srcpkgs/renderdoc/patches/qmake-no-rpath.patch
@@ -0,0 +1,13 @@
+Index: qrenderdoc/CMakeLists.txt
+===================================================================
+--- qrenderdoc/CMakeLists.txt.orig
++++ qrenderdoc/CMakeLists.txt
+@@ -144,7 +144,7 @@ endif()
+ # and finding dependencies from the cmake build
+ file(WRITE
+      ${CMAKE_BINARY_DIR}/qrenderdoc/qrenderdoc_cmake.pri
+-     "CONFIG+=${QMAKE_CONFIG}\n"
++     "CONFIG+=${QMAKE_CONFIG} no_qt_rpath\n"
+      "\n"
+      "QMAKE_CC=${CMAKE_C_COMPILER}\n"
+      "QMAKE_CXX=${CMAKE_CXX_COMPILER}\n"
diff --git a/srcpkgs/renderdoc/patches/unvendor-zstd-lz4.patch b/srcpkgs/renderdoc/patches/unvendor-zstd-lz4.patch
new file mode 100644
index 000000000000..d4003ded9161
--- /dev/null
+++ b/srcpkgs/renderdoc/patches/unvendor-zstd-lz4.patch
@@ -0,0 +1,68 @@
+Index: renderdoc/CMakeLists.txt
+===================================================================
+--- renderdoc/CMakeLists.txt.orig
++++ renderdoc/CMakeLists.txt
+@@ -213,54 +213,10 @@ set(sources
+     3rdparty/pugixml/pugixml.cpp
+     3rdparty/pugixml/pugixml.hpp
+     3rdparty/pugixml/pugiconfig.hpp
+-    3rdparty/lz4/lz4.c
+-    3rdparty/lz4/lz4.h
+     3rdparty/miniz/miniz.c
+     3rdparty/miniz/miniz.h
+     3rdparty/superluminal/superluminal.cpp
+     3rdparty/superluminal/superluminal.h
+-    3rdparty/zstd/bitstream.h
+-    3rdparty/zstd/compiler.h
+-    3rdparty/zstd/cpu.h
+-    3rdparty/zstd/debug.c
+-    3rdparty/zstd/debug.h
+-    3rdparty/zstd/entropy_common.c
+-    3rdparty/zstd/error_private.c
+-    3rdparty/zstd/error_private.h
+-    3rdparty/zstd/fse.h
+-    3rdparty/zstd/fse_compress.c
+-    3rdparty/zstd/fse_decompress.c
+-    3rdparty/zstd/hist.c
+-    3rdparty/zstd/hist.h
+-    3rdparty/zstd/huf.h
+-    3rdparty/zstd/huf_compress.c
+-    3rdparty/zstd/huf_decompress.c
+-    3rdparty/zstd/mem.h
+-    3rdparty/zstd/pool.c
+-    3rdparty/zstd/pool.h
+-    3rdparty/zstd/threading.c
+-    3rdparty/zstd/threading.h
+-    3rdparty/zstd/xxhash.c
+-    3rdparty/zstd/xxhash.h
+-    3rdparty/zstd/zstd.h
+-    3rdparty/zstd/zstd_common.c
+-    3rdparty/zstd/zstd_compress.c
+-    3rdparty/zstd/zstd_compress_internal.h
+-    3rdparty/zstd/zstd_decompress.c
+-    3rdparty/zstd/zstd_double_fast.c
+-    3rdparty/zstd/zstd_double_fast.h
+-    3rdparty/zstd/zstd_errors.h
+-    3rdparty/zstd/zstd_fast.c
+-    3rdparty/zstd/zstd_fast.h
+-    3rdparty/zstd/zstd_internal.h
+-    3rdparty/zstd/zstd_lazy.c
+-    3rdparty/zstd/zstd_lazy.h
+-    3rdparty/zstd/zstd_ldm.c
+-    3rdparty/zstd/zstd_ldm.h
+-    3rdparty/zstd/zstd_opt.c
+-    3rdparty/zstd/zstd_opt.h
+-    3rdparty/zstd/zstdmt_compress.c
+-    3rdparty/zstd/zstdmt_compress.h
+     3rdparty/stb/stb_image.h
+     3rdparty/stb/stb_image_write.h
+     3rdparty/stb/stb_image_resize.h
+@@ -271,6 +227,8 @@ set(sources
+     3rdparty/tinyfiledialogs/tinyfiledialogs.c
+     3rdparty/tinyfiledialogs/tinyfiledialogs.h)
+ 
++list(APPEND RDOC_LIBRARIES -llz4 -lzstd)
++
+ if(ANDROID)
+     list(APPEND sources
+         data/embedded_files.h
diff --git a/srcpkgs/renderdoc/template b/srcpkgs/renderdoc/template
index 7240e9ebc307..4615d45c52c9 100644
--- a/srcpkgs/renderdoc/template
+++ b/srcpkgs/renderdoc/template
@@ -1,13 +1,14 @@
 # Template file for 'renderdoc'
 pkgname=renderdoc
 version=1.12
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DENABLE_GL=ON -DENABLE_GLES=ON -DENABLE_QRENDERDOC=ON
  -DENABLE_RENDERDOCCMD=ON -DENABLE_VULKAN=ON -DENABLE_XCB=ON -DENABLE_XLIB=ON
  -DENABLE_PYRENDERDOC=ON"
-hostmakedepends="bison autoconf automake pkg-config python3"
+hostmakedepends="bison autoconf automake pkg-config python3 swig"
 makedepends="libX11-devel libxcb-devel xcb-util-keysyms-devel qt5-devel
+ libzstd-devel liblz4-devel
  qt5-svg-devel qt5-x11extras-devel pcre-devel python3-devel"
 short_desc="Stand-alone graphics debugging tool for Vulkan and OpenGL"
 maintainer="Urs Schulz <voidpkgs@ursschulz.de>"
@@ -19,19 +20,14 @@ checksum=4dece1b4cb859a76533b28fcd50e17321acfaa81c3435500a006c4a5ba15fddb
 if [ "$XBPS_TARGET_LIBC" = musl ]; then
 	makedepends+=" libexecinfo-devel"
 	LDLIBS="-lexecinfo"
+	broken="uses RTLD_DL_LINKMAP, RTLD_DEEPBIND, _r_debug"
 fi
 
 if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
 	makedepends+=" libatomic-devel"
 fi
 
-case "$XBPS_TARGET_MACHINE" in
-	*-musl) broken="uses RTLD_DL_LINKMAP, RTLD_DEEPBIND, _r_debug" ;;
-esac
-
-if [ "$CROSS_BUILD" ]; then
-	broken="Cross-compilation can't find python3 interpreter"
-fi
+nocross="Cross-compilation can't find python3 interpreter"
 
 post_patch() {
 	[ -z "$XBPS_TARGET_NO_ATOMIC8" ] && return 0
@@ -40,4 +36,5 @@ post_patch() {
 
 post_install() {
 	vlicense LICENSE.md
+	vlicense docs/credits_acknowledgements.rst
 }

From d4343e44b8b87cdb1bc571226acdbb2f5ed0ac04 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: Sat, 20 Mar 2021 00:47:52 +0700
Subject: [PATCH 09/62] python3-occ: build with CMAKE_BUILD_TYPE=None

---
 srcpkgs/python3-occ/template | 1 +
 1 file changed, 1 insertion(+)

diff --git a/srcpkgs/python3-occ/template b/srcpkgs/python3-occ/template
index 705f37457943..3ea0ef5e6387 100644
--- a/srcpkgs/python3-occ/template
+++ b/srcpkgs/python3-occ/template
@@ -5,6 +5,7 @@ revision=1
 archs="i686* x86_64* armv7l* aarch64* ppc*"
 wrksrc="pythonocc-core-${version}"
 build_style=cmake
+configure_args="-DPYTHONOCC_BUILD_TYPE=None -DCMAKE_BUILD_TYPE=None"
 hostmakedepends="python3 swig"
 makedepends="python3-devel occt-devel freetype-devel swig"
 depends="python3 occt freetype"

From 41da391a88b99266f13d9afddc4a0e8f036945e9 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: Fri, 19 Mar 2021 23:38:10 +0700
Subject: [PATCH 10/62] widelands: allow CMAKE_BUILD_TYPE=None

---
 srcpkgs/widelands-data                        |  1 -
 .../patches/cmake-build-type-none.patch       | 63 +++++++++++++++++++
 .../widelands/patches/fix-install-path.patch  | 40 ++++++++++++
 srcpkgs/widelands/template                    | 21 +------
 4 files changed, 105 insertions(+), 20 deletions(-)
 delete mode 120000 srcpkgs/widelands-data
 create mode 100644 srcpkgs/widelands/patches/cmake-build-type-none.patch
 create mode 100644 srcpkgs/widelands/patches/fix-install-path.patch

diff --git a/srcpkgs/widelands-data b/srcpkgs/widelands-data
deleted file mode 120000
index e9fbf89517f2..000000000000
--- a/srcpkgs/widelands-data
+++ /dev/null
@@ -1 +0,0 @@
-widelands
\ No newline at end of file
diff --git a/srcpkgs/widelands/patches/cmake-build-type-none.patch b/srcpkgs/widelands/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..3d210854741b
--- /dev/null
+++ b/srcpkgs/widelands/patches/cmake-build-type-none.patch
@@ -0,0 +1,63 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -202,7 +202,7 @@ elseif(CMAKE_BUILD_TYPE STREQUAL "RelWit
+   set(WL_DEBUG_FLAGS "-DNDEBUG -DNOPARACHUTE")
+   option(OPTION_ASAN "Build with AddressSanitizer" ON)
+ else()
+-  message(FATAL_ERROR "Unknown CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
++  set(WL_DEBUG_FLAGS "-DNDEBUG -DNOPARACHUTE")
+ endif()
+ 
+ wl_add_flag(WL_GENERIC_CXX_FLAGS "-std=c++11")
+@@ -353,7 +353,7 @@ endif (OPTION_BUILD_TESTS)
+ install (
+   FILES ${CMAKE_CURRENT_BINARY_DIR}/VERSION
+   DESTINATION ${WL_INSTALL_BASEDIR}
+-  CONFIGURATIONS Debug;Release
++  CONFIGURATIONS Debug
+   COMPONENT CoreVersionFile
+ )
+ 
+@@ -378,7 +378,6 @@ install(
+     data/txts
+     data/world
+   DESTINATION ${WL_INSTALL_DATADIR}
+-  CONFIGURATIONS Debug;Release
+   COMPONENT CoreDataFiles
+ )
+ 
+@@ -386,7 +385,6 @@ install(
+   DIRECTORY
+     data/maps
+   DESTINATION ${WL_INSTALL_DATADIR}
+-  CONFIGURATIONS Debug;Release
+   COMPONENT MapFiles
+ )
+ 
+@@ -395,7 +393,6 @@ install(
+     data/music
+     data/sound
+   DESTINATION ${WL_INSTALL_DATADIR}
+-  CONFIGURATIONS Debug;Release
+   COMPONENT MusicFiles
+ )
+ 
+@@ -405,7 +402,7 @@ install(
+     CREDITS
+     ChangeLog
+   DESTINATION ${WL_INSTALL_BASEDIR}
+-  CONFIGURATIONS Debug;Release
++  CONFIGURATIONS Debug
+   COMPONENT CoreLicenseFiles
+ )
+ 
+@@ -424,7 +421,6 @@ install(
+   DIRECTORY
+     ${CMAKE_CURRENT_BINARY_DIR}/locale/
+   DESTINATION ${WL_INSTALL_DATADIR}/locale
+-  CONFIGURATIONS Debug;Release
+   COMPONENT CoreLanguageFiles
+ )
+ 
diff --git a/srcpkgs/widelands/patches/fix-install-path.patch b/srcpkgs/widelands/patches/fix-install-path.patch
new file mode 100644
index 000000000000..6bb461389f03
--- /dev/null
+++ b/srcpkgs/widelands/patches/fix-install-path.patch
@@ -0,0 +1,40 @@
+Index: cmake/WlFunctions.cmake
+===================================================================
+--- cmake/WlFunctions.cmake.orig
++++ cmake/WlFunctions.cmake
+@@ -289,5 +289,5 @@ function(wl_binary NAME)
+ 
+   #Quoting the CMake documentation on DESTINATION:
+   #"If a relative path is given it is interpreted relative to the value of CMAKE_INSTALL_PREFIX"
+-  install(TARGETS ${NAME} DESTINATION "." COMPONENT ExecutableFiles)
++  install(TARGETS ${NAME} DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT ExecutableFiles)
+ endfunction()
+Index: xdg/CMakeLists.txt
+===================================================================
+--- xdg/CMakeLists.txt.orig
++++ xdg/CMakeLists.txt
+@@ -6,19 +6,19 @@ set(XDG_APPLICATION_ID "org.widelands.Wi
+ list(APPEND icon_sizes "16" "32" "48" "64" "128")
+ foreach (icon_size ${icon_sizes})
+   #install(FILES ${CMAKE_SOURCE_DIR}/data/images/logos/wl-ico-${icon_size}.png DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/${icon_size}x${icon_size}/apps RENAME ${XDG_APPLICATION_ID}.png)
+-  install(FILES ${CMAKE_SOURCE_DIR}/data/images/logos/wl-ico-${icon_size}.png DESTINATION ../share/icons/hicolor/${icon_size}x${icon_size}/apps RENAME ${XDG_APPLICATION_ID}.png)
++  install(FILES ${CMAKE_SOURCE_DIR}/data/images/logos/wl-ico-${icon_size}.png DESTINATION share/icons/hicolor/${icon_size}x${icon_size}/apps RENAME ${XDG_APPLICATION_ID}.png)
+ endforeach (icon_size ${icon_sizes})
+ #install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${CMAKE_PROJECT_NAME}.6           DESTINATION ${CMAKE_INSTALL_MANDIR}/man6)
+-install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${CMAKE_PROJECT_NAME}.6           DESTINATION ../share/man/man6)
++install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${CMAKE_PROJECT_NAME}.6           DESTINATION share/man/man6)
+ #install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${XDG_APPLICATION_ID}.desktop     DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications)
+-install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${XDG_APPLICATION_ID}.desktop     DESTINATION ../share/applications)
++install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${XDG_APPLICATION_ID}.desktop     DESTINATION share/applications)
+ #install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${XDG_APPLICATION_ID}.appdata.xml DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/metainfo)
+-install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${XDG_APPLICATION_ID}.appdata.xml DESTINATION ../share/metainfo)
++install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${XDG_APPLICATION_ID}.appdata.xml DESTINATION share/metainfo)
+ 
+ find_program(GTK_UPDATE_ICON_CACHE NAMES gtk-update-icon-cache)
+ if (GTK_UPDATE_ICON_CACHE)
+   #install(CODE "execute_process (COMMAND ${GTK_UPDATE_ICON_CACHE} -t -f ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor ||: )")
+-  install(CODE "execute_process (COMMAND ${GTK_UPDATE_ICON_CACHE} -t -f ${CMAKE_INSTALL_PREFIX}/../share/icons/hicolor ||: )")
++  install(CODE "execute_process (COMMAND ${GTK_UPDATE_ICON_CACHE} -t -f ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor ||: )")
+ else (GTK_UPDATE_ICON_CACHE)
+   message(WARNING "gtk-update-icon-cache not found!")
+ endif (GTK_UPDATE_ICON_CACHE)
diff --git a/srcpkgs/widelands/template b/srcpkgs/widelands/template
index 6cee85087ea7..cfa2c10993e0 100644
--- a/srcpkgs/widelands/template
+++ b/srcpkgs/widelands/template
@@ -1,7 +1,7 @@
 # Template file for 'widelands'
 pkgname=widelands
 version=21
-revision=3
+revision=4
 wrksrc="${pkgname}-build${version}"
 build_style=cmake
 configure_args="-DOPENGL_INCLUDE_DIR=${XBPS_CROSS_BASE}/usr/include
@@ -10,13 +10,13 @@ hostmakedepends="python3 pkg-config gettext"
 makedepends="boost-devel icu-devel minizip-devel gettext-devel
  glu-devel glew-devel SDL2-devel SDL2_gfx-devel SDL2_image-devel
  SDL2_net-devel SDL2_mixer-devel SDL2_ttf-devel"
-depends="${pkgname}-data-${version}_${revision}"
 short_desc="Real-time strategy game"
 maintainer="Jürgen Buchmüller <pullmoll@t-online.de>"
 license="GPL-2.0-or-later"
 homepage="http://www.widelands.org/"
 distfiles="https://github.com/widelands/widelands/archive/build${version}.tar.gz>${pkgname}-${version}.tar.gz"
 checksum=601e0e4c6f91b3fb0ece2cd1b83ecfb02344a1b9194fbb70ef3f70e06994e357
+replaces="widelands-data>=0"
 
 CXXFLAGS="-DU_USING_ICU_NAMESPACE=1"
 
@@ -29,22 +29,5 @@ if [ "$CROSS_BUILD" ]; then
 fi
 
 post_install() {
-	# For some reason the binary is installed as /usr/widelands - move it
-	vmkdir usr/bin
-	mv ${DESTDIR}/usr/${pkgname} ${DESTDIR}/usr/bin
-	vmkdir usr/share
-	mv ${DESTDIR}/share/* ${DESTDIR}/usr/share/
-	rmdir ${DESTDIR}/share
-
-	# Remove files not needed in the package
-	rm -f ${DESTDIR}/usr/COPYING ${DESTDIR}/usr/CREDITS ${DESTDIR}/usr/ChangeLog ${DESTDIR}/usr/VERSION
-
 	vinstall ${FILESDIR}/${pkgname}.desktop 644 usr/share/applications
 }
-
-widelands-data_package() {
-	short_desc+=" - data files"
-	pkg_install() {
-		vmove usr/share/widelands
-	}
-}

From f5911cd0c0dd76950cffb93a5a0a2593cca3ac5e 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: Sat, 20 Mar 2021 09:49:25 +0700
Subject: [PATCH 11/62] zziplib: fix SONAME when build with
 -DCMAKE_BUILD_TYPE=None

---
 .../cmake-build-type-none-soname.patch        | 35 +++++++++++++++++++
 srcpkgs/zziplib/template                      |  1 +
 2 files changed, 36 insertions(+)
 create mode 100644 srcpkgs/zziplib/patches/cmake-build-type-none-soname.patch

diff --git a/srcpkgs/zziplib/patches/cmake-build-type-none-soname.patch b/srcpkgs/zziplib/patches/cmake-build-type-none-soname.patch
new file mode 100644
index 000000000000..2d31b5b8a46a
--- /dev/null
+++ b/srcpkgs/zziplib/patches/cmake-build-type-none-soname.patch
@@ -0,0 +1,35 @@
+Index: zziplib-0.13.72/zzip/CMakeLists.txt
+===================================================================
+--- zziplib-0.13.72.orig/zzip/CMakeLists.txt
++++ zziplib-0.13.72/zzip/CMakeLists.txt
+@@ -190,15 +190,18 @@ target_include_directories (libzzipmmapp
+ endif()
+ 
+ set_target_properties(libzzip PROPERTIES OUTPUT_NAME "zzip" RELEASE_POSTFIX "-${RELNUM}")
++set_target_properties(libzzip PROPERTIES OUTPUT_NAME "zzip" NONE_POSTFIX "-${RELNUM}")
+ SET_TARGET_PROPERTIES(libzzip PROPERTIES VERSION ${VERNUM}.${FIXNUM} SOVERSION ${VERNUM})
+ 
+ if(ZZIPFSEEKO)
+ set_target_properties(libzzipfseeko PROPERTIES OUTPUT_NAME "zzipfseeko" RELEASE_POSTFIX "-${RELNUM}")
++set_target_properties(libzzipfseeko PROPERTIES OUTPUT_NAME "zzipfseeko" NONE_POSTFIX "-${RELNUM}")
+ SET_TARGET_PROPERTIES(libzzipfseeko PROPERTIES VERSION ${VERNUM}.${FIXNUM} SOVERSION ${VERNUM})
+ endif()
+ 
+ if(ZZIPMMAPPED)
+ set_target_properties(libzzipmmapped PROPERTIES OUTPUT_NAME "zzipmmapped" RELEASE_POSTFIX "-${RELNUM}")
++set_target_properties(libzzipmmapped PROPERTIES OUTPUT_NAME "zzipmmapped" NONE_POSTFIX "-${RELNUM}")
+ SET_TARGET_PROPERTIES(libzzipmmapped PROPERTIES VERSION ${VERNUM}.${FIXNUM} SOVERSION ${VERNUM})
+ endif()
+ 
+Index: zziplib-0.13.72/zzipwrap/CMakeLists.txt
+===================================================================
+--- zziplib-0.13.72.orig/zzipwrap/CMakeLists.txt
++++ zziplib-0.13.72/zzipwrap/CMakeLists.txt
+@@ -49,6 +49,7 @@ target_link_libraries(libzzipwrap libzzi
+ target_include_directories(libzzipwrap PRIVATE "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}")
+ 
+ set_target_properties(libzzipwrap PROPERTIES OUTPUT_NAME "zzipwrap" RELEASE_POSTFIX "-${RELNUM}")
++set_target_properties(libzzipwrap PROPERTIES OUTPUT_NAME "zzipwrap" NONE_POSTFIX "-${RELNUM}")
+ SET_TARGET_PROPERTIES(libzzipwrap PROPERTIES VERSION ${VERNUM}.${FIXNUM} SOVERSION ${VERNUM})
+ set_target_properties(libzzipwrap PROPERTIES DEFINE_SYMBOL "libzzip_EXPORTS")
+ 
diff --git a/srcpkgs/zziplib/template b/srcpkgs/zziplib/template
index ab5af234af62..2026f3e4a521 100644
--- a/srcpkgs/zziplib/template
+++ b/srcpkgs/zziplib/template
@@ -12,6 +12,7 @@ homepage="https://github.com/gdraheim/zziplib"
 changelog="https://raw.githubusercontent.com/gdraheim/zziplib/master/ChangeLog"
 distfiles="https://github.com/gdraheim/zziplib/archive/v${version}.tar.gz"
 checksum=93ef44bf1f1ea24fc66080426a469df82fa631d13ca3b2e4abaeab89538518dc
+patch_args=-Np1
 
 if [ "$CROSS_BUILD" ]; then
 	configure_args+=" -DZZIPTEST=OFF"

From 0553757a7fac92d219bc0f23739a290d61082f6c 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, 21 Mar 2021 15:28:04 +0700
Subject: [PATCH 12/62] mellowplayer: fix build

---
 srcpkgs/mellowplayer/patches/no-werror.patch | 13 +++++++++++++
 srcpkgs/mellowplayer/template                | 13 +++++++------
 2 files changed, 20 insertions(+), 6 deletions(-)
 create mode 100644 srcpkgs/mellowplayer/patches/no-werror.patch

diff --git a/srcpkgs/mellowplayer/patches/no-werror.patch b/srcpkgs/mellowplayer/patches/no-werror.patch
new file mode 100644
index 000000000000..7e678453a123
--- /dev/null
+++ b/srcpkgs/mellowplayer/patches/no-werror.patch
@@ -0,0 +1,13 @@
+Index: MellowPlayer-3.6.6/src/3rdparty/boost/di.hpp
+===================================================================
+--- MellowPlayer-3.6.6.orig/src/3rdparty/boost/di.hpp
++++ MellowPlayer-3.6.6/src/3rdparty/boost/di.hpp
+@@ -67,7 +67,7 @@ BOOST_DI_CFG_FWD
+ #pragma clang diagnostic error "-Wundefined-internal"
+ #pragma clang diagnostic ignored "-Wmissing-field-initializers"
+ #elif defined(__GCC__)
+-#pragma GCC diagnostic error "-Wdeprecated-declarations"
++#pragma GCC diagnostic warning "-Wdeprecated-declarations"
+ #pragma GCC diagnostic push
+ #if (__GNUC__ < 6)
+ #pragma GCC diagnostic error "-Werror"
diff --git a/srcpkgs/mellowplayer/template b/srcpkgs/mellowplayer/template
index 2f8f13960ca6..cfd8a185556f 100644
--- a/srcpkgs/mellowplayer/template
+++ b/srcpkgs/mellowplayer/template
@@ -4,7 +4,7 @@ version=3.6.6
 revision=1
 wrksrc="MellowPlayer-${version}"
 build_style=cmake
-hostmakedepends="pkg-config qt5-tools qt5-qmake"
+hostmakedepends="pkg-config qt5-tools qt5-qmake qt5-host-tools"
 makedepends="qt5-declarative-devel qt5-quickcontrols2-devel
  qt5-plugin-mysql qt5-plugin-pgsql qt5-plugin-sqlite
  qt5-plugin-tds qt5-plugin-odbc
@@ -17,11 +17,12 @@ license="GPL-2.0-or-later"
 homepage="https://colinduquesnoy.gitlab.io/MellowPlayer/"
 distfiles="https://gitlab.com/ColinDuquesnoy/MellowPlayer/-/archive/${version}/MellowPlayer-${version}.tar.bz2"
 checksum=17b8b25ca6b3d27b223f8be6ad80186ae5bd17ce762eb04ecd8b0e82e687b327
+patch_args=-Np1
 
-if [ "$CROSS_BUILD" ]; then
-	hostmakedepends+=" qt5-host-tools"
+if [ "$XBPS_WORDSIZE" != "$XBPS_TARGET_WORDSIZE" ]; then
+	broken="webengine can be built only if word size matches"
 fi
 
-case "$XBPS_TARGET_MACHINE" in
-	arm*) broken="qt5-webengine not available" ;;
-esac
+if [ "$XBPS_TARGET_ENDIAN" != "le" ]; then
+	broken="webengine only supports little endian"
+fi

From c66086ba1d8abe4e7ef9e3840d2a72c03d195bc8 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, 21 Mar 2021 15:43:09 +0700
Subject: [PATCH 13/62] ispc: fix CMAKE_BUILD_TYPE=None

---
 .../ispc/patches/cmake-build-type-none.patch   | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
 create mode 100644 srcpkgs/ispc/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/ispc/patches/cmake-build-type-none.patch b/srcpkgs/ispc/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..411e353c7314
--- /dev/null
+++ b/srcpkgs/ispc/patches/cmake-build-type-none.patch
@@ -0,0 +1,18 @@
+Index: ispc-1.15.0/CMakeLists.txt
+===================================================================
+--- ispc-1.15.0.orig/CMakeLists.txt
++++ ispc-1.15.0/CMakeLists.txt
+@@ -157,13 +157,6 @@ set(OUTPUT_RELEASE Release/bin)
+ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin )
+ 
+ if(CMAKE_BUILD_TYPE)
+-    # Validate build type
+-    set(CONFIGURATION_TYPES "Debug;Release;RelWithDebInfo")
+-
+-    string(FIND "${CONFIGURATION_TYPES}" "${CMAKE_BUILD_TYPE}" MATCHED_CONFIG)
+-    if (${MATCHED_CONFIG} EQUAL -1)
+-         message(FATAL_ERROR "CMAKE_BUILD_TYPE (${CMAKE_BUILD_TYPE}) allows only the following values: ${CONFIGURATION_TYPES}")
+-    endif()
+ else(NOT CMAKE_BUILD_TYPE)
+     set(CMAKE_BUILD_TYPE "Release")
+     message(STATUS "Build type not specified: Use Release by default.")

From 60c669ca4aec30db988a53b583e4a17725346e95 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, 21 Mar 2021 15:56:50 +0700
Subject: [PATCH 14/62] darktable: fix CMAKE_BUILD_TYPE=None

---
 .../darktable/patches/cmake-build-type-none.patch  | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
 create mode 100644 srcpkgs/darktable/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/darktable/patches/cmake-build-type-none.patch b/srcpkgs/darktable/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..7101f9c1a0e7
--- /dev/null
+++ b/srcpkgs/darktable/patches/cmake-build-type-none.patch
@@ -0,0 +1,14 @@
+Index: src/external/rawspeed/cmake/build-type.cmake
+===================================================================
+--- src/external/rawspeed/cmake/build-type.cmake.orig
++++ src/external/rawspeed/cmake/build-type.cmake
+@@ -27,9 +27,6 @@ string(TOUPPER "${RAWSPEED_SPECIAL_BUILD
+ 
+ # is this one of the known build types?
+ list (FIND CMAKE_CONFIGURATION_TYPES_UPPERCASE ${CMAKE_BUILD_TYPE_UPPERCASE} BUILD_TYPE_IS_KNOWN)
+-if (${BUILD_TYPE_IS_KNOWN} EQUAL -1)
+- message(SEND_ERROR "Unknown build type: ${CMAKE_BUILD_TYPE_UPPERCASE}. Please specify one of: ${CMAKE_CONFIGURATION_TYPES}")
+-endif()
+ 
+ # is this a special build?
+ list (FIND RAWSPEED_SPECIAL_BUILD_TYPES_UPPERCASE ${CMAKE_BUILD_TYPE_UPPERCASE} IS_SPECIAL_BUILD)

From 44d2ca7c4f92d513693c8fd18b6a568a3a11ef69 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, 21 Mar 2021 15:33:29 +0700
Subject: [PATCH 15/62] hedgewars: merge -data back

---
 srcpkgs/hedgewars-data                        |  1 -
 .../patches/cmake-build-type-none.patch       | 30 +++++++++++++++++++
 srcpkgs/hedgewars/template                    | 23 +++++---------
 3 files changed, 38 insertions(+), 16 deletions(-)
 delete mode 120000 srcpkgs/hedgewars-data
 create mode 100644 srcpkgs/hedgewars/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/hedgewars-data b/srcpkgs/hedgewars-data
deleted file mode 120000
index b57dc45ebadc..000000000000
--- a/srcpkgs/hedgewars-data
+++ /dev/null
@@ -1 +0,0 @@
-hedgewars
\ No newline at end of file
diff --git a/srcpkgs/hedgewars/patches/cmake-build-type-none.patch b/srcpkgs/hedgewars/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..b4e0c186717c
--- /dev/null
+++ b/srcpkgs/hedgewars/patches/cmake-build-type-none.patch
@@ -0,0 +1,30 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -54,7 +54,7 @@ option(NOVERSIONINFOUPDATE "Disable upda
+ 
+ 
+ if(BUILD_ENGINE_C AND NOT NOVIDEOREC)
+-    if((CMAKE_BUILD_TYPE STREQUAL "Release") OR (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo"))
++    if((CMAKE_BUILD_TYPE STREQUAL "Release") OR (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo") OR (CMAKE_BUILD_TYPE STREQUAL "None"))
+         message("NOTE: Video recorder support disabled. It's incompatible with BUILD_ENGINE_C")
+         set(BUILD_ENGINE_C ON CACHE STRING "Required for BUILD_ENGINE_JS" FORCE)
+     else()
+@@ -93,7 +93,7 @@ set(CPACK_PACKAGE_VERSION_MAJOR 1)
+ set(CPACK_PACKAGE_VERSION_MINOR 0)
+ set(CPACK_PACKAGE_VERSION_PATCH 0)
+ set(HEDGEWARS_PROTO_VER 59)
+-if((CMAKE_BUILD_TYPE STREQUAL "Release") OR (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo"))
++if((CMAKE_BUILD_TYPE STREQUAL "Release") OR (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo") OR (CMAKE_BUILD_TYPE STREQUAL "None"))
+     set(HEDGEWARS_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
+ else()
+     set(HEDGEWARS_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}-dev")
+@@ -114,6 +114,7 @@ include(${CMAKE_MODULE_PATH}/platform.cm
+ if(CMAKE_BUILD_TYPE)
+     if(NOT((CMAKE_BUILD_TYPE STREQUAL "Release") OR
+            (CMAKE_BUILD_TYPE STREQUAL "Debug") OR
++	   (CMAKE_BUILD_TYPE STREQUAL "None") OR
+            (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")))
+         set(CMAKE_BUILD_TYPE ${default_build_type} CACHE STRING "Build type (Debug/Release/RelWithDebInfo)" FORCE)
+         message(STATUS "Unknown build type ${CMAKE_BUILD_TYPE}, using default (${default_build_type})")
diff --git a/srcpkgs/hedgewars/template b/srcpkgs/hedgewars/template
index d2294cf572f5..aed3c03caf89 100644
--- a/srcpkgs/hedgewars/template
+++ b/srcpkgs/hedgewars/template
@@ -1,15 +1,16 @@
 # Template file for 'hedgewars'
 pkgname=hedgewars
 version=1.0.0
-revision=2
+revision=3
 wrksrc="${pkgname}-src-${version}"
 build_style=cmake
 configure_args="-DNOSERVER=1 -DDATA_INSTALL_DIR=/usr/share/${pkgname}
- -DPHYSFS_SYSTEM=1 -DCMAKE_VERBOSE_MAKEFILE=1 -DMINIMAL_FLAGS=1"
-hostmakedepends="lua51 pkg-config"
+ -DPHYSFS_SYSTEM=1 -DMINIMAL_FLAGS=1"
+make_cmd=make
+hostmakedepends="lua51 pkg-config qt5-qmake qt5-host-tools"
 makedepends="ffmpeg-devel lua51-devel physfs-devel qt5-tools-devel SDL2_image-devel
  SDL2_mixer-devel SDL2_net-devel SDL2_ttf-devel"
-depends="hedgewars-data>=${version}_${revision} libfreeglut"
+depends="libfreeglut"
 short_desc="Funny turn-based artillery game, featuring fighting Hedgehogs!"
 maintainer="Jakub Skrzypnik <jot.skrzyp@gmail.com>"
 license="GPL-2.0-only"
@@ -18,10 +19,8 @@ distfiles="https://hedgewars.org/download/releases/hedgewars-src-${version}.tar.
 checksum=211634e61f2e4beecc3c98c6f749601fcd08321fda1ba969b3b3832a004f155b
 nopie_files="/usr/bin/hwengine"
 nocross="Needs investigation: fails to link hwengine"
-
-if [ -n "$CROSS_BUILD" ]; then
-	hostmakedepends+=" qt5-devel"
-fi
+replaces="hedgewars-data>=0"
+export CMAKE_GENERATOR="Unix Makefiles"
 
 case $XBPS_TARGET_MACHINE in
 	x86_64*)
@@ -38,6 +37,7 @@ esac
 
 if [ -n "$_use_c_engine" ]; then
 	hostmakedepends+=" glew-devel libatomic-devel ghc clang"
+	makedepends+=" glew-devel libatomic-devel"
 	configure_args+=" -DBUILD_ENGINE_C=1"
 	nopie_files+=" /usr/bin/hedgewars"
 fi
@@ -56,10 +56,3 @@ pre_configure() {
 post_install() {
 	vinstall ${DESTDIR}/usr/share/hedgewars/Data/misc/hedgewars.desktop 644 usr/share/applications
 }
-
-hedgewars-data_package() {
-	short_desc+=" - data files"
-	pkg_install() {
-		vmove usr/share/hedgewars/Data
-	}
-}

From 506da290088b8d18c471fd18175b53314c3e3d41 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, 21 Mar 2021 16:41:58 +0700
Subject: [PATCH 16/62] mariadb: fix for CMAKE_BUILD_TYPE=None

---
 srcpkgs/mariadb/template | 32 ++++++++++++++------------------
 1 file changed, 14 insertions(+), 18 deletions(-)

diff --git a/srcpkgs/mariadb/template b/srcpkgs/mariadb/template
index 437ff757b383..78d5e2dbdbe8 100644
--- a/srcpkgs/mariadb/template
+++ b/srcpkgs/mariadb/template
@@ -34,35 +34,31 @@ replaces="mysql>=0"
 conf_files="/etc/mysql/my.cnf"
 system_accounts="mysql"
 mysql_homedir="/var/lib/mysql"
-CFLAGS="-w -fcommon"
+CFLAGS="-w -fcommon -DDBUG_OFF=1"
+CXXFLAGS="-DDBUG_OFF=1"
 
 pre_configure() {
 	# We need some host binaries before starting cross compilation.
 	if [ "$CROSS_BUILD" ]; then
+		mkdir -p build.native
 		# XXX still broken: jemalloc configure execs host bins.
-		CC= CXX= CPP= LD= AR= AS= RANLIB= CFLAGS= CXXFLAGS= LDFLAGS= cmake .
-		make comp_err comp_sql gen_lex_hash gen_lex_token
-		mkdir bin.host
-		cp extra/comp_err bin.host
-		cp scripts/comp_sql bin.host
-		cp sql/gen_lex_hash bin.host
-		cp sql/gen_lex_token bin.host
-		make clean
-		rm CMakeCache.txt
+		CC= CXX= CPP= LD= AR= AS= RANLIB= CFLAGS= CXXFLAGS= LDFLAGS= \
+			cmake -S . -B build.native
+		make -C build.native comp_err comp_sql gen_lex_hash gen_lex_token
 	fi
 }
 
 pre_build() {
 	if [ "$CROSS_BUILD" ]; then
 		# CMake complains if those binaries ain't in build
-		cp bin.host/comp_err ${wrksrc}/extra
-		cp bin.host/comp_err ${wrksrc}/build/extra
-		cp bin.host/comp_sql ${wrksrc}/scripts
-		cp bin.host/comp_sql ${wrksrc}/build/scripts
-		cp bin.host/gen_lex_hash ${wrksrc}/sql
-		cp bin.host/gen_lex_hash ${wrksrc}/build/sql
-		cp bin.host/gen_lex_token ${wrksrc}/sql
-		cp bin.host/gen_lex_token ${wrksrc}/build/sql
+		cp build.native/extra/comp_err ${wrksrc}/extra
+		cp build.native/extra/comp_err ${wrksrc}/build/extra
+		cp build.native/scripts/comp_sql ${wrksrc}/scripts
+		cp build.native/scripts/comp_sql ${wrksrc}/build/scripts
+		cp build.native/sql/gen_lex_hash ${wrksrc}/sql
+		cp build.native/sql/gen_lex_hash ${wrksrc}/build/sql
+		cp build.native/sql/gen_lex_token ${wrksrc}/sql
+		cp build.native/sql/gen_lex_token ${wrksrc}/build/sql
 		export PATH=${PATH}:${wrksrc}/extra:${wrksrc}/scripts:${wrksrc}/sql
 	fi
 	export LD_LIBRARY_PATH=${wrksrc}/build/storage/tokudb/ft-index/portability

From ff8fdcd6c17022a6b58c323fc5298ca1188302cd 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: Thu, 25 Mar 2021 07:58:28 +0700
Subject: [PATCH 17/62] EternalTerminal: remove -ggdb3

---
 .../EternalTerminal/patches/fix-cflags.patch    | 17 +++++++++++++++++
 srcpkgs/EternalTerminal/template                |  1 +
 2 files changed, 18 insertions(+)
 create mode 100644 srcpkgs/EternalTerminal/patches/fix-cflags.patch

diff --git a/srcpkgs/EternalTerminal/patches/fix-cflags.patch b/srcpkgs/EternalTerminal/patches/fix-cflags.patch
new file mode 100644
index 000000000000..e6fcd432f7e7
--- /dev/null
+++ b/srcpkgs/EternalTerminal/patches/fix-cflags.patch
@@ -0,0 +1,17 @@
+Index: EternalTerminal-et-v6.0.13/CMakeLists.txt
+===================================================================
+--- EternalTerminal-et-v6.0.13.orig/CMakeLists.txt
++++ EternalTerminal-et-v6.0.13/CMakeLists.txt
+@@ -26,12 +26,6 @@ if(DISABLE_CRASH_LOG)
+ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DELPP_DISABLE_DEFAULT_CRASH_HANDLING")
+ ENDIF(DISABLE_CRASH_LOG)
+ 
+-if(UNIX)
+-  # Enable debug info
+-  SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -ggdb3")
+-  SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -ggdb3")
+-endif()
+-
+ # Enable C++-11
+ set(CMAKE_CXX_STANDARD 11)
+ set(CMAKE_CXX_STANDARD_REQUIRED ON)
diff --git a/srcpkgs/EternalTerminal/template b/srcpkgs/EternalTerminal/template
index 7bac78d2ffd4..bc92e47743dd 100644
--- a/srcpkgs/EternalTerminal/template
+++ b/srcpkgs/EternalTerminal/template
@@ -13,6 +13,7 @@ homepage="https://eternalterminal.dev/"
 distfiles="https://github.com/MisterTea/EternalTerminal/archive/et-v${version}.tar.gz"
 checksum=728c3a444d666897c710e33fe473d8d289263a59574451b13aa53ec3c6ac88b3
 system_accounts="_eternal"
+patch_args=-Np1
 
 LDFLAGS="-lgflags"
 

From 9b336808d37929d13024615696f4075c7242e871 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: Thu, 25 Mar 2021 08:20:29 +0700
Subject: [PATCH 18/62] OTPClient: respect CFLAGS

---
 srcpkgs/OTPClient/patches/fix-cflags.patch | 17 +++++++++++++++++
 srcpkgs/OTPClient/template                 |  1 +
 2 files changed, 18 insertions(+)
 create mode 100644 srcpkgs/OTPClient/patches/fix-cflags.patch

diff --git a/srcpkgs/OTPClient/patches/fix-cflags.patch b/srcpkgs/OTPClient/patches/fix-cflags.patch
new file mode 100644
index 000000000000..ae70f441538f
--- /dev/null
+++ b/srcpkgs/OTPClient/patches/fix-cflags.patch
@@ -0,0 +1,17 @@
+Index: OTPClient-2.4.2/CMakeLists.txt
+===================================================================
+--- OTPClient-2.4.2.orig/CMakeLists.txt
++++ OTPClient-2.4.2/CMakeLists.txt
+@@ -11,11 +11,10 @@ option(BUILD_GUI "Build the GUI" ON)
+ option(BUILD_CLI "Build the CLI" ON)
+ 
+ set(CMAKE_C_STANDARD 11)
+-set(CMAKE_C_FLAGS "-Wall -Wextra -O3 -Wformat=2 -Wmissing-format-attribute -fstack-protector-strong -Wundef -Wmissing-format-attribute")
++set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wformat=2 -Wmissing-format-attribute -fstack-protector-strong -Wundef -Wmissing-format-attribute")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fdiagnostics-color=always -Wstrict-prototypes -Wunreachable-code")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wchar-subscripts -Wwrite-strings -Wpointer-arith -Wbad-function-cast -Wcast-align")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror=format-security -Werror=implicit-function-declaration -Wno-sign-compare")
+-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3")
+ if(CMAKE_COMPILER_IS_GNUCC)
+     set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pie -fPIE")
+ endif()
diff --git a/srcpkgs/OTPClient/template b/srcpkgs/OTPClient/template
index e8c0099850b7..f5af76e655a6 100644
--- a/srcpkgs/OTPClient/template
+++ b/srcpkgs/OTPClient/template
@@ -12,3 +12,4 @@ license="GPL-3.0-or-later"
 homepage="https://github.com/paolostivanin/OTPClient"
 distfiles="https://github.com/paolostivanin/OTPClient/archive/v${version}.tar.gz"
 checksum=74bc4312aa1cd336ca983434e3bed951c5ead327091e7708e3beb08508813495
+patch_args=-Np1

From 8d03d0e0495cb61473183c527d32340b5333ea37 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: Thu, 25 Mar 2021 08:30:31 +0700
Subject: [PATCH 19/62] crex: hardening

---
 srcpkgs/crex/patches/fix-cflags.patch | 20 ++++++++++++++++++++
 srcpkgs/crex/template                 |  7 ++-----
 2 files changed, 22 insertions(+), 5 deletions(-)
 create mode 100644 srcpkgs/crex/patches/fix-cflags.patch

diff --git a/srcpkgs/crex/patches/fix-cflags.patch b/srcpkgs/crex/patches/fix-cflags.patch
new file mode 100644
index 000000000000..d191fb1e9ec0
--- /dev/null
+++ b/srcpkgs/crex/patches/fix-cflags.patch
@@ -0,0 +1,20 @@
+Index: crex-0.2.5/CMakeLists.txt
+===================================================================
+--- crex-0.2.5.orig/CMakeLists.txt
++++ crex-0.2.5/CMakeLists.txt
+@@ -13,9 +13,6 @@ endif(CCACHE_FOUND)
+ set (CMAKE_CXX_STANDARD 14)
+ set (CMAKE_CXX_STANDARD_REQUIRED ON)
+ 
+-set (CMAKE_CXX_FLAGS "-fdiagnostics-color=auto")
+-set (CMAKE_C_FLAGS "-fdiagnostics-color=auto")
+-
+ set (DEBUG_FLAGS "-Wpedantic -Wall -Wextra -Wcast-align -Wcast-qual -Wctor-dtor-privacy -Wdisabled-optimization -Wformat=2 -Winit-self -Wlogical-op -Wmissing-declarations -Wmissing-include-dirs -Wnoexcept -Wold-style-cast -Woverloaded-virtual -Wredundant-decls -Wshadow -Wsign-conversion -Wsign-promo -Wstrict-null-sentinel -Wstrict-overflow=5 -Wswitch-default -Wundef -Wno-unused -std=c++14 -g")
+ set (DEBUG_LINK_FLAGS "-fprofile-arcs -ftest-coverage -flto")
+ 
+@@ -56,4 +53,4 @@ target_link_libraries (
+   ${TARGET}
+ )
+ 
+-install (TARGETS ${TARGET} DESTINATION "/usr/local/bin")
++install (TARGETS ${TARGET} DESTINATION "/usr/bin")
diff --git a/srcpkgs/crex/template b/srcpkgs/crex/template
index a54697a93adc..2f455a0b0c72 100644
--- a/srcpkgs/crex/template
+++ b/srcpkgs/crex/template
@@ -1,7 +1,7 @@
 # Template file for 'crex'
 pkgname=crex
 version=0.2.5
-revision=1
+revision=2
 build_style=cmake
 short_desc="Explore, test, and check regular expressions in the terminal"
 maintainer="Piotr Wójcik <chocimier@tlen.pl>"
@@ -9,10 +9,7 @@ license="MIT"
 homepage="https://github.com/octobanana/crex"
 distfiles="https://github.com/octobanana/crex/archive/${version}.tar.gz"
 checksum=c6a166b7a1e696a7babeaf7c5728eece1624704a18357f827129fc95ef2ecc56
-
-pre_configure() {
-	sed -e 's|/local/|/|' -i CMakeLists.txt
-}
+patch_args=-Np1
 
 post_install() {
 	vlicense LICENSE

From 728f34e8d67bbfa0a11dd9831d76cb0d50d7de38 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: Thu, 25 Mar 2021 08:34:32 +0700
Subject: [PATCH 20/62] libbaseencode: hardening

---
 srcpkgs/libbaseencode/patches/fix-cflags.patch | 13 +++++++++++++
 srcpkgs/libbaseencode/template                 |  3 ++-
 2 files changed, 15 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/libbaseencode/patches/fix-cflags.patch

diff --git a/srcpkgs/libbaseencode/patches/fix-cflags.patch b/srcpkgs/libbaseencode/patches/fix-cflags.patch
new file mode 100644
index 000000000000..1bb86a0b15a4
--- /dev/null
+++ b/srcpkgs/libbaseencode/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: libbaseencode-1.0.9/CMakeLists.txt
+===================================================================
+--- libbaseencode-1.0.9.orig/CMakeLists.txt
++++ libbaseencode-1.0.9/CMakeLists.txt
+@@ -15,7 +15,7 @@ set(CMAKE_C_STANDARD 11)
+ set(BASEENCODE_HEADERS src/baseencode.h)
+ set(SOURCE_FILES src/base32.c src/base64.c)
+ 
+-set(CMAKE_C_FLAGS "-Wall -Werror -fPIC")
++set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Werror -fPIC")
+ 
+ add_library(${PROJECT_NAME} SHARED ${SOURCE_FILES})
+ 
diff --git a/srcpkgs/libbaseencode/template b/srcpkgs/libbaseencode/template
index 384a189224df..d5929ad7bb51 100644
--- a/srcpkgs/libbaseencode/template
+++ b/srcpkgs/libbaseencode/template
@@ -1,7 +1,7 @@
 # Template file for 'libbaseencode'
 pkgname=libbaseencode
 version=1.0.9
-revision=1
+revision=2
 build_style=cmake
 short_desc="Library for encoding decoding data use base32 or base64"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -9,6 +9,7 @@ license="Apache-2.0"
 homepage="https://github.com/paolostivanin/libbaseencode"
 distfiles="https://github.com/paolostivanin/libbaseencode/archive/v${version}.tar.gz"
 checksum=a183d7cf30d931b2a078d6f0ef64616b71ab26f9258e5f4e191778c7ace7175d
+patch_args=-Np1
 
 libbaseencode-devel_package() {
 	depends="libbaseencode-${version}_${revision}"

From 359e32d13d04fd7fd567a46b222e6b6f29ec155c 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: Fri, 26 Mar 2021 08:46:56 +0700
Subject: [PATCH 21/62] bibletime: clean build flags

---
 srcpkgs/bibletime/patches/fix-cflags.patch | 13 +++++++++++++
 srcpkgs/bibletime/template                 |  1 +
 2 files changed, 14 insertions(+)
 create mode 100644 srcpkgs/bibletime/patches/fix-cflags.patch

diff --git a/srcpkgs/bibletime/patches/fix-cflags.patch b/srcpkgs/bibletime/patches/fix-cflags.patch
new file mode 100644
index 000000000000..480c5ca4ac1e
--- /dev/null
+++ b/srcpkgs/bibletime/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: bibletime-3.0/cmake/BTApplication.cmake
+===================================================================
+--- bibletime-3.0.orig/cmake/BTApplication.cmake
++++ bibletime-3.0/cmake/BTApplication.cmake
+@@ -41,7 +41,7 @@ IF(WIN32)
+     ADD_COMPILE_OPTIONS("/Zi")
+ ELSE()
+     ADD_COMPILE_OPTIONS(
+-        "-ggdb" "-Wall" "-Wextra"
++        "-Wall" "-Wextra" "-DNDEBUG" "-DQT_NO_DEBUG"
+         "$<$<STREQUAL:$<CONFIGURATION>,Release>:-O2>"
+         "$<$<STREQUAL:$<CONFIGURATION>,Release>:-DNDEBUG>"
+         "$<$<STREQUAL:$<CONFIGURATION>,Release>:-DQT_NO_DEBUG>"
diff --git a/srcpkgs/bibletime/template b/srcpkgs/bibletime/template
index 224881c45516..85bcc7f22f87 100644
--- a/srcpkgs/bibletime/template
+++ b/srcpkgs/bibletime/template
@@ -18,6 +18,7 @@ license="GPL-2.0-or-later"
 homepage="http://bibletime.info"
 distfiles="https://github.com/bibletime/bibletime/releases/download/v${version}/bibletime-${version}.tar.xz"
 checksum=d6beef62ad44b255e3dc4c5e89214bf01a0e85c9136073b0be12fca3d2b22622
+patch_args=-Np1
 
 pre_build() {
 	. /etc/profile.d/10_openjdk11.sh

From bd44d20ccc41640d64d0258a777d4ab688f62857 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: Fri, 26 Mar 2021 08:54:25 +0700
Subject: [PATCH 22/62] boomerang: clean build flags

---
 srcpkgs/boomerang/patches/fix-cflags.patch | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
 create mode 100644 srcpkgs/boomerang/patches/fix-cflags.patch

diff --git a/srcpkgs/boomerang/patches/fix-cflags.patch b/srcpkgs/boomerang/patches/fix-cflags.patch
new file mode 100644
index 000000000000..eb59766c1c5b
--- /dev/null
+++ b/srcpkgs/boomerang/patches/fix-cflags.patch
@@ -0,0 +1,21 @@
+Index: cmake-scripts/boomerang-flags.cmake
+===================================================================
+--- cmake-scripts/boomerang-flags.cmake
++++ cmake-scripts/boomerang-flags.cmake
+@@ -104,16 +104,6 @@ endif ()
+ 
+ 
+ if (NOT MSVC)
+-    if ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
+-        BOOMERANG_ADD_COMPILE_FLAGS(-O0)
+-    elseif ("${CMAKE_BUILD_TYPE}" STREQUAL "RelWithDebInfo")
+-        # No special flags
+-    elseif ("${CMAKE_BUILD_TYPE}" STREQUAL "MinSizeRel")
+-        BOOMERANG_ADD_COMPILE_FLAGS(-Os)
+-    else () # Release
+-        BOOMERANG_ADD_COMPILE_FLAGS(-O3)
+-    endif ()
+-
+     if (BOOMERANG_ENABLE_COVERAGE)
+         set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fprofile-arcs -ftest-coverage")
+         set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage")

From 3445376404523fb1b4fa6b9ebdbe3f393b56036e 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: Fri, 26 Mar 2021 08:58:11 +0700
Subject: [PATCH 23/62] catimg: don't change our build-type

---
 srcpkgs/catimg/patches/fix-cflags.patch | 12 ++++++++++++
 srcpkgs/catimg/template                 |  2 +-
 2 files changed, 13 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/catimg/patches/fix-cflags.patch

diff --git a/srcpkgs/catimg/patches/fix-cflags.patch b/srcpkgs/catimg/patches/fix-cflags.patch
new file mode 100644
index 000000000000..9b9f1074ef20
--- /dev/null
+++ b/srcpkgs/catimg/patches/fix-cflags.patch
@@ -0,0 +1,12 @@
+Index: catimg-2.7.0/CMakeLists.txt
+===================================================================
+--- catimg-2.7.0.orig/CMakeLists.txt
++++ catimg-2.7.0/CMakeLists.txt
+@@ -11,7 +11,6 @@ endif()
+ #set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wall -Wextra -g -std=c99 -Wno-unused-result")
+ #set(CMAKE_BUILD_TYPE Debug)
+ set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -Wall -Wextra -Os -std=c99 -Wno-unused-result")
+-set(CMAKE_BUILD_TYPE Release)
+ 
+ set(SRC ${PROJECT_SOURCE_DIR}/src)
+ 
diff --git a/srcpkgs/catimg/template b/srcpkgs/catimg/template
index 374351c45379..6fbc5f1d9140 100644
--- a/srcpkgs/catimg/template
+++ b/srcpkgs/catimg/template
@@ -9,7 +9,7 @@ license="MIT"
 homepage="https://github.com/posva/catimg"
 distfiles="https://github.com/posva/catimg/archive/${version}.tar.gz"
 checksum=3a6450316ff62fb07c3facb47ea208bf98f62abd02783e88c56f2a6508035139
-
+patch_args=-Np1
 CFLAGS="-fcommon"
 
 post_install() {

From cc06dd52ae25bd4d8f7ee25c595a3f9361da1faf 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: Fri, 26 Mar 2021 09:09:37 +0700
Subject: [PATCH 24/62] libcotp: fix build flags

---
 srcpkgs/libcotp/patches/fix-cflags.patch | 14 ++++++++++++++
 srcpkgs/libcotp/template                 |  1 +
 2 files changed, 15 insertions(+)
 create mode 100644 srcpkgs/libcotp/patches/fix-cflags.patch

diff --git a/srcpkgs/libcotp/patches/fix-cflags.patch b/srcpkgs/libcotp/patches/fix-cflags.patch
new file mode 100644
index 000000000000..397b3960e9f4
--- /dev/null
+++ b/srcpkgs/libcotp/patches/fix-cflags.patch
@@ -0,0 +1,14 @@
+Index: libcotp-1.2.2/CMakeLists.txt
+===================================================================
+--- libcotp-1.2.2.orig/CMakeLists.txt
++++ libcotp-1.2.2/CMakeLists.txt
+@@ -25,8 +25,7 @@ set(CMAKE_C_STANDARD 11)
+ set(COTP_HEADERS src/cotp.h)
+ set(SOURCE_FILES src/otp.c)
+ 
+-set(CMAKE_C_FLAGS "-Wall -Wextra -O3 -Wno-format-truncation -fstack-protector-strong -fPIC")
+-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3")
++set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wno-format-truncation -fstack-protector-strong -fPIC")
+ 
+ add_library(cotp SHARED ${SOURCE_FILES})
+ 
diff --git a/srcpkgs/libcotp/template b/srcpkgs/libcotp/template
index 9e147ff7deb6..88337290d1e8 100644
--- a/srcpkgs/libcotp/template
+++ b/srcpkgs/libcotp/template
@@ -11,6 +11,7 @@ license="Apache-2.0"
 homepage="https://github.com/paolostivanin/libcotp"
 distfiles="https://github.com/paolostivanin/libcotp/archive/v${version}.tar.gz"
 checksum=25b45ffa4aece5cc689503ebea7356a2f760c194f0c41805934495d2fe7165b1
+patch_args=-Np1
 
 libcotp-devel_package() {
 	depends="libcotp-${version}_${revision}"

From cb8a31aca2c128beca0eae35f6dcb058bc29c0d6 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: Fri, 26 Mar 2021 21:06:07 +0700
Subject: [PATCH 25/62] loudgain: hardening

---
 srcpkgs/loudgain/patches/fix-cflags.patch | 20 ++++++++++++++++++++
 srcpkgs/loudgain/template                 |  3 ++-
 2 files changed, 22 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/loudgain/patches/fix-cflags.patch

diff --git a/srcpkgs/loudgain/patches/fix-cflags.patch b/srcpkgs/loudgain/patches/fix-cflags.patch
new file mode 100644
index 000000000000..25b2c969bef4
--- /dev/null
+++ b/srcpkgs/loudgain/patches/fix-cflags.patch
@@ -0,0 +1,20 @@
+Index: loudgain-0.6.8/CMakeLists.txt
+===================================================================
+--- loudgain-0.6.8.orig/CMakeLists.txt
++++ loudgain-0.6.8/CMakeLists.txt
+@@ -69,12 +69,12 @@ TARGET_LINK_LIBRARIES(loudgain
+ )
+ 
+ SET_TARGET_PROPERTIES(loudgain PROPERTIES
+-  COMPILE_FLAGS "-Wall -pedantic -g"
++  COMPILE_FLAGS "-Wall -pedantic"
+ )
+ 
+-SET(CMAKE_C_FLAGS "-std=gnu99 -D_GNU_SOURCE")
++SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99 -D_GNU_SOURCE")
+ 
+-SET(CMAKE_CXX_FLAGS "-std=gnu++11 -D_GNU_SOURCE")
++SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11 -D_GNU_SOURCE")
+ 
+ INSTALL(TARGETS loudgain DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
+ 
diff --git a/srcpkgs/loudgain/template b/srcpkgs/loudgain/template
index f29167883439..00b2d20d27d6 100644
--- a/srcpkgs/loudgain/template
+++ b/srcpkgs/loudgain/template
@@ -1,7 +1,7 @@
 # Template file for 'loudgain'
 pkgname=loudgain
 version=0.6.8
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="pkg-config"
 makedepends="libebur128-devel taglib-devel ffmpeg-devel"
@@ -11,6 +11,7 @@ license="BSD-2-Clause"
 homepage="https://github.com/Moonbase59/loudgain"
 distfiles="https://github.com/Moonbase59/loudgain/archive/v${version}.tar.gz"
 checksum=1137c193ad941b366e87c5d84ccc95a7aa8571affc060db0bd1cf72c489aeaee
+patch_args=-Np1
 
 post_install() {
 	vlicense COPYING

From 47dc3039449e0a572e4b9d6902bb0441b72e4a1f 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: Fri, 26 Mar 2021 21:20:13 +0700
Subject: [PATCH 26/62] msg2: hardening

---
 srcpkgs/msg2/patches/fix-cflags.patch | 13 +++++++++++++
 srcpkgs/msg2/template                 |  2 +-
 2 files changed, 14 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/msg2/patches/fix-cflags.patch

diff --git a/srcpkgs/msg2/patches/fix-cflags.patch b/srcpkgs/msg2/patches/fix-cflags.patch
new file mode 100644
index 000000000000..64404bf44fcb
--- /dev/null
+++ b/srcpkgs/msg2/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -3,7 +3,7 @@ project(msg2)
+ 
+ # Flags
+ set(CMAKE_CXX_STANDARD 17)
+-set(CMAKE_CXX_FLAGS "-Os -pipe -fPIC -fno-plt -fstack-protector-strong -Wall -Wshadow -pedantic -Wno-parentheses -Wfatal-errors")
++set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pipe -fPIC -fno-plt -fstack-protector-strong -Wall -Wshadow -pedantic -Wno-parentheses -Wfatal-errors")
+ 
+ # Add source files
+ add_executable(msg2 main.cpp)
diff --git a/srcpkgs/msg2/template b/srcpkgs/msg2/template
index b4f77400bf22..473b3c4ec4d2 100644
--- a/srcpkgs/msg2/template
+++ b/srcpkgs/msg2/template
@@ -1,7 +1,7 @@
 # Template file for 'msg2'
 pkgname=msg2
 version=1.2.0
-revision=1
+revision=2
 build_style=cmake
 short_desc="Output a blue arrow and a white message on the commandline"
 maintainer="Orphaned <orphan@voidlinux.org>"

From fbd5ef8b54ec5612810d0acead4e46b55915e939 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: Fri, 26 Mar 2021 21:22:55 +0700
Subject: [PATCH 27/62] ippusbxd: fix cflags -O2 not -o2

---
 srcpkgs/ippusbxd/patches/fix-cflags.patch | 12 ++++++++++++
 srcpkgs/ippusbxd/template                 |  2 +-
 2 files changed, 13 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/ippusbxd/patches/fix-cflags.patch

diff --git a/srcpkgs/ippusbxd/patches/fix-cflags.patch b/srcpkgs/ippusbxd/patches/fix-cflags.patch
new file mode 100644
index 000000000000..5d36903c3ffd
--- /dev/null
+++ b/srcpkgs/ippusbxd/patches/fix-cflags.patch
@@ -0,0 +1,12 @@
+Index: src/CMakeLists.txt
+===================================================================
+--- src/CMakeLists.txt.orig
++++ src/CMakeLists.txt
+@@ -1,6 +1,6 @@
+ cmake_minimum_required(VERSION 2.6)
+ project(ippusbxd)
+-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -o2 -g -std=c99 -Wall -Wextra -pedantic -pedantic-errors")
++set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -Wall -Wextra -pedantic -pedantic-errors")
+ 
+ 
+ # Compiler specific configuration
diff --git a/srcpkgs/ippusbxd/template b/srcpkgs/ippusbxd/template
index ce4ff2ea9125..e81064e8b91d 100644
--- a/srcpkgs/ippusbxd/template
+++ b/srcpkgs/ippusbxd/template
@@ -1,7 +1,7 @@
 # Template file for 'ippusbxd'
 pkgname=ippusbxd
 version=1.34
-revision=1
+revision=2
 build_wrksrc=src
 build_style=cmake
 make_cmd=make

From 188e0f52d7b391394f0850380efecd9626e1c6bf 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: Fri, 26 Mar 2021 21:34:52 +0700
Subject: [PATCH 28/62] tlsh: respect -g + hardening

---
 srcpkgs/tlsh/patches/fix-cflags.patch | 13 +++++++++++++
 srcpkgs/tlsh/template                 |  2 +-
 2 files changed, 14 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/tlsh/patches/fix-cflags.patch

diff --git a/srcpkgs/tlsh/patches/fix-cflags.patch b/srcpkgs/tlsh/patches/fix-cflags.patch
new file mode 100644
index 000000000000..8715563715c7
--- /dev/null
+++ b/srcpkgs/tlsh/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -125,7 +125,7 @@ if (CMAKE_BUILD_TYPE STREQUAL Debug)
+     endif()
+ else(CMAKE_BUILD_TYPE STREQUAL Debug)
+     if(CMAKE_COMPILER_IS_GNUCXX)
+-        set(CMAKE_CXX_FLAGS "-O2 -fvisibility=internal")  ## Remove TlshImpl symbols
++        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=internal")  ## Remove TlshImpl symbols
+     endif()
+     if(MSVC)
+         set(CMAKE_CXX_FLAGS "/O2")        ## Optimize
diff --git a/srcpkgs/tlsh/template b/srcpkgs/tlsh/template
index 1f96834107cc..4ee1ccdc728a 100644
--- a/srcpkgs/tlsh/template
+++ b/srcpkgs/tlsh/template
@@ -1,7 +1,7 @@
 # Template file for 'tlsh'
 pkgname=tlsh
 version=3.19.1
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="python3"
 makedepends="python3-devel"

From 2443935600b7517b625bf34f802a4746210f43f6 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: Fri, 26 Mar 2021 21:59:06 +0700
Subject: [PATCH 29/62] poppler: hardening + respect -g

---
 srcpkgs/poppler/patches/fix-cflags.patch | 21 +++++++++++++++++++++
 srcpkgs/poppler/template                 |  2 +-
 2 files changed, 22 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/poppler/patches/fix-cflags.patch

diff --git a/srcpkgs/poppler/patches/fix-cflags.patch b/srcpkgs/poppler/patches/fix-cflags.patch
new file mode 100644
index 000000000000..9e62b11010ba
--- /dev/null
+++ b/srcpkgs/poppler/patches/fix-cflags.patch
@@ -0,0 +1,21 @@
+Index: cmake/modules/PopplerMacros.cmake
+===================================================================
+--- cmake/modules/PopplerMacros.cmake.orig
++++ cmake/modules/PopplerMacros.cmake
+@@ -123,14 +123,14 @@ if(CMAKE_COMPILER_IS_GNUCXX)
+   set(DEFAULT_COMPILE_WARNINGS_EXTRA "${_warn} ${_warnx}")
+ 
+   set(_save_cxxflags "${CMAKE_CXX_FLAGS}")
+-  set(CMAKE_CXX_FLAGS                "-fno-exceptions -fno-check-new -fno-common -D_DEFAULT_SOURCE")
++  set(CMAKE_CXX_FLAGS                "-fno-exceptions -fno-check-new -fno-common -D_DEFAULT_SOURCE ${_save_cxxflags}")
+   set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g ${_save_cxxflags}")
+   set(CMAKE_CXX_FLAGS_RELEASE        "-O2 -DNDEBUG ${_save_cxxflags}")
+   set(CMAKE_CXX_FLAGS_DEBUG          "-g -O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline ${_save_cxxflags}")
+   set(CMAKE_CXX_FLAGS_DEBUGFULL      "-g3 -fno-inline ${_save_cxxflags}")
+   set(CMAKE_CXX_FLAGS_PROFILE        "-g3 -fno-inline -ftest-coverage -fprofile-arcs ${_save_cxxflags}")
+   set(_save_cflags "${CMAKE_C_FLAGS}")
+-  set(CMAKE_C_FLAGS                  "-std=c99 -D_DEFAULT_SOURCE")
++  set(CMAKE_C_FLAGS                  "-std=c99 -D_DEFAULT_SOURCE ${_save_cflags}")
+   set(CMAKE_C_FLAGS_RELWITHDEBINFO   "-O2 -g ${_save_cflags}")
+   set(CMAKE_C_FLAGS_RELEASE          "-O2 -DNDEBUG ${_save_cflags}")
+   set(CMAKE_C_FLAGS_DEBUG            "-g -O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline ${_save_cflags}")
diff --git a/srcpkgs/poppler/template b/srcpkgs/poppler/template
index ed0db8de7ab6..1aebd7f7e177 100644
--- a/srcpkgs/poppler/template
+++ b/srcpkgs/poppler/template
@@ -4,7 +4,7 @@
 #
 pkgname=poppler
 version=20.09.0
-revision=2
+revision=3
 build_style=cmake
 build_helper="gir"
 configure_args="-DENABLE_UNSTABLE_API_ABI_HEADERS=ON -DENABLE_CPP=ON

From 412ed3716b35dfbad20203e2d2ec2fb8cef1f572 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: Fri, 26 Mar 2021 21:59:29 +0700
Subject: [PATCH 30/62] poppler-qt5: hardening + respect -g

---
 srcpkgs/poppler-qt5/patches  | 1 +
 srcpkgs/poppler-qt5/template | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)
 create mode 120000 srcpkgs/poppler-qt5/patches

diff --git a/srcpkgs/poppler-qt5/patches b/srcpkgs/poppler-qt5/patches
new file mode 120000
index 000000000000..636e4ac2cbd9
--- /dev/null
+++ b/srcpkgs/poppler-qt5/patches
@@ -0,0 +1 @@
+../poppler/patches
\ No newline at end of file
diff --git a/srcpkgs/poppler-qt5/template b/srcpkgs/poppler-qt5/template
index 0dc45c05c58b..c2ec35dbbad3 100644
--- a/srcpkgs/poppler-qt5/template
+++ b/srcpkgs/poppler-qt5/template
@@ -5,7 +5,7 @@
 #
 pkgname=poppler-qt5
 version=20.09.0
-revision=1
+revision=2
 wrksrc="poppler-${version}"
 build_style=cmake
 configure_args="-DENABLE_UNSTABLE_API_ABI_HEADERS=ON -DENABLE_GLIB=OFF

From 2953efa5fadb9e92de2278a63adda7e7b139236b 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: Sat, 27 Mar 2021 11:17:35 +0700
Subject: [PATCH 31/62] artyfx: remove -O1 -g

---
 srcpkgs/artyfx/patches/fix-avtk-cmake-sse.patch | 4 ++--
 srcpkgs/artyfx/patches/respect-our-cflags.patch | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/artyfx/patches/fix-avtk-cmake-sse.patch b/srcpkgs/artyfx/patches/fix-avtk-cmake-sse.patch
index 1a832155a566..47ef4dd9b84e 100644
--- a/srcpkgs/artyfx/patches/fix-avtk-cmake-sse.patch
+++ b/srcpkgs/artyfx/patches/fix-avtk-cmake-sse.patch
@@ -6,8 +6,8 @@
  
 -SET(CMAKE_C_FLAGS   "-fPIC -msse -msse2 -mfpmath=sse -g") # -fsanitize=address
 -SET(CMAKE_CXX_FLAGS "-fPIC -msse -msse2 -mfpmath=sse -g") # -fsanitize=address
-+SET(CMAKE_C_FLAGS   "${CMAKE_C_FLAGS} -fPIC -g") # -fsanitize=address
-+SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -g") # -fsanitize=address
++SET(CMAKE_C_FLAGS   "${CMAKE_C_FLAGS} -fPIC") # -fsanitize=address
++SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") # -fsanitize=address
 +
 +IF(BUILD_SSE)
 +	SET(CMAKE_C_FLAGS   "${CMAKE_C_FLAGS} -msse -msse2 -mfpmath=sse")
diff --git a/srcpkgs/artyfx/patches/respect-our-cflags.patch b/srcpkgs/artyfx/patches/respect-our-cflags.patch
index ee9155c7729e..7a32fd9df73b 100644
--- a/srcpkgs/artyfx/patches/respect-our-cflags.patch
+++ b/srcpkgs/artyfx/patches/respect-our-cflags.patch
@@ -10,8 +10,8 @@ Index: CMakeLists.txt
 -SET(CMAKE_C_FLAGS "-g -Wall -O1 -Wno-unused-variable")
 -SET(CMAKE_CXX_FLAGS "-g -Wall -O1 -Wno-unused-variable -ftree-vectorize")
 +SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fPIC -shared -L./src/avtk -Wl,--no-undefined")
-+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -Wall -O1 -Wno-unused-variable")
-+SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -Wall -O1 -Wno-unused-variable -ftree-vectorize")
++SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall  -Wno-unused-variable")
++SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall  -Wno-unused-variable -ftree-vectorize")
  
  
  # DSP sources

From 54ef15e5ad46cc417be3da8b496a2d25bfa55674 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: Sat, 27 Mar 2021 11:27:28 +0700
Subject: [PATCH 32/62] coin3: build with CMAKE_BUILD_TYPE=None

---
 srcpkgs/coin3/template | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/coin3/template b/srcpkgs/coin3/template
index d5483ee048c3..8f7218c2e8c3 100644
--- a/srcpkgs/coin3/template
+++ b/srcpkgs/coin3/template
@@ -5,7 +5,7 @@ revision=1
 wrksrc="coin-Coin-${version}"
 build_style=cmake
 configure_args="-DCMAKE_INSTALL_INCLUDEDIR=/usr/include/Coin3
- -DCMAKE_BUILD_TYPE=Release -DCOIN_BUILD_TESTS=OFF -DCOIN_BUILD_DOCUMENTATION=ON"
+ -DCOIN_BUILD_TESTS=OFF -DCOIN_BUILD_DOCUMENTATION=ON"
 hostmakedepends="doxygen graphviz"
 makedepends="boost-devel glu-devel"
 short_desc="High-level 3D graphics toolkit"
@@ -15,6 +15,9 @@ homepage="https://coin3d.github.io/"
 distfiles="https://github.com/coin3d/coin/archive/Coin-${version}.tar.gz"
 checksum=b00d2a8e9d962397cf9bf0d9baa81bcecfbd16eef675a98c792f5cf49eb6e805
 
+CFLAGS=-DNDEBUG
+CXXFLAGS=-DNDEBUG
+
 if [ "$CROSS_BUILD" ]; then
 	# bypass runtime test (quote hashing is fine with gcc 9.3)
 	configure_args+=" -DHAVE_HASH_QUOTING_EXITCODE=0"

From 0a360e5313e1b554fe0d1bc69aec7fa5f8f19e82 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: Sat, 27 Mar 2021 11:46:46 +0700
Subject: [PATCH 33/62] conky: don't overwrite CMAKE_BUILD_TYPE

---
 srcpkgs/conky/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/conky/template b/srcpkgs/conky/template
index 8b95a628edfb..f05c7d4a1bf2 100644
--- a/srcpkgs/conky/template
+++ b/srcpkgs/conky/template
@@ -5,7 +5,7 @@ version=1.12.1
 revision=1
 build_style=cmake
 conf_files="/etc/conky/conky.conf /etc/conky/conky_no_x11.conf"
-configure_args="-DCMAKE_BUILD_TYPE=Release -DMAINTAINER_MODE=ON -DRELEASE=ON
+configure_args="-DMAINTAINER_MODE=ON -DRELEASE=ON
  -DDOC_PATH=share/doc/${pkgname} -DBUILD_X11=ON -DBUILD_CURL=ON -DBUILD_XDBE=ON
  -DBUILD_RSS=ON -DBUILD_WEATHER_METAR=ON -DBUILD_IMLIB2=ON -DBUILD_WLAN=ON
  -DBUILD_LUA_CAIRO=ON -DBUILD_LUA_IMLIB2=ON -DBUILD_LUA_RSVG=ON

From 75aa1643ec700309fff57295c1b5d181a9691fbf 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: Sat, 27 Mar 2021 11:46:46 +0700
Subject: [PATCH 34/62] conky-cli: don't overwrite CMAKE_BUILD_TYPE

---
 srcpkgs/conky-cli/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/conky-cli/template b/srcpkgs/conky-cli/template
index b61bdcca0504..7d512b65ab3e 100644
--- a/srcpkgs/conky-cli/template
+++ b/srcpkgs/conky-cli/template
@@ -6,7 +6,7 @@ revision=1
 wrksrc="${pkgname/-cli/}-${version}"
 build_style=cmake
 conf_files="/etc/conky/conky.conf /etc/conky/conky_no_x11.conf"
-configure_args="-DCMAKE_BUILD_TYPE=Release -DMAINTAINER_MODE=ON -DRELEASE=ON
+configure_args="-DMAINTAINER_MODE=ON -DRELEASE=ON
  -DDOC_PATH=share/doc/${pkgname} -DBUILD_X11=OFF -DBUILD_CURL=ON -DBUILD_XDBE=OFF
  -DBUILD_RSS=ON -DBUILD_WEATHER_METAR=OFF -DBUILD_IMLIB2=OFF -DBUILD_WLAN=ON
  -DBUILD_DOCS=ON"

From b3306426e0c162a7cda21d6ec57ac1ad1223f56d 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: Sat, 27 Mar 2021 11:48:25 +0700
Subject: [PATCH 35/62] crossguid: don't overwrite -O2

---
 srcpkgs/crossguid/fix-cflags.patch | 12 ++++++++++++
 1 file changed, 12 insertions(+)
 create mode 100644 srcpkgs/crossguid/fix-cflags.patch

diff --git a/srcpkgs/crossguid/fix-cflags.patch b/srcpkgs/crossguid/fix-cflags.patch
new file mode 100644
index 000000000000..983360a07ccf
--- /dev/null
+++ b/srcpkgs/crossguid/fix-cflags.patch
@@ -0,0 +1,12 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -2,7 +2,6 @@ cmake_minimum_required(VERSION 3.5.1)
+ project(CrossGuid)
+ 
+ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake")
+-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3")
+ 
+ option(XG_TESTS "Build test runner" ON)
+ 

From d6e15b805548feae74b2f8b03f850f377513cddc 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: Sat, 27 Mar 2021 12:19:04 +0700
Subject: [PATCH 36/62] rapidjson: define -DNDEBUG

---
 srcpkgs/rapidjson/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/rapidjson/template b/srcpkgs/rapidjson/template
index 8597f8fb2706..99d92702cc9d 100644
--- a/srcpkgs/rapidjson/template
+++ b/srcpkgs/rapidjson/template
@@ -11,7 +11,7 @@ distfiles="https://github.com/miloyip/${pkgname}/archive/v${version}.tar.gz"
 checksum=bf7ced29704a1e696fbccf2a2b4ea068e7774fa37f6d7dd4039d0787f8bed98e
 
 # class-memaccess is required by https://github.com/Tencent/rapidjson/issues/1700
-CXXFLAGS="-Wno-type-limits -Wno-error=class-memaccess"
+CXXFLAGS="-Wno-type-limits -Wno-error=class-memaccess -DNDEBUG"
 
 post_patch() {
 	# Remove bin/jsonchecker, which is the JSON licensed files

From 75538f2d541d4e4669304a75b2d548b06725d665 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: Sat, 27 Mar 2021 12:18:36 +0700
Subject: [PATCH 37/62] cura-engine: ignore -O3

---
 srcpkgs/cura-engine/patches/fix-cflags.patch | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 srcpkgs/cura-engine/patches/fix-cflags.patch

diff --git a/srcpkgs/cura-engine/patches/fix-cflags.patch b/srcpkgs/cura-engine/patches/fix-cflags.patch
new file mode 100644
index 000000000000..e48a665523b8
--- /dev/null
+++ b/srcpkgs/cura-engine/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -42,7 +42,7 @@ endif()
+ if(CMAKE_BUILD_TYPE_UPPER MATCHES "DEBUG")
+     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_DEBUG_INIT}")
+ else()
+-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELEASE_INIT}")
++    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DNDEBUG")
+ endif()
+ 
+ set(CMAKE_CXX_STANDARD 11)

From 0afccc09d42ba2d2e4697a3d5eca11b9437ee34f 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: Sat, 27 Mar 2021 12:22:29 +0700
Subject: [PATCH 38/62] dislocker: remove -O1

---
 srcpkgs/dislocker/patches/fix-cflags.patch | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 srcpkgs/dislocker/patches/fix-cflags.patch

diff --git a/srcpkgs/dislocker/patches/fix-cflags.patch b/srcpkgs/dislocker/patches/fix-cflags.patch
new file mode 100644
index 000000000000..1229efeeaf0c
--- /dev/null
+++ b/srcpkgs/dislocker/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: src/CMakeLists.txt
+===================================================================
+--- src/CMakeLists.txt.orig
++++ src/CMakeLists.txt
+@@ -71,7 +71,7 @@ if(NOT DEFINED WARN_FLAGS)
+ 	set (WARN_FLAGS "-Wall -Wextra" CACHE STRING "" FORCE)
+ endif()
+ if(NOT DEFINED HARDEN_FLAGS)
+-	set (HARDEN_FLAGS "-fstack-protector -fstrict-aliasing -D_FORTIFY_SOURCE=2 -O1" CACHE STRING "" FORCE)
++	set (HARDEN_FLAGS "-fstack-protector -fstrict-aliasing" CACHE STRING "" FORCE)
+ endif()
+ 
+ set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")

From 3f008be63f28d88939de78b96ef1e5928254ba2d 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: Sat, 27 Mar 2021 12:29:31 +0700
Subject: [PATCH 39/62] freeorion: remove -O3

---
 srcpkgs/freeorion/patches/fix-cflags.patch | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
 create mode 100644 srcpkgs/freeorion/patches/fix-cflags.patch

diff --git a/srcpkgs/freeorion/patches/fix-cflags.patch b/srcpkgs/freeorion/patches/fix-cflags.patch
new file mode 100644
index 000000000000..c66d54599556
--- /dev/null
+++ b/srcpkgs/freeorion/patches/fix-cflags.patch
@@ -0,0 +1,18 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -432,13 +432,6 @@ if(MSVC)
+     )
+ endif()
+ 
+-target_compile_options(freeorionparseobj
+-    PRIVATE
+-        $<$<CXX_COMPILER_ID:Clang>:-ftemplate-depth=512>
+-        $<$<CXX_COMPILER_ID:AppleClang>:-ftemplate-depth=512>
+-        $<$<AND:$<NOT:$<BOOL:${BUILD_TESTING}>>,$<CXX_COMPILER_ID:GNU>>:-O3>
+-)
+-
+ target_compile_definitions(freeorionparseobj
+     PUBLIC
+         -DBOOST_ALL_DYN_LINK

From ce76fb0882ae229481bc8440d125f5eebf6da9f9 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: Fri, 26 Mar 2021 09:01:12 +0700
Subject: [PATCH 40/62] cglm: fix build flags

---
 srcpkgs/cglm/patches/fix-cflags.patch | 13 +++++++++++++
 srcpkgs/cglm/template                 |  1 +
 2 files changed, 14 insertions(+)
 create mode 100644 srcpkgs/cglm/patches/fix-cflags.patch

diff --git a/srcpkgs/cglm/patches/fix-cflags.patch b/srcpkgs/cglm/patches/fix-cflags.patch
new file mode 100644
index 000000000000..c74de6ea62d7
--- /dev/null
+++ b/srcpkgs/cglm/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: cglm-0.7.6/CMakeLists.txt
+===================================================================
+--- cglm-0.7.6.orig/CMakeLists.txt
++++ cglm-0.7.6/CMakeLists.txt
+@@ -25,7 +25,7 @@ if(MSVC)
+ 	add_definitions(-DNDEBUG -D_WINDOWS -D_USRDLL -DCGLM_EXPORTS -DCGLM_DLL)
+ 	add_compile_options(/W3 /Ox /Gy /Oi /TC)
+ else()
+-  add_compile_options(-Wall -Werror -O3)
++  add_compile_options(-Wall)
+ endif()
+ 
+ if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
diff --git a/srcpkgs/cglm/template b/srcpkgs/cglm/template
index f00a093edab9..311b4c79a7d3 100644
--- a/srcpkgs/cglm/template
+++ b/srcpkgs/cglm/template
@@ -9,6 +9,7 @@ license="MIT"
 homepage="https://github.com/recp/cglm"
 distfiles="https://github.com/recp/cglm/archive/v${version}.tar.gz"
 checksum=29ff8af4edc03697e36d3e6f99a80b884a80ee09d46055ce45765e5d6b2456d9
+patch_args=-Np1
 
 post_install() {
 	vlicense LICENSE

From f33b9b6e9fb6488a49e2b01e1e6f7b0a52b5c843 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: Sat, 27 Mar 2021 12:36:19 +0700
Subject: [PATCH 41/62] glyr: don't force Release build

---
 srcpkgs/glyr/patches/fix-cflags.patch | 12 ++++++++++++
 1 file changed, 12 insertions(+)
 create mode 100644 srcpkgs/glyr/patches/fix-cflags.patch

diff --git a/srcpkgs/glyr/patches/fix-cflags.patch b/srcpkgs/glyr/patches/fix-cflags.patch
new file mode 100644
index 000000000000..498ffe09a38f
--- /dev/null
+++ b/srcpkgs/glyr/patches/fix-cflags.patch
@@ -0,0 +1,12 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -60,7 +60,6 @@ exec_program(
+ IF(CMAKE_BUILD_TYPE STREQUAL "debug")
+     SET(GLYR_DEBUG TRUE)
+ ELSE()
+-    SET(CMAKE_BUILD_TYPE "release")
+     SET(GLYR_DEBUG FALSE)
+ ENDIF()
+ MESSAGE("-- Building Target: ${CMAKE_BUILD_TYPE}")

From 4e65b9eb39a8ceaa4cd55c7356098a8d2d17e1f5 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: Sat, 27 Mar 2021 12:41:50 +0700
Subject: [PATCH 42/62] hugin: remove -O3

---
 srcpkgs/hugin/patches/fix-cflags.patch | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
 create mode 100644 srcpkgs/hugin/patches/fix-cflags.patch

diff --git a/srcpkgs/hugin/patches/fix-cflags.patch b/srcpkgs/hugin/patches/fix-cflags.patch
new file mode 100644
index 000000000000..02fa56bef0e1
--- /dev/null
+++ b/srcpkgs/hugin/patches/fix-cflags.patch
@@ -0,0 +1,15 @@
+Index: src/celeste/CMakeLists.txt
+===================================================================
+--- src/celeste/CMakeLists.txt.orig
++++ src/celeste/CMakeLists.txt
+@@ -16,10 +16,6 @@
+ #    You should have received a copy of the GNU General Public License
+ #    along with Hugin  If not, see <http://www.gnu.org/licenses/>.
+  
+-IF(NOT WIN32)
+-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3")
+-ENDIF(NOT WIN32)
+-
+ # a list of all files belonging to celeste library
+ 
+ SET(CELESTE_SRC

From dbebdfb098cde201711b1bac36273c563a5cb64f 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: Sat, 27 Mar 2021 13:05:27 +0700
Subject: [PATCH 43/62] ledger: don't overwrite CMAKE_BUILD_TYPE

---
 srcpkgs/ledger/patches/fix-cflags.patch | 12 ++++++++++++
 1 file changed, 12 insertions(+)
 create mode 100644 srcpkgs/ledger/patches/fix-cflags.patch

diff --git a/srcpkgs/ledger/patches/fix-cflags.patch b/srcpkgs/ledger/patches/fix-cflags.patch
new file mode 100644
index 000000000000..179ab79cd148
--- /dev/null
+++ b/srcpkgs/ledger/patches/fix-cflags.patch
@@ -0,0 +1,12 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -41,7 +41,6 @@ if (BUILD_DEBUG)
+   set(CMAKE_BUILD_TYPE Debug)
+   set(DEBUG_MODE 1)
+ else()
+-  set(CMAKE_BUILD_TYPE Release)
+   set(DEBUG_MODE 0)
+ endif()
+ 

From 095bfd20a17ce9de70d256ba7476668a2568e6f2 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: Sat, 27 Mar 2021 13:18:24 +0700
Subject: [PATCH 44/62] libmygpo-qt: remove -ggdb3

---
 srcpkgs/libmygpo-qt/patches/fix-cflags.patch | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 srcpkgs/libmygpo-qt/patches/fix-cflags.patch

diff --git a/srcpkgs/libmygpo-qt/patches/fix-cflags.patch b/srcpkgs/libmygpo-qt/patches/fix-cflags.patch
new file mode 100644
index 000000000000..9940b6fc4323
--- /dev/null
+++ b/srcpkgs/libmygpo-qt/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -69,7 +69,7 @@ if (CMAKE_COMPILER_IS_GNUCXX)
+        -Wwrite-strings -Wpacked -Wformat-security -Wmissing-format-attribute
+        -Wold-style-cast -Woverloaded-virtual -Wnon-virtual-dtor  -Wall -Wextra
+        -Wformat=2 -Wundef -Wstack-protector -Wmissing-include-dirs
+-       -Winit-self -Wunsafe-loop-optimizations  -ggdb3 -fno-inline -DQT_STRICT_ITERATORS )
++       -Winit-self -Wunsafe-loop-optimizations  -fno-inline -DQT_STRICT_ITERATORS )
+     if ( NOT WIN32 )
+         add_definitions( -fvisibility=hidden )
+     endif()

From cb3c0c1607b1437db309226ac1ef2e6453528ea3 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: Sat, 27 Mar 2021 13:48:38 +0700
Subject: [PATCH 45/62] libogre: don't build vendored libraries

---
 srcpkgs/libogre/template | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/libogre/template b/srcpkgs/libogre/template
index 784e3a648bac..df60f7b4f542 100644
--- a/srcpkgs/libogre/template
+++ b/srcpkgs/libogre/template
@@ -1,25 +1,22 @@
-# Template file for 'ogre'
+# Template file for 'libogre'
 pkgname=libogre
 version=1.12.9
 revision=1
+wrksrc=ogre-$version
 build_style=cmake
-configure_args="-DCMAKE_INSTALL_PREFIX=/usr \
-	-DOGRE_INSTALL_SAMPLES=TRUE \
-	-DOGRE_INSTALL_DOCS=TRUE \
-	-DOGRE_INSTALL_SAMPLES_SOURCE=TRUE \
-	-DCMAKE_BUILD_TYPE=Release"
+configure_args="-DOGRE_INSTALL_SAMPLES=TRUE -DOGRE_INSTALL_DOCS=TRUE
+ -DOGRE_INSTALL_SAMPLES_SOURCE=TRUE -DOGRE_BUILD_DEPENDENCIES=FALSE"
+make_build_target="all OgreDoc"
 hostmakedepends="pkg-config graphviz doxygen dejavu-fonts-ttf"
 makedepends="boost-devel freetype-devel libXaw-devel libXrandr-devel
  MesaLib-devel zziplib-devel libcppunit-devel glu-devel libatomic-devel
  freeimage-devel pugixml-devel python3-devel"
 short_desc="Scene-oriented, flexible 3D engine"
 maintainer="Enno Boland <gottox@voidlinux.org>"
-homepage="http://www.ogre3d.org"
 license="MIT"
+homepage="http://www.ogre3d.org"
 distfiles="https://github.com/OGRECave/ogre/archive/v$version.tar.gz"
 checksum=028e7d0bbfce8fd254e1102666b07b7cbb9379321e88885d82feee5e061342aa
-make_build_target="all OgreDoc"
-wrksrc=ogre-$version
 
 pre_configure() {
 	if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then

From d6afa0c0ac5f47ab381e1049b4e5c3383d9256b0 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: Sat, 27 Mar 2021 13:52:50 +0700
Subject: [PATCH 46/62] libopenglrecorder: remove -O3

---
 srcpkgs/libopenglrecorder/patches/fix-cflags.patch | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 srcpkgs/libopenglrecorder/patches/fix-cflags.patch

diff --git a/srcpkgs/libopenglrecorder/patches/fix-cflags.patch b/srcpkgs/libopenglrecorder/patches/fix-cflags.patch
new file mode 100644
index 000000000000..7c48a0d2d822
--- /dev/null
+++ b/srcpkgs/libopenglrecorder/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -21,7 +21,7 @@ if (UNIX OR MINGW)
+     if (CMAKE_BUILD_TYPE MATCHES Debug)
+         add_definitions(-std=gnu++0x -O0)
+     else()
+-        add_definitions(-std=gnu++0x -O3)
++        add_definitions(-std=gnu++0x)
+     endif()
+ endif()
+ 

From 5670e7d4ac2a32d36ca66a70ca3b634817ac4051 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: Sat, 27 Mar 2021 13:55:41 +0700
Subject: [PATCH 47/62] libvidstab: remove -O3

---
 srcpkgs/libvidstab/patches/fix-cflags.patch | 39 +++++++++++++++++++++
 1 file changed, 39 insertions(+)
 create mode 100644 srcpkgs/libvidstab/patches/fix-cflags.patch

diff --git a/srcpkgs/libvidstab/patches/fix-cflags.patch b/srcpkgs/libvidstab/patches/fix-cflags.patch
new file mode 100644
index 000000000000..51c357efb101
--- /dev/null
+++ b/srcpkgs/libvidstab/patches/fix-cflags.patch
@@ -0,0 +1,39 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -25,7 +25,7 @@ else()
+     set(LIBSUFFIX "")
+ endif()
+ 
+-add_definitions( -Wall -O3 -g -Wno-pointer-sign -fPIC -std=gnu99)
++add_definitions( -Wall -Wno-pointer-sign -fPIC -std=gnu99)
+ # add_definitions(  -Wall -O0 -g -Wno-pointer-sign )
+ 
+ ### ORC is not used in any active code at the moment  ###
+Index: tests/CMakeLists.txt
+===================================================================
+--- tests/CMakeLists.txt.orig
++++ tests/CMakeLists.txt
+@@ -11,7 +11,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PAT
+ option(USE_OMP "use parallelization use OMP" ON)
+ 
+ #add_definitions( -Wall -O3 -Wno-pointer-sign -DTESTING  -std=gnu99)
+-add_definitions(  -Wall -O0 -g -Wno-pointer-sign -DTESTING -std=gnu99)
++add_definitions(  -Wall -Wno-pointer-sign -DTESTING -std=gnu99)
+ find_package(Orc)
+ if(ORC_FOUND)
+ add_definitions( -DUSE_ORC ${ORC_DEFINITIONS})
+Index: transcode/CMakeLists.txt
+===================================================================
+--- transcode/CMakeLists.txt.orig
++++ transcode/CMakeLists.txt
+@@ -9,7 +9,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PAT
+ set(TRANSCODE_ROOT ../../transcode)
+ 
+ 
+-add_definitions( -Wall -O3 -Wno-pointer-sign -DTRANSCODE -std=gnu99)
++add_definitions( -Wall -Wno-pointer-sign -DTRANSCODE -std=gnu99)
+ #add_definitions(  -Wall -O0 -g -Wno-pointer-sign )
+ # I tried it with 0.4.14
+ #  0.4.10 did not work (not all opcode implemented)

From 955e7962f814a7193e669cae0e15fa4d26b84296 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: Sat, 27 Mar 2021 14:18:34 +0700
Subject: [PATCH 48/62] openlierox: don't overwrote CMAKE_BUILD_TYPE

---
 srcpkgs/openlierox/patches/fix-cflags.patch | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
 create mode 100644 srcpkgs/openlierox/patches/fix-cflags.patch

diff --git a/srcpkgs/openlierox/patches/fix-cflags.patch b/srcpkgs/openlierox/patches/fix-cflags.patch
new file mode 100644
index 000000000000..4fe6652fd0a2
--- /dev/null
+++ b/srcpkgs/openlierox/patches/fix-cflags.patch
@@ -0,0 +1,17 @@
+Index: CMakeOlxCommon.cmake
+===================================================================
+--- CMakeOlxCommon.cmake.orig
++++ CMakeOlxCommon.cmake
+@@ -36,12 +36,6 @@ OPTION(BREAKPAD "Google Breakpad support
+ OPTION(DISABLE_JOYSTICK "Disable joystick support" No)
+ OPTION(MINGW_CROSS_COMPILE "Cross-compile Windows .EXE using i686-w64-mingw32-gcc compiler" No)
+ 
+-IF (DEBUG)
+-	SET(CMAKE_BUILD_TYPE Debug)
+-ELSE (DEBUG)
+-	SET(CMAKE_BUILD_TYPE Release)
+-ENDIF (DEBUG)
+-
+ IF (DEDICATED_ONLY)
+ 	SET(X11 No)
+ 	SET(WITH_G15 No)

From fd07e3e0c315b637801b452589c0ab54a92ff8bc 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: Sat, 27 Mar 2021 14:25:12 +0700
Subject: [PATCH 49/62] opensonic: don't overwrite CMAKE_BUILD_TYPE

---
 srcpkgs/opensonic/patches/fix-cflags.patch | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
 create mode 100644 srcpkgs/opensonic/patches/fix-cflags.patch

diff --git a/srcpkgs/opensonic/patches/fix-cflags.patch b/srcpkgs/opensonic/patches/fix-cflags.patch
new file mode 100644
index 000000000000..10d2c7c80e64
--- /dev/null
+++ b/srcpkgs/opensonic/patches/fix-cflags.patch
@@ -0,0 +1,17 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -25,12 +25,10 @@ SET(GAME_NAME "Open Sonic")
+ SET(GAME_VERSION "0.1.4")
+ SET(RTFM "Please read the user manual (readme.html) to get help.")
+ SET(ALLEGRO_RECOMMENDED_VERSION "4.4.1")
+-SET(CMAKE_BUILD_TYPE Release)
+ MESSAGE("${GAME_NAME} version ${GAME_VERSION}")
+ 
+ # configuring...
+ SET(DEFS "")
+-SET(CFLAGS_EXTRA "-g")
+ SET(CFLAGS "${CFLAGS} ${CMAKE_C_FLAGS}")
+ MESSAGE("Using CFLAGS='${CFLAGS}'")
+ 

From 334a12e2511308683a5eb1b1b270ee8e11e82343 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: Sat, 27 Mar 2021 15:17:28 +0700
Subject: [PATCH 50/62] rocksdb: don't overwrite CMAKE_BUILD_TYPE

---
 srcpkgs/rocksdb/template | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/rocksdb/template b/srcpkgs/rocksdb/template
index e39329e5d6a6..2ae7db40ab91 100644
--- a/srcpkgs/rocksdb/template
+++ b/srcpkgs/rocksdb/template
@@ -3,15 +3,16 @@ pkgname=rocksdb
 version=5.18.3
 revision=2
 build_style=cmake
-configure_args="-DCMAKE_BUILD_TYPE=Release -DPORTABLE=1 -DWITH_TESTS=0
- -DUSE_RTTI=0 -DWITH_LZ4=1"
+configure_args="-DPORTABLE=1 -DWITH_TESTS=0 -DUSE_RTTI=0 -DWITH_LZ4=1"
 makedepends="liblz4-devel"
 short_desc="RocksDB is a embeddable, persistent key-value store for fast storage"
 maintainer="magenbluten <mb0@codemonkey.cc>"
-license="GPL-2.0-or-later, Apache-2.0"
+license="GPL-2.0-or-later, Apache-2.0, BSD-3-Clause"
 homepage="https://github.com/facebook/rocksdb"
 distfiles="${homepage}/archive/v${version}.tar.gz"
 checksum=7fb6738263d3f2b360d7468cf2ebe333f3109f3ba1ff80115abd145d75287254
+CFLAGS=-DNDEBUG
+CXXFLAGS=-DNDEBUG
 
 if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
 	makedepends+=" libatomic-devel"

From 9b8d23021b078ad24ccb3bf1ce316751589bf165 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: Sat, 27 Mar 2021 15:40:26 +0700
Subject: [PATCH 51/62] seexpr-krita: don't overwrite CMAKE_BUILD_TYPE

---
 .../patches/cmake-build-type-none.patch       | 32 +++++++++++++++++++
 1 file changed, 32 insertions(+)
 create mode 100644 srcpkgs/seexpr-krita/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/seexpr-krita/patches/cmake-build-type-none.patch b/srcpkgs/seexpr-krita/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..94bb1f37db75
--- /dev/null
+++ b/srcpkgs/seexpr-krita/patches/cmake-build-type-none.patch
@@ -0,0 +1,32 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -42,14 +42,6 @@ endif()
+ 
+ ## Choose build options
+ # Disney specific method of choosing variant
+-if (${FLAVOR} STREQUAL "optimize")
+-    set(CMAKE_BUILD_TYPE "Release" CACHE STRING "type of build" FORCE)
+-endif()
+-
+-if (${FLAVOR} STREQUAL "debug")
+-    set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "type of build" FORCE)
+-endif()
+-
+ if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
+     execute_process(
+         COMMAND sh -c "echo `uname -s`-`uname -r | cut -d- -f1`-`uname -m`"
+@@ -212,12 +204,6 @@ else()
+ endif()
+ 
+ # Set to release if nothing else defined
+-if (NOT CMAKE_BUILD_TYPE)
+-  set(CMAKE_BUILD_TYPE "Release" CACHE STRING
+-      "Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel."
+-      FORCE)
+-endif()
+-
+ if (ENABLE_QT5)
+     find_package(Qt5 5.9.0 COMPONENTS Core Gui Widgets REQUIRED)
+     set_package_properties(Qt5 PROPERTIES

From 7826966d94e92d0e941d9c241ed9242cbf33b8d2 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: Sat, 27 Mar 2021 15:50:53 +0700
Subject: [PATCH 52/62] speed-dreams: hardening

---
 srcpkgs/speed-dreams/template | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/speed-dreams/template b/srcpkgs/speed-dreams/template
index 722f0c5ed87a..df7164f9c808 100644
--- a/srcpkgs/speed-dreams/template
+++ b/srcpkgs/speed-dreams/template
@@ -1,13 +1,13 @@
 # Template file for 'speed-dreams'
 pkgname=speed-dreams
 version=2.2.2
-revision=2
+revision=3
 archs="i686* x86_64* ppc64le*"
 _rev=r6553
 create_wrksrc=yes
 build_style=cmake
-configure_args="-DSD_BINDIR=/usr/bin -DSD_DATADIR=/usr/share/speed-dreams-2 -DSD_LIBDIR=/usr/lib/speed-dreams-2
- -DOPTION_OFFICIAL_ONLY=ON -DCMAKE_CXX_FLAGS=-fpermissive -DCMAKE_C_FLAGS=-fpermissive"
+configure_args="-DSD_BINDIR=/usr/bin -DSD_DATADIR=/usr/share/speed-dreams-2
+ -DSD_LIBDIR=/usr/lib/speed-dreams-2 -DOPTION_OFFICIAL_ONLY=ON"
 hostmakedepends="pkg-config"
 makedepends="freealut-devel libenet-devel libfreeglut-devel libjpeg-turbo-devel
  libpng-devel libvorbis-devel libXrandr-devel osg-devel plib-devel SDL2-devel
@@ -26,6 +26,8 @@ checksum="32aa55c17f8dafc1c54fb0d0b7b993d2688d431899cfc5db9eeece148c6887d0
  0b7b417d007ab3b7f0f4dcfdc868aafee1722150b81af519e1cd4c082b408183"
 nocross=yes
 replaces="speed-dreams-data>=0"
+CFLAGS=-fpermissive
+CXXFLAGS=-fpermissive
 
 if [ "$XBPS_TARGET_LIBC" = musl ]; then
 	broken="Segmentation fault"

From 3fb8dc95ecb5e766af63f624739f2ab2cab5b97a 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: Sat, 27 Mar 2021 19:04:09 +0700
Subject: [PATCH 53/62] traverso: hardening

---
 .../patches/cmake-build-type-none.patch       | 28 +++++++++++++++++++
 srcpkgs/traverso/template                     |  2 +-
 2 files changed, 29 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/traverso/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/traverso/patches/cmake-build-type-none.patch b/srcpkgs/traverso/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..75b3fd941eb8
--- /dev/null
+++ b/srcpkgs/traverso/patches/cmake-build-type-none.patch
@@ -0,0 +1,28 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -65,13 +65,7 @@ SET(TRAVERSO_DEFINES -DSTATIC_BUILD)
+ 
+ #BUILD SETUP
+ #None, Debug, Release, .. or custom ones
+-IF(WANT_DEBUG)
+-  SET(CMAKE_BUILD_TYPE DEBUG)
+-  SET(WANT_TRAVERSO_DEBUG ON)
+-ELSE(WANT_DEBUG)
+-  SET(CMAKE_BUILD_TYPE RELEASE)
+-  LIST(APPEND TRAVERSO_DEFINES -DQT_NO_DEBUG)
+-ENDIF(WANT_DEBUG)
++LIST(APPEND TRAVERSO_DEFINES -DQT_NO_DEBUG)
+ 
+ 
+ IF(WANT_TRAVERSO_DEBUG)
+@@ -326,7 +320,7 @@ ${Qt5Xml_INCLUDE_DIRS}
+ ${Qt5Xml_INCLUDES}
+ )
+ 
+-set(CMAKE_CXX_FLAGS "-fPIC")
++set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
+ 
+ #Set up libraries to link with all found packages
+ LINK_LIBRARIES (
diff --git a/srcpkgs/traverso/template b/srcpkgs/traverso/template
index 105924d4f0c6..4b93460f63d7 100644
--- a/srcpkgs/traverso/template
+++ b/srcpkgs/traverso/template
@@ -1,7 +1,7 @@
 # Template file for 'traverso'
 pkgname=traverso
 version=0.49.6
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DWANT_MP3_ENCODE=ON -DDETECT_HOST_CPU_FEATURES=OFF"
 hostmakedepends="pkg-config qt5-qmake qt5-host-tools"

From b20f79273a69b6524400aab88f686cbecf2011cc 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: Sat, 27 Mar 2021 19:08:11 +0700
Subject: [PATCH 54/62] xstarter: hardening

---
 .../patches/cmake-build-type-none.patch       | 22 +++++++++++++++++++
 srcpkgs/xstarter/template                     |  2 +-
 2 files changed, 23 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/xstarter/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/xstarter/patches/cmake-build-type-none.patch b/srcpkgs/xstarter/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..4f793e4c473c
--- /dev/null
+++ b/srcpkgs/xstarter/patches/cmake-build-type-none.patch
@@ -0,0 +1,22 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -5,16 +5,8 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
+ 
+ project(xstarter)
+ 
+-if(NOT CMAKE_BUILD_TYPE)
+-  set(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build (Debug or Release)" FORCE)
+-endif()
+-
+ set(PROJECT_VERSION "0.8.0")
+-if (CMAKE_BUILD_TYPE STREQUAL Debug)
+-  set(CMAKE_C_FLAGS "-g -Wall -pedantic")
+-else()
+-  set(CMAKE_C_FLAGS "-Wall -pedantic -O3")
+-endif()
++set(CMAKE_C_FLAGS "-Wall -pedantic ${CMAKE_C_FLAGS}")
+ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/bin")
+ 
+ set (CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
diff --git a/srcpkgs/xstarter/template b/srcpkgs/xstarter/template
index aa9a47e45e5c..4363d36e3c39 100644
--- a/srcpkgs/xstarter/template
+++ b/srcpkgs/xstarter/template
@@ -1,7 +1,7 @@
 # Template file for 'xstarter'
 pkgname=xstarter
 version=0.8.0
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="pkg-config"
 makedepends="glib-devel ncurses-devel"

From e8c8a73e82ad13ce5a25757678daa04a85d6ed36 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: Sat, 27 Mar 2021 19:15:48 +0700
Subject: [PATCH 55/62] yabause-gtk: ignore -O3

---
 srcpkgs/yabause-gtk/patches/fix-cflags.patch | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 srcpkgs/yabause-gtk/patches/fix-cflags.patch

diff --git a/srcpkgs/yabause-gtk/patches/fix-cflags.patch b/srcpkgs/yabause-gtk/patches/fix-cflags.patch
new file mode 100644
index 000000000000..52c1cae61799
--- /dev/null
+++ b/srcpkgs/yabause-gtk/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: src/CMakeLists.txt
+===================================================================
+--- src/CMakeLists.txt.orig
++++ src/CMakeLists.txt
+@@ -659,7 +659,7 @@ else ()
+ 	set(yabause_SOURCES ${yabause_SOURCES} sock-dummy.c thr-dummy.c)
+ endif ()
+ 
+-set(YAB_OPTIMIZATION "-O3" CACHE STRING "Override optimization level")
++set(YAB_OPTIMIZATION "" CACHE STRING "Override optimization level")
+ 
+ if("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "i686")
+ 	set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${YAB_OPTIMIZATION} -march=i686 -msse")

From ef5ad6f23af25c377ad25e455c212011bbeaf67b 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: Sat, 27 Mar 2021 19:26:47 +0700
Subject: [PATCH 56/62] ympd: hardening

---
 srcpkgs/ympd/patches/fix-cflags.patch | 13 +++++++++++++
 srcpkgs/ympd/template                 |  2 +-
 2 files changed, 14 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/ympd/patches/fix-cflags.patch

diff --git a/srcpkgs/ympd/patches/fix-cflags.patch b/srcpkgs/ympd/patches/fix-cflags.patch
new file mode 100644
index 000000000000..4720dd39e748
--- /dev/null
+++ b/srcpkgs/ympd/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -24,7 +24,7 @@ include_directories(${PROJECT_BINARY_DIR
+ 
+ include(CheckCSourceCompiles)
+ 
+-set(CMAKE_C_FLAGS "-std=gnu99 -Wall")
++set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99 -Wall")
+ set(CMAKE_C_FLAGS_DEBUG "-ggdb -pedantic")
+ if(WITH_IPV6)
+     set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS NS_ENABLE_IPV6)
diff --git a/srcpkgs/ympd/template b/srcpkgs/ympd/template
index 14437beb5384..450c079b2ca3 100644
--- a/srcpkgs/ympd/template
+++ b/srcpkgs/ympd/template
@@ -1,7 +1,7 @@
 # Template file for 'ympd'
 pkgname=ympd
 version=1.3.0
-revision=7
+revision=8
 build_style=cmake
 hostmakedepends="perl pkg-config"
 makedepends="libmpdclient-devel openssl-devel"

From e5f42d48adb35336d273686ebc5716edc992c35d 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: Sat, 27 Mar 2021 19:29:31 +0700
Subject: [PATCH 57/62] z80ex: hardening

---
 srcpkgs/z80ex/patches/fix-cflags.patch | 13 +++++++++++++
 srcpkgs/z80ex/template                 |  4 ++--
 2 files changed, 15 insertions(+), 2 deletions(-)
 create mode 100644 srcpkgs/z80ex/patches/fix-cflags.patch

diff --git a/srcpkgs/z80ex/patches/fix-cflags.patch b/srcpkgs/z80ex/patches/fix-cflags.patch
new file mode 100644
index 000000000000..6743da255e5c
--- /dev/null
+++ b/srcpkgs/z80ex/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -11,7 +11,7 @@ option (OPSTEP_FAST_AND_ROUGH "Fast and
+ 
+ #ALL_CFLAGS := -fPIC -fno-common -ansi -pedantic -Wall -pipe -O2 -I. -I./include
+ if (CMAKE_COMPILER_IS_GNUCC)
+-    set (CMAKE_C_FLAGS "-fPIC -fno-common -ansi -pedantic -Wall -pipe -O2")
++    set (CMAKE_C_FLAGS "-fPIC -fno-common -ansi -pedantic -Wall -pipe ${CMAKE_C_FLAGS}")
+ endif ()
+ 
+ include_directories(BEFORE . include)
diff --git a/srcpkgs/z80ex/template b/srcpkgs/z80ex/template
index 00a24a6fb902..5437f53d33d5 100644
--- a/srcpkgs/z80ex/template
+++ b/srcpkgs/z80ex/template
@@ -1,11 +1,11 @@
 # Template file for 'z80ex'
 pkgname=z80ex
 version=1.1.21
-revision=1
+revision=2
 build_style=cmake
 short_desc="ZiLOG Z80 CPU emulation library"
 maintainer="Diogo Leal <diogo@diogoleal.com>"
-license="GPL-2"
+license="GPL-2.0-only"
 homepage="https://sourceforge.net/projects/z80ex/"
 distfiles="${SOURCEFORGE_SITE}/project/z80ex/z80ex/${version}/z80ex-${version}.tar.gz"
 checksum=6f5e521d068a614b41e10180ad4ae45b1bc258ec28c962543feb9078856c2530

From 345ab5f2c294e27770181878b4e06c0ce0d90b6c 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: Sat, 27 Mar 2021 19:17:13 +0700
Subject: [PATCH 58/62] scribus: don't overwrite cmake-build-type

---
 .../patches/cmake-build-type-none.patch       | 33 +++++++++++++++++++
 1 file changed, 33 insertions(+)
 create mode 100644 srcpkgs/scribus/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/scribus/patches/cmake-build-type-none.patch b/srcpkgs/scribus/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..670c83cc48f5
--- /dev/null
+++ b/srcpkgs/scribus/patches/cmake-build-type-none.patch
@@ -0,0 +1,33 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -35,11 +35,6 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON)
+ 
+ 
+ #RPATH setup - more below too
+-if (WANT_NORPATH OR WANT_DISTROBUILD)
+-	set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
+-else()
+-	set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
+-endif()
+ set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
+ set(CMAKE_SKIP_RULE_DEPENDENCY TRUE)
+ set(CMAKE_SKIP_BUILD_RPATH TRUE)
+@@ -309,16 +304,6 @@ include (CMakeLists_Directories.cmake)
+ #Convert our simpler command line option to the CMake style
+ #None, Debug, Release, .. or custom ones
+ # set(WANT_DEBUG ON)
+-if(WANT_DEBUG)
+-	set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Set Debug Build Type" FORCE)
+-endif()
+-if (WANT_RELEASEWITHDEBUG)
+-	set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING "Set Release with Debug Info Build Type" FORCE)
+-endif()
+-if(NOT WANT_DEBUG AND NOT WANT_RELEASEWITHDEBUG)
+-	set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Set Release Build Type" FORCE)
+-endif()
+-
+ 
+ 
+ #Based on our build type, setup our build options

From 67ee2571c5f16bc33d84e899f044ade00c1e1003 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, 28 Mar 2021 10:39:04 +0700
Subject: [PATCH 59/62] yoshimi: cleanup, don't overwrite CMAKE_BUILD_TYPE

---
 srcpkgs/yoshimi/patches/fix-cflags.patch | 12 ++++++++++++
 srcpkgs/yoshimi/template                 | 13 +------------
 2 files changed, 13 insertions(+), 12 deletions(-)
 create mode 100644 srcpkgs/yoshimi/patches/fix-cflags.patch

diff --git a/srcpkgs/yoshimi/patches/fix-cflags.patch b/srcpkgs/yoshimi/patches/fix-cflags.patch
new file mode 100644
index 000000000000..4baeb82ef4e3
--- /dev/null
+++ b/srcpkgs/yoshimi/patches/fix-cflags.patch
@@ -0,0 +1,12 @@
+Index: src/CMakeLists.txt
+===================================================================
+--- src/CMakeLists.txt.orig
++++ src/CMakeLists.txt
+@@ -262,7 +262,6 @@ if (BuildForDebug)
+     set (CMAKE_CXX_FLAGS_DEBUG ${BuildOptionsDebug})
+     message (STATUS "DEBUG Build, flags: ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_DEBUG}")
+ else()
+-    set (CMAKE_BUILD_TYPE "Release")
+     set (CMAKE_CXX_FLAGS_RELEASE ${BuildOptionsRelease})
+     message (STATUS "RELEASE Build, flags: ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELEASE}")
+ endif ()
diff --git a/srcpkgs/yoshimi/template b/srcpkgs/yoshimi/template
index 0096f7f05710..64a6c9ad433f 100644
--- a/srcpkgs/yoshimi/template
+++ b/srcpkgs/yoshimi/template
@@ -4,6 +4,7 @@ version=1.7.4
 revision=2
 build_wrksrc=src
 build_style=cmake
+configure_args="-DCMAKE_INSTALL_DATAROOTDIR=/usr/share"
 hostmakedepends="pkg-config fltk"
 makedepends="boost-devel jack-devel fltk-devel fftw-devel mxml-devel cairo-devel
  lv2 readline-devel ncurses-devel"
@@ -17,15 +18,3 @@ checksum=27a8e33bda72aafae604e14841bed6373fc9e00ff70c98f1e13215d6a8808318
 case "$XBPS_TARGET_MACHINE" in
 	*-musl) makedepends+=" argp-standalone";;
 esac
-
-configure_args="-DCMAKE_INSTALL_DATAROOTDIR=/usr/share"
-
-pre_configure() {
-	sed -i 's|ncurses|ncursesw|g' CMakeLists.txt
-
-	case "$XBPS_TARGET_MACHINE" in
-		i686*) ;;
-		x86_64*) ;;
-		*) sed -i -e "s|-msse -msse2 -mfpmath=sse||g" CMakeLists.txt;;
-	esac
-}

From 9da82ea7ce4c1d2d58fe3c96e75817050ab87ef0 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, 28 Mar 2021 10:49:25 +0700
Subject: [PATCH 60/62] zulucrypt: remove -O3

---
 srcpkgs/zulucrypt/patches/fix-cflags.patch | 26 ++++++++++++++++++++++
 1 file changed, 26 insertions(+)
 create mode 100644 srcpkgs/zulucrypt/patches/fix-cflags.patch

diff --git a/srcpkgs/zulucrypt/patches/fix-cflags.patch b/srcpkgs/zulucrypt/patches/fix-cflags.patch
new file mode 100644
index 000000000000..d77c539c6c13
--- /dev/null
+++ b/srcpkgs/zulucrypt/patches/fix-cflags.patch
@@ -0,0 +1,26 @@
+Index: external_libraries/tcplay/CMakeLists.txt
+===================================================================
+--- external_libraries/tcplay/CMakeLists.txt.orig
++++ external_libraries/tcplay/CMakeLists.txt
+@@ -13,7 +13,7 @@ set (SRCS_LINUX  crypto-gcrypt.c)
+ set (CFLAGS_LINUX  "-D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE")
+ set (CFLAGS_WARN "-w")
+ set (CFLAGS_DEBUG  "-O0 -g3 -DDEBUG")
+-set (CFLAGS_OPT    "-O3")
++set (CFLAGS_OPT    "")
+ set (CFLAGS_VER    "-DMAJ_VER=${VERSION_MAJOR} -DMIN_VER=${VERSION_MINOR}")
+ set (CFLAGS_COMMON "-std=c99 -fPIC  ${CFLAGS_LINUX} ${CFLAGS_WARN} ${CFLAGS_VER}")
+ if ($ENV{DEBUG})
+Index: external_libraries/tcplay/Makefile.classic
+===================================================================
+--- external_libraries/tcplay/Makefile.classic.orig
++++ external_libraries/tcplay/Makefile.classic
+@@ -47,8 +47,6 @@ COMMON_CFLAGS= $(WARNFLAGS) -fPIC $(VER_
+ 
+ ifeq ($(DEBUG), yes)
+   COMMON_CFLAGS+= -O0 -g -DDEBUG
+-else
+-  COMMON_CFLAGS+= -O3
+ endif
+ 
+ ifeq (${SYSTEM}, linux)

From 98c717b415e47018d65599068bdfc0862671d38e 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, 28 Mar 2021 10:43:24 +0700
Subject: [PATCH 61/62] zbackup: don't overwrite CMAKE_BUILD_TYPE

---
 .../patches/cmake-build-type-none.patch       | 26 +++++++++++++++++++
 1 file changed, 26 insertions(+)
 create mode 100644 srcpkgs/zbackup/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/zbackup/patches/cmake-build-type-none.patch b/srcpkgs/zbackup/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..6d6ebc8e124d
--- /dev/null
+++ b/srcpkgs/zbackup/patches/cmake-build-type-none.patch
@@ -0,0 +1,26 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -6,8 +6,6 @@ project( zbackup )
+ 
+ set( CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" )
+ 
+-set( CMAKE_BUILD_TYPE Release )
+-
+ find_package( ZLIB REQUIRED )
+ include_directories( ${ZLIB_INCLUDE_DIRS} )
+ 
+Index: tartool/CMakeLists.txt
+===================================================================
+--- tartool/CMakeLists.txt.orig
++++ tartool/CMakeLists.txt
+@@ -4,8 +4,6 @@
+ cmake_minimum_required( VERSION 2.6.0 )
+ project( tartool )
+ 
+-set( CMAKE_BUILD_TYPE Release )
+-
+ add_executable( tartool tartool.cc ../file.cc ../dir.cc )
+ 
+ install( TARGETS tartool DESTINATION bin )

From 3ee4c2567e71564232d6d2aa334e2f6f5eb82544 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: Sat, 27 Mar 2021 15:19:47 +0700
Subject: [PATCH 62/62] rofs-filtered: hardening

---
 srcpkgs/rofs-filtered/patches/fix-cflags.patch | 13 +++++++++++++
 srcpkgs/rofs-filtered/template                 | 10 +++-------
 2 files changed, 16 insertions(+), 7 deletions(-)
 create mode 100644 srcpkgs/rofs-filtered/patches/fix-cflags.patch

diff --git a/srcpkgs/rofs-filtered/patches/fix-cflags.patch b/srcpkgs/rofs-filtered/patches/fix-cflags.patch
new file mode 100644
index 000000000000..b77600f66784
--- /dev/null
+++ b/srcpkgs/rofs-filtered/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -9,7 +9,7 @@ set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PA
+      "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
+ 
+ add_definitions(-D_GNU_SOURCE)
+-set(CMAKE_C_FLAGS "-Wall -std=c99")
++set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC -Wall -std=c99")
+ 
+ # find fuse library
+ find_package (FUSE REQUIRED)
diff --git a/srcpkgs/rofs-filtered/template b/srcpkgs/rofs-filtered/template
index 332cd57a9902..2bb8a2304312 100644
--- a/srcpkgs/rofs-filtered/template
+++ b/srcpkgs/rofs-filtered/template
@@ -1,17 +1,13 @@
 # Template file for 'rofs-filtered'
 pkgname=rofs-filtered
 version=1.7
-revision=1
+revision=2
+wrksrc="${pkgname}-rel-${version}"
 build_style=cmake
 makedepends="fuse-devel"
 short_desc="Filtered read only filesystem for FUSE"
 maintainer="Alexander Gehrke <void@qwertyuiop.de>"
-license="GPL-2"
+license="GPL-2.0-or-later"
 homepage="https://github.com/gburca/rofs-filtered"
 distfiles="https://github.com/gburca/rofs-filtered/archive/rel-${version}.tar.gz"
 checksum=d66066dfd0274a2fb7b71dd929445377dd23100b9fa43e3888dbe3fc7e8228e8
-wrksrc="${pkgname}-rel-${version}"
-
-pre_configure() {
-	sed -i -e 's/CMAKE_C_FLAGS "/CMAKE_C_FLAGS "-fPIC /' ${wrksrc}/CMakeLists.txt
-}

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PR PATCH] [Updated] build-style/cmake: set CMAKE_BUILD_TYPE to None
  2021-03-14 13:19 [PR PATCH] [WIP] build-style/cmake: set CMAKE_BUILD_TYPE to None sgn
                   ` (30 preceding siblings ...)
  2021-04-03  3:00 ` sgn
@ 2021-04-03  3:13 ` sgn
  2021-04-03  3:13 ` [PR PATCH] [Merged]: " sgn
  32 siblings, 0 replies; 34+ messages in thread
From: sgn @ 2021-04-03  3:13 UTC (permalink / raw)
  To: ml

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

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

https://github.com/sgn/void-packages cmake-build-type-to-None
https://github.com/void-linux/void-packages/pull/29459

build-style/cmake: set CMAKE_BUILD_TYPE to None
- I'm going to build all packages with `build_style=cmake` and fix them one by one before merging this in.

[ci skip]

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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-cmake-build-type-to-None-29459.patch --]
[-- Type: text/x-diff, Size: 118136 bytes --]

From 457ab774d6159a1bb13baeb4484ba1b6de271a1e 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: Mon, 15 Mar 2021 08:07:16 +0700
Subject: [PATCH 01/62] amdvlk: allow CMAKE_BUILD_TYPE=None

---
 .../patches/cmake-build-type-none.patch       | 60 +++++++++++++++++++
 1 file changed, 60 insertions(+)
 create mode 100644 srcpkgs/amdvlk/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/amdvlk/patches/cmake-build-type-none.patch b/srcpkgs/amdvlk/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..7a629e58548e
--- /dev/null
+++ b/srcpkgs/amdvlk/patches/cmake-build-type-none.patch
@@ -0,0 +1,60 @@
+Index: llvm-project/llvm/CMakeLists.txt
+===================================================================
+--- llvm-project/llvm/CMakeLists.txt.orig
++++ llvm-project/llvm/CMakeLists.txt
+@@ -251,11 +251,6 @@ endif()
+ 
+ string(TOUPPER "${CMAKE_BUILD_TYPE}" uppercase_CMAKE_BUILD_TYPE)
+ 
+-if (CMAKE_BUILD_TYPE AND
+-    NOT uppercase_CMAKE_BUILD_TYPE MATCHES "^(DEBUG|RELEASE|RELWITHDEBINFO|MINSIZEREL)$")
+-  message(FATAL_ERROR "Invalid value for CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
+-endif()
+-
+ set(LLVM_LIBDIR_SUFFIX "" CACHE STRING "Define suffix of library directory name (32/64)" )
+ 
+ set(LLVM_TOOLS_INSTALL_DIR "bin" CACHE STRING "Path for binary subdirectory (defaults to 'bin')")
+Index: pal/cmake/Modules/AmdCmakeHelper.cmake
+===================================================================
+--- pal/cmake/Modules/AmdCmakeHelper.cmake.orig
++++ pal/cmake/Modules/AmdCmakeHelper.cmake
+@@ -37,11 +37,6 @@ if (CMAKE_CONFIGURATION_TYPES)
+ else()
+     string(TOUPPER "${CMAKE_BUILD_TYPE}" capital_CMAKE_BUILD_TYPE)
+ 
+-    if (CMAKE_BUILD_TYPE AND
+-        NOT capital_CMAKE_BUILD_TYPE MATCHES "^(DEBUG|RELEASE|RELWITHDEBINFO|MINSIZEREL)$")
+-        message(FATAL_ERROR "Invalid value for CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
+-    endif()
+-
+     if(capital_CMAKE_BUILD_TYPE STREQUAL "DEBUG")
+         set(CMAKE_BUILD_TYPE_DEBUG ON)
+         set(CMAKE_BUILD_TYPE_RELEASE OFF)
+Index: xgl/CMakeLists.txt
+===================================================================
+--- xgl/CMakeLists.txt.orig
++++ xgl/CMakeLists.txt
+@@ -181,11 +181,6 @@ if (CMAKE_CONFIGURATION_TYPES)
+ else()
+     string(TOUPPER "${CMAKE_BUILD_TYPE}" capital_CMAKE_BUILD_TYPE)
+ 
+-    if (CMAKE_BUILD_TYPE AND
+-        NOT capital_CMAKE_BUILD_TYPE MATCHES "^(DEBUG|RELEASE|RELWITHDEBINFO|MINSIZEREL)$")
+-        message(FATAL_ERROR "Invalid value for CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
+-    endif()
+-
+     if(capital_CMAKE_BUILD_TYPE STREQUAL "DEBUG")
+         set(CMAKE_BUILD_TYPE_DEBUG ON)
+         set(CMAKE_BUILD_TYPE_RELEASE OFF)
+Index: xgl/icd/CMakeLists.txt
+===================================================================
+--- xgl/icd/CMakeLists.txt.orig
++++ xgl/icd/CMakeLists.txt
+@@ -84,7 +84,6 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Cl
+     endif()
+ 
+     if(CMAKE_BUILD_TYPE_RELEASE)
+-        target_compile_options(xgl PRIVATE -O3)
+         if(XGL_ENABLE_LTO)
+             if(${CMAKE_CXX_COMPILER_ID} MATCHES "GNU")
+                 execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION)

From e9a347f8b7fa13f6d172f042416255f8dfbd113e 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: Wed, 17 Mar 2021 06:24:04 +0700
Subject: [PATCH 02/62] eigen*: set CMAKE_BUILD_TYPE to Release

We're going to set default CMAKE_BUILD_TYPE to None soon. Those packages
are header only libraries, no need to waste time on patching.
---
 srcpkgs/eigen/template    | 1 +
 srcpkgs/eigen3.2/template | 1 +
 2 files changed, 2 insertions(+)

diff --git a/srcpkgs/eigen/template b/srcpkgs/eigen/template
index ee825e95f273..072228c16915 100644
--- a/srcpkgs/eigen/template
+++ b/srcpkgs/eigen/template
@@ -3,6 +3,7 @@ pkgname=eigen
 version=3.3.9
 revision=1
 build_style=cmake
+configure_args="-DCMAKE_BUILD_TYPE=Release"
 short_desc="C++ template library for linear algebra (version 3.x)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MPL-2.0, GPL-3.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"
diff --git a/srcpkgs/eigen3.2/template b/srcpkgs/eigen3.2/template
index 5715fc1b3a19..7b710534b5e5 100644
--- a/srcpkgs/eigen3.2/template
+++ b/srcpkgs/eigen3.2/template
@@ -4,6 +4,7 @@ version=3.2.10
 revision=3
 wrksrc="eigen-${version}"
 build_style=cmake
+configure_args="-DCMAKE_BUILD_TYPE=Release"
 short_desc="C++ template library for linear algebra (version 3.x)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MPL-2.0, GPL-3.0-or-later, LGPL-2.1-or-later, BSD-3-Clause"

From 38598687384b5823b983140f4baf805f60f38bba 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: Wed, 17 Mar 2021 07:04:48 +0700
Subject: [PATCH 03/62] embree: don't ignore CXXFLAGS, fix build with ispc
 1.13+

---
 .../embree/patches/uintNN-is-part-of-ispc-1.13.patch | 12 ++++++++++++
 srcpkgs/embree/template                              |  6 ++----
 2 files changed, 14 insertions(+), 4 deletions(-)
 create mode 100644 srcpkgs/embree/patches/uintNN-is-part-of-ispc-1.13.patch

diff --git a/srcpkgs/embree/patches/uintNN-is-part-of-ispc-1.13.patch b/srcpkgs/embree/patches/uintNN-is-part-of-ispc-1.13.patch
new file mode 100644
index 000000000000..5d0b02f3b2e5
--- /dev/null
+++ b/srcpkgs/embree/patches/uintNN-is-part-of-ispc-1.13.patch
@@ -0,0 +1,12 @@
+Index: embree-2.17.7/tutorials/common/common.isph
+===================================================================
+--- embree-2.17.7.orig/tutorials/common/common.isph
++++ embree-2.17.7/tutorials/common/common.isph
+@@ -16,7 +16,3 @@
+ 
+ #pragma once
+ 
+-typedef unsigned int64 uint64;
+-typedef unsigned int32 uint32;
+-typedef unsigned int16 uint16;
+-typedef unsigned int8  uint8;
diff --git a/srcpkgs/embree/template b/srcpkgs/embree/template
index 0bc72f46b6d8..849ec3c26c1d 100644
--- a/srcpkgs/embree/template
+++ b/srcpkgs/embree/template
@@ -4,6 +4,7 @@ version=2.17.7
 revision=2
 archs="x86_64"
 build_style=cmake
+configure_args="-DTBB_ROOT=/usr -DEMBREE_IGNORE_CMAKE_CXX_FLAGS=OFF"
 hostmakedepends="ispc"
 makedepends="libfreeglut-devel libXmu-devel tbb-devel MesaLib-devel libpng-devel
  libopenexr-devel libjpeg-turbo-devel libmagick-devel"
@@ -13,10 +14,7 @@ license="Apache-2.0"
 homepage="https://embree.github.io/"
 distfiles="https://github.com/$pkgname/$pkgname/archive/v$version.tar.gz"
 checksum=c0694f287fa1fbb382aba3a895702e248d92f7e89c0e5f64aefee965482ec04c
-
-nopie=y
-
-configure_args="-DTBB_ROOT=/usr -DENABLE_TUTORIALS=OFF"
+patch_args=-Np1
 
 embree-devel_package() {
 	depends="${sourcepkg}>=${version}_${revision}"

From 73ad795e5d36a0df404aaa574d1df9e221adb4a3 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: Wed, 17 Mar 2021 07:35:19 +0700
Subject: [PATCH 04/62] ettercap: remove libressl patch, CMAKE_BUILD_TYPE=None

---
 .../patches/allow-build-type-none.patch       | 24 ++++++++++++++
 srcpkgs/ettercap/patches/libressl.patch       | 31 -------------------
 srcpkgs/ettercap/template                     |  9 ++++--
 3 files changed, 31 insertions(+), 33 deletions(-)
 create mode 100644 srcpkgs/ettercap/patches/allow-build-type-none.patch
 delete mode 100644 srcpkgs/ettercap/patches/libressl.patch

diff --git a/srcpkgs/ettercap/patches/allow-build-type-none.patch b/srcpkgs/ettercap/patches/allow-build-type-none.patch
new file mode 100644
index 000000000000..324d75086b05
--- /dev/null
+++ b/srcpkgs/ettercap/patches/allow-build-type-none.patch
@@ -0,0 +1,24 @@
+Index: ettercap-0.8.3.1/CMakeLists.txt
+===================================================================
+--- ettercap-0.8.3.1.orig/CMakeLists.txt
++++ ettercap-0.8.3.1/CMakeLists.txt
+@@ -22,19 +22,6 @@ option(LIBRARY_BUILD "Build for libetter
+ option(INSTALL_DESKTOP "Install ettercap desktop files" ON)
+ 
+ 
+-set(VALID_BUILD_TYPES Debug Release RelWithDebInfo)
+-
+-if(NOT CMAKE_BUILD_TYPE)
+-  # Default to using "Release" as our build type.
+-  set(CMAKE_BUILD_TYPE "Release" CACHE STRING
+-    "Choose the type of build, options are: ${VALID_BUILD_TYPES}." FORCE)
+-endif()
+-list(FIND VALID_BUILD_TYPES ${CMAKE_BUILD_TYPE} contains_valid)
+-if(contains_valid EQUAL -1)
+-  message(FATAL_ERROR "Unknown CMAKE_BUILD_TYPE: '${CMAKE_BUILD_TYPE}'. Valid options are: ${VALID_BUILD_TYPES}")
+-endif()
+-unset(contains_valid)
+-
+ include(CMakeDependentOption)
+ 
+ # If SYSTEM_LIBS is set to off, then all SYSTEM_* options will be
diff --git a/srcpkgs/ettercap/patches/libressl.patch b/srcpkgs/ettercap/patches/libressl.patch
deleted file mode 100644
index 15e0d3c1c9e7..000000000000
--- a/srcpkgs/ettercap/patches/libressl.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From b2f7634c9dbc0ef68640f0571787d92300e9f9f9 Mon Sep 17 00:00:00 2001
-From: Stefan Strogin <stefan@steils.org>
-Date: Sat, 15 Aug 2020 07:18:31 +0300
-Subject: [PATCH] ec_sslwrap: fix compilation with LibreSSL
-
-Disable taking over SNI extension from ClientHello and SSL configuration
-operations until LibreSSL supports the required API.
-
-Fixes: https://github.com/Ettercap/ettercap/issues/1068
----
- src/ec_sslwrap.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git src/ec_sslwrap.c src/ec_sslwrap.c
-index b9f26a142..1e4c24fc1 100644
---- src/ec_sslwrap.c
-+++ src/ec_sslwrap.c
-@@ -71,11 +71,11 @@
- #define TLS_server_method SSLv23_server_method
- #endif
- 
--#if (OPENSSL_VERSION_NUMBER >= 0x10100000L)
-+#if (OPENSSL_VERSION_NUMBER >= 0x10100000L) && !defined(LIBRESSL_VERSION_NUMBER)
- #define HAVE_OPENSSL_1_1_0
- #endif
- 
--#if (OPENSSL_VERSION_NUMBER >= 0x10101000L)
-+#if (OPENSSL_VERSION_NUMBER >= 0x10101000L) && !defined(LIBRESSL_VERSION_NUMBER)
- #define HAVE_OPENSSL_1_1_1
- #endif
- 
diff --git a/srcpkgs/ettercap/template b/srcpkgs/ettercap/template
index 7fe4c340a079..611b4e9aded7 100644
--- a/srcpkgs/ettercap/template
+++ b/srcpkgs/ettercap/template
@@ -3,8 +3,8 @@ pkgname=ettercap
 version=0.8.3.1
 revision=2
 build_style=cmake
-configure_args="-DENABLE_GTK=OFF"
-hostmakedepends="flex"
+configure_args="-DENABLE_GTK=OFF -DBUNDLED_LIBS=OFF"
+hostmakedepends="flex pkg-config"
 makedepends="geoip-devel ncurses-devel openssl-devel libcurl-devel
  libltdl-devel libnet-devel libpcap-devel pcre-devel"
 conf_files="/etc/${pkgname}/etter.conf"
@@ -15,5 +15,10 @@ homepage="http://ettercap.github.com/ettercap/"
 distfiles="https://github.com/Ettercap/ettercap/archive/v${version}.tar.gz"
 checksum=d0c3ef88dfc284b61d3d5b64d946c1160fd04276b448519c1ae4438a9cdffaf3
 lib32disabled=yes
+patch_args=-Np1
 
 CFLAGS="-fcommon"
+
+post_extract() {
+	rm -rf bundled_deps
+}

From 82b3b169aab197a6cdf21a2122d595d758f203aa 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: Wed, 17 Mar 2021 08:27:10 +0700
Subject: [PATCH 05/62] injeqt: disable coverage

---
 srcpkgs/injeqt/template | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/injeqt/template b/srcpkgs/injeqt/template
index 1e5777fc0f18..78eba09a0249 100644
--- a/srcpkgs/injeqt/template
+++ b/srcpkgs/injeqt/template
@@ -3,7 +3,8 @@ pkgname=injeqt
 version=1.2.0
 revision=2
 build_style=cmake
-hostmakedepends="pkg-config"
+configure_args="-DDISABLE_COVERAGE=ON"
+hostmakedepends="pkg-config qt5-qmake qt5-host-tools"
 makedepends="qt5-devel"
 short_desc="Dependency injection framework for Qt"
 maintainer="Jürgen Buchmüller <pullmoll@t-online.de>"
@@ -12,9 +13,6 @@ homepage="https://github.com/vogel/injeqt/"
 distfiles="https://github.com/vogel/${pkgname}/archive/${version}.tar.gz>${pkgname}-${version}.tar.gz"
 checksum=77540cedb0b26affe993dd18124d796059e34c80a51d9ae6433fdff1860db135
 
-if [ -n "$CROSS_BUILD" ]; then
-	hostmakedepends+=" qt5-host-tools qt5-devel"
-fi
 CXXFLAGS="-fno-lifetime-dse -Wno-error=cast-align"
 
 injeqt-devel_package() {

From e4a86c00f8fcc80cdb53137f01d8a3583de40370 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: Wed, 17 Mar 2021 22:26:37 +0700
Subject: [PATCH 06/62] kindd: build with CMAKE_BUILD_TYPE=None

---
 srcpkgs/kindd/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/kindd/template b/srcpkgs/kindd/template
index e634b0f69bf6..4416041de58c 100644
--- a/srcpkgs/kindd/template
+++ b/srcpkgs/kindd/template
@@ -15,7 +15,7 @@ distfiles="${homepage}/archive/${version}.tar.gz"
 checksum=e596f1b1577ff3e83a779e6181252ae2f09731f513d17dd6b95cbc2cf204654f
 
 do_install() {
-	vbin release/kindd
+	vbin build/core/kindd
 	vinstall assets/appconf/kindd.svg 644 usr/share/pixmaps
 	vinstall assets/appconf/kindd.desktop 644 usr/share/applications
 }

From a33f8fcc81df65723398fa039ddc8f93f9bbf887 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: Thu, 18 Mar 2021 23:58:53 +0700
Subject: [PATCH 07/62] occt: allow CMAKE_BUILD_TYPE=None

---
 srcpkgs/occt/patches/cmake-build-type-none.patch | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 srcpkgs/occt/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/occt/patches/cmake-build-type-none.patch b/srcpkgs/occt/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..acb06fb55766
--- /dev/null
+++ b/srcpkgs/occt/patches/cmake-build-type-none.patch
@@ -0,0 +1,13 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -4,7 +4,7 @@ set (CMAKE_MODULE_PATH "${CMAKE_SOURCE_D
+ 
+ set (CMAKE_SUPPRESS_REGENERATION TRUE)
+ 
+-set (CMAKE_CONFIGURATION_TYPES Release Debug RelWithDebInfo CACHE INTERNAL "" FORCE)
++set (CMAKE_CONFIGURATION_TYPES None Release Debug RelWithDebInfo CACHE INTERNAL "" FORCE)
+ 
+ # macro: include patched file if it exists
+ macro (OCCT_INCLUDE_CMAKE_FILE BEING_INCLUDED_FILE)

From 67300645af6eac41f07e2ca8e689f4a8cf861d02 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: Fri, 19 Mar 2021 23:07:05 +0700
Subject: [PATCH 08/62] renderdoc: devendor zstd, lz4

---
 .../patches/build-type-none-is-release.patch  | 12 ++++
 .../renderdoc/patches/qmake-no-rpath.patch    | 13 ++++
 .../renderdoc/patches/unvendor-zstd-lz4.patch | 68 +++++++++++++++++++
 srcpkgs/renderdoc/template                    | 15 ++--
 4 files changed, 99 insertions(+), 9 deletions(-)
 create mode 100644 srcpkgs/renderdoc/patches/build-type-none-is-release.patch
 create mode 100644 srcpkgs/renderdoc/patches/qmake-no-rpath.patch
 create mode 100644 srcpkgs/renderdoc/patches/unvendor-zstd-lz4.patch

diff --git a/srcpkgs/renderdoc/patches/build-type-none-is-release.patch b/srcpkgs/renderdoc/patches/build-type-none-is-release.patch
new file mode 100644
index 000000000000..f16b944bc12c
--- /dev/null
+++ b/srcpkgs/renderdoc/patches/build-type-none-is-release.patch
@@ -0,0 +1,12 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -315,6 +315,7 @@ set(RELEASE_MODE 0)
+ 
+ if(cmake_build_type_lower STREQUAL "release" OR
+    cmake_build_type_lower STREQUAL "relwithdebinfo" OR
++   cmake_build_type_lower STREQUAL "none" OR
+    cmake_build_type_lower STREQUAL "minsizerel")
+     add_definitions(-D_RELEASE)
+     message(STATUS "Building RenderDoc in Release mode: ${CMAKE_BUILD_TYPE}")
diff --git a/srcpkgs/renderdoc/patches/qmake-no-rpath.patch b/srcpkgs/renderdoc/patches/qmake-no-rpath.patch
new file mode 100644
index 000000000000..6e6325c53555
--- /dev/null
+++ b/srcpkgs/renderdoc/patches/qmake-no-rpath.patch
@@ -0,0 +1,13 @@
+Index: qrenderdoc/CMakeLists.txt
+===================================================================
+--- qrenderdoc/CMakeLists.txt.orig
++++ qrenderdoc/CMakeLists.txt
+@@ -144,7 +144,7 @@ endif()
+ # and finding dependencies from the cmake build
+ file(WRITE
+      ${CMAKE_BINARY_DIR}/qrenderdoc/qrenderdoc_cmake.pri
+-     "CONFIG+=${QMAKE_CONFIG}\n"
++     "CONFIG+=${QMAKE_CONFIG} no_qt_rpath\n"
+      "\n"
+      "QMAKE_CC=${CMAKE_C_COMPILER}\n"
+      "QMAKE_CXX=${CMAKE_CXX_COMPILER}\n"
diff --git a/srcpkgs/renderdoc/patches/unvendor-zstd-lz4.patch b/srcpkgs/renderdoc/patches/unvendor-zstd-lz4.patch
new file mode 100644
index 000000000000..d4003ded9161
--- /dev/null
+++ b/srcpkgs/renderdoc/patches/unvendor-zstd-lz4.patch
@@ -0,0 +1,68 @@
+Index: renderdoc/CMakeLists.txt
+===================================================================
+--- renderdoc/CMakeLists.txt.orig
++++ renderdoc/CMakeLists.txt
+@@ -213,54 +213,10 @@ set(sources
+     3rdparty/pugixml/pugixml.cpp
+     3rdparty/pugixml/pugixml.hpp
+     3rdparty/pugixml/pugiconfig.hpp
+-    3rdparty/lz4/lz4.c
+-    3rdparty/lz4/lz4.h
+     3rdparty/miniz/miniz.c
+     3rdparty/miniz/miniz.h
+     3rdparty/superluminal/superluminal.cpp
+     3rdparty/superluminal/superluminal.h
+-    3rdparty/zstd/bitstream.h
+-    3rdparty/zstd/compiler.h
+-    3rdparty/zstd/cpu.h
+-    3rdparty/zstd/debug.c
+-    3rdparty/zstd/debug.h
+-    3rdparty/zstd/entropy_common.c
+-    3rdparty/zstd/error_private.c
+-    3rdparty/zstd/error_private.h
+-    3rdparty/zstd/fse.h
+-    3rdparty/zstd/fse_compress.c
+-    3rdparty/zstd/fse_decompress.c
+-    3rdparty/zstd/hist.c
+-    3rdparty/zstd/hist.h
+-    3rdparty/zstd/huf.h
+-    3rdparty/zstd/huf_compress.c
+-    3rdparty/zstd/huf_decompress.c
+-    3rdparty/zstd/mem.h
+-    3rdparty/zstd/pool.c
+-    3rdparty/zstd/pool.h
+-    3rdparty/zstd/threading.c
+-    3rdparty/zstd/threading.h
+-    3rdparty/zstd/xxhash.c
+-    3rdparty/zstd/xxhash.h
+-    3rdparty/zstd/zstd.h
+-    3rdparty/zstd/zstd_common.c
+-    3rdparty/zstd/zstd_compress.c
+-    3rdparty/zstd/zstd_compress_internal.h
+-    3rdparty/zstd/zstd_decompress.c
+-    3rdparty/zstd/zstd_double_fast.c
+-    3rdparty/zstd/zstd_double_fast.h
+-    3rdparty/zstd/zstd_errors.h
+-    3rdparty/zstd/zstd_fast.c
+-    3rdparty/zstd/zstd_fast.h
+-    3rdparty/zstd/zstd_internal.h
+-    3rdparty/zstd/zstd_lazy.c
+-    3rdparty/zstd/zstd_lazy.h
+-    3rdparty/zstd/zstd_ldm.c
+-    3rdparty/zstd/zstd_ldm.h
+-    3rdparty/zstd/zstd_opt.c
+-    3rdparty/zstd/zstd_opt.h
+-    3rdparty/zstd/zstdmt_compress.c
+-    3rdparty/zstd/zstdmt_compress.h
+     3rdparty/stb/stb_image.h
+     3rdparty/stb/stb_image_write.h
+     3rdparty/stb/stb_image_resize.h
+@@ -271,6 +227,8 @@ set(sources
+     3rdparty/tinyfiledialogs/tinyfiledialogs.c
+     3rdparty/tinyfiledialogs/tinyfiledialogs.h)
+ 
++list(APPEND RDOC_LIBRARIES -llz4 -lzstd)
++
+ if(ANDROID)
+     list(APPEND sources
+         data/embedded_files.h
diff --git a/srcpkgs/renderdoc/template b/srcpkgs/renderdoc/template
index 7240e9ebc307..4615d45c52c9 100644
--- a/srcpkgs/renderdoc/template
+++ b/srcpkgs/renderdoc/template
@@ -1,13 +1,14 @@
 # Template file for 'renderdoc'
 pkgname=renderdoc
 version=1.12
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DENABLE_GL=ON -DENABLE_GLES=ON -DENABLE_QRENDERDOC=ON
  -DENABLE_RENDERDOCCMD=ON -DENABLE_VULKAN=ON -DENABLE_XCB=ON -DENABLE_XLIB=ON
  -DENABLE_PYRENDERDOC=ON"
-hostmakedepends="bison autoconf automake pkg-config python3"
+hostmakedepends="bison autoconf automake pkg-config python3 swig"
 makedepends="libX11-devel libxcb-devel xcb-util-keysyms-devel qt5-devel
+ libzstd-devel liblz4-devel
  qt5-svg-devel qt5-x11extras-devel pcre-devel python3-devel"
 short_desc="Stand-alone graphics debugging tool for Vulkan and OpenGL"
 maintainer="Urs Schulz <voidpkgs@ursschulz.de>"
@@ -19,19 +20,14 @@ checksum=4dece1b4cb859a76533b28fcd50e17321acfaa81c3435500a006c4a5ba15fddb
 if [ "$XBPS_TARGET_LIBC" = musl ]; then
 	makedepends+=" libexecinfo-devel"
 	LDLIBS="-lexecinfo"
+	broken="uses RTLD_DL_LINKMAP, RTLD_DEEPBIND, _r_debug"
 fi
 
 if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
 	makedepends+=" libatomic-devel"
 fi
 
-case "$XBPS_TARGET_MACHINE" in
-	*-musl) broken="uses RTLD_DL_LINKMAP, RTLD_DEEPBIND, _r_debug" ;;
-esac
-
-if [ "$CROSS_BUILD" ]; then
-	broken="Cross-compilation can't find python3 interpreter"
-fi
+nocross="Cross-compilation can't find python3 interpreter"
 
 post_patch() {
 	[ -z "$XBPS_TARGET_NO_ATOMIC8" ] && return 0
@@ -40,4 +36,5 @@ post_patch() {
 
 post_install() {
 	vlicense LICENSE.md
+	vlicense docs/credits_acknowledgements.rst
 }

From d4343e44b8b87cdb1bc571226acdbb2f5ed0ac04 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: Sat, 20 Mar 2021 00:47:52 +0700
Subject: [PATCH 09/62] python3-occ: build with CMAKE_BUILD_TYPE=None

---
 srcpkgs/python3-occ/template | 1 +
 1 file changed, 1 insertion(+)

diff --git a/srcpkgs/python3-occ/template b/srcpkgs/python3-occ/template
index 705f37457943..3ea0ef5e6387 100644
--- a/srcpkgs/python3-occ/template
+++ b/srcpkgs/python3-occ/template
@@ -5,6 +5,7 @@ revision=1
 archs="i686* x86_64* armv7l* aarch64* ppc*"
 wrksrc="pythonocc-core-${version}"
 build_style=cmake
+configure_args="-DPYTHONOCC_BUILD_TYPE=None -DCMAKE_BUILD_TYPE=None"
 hostmakedepends="python3 swig"
 makedepends="python3-devel occt-devel freetype-devel swig"
 depends="python3 occt freetype"

From 41da391a88b99266f13d9afddc4a0e8f036945e9 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: Fri, 19 Mar 2021 23:38:10 +0700
Subject: [PATCH 10/62] widelands: allow CMAKE_BUILD_TYPE=None

---
 srcpkgs/widelands-data                        |  1 -
 .../patches/cmake-build-type-none.patch       | 63 +++++++++++++++++++
 .../widelands/patches/fix-install-path.patch  | 40 ++++++++++++
 srcpkgs/widelands/template                    | 21 +------
 4 files changed, 105 insertions(+), 20 deletions(-)
 delete mode 120000 srcpkgs/widelands-data
 create mode 100644 srcpkgs/widelands/patches/cmake-build-type-none.patch
 create mode 100644 srcpkgs/widelands/patches/fix-install-path.patch

diff --git a/srcpkgs/widelands-data b/srcpkgs/widelands-data
deleted file mode 120000
index e9fbf89517f2..000000000000
--- a/srcpkgs/widelands-data
+++ /dev/null
@@ -1 +0,0 @@
-widelands
\ No newline at end of file
diff --git a/srcpkgs/widelands/patches/cmake-build-type-none.patch b/srcpkgs/widelands/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..3d210854741b
--- /dev/null
+++ b/srcpkgs/widelands/patches/cmake-build-type-none.patch
@@ -0,0 +1,63 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -202,7 +202,7 @@ elseif(CMAKE_BUILD_TYPE STREQUAL "RelWit
+   set(WL_DEBUG_FLAGS "-DNDEBUG -DNOPARACHUTE")
+   option(OPTION_ASAN "Build with AddressSanitizer" ON)
+ else()
+-  message(FATAL_ERROR "Unknown CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
++  set(WL_DEBUG_FLAGS "-DNDEBUG -DNOPARACHUTE")
+ endif()
+ 
+ wl_add_flag(WL_GENERIC_CXX_FLAGS "-std=c++11")
+@@ -353,7 +353,7 @@ endif (OPTION_BUILD_TESTS)
+ install (
+   FILES ${CMAKE_CURRENT_BINARY_DIR}/VERSION
+   DESTINATION ${WL_INSTALL_BASEDIR}
+-  CONFIGURATIONS Debug;Release
++  CONFIGURATIONS Debug
+   COMPONENT CoreVersionFile
+ )
+ 
+@@ -378,7 +378,6 @@ install(
+     data/txts
+     data/world
+   DESTINATION ${WL_INSTALL_DATADIR}
+-  CONFIGURATIONS Debug;Release
+   COMPONENT CoreDataFiles
+ )
+ 
+@@ -386,7 +385,6 @@ install(
+   DIRECTORY
+     data/maps
+   DESTINATION ${WL_INSTALL_DATADIR}
+-  CONFIGURATIONS Debug;Release
+   COMPONENT MapFiles
+ )
+ 
+@@ -395,7 +393,6 @@ install(
+     data/music
+     data/sound
+   DESTINATION ${WL_INSTALL_DATADIR}
+-  CONFIGURATIONS Debug;Release
+   COMPONENT MusicFiles
+ )
+ 
+@@ -405,7 +402,7 @@ install(
+     CREDITS
+     ChangeLog
+   DESTINATION ${WL_INSTALL_BASEDIR}
+-  CONFIGURATIONS Debug;Release
++  CONFIGURATIONS Debug
+   COMPONENT CoreLicenseFiles
+ )
+ 
+@@ -424,7 +421,6 @@ install(
+   DIRECTORY
+     ${CMAKE_CURRENT_BINARY_DIR}/locale/
+   DESTINATION ${WL_INSTALL_DATADIR}/locale
+-  CONFIGURATIONS Debug;Release
+   COMPONENT CoreLanguageFiles
+ )
+ 
diff --git a/srcpkgs/widelands/patches/fix-install-path.patch b/srcpkgs/widelands/patches/fix-install-path.patch
new file mode 100644
index 000000000000..6bb461389f03
--- /dev/null
+++ b/srcpkgs/widelands/patches/fix-install-path.patch
@@ -0,0 +1,40 @@
+Index: cmake/WlFunctions.cmake
+===================================================================
+--- cmake/WlFunctions.cmake.orig
++++ cmake/WlFunctions.cmake
+@@ -289,5 +289,5 @@ function(wl_binary NAME)
+ 
+   #Quoting the CMake documentation on DESTINATION:
+   #"If a relative path is given it is interpreted relative to the value of CMAKE_INSTALL_PREFIX"
+-  install(TARGETS ${NAME} DESTINATION "." COMPONENT ExecutableFiles)
++  install(TARGETS ${NAME} DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT ExecutableFiles)
+ endfunction()
+Index: xdg/CMakeLists.txt
+===================================================================
+--- xdg/CMakeLists.txt.orig
++++ xdg/CMakeLists.txt
+@@ -6,19 +6,19 @@ set(XDG_APPLICATION_ID "org.widelands.Wi
+ list(APPEND icon_sizes "16" "32" "48" "64" "128")
+ foreach (icon_size ${icon_sizes})
+   #install(FILES ${CMAKE_SOURCE_DIR}/data/images/logos/wl-ico-${icon_size}.png DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/${icon_size}x${icon_size}/apps RENAME ${XDG_APPLICATION_ID}.png)
+-  install(FILES ${CMAKE_SOURCE_DIR}/data/images/logos/wl-ico-${icon_size}.png DESTINATION ../share/icons/hicolor/${icon_size}x${icon_size}/apps RENAME ${XDG_APPLICATION_ID}.png)
++  install(FILES ${CMAKE_SOURCE_DIR}/data/images/logos/wl-ico-${icon_size}.png DESTINATION share/icons/hicolor/${icon_size}x${icon_size}/apps RENAME ${XDG_APPLICATION_ID}.png)
+ endforeach (icon_size ${icon_sizes})
+ #install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${CMAKE_PROJECT_NAME}.6           DESTINATION ${CMAKE_INSTALL_MANDIR}/man6)
+-install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${CMAKE_PROJECT_NAME}.6           DESTINATION ../share/man/man6)
++install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${CMAKE_PROJECT_NAME}.6           DESTINATION share/man/man6)
+ #install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${XDG_APPLICATION_ID}.desktop     DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications)
+-install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${XDG_APPLICATION_ID}.desktop     DESTINATION ../share/applications)
++install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${XDG_APPLICATION_ID}.desktop     DESTINATION share/applications)
+ #install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${XDG_APPLICATION_ID}.appdata.xml DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/metainfo)
+-install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${XDG_APPLICATION_ID}.appdata.xml DESTINATION ../share/metainfo)
++install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${XDG_APPLICATION_ID}.appdata.xml DESTINATION share/metainfo)
+ 
+ find_program(GTK_UPDATE_ICON_CACHE NAMES gtk-update-icon-cache)
+ if (GTK_UPDATE_ICON_CACHE)
+   #install(CODE "execute_process (COMMAND ${GTK_UPDATE_ICON_CACHE} -t -f ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor ||: )")
+-  install(CODE "execute_process (COMMAND ${GTK_UPDATE_ICON_CACHE} -t -f ${CMAKE_INSTALL_PREFIX}/../share/icons/hicolor ||: )")
++  install(CODE "execute_process (COMMAND ${GTK_UPDATE_ICON_CACHE} -t -f ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor ||: )")
+ else (GTK_UPDATE_ICON_CACHE)
+   message(WARNING "gtk-update-icon-cache not found!")
+ endif (GTK_UPDATE_ICON_CACHE)
diff --git a/srcpkgs/widelands/template b/srcpkgs/widelands/template
index 6cee85087ea7..cfa2c10993e0 100644
--- a/srcpkgs/widelands/template
+++ b/srcpkgs/widelands/template
@@ -1,7 +1,7 @@
 # Template file for 'widelands'
 pkgname=widelands
 version=21
-revision=3
+revision=4
 wrksrc="${pkgname}-build${version}"
 build_style=cmake
 configure_args="-DOPENGL_INCLUDE_DIR=${XBPS_CROSS_BASE}/usr/include
@@ -10,13 +10,13 @@ hostmakedepends="python3 pkg-config gettext"
 makedepends="boost-devel icu-devel minizip-devel gettext-devel
  glu-devel glew-devel SDL2-devel SDL2_gfx-devel SDL2_image-devel
  SDL2_net-devel SDL2_mixer-devel SDL2_ttf-devel"
-depends="${pkgname}-data-${version}_${revision}"
 short_desc="Real-time strategy game"
 maintainer="Jürgen Buchmüller <pullmoll@t-online.de>"
 license="GPL-2.0-or-later"
 homepage="http://www.widelands.org/"
 distfiles="https://github.com/widelands/widelands/archive/build${version}.tar.gz>${pkgname}-${version}.tar.gz"
 checksum=601e0e4c6f91b3fb0ece2cd1b83ecfb02344a1b9194fbb70ef3f70e06994e357
+replaces="widelands-data>=0"
 
 CXXFLAGS="-DU_USING_ICU_NAMESPACE=1"
 
@@ -29,22 +29,5 @@ if [ "$CROSS_BUILD" ]; then
 fi
 
 post_install() {
-	# For some reason the binary is installed as /usr/widelands - move it
-	vmkdir usr/bin
-	mv ${DESTDIR}/usr/${pkgname} ${DESTDIR}/usr/bin
-	vmkdir usr/share
-	mv ${DESTDIR}/share/* ${DESTDIR}/usr/share/
-	rmdir ${DESTDIR}/share
-
-	# Remove files not needed in the package
-	rm -f ${DESTDIR}/usr/COPYING ${DESTDIR}/usr/CREDITS ${DESTDIR}/usr/ChangeLog ${DESTDIR}/usr/VERSION
-
 	vinstall ${FILESDIR}/${pkgname}.desktop 644 usr/share/applications
 }
-
-widelands-data_package() {
-	short_desc+=" - data files"
-	pkg_install() {
-		vmove usr/share/widelands
-	}
-}

From f5911cd0c0dd76950cffb93a5a0a2593cca3ac5e 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: Sat, 20 Mar 2021 09:49:25 +0700
Subject: [PATCH 11/62] zziplib: fix SONAME when build with
 -DCMAKE_BUILD_TYPE=None

---
 .../cmake-build-type-none-soname.patch        | 35 +++++++++++++++++++
 srcpkgs/zziplib/template                      |  1 +
 2 files changed, 36 insertions(+)
 create mode 100644 srcpkgs/zziplib/patches/cmake-build-type-none-soname.patch

diff --git a/srcpkgs/zziplib/patches/cmake-build-type-none-soname.patch b/srcpkgs/zziplib/patches/cmake-build-type-none-soname.patch
new file mode 100644
index 000000000000..2d31b5b8a46a
--- /dev/null
+++ b/srcpkgs/zziplib/patches/cmake-build-type-none-soname.patch
@@ -0,0 +1,35 @@
+Index: zziplib-0.13.72/zzip/CMakeLists.txt
+===================================================================
+--- zziplib-0.13.72.orig/zzip/CMakeLists.txt
++++ zziplib-0.13.72/zzip/CMakeLists.txt
+@@ -190,15 +190,18 @@ target_include_directories (libzzipmmapp
+ endif()
+ 
+ set_target_properties(libzzip PROPERTIES OUTPUT_NAME "zzip" RELEASE_POSTFIX "-${RELNUM}")
++set_target_properties(libzzip PROPERTIES OUTPUT_NAME "zzip" NONE_POSTFIX "-${RELNUM}")
+ SET_TARGET_PROPERTIES(libzzip PROPERTIES VERSION ${VERNUM}.${FIXNUM} SOVERSION ${VERNUM})
+ 
+ if(ZZIPFSEEKO)
+ set_target_properties(libzzipfseeko PROPERTIES OUTPUT_NAME "zzipfseeko" RELEASE_POSTFIX "-${RELNUM}")
++set_target_properties(libzzipfseeko PROPERTIES OUTPUT_NAME "zzipfseeko" NONE_POSTFIX "-${RELNUM}")
+ SET_TARGET_PROPERTIES(libzzipfseeko PROPERTIES VERSION ${VERNUM}.${FIXNUM} SOVERSION ${VERNUM})
+ endif()
+ 
+ if(ZZIPMMAPPED)
+ set_target_properties(libzzipmmapped PROPERTIES OUTPUT_NAME "zzipmmapped" RELEASE_POSTFIX "-${RELNUM}")
++set_target_properties(libzzipmmapped PROPERTIES OUTPUT_NAME "zzipmmapped" NONE_POSTFIX "-${RELNUM}")
+ SET_TARGET_PROPERTIES(libzzipmmapped PROPERTIES VERSION ${VERNUM}.${FIXNUM} SOVERSION ${VERNUM})
+ endif()
+ 
+Index: zziplib-0.13.72/zzipwrap/CMakeLists.txt
+===================================================================
+--- zziplib-0.13.72.orig/zzipwrap/CMakeLists.txt
++++ zziplib-0.13.72/zzipwrap/CMakeLists.txt
+@@ -49,6 +49,7 @@ target_link_libraries(libzzipwrap libzzi
+ target_include_directories(libzzipwrap PRIVATE "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}")
+ 
+ set_target_properties(libzzipwrap PROPERTIES OUTPUT_NAME "zzipwrap" RELEASE_POSTFIX "-${RELNUM}")
++set_target_properties(libzzipwrap PROPERTIES OUTPUT_NAME "zzipwrap" NONE_POSTFIX "-${RELNUM}")
+ SET_TARGET_PROPERTIES(libzzipwrap PROPERTIES VERSION ${VERNUM}.${FIXNUM} SOVERSION ${VERNUM})
+ set_target_properties(libzzipwrap PROPERTIES DEFINE_SYMBOL "libzzip_EXPORTS")
+ 
diff --git a/srcpkgs/zziplib/template b/srcpkgs/zziplib/template
index ab5af234af62..2026f3e4a521 100644
--- a/srcpkgs/zziplib/template
+++ b/srcpkgs/zziplib/template
@@ -12,6 +12,7 @@ homepage="https://github.com/gdraheim/zziplib"
 changelog="https://raw.githubusercontent.com/gdraheim/zziplib/master/ChangeLog"
 distfiles="https://github.com/gdraheim/zziplib/archive/v${version}.tar.gz"
 checksum=93ef44bf1f1ea24fc66080426a469df82fa631d13ca3b2e4abaeab89538518dc
+patch_args=-Np1
 
 if [ "$CROSS_BUILD" ]; then
 	configure_args+=" -DZZIPTEST=OFF"

From 0553757a7fac92d219bc0f23739a290d61082f6c 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, 21 Mar 2021 15:28:04 +0700
Subject: [PATCH 12/62] mellowplayer: fix build

---
 srcpkgs/mellowplayer/patches/no-werror.patch | 13 +++++++++++++
 srcpkgs/mellowplayer/template                | 13 +++++++------
 2 files changed, 20 insertions(+), 6 deletions(-)
 create mode 100644 srcpkgs/mellowplayer/patches/no-werror.patch

diff --git a/srcpkgs/mellowplayer/patches/no-werror.patch b/srcpkgs/mellowplayer/patches/no-werror.patch
new file mode 100644
index 000000000000..7e678453a123
--- /dev/null
+++ b/srcpkgs/mellowplayer/patches/no-werror.patch
@@ -0,0 +1,13 @@
+Index: MellowPlayer-3.6.6/src/3rdparty/boost/di.hpp
+===================================================================
+--- MellowPlayer-3.6.6.orig/src/3rdparty/boost/di.hpp
++++ MellowPlayer-3.6.6/src/3rdparty/boost/di.hpp
+@@ -67,7 +67,7 @@ BOOST_DI_CFG_FWD
+ #pragma clang diagnostic error "-Wundefined-internal"
+ #pragma clang diagnostic ignored "-Wmissing-field-initializers"
+ #elif defined(__GCC__)
+-#pragma GCC diagnostic error "-Wdeprecated-declarations"
++#pragma GCC diagnostic warning "-Wdeprecated-declarations"
+ #pragma GCC diagnostic push
+ #if (__GNUC__ < 6)
+ #pragma GCC diagnostic error "-Werror"
diff --git a/srcpkgs/mellowplayer/template b/srcpkgs/mellowplayer/template
index 2f8f13960ca6..cfd8a185556f 100644
--- a/srcpkgs/mellowplayer/template
+++ b/srcpkgs/mellowplayer/template
@@ -4,7 +4,7 @@ version=3.6.6
 revision=1
 wrksrc="MellowPlayer-${version}"
 build_style=cmake
-hostmakedepends="pkg-config qt5-tools qt5-qmake"
+hostmakedepends="pkg-config qt5-tools qt5-qmake qt5-host-tools"
 makedepends="qt5-declarative-devel qt5-quickcontrols2-devel
  qt5-plugin-mysql qt5-plugin-pgsql qt5-plugin-sqlite
  qt5-plugin-tds qt5-plugin-odbc
@@ -17,11 +17,12 @@ license="GPL-2.0-or-later"
 homepage="https://colinduquesnoy.gitlab.io/MellowPlayer/"
 distfiles="https://gitlab.com/ColinDuquesnoy/MellowPlayer/-/archive/${version}/MellowPlayer-${version}.tar.bz2"
 checksum=17b8b25ca6b3d27b223f8be6ad80186ae5bd17ce762eb04ecd8b0e82e687b327
+patch_args=-Np1
 
-if [ "$CROSS_BUILD" ]; then
-	hostmakedepends+=" qt5-host-tools"
+if [ "$XBPS_WORDSIZE" != "$XBPS_TARGET_WORDSIZE" ]; then
+	broken="webengine can be built only if word size matches"
 fi
 
-case "$XBPS_TARGET_MACHINE" in
-	arm*) broken="qt5-webengine not available" ;;
-esac
+if [ "$XBPS_TARGET_ENDIAN" != "le" ]; then
+	broken="webengine only supports little endian"
+fi

From c66086ba1d8abe4e7ef9e3840d2a72c03d195bc8 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, 21 Mar 2021 15:43:09 +0700
Subject: [PATCH 13/62] ispc: fix CMAKE_BUILD_TYPE=None

---
 .../ispc/patches/cmake-build-type-none.patch   | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
 create mode 100644 srcpkgs/ispc/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/ispc/patches/cmake-build-type-none.patch b/srcpkgs/ispc/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..411e353c7314
--- /dev/null
+++ b/srcpkgs/ispc/patches/cmake-build-type-none.patch
@@ -0,0 +1,18 @@
+Index: ispc-1.15.0/CMakeLists.txt
+===================================================================
+--- ispc-1.15.0.orig/CMakeLists.txt
++++ ispc-1.15.0/CMakeLists.txt
+@@ -157,13 +157,6 @@ set(OUTPUT_RELEASE Release/bin)
+ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin )
+ 
+ if(CMAKE_BUILD_TYPE)
+-    # Validate build type
+-    set(CONFIGURATION_TYPES "Debug;Release;RelWithDebInfo")
+-
+-    string(FIND "${CONFIGURATION_TYPES}" "${CMAKE_BUILD_TYPE}" MATCHED_CONFIG)
+-    if (${MATCHED_CONFIG} EQUAL -1)
+-         message(FATAL_ERROR "CMAKE_BUILD_TYPE (${CMAKE_BUILD_TYPE}) allows only the following values: ${CONFIGURATION_TYPES}")
+-    endif()
+ else(NOT CMAKE_BUILD_TYPE)
+     set(CMAKE_BUILD_TYPE "Release")
+     message(STATUS "Build type not specified: Use Release by default.")

From 60c669ca4aec30db988a53b583e4a17725346e95 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, 21 Mar 2021 15:56:50 +0700
Subject: [PATCH 14/62] darktable: fix CMAKE_BUILD_TYPE=None

---
 .../darktable/patches/cmake-build-type-none.patch  | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
 create mode 100644 srcpkgs/darktable/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/darktable/patches/cmake-build-type-none.patch b/srcpkgs/darktable/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..7101f9c1a0e7
--- /dev/null
+++ b/srcpkgs/darktable/patches/cmake-build-type-none.patch
@@ -0,0 +1,14 @@
+Index: src/external/rawspeed/cmake/build-type.cmake
+===================================================================
+--- src/external/rawspeed/cmake/build-type.cmake.orig
++++ src/external/rawspeed/cmake/build-type.cmake
+@@ -27,9 +27,6 @@ string(TOUPPER "${RAWSPEED_SPECIAL_BUILD
+ 
+ # is this one of the known build types?
+ list (FIND CMAKE_CONFIGURATION_TYPES_UPPERCASE ${CMAKE_BUILD_TYPE_UPPERCASE} BUILD_TYPE_IS_KNOWN)
+-if (${BUILD_TYPE_IS_KNOWN} EQUAL -1)
+- message(SEND_ERROR "Unknown build type: ${CMAKE_BUILD_TYPE_UPPERCASE}. Please specify one of: ${CMAKE_CONFIGURATION_TYPES}")
+-endif()
+ 
+ # is this a special build?
+ list (FIND RAWSPEED_SPECIAL_BUILD_TYPES_UPPERCASE ${CMAKE_BUILD_TYPE_UPPERCASE} IS_SPECIAL_BUILD)

From 44d2ca7c4f92d513693c8fd18b6a568a3a11ef69 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, 21 Mar 2021 15:33:29 +0700
Subject: [PATCH 15/62] hedgewars: merge -data back

---
 srcpkgs/hedgewars-data                        |  1 -
 .../patches/cmake-build-type-none.patch       | 30 +++++++++++++++++++
 srcpkgs/hedgewars/template                    | 23 +++++---------
 3 files changed, 38 insertions(+), 16 deletions(-)
 delete mode 120000 srcpkgs/hedgewars-data
 create mode 100644 srcpkgs/hedgewars/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/hedgewars-data b/srcpkgs/hedgewars-data
deleted file mode 120000
index b57dc45ebadc..000000000000
--- a/srcpkgs/hedgewars-data
+++ /dev/null
@@ -1 +0,0 @@
-hedgewars
\ No newline at end of file
diff --git a/srcpkgs/hedgewars/patches/cmake-build-type-none.patch b/srcpkgs/hedgewars/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..b4e0c186717c
--- /dev/null
+++ b/srcpkgs/hedgewars/patches/cmake-build-type-none.patch
@@ -0,0 +1,30 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -54,7 +54,7 @@ option(NOVERSIONINFOUPDATE "Disable upda
+ 
+ 
+ if(BUILD_ENGINE_C AND NOT NOVIDEOREC)
+-    if((CMAKE_BUILD_TYPE STREQUAL "Release") OR (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo"))
++    if((CMAKE_BUILD_TYPE STREQUAL "Release") OR (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo") OR (CMAKE_BUILD_TYPE STREQUAL "None"))
+         message("NOTE: Video recorder support disabled. It's incompatible with BUILD_ENGINE_C")
+         set(BUILD_ENGINE_C ON CACHE STRING "Required for BUILD_ENGINE_JS" FORCE)
+     else()
+@@ -93,7 +93,7 @@ set(CPACK_PACKAGE_VERSION_MAJOR 1)
+ set(CPACK_PACKAGE_VERSION_MINOR 0)
+ set(CPACK_PACKAGE_VERSION_PATCH 0)
+ set(HEDGEWARS_PROTO_VER 59)
+-if((CMAKE_BUILD_TYPE STREQUAL "Release") OR (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo"))
++if((CMAKE_BUILD_TYPE STREQUAL "Release") OR (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo") OR (CMAKE_BUILD_TYPE STREQUAL "None"))
+     set(HEDGEWARS_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
+ else()
+     set(HEDGEWARS_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}-dev")
+@@ -114,6 +114,7 @@ include(${CMAKE_MODULE_PATH}/platform.cm
+ if(CMAKE_BUILD_TYPE)
+     if(NOT((CMAKE_BUILD_TYPE STREQUAL "Release") OR
+            (CMAKE_BUILD_TYPE STREQUAL "Debug") OR
++	   (CMAKE_BUILD_TYPE STREQUAL "None") OR
+            (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")))
+         set(CMAKE_BUILD_TYPE ${default_build_type} CACHE STRING "Build type (Debug/Release/RelWithDebInfo)" FORCE)
+         message(STATUS "Unknown build type ${CMAKE_BUILD_TYPE}, using default (${default_build_type})")
diff --git a/srcpkgs/hedgewars/template b/srcpkgs/hedgewars/template
index d2294cf572f5..aed3c03caf89 100644
--- a/srcpkgs/hedgewars/template
+++ b/srcpkgs/hedgewars/template
@@ -1,15 +1,16 @@
 # Template file for 'hedgewars'
 pkgname=hedgewars
 version=1.0.0
-revision=2
+revision=3
 wrksrc="${pkgname}-src-${version}"
 build_style=cmake
 configure_args="-DNOSERVER=1 -DDATA_INSTALL_DIR=/usr/share/${pkgname}
- -DPHYSFS_SYSTEM=1 -DCMAKE_VERBOSE_MAKEFILE=1 -DMINIMAL_FLAGS=1"
-hostmakedepends="lua51 pkg-config"
+ -DPHYSFS_SYSTEM=1 -DMINIMAL_FLAGS=1"
+make_cmd=make
+hostmakedepends="lua51 pkg-config qt5-qmake qt5-host-tools"
 makedepends="ffmpeg-devel lua51-devel physfs-devel qt5-tools-devel SDL2_image-devel
  SDL2_mixer-devel SDL2_net-devel SDL2_ttf-devel"
-depends="hedgewars-data>=${version}_${revision} libfreeglut"
+depends="libfreeglut"
 short_desc="Funny turn-based artillery game, featuring fighting Hedgehogs!"
 maintainer="Jakub Skrzypnik <jot.skrzyp@gmail.com>"
 license="GPL-2.0-only"
@@ -18,10 +19,8 @@ distfiles="https://hedgewars.org/download/releases/hedgewars-src-${version}.tar.
 checksum=211634e61f2e4beecc3c98c6f749601fcd08321fda1ba969b3b3832a004f155b
 nopie_files="/usr/bin/hwengine"
 nocross="Needs investigation: fails to link hwengine"
-
-if [ -n "$CROSS_BUILD" ]; then
-	hostmakedepends+=" qt5-devel"
-fi
+replaces="hedgewars-data>=0"
+export CMAKE_GENERATOR="Unix Makefiles"
 
 case $XBPS_TARGET_MACHINE in
 	x86_64*)
@@ -38,6 +37,7 @@ esac
 
 if [ -n "$_use_c_engine" ]; then
 	hostmakedepends+=" glew-devel libatomic-devel ghc clang"
+	makedepends+=" glew-devel libatomic-devel"
 	configure_args+=" -DBUILD_ENGINE_C=1"
 	nopie_files+=" /usr/bin/hedgewars"
 fi
@@ -56,10 +56,3 @@ pre_configure() {
 post_install() {
 	vinstall ${DESTDIR}/usr/share/hedgewars/Data/misc/hedgewars.desktop 644 usr/share/applications
 }
-
-hedgewars-data_package() {
-	short_desc+=" - data files"
-	pkg_install() {
-		vmove usr/share/hedgewars/Data
-	}
-}

From 506da290088b8d18c471fd18175b53314c3e3d41 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, 21 Mar 2021 16:41:58 +0700
Subject: [PATCH 16/62] mariadb: fix for CMAKE_BUILD_TYPE=None

---
 srcpkgs/mariadb/template | 32 ++++++++++++++------------------
 1 file changed, 14 insertions(+), 18 deletions(-)

diff --git a/srcpkgs/mariadb/template b/srcpkgs/mariadb/template
index 437ff757b383..78d5e2dbdbe8 100644
--- a/srcpkgs/mariadb/template
+++ b/srcpkgs/mariadb/template
@@ -34,35 +34,31 @@ replaces="mysql>=0"
 conf_files="/etc/mysql/my.cnf"
 system_accounts="mysql"
 mysql_homedir="/var/lib/mysql"
-CFLAGS="-w -fcommon"
+CFLAGS="-w -fcommon -DDBUG_OFF=1"
+CXXFLAGS="-DDBUG_OFF=1"
 
 pre_configure() {
 	# We need some host binaries before starting cross compilation.
 	if [ "$CROSS_BUILD" ]; then
+		mkdir -p build.native
 		# XXX still broken: jemalloc configure execs host bins.
-		CC= CXX= CPP= LD= AR= AS= RANLIB= CFLAGS= CXXFLAGS= LDFLAGS= cmake .
-		make comp_err comp_sql gen_lex_hash gen_lex_token
-		mkdir bin.host
-		cp extra/comp_err bin.host
-		cp scripts/comp_sql bin.host
-		cp sql/gen_lex_hash bin.host
-		cp sql/gen_lex_token bin.host
-		make clean
-		rm CMakeCache.txt
+		CC= CXX= CPP= LD= AR= AS= RANLIB= CFLAGS= CXXFLAGS= LDFLAGS= \
+			cmake -S . -B build.native
+		make -C build.native comp_err comp_sql gen_lex_hash gen_lex_token
 	fi
 }
 
 pre_build() {
 	if [ "$CROSS_BUILD" ]; then
 		# CMake complains if those binaries ain't in build
-		cp bin.host/comp_err ${wrksrc}/extra
-		cp bin.host/comp_err ${wrksrc}/build/extra
-		cp bin.host/comp_sql ${wrksrc}/scripts
-		cp bin.host/comp_sql ${wrksrc}/build/scripts
-		cp bin.host/gen_lex_hash ${wrksrc}/sql
-		cp bin.host/gen_lex_hash ${wrksrc}/build/sql
-		cp bin.host/gen_lex_token ${wrksrc}/sql
-		cp bin.host/gen_lex_token ${wrksrc}/build/sql
+		cp build.native/extra/comp_err ${wrksrc}/extra
+		cp build.native/extra/comp_err ${wrksrc}/build/extra
+		cp build.native/scripts/comp_sql ${wrksrc}/scripts
+		cp build.native/scripts/comp_sql ${wrksrc}/build/scripts
+		cp build.native/sql/gen_lex_hash ${wrksrc}/sql
+		cp build.native/sql/gen_lex_hash ${wrksrc}/build/sql
+		cp build.native/sql/gen_lex_token ${wrksrc}/sql
+		cp build.native/sql/gen_lex_token ${wrksrc}/build/sql
 		export PATH=${PATH}:${wrksrc}/extra:${wrksrc}/scripts:${wrksrc}/sql
 	fi
 	export LD_LIBRARY_PATH=${wrksrc}/build/storage/tokudb/ft-index/portability

From ff8fdcd6c17022a6b58c323fc5298ca1188302cd 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: Thu, 25 Mar 2021 07:58:28 +0700
Subject: [PATCH 17/62] EternalTerminal: remove -ggdb3

---
 .../EternalTerminal/patches/fix-cflags.patch    | 17 +++++++++++++++++
 srcpkgs/EternalTerminal/template                |  1 +
 2 files changed, 18 insertions(+)
 create mode 100644 srcpkgs/EternalTerminal/patches/fix-cflags.patch

diff --git a/srcpkgs/EternalTerminal/patches/fix-cflags.patch b/srcpkgs/EternalTerminal/patches/fix-cflags.patch
new file mode 100644
index 000000000000..e6fcd432f7e7
--- /dev/null
+++ b/srcpkgs/EternalTerminal/patches/fix-cflags.patch
@@ -0,0 +1,17 @@
+Index: EternalTerminal-et-v6.0.13/CMakeLists.txt
+===================================================================
+--- EternalTerminal-et-v6.0.13.orig/CMakeLists.txt
++++ EternalTerminal-et-v6.0.13/CMakeLists.txt
+@@ -26,12 +26,6 @@ if(DISABLE_CRASH_LOG)
+ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DELPP_DISABLE_DEFAULT_CRASH_HANDLING")
+ ENDIF(DISABLE_CRASH_LOG)
+ 
+-if(UNIX)
+-  # Enable debug info
+-  SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -ggdb3")
+-  SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -ggdb3")
+-endif()
+-
+ # Enable C++-11
+ set(CMAKE_CXX_STANDARD 11)
+ set(CMAKE_CXX_STANDARD_REQUIRED ON)
diff --git a/srcpkgs/EternalTerminal/template b/srcpkgs/EternalTerminal/template
index 7bac78d2ffd4..bc92e47743dd 100644
--- a/srcpkgs/EternalTerminal/template
+++ b/srcpkgs/EternalTerminal/template
@@ -13,6 +13,7 @@ homepage="https://eternalterminal.dev/"
 distfiles="https://github.com/MisterTea/EternalTerminal/archive/et-v${version}.tar.gz"
 checksum=728c3a444d666897c710e33fe473d8d289263a59574451b13aa53ec3c6ac88b3
 system_accounts="_eternal"
+patch_args=-Np1
 
 LDFLAGS="-lgflags"
 

From 9b336808d37929d13024615696f4075c7242e871 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: Thu, 25 Mar 2021 08:20:29 +0700
Subject: [PATCH 18/62] OTPClient: respect CFLAGS

---
 srcpkgs/OTPClient/patches/fix-cflags.patch | 17 +++++++++++++++++
 srcpkgs/OTPClient/template                 |  1 +
 2 files changed, 18 insertions(+)
 create mode 100644 srcpkgs/OTPClient/patches/fix-cflags.patch

diff --git a/srcpkgs/OTPClient/patches/fix-cflags.patch b/srcpkgs/OTPClient/patches/fix-cflags.patch
new file mode 100644
index 000000000000..ae70f441538f
--- /dev/null
+++ b/srcpkgs/OTPClient/patches/fix-cflags.patch
@@ -0,0 +1,17 @@
+Index: OTPClient-2.4.2/CMakeLists.txt
+===================================================================
+--- OTPClient-2.4.2.orig/CMakeLists.txt
++++ OTPClient-2.4.2/CMakeLists.txt
+@@ -11,11 +11,10 @@ option(BUILD_GUI "Build the GUI" ON)
+ option(BUILD_CLI "Build the CLI" ON)
+ 
+ set(CMAKE_C_STANDARD 11)
+-set(CMAKE_C_FLAGS "-Wall -Wextra -O3 -Wformat=2 -Wmissing-format-attribute -fstack-protector-strong -Wundef -Wmissing-format-attribute")
++set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wformat=2 -Wmissing-format-attribute -fstack-protector-strong -Wundef -Wmissing-format-attribute")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fdiagnostics-color=always -Wstrict-prototypes -Wunreachable-code")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wchar-subscripts -Wwrite-strings -Wpointer-arith -Wbad-function-cast -Wcast-align")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror=format-security -Werror=implicit-function-declaration -Wno-sign-compare")
+-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3")
+ if(CMAKE_COMPILER_IS_GNUCC)
+     set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pie -fPIE")
+ endif()
diff --git a/srcpkgs/OTPClient/template b/srcpkgs/OTPClient/template
index e8c0099850b7..f5af76e655a6 100644
--- a/srcpkgs/OTPClient/template
+++ b/srcpkgs/OTPClient/template
@@ -12,3 +12,4 @@ license="GPL-3.0-or-later"
 homepage="https://github.com/paolostivanin/OTPClient"
 distfiles="https://github.com/paolostivanin/OTPClient/archive/v${version}.tar.gz"
 checksum=74bc4312aa1cd336ca983434e3bed951c5ead327091e7708e3beb08508813495
+patch_args=-Np1

From 8d03d0e0495cb61473183c527d32340b5333ea37 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: Thu, 25 Mar 2021 08:30:31 +0700
Subject: [PATCH 19/62] crex: hardening

---
 srcpkgs/crex/patches/fix-cflags.patch | 20 ++++++++++++++++++++
 srcpkgs/crex/template                 |  7 ++-----
 2 files changed, 22 insertions(+), 5 deletions(-)
 create mode 100644 srcpkgs/crex/patches/fix-cflags.patch

diff --git a/srcpkgs/crex/patches/fix-cflags.patch b/srcpkgs/crex/patches/fix-cflags.patch
new file mode 100644
index 000000000000..d191fb1e9ec0
--- /dev/null
+++ b/srcpkgs/crex/patches/fix-cflags.patch
@@ -0,0 +1,20 @@
+Index: crex-0.2.5/CMakeLists.txt
+===================================================================
+--- crex-0.2.5.orig/CMakeLists.txt
++++ crex-0.2.5/CMakeLists.txt
+@@ -13,9 +13,6 @@ endif(CCACHE_FOUND)
+ set (CMAKE_CXX_STANDARD 14)
+ set (CMAKE_CXX_STANDARD_REQUIRED ON)
+ 
+-set (CMAKE_CXX_FLAGS "-fdiagnostics-color=auto")
+-set (CMAKE_C_FLAGS "-fdiagnostics-color=auto")
+-
+ set (DEBUG_FLAGS "-Wpedantic -Wall -Wextra -Wcast-align -Wcast-qual -Wctor-dtor-privacy -Wdisabled-optimization -Wformat=2 -Winit-self -Wlogical-op -Wmissing-declarations -Wmissing-include-dirs -Wnoexcept -Wold-style-cast -Woverloaded-virtual -Wredundant-decls -Wshadow -Wsign-conversion -Wsign-promo -Wstrict-null-sentinel -Wstrict-overflow=5 -Wswitch-default -Wundef -Wno-unused -std=c++14 -g")
+ set (DEBUG_LINK_FLAGS "-fprofile-arcs -ftest-coverage -flto")
+ 
+@@ -56,4 +53,4 @@ target_link_libraries (
+   ${TARGET}
+ )
+ 
+-install (TARGETS ${TARGET} DESTINATION "/usr/local/bin")
++install (TARGETS ${TARGET} DESTINATION "/usr/bin")
diff --git a/srcpkgs/crex/template b/srcpkgs/crex/template
index a54697a93adc..2f455a0b0c72 100644
--- a/srcpkgs/crex/template
+++ b/srcpkgs/crex/template
@@ -1,7 +1,7 @@
 # Template file for 'crex'
 pkgname=crex
 version=0.2.5
-revision=1
+revision=2
 build_style=cmake
 short_desc="Explore, test, and check regular expressions in the terminal"
 maintainer="Piotr Wójcik <chocimier@tlen.pl>"
@@ -9,10 +9,7 @@ license="MIT"
 homepage="https://github.com/octobanana/crex"
 distfiles="https://github.com/octobanana/crex/archive/${version}.tar.gz"
 checksum=c6a166b7a1e696a7babeaf7c5728eece1624704a18357f827129fc95ef2ecc56
-
-pre_configure() {
-	sed -e 's|/local/|/|' -i CMakeLists.txt
-}
+patch_args=-Np1
 
 post_install() {
 	vlicense LICENSE

From 728f34e8d67bbfa0a11dd9831d76cb0d50d7de38 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: Thu, 25 Mar 2021 08:34:32 +0700
Subject: [PATCH 20/62] libbaseencode: hardening

---
 srcpkgs/libbaseencode/patches/fix-cflags.patch | 13 +++++++++++++
 srcpkgs/libbaseencode/template                 |  3 ++-
 2 files changed, 15 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/libbaseencode/patches/fix-cflags.patch

diff --git a/srcpkgs/libbaseencode/patches/fix-cflags.patch b/srcpkgs/libbaseencode/patches/fix-cflags.patch
new file mode 100644
index 000000000000..1bb86a0b15a4
--- /dev/null
+++ b/srcpkgs/libbaseencode/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: libbaseencode-1.0.9/CMakeLists.txt
+===================================================================
+--- libbaseencode-1.0.9.orig/CMakeLists.txt
++++ libbaseencode-1.0.9/CMakeLists.txt
+@@ -15,7 +15,7 @@ set(CMAKE_C_STANDARD 11)
+ set(BASEENCODE_HEADERS src/baseencode.h)
+ set(SOURCE_FILES src/base32.c src/base64.c)
+ 
+-set(CMAKE_C_FLAGS "-Wall -Werror -fPIC")
++set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Werror -fPIC")
+ 
+ add_library(${PROJECT_NAME} SHARED ${SOURCE_FILES})
+ 
diff --git a/srcpkgs/libbaseencode/template b/srcpkgs/libbaseencode/template
index 384a189224df..d5929ad7bb51 100644
--- a/srcpkgs/libbaseencode/template
+++ b/srcpkgs/libbaseencode/template
@@ -1,7 +1,7 @@
 # Template file for 'libbaseencode'
 pkgname=libbaseencode
 version=1.0.9
-revision=1
+revision=2
 build_style=cmake
 short_desc="Library for encoding decoding data use base32 or base64"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -9,6 +9,7 @@ license="Apache-2.0"
 homepage="https://github.com/paolostivanin/libbaseencode"
 distfiles="https://github.com/paolostivanin/libbaseencode/archive/v${version}.tar.gz"
 checksum=a183d7cf30d931b2a078d6f0ef64616b71ab26f9258e5f4e191778c7ace7175d
+patch_args=-Np1
 
 libbaseencode-devel_package() {
 	depends="libbaseencode-${version}_${revision}"

From 359e32d13d04fd7fd567a46b222e6b6f29ec155c 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: Fri, 26 Mar 2021 08:46:56 +0700
Subject: [PATCH 21/62] bibletime: clean build flags

---
 srcpkgs/bibletime/patches/fix-cflags.patch | 13 +++++++++++++
 srcpkgs/bibletime/template                 |  1 +
 2 files changed, 14 insertions(+)
 create mode 100644 srcpkgs/bibletime/patches/fix-cflags.patch

diff --git a/srcpkgs/bibletime/patches/fix-cflags.patch b/srcpkgs/bibletime/patches/fix-cflags.patch
new file mode 100644
index 000000000000..480c5ca4ac1e
--- /dev/null
+++ b/srcpkgs/bibletime/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: bibletime-3.0/cmake/BTApplication.cmake
+===================================================================
+--- bibletime-3.0.orig/cmake/BTApplication.cmake
++++ bibletime-3.0/cmake/BTApplication.cmake
+@@ -41,7 +41,7 @@ IF(WIN32)
+     ADD_COMPILE_OPTIONS("/Zi")
+ ELSE()
+     ADD_COMPILE_OPTIONS(
+-        "-ggdb" "-Wall" "-Wextra"
++        "-Wall" "-Wextra" "-DNDEBUG" "-DQT_NO_DEBUG"
+         "$<$<STREQUAL:$<CONFIGURATION>,Release>:-O2>"
+         "$<$<STREQUAL:$<CONFIGURATION>,Release>:-DNDEBUG>"
+         "$<$<STREQUAL:$<CONFIGURATION>,Release>:-DQT_NO_DEBUG>"
diff --git a/srcpkgs/bibletime/template b/srcpkgs/bibletime/template
index 224881c45516..85bcc7f22f87 100644
--- a/srcpkgs/bibletime/template
+++ b/srcpkgs/bibletime/template
@@ -18,6 +18,7 @@ license="GPL-2.0-or-later"
 homepage="http://bibletime.info"
 distfiles="https://github.com/bibletime/bibletime/releases/download/v${version}/bibletime-${version}.tar.xz"
 checksum=d6beef62ad44b255e3dc4c5e89214bf01a0e85c9136073b0be12fca3d2b22622
+patch_args=-Np1
 
 pre_build() {
 	. /etc/profile.d/10_openjdk11.sh

From bd44d20ccc41640d64d0258a777d4ab688f62857 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: Fri, 26 Mar 2021 08:54:25 +0700
Subject: [PATCH 22/62] boomerang: clean build flags

---
 srcpkgs/boomerang/patches/fix-cflags.patch | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
 create mode 100644 srcpkgs/boomerang/patches/fix-cflags.patch

diff --git a/srcpkgs/boomerang/patches/fix-cflags.patch b/srcpkgs/boomerang/patches/fix-cflags.patch
new file mode 100644
index 000000000000..eb59766c1c5b
--- /dev/null
+++ b/srcpkgs/boomerang/patches/fix-cflags.patch
@@ -0,0 +1,21 @@
+Index: cmake-scripts/boomerang-flags.cmake
+===================================================================
+--- cmake-scripts/boomerang-flags.cmake
++++ cmake-scripts/boomerang-flags.cmake
+@@ -104,16 +104,6 @@ endif ()
+ 
+ 
+ if (NOT MSVC)
+-    if ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
+-        BOOMERANG_ADD_COMPILE_FLAGS(-O0)
+-    elseif ("${CMAKE_BUILD_TYPE}" STREQUAL "RelWithDebInfo")
+-        # No special flags
+-    elseif ("${CMAKE_BUILD_TYPE}" STREQUAL "MinSizeRel")
+-        BOOMERANG_ADD_COMPILE_FLAGS(-Os)
+-    else () # Release
+-        BOOMERANG_ADD_COMPILE_FLAGS(-O3)
+-    endif ()
+-
+     if (BOOMERANG_ENABLE_COVERAGE)
+         set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fprofile-arcs -ftest-coverage")
+         set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage")

From 3445376404523fb1b4fa6b9ebdbe3f393b56036e 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: Fri, 26 Mar 2021 08:58:11 +0700
Subject: [PATCH 23/62] catimg: don't change our build-type

---
 srcpkgs/catimg/patches/fix-cflags.patch | 12 ++++++++++++
 srcpkgs/catimg/template                 |  2 +-
 2 files changed, 13 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/catimg/patches/fix-cflags.patch

diff --git a/srcpkgs/catimg/patches/fix-cflags.patch b/srcpkgs/catimg/patches/fix-cflags.patch
new file mode 100644
index 000000000000..9b9f1074ef20
--- /dev/null
+++ b/srcpkgs/catimg/patches/fix-cflags.patch
@@ -0,0 +1,12 @@
+Index: catimg-2.7.0/CMakeLists.txt
+===================================================================
+--- catimg-2.7.0.orig/CMakeLists.txt
++++ catimg-2.7.0/CMakeLists.txt
+@@ -11,7 +11,6 @@ endif()
+ #set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wall -Wextra -g -std=c99 -Wno-unused-result")
+ #set(CMAKE_BUILD_TYPE Debug)
+ set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -Wall -Wextra -Os -std=c99 -Wno-unused-result")
+-set(CMAKE_BUILD_TYPE Release)
+ 
+ set(SRC ${PROJECT_SOURCE_DIR}/src)
+ 
diff --git a/srcpkgs/catimg/template b/srcpkgs/catimg/template
index 374351c45379..6fbc5f1d9140 100644
--- a/srcpkgs/catimg/template
+++ b/srcpkgs/catimg/template
@@ -9,7 +9,7 @@ license="MIT"
 homepage="https://github.com/posva/catimg"
 distfiles="https://github.com/posva/catimg/archive/${version}.tar.gz"
 checksum=3a6450316ff62fb07c3facb47ea208bf98f62abd02783e88c56f2a6508035139
-
+patch_args=-Np1
 CFLAGS="-fcommon"
 
 post_install() {

From cc06dd52ae25bd4d8f7ee25c595a3f9361da1faf 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: Fri, 26 Mar 2021 09:09:37 +0700
Subject: [PATCH 24/62] libcotp: fix build flags

---
 srcpkgs/libcotp/patches/fix-cflags.patch | 14 ++++++++++++++
 srcpkgs/libcotp/template                 |  1 +
 2 files changed, 15 insertions(+)
 create mode 100644 srcpkgs/libcotp/patches/fix-cflags.patch

diff --git a/srcpkgs/libcotp/patches/fix-cflags.patch b/srcpkgs/libcotp/patches/fix-cflags.patch
new file mode 100644
index 000000000000..397b3960e9f4
--- /dev/null
+++ b/srcpkgs/libcotp/patches/fix-cflags.patch
@@ -0,0 +1,14 @@
+Index: libcotp-1.2.2/CMakeLists.txt
+===================================================================
+--- libcotp-1.2.2.orig/CMakeLists.txt
++++ libcotp-1.2.2/CMakeLists.txt
+@@ -25,8 +25,7 @@ set(CMAKE_C_STANDARD 11)
+ set(COTP_HEADERS src/cotp.h)
+ set(SOURCE_FILES src/otp.c)
+ 
+-set(CMAKE_C_FLAGS "-Wall -Wextra -O3 -Wno-format-truncation -fstack-protector-strong -fPIC")
+-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3")
++set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wno-format-truncation -fstack-protector-strong -fPIC")
+ 
+ add_library(cotp SHARED ${SOURCE_FILES})
+ 
diff --git a/srcpkgs/libcotp/template b/srcpkgs/libcotp/template
index 9e147ff7deb6..88337290d1e8 100644
--- a/srcpkgs/libcotp/template
+++ b/srcpkgs/libcotp/template
@@ -11,6 +11,7 @@ license="Apache-2.0"
 homepage="https://github.com/paolostivanin/libcotp"
 distfiles="https://github.com/paolostivanin/libcotp/archive/v${version}.tar.gz"
 checksum=25b45ffa4aece5cc689503ebea7356a2f760c194f0c41805934495d2fe7165b1
+patch_args=-Np1
 
 libcotp-devel_package() {
 	depends="libcotp-${version}_${revision}"

From cb8a31aca2c128beca0eae35f6dcb058bc29c0d6 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: Fri, 26 Mar 2021 21:06:07 +0700
Subject: [PATCH 25/62] loudgain: hardening

---
 srcpkgs/loudgain/patches/fix-cflags.patch | 20 ++++++++++++++++++++
 srcpkgs/loudgain/template                 |  3 ++-
 2 files changed, 22 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/loudgain/patches/fix-cflags.patch

diff --git a/srcpkgs/loudgain/patches/fix-cflags.patch b/srcpkgs/loudgain/patches/fix-cflags.patch
new file mode 100644
index 000000000000..25b2c969bef4
--- /dev/null
+++ b/srcpkgs/loudgain/patches/fix-cflags.patch
@@ -0,0 +1,20 @@
+Index: loudgain-0.6.8/CMakeLists.txt
+===================================================================
+--- loudgain-0.6.8.orig/CMakeLists.txt
++++ loudgain-0.6.8/CMakeLists.txt
+@@ -69,12 +69,12 @@ TARGET_LINK_LIBRARIES(loudgain
+ )
+ 
+ SET_TARGET_PROPERTIES(loudgain PROPERTIES
+-  COMPILE_FLAGS "-Wall -pedantic -g"
++  COMPILE_FLAGS "-Wall -pedantic"
+ )
+ 
+-SET(CMAKE_C_FLAGS "-std=gnu99 -D_GNU_SOURCE")
++SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99 -D_GNU_SOURCE")
+ 
+-SET(CMAKE_CXX_FLAGS "-std=gnu++11 -D_GNU_SOURCE")
++SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11 -D_GNU_SOURCE")
+ 
+ INSTALL(TARGETS loudgain DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
+ 
diff --git a/srcpkgs/loudgain/template b/srcpkgs/loudgain/template
index f29167883439..00b2d20d27d6 100644
--- a/srcpkgs/loudgain/template
+++ b/srcpkgs/loudgain/template
@@ -1,7 +1,7 @@
 # Template file for 'loudgain'
 pkgname=loudgain
 version=0.6.8
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="pkg-config"
 makedepends="libebur128-devel taglib-devel ffmpeg-devel"
@@ -11,6 +11,7 @@ license="BSD-2-Clause"
 homepage="https://github.com/Moonbase59/loudgain"
 distfiles="https://github.com/Moonbase59/loudgain/archive/v${version}.tar.gz"
 checksum=1137c193ad941b366e87c5d84ccc95a7aa8571affc060db0bd1cf72c489aeaee
+patch_args=-Np1
 
 post_install() {
 	vlicense COPYING

From 47dc3039449e0a572e4b9d6902bb0441b72e4a1f 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: Fri, 26 Mar 2021 21:20:13 +0700
Subject: [PATCH 26/62] msg2: hardening

---
 srcpkgs/msg2/patches/fix-cflags.patch | 13 +++++++++++++
 srcpkgs/msg2/template                 |  2 +-
 2 files changed, 14 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/msg2/patches/fix-cflags.patch

diff --git a/srcpkgs/msg2/patches/fix-cflags.patch b/srcpkgs/msg2/patches/fix-cflags.patch
new file mode 100644
index 000000000000..64404bf44fcb
--- /dev/null
+++ b/srcpkgs/msg2/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -3,7 +3,7 @@ project(msg2)
+ 
+ # Flags
+ set(CMAKE_CXX_STANDARD 17)
+-set(CMAKE_CXX_FLAGS "-Os -pipe -fPIC -fno-plt -fstack-protector-strong -Wall -Wshadow -pedantic -Wno-parentheses -Wfatal-errors")
++set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pipe -fPIC -fno-plt -fstack-protector-strong -Wall -Wshadow -pedantic -Wno-parentheses -Wfatal-errors")
+ 
+ # Add source files
+ add_executable(msg2 main.cpp)
diff --git a/srcpkgs/msg2/template b/srcpkgs/msg2/template
index b4f77400bf22..473b3c4ec4d2 100644
--- a/srcpkgs/msg2/template
+++ b/srcpkgs/msg2/template
@@ -1,7 +1,7 @@
 # Template file for 'msg2'
 pkgname=msg2
 version=1.2.0
-revision=1
+revision=2
 build_style=cmake
 short_desc="Output a blue arrow and a white message on the commandline"
 maintainer="Orphaned <orphan@voidlinux.org>"

From fbd5ef8b54ec5612810d0acead4e46b55915e939 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: Fri, 26 Mar 2021 21:22:55 +0700
Subject: [PATCH 27/62] ippusbxd: fix cflags -O2 not -o2

---
 srcpkgs/ippusbxd/patches/fix-cflags.patch | 12 ++++++++++++
 srcpkgs/ippusbxd/template                 |  2 +-
 2 files changed, 13 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/ippusbxd/patches/fix-cflags.patch

diff --git a/srcpkgs/ippusbxd/patches/fix-cflags.patch b/srcpkgs/ippusbxd/patches/fix-cflags.patch
new file mode 100644
index 000000000000..5d36903c3ffd
--- /dev/null
+++ b/srcpkgs/ippusbxd/patches/fix-cflags.patch
@@ -0,0 +1,12 @@
+Index: src/CMakeLists.txt
+===================================================================
+--- src/CMakeLists.txt.orig
++++ src/CMakeLists.txt
+@@ -1,6 +1,6 @@
+ cmake_minimum_required(VERSION 2.6)
+ project(ippusbxd)
+-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -o2 -g -std=c99 -Wall -Wextra -pedantic -pedantic-errors")
++set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -Wall -Wextra -pedantic -pedantic-errors")
+ 
+ 
+ # Compiler specific configuration
diff --git a/srcpkgs/ippusbxd/template b/srcpkgs/ippusbxd/template
index ce4ff2ea9125..e81064e8b91d 100644
--- a/srcpkgs/ippusbxd/template
+++ b/srcpkgs/ippusbxd/template
@@ -1,7 +1,7 @@
 # Template file for 'ippusbxd'
 pkgname=ippusbxd
 version=1.34
-revision=1
+revision=2
 build_wrksrc=src
 build_style=cmake
 make_cmd=make

From 188e0f52d7b391394f0850380efecd9626e1c6bf 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: Fri, 26 Mar 2021 21:34:52 +0700
Subject: [PATCH 28/62] tlsh: respect -g + hardening

---
 srcpkgs/tlsh/patches/fix-cflags.patch | 13 +++++++++++++
 srcpkgs/tlsh/template                 |  2 +-
 2 files changed, 14 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/tlsh/patches/fix-cflags.patch

diff --git a/srcpkgs/tlsh/patches/fix-cflags.patch b/srcpkgs/tlsh/patches/fix-cflags.patch
new file mode 100644
index 000000000000..8715563715c7
--- /dev/null
+++ b/srcpkgs/tlsh/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -125,7 +125,7 @@ if (CMAKE_BUILD_TYPE STREQUAL Debug)
+     endif()
+ else(CMAKE_BUILD_TYPE STREQUAL Debug)
+     if(CMAKE_COMPILER_IS_GNUCXX)
+-        set(CMAKE_CXX_FLAGS "-O2 -fvisibility=internal")  ## Remove TlshImpl symbols
++        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=internal")  ## Remove TlshImpl symbols
+     endif()
+     if(MSVC)
+         set(CMAKE_CXX_FLAGS "/O2")        ## Optimize
diff --git a/srcpkgs/tlsh/template b/srcpkgs/tlsh/template
index 1f96834107cc..4ee1ccdc728a 100644
--- a/srcpkgs/tlsh/template
+++ b/srcpkgs/tlsh/template
@@ -1,7 +1,7 @@
 # Template file for 'tlsh'
 pkgname=tlsh
 version=3.19.1
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="python3"
 makedepends="python3-devel"

From 2443935600b7517b625bf34f802a4746210f43f6 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: Fri, 26 Mar 2021 21:59:06 +0700
Subject: [PATCH 29/62] poppler: hardening + respect -g

---
 srcpkgs/poppler/patches/fix-cflags.patch | 21 +++++++++++++++++++++
 srcpkgs/poppler/template                 |  2 +-
 2 files changed, 22 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/poppler/patches/fix-cflags.patch

diff --git a/srcpkgs/poppler/patches/fix-cflags.patch b/srcpkgs/poppler/patches/fix-cflags.patch
new file mode 100644
index 000000000000..9e62b11010ba
--- /dev/null
+++ b/srcpkgs/poppler/patches/fix-cflags.patch
@@ -0,0 +1,21 @@
+Index: cmake/modules/PopplerMacros.cmake
+===================================================================
+--- cmake/modules/PopplerMacros.cmake.orig
++++ cmake/modules/PopplerMacros.cmake
+@@ -123,14 +123,14 @@ if(CMAKE_COMPILER_IS_GNUCXX)
+   set(DEFAULT_COMPILE_WARNINGS_EXTRA "${_warn} ${_warnx}")
+ 
+   set(_save_cxxflags "${CMAKE_CXX_FLAGS}")
+-  set(CMAKE_CXX_FLAGS                "-fno-exceptions -fno-check-new -fno-common -D_DEFAULT_SOURCE")
++  set(CMAKE_CXX_FLAGS                "-fno-exceptions -fno-check-new -fno-common -D_DEFAULT_SOURCE ${_save_cxxflags}")
+   set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g ${_save_cxxflags}")
+   set(CMAKE_CXX_FLAGS_RELEASE        "-O2 -DNDEBUG ${_save_cxxflags}")
+   set(CMAKE_CXX_FLAGS_DEBUG          "-g -O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline ${_save_cxxflags}")
+   set(CMAKE_CXX_FLAGS_DEBUGFULL      "-g3 -fno-inline ${_save_cxxflags}")
+   set(CMAKE_CXX_FLAGS_PROFILE        "-g3 -fno-inline -ftest-coverage -fprofile-arcs ${_save_cxxflags}")
+   set(_save_cflags "${CMAKE_C_FLAGS}")
+-  set(CMAKE_C_FLAGS                  "-std=c99 -D_DEFAULT_SOURCE")
++  set(CMAKE_C_FLAGS                  "-std=c99 -D_DEFAULT_SOURCE ${_save_cflags}")
+   set(CMAKE_C_FLAGS_RELWITHDEBINFO   "-O2 -g ${_save_cflags}")
+   set(CMAKE_C_FLAGS_RELEASE          "-O2 -DNDEBUG ${_save_cflags}")
+   set(CMAKE_C_FLAGS_DEBUG            "-g -O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline ${_save_cflags}")
diff --git a/srcpkgs/poppler/template b/srcpkgs/poppler/template
index ed0db8de7ab6..1aebd7f7e177 100644
--- a/srcpkgs/poppler/template
+++ b/srcpkgs/poppler/template
@@ -4,7 +4,7 @@
 #
 pkgname=poppler
 version=20.09.0
-revision=2
+revision=3
 build_style=cmake
 build_helper="gir"
 configure_args="-DENABLE_UNSTABLE_API_ABI_HEADERS=ON -DENABLE_CPP=ON

From 412ed3716b35dfbad20203e2d2ec2fb8cef1f572 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: Fri, 26 Mar 2021 21:59:29 +0700
Subject: [PATCH 30/62] poppler-qt5: hardening + respect -g

---
 srcpkgs/poppler-qt5/patches  | 1 +
 srcpkgs/poppler-qt5/template | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)
 create mode 120000 srcpkgs/poppler-qt5/patches

diff --git a/srcpkgs/poppler-qt5/patches b/srcpkgs/poppler-qt5/patches
new file mode 120000
index 000000000000..636e4ac2cbd9
--- /dev/null
+++ b/srcpkgs/poppler-qt5/patches
@@ -0,0 +1 @@
+../poppler/patches
\ No newline at end of file
diff --git a/srcpkgs/poppler-qt5/template b/srcpkgs/poppler-qt5/template
index 0dc45c05c58b..c2ec35dbbad3 100644
--- a/srcpkgs/poppler-qt5/template
+++ b/srcpkgs/poppler-qt5/template
@@ -5,7 +5,7 @@
 #
 pkgname=poppler-qt5
 version=20.09.0
-revision=1
+revision=2
 wrksrc="poppler-${version}"
 build_style=cmake
 configure_args="-DENABLE_UNSTABLE_API_ABI_HEADERS=ON -DENABLE_GLIB=OFF

From 2953efa5fadb9e92de2278a63adda7e7b139236b 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: Sat, 27 Mar 2021 11:17:35 +0700
Subject: [PATCH 31/62] artyfx: remove -O1 -g

---
 srcpkgs/artyfx/patches/fix-avtk-cmake-sse.patch | 4 ++--
 srcpkgs/artyfx/patches/respect-our-cflags.patch | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/artyfx/patches/fix-avtk-cmake-sse.patch b/srcpkgs/artyfx/patches/fix-avtk-cmake-sse.patch
index 1a832155a566..47ef4dd9b84e 100644
--- a/srcpkgs/artyfx/patches/fix-avtk-cmake-sse.patch
+++ b/srcpkgs/artyfx/patches/fix-avtk-cmake-sse.patch
@@ -6,8 +6,8 @@
  
 -SET(CMAKE_C_FLAGS   "-fPIC -msse -msse2 -mfpmath=sse -g") # -fsanitize=address
 -SET(CMAKE_CXX_FLAGS "-fPIC -msse -msse2 -mfpmath=sse -g") # -fsanitize=address
-+SET(CMAKE_C_FLAGS   "${CMAKE_C_FLAGS} -fPIC -g") # -fsanitize=address
-+SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -g") # -fsanitize=address
++SET(CMAKE_C_FLAGS   "${CMAKE_C_FLAGS} -fPIC") # -fsanitize=address
++SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") # -fsanitize=address
 +
 +IF(BUILD_SSE)
 +	SET(CMAKE_C_FLAGS   "${CMAKE_C_FLAGS} -msse -msse2 -mfpmath=sse")
diff --git a/srcpkgs/artyfx/patches/respect-our-cflags.patch b/srcpkgs/artyfx/patches/respect-our-cflags.patch
index ee9155c7729e..7a32fd9df73b 100644
--- a/srcpkgs/artyfx/patches/respect-our-cflags.patch
+++ b/srcpkgs/artyfx/patches/respect-our-cflags.patch
@@ -10,8 +10,8 @@ Index: CMakeLists.txt
 -SET(CMAKE_C_FLAGS "-g -Wall -O1 -Wno-unused-variable")
 -SET(CMAKE_CXX_FLAGS "-g -Wall -O1 -Wno-unused-variable -ftree-vectorize")
 +SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fPIC -shared -L./src/avtk -Wl,--no-undefined")
-+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -Wall -O1 -Wno-unused-variable")
-+SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -Wall -O1 -Wno-unused-variable -ftree-vectorize")
++SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall  -Wno-unused-variable")
++SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall  -Wno-unused-variable -ftree-vectorize")
  
  
  # DSP sources

From 54ef15e5ad46cc417be3da8b496a2d25bfa55674 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: Sat, 27 Mar 2021 11:27:28 +0700
Subject: [PATCH 32/62] coin3: build with CMAKE_BUILD_TYPE=None

---
 srcpkgs/coin3/template | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/coin3/template b/srcpkgs/coin3/template
index d5483ee048c3..8f7218c2e8c3 100644
--- a/srcpkgs/coin3/template
+++ b/srcpkgs/coin3/template
@@ -5,7 +5,7 @@ revision=1
 wrksrc="coin-Coin-${version}"
 build_style=cmake
 configure_args="-DCMAKE_INSTALL_INCLUDEDIR=/usr/include/Coin3
- -DCMAKE_BUILD_TYPE=Release -DCOIN_BUILD_TESTS=OFF -DCOIN_BUILD_DOCUMENTATION=ON"
+ -DCOIN_BUILD_TESTS=OFF -DCOIN_BUILD_DOCUMENTATION=ON"
 hostmakedepends="doxygen graphviz"
 makedepends="boost-devel glu-devel"
 short_desc="High-level 3D graphics toolkit"
@@ -15,6 +15,9 @@ homepage="https://coin3d.github.io/"
 distfiles="https://github.com/coin3d/coin/archive/Coin-${version}.tar.gz"
 checksum=b00d2a8e9d962397cf9bf0d9baa81bcecfbd16eef675a98c792f5cf49eb6e805
 
+CFLAGS=-DNDEBUG
+CXXFLAGS=-DNDEBUG
+
 if [ "$CROSS_BUILD" ]; then
 	# bypass runtime test (quote hashing is fine with gcc 9.3)
 	configure_args+=" -DHAVE_HASH_QUOTING_EXITCODE=0"

From 0a360e5313e1b554fe0d1bc69aec7fa5f8f19e82 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: Sat, 27 Mar 2021 11:46:46 +0700
Subject: [PATCH 33/62] conky: don't overwrite CMAKE_BUILD_TYPE

---
 srcpkgs/conky/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/conky/template b/srcpkgs/conky/template
index 8b95a628edfb..f05c7d4a1bf2 100644
--- a/srcpkgs/conky/template
+++ b/srcpkgs/conky/template
@@ -5,7 +5,7 @@ version=1.12.1
 revision=1
 build_style=cmake
 conf_files="/etc/conky/conky.conf /etc/conky/conky_no_x11.conf"
-configure_args="-DCMAKE_BUILD_TYPE=Release -DMAINTAINER_MODE=ON -DRELEASE=ON
+configure_args="-DMAINTAINER_MODE=ON -DRELEASE=ON
  -DDOC_PATH=share/doc/${pkgname} -DBUILD_X11=ON -DBUILD_CURL=ON -DBUILD_XDBE=ON
  -DBUILD_RSS=ON -DBUILD_WEATHER_METAR=ON -DBUILD_IMLIB2=ON -DBUILD_WLAN=ON
  -DBUILD_LUA_CAIRO=ON -DBUILD_LUA_IMLIB2=ON -DBUILD_LUA_RSVG=ON

From 75aa1643ec700309fff57295c1b5d181a9691fbf 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: Sat, 27 Mar 2021 11:46:46 +0700
Subject: [PATCH 34/62] conky-cli: don't overwrite CMAKE_BUILD_TYPE

---
 srcpkgs/conky-cli/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/conky-cli/template b/srcpkgs/conky-cli/template
index b61bdcca0504..7d512b65ab3e 100644
--- a/srcpkgs/conky-cli/template
+++ b/srcpkgs/conky-cli/template
@@ -6,7 +6,7 @@ revision=1
 wrksrc="${pkgname/-cli/}-${version}"
 build_style=cmake
 conf_files="/etc/conky/conky.conf /etc/conky/conky_no_x11.conf"
-configure_args="-DCMAKE_BUILD_TYPE=Release -DMAINTAINER_MODE=ON -DRELEASE=ON
+configure_args="-DMAINTAINER_MODE=ON -DRELEASE=ON
  -DDOC_PATH=share/doc/${pkgname} -DBUILD_X11=OFF -DBUILD_CURL=ON -DBUILD_XDBE=OFF
  -DBUILD_RSS=ON -DBUILD_WEATHER_METAR=OFF -DBUILD_IMLIB2=OFF -DBUILD_WLAN=ON
  -DBUILD_DOCS=ON"

From b3306426e0c162a7cda21d6ec57ac1ad1223f56d 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: Sat, 27 Mar 2021 11:48:25 +0700
Subject: [PATCH 35/62] crossguid: don't overwrite -O2

---
 srcpkgs/crossguid/fix-cflags.patch | 12 ++++++++++++
 1 file changed, 12 insertions(+)
 create mode 100644 srcpkgs/crossguid/fix-cflags.patch

diff --git a/srcpkgs/crossguid/fix-cflags.patch b/srcpkgs/crossguid/fix-cflags.patch
new file mode 100644
index 000000000000..983360a07ccf
--- /dev/null
+++ b/srcpkgs/crossguid/fix-cflags.patch
@@ -0,0 +1,12 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -2,7 +2,6 @@ cmake_minimum_required(VERSION 3.5.1)
+ project(CrossGuid)
+ 
+ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake")
+-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3")
+ 
+ option(XG_TESTS "Build test runner" ON)
+ 

From d6e15b805548feae74b2f8b03f850f377513cddc 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: Sat, 27 Mar 2021 12:19:04 +0700
Subject: [PATCH 36/62] rapidjson: define -DNDEBUG

---
 srcpkgs/rapidjson/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/rapidjson/template b/srcpkgs/rapidjson/template
index 8597f8fb2706..99d92702cc9d 100644
--- a/srcpkgs/rapidjson/template
+++ b/srcpkgs/rapidjson/template
@@ -11,7 +11,7 @@ distfiles="https://github.com/miloyip/${pkgname}/archive/v${version}.tar.gz"
 checksum=bf7ced29704a1e696fbccf2a2b4ea068e7774fa37f6d7dd4039d0787f8bed98e
 
 # class-memaccess is required by https://github.com/Tencent/rapidjson/issues/1700
-CXXFLAGS="-Wno-type-limits -Wno-error=class-memaccess"
+CXXFLAGS="-Wno-type-limits -Wno-error=class-memaccess -DNDEBUG"
 
 post_patch() {
 	# Remove bin/jsonchecker, which is the JSON licensed files

From 75538f2d541d4e4669304a75b2d548b06725d665 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: Sat, 27 Mar 2021 12:18:36 +0700
Subject: [PATCH 37/62] cura-engine: ignore -O3

---
 srcpkgs/cura-engine/patches/fix-cflags.patch | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 srcpkgs/cura-engine/patches/fix-cflags.patch

diff --git a/srcpkgs/cura-engine/patches/fix-cflags.patch b/srcpkgs/cura-engine/patches/fix-cflags.patch
new file mode 100644
index 000000000000..e48a665523b8
--- /dev/null
+++ b/srcpkgs/cura-engine/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -42,7 +42,7 @@ endif()
+ if(CMAKE_BUILD_TYPE_UPPER MATCHES "DEBUG")
+     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_DEBUG_INIT}")
+ else()
+-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELEASE_INIT}")
++    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DNDEBUG")
+ endif()
+ 
+ set(CMAKE_CXX_STANDARD 11)

From 0afccc09d42ba2d2e4697a3d5eca11b9437ee34f 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: Sat, 27 Mar 2021 12:22:29 +0700
Subject: [PATCH 38/62] dislocker: remove -O1

---
 srcpkgs/dislocker/patches/fix-cflags.patch | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 srcpkgs/dislocker/patches/fix-cflags.patch

diff --git a/srcpkgs/dislocker/patches/fix-cflags.patch b/srcpkgs/dislocker/patches/fix-cflags.patch
new file mode 100644
index 000000000000..1229efeeaf0c
--- /dev/null
+++ b/srcpkgs/dislocker/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: src/CMakeLists.txt
+===================================================================
+--- src/CMakeLists.txt.orig
++++ src/CMakeLists.txt
+@@ -71,7 +71,7 @@ if(NOT DEFINED WARN_FLAGS)
+ 	set (WARN_FLAGS "-Wall -Wextra" CACHE STRING "" FORCE)
+ endif()
+ if(NOT DEFINED HARDEN_FLAGS)
+-	set (HARDEN_FLAGS "-fstack-protector -fstrict-aliasing -D_FORTIFY_SOURCE=2 -O1" CACHE STRING "" FORCE)
++	set (HARDEN_FLAGS "-fstack-protector -fstrict-aliasing" CACHE STRING "" FORCE)
+ endif()
+ 
+ set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")

From 3f008be63f28d88939de78b96ef1e5928254ba2d 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: Sat, 27 Mar 2021 12:29:31 +0700
Subject: [PATCH 39/62] freeorion: remove -O3

---
 srcpkgs/freeorion/patches/fix-cflags.patch | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
 create mode 100644 srcpkgs/freeorion/patches/fix-cflags.patch

diff --git a/srcpkgs/freeorion/patches/fix-cflags.patch b/srcpkgs/freeorion/patches/fix-cflags.patch
new file mode 100644
index 000000000000..c66d54599556
--- /dev/null
+++ b/srcpkgs/freeorion/patches/fix-cflags.patch
@@ -0,0 +1,18 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -432,13 +432,6 @@ if(MSVC)
+     )
+ endif()
+ 
+-target_compile_options(freeorionparseobj
+-    PRIVATE
+-        $<$<CXX_COMPILER_ID:Clang>:-ftemplate-depth=512>
+-        $<$<CXX_COMPILER_ID:AppleClang>:-ftemplate-depth=512>
+-        $<$<AND:$<NOT:$<BOOL:${BUILD_TESTING}>>,$<CXX_COMPILER_ID:GNU>>:-O3>
+-)
+-
+ target_compile_definitions(freeorionparseobj
+     PUBLIC
+         -DBOOST_ALL_DYN_LINK

From ce76fb0882ae229481bc8440d125f5eebf6da9f9 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: Fri, 26 Mar 2021 09:01:12 +0700
Subject: [PATCH 40/62] cglm: fix build flags

---
 srcpkgs/cglm/patches/fix-cflags.patch | 13 +++++++++++++
 srcpkgs/cglm/template                 |  1 +
 2 files changed, 14 insertions(+)
 create mode 100644 srcpkgs/cglm/patches/fix-cflags.patch

diff --git a/srcpkgs/cglm/patches/fix-cflags.patch b/srcpkgs/cglm/patches/fix-cflags.patch
new file mode 100644
index 000000000000..c74de6ea62d7
--- /dev/null
+++ b/srcpkgs/cglm/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: cglm-0.7.6/CMakeLists.txt
+===================================================================
+--- cglm-0.7.6.orig/CMakeLists.txt
++++ cglm-0.7.6/CMakeLists.txt
+@@ -25,7 +25,7 @@ if(MSVC)
+ 	add_definitions(-DNDEBUG -D_WINDOWS -D_USRDLL -DCGLM_EXPORTS -DCGLM_DLL)
+ 	add_compile_options(/W3 /Ox /Gy /Oi /TC)
+ else()
+-  add_compile_options(-Wall -Werror -O3)
++  add_compile_options(-Wall)
+ endif()
+ 
+ if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
diff --git a/srcpkgs/cglm/template b/srcpkgs/cglm/template
index f00a093edab9..311b4c79a7d3 100644
--- a/srcpkgs/cglm/template
+++ b/srcpkgs/cglm/template
@@ -9,6 +9,7 @@ license="MIT"
 homepage="https://github.com/recp/cglm"
 distfiles="https://github.com/recp/cglm/archive/v${version}.tar.gz"
 checksum=29ff8af4edc03697e36d3e6f99a80b884a80ee09d46055ce45765e5d6b2456d9
+patch_args=-Np1
 
 post_install() {
 	vlicense LICENSE

From f33b9b6e9fb6488a49e2b01e1e6f7b0a52b5c843 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: Sat, 27 Mar 2021 12:36:19 +0700
Subject: [PATCH 41/62] glyr: don't force Release build

---
 srcpkgs/glyr/patches/fix-cflags.patch | 12 ++++++++++++
 1 file changed, 12 insertions(+)
 create mode 100644 srcpkgs/glyr/patches/fix-cflags.patch

diff --git a/srcpkgs/glyr/patches/fix-cflags.patch b/srcpkgs/glyr/patches/fix-cflags.patch
new file mode 100644
index 000000000000..498ffe09a38f
--- /dev/null
+++ b/srcpkgs/glyr/patches/fix-cflags.patch
@@ -0,0 +1,12 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -60,7 +60,6 @@ exec_program(
+ IF(CMAKE_BUILD_TYPE STREQUAL "debug")
+     SET(GLYR_DEBUG TRUE)
+ ELSE()
+-    SET(CMAKE_BUILD_TYPE "release")
+     SET(GLYR_DEBUG FALSE)
+ ENDIF()
+ MESSAGE("-- Building Target: ${CMAKE_BUILD_TYPE}")

From 4e65b9eb39a8ceaa4cd55c7356098a8d2d17e1f5 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: Sat, 27 Mar 2021 12:41:50 +0700
Subject: [PATCH 42/62] hugin: remove -O3

---
 srcpkgs/hugin/patches/fix-cflags.patch | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
 create mode 100644 srcpkgs/hugin/patches/fix-cflags.patch

diff --git a/srcpkgs/hugin/patches/fix-cflags.patch b/srcpkgs/hugin/patches/fix-cflags.patch
new file mode 100644
index 000000000000..02fa56bef0e1
--- /dev/null
+++ b/srcpkgs/hugin/patches/fix-cflags.patch
@@ -0,0 +1,15 @@
+Index: src/celeste/CMakeLists.txt
+===================================================================
+--- src/celeste/CMakeLists.txt.orig
++++ src/celeste/CMakeLists.txt
+@@ -16,10 +16,6 @@
+ #    You should have received a copy of the GNU General Public License
+ #    along with Hugin  If not, see <http://www.gnu.org/licenses/>.
+  
+-IF(NOT WIN32)
+-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3")
+-ENDIF(NOT WIN32)
+-
+ # a list of all files belonging to celeste library
+ 
+ SET(CELESTE_SRC

From dbebdfb098cde201711b1bac36273c563a5cb64f 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: Sat, 27 Mar 2021 13:05:27 +0700
Subject: [PATCH 43/62] ledger: don't overwrite CMAKE_BUILD_TYPE

---
 srcpkgs/ledger/patches/fix-cflags.patch | 12 ++++++++++++
 1 file changed, 12 insertions(+)
 create mode 100644 srcpkgs/ledger/patches/fix-cflags.patch

diff --git a/srcpkgs/ledger/patches/fix-cflags.patch b/srcpkgs/ledger/patches/fix-cflags.patch
new file mode 100644
index 000000000000..179ab79cd148
--- /dev/null
+++ b/srcpkgs/ledger/patches/fix-cflags.patch
@@ -0,0 +1,12 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -41,7 +41,6 @@ if (BUILD_DEBUG)
+   set(CMAKE_BUILD_TYPE Debug)
+   set(DEBUG_MODE 1)
+ else()
+-  set(CMAKE_BUILD_TYPE Release)
+   set(DEBUG_MODE 0)
+ endif()
+ 

From 095bfd20a17ce9de70d256ba7476668a2568e6f2 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: Sat, 27 Mar 2021 13:18:24 +0700
Subject: [PATCH 44/62] libmygpo-qt: remove -ggdb3

---
 srcpkgs/libmygpo-qt/patches/fix-cflags.patch | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 srcpkgs/libmygpo-qt/patches/fix-cflags.patch

diff --git a/srcpkgs/libmygpo-qt/patches/fix-cflags.patch b/srcpkgs/libmygpo-qt/patches/fix-cflags.patch
new file mode 100644
index 000000000000..9940b6fc4323
--- /dev/null
+++ b/srcpkgs/libmygpo-qt/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -69,7 +69,7 @@ if (CMAKE_COMPILER_IS_GNUCXX)
+        -Wwrite-strings -Wpacked -Wformat-security -Wmissing-format-attribute
+        -Wold-style-cast -Woverloaded-virtual -Wnon-virtual-dtor  -Wall -Wextra
+        -Wformat=2 -Wundef -Wstack-protector -Wmissing-include-dirs
+-       -Winit-self -Wunsafe-loop-optimizations  -ggdb3 -fno-inline -DQT_STRICT_ITERATORS )
++       -Winit-self -Wunsafe-loop-optimizations  -fno-inline -DQT_STRICT_ITERATORS )
+     if ( NOT WIN32 )
+         add_definitions( -fvisibility=hidden )
+     endif()

From cb3c0c1607b1437db309226ac1ef2e6453528ea3 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: Sat, 27 Mar 2021 13:48:38 +0700
Subject: [PATCH 45/62] libogre: don't build vendored libraries

---
 srcpkgs/libogre/template | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/libogre/template b/srcpkgs/libogre/template
index 784e3a648bac..df60f7b4f542 100644
--- a/srcpkgs/libogre/template
+++ b/srcpkgs/libogre/template
@@ -1,25 +1,22 @@
-# Template file for 'ogre'
+# Template file for 'libogre'
 pkgname=libogre
 version=1.12.9
 revision=1
+wrksrc=ogre-$version
 build_style=cmake
-configure_args="-DCMAKE_INSTALL_PREFIX=/usr \
-	-DOGRE_INSTALL_SAMPLES=TRUE \
-	-DOGRE_INSTALL_DOCS=TRUE \
-	-DOGRE_INSTALL_SAMPLES_SOURCE=TRUE \
-	-DCMAKE_BUILD_TYPE=Release"
+configure_args="-DOGRE_INSTALL_SAMPLES=TRUE -DOGRE_INSTALL_DOCS=TRUE
+ -DOGRE_INSTALL_SAMPLES_SOURCE=TRUE -DOGRE_BUILD_DEPENDENCIES=FALSE"
+make_build_target="all OgreDoc"
 hostmakedepends="pkg-config graphviz doxygen dejavu-fonts-ttf"
 makedepends="boost-devel freetype-devel libXaw-devel libXrandr-devel
  MesaLib-devel zziplib-devel libcppunit-devel glu-devel libatomic-devel
  freeimage-devel pugixml-devel python3-devel"
 short_desc="Scene-oriented, flexible 3D engine"
 maintainer="Enno Boland <gottox@voidlinux.org>"
-homepage="http://www.ogre3d.org"
 license="MIT"
+homepage="http://www.ogre3d.org"
 distfiles="https://github.com/OGRECave/ogre/archive/v$version.tar.gz"
 checksum=028e7d0bbfce8fd254e1102666b07b7cbb9379321e88885d82feee5e061342aa
-make_build_target="all OgreDoc"
-wrksrc=ogre-$version
 
 pre_configure() {
 	if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then

From d6afa0c0ac5f47ab381e1049b4e5c3383d9256b0 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: Sat, 27 Mar 2021 13:52:50 +0700
Subject: [PATCH 46/62] libopenglrecorder: remove -O3

---
 srcpkgs/libopenglrecorder/patches/fix-cflags.patch | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 srcpkgs/libopenglrecorder/patches/fix-cflags.patch

diff --git a/srcpkgs/libopenglrecorder/patches/fix-cflags.patch b/srcpkgs/libopenglrecorder/patches/fix-cflags.patch
new file mode 100644
index 000000000000..7c48a0d2d822
--- /dev/null
+++ b/srcpkgs/libopenglrecorder/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -21,7 +21,7 @@ if (UNIX OR MINGW)
+     if (CMAKE_BUILD_TYPE MATCHES Debug)
+         add_definitions(-std=gnu++0x -O0)
+     else()
+-        add_definitions(-std=gnu++0x -O3)
++        add_definitions(-std=gnu++0x)
+     endif()
+ endif()
+ 

From 5670e7d4ac2a32d36ca66a70ca3b634817ac4051 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: Sat, 27 Mar 2021 13:55:41 +0700
Subject: [PATCH 47/62] libvidstab: remove -O3

---
 srcpkgs/libvidstab/patches/fix-cflags.patch | 39 +++++++++++++++++++++
 1 file changed, 39 insertions(+)
 create mode 100644 srcpkgs/libvidstab/patches/fix-cflags.patch

diff --git a/srcpkgs/libvidstab/patches/fix-cflags.patch b/srcpkgs/libvidstab/patches/fix-cflags.patch
new file mode 100644
index 000000000000..51c357efb101
--- /dev/null
+++ b/srcpkgs/libvidstab/patches/fix-cflags.patch
@@ -0,0 +1,39 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -25,7 +25,7 @@ else()
+     set(LIBSUFFIX "")
+ endif()
+ 
+-add_definitions( -Wall -O3 -g -Wno-pointer-sign -fPIC -std=gnu99)
++add_definitions( -Wall -Wno-pointer-sign -fPIC -std=gnu99)
+ # add_definitions(  -Wall -O0 -g -Wno-pointer-sign )
+ 
+ ### ORC is not used in any active code at the moment  ###
+Index: tests/CMakeLists.txt
+===================================================================
+--- tests/CMakeLists.txt.orig
++++ tests/CMakeLists.txt
+@@ -11,7 +11,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PAT
+ option(USE_OMP "use parallelization use OMP" ON)
+ 
+ #add_definitions( -Wall -O3 -Wno-pointer-sign -DTESTING  -std=gnu99)
+-add_definitions(  -Wall -O0 -g -Wno-pointer-sign -DTESTING -std=gnu99)
++add_definitions(  -Wall -Wno-pointer-sign -DTESTING -std=gnu99)
+ find_package(Orc)
+ if(ORC_FOUND)
+ add_definitions( -DUSE_ORC ${ORC_DEFINITIONS})
+Index: transcode/CMakeLists.txt
+===================================================================
+--- transcode/CMakeLists.txt.orig
++++ transcode/CMakeLists.txt
+@@ -9,7 +9,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PAT
+ set(TRANSCODE_ROOT ../../transcode)
+ 
+ 
+-add_definitions( -Wall -O3 -Wno-pointer-sign -DTRANSCODE -std=gnu99)
++add_definitions( -Wall -Wno-pointer-sign -DTRANSCODE -std=gnu99)
+ #add_definitions(  -Wall -O0 -g -Wno-pointer-sign )
+ # I tried it with 0.4.14
+ #  0.4.10 did not work (not all opcode implemented)

From 955e7962f814a7193e669cae0e15fa4d26b84296 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: Sat, 27 Mar 2021 14:18:34 +0700
Subject: [PATCH 48/62] openlierox: don't overwrote CMAKE_BUILD_TYPE

---
 srcpkgs/openlierox/patches/fix-cflags.patch | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
 create mode 100644 srcpkgs/openlierox/patches/fix-cflags.patch

diff --git a/srcpkgs/openlierox/patches/fix-cflags.patch b/srcpkgs/openlierox/patches/fix-cflags.patch
new file mode 100644
index 000000000000..4fe6652fd0a2
--- /dev/null
+++ b/srcpkgs/openlierox/patches/fix-cflags.patch
@@ -0,0 +1,17 @@
+Index: CMakeOlxCommon.cmake
+===================================================================
+--- CMakeOlxCommon.cmake.orig
++++ CMakeOlxCommon.cmake
+@@ -36,12 +36,6 @@ OPTION(BREAKPAD "Google Breakpad support
+ OPTION(DISABLE_JOYSTICK "Disable joystick support" No)
+ OPTION(MINGW_CROSS_COMPILE "Cross-compile Windows .EXE using i686-w64-mingw32-gcc compiler" No)
+ 
+-IF (DEBUG)
+-	SET(CMAKE_BUILD_TYPE Debug)
+-ELSE (DEBUG)
+-	SET(CMAKE_BUILD_TYPE Release)
+-ENDIF (DEBUG)
+-
+ IF (DEDICATED_ONLY)
+ 	SET(X11 No)
+ 	SET(WITH_G15 No)

From fd07e3e0c315b637801b452589c0ab54a92ff8bc 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: Sat, 27 Mar 2021 14:25:12 +0700
Subject: [PATCH 49/62] opensonic: don't overwrite CMAKE_BUILD_TYPE

---
 srcpkgs/opensonic/patches/fix-cflags.patch | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
 create mode 100644 srcpkgs/opensonic/patches/fix-cflags.patch

diff --git a/srcpkgs/opensonic/patches/fix-cflags.patch b/srcpkgs/opensonic/patches/fix-cflags.patch
new file mode 100644
index 000000000000..10d2c7c80e64
--- /dev/null
+++ b/srcpkgs/opensonic/patches/fix-cflags.patch
@@ -0,0 +1,17 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -25,12 +25,10 @@ SET(GAME_NAME "Open Sonic")
+ SET(GAME_VERSION "0.1.4")
+ SET(RTFM "Please read the user manual (readme.html) to get help.")
+ SET(ALLEGRO_RECOMMENDED_VERSION "4.4.1")
+-SET(CMAKE_BUILD_TYPE Release)
+ MESSAGE("${GAME_NAME} version ${GAME_VERSION}")
+ 
+ # configuring...
+ SET(DEFS "")
+-SET(CFLAGS_EXTRA "-g")
+ SET(CFLAGS "${CFLAGS} ${CMAKE_C_FLAGS}")
+ MESSAGE("Using CFLAGS='${CFLAGS}'")
+ 

From 334a12e2511308683a5eb1b1b270ee8e11e82343 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: Sat, 27 Mar 2021 15:17:28 +0700
Subject: [PATCH 50/62] rocksdb: don't overwrite CMAKE_BUILD_TYPE

---
 srcpkgs/rocksdb/template | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/rocksdb/template b/srcpkgs/rocksdb/template
index e39329e5d6a6..2ae7db40ab91 100644
--- a/srcpkgs/rocksdb/template
+++ b/srcpkgs/rocksdb/template
@@ -3,15 +3,16 @@ pkgname=rocksdb
 version=5.18.3
 revision=2
 build_style=cmake
-configure_args="-DCMAKE_BUILD_TYPE=Release -DPORTABLE=1 -DWITH_TESTS=0
- -DUSE_RTTI=0 -DWITH_LZ4=1"
+configure_args="-DPORTABLE=1 -DWITH_TESTS=0 -DUSE_RTTI=0 -DWITH_LZ4=1"
 makedepends="liblz4-devel"
 short_desc="RocksDB is a embeddable, persistent key-value store for fast storage"
 maintainer="magenbluten <mb0@codemonkey.cc>"
-license="GPL-2.0-or-later, Apache-2.0"
+license="GPL-2.0-or-later, Apache-2.0, BSD-3-Clause"
 homepage="https://github.com/facebook/rocksdb"
 distfiles="${homepage}/archive/v${version}.tar.gz"
 checksum=7fb6738263d3f2b360d7468cf2ebe333f3109f3ba1ff80115abd145d75287254
+CFLAGS=-DNDEBUG
+CXXFLAGS=-DNDEBUG
 
 if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
 	makedepends+=" libatomic-devel"

From 9b8d23021b078ad24ccb3bf1ce316751589bf165 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: Sat, 27 Mar 2021 15:40:26 +0700
Subject: [PATCH 51/62] seexpr-krita: don't overwrite CMAKE_BUILD_TYPE

---
 .../patches/cmake-build-type-none.patch       | 32 +++++++++++++++++++
 1 file changed, 32 insertions(+)
 create mode 100644 srcpkgs/seexpr-krita/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/seexpr-krita/patches/cmake-build-type-none.patch b/srcpkgs/seexpr-krita/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..94bb1f37db75
--- /dev/null
+++ b/srcpkgs/seexpr-krita/patches/cmake-build-type-none.patch
@@ -0,0 +1,32 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -42,14 +42,6 @@ endif()
+ 
+ ## Choose build options
+ # Disney specific method of choosing variant
+-if (${FLAVOR} STREQUAL "optimize")
+-    set(CMAKE_BUILD_TYPE "Release" CACHE STRING "type of build" FORCE)
+-endif()
+-
+-if (${FLAVOR} STREQUAL "debug")
+-    set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "type of build" FORCE)
+-endif()
+-
+ if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
+     execute_process(
+         COMMAND sh -c "echo `uname -s`-`uname -r | cut -d- -f1`-`uname -m`"
+@@ -212,12 +204,6 @@ else()
+ endif()
+ 
+ # Set to release if nothing else defined
+-if (NOT CMAKE_BUILD_TYPE)
+-  set(CMAKE_BUILD_TYPE "Release" CACHE STRING
+-      "Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel."
+-      FORCE)
+-endif()
+-
+ if (ENABLE_QT5)
+     find_package(Qt5 5.9.0 COMPONENTS Core Gui Widgets REQUIRED)
+     set_package_properties(Qt5 PROPERTIES

From 7826966d94e92d0e941d9c241ed9242cbf33b8d2 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: Sat, 27 Mar 2021 15:50:53 +0700
Subject: [PATCH 52/62] speed-dreams: hardening

---
 srcpkgs/speed-dreams/template | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/speed-dreams/template b/srcpkgs/speed-dreams/template
index 722f0c5ed87a..df7164f9c808 100644
--- a/srcpkgs/speed-dreams/template
+++ b/srcpkgs/speed-dreams/template
@@ -1,13 +1,13 @@
 # Template file for 'speed-dreams'
 pkgname=speed-dreams
 version=2.2.2
-revision=2
+revision=3
 archs="i686* x86_64* ppc64le*"
 _rev=r6553
 create_wrksrc=yes
 build_style=cmake
-configure_args="-DSD_BINDIR=/usr/bin -DSD_DATADIR=/usr/share/speed-dreams-2 -DSD_LIBDIR=/usr/lib/speed-dreams-2
- -DOPTION_OFFICIAL_ONLY=ON -DCMAKE_CXX_FLAGS=-fpermissive -DCMAKE_C_FLAGS=-fpermissive"
+configure_args="-DSD_BINDIR=/usr/bin -DSD_DATADIR=/usr/share/speed-dreams-2
+ -DSD_LIBDIR=/usr/lib/speed-dreams-2 -DOPTION_OFFICIAL_ONLY=ON"
 hostmakedepends="pkg-config"
 makedepends="freealut-devel libenet-devel libfreeglut-devel libjpeg-turbo-devel
  libpng-devel libvorbis-devel libXrandr-devel osg-devel plib-devel SDL2-devel
@@ -26,6 +26,8 @@ checksum="32aa55c17f8dafc1c54fb0d0b7b993d2688d431899cfc5db9eeece148c6887d0
  0b7b417d007ab3b7f0f4dcfdc868aafee1722150b81af519e1cd4c082b408183"
 nocross=yes
 replaces="speed-dreams-data>=0"
+CFLAGS=-fpermissive
+CXXFLAGS=-fpermissive
 
 if [ "$XBPS_TARGET_LIBC" = musl ]; then
 	broken="Segmentation fault"

From 3fb8dc95ecb5e766af63f624739f2ab2cab5b97a 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: Sat, 27 Mar 2021 19:04:09 +0700
Subject: [PATCH 53/62] traverso: hardening

---
 .../patches/cmake-build-type-none.patch       | 28 +++++++++++++++++++
 srcpkgs/traverso/template                     |  2 +-
 2 files changed, 29 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/traverso/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/traverso/patches/cmake-build-type-none.patch b/srcpkgs/traverso/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..75b3fd941eb8
--- /dev/null
+++ b/srcpkgs/traverso/patches/cmake-build-type-none.patch
@@ -0,0 +1,28 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -65,13 +65,7 @@ SET(TRAVERSO_DEFINES -DSTATIC_BUILD)
+ 
+ #BUILD SETUP
+ #None, Debug, Release, .. or custom ones
+-IF(WANT_DEBUG)
+-  SET(CMAKE_BUILD_TYPE DEBUG)
+-  SET(WANT_TRAVERSO_DEBUG ON)
+-ELSE(WANT_DEBUG)
+-  SET(CMAKE_BUILD_TYPE RELEASE)
+-  LIST(APPEND TRAVERSO_DEFINES -DQT_NO_DEBUG)
+-ENDIF(WANT_DEBUG)
++LIST(APPEND TRAVERSO_DEFINES -DQT_NO_DEBUG)
+ 
+ 
+ IF(WANT_TRAVERSO_DEBUG)
+@@ -326,7 +320,7 @@ ${Qt5Xml_INCLUDE_DIRS}
+ ${Qt5Xml_INCLUDES}
+ )
+ 
+-set(CMAKE_CXX_FLAGS "-fPIC")
++set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
+ 
+ #Set up libraries to link with all found packages
+ LINK_LIBRARIES (
diff --git a/srcpkgs/traverso/template b/srcpkgs/traverso/template
index 105924d4f0c6..4b93460f63d7 100644
--- a/srcpkgs/traverso/template
+++ b/srcpkgs/traverso/template
@@ -1,7 +1,7 @@
 # Template file for 'traverso'
 pkgname=traverso
 version=0.49.6
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DWANT_MP3_ENCODE=ON -DDETECT_HOST_CPU_FEATURES=OFF"
 hostmakedepends="pkg-config qt5-qmake qt5-host-tools"

From b20f79273a69b6524400aab88f686cbecf2011cc 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: Sat, 27 Mar 2021 19:08:11 +0700
Subject: [PATCH 54/62] xstarter: hardening

---
 .../patches/cmake-build-type-none.patch       | 22 +++++++++++++++++++
 srcpkgs/xstarter/template                     |  2 +-
 2 files changed, 23 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/xstarter/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/xstarter/patches/cmake-build-type-none.patch b/srcpkgs/xstarter/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..4f793e4c473c
--- /dev/null
+++ b/srcpkgs/xstarter/patches/cmake-build-type-none.patch
@@ -0,0 +1,22 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -5,16 +5,8 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
+ 
+ project(xstarter)
+ 
+-if(NOT CMAKE_BUILD_TYPE)
+-  set(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build (Debug or Release)" FORCE)
+-endif()
+-
+ set(PROJECT_VERSION "0.8.0")
+-if (CMAKE_BUILD_TYPE STREQUAL Debug)
+-  set(CMAKE_C_FLAGS "-g -Wall -pedantic")
+-else()
+-  set(CMAKE_C_FLAGS "-Wall -pedantic -O3")
+-endif()
++set(CMAKE_C_FLAGS "-Wall -pedantic ${CMAKE_C_FLAGS}")
+ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/bin")
+ 
+ set (CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
diff --git a/srcpkgs/xstarter/template b/srcpkgs/xstarter/template
index aa9a47e45e5c..4363d36e3c39 100644
--- a/srcpkgs/xstarter/template
+++ b/srcpkgs/xstarter/template
@@ -1,7 +1,7 @@
 # Template file for 'xstarter'
 pkgname=xstarter
 version=0.8.0
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="pkg-config"
 makedepends="glib-devel ncurses-devel"

From e8c8a73e82ad13ce5a25757678daa04a85d6ed36 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: Sat, 27 Mar 2021 19:15:48 +0700
Subject: [PATCH 55/62] yabause-gtk: ignore -O3

---
 srcpkgs/yabause-gtk/patches/fix-cflags.patch | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 srcpkgs/yabause-gtk/patches/fix-cflags.patch

diff --git a/srcpkgs/yabause-gtk/patches/fix-cflags.patch b/srcpkgs/yabause-gtk/patches/fix-cflags.patch
new file mode 100644
index 000000000000..52c1cae61799
--- /dev/null
+++ b/srcpkgs/yabause-gtk/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: src/CMakeLists.txt
+===================================================================
+--- src/CMakeLists.txt.orig
++++ src/CMakeLists.txt
+@@ -659,7 +659,7 @@ else ()
+ 	set(yabause_SOURCES ${yabause_SOURCES} sock-dummy.c thr-dummy.c)
+ endif ()
+ 
+-set(YAB_OPTIMIZATION "-O3" CACHE STRING "Override optimization level")
++set(YAB_OPTIMIZATION "" CACHE STRING "Override optimization level")
+ 
+ if("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "i686")
+ 	set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${YAB_OPTIMIZATION} -march=i686 -msse")

From ef5ad6f23af25c377ad25e455c212011bbeaf67b 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: Sat, 27 Mar 2021 19:26:47 +0700
Subject: [PATCH 56/62] ympd: hardening

---
 srcpkgs/ympd/patches/fix-cflags.patch | 13 +++++++++++++
 srcpkgs/ympd/template                 |  2 +-
 2 files changed, 14 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/ympd/patches/fix-cflags.patch

diff --git a/srcpkgs/ympd/patches/fix-cflags.patch b/srcpkgs/ympd/patches/fix-cflags.patch
new file mode 100644
index 000000000000..4720dd39e748
--- /dev/null
+++ b/srcpkgs/ympd/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -24,7 +24,7 @@ include_directories(${PROJECT_BINARY_DIR
+ 
+ include(CheckCSourceCompiles)
+ 
+-set(CMAKE_C_FLAGS "-std=gnu99 -Wall")
++set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99 -Wall")
+ set(CMAKE_C_FLAGS_DEBUG "-ggdb -pedantic")
+ if(WITH_IPV6)
+     set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS NS_ENABLE_IPV6)
diff --git a/srcpkgs/ympd/template b/srcpkgs/ympd/template
index 14437beb5384..450c079b2ca3 100644
--- a/srcpkgs/ympd/template
+++ b/srcpkgs/ympd/template
@@ -1,7 +1,7 @@
 # Template file for 'ympd'
 pkgname=ympd
 version=1.3.0
-revision=7
+revision=8
 build_style=cmake
 hostmakedepends="perl pkg-config"
 makedepends="libmpdclient-devel openssl-devel"

From e5f42d48adb35336d273686ebc5716edc992c35d 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: Sat, 27 Mar 2021 19:29:31 +0700
Subject: [PATCH 57/62] z80ex: hardening

---
 srcpkgs/z80ex/patches/fix-cflags.patch | 13 +++++++++++++
 srcpkgs/z80ex/template                 |  4 ++--
 2 files changed, 15 insertions(+), 2 deletions(-)
 create mode 100644 srcpkgs/z80ex/patches/fix-cflags.patch

diff --git a/srcpkgs/z80ex/patches/fix-cflags.patch b/srcpkgs/z80ex/patches/fix-cflags.patch
new file mode 100644
index 000000000000..6743da255e5c
--- /dev/null
+++ b/srcpkgs/z80ex/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -11,7 +11,7 @@ option (OPSTEP_FAST_AND_ROUGH "Fast and
+ 
+ #ALL_CFLAGS := -fPIC -fno-common -ansi -pedantic -Wall -pipe -O2 -I. -I./include
+ if (CMAKE_COMPILER_IS_GNUCC)
+-    set (CMAKE_C_FLAGS "-fPIC -fno-common -ansi -pedantic -Wall -pipe -O2")
++    set (CMAKE_C_FLAGS "-fPIC -fno-common -ansi -pedantic -Wall -pipe ${CMAKE_C_FLAGS}")
+ endif ()
+ 
+ include_directories(BEFORE . include)
diff --git a/srcpkgs/z80ex/template b/srcpkgs/z80ex/template
index 00a24a6fb902..5437f53d33d5 100644
--- a/srcpkgs/z80ex/template
+++ b/srcpkgs/z80ex/template
@@ -1,11 +1,11 @@
 # Template file for 'z80ex'
 pkgname=z80ex
 version=1.1.21
-revision=1
+revision=2
 build_style=cmake
 short_desc="ZiLOG Z80 CPU emulation library"
 maintainer="Diogo Leal <diogo@diogoleal.com>"
-license="GPL-2"
+license="GPL-2.0-only"
 homepage="https://sourceforge.net/projects/z80ex/"
 distfiles="${SOURCEFORGE_SITE}/project/z80ex/z80ex/${version}/z80ex-${version}.tar.gz"
 checksum=6f5e521d068a614b41e10180ad4ae45b1bc258ec28c962543feb9078856c2530

From 345ab5f2c294e27770181878b4e06c0ce0d90b6c 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: Sat, 27 Mar 2021 19:17:13 +0700
Subject: [PATCH 58/62] scribus: don't overwrite cmake-build-type

---
 .../patches/cmake-build-type-none.patch       | 33 +++++++++++++++++++
 1 file changed, 33 insertions(+)
 create mode 100644 srcpkgs/scribus/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/scribus/patches/cmake-build-type-none.patch b/srcpkgs/scribus/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..670c83cc48f5
--- /dev/null
+++ b/srcpkgs/scribus/patches/cmake-build-type-none.patch
@@ -0,0 +1,33 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -35,11 +35,6 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON)
+ 
+ 
+ #RPATH setup - more below too
+-if (WANT_NORPATH OR WANT_DISTROBUILD)
+-	set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
+-else()
+-	set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
+-endif()
+ set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
+ set(CMAKE_SKIP_RULE_DEPENDENCY TRUE)
+ set(CMAKE_SKIP_BUILD_RPATH TRUE)
+@@ -309,16 +304,6 @@ include (CMakeLists_Directories.cmake)
+ #Convert our simpler command line option to the CMake style
+ #None, Debug, Release, .. or custom ones
+ # set(WANT_DEBUG ON)
+-if(WANT_DEBUG)
+-	set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Set Debug Build Type" FORCE)
+-endif()
+-if (WANT_RELEASEWITHDEBUG)
+-	set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING "Set Release with Debug Info Build Type" FORCE)
+-endif()
+-if(NOT WANT_DEBUG AND NOT WANT_RELEASEWITHDEBUG)
+-	set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Set Release Build Type" FORCE)
+-endif()
+-
+ 
+ 
+ #Based on our build type, setup our build options

From 67ee2571c5f16bc33d84e899f044ade00c1e1003 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, 28 Mar 2021 10:39:04 +0700
Subject: [PATCH 59/62] yoshimi: cleanup, don't overwrite CMAKE_BUILD_TYPE

---
 srcpkgs/yoshimi/patches/fix-cflags.patch | 12 ++++++++++++
 srcpkgs/yoshimi/template                 | 13 +------------
 2 files changed, 13 insertions(+), 12 deletions(-)
 create mode 100644 srcpkgs/yoshimi/patches/fix-cflags.patch

diff --git a/srcpkgs/yoshimi/patches/fix-cflags.patch b/srcpkgs/yoshimi/patches/fix-cflags.patch
new file mode 100644
index 000000000000..4baeb82ef4e3
--- /dev/null
+++ b/srcpkgs/yoshimi/patches/fix-cflags.patch
@@ -0,0 +1,12 @@
+Index: src/CMakeLists.txt
+===================================================================
+--- src/CMakeLists.txt.orig
++++ src/CMakeLists.txt
+@@ -262,7 +262,6 @@ if (BuildForDebug)
+     set (CMAKE_CXX_FLAGS_DEBUG ${BuildOptionsDebug})
+     message (STATUS "DEBUG Build, flags: ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_DEBUG}")
+ else()
+-    set (CMAKE_BUILD_TYPE "Release")
+     set (CMAKE_CXX_FLAGS_RELEASE ${BuildOptionsRelease})
+     message (STATUS "RELEASE Build, flags: ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELEASE}")
+ endif ()
diff --git a/srcpkgs/yoshimi/template b/srcpkgs/yoshimi/template
index 0096f7f05710..64a6c9ad433f 100644
--- a/srcpkgs/yoshimi/template
+++ b/srcpkgs/yoshimi/template
@@ -4,6 +4,7 @@ version=1.7.4
 revision=2
 build_wrksrc=src
 build_style=cmake
+configure_args="-DCMAKE_INSTALL_DATAROOTDIR=/usr/share"
 hostmakedepends="pkg-config fltk"
 makedepends="boost-devel jack-devel fltk-devel fftw-devel mxml-devel cairo-devel
  lv2 readline-devel ncurses-devel"
@@ -17,15 +18,3 @@ checksum=27a8e33bda72aafae604e14841bed6373fc9e00ff70c98f1e13215d6a8808318
 case "$XBPS_TARGET_MACHINE" in
 	*-musl) makedepends+=" argp-standalone";;
 esac
-
-configure_args="-DCMAKE_INSTALL_DATAROOTDIR=/usr/share"
-
-pre_configure() {
-	sed -i 's|ncurses|ncursesw|g' CMakeLists.txt
-
-	case "$XBPS_TARGET_MACHINE" in
-		i686*) ;;
-		x86_64*) ;;
-		*) sed -i -e "s|-msse -msse2 -mfpmath=sse||g" CMakeLists.txt;;
-	esac
-}

From 9da82ea7ce4c1d2d58fe3c96e75817050ab87ef0 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, 28 Mar 2021 10:49:25 +0700
Subject: [PATCH 60/62] zulucrypt: remove -O3

---
 srcpkgs/zulucrypt/patches/fix-cflags.patch | 26 ++++++++++++++++++++++
 1 file changed, 26 insertions(+)
 create mode 100644 srcpkgs/zulucrypt/patches/fix-cflags.patch

diff --git a/srcpkgs/zulucrypt/patches/fix-cflags.patch b/srcpkgs/zulucrypt/patches/fix-cflags.patch
new file mode 100644
index 000000000000..d77c539c6c13
--- /dev/null
+++ b/srcpkgs/zulucrypt/patches/fix-cflags.patch
@@ -0,0 +1,26 @@
+Index: external_libraries/tcplay/CMakeLists.txt
+===================================================================
+--- external_libraries/tcplay/CMakeLists.txt.orig
++++ external_libraries/tcplay/CMakeLists.txt
+@@ -13,7 +13,7 @@ set (SRCS_LINUX  crypto-gcrypt.c)
+ set (CFLAGS_LINUX  "-D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE")
+ set (CFLAGS_WARN "-w")
+ set (CFLAGS_DEBUG  "-O0 -g3 -DDEBUG")
+-set (CFLAGS_OPT    "-O3")
++set (CFLAGS_OPT    "")
+ set (CFLAGS_VER    "-DMAJ_VER=${VERSION_MAJOR} -DMIN_VER=${VERSION_MINOR}")
+ set (CFLAGS_COMMON "-std=c99 -fPIC  ${CFLAGS_LINUX} ${CFLAGS_WARN} ${CFLAGS_VER}")
+ if ($ENV{DEBUG})
+Index: external_libraries/tcplay/Makefile.classic
+===================================================================
+--- external_libraries/tcplay/Makefile.classic.orig
++++ external_libraries/tcplay/Makefile.classic
+@@ -47,8 +47,6 @@ COMMON_CFLAGS= $(WARNFLAGS) -fPIC $(VER_
+ 
+ ifeq ($(DEBUG), yes)
+   COMMON_CFLAGS+= -O0 -g -DDEBUG
+-else
+-  COMMON_CFLAGS+= -O3
+ endif
+ 
+ ifeq (${SYSTEM}, linux)

From 98c717b415e47018d65599068bdfc0862671d38e 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, 28 Mar 2021 10:43:24 +0700
Subject: [PATCH 61/62] zbackup: don't overwrite CMAKE_BUILD_TYPE

---
 .../patches/cmake-build-type-none.patch       | 26 +++++++++++++++++++
 1 file changed, 26 insertions(+)
 create mode 100644 srcpkgs/zbackup/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/zbackup/patches/cmake-build-type-none.patch b/srcpkgs/zbackup/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..6d6ebc8e124d
--- /dev/null
+++ b/srcpkgs/zbackup/patches/cmake-build-type-none.patch
@@ -0,0 +1,26 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -6,8 +6,6 @@ project( zbackup )
+ 
+ set( CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" )
+ 
+-set( CMAKE_BUILD_TYPE Release )
+-
+ find_package( ZLIB REQUIRED )
+ include_directories( ${ZLIB_INCLUDE_DIRS} )
+ 
+Index: tartool/CMakeLists.txt
+===================================================================
+--- tartool/CMakeLists.txt.orig
++++ tartool/CMakeLists.txt
+@@ -4,8 +4,6 @@
+ cmake_minimum_required( VERSION 2.6.0 )
+ project( tartool )
+ 
+-set( CMAKE_BUILD_TYPE Release )
+-
+ add_executable( tartool tartool.cc ../file.cc ../dir.cc )
+ 
+ install( TARGETS tartool DESTINATION bin )

From 3ee4c2567e71564232d6d2aa334e2f6f5eb82544 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: Sat, 27 Mar 2021 15:19:47 +0700
Subject: [PATCH 62/62] rofs-filtered: hardening

---
 srcpkgs/rofs-filtered/patches/fix-cflags.patch | 13 +++++++++++++
 srcpkgs/rofs-filtered/template                 | 10 +++-------
 2 files changed, 16 insertions(+), 7 deletions(-)
 create mode 100644 srcpkgs/rofs-filtered/patches/fix-cflags.patch

diff --git a/srcpkgs/rofs-filtered/patches/fix-cflags.patch b/srcpkgs/rofs-filtered/patches/fix-cflags.patch
new file mode 100644
index 000000000000..b77600f66784
--- /dev/null
+++ b/srcpkgs/rofs-filtered/patches/fix-cflags.patch
@@ -0,0 +1,13 @@
+Index: CMakeLists.txt
+===================================================================
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -9,7 +9,7 @@ set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PA
+      "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
+ 
+ add_definitions(-D_GNU_SOURCE)
+-set(CMAKE_C_FLAGS "-Wall -std=c99")
++set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC -Wall -std=c99")
+ 
+ # find fuse library
+ find_package (FUSE REQUIRED)
diff --git a/srcpkgs/rofs-filtered/template b/srcpkgs/rofs-filtered/template
index 332cd57a9902..2bb8a2304312 100644
--- a/srcpkgs/rofs-filtered/template
+++ b/srcpkgs/rofs-filtered/template
@@ -1,17 +1,13 @@
 # Template file for 'rofs-filtered'
 pkgname=rofs-filtered
 version=1.7
-revision=1
+revision=2
+wrksrc="${pkgname}-rel-${version}"
 build_style=cmake
 makedepends="fuse-devel"
 short_desc="Filtered read only filesystem for FUSE"
 maintainer="Alexander Gehrke <void@qwertyuiop.de>"
-license="GPL-2"
+license="GPL-2.0-or-later"
 homepage="https://github.com/gburca/rofs-filtered"
 distfiles="https://github.com/gburca/rofs-filtered/archive/rel-${version}.tar.gz"
 checksum=d66066dfd0274a2fb7b71dd929445377dd23100b9fa43e3888dbe3fc7e8228e8
-wrksrc="${pkgname}-rel-${version}"
-
-pre_configure() {
-	sed -i -e 's/CMAKE_C_FLAGS "/CMAKE_C_FLAGS "-fPIC /' ${wrksrc}/CMakeLists.txt
-}

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PR PATCH] [Merged]: build-style/cmake: set CMAKE_BUILD_TYPE to None
  2021-03-14 13:19 [PR PATCH] [WIP] build-style/cmake: set CMAKE_BUILD_TYPE to None sgn
                   ` (31 preceding siblings ...)
  2021-04-03  3:13 ` sgn
@ 2021-04-03  3:13 ` sgn
  32 siblings, 0 replies; 34+ messages in thread
From: sgn @ 2021-04-03  3:13 UTC (permalink / raw)
  To: ml

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

There's a merged pull request on the void-packages repository

build-style/cmake: set CMAKE_BUILD_TYPE to None
https://github.com/void-linux/void-packages/pull/29459

Description:
- I'm going to build all packages with `build_style=cmake` and fix them one by one before merging this in.

[ci skip]

^ permalink raw reply	[flat|nested] 34+ messages in thread

end of thread, other threads:[~2021-04-03  3:13 UTC | newest]

Thread overview: 34+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-14 13:19 [PR PATCH] [WIP] build-style/cmake: set CMAKE_BUILD_TYPE to None sgn
2021-03-15  1:07 ` [PR PATCH] [Updated] " sgn
2021-03-16 23:26 ` sgn
2021-03-17 15:32 ` sgn
2021-03-21  9:45 ` sgn
2021-03-21  9:48 ` sgn
2021-03-21  9:48 ` [PR REVIEW] " sgn
2021-03-21  9:52 ` sgn
2021-03-21  9:55 ` sgn
2021-03-21  9:55 ` [PR REVIEW] " thypon
2021-03-21  9:55 ` thypon
2021-03-21  9:59 ` sgn
2021-03-23  9:15 ` [PR REVIEW] " Piraty
2021-03-25  0:45 ` [PR PATCH] [Updated] " sgn
2021-03-25  1:38 ` sgn
2021-03-26 15:13 ` sgn
2021-03-26 15:42 ` ericonr
2021-03-26 15:43 ` ericonr
2021-03-26 15:48 ` sgn
2021-03-26 16:01 ` [PR PATCH] [Updated] " sgn
2021-03-27  8:23 ` sgn
2021-03-27  8:24 ` sgn
2021-03-27  8:51 ` [PR PATCH] [Updated] " sgn
2021-03-27 12:30 ` sgn
2021-03-27 12:33 ` sgn
2021-03-28  3:40 ` [PR PATCH] [Updated] " sgn
2021-03-28  3:50 ` sgn
2021-03-28  3:53 ` sgn
2021-03-28  3:54 ` sgn
2021-03-29  0:48 ` [PR PATCH] [Updated] " sgn
2021-03-29 15:30 ` sgn
2021-04-03  3:00 ` sgn
2021-04-03  3:13 ` sgn
2021-04-03  3:13 ` [PR PATCH] [Merged]: " sgn

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).