summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 41d4e37a59744a4ef212945af9ff80929d37aee0 (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
# Maintainer: Vekhir <vekhir AT yahoo DOT com>
# Contributor: Jiuyang Liu <liujiuyang1994@gmail.com>
# Contributor: Paulo Matias <matias@ufscar.br>

pkgname=bsc
pkgver=2024.07
pkgrel=1
pkgdesc='Bluespec Compiler (BSC)'
arch=('x86_64')
url='https://github.com/B-Lang-org/bsc'
license=('BSD-3-Clause')
depends=('haskell-old-time' 'haskell-syb' 'haskell-regex-compat' 'haskell-split')
makedepends=('git' 'gperf' 'ghc' 'tcl' 'texlive-latexextra' 'texlive-fontsextra')
checkdepends=('dejagnu' 'iverilog' 'pkg-config' 'systemc' 'tcsh' 'time')
optdepends=('tcl: bluesim and bluetcl')
source=("bsc-${pkgver}::https://github.com/B-Lang-org/bsc/archive/refs/tags/${pkgver}.tar.gz"
        "https://github.com/B-Lang-org/bsc/releases/download/${pkgver}/yices-src-for-bsc-${pkgver}.tar.gz")
sha256sums=('dd3a217ab17e383401bc52a3437fe2fdd02f9bb67e84295dcb872694ce4b4c85'
            'a7211d089be68303983cc644b70edaae8efab529ff63fd8670a4f20119888781')
_prefix="/opt/bsc"

prepare() {
  ls -la
  ls -la bsc-${pkgver}/src/vendor/yices/v2.6/yices2
  ls -la src
  ls -la src/vendor
  ls -la src/vendor/yices
  ls -la src/vendor/yices/v2.6
  ls -la src/vendor/yices/v2.6/yices2
  cp -r src/vendor/yices/v2.6/yices2 bsc-${pkgver}/src/vendor/yices/v2.6
  ls -la bsc-${pkgver}/src/vendor/yices/v2.6/yices2
}

build(){
  # prevent static lib mangling with LTO (pacman#150, bsc#704)
  CXXFLAGS+=" -ffat-lto-objects"

  cd "$srcdir/bsc-${pkgver}"
  make GHC="ghc -dynamic" GHCJOBS=4 GHCRTSFLAGS='+RTS -A128m -RTS' install-src
  make install-doc
}

check() {
  cd "$srcdir/bsc-${pkgver}/testsuite"
  make check
}

package() {
  cd "$srcdir/bsc-${pkgver}"
  install -d "${pkgdir}${_prefix}"
  cp -dr --preserve=mode,timestamp ./inst/* "${pkgdir}${_prefix}"

  install -d "${pkgdir}/usr/bin"
  local _prog
  for _prog in bsc bluetcl; do
    sed -i "s,^BINDIR=.*$,BINDIR=${_prefix}/bin," "${pkgdir}${_prefix}/bin/${_prog}"
    ln -s "${_prefix}/bin/${_prog}" "${pkgdir}/usr/bin"
  done

  install -Dm644 COPYING "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"

  install -d "${pkgdir}/usr/share/vim/vimfiles"
  cp -dr --preserve=mode,timestamp ./util/vim/{ftdetect,indent,syntax} "${pkgdir}/usr/share/vim/vimfiles"
}