summarylogtreecommitdiffstats
path: root/PKGBUILD.in
diff options
context:
space:
mode:
authordx-mon2020-10-14 00:01:19 +0100
committerdx-mon2020-10-14 00:01:19 +0100
commitd7c3688a6521ba15142b9a66bd5bf91a3f4fdbd8 (patch)
tree856e6643c978ddb183f30bc1ca5fdc5cf00f5550 /PKGBUILD.in
parenta51f0ac21fa56dc6845476f90723463529b02642 (diff)
downloadaur-d7c3688a6521ba15142b9a66bd5bf91a3f4fdbd8.tar.gz
Bump to KiCAD 5.99.0-4027-g505d764f2 and add update automation
Diffstat (limited to 'PKGBUILD.in')
-rw-r--r--PKGBUILD.in102
1 files changed, 102 insertions, 0 deletions
diff --git a/PKGBUILD.in b/PKGBUILD.in
new file mode 100644
index 00000000000..5b4f39d6bff
--- /dev/null
+++ b/PKGBUILD.in
@@ -0,0 +1,102 @@
+# Maintainer: Rachel Mant <dx-mon@users.sourceforge.net>
+
+pkgname=kicad-nightly
+pkgver=@KICAD_VERSION@
+pkgrel=1
+pkgdesc='Electronic schematic and printed circuit board (PCB) design tools'
+arch=('x86_64')
+url='http://kicad-pcb.org/'
+license=('GPL')
+depends=('wxgtk3' 'python' 'boost-libs' 'glew' 'curl' 'glm' 'ngspice' 'opencascade' 'python-wxpython')
+makedepends=('git' 'cmake' 'zlib' 'mesa' 'boost' 'swig')
+optdepends=(
+ 'kicad-library: for footprints and symbols'
+ 'kicad-library-3d: for 3d models of components'
+)
+source=(
+ 'git+https://gitlab.com/kicad/code/kicad.git'#commit=@KICAD_HASH@
+ 'git+https://gitlab.com/kicad/code/kicad-i18n.git'#commit=@I18N_HASH@
+ 'kicad-nightly.env'
+)
+sha256sums=(
+ 'SKIP' 'SKIP'
+ 'fce26af6b9c181a99197bfc9bc6c778561ad55a375480f4d0d73bb34078b5d18'
+)
+
+pkgver()
+{
+ cd "$srcdir/kicad"
+ git describe --tags | sed -e 's/-/_/g'
+}
+
+build()
+{
+ cd "$srcdir/kicad"
+
+ mkdir build
+ cd build
+ cmake .. \
+ -DCMAKE_BUILD_TYPE=Release \
+ -DCMAKE_INSTALL_PREFIX=/usr/lib/kicad-nightly \
+ -DCMAKE_INSTALL_DATADIR=/usr/share/kicad-nightly \
+ -DCMAKE_INSTALL_DOCDIR=/usr/share/doc/kicad-nightly \
+ -DCMAKE_INSTALL_LIBDIR=/usr/lib/kicad-nightly/lib \
+ -DCMAKE_EXECUTABLE_SUFFIX=-nightly \
+ -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 \
+ -DKICAD_DATA=/usr/share/kicad-nightly \
+ -DwxWidgets_CONFIG_EXECUTABLE=/usr/bin/wx-config-gtk3 \
+ -DBUILD_GITHUB_PLUGIN=ON
+ make -j $(nproc)
+
+ cd "$srcdir/kicad-i18n"
+
+ mkdir build
+ cd build
+ cmake .. \
+ -DCMAKE_INSTALL_PREFIX=/usr/lib/kicad-nightly \
+ -DCMAKE_INSTALL_DATADIR=/usr/share/kicad-nightly \
+ -DCMAKE_INSTALL_DOCDIR=/usr/share/doc/kicad-nightly
+ make -j $(nproc)
+}
+
+package()
+{
+ cd "$srcdir/kicad/build"
+ make DESTDIR="$pkgdir" install
+
+ mkdir -p "$pkgdir/usr/share"
+ for prog in bitmap2component eeschema gerbview kicad pcbcalculator pcbnew; do
+ sed -i \
+ -e 's/^Exec=\([^ ]*\)\(.*\)$/Exec=\1-nightly\2/g' \
+ -e 's/^Icon=\(.*\)$/Icon=\1-nightly/g' \
+ -e 's/^Name=\(.*\)$/Name=\1 nightly/g' \
+ "$pkgdir/usr/lib/kicad-nightly/share/applications/$prog.desktop"
+ mv "$pkgdir/usr/lib/kicad-nightly/share/applications/$prog.desktop" \
+ "$pkgdir/usr/lib/kicad-nightly/share/applications/${prog}-nightly.desktop"
+ done
+ mv "$pkgdir/usr/lib/kicad-nightly/share/applications" "$pkgdir/usr/share"
+
+ cd "$srcdir"
+ mkdir -p "$pkgdir/usr/share/kicad-nightly"
+ cp kicad-nightly.env "$pkgdir/usr/share/kicad-nightly/kicad-nightly.env"
+
+ mkdir -p "$pkgdir/usr/bin"
+ (cd "$pkgdir/usr/lib/kicad-nightly/bin" && ls | grep -v '\.kiface') | while read prog; do
+ cat > "$pkgdir/usr/bin/$prog-nightly" <<EOF
+#!/bin/sh
+. /usr/share/kicad-nightly/kicad-nightly.env
+exec /usr/lib/kicad-nightly/bin/$prog
+EOF
+ chmod +x "$pkgdir/usr/bin/$prog-nightly"
+ done
+
+ cd "$srcdir/kicad-i18n/build"
+ make DESTDIR="$pkgdir" install
+}