# Maintainer: Coelacanthus <uwu@coelacanthus.name>
# Contributor: Zes4Null <rjw1248[at]hotmail[dot]com>
# Contributor: Philip <philip1731 protonmail ch>

pkgname=qucs-s
pkgver=26.1.1
pkgrel=1
pkgdesc="A spin-off of Qucs that supports other free SPICE circuit simulators like ngspice with the same Qucs GUI"
arch=('x86_64' 'i686')
url="https://ra3xdh.github.io"
license=('GPL-2.0-or-later')
depends=(
    'glibc'
    'gcc-libs'
    'sh'
    'qt6-base'
    'qt6-svg'
    'qt6-charts'
    'ngspice'
    'python'
    'python-numpy'
    'python-matplotlib'
    'hicolor-icon-theme'
)
makedepends=(
    'cmake'
    'qt6-tools'
    'ninja'
    'gperf'
    'dos2unix'
)
optdepends=(
    'qucs: Qucsator simulation backend'
    'xyce-serial: SPICE-compatible simulation backend'
    'spiceopus: general purpose simulation backend for optimization loops'
    'openvaf: compiler for Verilog-A devices support'
    'octave: high-level language for post-simulation data processing'
)
source=(https://github.com/ra3xdh/qucs_s/releases/download/$pkgver/$pkgname-$pkgver.tar.gz)
b2sums=('cd2952e45da3e7b15e78b259685a0882f722c3f2be0322c97a026d21914f09da1a933ec2b492f2fa772da9b4c494292e7de6bd14ee4b40630a4c887b6da3f094')

build() {
    cmake -S "$pkgname-$pkgver" -B build \
        -G Ninja \
        -DCMAKE_INSTALL_PREFIX=/usr \
        -DWITH_QT6=ON
        
    cmake --build build
}

package() {
    DESTDIR="$pkgdir" cmake --install build
}

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