]> sigrok.org Git - sigrok-util.git/blame - cross-compile/macosx/sigrok-native-macosx
sigrok-native-macosx: Drop Qt4 references/comments.
[sigrok-util.git] / cross-compile / macosx / sigrok-native-macosx
CommitLineData
4b4f052c
UH
1#!/bin/sh
2##
3## This file is part of the sigrok-util project.
4##
5## Copyright (C) 2015 Uwe Hermann <uwe@hermann-uwe.de>
6##
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.
11##
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.
16##
17## You should have received a copy of the GNU General Public License
b65a0b06 18## along with this program; if not, see <http://www.gnu.org/licenses/>.
4b4f052c
UH
19##
20
21set -e
22
23# The path where the compiled packages will be installed.
24PREFIX=$HOME/sr_macosx
25
26# The path where to download files to and where to build packages.
27BUILDDIR=./build
28
29# The path where the libsigrok Python bindings will be installed.
30PYPATH=$PREFIX/lib/python2.7/site-packages
31
2793b933
UH
32# Edit this to control verbose build output.
33# V="V=1 VERBOSE=1"
34
4b4f052c 35# Edit this to enable/disable/modify parallel compiles.
6a8ce4e0 36PARALLEL="-j "`sysctl -n hw.ncpu`
4b4f052c
UH
37
38# Uncomment the following lines to build with clang and run scan-build.
39# export CC=llvm-gcc
40# export CXX=llvm-g++
41# SB="scan-build -k -v"
42
43# Uncomment the following lines to build with gcc/g++.
6a8ce4e0
PET
44export CC=gcc
45export CXX=g++
4b4f052c 46
6afe728b
UH
47# Path to Qt5 binaries (needed for cmake to find the Qt5 libs).
48export PATH=`brew list qt5 | grep bin | head -n 1 | xargs dirname`":$PATH"
4b4f052c
UH
49
50# Path to Python 2/3 pkg-config files.
51# In Homebrew, pkg-config files of "keg-only" formulas (Python is one of them)
52# aren't installed into /usr/local/lib/pkgconfig (we manually reference them).
6a8ce4e0
PET
53PY2=`brew list python | grep pkgconfig | head -n 1 | xargs dirname`
54PY3=`brew list python3 | grep pkgconfig | head -n 1 | xargs dirname`
4b4f052c
UH
55
56# You usually don't need to change anything below this line.
57
58# -----------------------------------------------------------------------------
59
60P="$PREFIX/lib/pkgconfig:$PY2:$PY3"
61C="$C --prefix=$PREFIX"
62
63# Remove build directory contents (if any) and create a new build dir.
64rm -rf $BUILDDIR
65mkdir $BUILDDIR
66cd $BUILDDIR
67
68GIT_CLONE="git clone --depth=1"
69
70# -----------------------------------------------------------------------------
71
72# libserialport
73$GIT_CLONE git://sigrok.org/libserialport
74cd libserialport
75./autogen.sh
76mkdir build
77cd build
78../configure $C
2793b933
UH
79$SB make $PARALLEL $V
80make install $V
4b4f052c
UH
81cd ../..
82
83# libsigrok
84mkdir -p $PYPATH
85$GIT_CLONE git://sigrok.org/libsigrok
86cd libsigrok
87./autogen.sh
88mkdir build
89cd build
56363ab9 90PKG_CONFIG_PATH=$P ../configure $C
2793b933
UH
91$SB make $PARALLEL $V
92PYTHONPATH=$PYPATH $SB make install $V
93$SB make check $V
4b4f052c
UH
94cd ../..
95
96# libsigrokdecode
97$GIT_CLONE git://sigrok.org/libsigrokdecode
98cd libsigrokdecode
99./autogen.sh
100mkdir build
101cd build
102PKG_CONFIG_PATH=$P ../configure $C
2793b933
UH
103$SB make $PARALLEL $V
104make install $V
105$SB make check $V
4b4f052c
UH
106cd ../..
107
108# sigrok-firmware
109$GIT_CLONE git://sigrok.org/sigrok-firmware
110cd sigrok-firmware
111./autogen.sh
112mkdir build
113cd build
114# Nothing gets cross-compiled here, we just need 'make install' basically.
115../configure $C
2793b933 116make install $V
4b4f052c
UH
117cd ../..
118
119# sigrok-firmware-fx2lafw
120$GIT_CLONE git://sigrok.org/sigrok-firmware-fx2lafw
121cd sigrok-firmware-fx2lafw
122./autogen.sh
123mkdir build
124cd build
125# We're building the fx2lafw firmware on the host, no need to cross-compile.
126../configure $C
2793b933
UH
127make $PARALLEL $V
128make install $V
4b4f052c
UH
129cd ../..
130
131# sigrok-cli
132$GIT_CLONE git://sigrok.org/sigrok-cli
133cd sigrok-cli
134./autogen.sh
135mkdir build
136cd build
137PKG_CONFIG_PATH=$P ../configure $C
2793b933
UH
138$SB make $PARALLEL $V
139make install $V
4b4f052c
UH
140cd ../..
141
142# PulseView
143$GIT_CLONE git://sigrok.org/pulseview
144cd pulseview
145mkdir build
146cd build
147PKG_CONFIG_PATH=$P $SB cmake -DCMAKE_INSTALL_PREFIX:PATH=$PREFIX -DDISABLE_WERROR=y -DENABLE_TESTS=y ..
2793b933
UH
148$SB make $PARALLEL $V
149make install $V
150$SB make test $V
4b4f052c
UH
151cd ../..
152