commit:     32df5078b163522dd745f3a86c56574bdbd1f7a8
Author:     Sébastien Fabbro <bicatali <AT> gentoo <DOT> org>
AuthorDate: Fri Jul 21 23:36:58 2017 +0000
Commit:     Sebastien Fabbro <bicatali <AT> gentoo <DOT> org>
CommitDate: Mon Jul 24 19:32:43 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=32df5078

sci-libs/pgplot: fix for static build, prefix, and for EAPI6

Package-Manager: Portage-2.3.6, Repoman-2.3.3

 sci-libs/pgplot/files/pgplot-compile-setup.patch |   4 +-
 sci-libs/pgplot/files/pgplot-drivers.patch       |   4 +-
 sci-libs/pgplot/files/pgplot-headers.patch       |  28 ++--
 sci-libs/pgplot/files/pgplot-libpng15.patch      |   4 +-
 sci-libs/pgplot/files/pgplot-makemake.patch      |   6 +-
 sci-libs/pgplot/files/pgplot-tk86.patch          |   4 +-
 sci-libs/pgplot/pgplot-5.2.2-r7.ebuild           | 173 +++++++++++++++++++++++
 7 files changed, 198 insertions(+), 25 deletions(-)

diff --git a/sci-libs/pgplot/files/pgplot-compile-setup.patch 
b/sci-libs/pgplot/files/pgplot-compile-setup.patch
index f1709c333f4..a5baef6a4d2 100644
--- a/sci-libs/pgplot/files/pgplot-compile-setup.patch
+++ b/sci-libs/pgplot/files/pgplot-compile-setup.patch
@@ -1,5 +1,5 @@
---- sys_linux/g77_gcc.conf.orig        1999-07-05 19:10:33.000000000 +0100
-+++ sys_linux/g77_gcc.conf     2008-10-29 18:30:33.000000000 +0000
+--- a/sys_linux/g77_gcc.conf.orig      1999-07-05 19:10:33.000000000 +0100
++++ b/sys_linux/g77_gcc.conf   2008-10-29 18:30:33.000000000 +0000
 @@ -1,4 +1,4 @@
 -# The GNU g77 FORTRAN compiler and Gnu gcc C compiler on an elf-system.
 +# The GNU gfortran FORTRAN compiler and Gnu gcc C compiler on an elf-system.

diff --git a/sci-libs/pgplot/files/pgplot-drivers.patch 
b/sci-libs/pgplot/files/pgplot-drivers.patch
index 8201bdfaeb7..c03d7508fc3 100644
--- a/sci-libs/pgplot/files/pgplot-drivers.patch
+++ b/sci-libs/pgplot/files/pgplot-drivers.patch
@@ -1,5 +1,5 @@
---- drivers.list.orig  2007-03-08 15:56:20.000000000 +0000
-+++ drivers.list       2007-03-08 15:59:21.000000000 +0000
+--- a/drivers.list     2007-03-08 15:56:20.000000000 +0000
++++ b/drivers.list     2007-03-08 15:59:21.000000000 +0000
 @@ -6,71 +6,71 @@
  
!------------------------------------------------------------------------------
  ! File       Code       Description                                
Restrictions

diff --git a/sci-libs/pgplot/files/pgplot-headers.patch 
b/sci-libs/pgplot/files/pgplot-headers.patch
index 7bde726a041..c05ca702648 100644
--- a/sci-libs/pgplot/files/pgplot-headers.patch
+++ b/sci-libs/pgplot/files/pgplot-headers.patch
@@ -1,5 +1,5 @@
---- ./sys/grtermio.c.orig      2008-10-29 17:42:48.000000000 +0000
-+++ ./sys/grtermio.c   2008-10-29 19:54:43.000000000 +0000
+--- a/sys/grtermio.c   2008-10-29 17:42:48.000000000 +0000
++++ b/sys/grtermio.c   2008-10-29 19:54:43.000000000 +0000
 @@ -7,6 +7,10 @@
  
  #include <stdio.h>
@@ -11,8 +11,8 @@
  
  #ifdef PG_PPU
  #define GROTER groter_
---- ./sys/grfileio.c.orig      2008-10-29 15:10:02.000000000 +0000
-+++ ./sys/grfileio.c   2008-10-29 17:56:50.000000000 +0000
+--- a/sys/grfileio.c   2008-10-29 15:10:02.000000000 +0000
++++ b/sys/grfileio.c   2008-10-29 17:56:50.000000000 +0000
 @@ -17,7 +17,9 @@
   */
  
