aboutsummaryrefslogtreecommitdiff
path: root/libs/libmpc
diff options
context:
space:
mode:
authorJeffery To <jeffery.to@gmail.com>2023-05-28 03:07:15 +0800
committerRosen Penev <rosenp@gmail.com>2023-05-29 18:15:59 +0300
commit4d64d5f80a0bbffded0d4d99d7578d61349e424c (patch)
treea0b17d1497cd7efc4b3ea2b3334520c91cf65fa9 /libs/libmpc
parent925bd169451f3223ca3800cde4af390759919e3b (diff)
libmpc: Add package
From the documentation: GNU MPC is a portable library written in C for arbitrary precision arithmetic on complex numbers providing correct rounding. It implements a multiprecision equivalent of the C99 standard. It builds upon the GNU MP and the GNU MPFR libraries. Signed-off-by: Jeffery To <jeffery.to@gmail.com>
Diffstat (limited to 'libs/libmpc')
-rw-r--r--libs/libmpc/Makefile57
-rw-r--r--libs/libmpc/patches/001-only-src.patch22
2 files changed, 79 insertions, 0 deletions
diff --git a/libs/libmpc/Makefile b/libs/libmpc/Makefile
new file mode 100644
index 000000000..2a5e3d119
--- /dev/null
+++ b/libs/libmpc/Makefile
@@ -0,0 +1,57 @@
+#
+# Copyright (C) 2023 Jeffery To
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=mpc
+PKG_VERSION:=1.3.1
+PKG_RELEASE:=1
+
+PKG_SOURCE_URL:=@GNU/mpc/
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_HASH:=ab642492f5cf882b74aa0cb730cd410a81edcdbec895183ce930e706c1c759b8
+
+PKG_LICENSE:=LGPL-3.0-or-later
+PKG_LICENSE_FILES:=COPYING.LESSER
+PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>
+
+PKG_BUILD_PARALLEL:=1
+PKG_FIXUP:=autoreconf
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libmpc
+ SECTION:=libs
+ CATEGORY:=Libraries
+ TITLE:=GNU MPC library
+ URL:=https://www.multiprecision.org/mpc/
+ DEPENDS:=+libgmp +libmpfr
+ ABI_VERSION:=3
+endef
+
+define Package/libmpc/description
+GNU MPC is a portable library written in C for arbitrary precision
+arithmetic on complex numbers providing correct rounding. It implements
+a multiprecision equivalent of the C99 standard. It builds upon the GNU
+MP and the GNU MPFR libraries.
+endef
+
+define Build/InstallDev
+ $(INSTALL_DIR) $(1)/usr/include
+ $(CP) $(PKG_INSTALL_DIR)/usr/include/mpc* $(1)/usr/include/
+
+ $(INSTALL_DIR) $(1)/usr/lib
+ $(CP) $(PKG_INSTALL_DIR)/usr/lib/libmpc.{a,so*} $(1)/usr/lib/
+endef
+
+define Package/libmpc/install
+ $(INSTALL_DIR) $(1)/usr/lib
+ $(CP) $(PKG_INSTALL_DIR)/usr/lib/libmpc.so.* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,libmpc))
diff --git a/libs/libmpc/patches/001-only-src.patch b/libs/libmpc/patches/001-only-src.patch
new file mode 100644
index 000000000..8201ec7b0
--- /dev/null
+++ b/libs/libmpc/patches/001-only-src.patch
@@ -0,0 +1,22 @@
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -23,7 +23,7 @@ ACLOCAL_AMFLAGS = -I m4
+ # VERSION = @VERSION@@GITVERSION@ # for development version
+ VERSION = @VERSION@
+
+-SUBDIRS = src tests doc tools
++SUBDIRS = src
+
+ EXTRA_HEADERS = src/mpc-log.h
+ include_HEADERS = src/mpc.h @MPC_LOG_H@
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -376,7 +376,7 @@ top_build_prefix = @top_build_prefix@
+ top_builddir = @top_builddir@
+ top_srcdir = @top_srcdir@
+ ACLOCAL_AMFLAGS = -I m4
+-SUBDIRS = src tests doc tools
++SUBDIRS = src
+ EXTRA_HEADERS = src/mpc-log.h
+ include_HEADERS = src/mpc.h @MPC_LOG_H@
+ EXTRA_DIST = doc/fdl-1.3.texi src/mpc-log.h