aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNecktwi Ozfguah <necktwi@ferryfair.com>2019-05-15 18:58:39 +0530
committerAnthony G. Basile <blueness@gentoo.org>2019-05-15 12:00:44 -0400
commitd7ae21668ccbdaa0153250168325813b6c083b60 (patch)
tree0fd784a98bd9c20684fff16d1d68f6660337ce25 /dev-util
parentsys-auth/polkit: remove older versions (diff)
downloadmusl-d7ae21668ccbdaa0153250168325813b6c083b60.tar.gz
musl-d7ae21668ccbdaa0153250168325813b6c083b60.tar.bz2
musl-d7ae21668ccbdaa0153250168325813b6c083b60.zip
dev-utils/cmocka: define uintptr_t if not defined
define uintptr_t if UINTPTR_MAX is not defined. Signed-off-by: Necktwi Ozfguah <necktwi@ferryfair.com> Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
Diffstat (limited to 'dev-util')
-rw-r--r--dev-util/cmocka/Manifest1
-rw-r--r--dev-util/cmocka/cmocka-1.1.3.ebuild51
-rw-r--r--dev-util/cmocka/files/cmocka-1.1.3-fix-doxygen.patch43
-rw-r--r--dev-util/cmocka/files/cmocka-1.1.3-musl.patch82
-rw-r--r--dev-util/cmocka/metadata.xml12
5 files changed, 189 insertions, 0 deletions
diff --git a/dev-util/cmocka/Manifest b/dev-util/cmocka/Manifest
new file mode 100644
index 0000000..2b6a080
--- /dev/null
+++ b/dev-util/cmocka/Manifest
@@ -0,0 +1 @@
+DIST cmocka-1.1.3.tar.xz 78744 BLAKE2B 5043a496afab08837a73c2e0ff9c9b3c3880a2fd394a768b1f8b51d2fec517a5527e93b7e660f8dcc73af79aaf88e224f4e2869c7e31540f8e54c76481905ff6 SHA512 b1a2ce72234256d653eebf95f8744a34525b9027e1ecf6552e1620c83a4bdda8b5674b748cc5fd14abada1e374829e2e7f0bcab0b1c8d6c3b7d9b7ec474b6ed3
diff --git a/dev-util/cmocka/cmocka-1.1.3.ebuild b/dev-util/cmocka/cmocka-1.1.3.ebuild
new file mode 100644
index 0000000..4aadbf9
--- /dev/null
+++ b/dev-util/cmocka/cmocka-1.1.3.ebuild
@@ -0,0 +1,51 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit cmake-multilib
+
+DESCRIPTION="A unit testing framework for C"
+HOMEPAGE="https://cmocka.org/"
+SRC_URI="https://cmocka.org/files/1.1/${P}.tar.xz"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux"
+IUSE="doc static-libs test"
+
+DEPEND="
+ doc? ( app-doc/doxygen[dot] )
+"
+RDEPEND=""
+
+DOCS=( AUTHORS ChangeLog README.md )
+
+PATCHES=(
+ "${FILESDIR}/${P}-fix-doxygen.patch" # bug 671404
+ "${FILESDIR}/${P}-musl.patch"
+)
+
+multilib_src_configure() {
+ local mycmakeargs=(
+ -DWITH_STATIC_LIB=$(usex static-libs)
+ -DUNIT_TESTING=$(usex test)
+ $(multilib_is_native_abi && cmake-utils_use_find_package doc Doxygen \
+ || echo -DCMAKE_DISABLE_FIND_PACKAGE_Doxygen=ON)
+ )
+
+ cmake-utils_src_configure
+}
+
+multilib_src_compile() {
+ cmake-utils_src_compile
+ multilib_is_native_abi && use doc && cmake-utils_src_compile docs
+}
+
+multilib_src_install() {
+ if multilib_is_native_abi && use doc; then
+ local HTML_DOCS=( "${BUILD_DIR}"/doc/html/. )
+ fi
+
+ cmake-utils_src_install
+}
diff --git a/dev-util/cmocka/files/cmocka-1.1.3-fix-doxygen.patch b/dev-util/cmocka/files/cmocka-1.1.3-fix-doxygen.patch
new file mode 100644
index 0000000..c093021
--- /dev/null
+++ b/dev-util/cmocka/files/cmocka-1.1.3-fix-doxygen.patch
@@ -0,0 +1,43 @@
+From 1abfea55df24e83c2ea321b5f2b75e1a58963bc6 Mon Sep 17 00:00:00 2001
+From: Andreas Schneider <asn@cryptomilk.org>
+Date: Wed, 24 Oct 2018 16:33:39 +0200
+Subject: cmake: Fix doxygen generation
+
+Fixes #12
+
+Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
+---
+ CMakeLists.txt | 2 +-
+ doc/CMakeLists.txt | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 88408a9..7778039 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -51,9 +51,9 @@ if (MINGW)
+ endif (MINGW)
+
+ # check subdirectories
+-add_subdirectory(doc)
+ add_subdirectory(include)
+ add_subdirectory(src)
++add_subdirectory(doc)
+
+ include(AddCMockaTest)
+ if (UNIT_TESTING)
+diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt
+index a7bc65e..6ac7494 100644
+--- a/doc/CMakeLists.txt
++++ b/doc/CMakeLists.txt
+@@ -38,7 +38,7 @@ if (DOXYGEN_FOUND)
+
+ doxygen_add_docs(docs
+ ${cmocka-library_SOURCE_DIR}
+- ${cmocka-headers_SOURCE_DIR}
++ ${cmocka-header_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR})
+ endif(DOXYGEN_FOUND)
+
+--
+cgit v1.2.1
diff --git a/dev-util/cmocka/files/cmocka-1.1.3-musl.patch b/dev-util/cmocka/files/cmocka-1.1.3-musl.patch
new file mode 100644
index 0000000..88b352b
--- /dev/null
+++ b/dev-util/cmocka/files/cmocka-1.1.3-musl.patch
@@ -0,0 +1,82 @@
+From 939131e519c2a0d53ec177c69f010e17efea0949 Mon Sep 17 00:00:00 2001
+From: Quentin Rameau <quinq@fifth.space>
+Date: Sun, 20 Jan 2019 14:50:27 +0100
+Subject: [PATCH] Use portable guard for defining uintptr_t
+
+---
+ include/cmocka.h | 14 +++++++++-----
+ src/cmocka.c | 3 +--
+ 2 files changed, 10 insertions(+), 7 deletions(-)
+
+diff --git a/include/cmocka.h b/include/cmocka.h
+index 377c696..0fbc577 100644
+--- a/include/cmocka.h
++++ b/include/cmocka.h
+@@ -44,6 +44,7 @@ int __stdcall IsDebuggerPresent();
+ * These headers or their equivalents should be included prior to including
+ * this header file.
+ * @code
++ * #include <limits.h>
+ * #include <stdarg.h>
+ * #include <stddef.h>
+ * #include <setjmp.h>
+@@ -111,33 +123,37 @@ typedef uintmax_t LargestIntegralType;
+ ((LargestIntegralType)(value))
+
++#include <stdint.h>
+ /* Smallest integral type capable of holding a pointer. */
+-#if !defined(_UINTPTR_T) && !defined(_UINTPTR_T_DEFINED)
++#if !defined(UINTPTR_MAX)
+ # if defined(_WIN32)
+ /* WIN32 is an ILP32 platform */
+ typedef unsigned int uintptr_t;
++# define UINTPTR_MAX UINT_MAX
+ # elif defined(_WIN64)
+ typedef unsigned long int uintptr_t
++# define UINTPTR_MAX ULONG_MAX
+ # else /* _WIN32 */
+
+ /* ILP32 and LP64 platforms */
+ # ifdef __WORDSIZE /* glibc */
+ # if __WORDSIZE == 64
+ typedef unsigned long int uintptr_t;
++# define UINTPTR_MAX ULONG_MAX
+ # else
+ typedef unsigned int uintptr_t;
++# define UINTPTR_MAX UINT_MAX
+ # endif /* __WORDSIZE == 64 */
+ # else /* __WORDSIZE */
+ # if defined(_LP64) || defined(_I32LPx)
+ typedef unsigned long int uintptr_t;
++# define UINTPTR_MAX ULONG_MAX
+ # else
+ typedef unsigned int uintptr_t;
++# define UINTPTR_MAX UINT_MAX
+ # endif
+ # endif /* __WORDSIZE */
+ # endif /* _WIN32 */
+-
+-# define _UINTPTR_T
+-# define _UINTPTR_T_DEFINED
+-#endif /* !defined(_UINTPTR_T) || !defined(_UINTPTR_T_DEFINED) */
++#endif /* !defined(UINTPTR_MAX) */
+
+ /* Perform an unsigned cast to uintptr_t. */
+ #define cast_to_pointer_integral_type(value) \
+diff --git a/src/cmocka.c b/src/cmocka.c
+index 4ae65b7..d4a4f45 100644
+--- a/src/cmocka.c
++++ b/src/cmocka.c
+@@ -51,8 +51,7 @@
+ * Example:
+ *
+ * typedef unsigned long int uintptr_t
+- * #define _UINTPTR_T 1
+- * #define _UINTPTR_T_DEFINED 1
++ * #define UINTPTR_MAX ULONG_MAX
+ */
+ #ifdef CMOCKA_PLATFORM_INCLUDE
+ # include "cmocka_platform.h"
+--
+2.20.1
+
diff --git a/dev-util/cmocka/metadata.xml b/dev-util/cmocka/metadata.xml
new file mode 100644
index 0000000..b659c16
--- /dev/null
+++ b/dev-util/cmocka/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="person">
+ <email>creffett@gentoo.org</email>
+ <name>Chris Reffett</name>
+</maintainer>
+<maintainer type="project">
+ <email>kde@gentoo.org</email>
+ <name>Gentoo KDE Project</name>
+</maintainer>
+</pkgmetadata>