pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

mpc: Import mpc-1.3.1 as wip/mpc



Module Name:	pkgsrc-wip
Committed By:	David Shao <davshao%gmail.com@localhost>
Pushed By:	dshao
Date:		Tue Jul 4 14:05:19 2023 -0700
Changeset:	4d981d3866c4db79142c5be5d0cc30a438cc671d

Modified Files:
	Makefile
Added Files:
	mpc/COMMIT_MSG
	mpc/DESCR
	mpc/Makefile
	mpc/PLIST
	mpc/TODO
	mpc/buildlink3.mk
	mpc/builtin.mk
	mpc/distinfo
	mpc/inplace.mk

Log Message:
mpc: Import mpc-1.3.1 as wip/mpc

MPC is a complex floating-point library with exact rounding.
It is based on the GNU MPFR floating-point library, which is itself
based on the GNU MP library.

This is a C library for the arithmetic of complex numbers with
arbitrarily high precision and correct rounding of the result.
It extends the principles of the IEEE-754 standard for fixed
precision real floating point numbers to complex numbers,
providing well-defined semantics for every operation.
At the same time, speed of operation at high precision is a
major design goal.

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=4d981d3866c4db79142c5be5d0cc30a438cc671d

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 Makefile          |  1 +
 mpc/COMMIT_MSG    | 13 ++++++++++
 mpc/DESCR         | 11 +++++++++
 mpc/Makefile      | 29 ++++++++++++++++++++++
 mpc/PLIST         |  4 +++
 mpc/TODO          |  1 +
 mpc/buildlink3.mk | 15 +++++++++++
 mpc/builtin.mk    | 74 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 mpc/distinfo      |  5 ++++
 mpc/inplace.mk    | 19 ++++++++++++++
 10 files changed, 172 insertions(+)

diffs:
diff --git a/Makefile b/Makefile
index 679efac8ed..d0e4eefc9a 100644
--- a/Makefile
+++ b/Makefile
@@ -2414,6 +2414,7 @@ SUBDIR+=	mozjpeg
 SUBDIR+=	mozldap
 SUBDIR+=	mozplugger
 SUBDIR+=	mp3chop
+SUBDIR+=	mpc
 SUBDIR+=	mpc-el
 SUBDIR+=	mpdecimal
 SUBDIR+=	mpg123-jack
