forked from SatDump/SatDump
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Configure-vcpkg.sh
executable file
·195 lines (173 loc) · 6.28 KB
/
Configure-vcpkg.sh
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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
#!/bin/bash
if [[ -z "$GITHUB_WORKSPACE" ]]
then
GITHUB_WORKSPACE=".."
cd $( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )/..
fi
if [[ -d vcpkg ]]
then
rm -rf vcpkg
fi
git clone https://github.com/microsoft/vcpkg
cd vcpkg
git checkout ad3bae5
if [[ "$(uname -m)" == "arm64" ]]
then
cp ../macOS/arm64-osx-satdump.cmake triplets/osx-satdump.cmake
osx_target="11.0"
else
cp ../macOS/x64-osx-satdump.cmake triplets/osx-satdump.cmake
osx_target="10.15"
fi
./bootstrap-vcpkg.sh
echo "Installing vcpkg packages..."
# Core packages. libxml2 is for libiio
./vcpkg install --triplet osx-satdump libjpeg-turbo tiff libpng glfw3 libusb fftw3 libxml2 portaudio jemalloc nng[mbedtls] zstd armadillo
# Entirely for UHD...
./vcpkg install --triplet osx-satdump boost-chrono boost-date-time boost-filesystem boost-program-options boost-system boost-serialization boost-thread \
boost-test boost-format boost-asio boost-math boost-graph boost-units boost-lockfree boost-circular-buffer \
boost-assign boost-dll
mkdir build && cd build
#Used for volk and uhd builds
echo "Setting up venv"
python3 -m venv venv
source venv/bin/activate
pip3 install mako
build_args="-DCMAKE_TOOLCHAIN_FILE=$(cd ../scripts/buildsystems && pwd)/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=osx-satdump -DCMAKE_INSTALL_PREFIX=$(cd ../installed/osx-satdump && pwd) -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_DEPLOYMENT_TARGET=$osx_target -DCMAKE_MACOSX_RPATH=ON"
libusb_include="$(cd ../installed/osx-satdump/include/libusb-1.0 && pwd)"
libusb_lib="$(cd ../installed/osx-satdump/lib && pwd)/libusb-1.0.0.dylib"
echo "Building OpenMP"
mkdir libomp && cd libomp
curl -LJ --output openmp-17.0.6.src.tar.xz https://github.com/llvm/llvm-project/releases/download/llvmorg-17.0.6/openmp-17.0.6.src.tar.xz
curl -LJ --output cmake-17.0.6.src.tar.xz https://github.com/llvm/llvm-project/releases/download/llvmorg-17.0.6/cmake-17.0.6.src.tar.xz
tar -xf openmp-17.0.6.src.tar.xz
tar -xf cmake-17.0.6.src.tar.xz
mv cmake-17.0.6.src cmake
cd openmp-17.0.6.src
mkdir build && cd build
cmake $build_args -DLIBOMP_INSTALL_ALIASES=OFF ..
make -j$(sysctl -n hw.logicalcpu)
make install
cd ../../..
rm -rf libomp
echo "Building orc"
git clone https://github.com/GStreamer/orc --depth 1 -b 0.4.38
cd orc
MACOSX_DEPLOYMENT_TARGET=$osx_target meson setup --buildtype=release --prefix=$(cd ../../installed/osx-satdump && pwd) -Dgtk_doc=disabled build
MACOSX_DEPLOYMENT_TARGET=$osx_target meson compile -C build --verbose
MACOSX_DEPLOYMENT_TARGET=$osx_target meson install -C build
cd ..
rm -rf orc
echo "Building cpu_features..."
git clone https://github.com/google/cpu_features --depth 1 -b v0.9.0
cd cpu_features
mkdir build && cd build
cmake $build_args -DBUILD_TESTING=OFF -DBUILD_EXECUTABLE=OFF ..
make -j$(sysctl -n hw.logicalcpu)
make install
cd ../..
rm -rf cpu_features
echo "Building Volk..."
git clone https://github.com/gnuradio/volk --depth 1 -b v3.1.2
cd volk
mkdir build && cd build
cmake $build_args -DENABLE_TESTING=OFF -DENABLE_MODTOOL=OFF ..
make -j$(sysctl -n hw.logicalcpu)
make install
cd ../..
rm -rf volk
echo "Building Airspy..."
git clone https://github.com/airspy/airspyone_host --depth 1 -b v1.0.10
cd airspyone_host/libairspy
mkdir build && cd build
cmake $build_args -DLIBUSB_INCLUDE_DIR=$libusb_include -DLIBUSB_LIBRARIES=$libusb_lib ..
make -j$(sysctl -n hw.logicalcpu)
make install
cd ../../..
rm -rf airspyone_host
echo "Building Airspy HF..."
git clone https://github.com/airspy/airspyhf --depth 1 -b 1.6.8
cd airspyhf/libairspyhf
mkdir build && cd build
cmake $build_args -DLIBUSB_INCLUDE_DIR=$libusb_include -DLIBUSB_LIBRARIES=$libusb_lib ..
make -j$(sysctl -n hw.logicalcpu)
make install
cd ../../..
rm -rf airspyhf
echo "Building RTL-SDR..."
git clone https://github.com/osmocom/rtl-sdr --depth 1 -b v2.0.1
cd rtl-sdr
mkdir build && cd build
cmake $build_args -DLIBUSB_INCLUDE_DIRS=$libusb_include -DLIBUSB_LIBRARIES=$libusb_lib ..
make -j$(sysctl -n hw.logicalcpu)
make install
cd ../..
rm -rf rtl-sdr
echo "Building HackRF..."
git clone https://github.com/greatscottgadgets/hackrf --depth 1 -b v2024.02.1
cd hackrf/host/libhackrf
mkdir build && cd build
cmake $build_args -DLIBUSB_INCLUDE_DIR=$libusb_include -DLIBUSB_LIBRARIES=$libusb_lib ..
make -j$(sysctl -n hw.logicalcpu)
make install
cd ../../../..
rm -rf hackrf
echo "Building LimeSuite..."
git clone https://github.com/myriadrf/LimeSuite --depth 1 -b v23.11.0
cd LimeSuite
mkdir build-dir && cd build-dir
cmake $build_args -DENABLE_GUI=OFF ..
make -j$(sysctl -n hw.logicalcpu)
make install
cd ../..
rm -rf LimeSuite
echo "Building libiio..."
git clone https://github.com/analogdevicesinc/libiio --depth 1 -b v0.25
cd libiio
mkdir build && cd build
cmake $build_args -DWITH_IIOD=OFF -DOSX_FRAMEWORK=OFF -DWITH_TESTS=OFF -DWITH_ZSTD=ON ..
make -j$(sysctl -n hw.logicalcpu)
make install
cd ../..
rm -rf libiio
echo "Building libad9361-iio..."
git clone https://github.com/analogdevicesinc/libad9361-iio --depth 1 -b v0.3
cd libad9361-iio
sed -i '' 's/<iio\/iio.h>/<iio.h>/g' test/*.c #Patch tests for macOS
sed -i '' 's/FRAMEWORK TRUE//' CMakeLists.txt #Just a dylib, please!
mkdir build && cd build
cmake $build_args -DOSX_PACKAGE=OFF -DWITH_DOC=OFF -DENABLE_PACKAGING=OFF ..
make -j$(sysctl -n hw.logicalcpu)
make install
cd ../..
rm -rf libad9361-iio
echo "Building bladeRF..."
git clone https://github.com/Nuand/bladeRF
cd bladeRF
git checkout 2fbae2c
cd host && mkdir build && cd build
cmake $build_args -DTEST_LIBBLADERF=OFF ..
make -j$(sysctl -n hw.logicalcpu)
make install
cd ../../..
rm -rf bladeRF
echo "Building UHD..."
git clone https://github.com/EttusResearch/uhd --depth 1 -b v4.6.0.0
cd uhd/host
mkdir build && cd build
cmake $build_args -DENABLE_MAN_PAGES=OFF -DENABLE_MANUAL=OFF -DENABLE_PYTHON_API=OFF -DENABLE_EXAMPLES=OFF -DENABLE_UTILS=OFF -DENABLE_TESTS=OFF ..
make -j$(sysctl -n hw.logicalcpu)
make install
cd ../../..
rm -rf uhd
echo "Adding SDRPlay Library..."
curl -LJ --output sdrplay-macos.zip https://www.satdump.org/sdrplay-macos.zip
unzip sdrplay-macos.zip
cp sdrplay-macos/lib/* ../installed/osx-satdump/lib
cp sdrplay-macos/include/* ../installed/osx-satdump/include
cd ../installed/osx-satdump/lib
ln -s libsdrplay_api.3.15.dylib libsdrplay_api.dylib
cd -
rm -rf sdrplay-macos*
deactivate #Exit the venv
echo "Done!"