Username: Password: Remember me
# Maintainer: AlmAck <gluca86 [at] gmail [dot] com>
# Arch Maintainer: Kyle Keen <keenerd@gmail.com>
 
pkgname=kicad
pkgver=5.1.4
pkgrel=1
pkgdesc="Electronic schematic and printed circuit board (PCB) design tools"
arch=('x86_64')
#url="http://iut-tice.ujf-grenoble.fr/kicad/"
url="http://kicad-pcb.org/"
license=('GPL')
#wxgtk3 is still not supported yet (FS#54839)
depends=('wxgtk' 'python3' 'boost-libs' 'glew' 'curl' 'glm' 'ngspice' 'opencascade' 'python3-wxpython')
# the AUR git package uses python3 but this release does not support it
# can ngspice/opencascade be an optdep?
# opencascade vs community edition?
makedepends=('cmake' 'zlib' 'mesa' 'boost' 'swig')
optdepends=('kicad-library: for footprints and symbols'
            'kicad-library-3d: for 3d models of components')
source=("https://launchpad.net/kicad/5.0/$pkgver/+download/kicad-$pkgver.tar.xz"
        "kicad-i18n.$pkgver.tgz::https://github.com/KiCad/kicad-i18n/archive/$pkgver.tar.gz")
sha512sums=('ce0efb740686eafdbbdf8cda68ad800a70c8991302f984be3db4bbdb3bfafe1634871ec6ea26bb6854a417db6336880e5a043dc022ef8126c0e98abc90671337'
            '28993e0021ebd7f3c0e7e21b609f57b85b95c74c33d65d30e707c5194b340dbb46142a6250a19256c927dc2f0600a7e1de723aefa9e74b2761ebc7c380143527')
 
prepare() {
  cd "$srcdir/kicad-$pkgver"
  #find -name '*.py' -exec sed -i '1s/python$/&2/' {} +
}
 
build() {
  cd "$srcdir/kicad-$pkgver"
 
  mkdir -p build/Release
  cd build/Release
  cmake ../.. -DCMAKE_BUILD_TYPE=Release    \
              -DCMAKE_INSTALL_PREFIX=/usr   \
              -DCMAKE_INSTALL_LIBDIR=lib    \
              -DKICAD_USE_OCE=OFF           \
              -DKICAD_USE_OCC=ON            \
              -DKICAD_SCRIPTING=ON          \
              -DKICAD_SCRIPTING_PYTHON3=ON \
              -DKICAD_SCRIPTING_MODULES=ON  \
              -DKICAD_SCRIPTING_WXPYTHON=ON \
              -DKICAD_SCRIPTING_ACTION_MENU=ON \
              -DKICAD_SCRIPTING_WXPYTHON_PHOENIX=ON \
              -DwxWidgets_CONFIG_EXECUTABLE=/usr/bin/wx-config \
              -DBUILD_GITHUB_PLUGIN=ON
  make
 
  cd "$srcdir/kicad-i18n-$pkgver"
  mkdir -p build/Release
  cd build/Release
  cmake ../.. -DCMAKE_INSTALL_PREFIX=/usr
  make
}
 
package() {
  cd "$srcdir/kicad-$pkgver/build/Release"
 
  make DESTDIR="$pkgdir" install
 
  # copy updated linux icons
  #cp -r -n "$srcdir/$pkgname-icons/resources/linux/mime/icons" "$pkgdir/usr/share/"
 
  cd "$srcdir/kicad-i18n-$pkgver/build/Release"
  make DESTDIR="$pkgdir" install
}