sci-mathematics/planarity: new package of graph planarity algorithms.
authorMichael Orlitzky <mjo@gentoo.org>
Wed, 29 Jan 2020 22:49:38 +0000 (17:49 -0500)
committerMichael Orlitzky <mjo@gentoo.org>
Thu, 30 Jan 2020 01:00:49 +0000 (20:00 -0500)
This commit imports the "planarity" package from the sage-on-gentoo
overlay with a few minor changes:

  * Update to EAPI=7.
  * Drop autotools.eclass and use the tarball from sagemath.org
    that contains the autotools stuff.
  * Add USE=examples to install some sample input/output.
  * Update the old code.google.com HOMEPAGE to point to github.

The SageMath project now has the ability to detect and use a system
copy of planarity, so this will help Gentoo users of SageMath avoid
some pointless rebuilds of planarity.

Closes: https://bugs.gentoo.org/707324
Package-Manager: Portage-2.3.84, Repoman-2.3.20
Signed-off-by: Michael Orlitzky <mjo@gentoo.org>
sci-mathematics/planarity/Manifest [new file with mode: 0644]
sci-mathematics/planarity/files/planarity-3.0.0.5-extern.patch [new file with mode: 0644]
sci-mathematics/planarity/metadata.xml [new file with mode: 0644]
sci-mathematics/planarity/planarity-3.0.0.5.ebuild [new file with mode: 0644]

diff --git a/sci-mathematics/planarity/Manifest b/sci-mathematics/planarity/Manifest
new file mode 100644 (file)
index 0000000..18c3677
--- /dev/null
@@ -0,0 +1 @@
+DIST planarity-3.0.0.5.tar.gz 492644 BLAKE2B d183bc07cab7246b62cc7340956206e3f6c5999aa92b223e7665ebd8ae1bc0c354011c078ea4f42d2e45efa2ae5e83e082e4c8d80e3391a4f20be1020ebf8188 SHA512 dfeb7e024e1f5758e5abbd854c4ca963b4f5d45433b2c5eb00ce85c154b5407ebccd1ace0db167488dee757db2c23367101a2aa568941a3664bac9058ea24328
diff --git a/sci-mathematics/planarity/files/planarity-3.0.0.5-extern.patch b/sci-mathematics/planarity/files/planarity-3.0.0.5-extern.patch
new file mode 100644 (file)
index 0000000..c1b2a27
--- /dev/null
@@ -0,0 +1,21 @@
+diff -Naur planarity-2.2.0.orig/c/planarity.h planarity-2.2.0/c/planarity.h
+--- planarity-2.2.0.orig/c/planarity.h 2015-06-04 22:24:57.753965370 +1200
++++ planarity-2.2.0/c/planarity.h      2015-06-04 23:02:38.138973933 +1200
+@@ -77,7 +77,7 @@
+ int legacyCommandLine(int argc, char *argv[]);\r
+ int menu();\r
\r
+-char Mode,\r
++extern char Mode,\r
+      OrigOut,\r
+      EmbeddableOut,\r
+      ObstructedOut,\r
+@@ -88,7 +88,7 @@
\r
+ /* Low-level Utilities */\r
+ #define MAXLINE 1024\r
+-char Line[MAXLINE];\r
++extern char Line[MAXLINE];\r
\r
+ void Message(char *message);\r
+ void ErrorMessage(char *message);\r
diff --git a/sci-mathematics/planarity/metadata.xml b/sci-mathematics/planarity/metadata.xml
new file mode 100644 (file)
index 0000000..d6f3a10
--- /dev/null
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+  <maintainer type="person">
+    <email>mjo@gentoo.org</email>
+  </maintainer>
+  <!--
+      mjo: François maintained this package in the sage-on-gentoo overlay
+      long before I moved it into ::gentoo. You don't need an ACK from me
+      to merge his changes.
+  -->
+  <maintainer type="person">
+    <email>frp.bissey@gmail.com</email>
+    <name>François Bissey</name>
+  </maintainer>
+  <maintainer type="project">
+    <email>proxy-maint@gentoo.org</email>
+    <name>Proxy Maintainers</name>
+  </maintainer>
+
+  <upstream>
+    <remote-id type="github">
+      graph-algorithms/edge-addition-planarity-suite
+    </remote-id>
+  </upstream>
+</pkgmetadata>
diff --git a/sci-mathematics/planarity/planarity-3.0.0.5.ebuild b/sci-mathematics/planarity/planarity-3.0.0.5.ebuild
new file mode 100644 (file)
index 0000000..2deb388
--- /dev/null
@@ -0,0 +1,33 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+MY_PN="edge-addition-planarity-suite-Version"
+DESCRIPTION="The edge addition planarity suite of graph algorithms"
+HOMEPAGE="https://github.com/graph-algorithms/edge-addition-planarity-suite/"
+
+# Use the tarball from sage because the github release doesn't
+# contain the generated autotools files (like ./configure).
+SRC_URI="http://files.sagemath.org/spkg/upstream/${PN}/${P}.tar.gz"
+IUSE="examples static-libs"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+# https://github.com/graph-algorithms/edge-addition-planarity-suite/issues/4
+# https://github.com/graph-algorithms/edge-addition-planarity-suite/pull/3
+PATCHES=( "${FILESDIR}/${P}-extern.patch" )
+
+S="${WORKDIR}/${MY_PN}_${PV}"
+
+src_configure(){
+       econf $(use_enable static-libs static)
+}
+
+src_install(){
+       default
+       find "${ED}" -name '*.la' -delete || die
+       use examples && dodoc -r c/samples
+}