summaryrefslogtreecommitdiffhomepage
path: root/trunk/PKGBUILD
blob: 118b5c6958ea315cbe3f735616a43d27239c5b3b (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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# Maintainer: Ronald van Haren <ronald.archlinux.org>
# Contributor: damir <damir@archlinux.org>
# Contributor: Tom Newsom <Jeepster@gmx.co.uk>

pkgbase=gnuplot
pkgname=(gnuplot-nogtk gnuplot-nogui)
pkgver=5.2.7
pkgrel=1
pkgdesc="Plotting package which outputs to X11, PostScript, PNG, GIF, and others" 
arch=('x86_64')
url="http://www.gnuplot.info" 
license=('custom') 
depends=('readline' 'gd' 'cairo' 'libjpeg' 'lua' 'qt5-svg' 'gnutls' 'libcerf') 
makedepends=('texinfo' 'texlive-core' 'emacs' 'texlive-latexextra' 'qt5-tools')
source=("https://downloads.sourceforge.net/sourceforge/$pkgbase/$pkgbase-$pkgver.tar.gz"
        "lua53_compat.patch")
sha1sums=('fcd54ed0b1e5d7dda8151602b7198f0040462c70'
          '9005fa9e4da91ceedb8ccd1d761866e7b064f8b1')

prepare() {
  cd ${pkgbase}-${pkgver}

  # fix default source location; use the GDFONTPATH variable to modify at runtime
  sed -i 's|/usr/X11R6/lib/X11/fonts/truetype|/usr/share/fonts/TTF|' src/variable.c

  sed -i -e 's|/usr/X11R6/lib/X11/fonts/Type1|/usr/share/fonts/Type1|' \
  -e 's|$(X11ROOT)/X11R6/lib/X11/fonts/Type1|$(X11ROOT)/usr/share/fonts/Type1|' \
  src/variable.c

  patch -p1 < "$srcdir"/lua53_compat.patch

  mkdir build
  mkdir build_nogui
}

build() {
  pushd ${pkgbase}-${pkgver}/build

  MAKEINFO=/usr/bin/makeinfo  ../configure \
              --prefix=/usr \
              --libexecdir=/usr/bin \
              --with-gihdir=/usr/share/gnuplot \
              --with-readline=gnu \
              --with-bitmap-terminals \
              --enable-qt \
              --disable-wxwidgets \
              --without-lisp-files \
              --with-texdir=/usr/share/texmf/tex/latex/gnuplot
  make pkglibexecdir=/usr/bin

  popd
  pushd ${pkgbase}-${pkgver}/build_nogui

  MAKEINFO=/usr/bin/makeinfo  ../configure \
              --prefix=/usr \
              --libexecdir=/usr/bin \
              --with-gihdir=/usr/share/gnuplot \
              --with-readline=gnu \
              --with-bitmap-terminals \
              --with-qt=no \
              --disable-wxwidgets \
              --without-lisp-files \
              --with-texdir=/usr/share/texmf/tex/latex/gnuplot
  make pkglibexecdir=/usr/bin
}

package_gnuplot-nogtk() {
  pkgname=gnuplot-nogtk
  conflicts=('gnuplot')
  privides=('gnuplot')

  cd ${pkgbase}-${pkgver}/build
  make pkglibexecdir=/usr/bin DESTDIR="${pkgdir}" install

  install -Dm644 ../Copyright "${pkgdir}/usr/share/licenses/$pkgname/Copyright"

  rm -f "${pkgdir}/usr/share/texmf-dist/ls-R"
}

package_gnuplot-nogui() {
  pkgname=gnuplot-nogui
  conflicts=('gnuplot')
  depends=('readline' 'gd' 'cairo' 'libjpeg' 'lua' 'gnutls' 'libcerf' 'pango')

  cd ${pkgbase}-${pkgver}/build_nogui
  make pkglibexecdir=/usr/bin DESTDIR="${pkgdir}" install

  install -Dm644 ../Copyright "${pkgdir}/usr/share/licenses/$pkgname/Copyright"

  rm -f "${pkgdir}/usr/share/texmf-dist/ls-R"
}