@@ -23,8 +23,8 @@
  #include <sys/types.h>
  #include <fcntl.h>
  
---- ./drivers/figdisp_comm.c.orig      2008-10-29 15:09:15.000000000 +0000
-+++ ./drivers/figdisp_comm.c   2008-10-29 17:54:08.000000000 +0000
+--- a/drivers/figdisp_comm.c   2008-10-29 15:09:15.000000000 +0000
++++ b/drivers/figdisp_comm.c   2008-10-29 17:54:08.000000000 +0000
 @@ -17,6 +17,8 @@
  
  /* The system include files */
@@ -34,8 +34,8 @@
  
  /* Get ntohs prototype or macro */
  
---- ./pgdispd/resdb.c.orig     2008-10-29 18:22:41.000000000 +0000
-+++ ./pgdispd/resdb.c  2008-10-29 20:10:22.000000000 +0000
+--- a/pgdispd/resdb.c  2008-10-29 18:22:41.000000000 +0000
++++ b/pgdispd/resdb.c  2008-10-29 20:10:22.000000000 +0000
 @@ -47,6 +47,8 @@
  #include <stdio.h>
  #include <stdlib.h>
@@ -53,8 +53,8 @@
        extern struct passwd *getpwuid();
        struct passwd *pw;
        register char *ptr;
---- ./pgdispd/proccom.c.orig   2008-10-29 15:03:34.000000000 +0000
-+++ ./pgdispd/proccom.c        2008-10-29 18:15:48.000000000 +0000
+--- a/pgdispd/proccom.c        2008-10-29 15:03:34.000000000 +0000
++++ b/pgdispd/proccom.c        2008-10-29 18:15:48.000000000 +0000
 @@ -90,6 +90,7 @@
  
  /* The system include files */
@@ -71,8 +71,8 @@
  
        if (!len & savedshorts)
        { /* an incomplete command was sent! */
---- ./pgdispd/getvisuals.c.orig        2008-10-29 17:59:37.000000000 +0000
-+++ ./pgdispd/getvisuals.c     2008-10-29 18:00:18.000000000 +0000
+--- a/pgdispd/getvisuals.c     2008-10-29 17:59:37.000000000 +0000
++++ b/pgdispd/getvisuals.c     2008-10-29 18:00:18.000000000 +0000
 @@ -30,6 +30,7 @@
  #include "messages.h"
  
@@ -81,8 +81,8 @@
  
  #define MAX_DEPTH     24      /* the maximum visual depth to use */
  
---- ./pgdispd/figcurs.c.orig   2008-10-29 17:58:22.000000000 +0000
-+++ ./pgdispd/figcurs.c        2008-10-29 18:14:02.000000000 +0000
+--- a/pgdispd/figcurs.c        2008-10-29 17:58:22.000000000 +0000
++++ b/pgdispd/figcurs.c        2008-10-29 18:14:02.000000000 +0000
 @@ -19,6 +19,7 @@
  
  /* The standard include files */

diff --git a/sci-libs/pgplot/files/pgplot-libpng15.patch 
b/sci-libs/pgplot/files/pgplot-libpng15.patch
index b1064cb4da1..a3cefe1dde7 100644
--- a/sci-libs/pgplot/files/pgplot-libpng15.patch
+++ b/sci-libs/pgplot/files/pgplot-libpng15.patch
@@ -1,5 +1,5 @@
---- drivers/pndriv.c
-+++ drivers/pndriv.c
+--- a/drivers/pndriv.c
++++ b/drivers/pndriv.c
 @@ -222,7 +222,7 @@
        return;
    }

diff --git a/sci-libs/pgplot/files/pgplot-makemake.patch 
b/sci-libs/pgplot/files/pgplot-makemake.patch
index 6cc3c637b6e..fafd2f16ea4 100644
--- a/sci-libs/pgplot/files/pgplot-makemake.patch
+++ b/sci-libs/pgplot/files/pgplot-makemake.patch
@@ -1,5 +1,5 @@
---- makemake.orig      2012-07-05 14:08:30.210815190 -0700
-+++ makemake   2012-07-05 14:26:28.353381906 -0700
+--- a/makemake 2012-07-05 14:08:30.210815190 -0700
++++ b/makemake 2012-07-05 14:26:28.353381906 -0700
 @@ -73,7 +73,7 @@
  
  # List the default make targets.
