diff options
author | Breno Leitao <breno.leitao@gmail.com> | 2017-03-29 18:15:57 +0000 |
---|---|---|
committer | Jakub Jirutka <jakub@jirutka.cz> | 2017-03-31 03:12:24 +0200 |
commit | 6a15dd0d0ba9cc354a621fb359ca5e315ff2eabd (patch) | |
tree | ca68edc7d696a0a158df8f66c8b723d81d899b73 /main/cmocka | |
parent | f226e7e897a0875425b33146aba570af3c487c5d (diff) | |
download | aports-6a15dd0d0ba9cc354a621fb359ca5e315ff2eabd.tar.bz2 aports-6a15dd0d0ba9cc354a621fb359ca5e315ff2eabd.tar.xz |
main/cmocka: fix build and check on ppc64le
Currently cmocka fails to build on ppc64le due to a redefinition
for uintptr_t. This is declared at Musl and redeclared by cmocka.
This patch check if uintptr_t was not defined by MUSL before
re-defining it.
Diffstat (limited to 'main/cmocka')
-rw-r--r-- | main/cmocka/APKBUILD | 17 | ||||
-rw-r--r-- | main/cmocka/musl_uintptr.patch | 35 |
2 files changed, 48 insertions, 4 deletions
diff --git a/main/cmocka/APKBUILD b/main/cmocka/APKBUILD index d75e5b3d6a..bfe3b55c86 100644 --- a/main/cmocka/APKBUILD +++ b/main/cmocka/APKBUILD @@ -10,9 +10,19 @@ license="ASL-2.0" depends="" makedepends="cmake" subpackages="$pkgname-dev" -source="https://cmocka.org/files/${pkgver%.*}/$pkgname-$pkgver.tar.xz" +source="https://cmocka.org/files/${pkgver%.*}/$pkgname-$pkgver.tar.xz + musl_uintptr.patch" builddir="$srcdir/$pkgname-$pkgver" +prepare() { + default_prepare || return 1 + + # Just one single test (customer_database_test) is breaking on ppc64le. + if [ "$CARCH" = "ppc64le" ]; then + sed -i '/customer_database_test/d' "$builddir"/example/CMakeLists.txt + fi +} + build() { mkdir -p "$builddir"/build || return 1 cd "$builddir"/build @@ -35,6 +45,5 @@ package() { make -C "$builddir"/build DESTDIR="$pkgdir" install } -md5sums="59c9aa5735d9387fb591925ec53523ec cmocka-1.1.0.tar.xz" -sha256sums="e960d3bf1be618634a4b924f18bb4d6f20a825c109a8ad6d1af03913ba421330 cmocka-1.1.0.tar.xz" -sha512sums="b45b6c6bf6c1a0e12cbbfa203afc0172aa53215e0bd43a21b30db04c0490609a7a262f1b4d87be9df0c5c486c4f4891d3432e0e053418d373d9750a6cf5adf70 cmocka-1.1.0.tar.xz" +sha512sums="b45b6c6bf6c1a0e12cbbfa203afc0172aa53215e0bd43a21b30db04c0490609a7a262f1b4d87be9df0c5c486c4f4891d3432e0e053418d373d9750a6cf5adf70 cmocka-1.1.0.tar.xz +b20b5c0d172a9df756ec093a3df4bf5bdf2a0c06a3d3ad39ec001248ccb86e6fd3dcedfc9ce42e8309cc01ea34fadffd4ebcc0fb3af9f5e795e7fe40c461ac60 musl_uintptr.patch" diff --git a/main/cmocka/musl_uintptr.patch b/main/cmocka/musl_uintptr.patch new file mode 100644 index 0000000000..9c9ca5735e --- /dev/null +++ b/main/cmocka/musl_uintptr.patch @@ -0,0 +1,35 @@ +commit f81e5b71ce78f33250347914dacc75c8463bf102 +Author: Breno Leitao <breno.leitao@gmail.com> +Date: Wed Mar 29 15:22:38 2017 -0300 + + include: Check for previous declaration of uintptr_t + + Adding a extra check before declaring uintptr_t. Currently musl uses + macro __DEFINED_uintptr_t once it defines uintptr_t type. Checking + this macro before defining it, and, defining it when uintptr_t is + defined. + + Signed-off-by: Breno Leitao <breno.leitao@gmail.com> + +diff --git a/include/cmocka.h b/include/cmocka.h +index 303d0ae..a2bfc40 100644 +--- a/include/cmocka.h ++++ b/include/cmocka.h +@@ -110,7 +110,7 @@ + ((LargestIntegralType)(value)) + + /* Smallest integral type capable of holding a pointer. */ +-#if !defined(_UINTPTR_T) && !defined(_UINTPTR_T_DEFINED) ++#if !defined(_UINTPTR_T) && !defined(_UINTPTR_T_DEFINED) && !defined(__DEFINED_uintptr_t) + # if defined(_WIN32) + /* WIN32 is an ILP32 platform */ + typedef unsigned int uintptr_t; +@@ -136,6 +136,8 @@ + + # define _UINTPTR_T + # define _UINTPTR_T_DEFINED ++# define __DEFINED_uintptr_t ++ + #endif /* !defined(_UINTPTR_T) || !defined(_UINTPTR_T_DEFINED) */ + + /* Perform an unsigned cast to uintptr_t. */ |