minor: Fix shell script formatting enhancing readability (#2681)
This commit is contained in:
parent
7d62be5ccb
commit
2c9cfba836
2 changed files with 49 additions and 49 deletions
.ci/scripts
|
@ -16,25 +16,25 @@ set -- -DENABLE_RTLSDR=$RTLSDR -DENABLE_SOAPYSDR=$SOAPYSDR -DENABLE_OPENSSL=$OPE
|
||||||
mkdir -p build
|
mkdir -p build
|
||||||
cd build
|
cd build
|
||||||
if [ -n "$CMAKE_TOOLCHAIN_FILE" ] ; then
|
if [ -n "$CMAKE_TOOLCHAIN_FILE" ] ; then
|
||||||
cmake $@ -DCMAKE_TOOLCHAIN_FILE=../$CMAKE_TOOLCHAIN_FILE ..
|
cmake $@ -DCMAKE_TOOLCHAIN_FILE=../$CMAKE_TOOLCHAIN_FILE ..
|
||||||
else
|
else
|
||||||
cmake $@ ..
|
cmake $@ ..
|
||||||
fi
|
fi
|
||||||
make
|
make
|
||||||
# make install
|
# make install
|
||||||
|
|
||||||
if [ -n "$RUN_RTL_433_TESTS" ] ; then
|
if [ -n "$RUN_RTL_433_TESTS" ] ; then
|
||||||
|
|
||||||
cd ..
|
cd ..
|
||||||
set -x
|
set -x
|
||||||
git clone --depth 1 https://github.com/merbanan/rtl_433_tests.git
|
git clone --depth 1 https://github.com/merbanan/rtl_433_tests.git
|
||||||
cd rtl_433_tests
|
cd rtl_433_tests
|
||||||
export PATH=../build/src:$PATH
|
export PATH=../build/src:$PATH
|
||||||
test -f ../build/src/rtl_433
|
test -f ../build/src/rtl_433
|
||||||
|
|
||||||
# virtualenv --system-site-packages .venv
|
# virtualenv --system-site-packages .venv
|
||||||
# source .venv/bin/activate
|
# source .venv/bin/activate
|
||||||
# pip install deepdiff
|
# pip install deepdiff
|
||||||
make test
|
make test
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -17,9 +17,9 @@ sed="${sed:-sed}"
|
||||||
# from https://libusb.info/
|
# from https://libusb.info/
|
||||||
if [ ! -e libusb/include/libusb-1.0/libusb.h ]
|
if [ ! -e libusb/include/libusb-1.0/libusb.h ]
|
||||||
then
|
then
|
||||||
[ -e libusb-${libusb_ver}.7z ] || curl -L -O https://github.com/libusb/libusb/releases/download/v${libusb_ver}/libusb-${libusb_ver}.7z
|
[ -e libusb-${libusb_ver}.7z ] || curl -L -O https://github.com/libusb/libusb/releases/download/v${libusb_ver}/libusb-${libusb_ver}.7z
|
||||||
mkdir -p libusb
|
mkdir -p libusb
|
||||||
7z x -olibusb -y libusb-${libusb_ver}.7z
|
7z x -olibusb -y libusb-${libusb_ver}.7z
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# remove this script name and two dir levels to get the source root
|
# remove this script name and two dir levels to get the source root
|
||||||
|
@ -46,64 +46,64 @@ cp libusb/MinGW64/dll/libusb-1.0.dll.a $sysroot64/usr/lib
|
||||||
|
|
||||||
if [ ! -d rtl-sdr-${rtlsdr_ver} ]
|
if [ ! -d rtl-sdr-${rtlsdr_ver} ]
|
||||||
then
|
then
|
||||||
# or git clone https://github.com/osmocom/rtl-sdr.git
|
# or git clone https://github.com/osmocom/rtl-sdr.git
|
||||||
[ -e rtl-sdr-${rtlsdr_ver}.tar.gz ] || curl -L -o rtl-sdr-${rtlsdr_ver}.tar.gz https://github.com/osmocom/rtl-sdr/archive/${rtlsdr_ver}.tar.gz
|
[ -e rtl-sdr-${rtlsdr_ver}.tar.gz ] || curl -L -o rtl-sdr-${rtlsdr_ver}.tar.gz https://github.com/osmocom/rtl-sdr/archive/${rtlsdr_ver}.tar.gz
|
||||||
tar xzf rtl-sdr-${rtlsdr_ver}.tar.gz
|
tar xzf rtl-sdr-${rtlsdr_ver}.tar.gz
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cd rtl-sdr-${rtlsdr_ver}
|
cd rtl-sdr-${rtlsdr_ver}
|
||||||
|
|
||||||
if [ ! -e $sysroot32/usr/lib/librtlsdr.a ]
|
if [ ! -e $sysroot32/usr/lib/librtlsdr.a ]
|
||||||
then
|
then
|
||||||
export CMAKE_SYSROOT=$sysroot32 ; echo $CMAKE_SYSROOT
|
export CMAKE_SYSROOT=$sysroot32 ; echo $CMAKE_SYSROOT
|
||||||
mkdir build-tmp ; cd build-tmp ; cmake -DCMAKE_TOOLCHAIN_FILE=$source_dir/cmake/Toolchain-gcc-mingw-w64-i686.cmake .. && make && make install ; cd ..
|
mkdir build-tmp ; cd build-tmp ; cmake -DCMAKE_TOOLCHAIN_FILE=$source_dir/cmake/Toolchain-gcc-mingw-w64-i686.cmake .. && make && make install ; cd ..
|
||||||
rm -rf build-tmp
|
rm -rf build-tmp
|
||||||
mv $sysroot32/usr/lib/librtlsdr_static.a $sysroot32/usr/lib/librtlsdr.a
|
mv $sysroot32/usr/lib/librtlsdr_static.a $sysroot32/usr/lib/librtlsdr.a
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -e $sysroot32static/usr/lib/librtlsdr.a ]
|
if [ ! -e $sysroot32static/usr/lib/librtlsdr.a ]
|
||||||
then
|
then
|
||||||
export CMAKE_SYSROOT=$sysroot32static ; echo $CMAKE_SYSROOT
|
export CMAKE_SYSROOT=$sysroot32static ; echo $CMAKE_SYSROOT
|
||||||
mkdir build-tmp ; cd build-tmp ; cmake -DCMAKE_TOOLCHAIN_FILE=$source_dir/cmake/Toolchain-gcc-mingw-w64-i686.cmake -DBUILD_SHARED_LIBS:BOOL=OFF .. && make && make install ; cd ..
|
mkdir build-tmp ; cd build-tmp ; cmake -DCMAKE_TOOLCHAIN_FILE=$source_dir/cmake/Toolchain-gcc-mingw-w64-i686.cmake -DBUILD_SHARED_LIBS:BOOL=OFF .. && make && make install ; cd ..
|
||||||
rm -rf build-tmp
|
rm -rf build-tmp
|
||||||
mv $sysroot32static/usr/lib/librtlsdr_static.a $sysroot32static/usr/lib/librtlsdr.a
|
mv $sysroot32static/usr/lib/librtlsdr_static.a $sysroot32static/usr/lib/librtlsdr.a
|
||||||
rm $sysroot32static/usr/lib/librtlsdr.dll.a
|
rm $sysroot32static/usr/lib/librtlsdr.dll.a
|
||||||
rm $sysroot32static/usr/bin/librtlsdr.dll
|
rm $sysroot32static/usr/bin/librtlsdr.dll
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -e $sysroot64/usr/lib/librtlsdr.a ]
|
if [ ! -e $sysroot64/usr/lib/librtlsdr.a ]
|
||||||
then
|
then
|
||||||
export CMAKE_SYSROOT=$sysroot64 ; echo $CMAKE_SYSROOT
|
export CMAKE_SYSROOT=$sysroot64 ; echo $CMAKE_SYSROOT
|
||||||
mkdir build-tmp ; cd build-tmp ; cmake -DCMAKE_TOOLCHAIN_FILE=$source_dir/cmake/Toolchain-gcc-mingw-w64-x86-64.cmake .. && make && make install ; cd ..
|
mkdir build-tmp ; cd build-tmp ; cmake -DCMAKE_TOOLCHAIN_FILE=$source_dir/cmake/Toolchain-gcc-mingw-w64-x86-64.cmake .. && make && make install ; cd ..
|
||||||
rm -rf build-tmp
|
rm -rf build-tmp
|
||||||
mv $sysroot64/usr/lib/librtlsdr_static.a $sysroot64/usr/lib/librtlsdr.a
|
mv $sysroot64/usr/lib/librtlsdr_static.a $sysroot64/usr/lib/librtlsdr.a
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -e $sysroot64static/usr/lib/librtlsdr.a ]
|
if [ ! -e $sysroot64static/usr/lib/librtlsdr.a ]
|
||||||
then
|
then
|
||||||
export CMAKE_SYSROOT=$sysroot64static ; echo $CMAKE_SYSROOT
|
export CMAKE_SYSROOT=$sysroot64static ; echo $CMAKE_SYSROOT
|
||||||
mkdir build-tmp ; cd build-tmp ; cmake -DCMAKE_TOOLCHAIN_FILE=$source_dir/cmake/Toolchain-gcc-mingw-w64-x86-64.cmake -DBUILD_SHARED_LIBS:BOOL=OFF .. && make && make install ; cd ..
|
mkdir build-tmp ; cd build-tmp ; cmake -DCMAKE_TOOLCHAIN_FILE=$source_dir/cmake/Toolchain-gcc-mingw-w64-x86-64.cmake -DBUILD_SHARED_LIBS:BOOL=OFF .. && make && make install ; cd ..
|
||||||
rm -rf build-tmp
|
rm -rf build-tmp
|
||||||
mv $sysroot64static/usr/lib/librtlsdr_static.a $sysroot64static/usr/lib/librtlsdr.a
|
mv $sysroot64static/usr/lib/librtlsdr_static.a $sysroot64static/usr/lib/librtlsdr.a
|
||||||
rm $sysroot64static/usr/lib/librtlsdr.dll.a
|
rm $sysroot64static/usr/lib/librtlsdr.dll.a
|
||||||
rm $sysroot64static/usr/bin/librtlsdr.dll
|
rm $sysroot64static/usr/bin/librtlsdr.dll
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
if [ ! -e $sysroot64/usr/bin/SoapySDR.dll -o ! -e $sysroot64/usr/lib/SoapySDR.lib ]
|
if [ ! -e $sysroot64/usr/bin/SoapySDR.dll -o ! -e $sysroot64/usr/lib/SoapySDR.lib ]
|
||||||
then
|
then
|
||||||
# from https://downloads.myriadrf.org/builds/PothosSDR/
|
# from https://downloads.myriadrf.org/builds/PothosSDR/
|
||||||
[ -e PothosSDR-${pothos_ver}-x64.exe ] || curl -L -O https://downloads.myriadrf.org/builds/PothosSDR/PothosSDR-${pothos_ver}-x64.exe
|
[ -e PothosSDR-${pothos_ver}-x64.exe ] || curl -L -O https://downloads.myriadrf.org/builds/PothosSDR/PothosSDR-${pothos_ver}-x64.exe
|
||||||
mkdir -p pothos
|
mkdir -p pothos
|
||||||
7z x -opothos -y PothosSDR-${pothos_ver}-x64.exe
|
7z x -opothos -y PothosSDR-${pothos_ver}-x64.exe
|
||||||
# workaround: 7-Zip 9.20 creates strange root directories
|
# workaround: 7-Zip 9.20 creates strange root directories
|
||||||
[ -e pothos/bin ] || mv pothos/*/* pothos/ || :
|
[ -e pothos/bin ] || mv pothos/*/* pothos/ || :
|
||||||
cp pothos/bin/SoapySDR.dll $sysroot64/usr/bin
|
cp pothos/bin/SoapySDR.dll $sysroot64/usr/bin
|
||||||
cp -R pothos/include/SoapySDR $sysroot64/usr/include
|
cp -R pothos/include/SoapySDR $sysroot64/usr/include
|
||||||
cp pothos/lib/SoapySDR.lib $sysroot64/usr/lib
|
cp pothos/lib/SoapySDR.lib $sysroot64/usr/lib
|
||||||
cp -R pothos/cmake $sysroot64/usr
|
cp -R pothos/cmake $sysroot64/usr
|
||||||
$sed -i 's/.*INTERFACE_COMPILE_OPTIONS.*//g' $sysroot64/usr/cmake/SoapySDRExport.cmake
|
$sed -i 's/.*INTERFACE_COMPILE_OPTIONS.*//g' $sysroot64/usr/cmake/SoapySDRExport.cmake
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# build rtl_433
|
# build rtl_433
|
||||||
|
|
Loading…
Add table
Reference in a new issue