@@ -28,7 +28,7 @@
  if (echo $DRIV_LIST | grep -s tkdriv 2>&1 1>/dev/null); then
 -  DEFAULT_TARGETS="$DEFAULT_TARGETS libtkpgplot.a pgtkdemo pgtkdemo.tcl"
 -  INSTALL_LIST="$INSTALL_LIST libtkpgplot.a tkpgplot.h"
-+  DEFAULT_TARGETS="$DEFAULT_TARGETS libtkpgplot.so"
++  DEFAULT_TARGETS="$DEFAULT_TARGETS libtkpgplot.a"
 +  INSTALL_LIST="$INSTALL_LIST libtkpgplot.a tkpgplot.h"
  fi
  

diff --git a/sci-libs/pgplot/files/pgplot-tk86.patch 
b/sci-libs/pgplot/files/pgplot-tk86.patch
index bc0023eb90d..3223dc0dac4 100644
--- a/sci-libs/pgplot/files/pgplot-tk86.patch
+++ b/sci-libs/pgplot/files/pgplot-tk86.patch
@@ -1,5 +1,5 @@
---- drivers/xtk/tkpgplot.c.ORIG        2000-12-13 03:16:28.000000000 +0100
-+++ drivers/xtk/tkpgplot.c     2013-01-15 11:02:27.221231471 +0100
+--- a/drivers/xtk/tkpgplot.c   2000-12-13 03:16:28.000000000 +0100
++++ b/drivers/xtk/tkpgplot.c   2013-01-15 11:02:27.221231471 +0100
 @@ -417,7 +417,7 @@
  /*
   * If Tk_Init() hasn't been called, then there won't be a main window

diff --git a/sci-libs/pgplot/pgplot-5.2.2-r7.ebuild 
b/sci-libs/pgplot/pgplot-5.2.2-r7.ebuild
new file mode 100644
index 00000000000..793ce9da593
--- /dev/null
+++ b/sci-libs/pgplot/pgplot-5.2.2-r7.ebuild
@@ -0,0 +1,173 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit eutils fortran-2 toolchain-funcs
+
+MY_P="${PN}${PV//.}"
+
+DESCRIPTION="FORTRAN/C device-independent scientific graphic library"
+HOMEPAGE="http://www.astro.caltech.edu/~tjp/pgplot/";
+SRC_URI="ftp://ftp.astro.caltech.edu/pub/pgplot/${MY_P}.tar.gz";
+
+SLOT="0"
+LICENSE="free-noncomm"
+KEYWORDS="~amd64 ~arm ~ia64 ~ppc ~x86 ~amd64-linux ~x86-linux"
+IUSE="doc motif static-libs tk"
+
+RDEPEND="
+       media-libs/libpng:=
+       x11-libs/libX11:=
+       x11-libs/libXt:=
+       motif? ( x11-libs/motif:= )
+       tk? ( dev-lang/tk:= )"
+DEPEND="${RDEPEND}
+       doc? ( virtual/latex-base )"
+
+S="${WORKDIR}/${PN}"
+
+PATCHES=(
+       "${FILESDIR}"/${PN}-drivers.patch
+       "${FILESDIR}"/${PN}-makemake.patch
+       "${FILESDIR}"/${PN}-compile-setup.patch
+       "${FILESDIR}"/${PN}-headers.patch
+       "${FILESDIR}"/${PN}-libpng15.patch
+       "${FILESDIR}"/${PN}-tk86.patch
+)
+
+src_prepare() {
+       default
+       # gfortran < 4.3 does not compile gif, pp and wd drivers
+       if [[ $(tc-getFC) == *gfortran* ]] &&
+               [[ $(gcc-major-version)$(gcc-minor-version) -lt 43 ]] ; then
+               ewarn "Warning!"
+               ewarn "gfortran < 4.3 selected: does not compile all drivers"
+               ewarn "disabling gif, wd, and ppd drivers"
+               ewarn "if you want more drivers, use gfortran >= 4.3"
+               sed -e 's/GIDRIV/! GIDRIV/g' \
+                       -e 's/PPDRIV/! GIDRIV/g' \
+                       -e 's/WDDRIV/! GIDRIV/g' \
+                       -i drivers.list || die "sed drivers failed"
+       fi
+
+       # fix pointers for 64 bits
+       if use amd64 || use ia64; then
+               sed -e 's/INTEGER PIXMAP/INTEGER*8 PIXMAP/g' \
+                       -i drivers/{gi,pp,wd}driv.f || die "sed 64bits failed"
+       fi
+
+       cp sys_linux/g77_gcc.conf local.conf
+
+       sed -e "s:FCOMPL=.*:FCOMPL=\"$(tc-getFC)\":g" \
+               -e "s:CCOMPL=.*:CCOMPL=\"$(tc-getCC)\":g" \
+               -i local.conf || die "sed flags failed"
+
+       if [[ "$(tc-getFC)" = if* ]]; then
+               sed -e 's/-Wall//g' \
+                       -e 's/TK_LIBS="/TK_LIBS="-nofor-main /' \
+                       -i local.conf || die "sed drivers failed"
+       fi
+
+       sed -e "s:/usr/local/pgplot:${EPREFIX}/usr/$(get_libdir)/pgplot:g" \
+               -e "s:/usr/local/bin:${EPREFIX}/usr/bin:g" \
+               -i src/grgfil.f makehtml maketex || die "sed path failed"
+
+       use motif && sed -i -e '/XMDRIV/s/!//' drivers.list
+       use tk && sed -i -e '/TKDRIV/s/!//' drivers.list
+}
+
+src_configure() {
+       ./makemake . linux
+       # post makefile creation prefix hack
+       sed -i -e "s|/usr|${EPREFIX}/usr|g" makefile || die
+}
+
+src_compile() {
+       emake \
+               CFLAGS="${CFLAGS} -fPIC" \
+               FFLAGS="${FFLAGS} -fPIC" \
+               shared cpg-shared pgxwin_server pgdisp pgplot.doc
+
+       use tk && emake CFLAGS="${CFLAGS} -fPIC" libtkpgplot.so
+       use motif && emake CFLAGS="${CFLAGS} -fPIC" libXmPgplot.so
+
+       emake -j1 clean
+       use static-libs && emake all cpg
+
+       if use doc; then
+               export VARTEXFONTS="${T}/fonts"
+               emake pgplot.html pgplot-routines.tex
+               pdflatex pgplot-routines.tex
+               pdflatex pgplot-routines.tex
+       fi
+
+       # this just cleans out not needed files
+       emake -j1 clean
+}
+
+src_test() {
+       # i can go to 16
+       local i j
+       for i in 1 2 3; do
+               emake pgdemo${i}
+               # j can also be LATEX CPS...
+               for j in NULL PNG PS CPS LATEX; do
+                       local testexe=./test_${j}_${i}
+                       echo "LD_LIBRARY_PATH=. ./pgdemo${i} <<EOF" > ${testexe}
+                       echo "/${j}" >> ${testexe}
+                       echo "EOF" >> ${testexe}
+                       sh ${testexe} || die "test ${i} failed"
+               done
+       done
+}
+
+src_install() {
+       insinto /usr/$(get_libdir)/pgplot
+       doins grfont.dat grexec.f *.inc rgb.txt
+       echo "PGPLOT_FONT=${EPREFIX%/}/usr/$(get_libdir)/pgplot/grfont.dat" >> 
99pgplot
+       doenvd 99pgplot
+
+       dolib.so libpgplot.so*
+       dobin pgxwin_server pgdisp
+
+       # C binding
+       insinto /usr/include
+       doins cpgplot.h
+       dolib.so libcpgplot.so*
+
+       if use motif; then
+               insinto /usr/include
+               doins XmPgplot.h
+               dolib.so libXmPgplot.so*
+       fi
+
+       if use tk; then
+               insinto /usr/include
+               doins tkpgplot.h
+               dolib.so libtkpgplot.so*
+       fi
+
+       use static-libs && dolib.a lib*pgplot.a
+
+       # minimal doc
+       dodoc aaaread.me pgplot.doc
+       newdoc pgdispd/aaaread.me pgdispd.txt
+
+       if use doc; then
+               dodoc cpg/cpgplot.doc applications/curvefit/curvefit.doc 
pgplot.html
+               dodoc pgplot-routines.pdf pgplot-routines.tex
+               insinto /usr/share/doc/${PF}/examples
+               doins  examples/* cpg/cpgdemo.c
+               insinto /usr/share/doc/${PF}/applications
+               doins -r applications/*
+               if use motif; then
+                       insinto /usr/share/doc/${PF}/pgm
+                       doins pgmf/* drivers/xmotif/pgmdemo.c
+               fi
+               if use tk; then
+                       insinto /usr/share/doc/${PF}/pgtk
+                       doins drivers/xtk/pgtkdemo.*
+               fi
+       fi
+}

Reply via email to