summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 6d7a7e7d76b8440ec09323f6fdd81d1591d68dba (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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
# Maintainer: serkho <sergey.khorev@gmail.com>
# adopted from reduce-algebra by quasi <quasi@aur.archlinux.org>
# Contributor: wangjiezhe <wangjiezhe AT yandex DOT com>

pkgbase=reduce-svn
_pkgbase=reduce
pkgname=(reduce-csl-svn reduce-psl-svn reduce-common-svn reduce-addons-svn)
pkgver=20170305.3943
pkgrel=1
arch=('i686' 'x86_64')
url="http://reduce-algebra.sourceforge.net/"
license=('BSD')
groups=('science')
makedepends=('subversion' 'texlive-htmlxml' 'imagemagick') # for documentation
depends=('ncurses' 'libxext' 'libxrandr' 'libxft' 'freetype2' 'expat' 'libx11' 'libxcursor')
options=('!ccache')
source=("${_pkgbase}::svn://svn.code.sf.net/p/reduce-algebra/code/trunk"
        'csl' 'redcsl' 'redpsl'
        'redcsl.desktop' 'qreduce.desktop'
        'qreduce-file-location.patch')
sha256sums=('SKIP'
            '5a6065ef28bc64e38cc5c7e9c3ce5145c273e3ea7e7c073d8417a4d94fa6bafe'
            '9724e19545f181f6456e30bc1eff837cb708678f162a939b45f23627ad50c46c'
            '3d383ac93cb831a5a142395e76a9c275dc7e49dc150763610869e56e5a795e65'
            '22c7c510fba9ec2bcb8f476af0c96055a915a31f34c01ece43ff21d0dfa9dd0d'
            '9dce4d401c759c933ebc3ffbe0eff86150f04829ca10a9fd6f6faba4498f47ad'
            '5896e2252dd87b764143dbf8d9889e289811a3020dd019386debee5bb02a142d')

pkgver() {
  cd ${srcdir}/${_pkgbase}
  svn info | awk '/Revision/{r=$2}/Date/{gsub(/-/,"");d=$4}END{print d"."r}'
}

prepare() {
  rm -rf "${srcdir}/${_pkgbase}-build"
  svn export "${srcdir}/${_pkgbase}" "${srcdir}/${_pkgbase}-build"
  #svn export --force "${srcdir}/${_pkgbase}" "${srcdir}/${_pkgbase}-build"

  cd "${srcdir}/${_pkgbase}-build"
  patch -Np0 -i "${srcdir}/qreduce-file-location.patch"
  sed -i 's/redcsl/redpsl/' generic/qreduce/{qrdefaults,qrmodel}.py

  sed -i 's/python-config/python2-config/g' generic/libreduce/src/Makefile.in
}

build() {
  cd "${srcdir}/${_pkgbase}-build"
  ./configure --with-csl
  ./configure --with-psl
  make
  # (cd generic/redfront && make)
  (cd generic/casefold && cc casefold.c -o casefold)
  (cd generic/libreduce && make PYTHON=/usr/bin/python2)
  (cd generic/emacs && makeinfo reduce-ide.texinfo)
}

package_reduce-csl-svn() {
  depends=('reduce-common')
  provides=('reduce-csl')
  conflicts=('reduce-csl' 'reduce-algebra')
  pkgdesc='REDUCE Computer Algebra System -- CSL version'
  #pkgdesc="A portable general-purpose computer algebra system (CSL version)"

  install -Dm755 redcsl ${pkgdir}/usr/bin/redcsl
  install -Dm755 csl ${pkgdir}/usr/bin/csl
  install -Dm644 redcsl.desktop ${pkgdir}/usr/share/applications/redcsl.desktop

  cd "${srcdir}/${_pkgbase}-build"

  install -Dm644 cslbuild/generated-c/reduce.img ${pkgdir}/usr/lib/reduce/cslbuild/csl/reduce.img
  install -Dm644 cslbuild/generated-c/csl.img ${pkgdir}/usr/lib/reduce/cslbuild/csl/csl.img

  install -d ${pkgdir}/usr/lib/reduce/cslbuild/csl
  install -d ${pkgdir}/usr/share/reduce/

  install -t ${pkgdir}/usr/lib/reduce/cslbuild/csl/ cslbuild/${CARCH}-unknown-linux-gnu/csl/{csl,reduce}

  cp -r cslbuild/${CARCH}-unknown-linux-gnu/csl/reduce.resources ${pkgdir}/usr/lib/reduce/cslbuild/csl/
  cp -r cslbuild/${CARCH}-unknown-linux-gnu/csl/reduce.fonts ${pkgdir}/usr/share/reduce/fonts

  install -Dm644 debianbuild/reduce/debian/copyright ${pkgdir}/usr/share/doc/reduce-csl/copyright
  install -Dm644 debianbuild/reduce/debian/redcsl.1 ${pkgdir}/usr/share/man/man1/redcsl.1

  cd "${pkgdir}/usr/lib/reduce/cslbuild/csl"
  ln -s ../../../../share/reduce/fonts reduce.fonts

  cd "${pkgdir}/usr/share/reduce"
  ln -s ../../lib/reduce/cslbuild
}

package_reduce-psl-svn() {
  depends=('reduce-common')
  provides=('reduce-psl')
  conflicts=('reduce-psl')
  pkgdesc='REDUCE Computer Algebra System -- PSL version'

  install -D redpsl ${pkgdir}/usr/bin/redpsl

  cd "${srcdir}/${_pkgbase}-build"

  install -d ${pkgdir}/usr/lib/reduce/pslbuild
  install -d ${pkgdir}/usr/share/reduce

  cp -r pslbuild/${CARCH}-unknown-linux-gnu/{psl,red} ${pkgdir}/usr/lib/reduce/pslbuild/

  install -Dm644 debianbuild/reduce/debian/copyright ${pkgdir}/usr/share/doc/reduce-psl/copyright
  install -Dm644 debianbuild/reduce/debian/redpsl.1 ${pkgdir}/usr/share/man/man1/redpsl.1

  cd "${pkgdir}/usr/share/reduce"
  ln -s ../../lib/reduce/pslbuild
}

package_reduce-common-svn() {
  provides=('reduce-common')
  conflicts=('reduce-common')
  pkgdesc='REDUCE Computer Algebra System -- common files'

  cd "${srcdir}/${_pkgbase}-build"

  install -d ${pkgdir}/usr/share/reduce/doc

  cp -r packages ${pkgdir}/usr/share/reduce/

  install -Dm644 debianbuild/reduce/debian/copyright ${pkgdir}/usr/share/doc/reduce-common/copyright

  cp -r doc/{manual,manual2,misc,primers,util} ${pkgdir}/usr/share/reduce/doc

  install -Dm644 generic/qreduce/Bumblebee.png ${pkgdir}/usr/share/icons/redcsl.png
}

package_reduce-addons-svn() {
  provides=('reduce-addons')
  conflicts=('reduce-addons')
  pkgdesc='Useful addons for the REDUCE Computer Algebra System'
  optdepends=(
    'reduce-csl: REDUCE Computer Algebra System'
    'reduce-psl: REDUCE Computer Algebra System'
    'python2-pyside: for QT-based GUI'
  )

  install -Dm644 qreduce.desktop ${pkgdir}/usr/share/applications/qreduce.desktop

  cd "${srcdir}/${_pkgbase}-build"

  install -d ${pkgdir}/usr/lib/reduce
  install -d ${pkgdir}/usr/share/doc/reduce-addons
  install -d ${pkgdir}/usr/share/emacs/site-lisp/reduce

  # install -D generic/redfront/${CARCH}-unknown-linux-gnu/redfront/redfront ${pkgdir}/usr/bin/redfront
  # install -Dm644 generic/redfront/src/redfront.1 ${pkgdir}/usr/share/man/man1/redfront.1

  install -D generic/breduce/breduce ${pkgdir}/usr/bin/breduce
  install -Dm644 generic/breduce/breduce.1 ${pkgdir}/usr/share/man/man1/breduce.1
  install -t ${pkgdir}/usr/share/doc/reduce-addons generic/breduce/breduce.{bbl,pdf,tex}

  install -D generic/casefold/casefold ${pkgdir}/usr/bin/casefold
  install -Dm644 generic/casefold/README ${pkgdir}/usr/share/doc/reduce-addons/README.casefold

  install -t ${pkgdir}/usr/lib/reduce generic/libreduce/${CARCH}-unknown-linux-gnu/{libreduce.so,RedPy.so}

  cp -r generic/qreduce ${pkgdir}/usr/share/

  install -t ${pkgdir}/usr/share/emacs/site-lisp/reduce generic/emacs/reduce-{mode,run}.el
  install -Dm644 generic/emacs/reduce-ide.texinfo ${pkgdir}/usr/share/doc/reduce-addons/reduce-ide.texinfo
  install -Dm644 generic/emacs/README ${pkgdir}/usr/share/doc/reduce-addons/README.emacs
  install -Dm644 generic/emacs/reduce-ide.info ${pkgdir}/usr/share/info/reduce-ide.info

  cd "${pkgdir}/usr/bin"
  # ln -s redfront rfcsl
  # ln -s redfront rfpsl
  ln -s ../share/qreduce/qreduce.py qreduce

  # cd "${pkgdir}/usr/share/man/man1"
  # ln -s redfront.1 rfcsl.1
  # ln -s redfront.1 rfpsl.1

  cd "${pkgdir}/usr/share/qreduce"
  ln -s ../../lib/reduce/RedPy.so
}

# vim:set ts=2 sw=2 et: