summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 5a1fa8ea3516ed9a84b19714ed31a1e8bfa5c4e6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# Contributor: AstroFloyd  < AstroFloyd [at] gmail [dt] com >
# Contributor: Julien Morin <morin.jul@gmail.com>
# Contributor: Stefan Husmann <stefan-husmann@t-online.de>

pkgname=pgplot
pkgver=5.2.2
pkgrel=8
pkgdesc="Fortran- or C-callable, device-independent graphics package for making simple scientific graphs."
url="http://www.astro.caltech.edu/~tjp/pgplot/"
license=('custom')
options=(!makeflags)
arch=('i686' 'x86_64')
makedepends=('gcc-fortran')
depends=('libpng' 'libx11')
changelog=ChangeLog
source=(ftp://ftp.astro.caltech.edu/pub/pgplot/${pkgname}522.tar.gz pndriv.c.patch)
md5sums=('e8a6e8d0d5ef9d1709dfb567724525ae' '25535f059b2e39ea44f93c24a41abacd')

build() {
  cd $srcdir/$pkgname
  sed -i '23i#include <string.h>' sys/grfileio.c
  sed -i '23i#include <unistd.h>' sys/grfileio.c
  sed -i '10i#include <string.h>' sys/grtermio.c
  sed -i '10i#include <fcntl.h>' sys/grtermio.c
  sed -i '10i#include <unistd.h>' sys/grtermio.c
  sed -i 's/! CGDRIV/CGDRIV/' drivers.list
  sed -i 's/! LXDRIV/LXDRIV/' drivers.list
  #sed -i 's/! PNDRIV/PNDRIV/' drivers.list
  sed -i 's/! PSDRIV/PSDRIV/' drivers.list
  sed -i 's/! TTDRIV 5/TTDRIV 5/' drivers.list
  sed -i 's/! XWDRIV/XWDRIV/1' drivers.list
  patch -p0 -i "${srcdir}"/pndriv.c.patch

  ./makemake . linux g77_gcc
  sed -i 's=pndriv.o : ./png.h ./pngconf.h ./zlib.h ./zconf.h=#pndriv.o : ./png.h ./pngconf.h ./zlib.h ./zconf.h=' makefile
  make FCOMPL=gfortran SHARED_LIB_LIBS="-lpng -lz -lX11" all cpg || return 1
}

package() {
  cd $srcdir/$pkgname
  install -D -m644 libpgplot.a $pkgdir/usr/lib/libpgplot.a
  install -D -m755 libpgplot.so $pkgdir/usr/lib/libpgplot.so
  install -D -m644 grfont.dat  $pkgdir/usr/lib/grfont.dat
  install -D -m644 rgb.txt $pkgdir/usr/lib/rgb.txt
  install -D -m755 pgxwin_server $pkgdir/usr/bin/pgxwin_server
  install -D -m644 libcpgplot.a $pkgdir/usr/lib/libcpgplot.a
  install -D -m644 cpgplot.h $pkgdir/usr/include/cpgplot.h
  install -D -m644 copyright.notice $pkgdir/usr/share/licenses/custom/$pkgname/copyright.notice
}