diff --git a/mpc/COMMIT_MSG b/mpc/COMMIT_MSG
new file mode 100644
index 0000000000..614d11c385
--- /dev/null
+++ b/mpc/COMMIT_MSG
@@ -0,0 +1,13 @@
+math/mpc: Add mpc version 1.3.1
+
+MPC is a complex floating-point library with exact rounding.
+It is based on the GNU MPFR floating-point library, which is itself
+based on the GNU MP library.
+
+This is a C library for the arithmetic of complex numbers with
+arbitrarily high precision and correct rounding of the result.
+It extends the principles of the IEEE-754 standard for fixed
+precision real floating point numbers to complex numbers,
+providing well-defined semantics for every operation.
+At the same time, speed of operation at high precision is a
+major design goal.
diff --git a/mpc/DESCR b/mpc/DESCR
new file mode 100644
index 0000000000..722f8d0986
--- /dev/null
+++ b/mpc/DESCR
@@ -0,0 +1,11 @@
+MPC is a complex floating-point library with exact rounding.
+It is based on the GNU MPFR floating-point library, which is itself
+based on the GNU MP library.
+
+This is a C library for the arithmetic of complex numbers with
+arbitrarily high precision and correct rounding of the result.
+It extends the principles of the IEEE-754 standard for fixed
+precision real floating point numbers to complex numbers,
+providing well-defined semantics for every operation.
+At the same time, speed of operation at high precision is a
+major design goal.
diff --git a/mpc/Makefile b/mpc/Makefile
new file mode 100644
index 0000000000..cc873cf6de
--- /dev/null
+++ b/mpc/Makefile
@@ -0,0 +1,29 @@
+# $NetBSD$
+
+DISTNAME=	mpc-1.3.1
+CATEGORIES=	math
+MASTER_SITES=	${MASTER_SITE_GNU:=mpc/}
+
+MAINTAINER=	pkgsrc-users%NetBSD.org@localhost
+HOMEPAGE=	https://www.multiprecision.org/mpc/
+COMMENT=	MPFR-based library for complex floating-point with exact rounding
+LICENSE=	gnu-lgpl-v3
+
+USE_LIBTOOL=		yes
+GNU_CONFIGURE=		yes
+.include "../../mk/bsd.prefs.mk"
+# .if !empty(MACHINE_PLATFORM:MNetBSD-[0-9]*-*)
+# CONFIGURE_ARGS+=        --disable-float128
+# .endif
+# TEST_TARGET=		check
+INFO_FILES=		yes
+
+# PKGCONFIG_OVERRIDE+=	mpfr.pc.in
+
+BUILDLINK_API_DEPENDS.mpfr+=	mpfr>=4.1
+.include "../../math/mpfr/buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
+
+# .if (${MACHINE_ARCH} == alpha)
+# CONFIGURE_ENV+=	CFLAGS="${CFLAGS:N-mieee}"
+# .endif
diff --git a/mpc/PLIST b/mpc/PLIST
new file mode 100644
index 0000000000..3369e6091f
--- /dev/null
+++ b/mpc/PLIST
@@ -0,0 +1,4 @@
+@comment $NetBSD$
+include/mpc.h
+info/mpc.info
+lib/libmpc.la
diff --git a/mpc/TODO b/mpc/TODO
new file mode 100644
index 0000000000..e62dc31295
--- /dev/null
+++ b/mpc/TODO
@@ -0,0 +1 @@
+Finished adapting math/mpfr to mpc.
diff --git a/mpc/buildlink3.mk b/mpc/buildlink3.mk
new file mode 100644
index 0000000000..0cf4ca4a35
--- /dev/null
+++ b/mpc/buildlink3.mk
@@ -0,0 +1,15 @@
+# $NetBSD: buildlink3.mk,v 1.11 2018/01/28 16:24:11 wiz Exp $
+
+BUILDLINK_TREE+=	mpc
+
+.if !defined(MPC_BUILDLINK3_MK)
+MPC_BUILDLINK3_MK:=
+
+BUILDLINK_API_DEPENDS.mpc+=	mpc>=1.3.1
+BUILDLINK_ABI_DEPENDS.mpc+=	mpc>=1.3.1
+BUILDLINK_PKGSRCDIR.mpc?=	../../math/mpc
+
+.include "../../math/mpfr/buildlink3.mk"
+.endif # MPC_BUILDLINK3_MK
+
+BUILDLINK_TREE+=	-mpc
diff --git a/mpc/builtin.mk b/mpc/builtin.mk
new file mode 100644
index 0000000000..c0f03970f7
--- /dev/null
+++ b/mpc/builtin.mk
@@ -0,0 +1,74 @@
+# $NetBSD: builtin.mk,v 1.8 2023/01/09 13:25:11 wiz Exp $
+
+BUILTIN_PKG:=	mpc
+
+BUILTIN_FIND_HEADERS_VAR:=	H_MPC
+BUILTIN_FIND_HEADERS.H_MPC=	mpc.h
+
+BUILTIN_VERSION_SCRIPT.mpc=	${AWK} \
+				'/\#define[ \t]*MPC_VERSION_STRING[ \t]/ { \
+				v = substr($$3, 2, length($$3)-2) } \
+				END { gsub("-p",".",v); print v }'
+
+.include "../../mk/buildlink3/bsd.builtin.mk"
+
+###
+### Determine if there is a built-in implementation of the package and
+### set IS_BUILTIN.<pkg> appropriately ("yes" or "no").
+###
+.if !defined(IS_BUILTIN.mpc)
+IS_BUILTIN.mpc=		no
+.  if empty(H_MPC:M__nonexistent__) && empty(H_MPC:M${LOCALBASE}/*)
+IS_BUILTIN.mpc=		yes
+.  endif
+.endif
+MAKEVARS+=		IS_BUILTIN.mpc
+
+###
+### If there is a built-in implementation, then set BUILTIN_PKG.<pkg> to
+### a package name to represent the built-in package.
+###
+.if !defined(BUILTIN_PKG.mpc) && \
+    ${IS_BUILTIN.mpc:tl} == yes && \
+    empty(H_MPC:M__nonexistent__)
+BUILTIN_VERSION.mpc!=	${BUILTIN_VERSION_SCRIPT.mpc} ${H_MPC}
+BUILTIN_PKG.mpc=	mpc-${BUILTIN_VERSION.mpc}
+.endif
+MAKEVARS+=		BUILTIN_PKG.mpc
+
+###
+### Determine whether we should use the built-in implementation if it
+### exists, and set USE_BUILTIN.<pkg> appropriate ("yes" or "no").
+###
+.if !defined(USE_BUILTIN.mpc)
+.  if ${PREFER.mpc} == "pkgsrc"
+USE_BUILTIN.mpc=	no
+.  else
+USE_BUILTIN.mpc=	${IS_BUILTIN.mpc}
+.    if defined(BUILTIN_PKG.mpc) && ${IS_BUILTIN.mpc:tl} == yes
+USE_BUILTIN.mpc=	yes
+.      for _dep_ in ${BUILDLINK_API_DEPENDS.mpc}
+.        if ${USE_BUILTIN.mpc:tl} == yes
+USE_BUILTIN.mpc!=	\
+	if ${PKG_ADMIN} pmatch ${_dep_:Q} ${BUILTIN_PKG.mpc:Q}; then	\
+		${ECHO} yes;						\
+	else								\
+		${ECHO} no;						\
+	fi
+.        endif
+.      endfor
+.    endif
+.  endif  # PREFER.mpc
+.endif
+MAKEVARS+=		USE_BUILTIN.mpc
+
+CHECK_BUILTIN.mpc?=	no
+.if ${CHECK_BUILTIN.mpc:tl} == no
+.  if ${USE_BUILTIN.mpc:tl} == yes
+MPC_INCLUDE=		${H_MPC:H}
+BUILDLINK_INCDIRS.mpc=	${MPC_INCLUDE}
+BUILDLINK_LIBDIRS.mpc=	lib${LIBABISUFFIX}
+CPPFLAGS+=		-I${MPC_INCLUDE}
+CFLAGS+=		-I${MPC_INCLUDE}
+.  endif
+.endif # CHECK_BUILTIN.mpc
diff --git a/mpc/distinfo b/mpc/distinfo
new file mode 100644
index 0000000000..6141a6b9fd
--- /dev/null
+++ b/mpc/distinfo
@@ -0,0 +1,5 @@
+$NetBSD: distinfo,v 1.34 2023/01/09 13:25:11 wiz Exp $
+
+BLAKE2s (mpc-1.3.1.tar.gz) = 5d2921ff2ec9523efd7063c63ee57dcb0905b398a8a2a2e58a952846e4dc934b
+SHA512 (mpc-1.3.1.tar.gz) = 4bab4ef6076f8c5dfdc99d810b51108ced61ea2942ba0c1c932d624360a5473df20d32b300fc76f2ba4aa2a97e1f275c9fd494a1ba9f07c4cb2ad7ceaeb1ae97
+Size (mpc-1.3.1.tar.gz) = 773573 bytes
diff --git a/mpc/inplace.mk b/mpc/inplace.mk
new file mode 100644
index 0000000000..afe9111eec
--- /dev/null
+++ b/mpc/inplace.mk
@@ -0,0 +1,19 @@
+# $NetBSD: inplace.mk,v 1.5 2015/09/15 20:56:33 joerg Exp $
+#
+# Include this file to extract math/mpc source into the WRKSRC of
+# another package. This is to be used by GCC packages to avoid the
+# numerous dependencies math/mpc has.
+
+.PHONY: fetch-inplace-mpc extract-inplace-mpc
+post-fetch: fetch-inplace-mpc
+
+post-extract: extract-inplace-mpc
+
+fetch-inplace-mpc:
+	(cd ../../math/mpc && ${MAKE} WRKDIR=${WRKSRC}/.devel.mpc EXTRACT_DIR=${WRKSRC} \
+		WRKSRC='$${EXTRACT_DIR}/$${DISTNAME}' SKIP_DEPENDS=YES checksum)
+
+extract-inplace-mpc:
+	(cd ../../math/mpc && ${MAKE} WRKDIR=${WRKSRC}/.devel.mpc EXTRACT_DIR=${WRKSRC} \
+		WRKSRC='$${EXTRACT_DIR}/$${DISTNAME}' SKIP_DEPENDS=YES patch)
+	${MV} ${WRKSRC}/mpc-* ${WRKSRC}/mpc


Home | Main Index | Thread Index | Old Index