aboutsummaryrefslogtreecommitdiffstats
path: root/testing/kicad/APKBUILD
blob: 775f0cd5fcb715bc4137c6e1a6f1bb8fe0bb2251 (plain) (blame)
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
# Maintainer: Marian Buschsieweke <marian.buschsieweke@ovgu.de>
# Contributor: Marian Buschsieweke <marian.buschsieweke@ovgu.de>
pkgname=kicad
pkgver=5.1.5
pkgrel=3
pkgdesc="A Cross Platform and Open Source Electronics Design Automation Suite"
url="http://kicad-pcb.org/"
arch="all !s390x" # No support for s390x in libcontext (shipped with kicad)
license="GPL-3.0-or-later"
makedepends="
	boost-dev
	cairo-dev
	cmake
	curl-dev
	glew-dev
	glm-dev
	ngspice-dev
	py3-wxpython
	python3-dev
	swig
	wxgtk-base-dev
	wxgtk3-dev
	zlib-dev
	"
depends="python3"
subpackages="$pkgname-i18n:i18n:noarch $pkgname-doc"
source="
	https://launchpad.net/kicad/5.0/$pkgver/+download/kicad-$pkgver.tar.xz
	kicad-i18n.$pkgver.tar.gz::https://github.com/KiCad/kicad-i18n/archive/$pkgver.tar.gz
	"

case "$CARCH" in
	x86_64)
		makedepends="$makedepends opencascade-dev vtk-dev"
		subpackages="$subpackages kicad-opencascade"
		;;
	*)
		# Dependency opencascade (needed for STEP file support in 3D preview)
		# not available on all other architectures
		;;
esac

_build_kicad() {
	mkdir -p "$1"
	cd "$1"
	cmake .. \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DKICAD_USE_OCE=OFF \
		-DKICAD_USE_OCC=$2 \
		-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-gtk3 \
		-DwxWidgets_INCLUDE_DIRS=/usr/include \
		-DBUILD_GITHUB_PLUGIN=ON
	make
	cd "$builddir"
}

_build_kicad_i18n() {
	cd "$srcdir"/kicad-i18n-$pkgver
	mkdir -p build
	cd build
	cmake .. -DCMAKE_INSTALL_PREFIX=/usr
	make
	cd "$builddir"
}

build() {
	# First build without opencascade
	_build_kicad "build" "OFF"
	_build_kicad_i18n

	# Now build with opencascade, if possible
	case "$CARCH" in
		x86_64)
			_build_kicad "build-occ" "ON"
			;;
		*)
			# Dependency opencascade (needed for STEP file support in 3D preview)
			# not available on all other architectures
			;;
	esac
}

check() {
	cd build
	make test
}

package() {
	cd build
	make DESTDIR="$pkgdir" install
}

i18n() {
	cd "$srcdir"/kicad-i18n-$pkgver/build
	make DESTDIR="$subpkgdir" install
}

opencascade() {
	pkgdesc="kicad with support for STEP file in 3D preview"
	replaces="$pkgname"
	provides="$pkgname=$pkgver-r$pkgrel"
	cd "$builddir/build-occ"
	make DESTDIR="$subpkgdir" install
}

sha512sums="5ca19e219da07a906f13e236849eb4497c9f827726a5cd13aceffe1d8c7dee480823bf3e949527f59a805eb3b8176fad51576ae663dd07b10e2822f2b37866a5  kicad-5.1.5.tar.xz
68e6602fcc7e73c22a594b45ecf53a956af8a134e28e86242bfaa4087df21c04b24ae4df9928f00c2cee7eb0631a02a4de1cd09547b36a466fb324f983ea5363  kicad-i18n.5.1.5.tar.gz"