This repository has been archived by the owner on Dec 5, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 24
/
PKGBUILD-STABLE-5.0
185 lines (167 loc) · 6.66 KB
/
PKGBUILD-STABLE-5.0
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
# Maintainer: Alexey Pavlov <[email protected]>
_realname=kicad
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}-git"
pkgver=5.0.2_1
_upver=`echo ${pkgver} | sed -e 's/_.*//g'`
_basever=5.0.2
_rcver=`echo ${pkgver} | sed -e 's/.*_//g'`
pkgrel=1
pkgdesc="Software for the creation of electronic schematic diagrams and printed circuit board artwork (mingw-w64)"
arch=('any')
url="http://www.kicad-pcb.org"
license=("GPL2+")
provides=("${MINGW_PACKAGE_PREFIX}-${_realname}")
conflicts=("${MINGW_PACKAGE_PREFIX}-${_realname}")
depends=("${MINGW_PACKAGE_PREFIX}-boost"
"${MINGW_PACKAGE_PREFIX}-cairo"
"${MINGW_PACKAGE_PREFIX}-curl"
"${MINGW_PACKAGE_PREFIX}-glew"
"${MINGW_PACKAGE_PREFIX}-openssl"
"${MINGW_PACKAGE_PREFIX}-wxPython"
"${MINGW_PACKAGE_PREFIX}-wxWidgets"
"${MINGW_PACKAGE_PREFIX}-libxslt"
"${MINGW_PACKAGE_PREFIX}-oce"
"${MINGW_PACKAGE_PREFIX}-ngspice"
"${MINGW_PACKAGE_PREFIX}-fftw")
makedepends=("${MINGW_PACKAGE_PREFIX}-cmake"
"${MINGW_PACKAGE_PREFIX}-doxygen"
"${MINGW_PACKAGE_PREFIX}-gcc"
"${MINGW_PACKAGE_PREFIX}-python2"
"${MINGW_PACKAGE_PREFIX}-pkg-config"
"${MINGW_PACKAGE_PREFIX}-swig"
"${MINGW_PACKAGE_PREFIX}-glm"
"git")
#source=("${_realname}::git+https://git.launchpad.net/kicad#tag=${_upver}"
source=("${_realname}::git+https://git.launchpad.net/kicad#branch=5.0"
"${_realname}-i18n-${_upver}.tar.gz"::"https://github.com/KiCad/kicad-i18n/archive/${_upver}.tar.gz"
"${_realname}-symbols-${_basever}.tar.gz"::"https://github.com/KiCad/kicad-symbols/archive/${_basever}.tar.gz"
"${_realname}-footprints-${_basever}.tar.gz"::"https://github.com/KiCad/kicad-footprints/archive/${_basever}.tar.gz"
"${_realname}-packages3D-${_basever}.tar.gz"::"https://github.com/KiCad/kicad-packages3D/archive/${_basever}.tar.gz"
"${_realname}-templates-${_basever}.tar.gz"::"https://github.com/KiCad/kicad-templates/archive/${_basever}.tar.gz"
"${_realname}-doc-${_upver}.tar.gz"::"https://kicad-downloads.s3.cern.ch/docs/kicad-doc-${_basever}.tar.gz"
)
md5sums=('SKIP'
'540eb9bbfb2004749ded2553adfcefd1'
'12d1baa4b77f6aa90c0ebe013934bf11'
'caa7a7e263fb2520a95032485c3e2d13'
'9166a728ba291fd943165f14c04399b0'
'8ad047f22a0ee9ddcf113300d83a7d83'
'780d865b31ccaddabce07b43a7e89187')
prepare() {
# Hack to get UTF8 support for paths with mingw
# https://lists.launchpad.net/kicad-developers/msg28560.html
rm -rf ${srcdir}/${_realname}/include/wx
mkdir ${srcdir}/${_realname}/include/wx
cp $(find ${MINGW_PREFIX} -path "*wx\\/app.h") \
${srcdir}/${_realname}/include/wx
cd ${srcdir}/${_realname}
patch -p1 -i ${srcdir}/${_realname}/patches/wxwidgets-3.0.2_mingw_fix_unicode_entry.patch
}
build() {
cd "${srcdir}"
# Configure and build KiCad.
[[ -d build-${MINGW_CHOST} ]] && rm -r build-${MINGW_CHOST}
mkdir build-${MINGW_CHOST} && cd build-${MINGW_CHOST}
# Get GCC version
GCCVERSION=`gcc --version | grep ^gcc | sed 's/^.* //g'`
# Add flag to silence deprecation warnings
# Due to bug in gcc 5.1,5.2
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65974
EXTRA_FLAGS=""
if [ $GCCVERSION = "5.1.0" ] || [ $GCCVERSION = "5.2.0" ]; then
EXTRA_FLAGS=" -DCMAKE_CXX_FLAGS=-Wno-deprecated-declarations"
fi
MSYS2_ARG_CONV_EXCL="-DCMAKE_INSTALL_PREFIX=" \
${MINGW_PREFIX}/bin/cmake \
-G"MSYS Makefiles" \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \
-DCMAKE_RULE_MESSAGES:BOOL=OFF \
-DCMAKE_PREFIX_PATH=${MINGW_PREFIX} \
-DCMAKE_INSTALL_PREFIX=${MINGW_PREFIX} \
-DDEFAULT_INSTALL_PATH=${MINGW_PREFIX} \
-DOPENSSL_ROOT_DIR=${MINGW_PREFIX} \
-DKICAD_VERSION_EXTRA=${_rcver} \
-DKICAD_SCRIPTING=ON \
-DKICAD_SCRIPTING_MODULES=ON \
-DKICAD_SCRIPTING_WXPYTHON=ON \
-DKICAD_SCRIPTING_ACTION_MENU=ON \
-DKICAD_USE_OCE=ON \
-DKICAD_SPICE=ON \
-DPYTHON_EXECUTABLE=${MINGW_PREFIX}/bin/python2 \
${EXTRA_FLAGS} \
../${_realname}
make
cd "${srcdir}"
# Configure the translation installation build.
[[ -d build-i18n ]] && rm -r build-i18n
mkdir build-i18n && cd build-i18n
MSYS2_ARG_CONV_EXCL="-DCMAKE_INSTALL_PREFIX=" \
${MINGW_PREFIX}/bin/cmake \
-G "MSYS Makefiles" \
-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \
-DCMAKE_RULE_MESSAGES:BOOL=OFF \
-DCMAKE_INSTALL_PREFIX=${MINGW_PREFIX} \
../${_realname}-i18n-${_upver}
cd "${srcdir}"
# Configure the library installation build.
[[ -d build-symbols ]] && rm -r build-symbols
mkdir build-symbols && cd build-symbols
MSYS2_ARG_CONV_EXCL="-DCMAKE_INSTALL_PREFIX=" \
${MINGW_PREFIX}/bin/cmake \
-G "MSYS Makefiles" \
-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \
-DCMAKE_RULE_MESSAGES:BOOL=OFF \
-DCMAKE_INSTALL_PREFIX=${MINGW_PREFIX} \
../${_realname}-symbols-${_basever}
cd "${srcdir}"
[[ -d build-footprints ]] && rm -r build-footprints
mkdir build-footprints && cd build-footprints
MSYS2_ARG_CONV_EXCL="-DCMAKE_INSTALL_PREFIX=" \
${MINGW_PREFIX}/bin/cmake \
-G "MSYS Makefiles" \
-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \
-DCMAKE_RULE_MESSAGES:BOOL=OFF \
-DCMAKE_INSTALL_PREFIX=${MINGW_PREFIX} \
../${_realname}-footprints-${_basever}
cd "${srcdir}"
[[ -d build-packages3D ]] && rm -r build-packages3D
mkdir build-packages3D && cd build-packages3D
MSYS2_ARG_CONV_EXCL="-DCMAKE_INSTALL_PREFIX=" \
${MINGW_PREFIX}/bin/cmake \
-G "MSYS Makefiles" \
-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \
-DCMAKE_RULE_MESSAGES:BOOL=OFF \
-DCMAKE_INSTALL_PREFIX=${MINGW_PREFIX} \
../${_realname}-packages3D-${_basever}
cd "${srcdir}"
[[ -d build-templates ]] && rm -r build-templates
mkdir build-templates && cd build-templates
MSYS2_ARG_CONV_EXCL="-DCMAKE_INSTALL_PREFIX=" \
${MINGW_PREFIX}/bin/cmake \
-G "MSYS Makefiles" \
-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \
-DCMAKE_RULE_MESSAGES:BOOL=OFF \
-DCMAKE_INSTALL_PREFIX=${MINGW_PREFIX} \
../${_realname}-templates-${_basever}
}
package() {
# Install KiCad.
cd "${srcdir}/build-${MINGW_CHOST}"
make DESTDIR=${pkgdir} install
# Install KiCad i18n.
cd "${srcdir}/build-i18n"
make DESTDIR=${pkgdir} install
# Install the KiCad libraries.
cd "${srcdir}/build-symbols"
make DESTDIR=${pkgdir} install
cd "${srcdir}/build-footprints"
make DESTDIR=${pkgdir} install
cd "${srcdir}/build-packages3D"
make DESTDIR=${pkgdir} install
cd "${srcdir}/build-templates"
make DESTDIR=${pkgdir} install
# Install KiCad docs.
mkdir -p "${pkgdir}${MINGW_PREFIX}/share/doc/kicad/"
cp -r "${srcdir}/kicad-doc-${_upver}/share/doc/kicad/help" "${pkgdir}${MINGW_PREFIX}/share/doc/kicad/"
}