summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: c52ccdb18c9adbae3e1f1bdd45a4dbc175ce6146 (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
# Maintainer: Eugen Kuksa <eugenk@cs.uni-bremen.de>

pkgname=hets-server
pkgver=0.99_1484075143
pkgrel=1

pkgdesc="A parsing, static analysis and proof management tool incorporating various provers and different specification languages."

url="http://hets.eu"
arch=('i686' 'x86_64')
license=('custom:hets-license')
depends=('hets-commons' 'hets-lib' 'tcl' 'tk' 'ncurses' 'cairo' 'glib2' 'gettext' 'fontconfig' 'libglade')
optdepends=('spass' 'eprover' 'darwin' 'pellet' 'isabelle')
makedepends=('ghc>=7.8.4')
provides=('hets-server')
conflicts=('hets-server-bin')
_commit='b39edff7b191f41fb4b7268e00dd0289965ca9bf'
source=("${pkgname}::git+https://github.com/spechub/Hets.git#commit=${_commit}")
sha256sums=('SKIP')

_executable_name='hets-server'

build() {
  cd $srcdir/$pkgname
  make hets_server.bin
}

package() {
  cd $srcdir/$pkgname
  make install-hets_server PREFIX="$pkgdir/usr"

  # Patch the header of the wrapper script to include the (only working) locale,
  # to use a shell that is certainly installed and to set the correct basedir.
	local wrapper_script="bin/$_executable_name"
  pushd "$pkgdir/usr" > /dev/null
    # Remove useless files that were added by the makefile's sed invocation
    rm -f "share/man/man1/hets.1e"
    rm -f "share/man/man1/hets.1-e"

    echo "#!/bin/bash"                  > "$wrapper_script.tmp"
    echo ""                            >> "$wrapper_script.tmp"
    echo "export LANG=en_US.UTF-8"     >> "$wrapper_script.tmp"
    echo "export LANGUAGE=en_US.UTF-8" >> "$wrapper_script.tmp"
    echo "export LC_ALL=en_US.UTF-8"   >> "$wrapper_script.tmp"
    echo ""                            >> "$wrapper_script.tmp"
    echo "BASEDIR=\"/usr\""            >> "$wrapper_script.tmp"
    echo "PROG=\"$_executable_name\""  >> "$wrapper_script.tmp"

    # replace the script header with the above one
		sed -ie "/\/bin\/ksh93/,/PROG=/ d" "$wrapper_script"
		cat "$wrapper_script" >> "$wrapper_script.tmp"
		cat "$wrapper_script.tmp" > "$wrapper_script"
    rm -f "${wrapper_script}.tmp"
    rm -f "${wrapper_script}e"
    rm -f "${wrapper_script}-e"
  popd > /dev/null
}