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-DEBUG
161 lines (142 loc) · 5.28 KB
/
PKGBUILD-DEBUG
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
# Maintainer: Alexey Pavlov <alexpux@gmail.com>
_realname=kicad
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}-git"
pkgver=r6023.cb629e0
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+")
options=(!debug !strip)
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"
"unzip")
source=("${_realname}"::"git+https://github.com/KiCad/kicad-source-mirror.git"
"${_realname}-i18n"::"git+https://github.com/KiCad/kicad-i18n.git"
"${_realname}-libs"::"git+https://github.com/KiCad/kicad-library.git"
"${_realname}-footprints.zip"::"http://ci.kicad-pcb.org/job/any-kicad-pretty-lib-nightlies/lastSuccessfulBuild/artifact/*zip*/archive.zip"
"http://docs.kicad-pcb.org/kicad-doc-HEAD.tar.gz"
)
md5sums=('SKIP'
'SKIP'
'SKIP'
'SKIP'
'SKIP'
)
noextract=("${_realname}-footprints.zip")
pkgver() {
cd "${srcdir}/${_realname}"
printf "r%s.%s" "$(git rev-list --count --first-parent HEAD)" "$(git rev-parse --short HEAD)"
}
prepare() {
if [ -d ${srcdir}/arch ]; then
rm -rf ${srcdir}/archive
fi
if [ -d ${srcdir}/${_realname}-footprints ]; then
rm -rf ${srcdir}/${_realname}-footprints
fi
unzip ${srcdir}/${_realname}-footprints.zip
mv ${srcdir}/archive ${srcdir}/${_realname}-footprints
# 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 /usr/x86_64-*mingw*/ -path "*wx\\/app.h") \
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.exe \
-G"MSYS Makefiles" \
-DCMAKE_BUILD_TYPE=Debug \
-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_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.exe \
${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.exe \
-G "MSYS Makefiles" \
-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \
-DCMAKE_RULE_MESSAGES:BOOL=OFF \
-DCMAKE_INSTALL_PREFIX=${MINGW_PREFIX} \
../${_realname}-i18n
cd "${srcdir}"
# Configure the library installation build.
[[ -d build-libs ]] && rm -r build-libs
mkdir build-libs && cd build-libs
MSYS2_ARG_CONV_EXCL="-DCMAKE_INSTALL_PREFIX=" \
${MINGW_PREFIX}/bin/cmake.exe \
-G "MSYS Makefiles" \
-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \
-DCMAKE_RULE_MESSAGES:BOOL=OFF \
-DCMAKE_INSTALL_PREFIX=${MINGW_PREFIX} \
../${_realname}-libs
}
package() {
# Install KiCad.
cd "${srcdir}/build-${MINGW_CHOST}"
make DESTDIR=${pkgdir} install
# Install KiCad i18n.
cd "${srcdir}/build-i18n"
make DESTDIR=${pkgdir} install
# Install KiCad libraries.
cd "${srcdir}/build-libs"
make DESTDIR=${pkgdir} install
# Install the pretties
mkdir -p "${pkgdir}${MINGW_PREFIX}/share/kicad/modules"
cp -rd "${srcdir}/kicad-footprints"/* "${pkgdir}${MINGW_PREFIX}/share/kicad/modules"
# Install KiCad docs.
mkdir -p "${pkgdir}${MINGW_PREFIX}/share/doc/kicad/"
cp -r "${srcdir}/kicad-doc-HEAD/share/doc/kicad/help" "${pkgdir}${MINGW_PREFIX}/share/doc/kicad/"
}