void-packages/srcpkgs/extra-cmake-modules/patches/musl.patch
Đoàn Trần Công Danh a03d116397 srcpkgs/e*: convert patches to -Np1
```sh

git grep -l '^patch_args=-Np0' "srcpkgs/$1*/template" |
while read template; do
	for p in ${template%/template}/patches/*; do
		sed -i '
			\,^[+-][+-][+-] /dev/null,b
			/^[*-]\+ [0-9]\+\(,[0-9]\+\)\? [*-]\+$/b
			s,^[*][*][*] ,&a/,
			/^--- /{
				s,\(^--- \)\(./\)*,\1a/,
				s,[.][Oo][Rr][Ii][Gg]\([	/]\),\1,
				s/[.][Oo][Rr][Ii][Gg]$//
				s/[.]patched[.]\([^.]\)/.\1/
				h
			}
			/^+++ -/{
				g
				s/^--- a/+++ b/
				b
			}
			s,\(^+++ \)\(./\)*,\1b/,
		' "$p"
	done
	sed -i '/^patch_args=/d' $template
done
```
2021-06-20 13:17:29 +07:00

31 lines
1.2 KiB
Diff

From 82387db20e8a22475a242705795d451219167ceb Mon Sep 17 00:00:00 2001
From: "A. Wilcox" <AWilcox@Wilcox-Tech.com>
Date: Fri, 2 Dec 2016 01:27:14 -0600
Subject: [PATCH] KDECompilerSettings: Ensure POSIX correctness
This change ensures that _XOPEN_SOURCE is defined. Since we use -std=
iso9899:1990, GCC and Clang won't enable this definition by default.
On non-glibc systems (where _GNU_SOURCE isn't defined), this causes most
POSIX interfaces to be missing, which cause various build failures.
Signed-off-by: A. Wilcox <AWilcox@Wilcox-Tech.com>
---
kde-modules/KDECompilerSettings.cmake | 3 +++
1 file changed, 3 insertions(+)
diff --git a/kde-modules/KDECompilerSettings.cmake b/kde-modules/KDECompilerSettings.cmake
index dfa29f7..f50911c 100644
--- a/kde-modules/KDECompilerSettings.cmake
+++ b/kde-modules/KDECompilerSettings.cmake
@@ -140,6 +140,9 @@ if (UNIX)
# implementation recognize it?
_kde_add_platform_definitions(-D_LARGEFILE64_SOURCE)
+ # Non-glibc platforms need this since we specify -std=iso9899:1990
+ _kde_add_platform_definitions(-D_XOPEN_SOURCE=600)
+
include(CheckCXXSourceCompiles)
# By default (in glibc, at least), on 32bit platforms off_t is 32 bits,
--
2.10.0