3 ## This file is part of the sigrok-util project.
5 ## Copyright (C) 2016-2018 Uwe Hermann <uwe@hermann-uwe.de>
7 ## This program is free software; you can redistribute it and/or modify
8 ## it under the terms of the GNU General Public License as published by
9 ## the Free Software Foundation; either version 2 of the License, or
10 ## (at your option) any later version.
12 ## This program is distributed in the hope that it will be useful,
13 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
14 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 ## GNU General Public License for more details.
17 ## You should have received a copy of the GNU General Public License
18 ## along with this program; if not, see <http://www.gnu.org/licenses/>.
23 # The base path prefix where the compiled packages will be installed.
24 PREFIXBASE=$HOME/sr_msys2
26 # The base path prefix where to download files to and where to build packages.
29 # The $PREFIX subdir where the libsigrok Python bindings will be installed.
30 PYBASE=lib/python2.7/site-packages
32 # Edit this to control verbose build output.
35 # Edit this to enable/disable/modify parallel compiles.
38 # Edit this to enable/disable debug builds.
41 # You usually don't need to change anything below this line.
43 # -----------------------------------------------------------------------------
45 # The build target type: "i686" (32bit) or "x86_64" (64bit).
46 # This is selected based on which MSYS2 shell is being used to do the build.
49 VER_SIGROK_FIRMWARE_FX2LAFW=0.1.5
51 WGET="wget -c --quiet"
52 GIT_CLONE="git clone --depth=1"
54 REPO_BASE="git://sigrok.org"
56 # Construct the build and install directory pathnames.
57 if [ $TARGET = "i686" ]; then
62 if [ $DEBUG = 1 ]; then
63 # CFLAGS/CXXFLAGS contains "-g" per default for autotools projects.
65 PREFIX=$PREFIXBASE"_debug_"$SUFFIX
66 BUILDDIR=$BUILDBASE"_debug_"$SUFFIX
69 PREFIX=$PREFIXBASE"_release_"$SUFFIX
70 BUILDDIR=$BUILDBASE"_release_"$SUFFIX
73 PYPATH=$PREFIX/$PYBASE
75 # -----------------------------------------------------------------------------
77 P="$PREFIX/lib/pkgconfig"
78 C="$C --prefix=$PREFIX"
79 L="--disable-shared --enable-static"
81 # Path to Qt binaries (needed for cmake to find the Qt libs).
82 PATH="/mingw32/qt5-static/bin:$PATH"
88 # Remove build directory contents (if any) and create a new build dir.
93 # -----------------------------------------------------------------------------
95 if [ "x$1" = "xprepare" ]; then
96 # Update package list, install/update all requirements.
99 autoconf automake autoconf-archive libtool make pkg-config wget patch \
100 $W-toolchain $W-glib2 $W-glibmm $W-libusb $W-libftdi $W-check $W-boost \
101 $W-libzip $W-doxygen $W-python3 $W-python3-numpy $W-python3-gobject \
102 $W-python3-setuptools $W-swig $W-qt5-static $W-cmake $W-nsis
106 # -----------------------------------------------------------------------------
109 $GIT_CLONE git://github.com/dickens/libusb -b event-abstraction-v4
118 $GIT_CLONE $REPO_BASE/libserialport
124 $SB make $PARALLEL $V
129 $GIT_CLONE $REPO_BASE/libsigrok
134 PKG_CONFIG_PATH=$P PYTHON=python3 ../configure $C $L --disable-python
135 $SB make $PARALLEL $V
136 PYTHONPATH=$PYPATH $SB make install $V
137 # $SB make check $V # TODO
141 $GIT_CLONE $REPO_BASE/libsigrokdecode
146 PKG_CONFIG_PATH=$P ../configure $C $L
147 $SB make $PARALLEL $V
149 # $SB make check $V # TODO
153 $GIT_CLONE $REPO_BASE/sigrok-firmware
158 # Nothing gets cross-compiled here, we just need 'make install' basically.
163 # sigrok-firmware-fx2lafw
164 $WGET http://sigrok.org/download/binary/sigrok-firmware-fx2lafw/sigrok-firmware-fx2lafw-bin-$VER_SIGROK_FIRMWARE_FX2LAFW.tar.gz
165 tar xfz sigrok-firmware-fx2lafw-bin-$VER_SIGROK_FIRMWARE_FX2LAFW.tar.gz
166 cd sigrok-firmware-fx2lafw-bin-$VER_SIGROK_FIRMWARE_FX2LAFW
167 cp *.fw $PREFIX/share/sigrok-firmware/
170 # TODO: Doesn't build, libsigrokdecode linking errors.
172 # $GIT_CLONE $REPO_BASE/sigrok-cli
177 # PKG_CONFIG_PATH=$P ../configure $C $L
178 # $SB make $PARALLEL $V
180 # # makensis -DHOME=$HOME contrib/sigrok-cli_cross.nsi # TODO
183 # TODO: Doesn't build, various linking errors.
185 $GIT_CLONE $REPO_BASE/pulseview
189 PKG_CONFIG_PATH=$P $SB cmake \
190 -G "Unix Makefiles" \
191 -DCMAKE_INSTALL_PREFIX:PATH=$PREFIX \
192 -DCMAKE_BUILD_TYPE=$BUILD_TYPE \
196 $SB make $PARALLEL $V
198 # $SB make test $V # TODO
199 # makensis -DHOME=$HOME contrib/pulseview_cross.nsi # TODO