forked from KiCad/kicad-winbuilder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
PKGBUILD-libcurl
124 lines (106 loc) · 3.84 KB
/
PKGBUILD-libcurl
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
# Maintainer: Alexey Pavlov <[email protected]>
_realname=kicad
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}-git"
pkgver=r6281.c877c5f
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")
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://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"
"http://docs.kicad-pcb.org/kicad-doc-HEAD.tar.gz"
)
md5sums=('SKIP'
'SKIP'
'SKIP'
'SKIP'
)
pkgver() {
cd "${srcdir}/${_realname}"
printf "r%s.%s" "$(git rev-list --count --first-parent HEAD)" "$(git rev-parse --short HEAD)"
}
build() {
cd "${srcdir}/kicad"
msg2 "Patching..."
git apply ../../0001-Replace-avhttp-with-libcurl-implementation.patch
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_PREFIX_PATH=${MINGW_PREFIX} \
-DCMAKE_INSTALL_PREFIX=${MINGW_PREFIX} \
-DDEFAULT_INSTALL_PATH=${MINGW_PREFIX} \
-DOPENSSL_ROOT_DIR=${MINGW_PREFIX} \
-DKICAD_REPO_NAME=0001-Replace-avhttp-with-libcurl-implementation.patch \
-DKICAD_SKIP_BOOST=ON \
-DKICAD_SCRIPTING=ON \
-DKICAD_SCRIPTING_MODULES=ON \
-DKICAD_SCRIPTING_WXPYTHON=ON \
-DPYTHON_EXECUTABLE=${MINGW_PREFIX}/bin/python2.exe \
${EXTRA_FLAGS} \
../${_realname}
make
cd "${srcdir}"
# Configure the translationn 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_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_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 KiCad docs.
cp -r "${srcdir}/kicad-doc-HEAD/share/doc/kicad/help" "${pkgdir}${MINGW_PREFIX}/share/doc/kicad/"
}