3 ## This file is part of the sigrok-util project.
5 ## Copyright (C) 2016 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 # Build target: "i686" (32bit) or "x86_64" (64bit).
26 # The path where the compiled packages will be installed.
29 # The path where to download files to and where to build packages.
32 # The path where the libsigrok Python bindings will be installed.
33 PYPATH=$PREFIX/lib/python2.7/site-packages
35 # Edit this to control verbose build output.
38 # Edit this to enable/disable/modify parallel compiles.
41 # You usually don't need to change anything below this line.
43 # -----------------------------------------------------------------------------
45 VER_SIGROK_FIRMWARE_FX2LAFW=0.1.3
47 # -----------------------------------------------------------------------------
49 if [ $DEBUG = 1 ]; then
55 P="$PREFIX/lib/pkgconfig"
56 C="$C --prefix=$PREFIX"
57 L="--disable-shared --enable-static"
59 # Path to Qt binaries (needed for cmake to find the Qt libs).
60 PATH="/mingw32/qt5-static/bin:$PATH"
64 WGET="wget -c --quiet"
65 GIT_CLONE="git clone --depth=1"
67 REPO_BASE="git://sigrok.org"
69 # Remove build directory contents (if any) and create a new build dir.
74 # -----------------------------------------------------------------------------
76 if [ "x$1" = "xprepare" ]; then
77 # Update package list, install/update all requirements.
80 autoconf automake autoconf-archive libtool make pkg-config wget patch \
81 $W-toolchain $W-glib2 $W-glibmm $W-libusb $W-libfdi $W-check $W-boost \
82 $W-libzip $W-doxygen $W-python3 $W-python3-numpy $W-python3-gobject \
83 $W-python3-setuptools $W-swig $W-qt5-static $W-cmake $W-nsis
87 # -----------------------------------------------------------------------------
90 $GIT_CLONE git://github.com/dickens/libusb -b event-abstraction-v4
99 $GIT_CLONE $REPO_BASE/libserialport
105 $SB make $PARALLEL $V
111 $GIT_CLONE $REPO_BASE/libsigrok
116 PKG_CONFIG_PATH=$P PYTHON=python3 ../configure $C $L --disable-python
117 $SB make $PARALLEL $V
118 PYTHONPATH=$PYPATH $SB make install $V
119 # $SB make check $V # TODO
123 $GIT_CLONE $REPO_BASE/libsigrokdecode
128 PKG_CONFIG_PATH=$P ../configure $C $L
129 $SB make $PARALLEL $V
131 # $SB make check $V # TODO
135 $GIT_CLONE $REPO_BASE/sigrok-firmware
140 # Nothing gets cross-compiled here, we just need 'make install' basically.
145 # sigrok-firmware-fx2lafw
146 $WGET http://sigrok.org/download/binary/sigrok-firmware-fx2lafw/sigrok-firmware-fx2lafw-bin-$VER_SIGROK_FIRMWARE_FX2LAFW.tar.gz
147 tar xfz sigrok-firmware-fx2lafw-bin-$VER_SIGROK_FIRMWARE_FX2LAFW.tar.gz
148 cd sigrok-firmware-fx2lafw-bin-$VER_SIGROK_FIRMWARE_FX2LAFW
149 cp *.fw $PREFIX/share/sigrok-firmware/
152 # TODO: Doesn't build, libsigrokdecode linking errors.
154 # $GIT_CLONE $REPO_BASE/sigrok-cli
159 # PKG_CONFIG_PATH=$P ../configure $C $L
160 # $SB make $PARALLEL $V
162 # # makensis -DHOME=$HOME contrib/sigrok-cli_cross.nsi # TODO
165 # TODO: Doesn't build, various linking errors.
167 $GIT_CLONE $REPO_BASE/pulseview
171 PKG_CONFIG_PATH=$P $SB cmake \
172 -G "Unix Makefiles" \
173 -DCMAKE_INSTALL_PREFIX:PATH=$PREFIX \
174 -DCMAKE_BUILD_TYPE=$BUILD_TYPE \
178 $SB make $PARALLEL $V
180 # $SB make test $V # TODO
181 # makensis -DHOME=$HOME contrib/pulseview_cross.nsi # TODO