public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/sci:master commit in: sci-mathematics/gap-core/, sci-mathematics/gap-core/files/, profiles/
@ 2020-10-22  3:58 Aisha Tammy
  0 siblings, 0 replies; only message in thread
From: Aisha Tammy @ 2020-10-22  3:58 UTC (permalink / raw
  To: gentoo-commits

commit:     499b1d05def066a51b3ba805ba42cc6eb3e46d21
Author:     Aisha Tammy <gentoo <AT> aisha <DOT> cc>
AuthorDate: Thu Oct 22 03:50:37 2020 +0000
Commit:     Aisha Tammy <gentoo <AT> aisha <DOT> cc>
CommitDate: Thu Oct 22 03:50:43 2020 +0000
URL:        https://gitweb.gentoo.org/proj/sci.git/commit/?id=499b1d05

sci-mathematics/gap-core: core package for GAP

all tests for core package passing

Package-Manager: Portage-3.0.8, Repoman-3.0.1
Signed-off-by: Aisha Tammy <gentoo <AT> aisha.cc>

 profiles/package.mask                              |   5 +
 .../gap-core/files/gap-core-4.11.0-autoconf.patch  | 136 ++++++++++++++++++++
 sci-mathematics/gap-core/gap-core-4.11.0.ebuild    | 140 +++++++++++++++++++++
 sci-mathematics/gap-core/metadata.xml              |  30 +++++
 4 files changed, 311 insertions(+)

diff --git a/profiles/package.mask b/profiles/package.mask
index 56b672d8d..f495d9865 100644
--- a/profiles/package.mask
+++ b/profiles/package.mask
@@ -30,3 +30,8 @@
 
 #--- END OF EXAMPLES ---
 
+# Aisha Tammy <gentoo@aisha.cc> (2020-10-21)
+# This ebuild is unmaintainable and the package
+# is going to be split subpackages
+# suggested replacement - sci-mathematics/gap-core
+sci-mathematics/gap
\ No newline at end of file

diff --git a/sci-mathematics/gap-core/files/gap-core-4.11.0-autoconf.patch b/sci-mathematics/gap-core/files/gap-core-4.11.0-autoconf.patch
new file mode 100644
index 000000000..ea3ebdfe6
--- /dev/null
+++ b/sci-mathematics/gap-core/files/gap-core-4.11.0-autoconf.patch
@@ -0,0 +1,136 @@
+diff --git a/Makefile.rules b/Makefile.rules
+index c2971b2..3c04e8b 100644
+--- a/Makefile.rules
++++ b/Makefile.rules
+@@ -483,20 +483,22 @@ clean:
+ 
+ LTINSTALL=$(LIBTOOL) --mode=install $(INSTALL)
+ 
+-install:
+-	@echo "Error, 'make install' has not yet been implemented"
+-	exit 1
++install: install-bin install-libgap install-headers install-gaproot
+ 
+ install-bin:
+-	@echo "Warning, 'make install-bin' is incomplete"
+ 	$(INSTALL) -d -m 0755 $(DESTDIR)$(bindir)
+-	$(INSTALL) -m 0755 gap $(DESTDIR)$(bindir)/gap.real
+-	echo "!/bin/sh\nexec \"$(bindir)/gap.real\" -l \"$(datarootdir)/gap\" \"$@\"" > gap-wrapper.sh
+-	$(INSTALL) -m 0755 gap-wrapper.sh $(DESTDIR)$(bindir)/gap
+-	# TODO: make gac installable; this requires adjusting path in it, and
+-	# installing the libtool script generated by configure somewhere; and then
+-	# putting that path to it into gac)
+-	#$(INSTALL) gac $(DESTDIR)$(bindir)
++	$(INSTALL) -m 0755 gap $(DESTDIR)$(datarootdir)/gap
++	echo "!/bin/sh\nexec \"$(datarootdir)/gap\" -l \"$(datarootdir)/gap\" \"$@\"" > gap
++	$(INSTALL) -m 0755 gap $(DESTDIR)$(bindir)
++	sed -e "s:^abs_top_builddir=.*$:abs_top_builddir=\"$(datarootdir)/gap\":" \
++	    -e "s:^abs_top_srcdir=.*$:abs_top_srcdir=\"$(datarootdir)/gap\":" \
++	    -i gac
++	$(INSTALL) -m 0755 gac $(DESTDIR)$(bindir)
++
++install-libgap: libgap.la
++	@echo "Warning, 'make install-libgap' is incomplete"
++	$(INSTALL) -d -m 0755 $(DESTDIR)$(libdir)
++	$(LTINSTALL) libgap.la $(DESTDIR)$(libdir)
+ 
+ install-gaproot:
+ 	@echo "Warning, 'make install-gaproot' is incomplete"
+@@ -538,11 +540,6 @@ install-headers:
+ 	$(INSTALL) -m 0644 $(srcdir)/src/hpc/*.h $(DESTDIR)$(includedir)/gap/hpc
+ 	# TODO: take care of config.h, this is difficult
+ 
+-install-libgap: libgap.la
+-	@echo "Warning, 'make install-libgap' is incomplete"
+-	$(INSTALL) -d -m 0755 $(DESTDIR)$(libdir)
+-	$(LTINSTALL) libgap.la $(DESTDIR)$(libdir)
+-
+ 
+ .PHONY: install install-bin install-gaproot install-headers install-libgap
+ 
+diff --git a/configure.ac b/configure.ac
+index 938fcd3..b3b2340 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -6,6 +6,7 @@ AC_INIT([GAP], [4.dev], [support@gap-system.org], [gap], [https://www.gap-system
+ 
+ AC_CONFIG_SRCDIR([src/gap.c])
+ AC_CONFIG_AUX_DIR([cnf])
++AC_CONFIG_MACRO_DIR([m4])
+ 
+ AC_CONFIG_HEADERS([gen/config.h:src/config.h.in])
+ AC_CONFIG_COMMANDS([gen/stamp-h], [echo timestamp > gen/stamp-h])
+@@ -207,29 +208,41 @@ dnl User setting: Debug mode (off by default)
+ dnl
+ AC_ARG_ENABLE([debug],
+     [AS_HELP_STRING([--enable-debug], [enable debug mode])],
+-    [AC_DEFINE([GAP_KERNEL_DEBUG], [1], [define if building in debug mode])
+-     AC_DEFINE([GAP_PRINT_BACKTRACE], [1], [to enable backtraces upon crashes])],
++    [],
+     [enable_debug=no]
+     )
+ AC_MSG_CHECKING([whether to enable debug mode])
+ AC_MSG_RESULT([$enable_debug])
+ 
++AS_IF([test "x$enable_debug" != "xno"],
++    [AC_DEFINE([GAP_KERNEL_DEBUG], [1], [define if building in debug mode])
++     AC_DEFINE([GAP_PRINT_BACKTRACE], [1], [to enable backtraces upon crashes])],
++) 
++
+ AC_ARG_ENABLE([memory-checking],
+     [AS_HELP_STRING([--enable-memory-checking], [enable memory checking])],
+-    [AC_DEFINE([GAP_MEM_CHECK], [1], [define if building with memory checking])],
++    [],
+     [enable_memory_checking=no]
+     )
+ AC_MSG_CHECKING([whether to enable memory checking])
+ AC_MSG_RESULT([$enable_memory_checking])
+ 
++AS_IF([test "x$enable_memory_checking" != "xno"],
++  [AC_DEFINE([GAP_MEM_CHECK], [1], [define if building with memory checking])]
++)
++
+ AC_ARG_ENABLE([valgrind],
+     [AS_HELP_STRING([--enable-valgrind], [enable valgrind extensions to GASMAN])],
+-    [AC_DEFINE([GAP_MEMORY_CANARY], [1], [define if building with valgrind extensions])],
++    [],
+     [enable_valgrind=no]
+     )
+ AC_MSG_CHECKING([whether to enable valgrind extensions to GASMAN])
+ AC_MSG_RESULT([$enable_valgrind])
+ 
++AS_IF([test "x$enable_valgrind" != "xno"],
++  [AC_DEFINE([GAP_MEMORY_CANARY], [1], [define if building with valgrind extensions])]
++)
++
+ if test "x$enable_valgrind" != "xno" -a "x$enable_memory_checking" != "xno"; then
+     AC_MSG_ERROR([--enable-valgrind and --enable-memory-checking cannot be used at the same time])
+ fi
+@@ -549,10 +562,9 @@ AS_IF([test "x$with_gc" = xboehm],
+   #
+   # As a side benefit, users do not have to worry about installing dependencies.
+ 
+-  BUILD_LIBATOMIC_OPS=yes
+-  LIBATOMIC_OPS_CPPFLAGS='-I${abs_builddir}/extern/install/libatomic_ops/include'
+-  LIBATOMIC_OPS_LDFLAGS='${abs_builddir}/extern/install/libatomic_ops/lib/libatomic_ops.la'
+-  LIBATOMIC_OPS_LIBS=
++  BUILD_LIBATOMIC_OPS=no
++  #PKG_CHECK_MODULES([LIBATOMIC_OPS], [atomic_ops])
++
+   AC_SUBST([BUILD_LIBATOMIC_OPS])
+   AC_SUBST([LIBATOMIC_OPS_CPPFLAGS])
+   AC_SUBST([LIBATOMIC_OPS_LDFLAGS])
+@@ -561,11 +573,8 @@ AS_IF([test "x$with_gc" = xboehm],
+   ATOMIC_OPS_CFLAGS=$LIBATOMIC_OPS_CPPFLAGS
+   ATOMIC_OPS_LIBS=$LIBATOMIC_OPS_LDFLAGS
+ 
+-
+-  BUILD_BOEHM_GC=yes
+-  BOEHM_GC_CPPFLAGS='-I${abs_builddir}/extern/install/gc/include'
+-  BOEHM_GC_LDFLAGS='${abs_builddir}/extern/install/gc/lib/libgc.la'
+-  BOEHM_GC_LIBS=
++  BUILD_BOEHM_GC=no
++  #PKG_CHECK_MODULES([BOEHM_GC], [bdw-gc])
+   AC_SUBST([BUILD_BOEHM_GC])
+   AC_SUBST([BOEHM_GC_CPPFLAGS])
+   AC_SUBST([BOEHM_GC_LDFLAGS])

diff --git a/sci-mathematics/gap-core/gap-core-4.11.0.ebuild b/sci-mathematics/gap-core/gap-core-4.11.0.ebuild
new file mode 100644
index 000000000..c4610cb98
--- /dev/null
+++ b/sci-mathematics/gap-core/gap-core-4.11.0.ebuild
@@ -0,0 +1,140 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python3_{7..9} )
+inherit autotools python-any-r1
+
+DESCRIPTION="System for computational discrete algebra"
+HOMEPAGE="https://www.gap-system.org/"
+SRC_URI="https://github.com/gap-system/gap/releases/download/v${PV}/gap-${PV}-core.tar.bz2 -> ${P}.tar.bz2
+	https://github.com/gap-system/gap/releases/download/v${PV}/packages-required-v${PV}.tar.gz -> ${P}-packages.tar.gz
+"
+S="${WORKDIR}"/gap-${PV}
+
+SLOT="0"
+LICENSE="GPL-2"
+KEYWORDS="~amd64"
+# broken HPC
+IUSE="-boehm debug -hpc julia julia-gc memcheck valgrind"
+REQUIRED_USE="valgrind? ( memcheck ) julia-gc? ( julia ) hpc? ( boehm )"
+
+RDEPEND+="
+	dev-libs/gmp
+	net-libs/zeromq
+	sci-libs/cddlib
+	sys-libs/readline
+	sys-libs/zlib
+	julia? ( || (
+		dev-lang/julia
+		dev-lang/julia-bin
+	) )
+	valgrind? ( dev-util/valgrind )
+"
+DEPEND+="${RDEPEND}"
+BDEPEND+="${PYTHON_DEPS}"
+
+PATCHES=( "${FILESDIR}"/${PN}-4.11.0-autoconf.patch )
+
+pkg_setup() {
+	if use valgrind; then
+		elog "If you enable the use of valgrind duing building"
+		elog "be sure that you have enabled the proper flags"
+		elog "in gcc to support it:"
+		elog "https://wiki.gentoo.org/wiki/Debugging#Valgrind"
+	fi
+}
+
+src_unpack() {
+	default
+	mkdir -p "${S}"/pkg || die
+	mv "${WORKDIR}"/{GAPDoc*,primgrp*,SmallGrp*,transgrp*} "${S}"/pkg || die
+}
+
+src_prepare() {
+	default
+	eautoreconf -f -i
+
+	# use GNUmakefile
+	rm Makefile || die
+
+	# make sure of no external gmp/zlib being build
+	# gap uses bundled libatomic_ops and boehm-gc
+	rm -rf extern || die
+
+	# this test takes TOO long
+	rm tst/teststandard/opers/AutomorphismGroup.tst || die
+}
+
+src_configure() {
+	local myconf=(
+		--enable-shared
+		--disable-static
+		--with-gmp
+		--with-zlib
+		--with-readline
+		--enable-popcnt
+		$(use_enable memcheck memory-checking)
+		$(use_enable valgrind)
+		$(use_enable hpc hpcgap)
+		$(use_enable debug)
+		$(use_with julia)
+	)
+	# garbage collector settings
+	if use boehm; then
+		myconf+=( --with-gc=boehm )
+	elif use julia-gc; then
+		myconf+=( --with-gc=julia )
+	else
+		myconf+=( --with-gc=gasman )
+	fi
+
+	# only supporting amd64 builds
+	econf ${myconf[@]} ABI=64
+}
+
+src_test() {
+	emake testinstall testlibgap
+}
+
+src_install() {
+	# upstream has no install function
+	# we try to simulate on as best as we can
+
+	dodoc README{,.buildsys,.hpcgap}.md \
+		CHANGES.md CITATION
+
+	sed -e "s:^abs_top_builddir=.*$:abs_top_builddir=\"${EPREFIX}/usr/share/gap\":" \
+	    -e "s:^abs_top_srcdir=.*$:abs_top_srcdir=\"${EPREFIX}/usr/share/gap\":" \
+	    -i gac || die
+	dobin gac
+
+	exeinto /usr/share/gap/
+	doexe gap
+
+	cat <<-EOF > gap.sh || die
+	\#!/bin/sh
+	exec "${EPREFIX}"/usr/share/gap/gap -l "${EPREFIX}"/usr/share/gap "\$@"
+	EOF
+	newbin gap.sh gap
+
+	dolib.so .libs/libgap.so*
+
+	dodir /usr/include/gap
+	cp -a src/*.h gen/*.h "${ED}"/usr/include/gap || die
+	if use hpc; then
+		dodir /usr/include/gap/hpc
+		cp -a src/hpc/*.h "${ED}"/usr/include/gap/hpc || die
+	fi
+
+	cp -a doc grp lib tst libtool "${ED}"/usr/share/gap || die
+
+	sed -e "s:${S}:${EPREFIX}/usr/share/gap:g" -i sysinfo.gap
+	insinto /usr/share/gap
+	doins sysinfo.gap*
+
+	# remove objects and static lib files
+	find "${ED}" \( -name "*.o" -o -name "*.a"  -o -name "*.la" \) \
+	     -delete || die
+}

diff --git a/sci-mathematics/gap-core/metadata.xml b/sci-mathematics/gap-core/metadata.xml
new file mode 100644
index 000000000..a59ef9895
--- /dev/null
+++ b/sci-mathematics/gap-core/metadata.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+	<maintainer type="person">
+		<email>A.G.Grozin@inp.nsk.su</email>
+		<name>Andrey Grozin</name>
+	</maintainer>
+	<maintainer type="project">
+		<email>sci-mathematics@gentoo.org</email>
+		<name>Gentoo Mathematics Project</name>
+	</maintainer>
+	<longdescription lang="en">
+Groups, Algorithms, Programming is a system for computational
+discrete algebra, with particular emphasis on Computational Group
+Theory. GAP provides a  programming language, a library of thousands
+of functions implementing algebraic algorithms written in the GAP
+language as well as large data libraries of algebraic objects. GAP
+is used in research and teaching for studying groups and their
+representations, rings, vector spaces, algebras, combinatorial
+structures, and more.
+</longdescription>
+	<use>
+		<flag name="boehm">Use <pkg>dev-libs/boehm-gc</pkg> as garbage collector</flag>
+		<flag name="hpc">Build gap with multithreading and parallel process support</flag>
+		<flag name="julia">Build julia bindings</flag>
+		<flag name="julia-gc">Use the julia garbage collector</flag>
+		<flag name="memcheck">Enable memory checking</flag>
+		<flag name="valgrind">Build symbols to be used by valgrind</flag>		
+	</use>
+</pkgmetadata>


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2020-10-22  3:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-10-22  3:58 [gentoo-commits] proj/sci:master commit in: sci-mathematics/gap-core/, sci-mathematics/gap-core/files/, profiles/ Aisha Tammy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox