git » ngspice.git » main » tree

[main] / PKGBUILD

# Maintainer: George Rawlinson <grawlinson@archlinux.org>
# Contributor: Kyle Keen <keenerd@gmail.com>
# Contributor: Abhishek Dasgupta <abhidg@gmail.com>
# Contributor: Jason Taylor <jftaylor21@gmail.com>
# Contributor: Luis Henrique <lmello.009@gmail.com>

pkgname=ngspice
pkgver=42
pkgrel=1
pkgdesc='Mixed-level/Mixed-signal circuit simulator based on Spice3f5, Ciber1b1, and Xspice'
arch=('x86_64' 'armv7h')
url='https://ngspice.sourceforge.net'
license=('BSD')
depends=(
  'gcc-libs'
  'libedit'
  'libxaw'
)
source=(
  "$pkgname-$pkgver.tar.gz::https://downloads.sourceforge.net/project/$pkgname/ng-spice-rework/$pkgver/$pkgname-$pkgver.tar.gz"
  "https://ngspice.sourceforge.net/docs/ngspice-$pkgver-manual.pdf"
)
sha512sums=('37fbabd8e537ac8efe02731e54a0c586588e48010a8022daeeb53442b8ebdf3f1ea866e8d6eb180c130cabba2ae6675bc8741208ad2a20091d2c753eec9b4d55'
            '9251231fb3e33e5961e10cd2d2317003bc3d72f211224f7db743fe6f80f20ef7f25daad84810b3869239d248a04e97dd6fa375416c6b0180370904fb5e5cdd74')
b2sums=('c872f323bb8c80c42ebd1fc2c8ab9dfc3ad63e8906e846e202c4745bcd5a21d46a1330e389a1b280c48e41e5863fc1019514ebbe6455870e34649e95d3643284'
        '9a15b4fa200f43faaf92d9c36a10d101ac708138837089f3ca7fda81ce484be200dca433725bc0d10fd231562307f1634ad1ef396f4f7a3c55c99a35b2c4af95')

build() {
  cd "$pkgname-$pkgver"

  local _common_flags=(
    --prefix=/usr
    --mandir=/usr/share/man
    --infodir=/usr/share/info
    --with-readline=no
    --enable-xspice
    --enable-cider
    --enable-openmp
    --disable-debug
  )

  # FS#45230, create so lib
  # shared lib sets flags and modifies headers, needs dedicated pass
  ./configure \
    "${_common_flags[@]}" \
    --with-ngshared
  make

  ./configure "${_common_flags[@]}"
  make
}

package() {
  cd "$pkgname-$pkgver"

  make DESTDIR="$pkgdir" install

  # license
  install -vDm644 COPYING "$pkgdir/usr/share/licenses/$pkgname/LICENSE"

  # documentation
  install -vDm644  "$srcdir/ngspice-$pkgver-manual.pdf" "$pkgdir/usr/share/doc/$pkgname/manual.pdf"

  # shared library
  local _sover="0.0.9"
  install -vDm755 "src/.libs/libngspice.so.$_sover" "$pkgdir/usr/lib/libngspice.so.$_sover"
  ln -s "libngspice.so.$_sover" "$pkgdir/usr/lib/libngspice.so.0"
  ln -s "libngspice.so.$_sover" "$pkgdir/usr/lib/libngspice.so"

  # FS#70563, probably remove on v35
  install -Dm644 ngspice.pc "$pkgdir/usr/lib/pkgconfig/ngspice.pc"
  install -Dm644 src/include/ngspice/sharedspice.h "$pkgdir/usr/include/ngspice/sharedspice.h"
}