Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
JVital2013 committed Apr 16, 2024
1 parent 84bab6b commit 1072ad0
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 29 deletions.
38 changes: 15 additions & 23 deletions .github/workflows/all_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -274,22 +274,18 @@ jobs:
path: ${{runner.workspace}}/build/*.deb

build_macos_intel:
runs-on: macos-12
runs-on: macos-13

steps:
- uses: actions/checkout@v4

- name: Install dependencies
run: brew install cmake volk jpeg libpng libtiff glfw airspy rtl-sdr hackrf mbedtls pkg-config libomp dylibbundler portaudio jemalloc

- name: Build airspyhf
run: git clone https://github.com/airspy/airspyhf.git && cd airspyhf && mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Release .. && make -j8 && sudo make install

- name: Build nng
run: git clone -b v1.6.0 https://github.com/nanomsg/nng && cd nng && mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -DNNG_ENABLE_TLS=ON -DNNG_TOOLS=OFF -DNNG_TESTS=OFF -DNNG_ENABLE_NNGCAT=OFF .. && make -j`nproc` && sudo make install
- name: Install build dependencies
run: brew install cmake dylibbundler pkg-config libtool autoconf automake

- name: Build FFTW3
run: wget http://www.fftw.org/fftw-3.3.9.tar.gz && tar xf fftw-3.3.9.tar.gz && rm fftw-3.3.9.tar.gz && cd fftw-3.3.9 && mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=false -DENABLE_FLOAT=true .. && make -j8 && sudo make install
- name: Build vcpkg
working-directory: ${{runner.workspace}}/macOS
shell: bash
run: $GITHUB_WORKSPACE/macOS/Configure-vcpkg.sh

- name: Create Build Environment
# Some projects don't allow in-source building, so create a separate build directory
Expand All @@ -301,7 +297,7 @@ jobs:
# Note the current convention is to use the -S and -B options here to specify source
# and build directories, but this is only available with CMake 3.13 and higher.
# The CMake binaries on the Github Actions machines are (as of this writing) 3.12
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_TOOLCHAIN_FILE=$GITHUB_WORKSPACE/vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 -DVCPKG_TARGET_TRIPLET=x64-osx-satdump

- name: Build
working-directory: ${{runner.workspace}}/build
Expand Down Expand Up @@ -333,17 +329,13 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Install dependencies
run: brew install cmake volk jpeg libpng libtiff glfw airspy rtl-sdr hackrf mbedtls pkg-config libomp dylibbundler portaudio jemalloc

- name: Build airspyhf
run: git clone https://github.com/airspy/airspyhf.git && cd airspyhf && mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Release .. && make -j8 && sudo make install

- name: Build nng
run: git clone -b v1.6.0 https://github.com/nanomsg/nng && cd nng && mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -DNNG_ENABLE_TLS=ON -DNNG_TOOLS=OFF -DNNG_TESTS=OFF -DNNG_ENABLE_NNGCAT=OFF .. && make -j`nproc` && sudo make install
- name: Install build dependencies
run: brew install cmake dylibbundler pkg-config libtool autoconf automake

- name: Build FFTW3
run: wget http://www.fftw.org/fftw-3.3.9.tar.gz && tar xf fftw-3.3.9.tar.gz && rm fftw-3.3.9.tar.gz && cd fftw-3.3.9 && mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=false -DENABLE_FLOAT=true -DENABLE_THREADS=true -DENABLE_SSE=false -DENABLE_SSE2=false -DENABLE_AVX=false -DENABLE_AVX2=false .. && make -j8 && sudo make install
- name: Build vcpkg
working-directory: ${{runner.workspace}}/macOS
shell: bash
run: $GITHUB_WORKSPACE/macOS/Configure-vcpkg.sh

- name: Create Build Environment
# Some projects don't allow in-source building, so create a separate build directory
Expand All @@ -355,7 +347,7 @@ jobs:
# Note the current convention is to use the -S and -B options here to specify source
# and build directories, but this is only available with CMake 3.13 and higher.
# The CMake binaries on the Github Actions machines are (as of this writing) 3.12
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_TOOLCHAIN_FILE=$GITHUB_WORKSPACE/vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 -DVCPKG_TARGET_TRIPLET=arm64-osx-satdump

- name: Build
working-directory: ${{runner.workspace}}/build
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ if(UNIX)
if(BUILD_OPENMP)
message("Compiling with OpenMP support!")
if(APPLE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-command-line-argument -Xpreprocessor)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-command-line-argument -Xpreprocessor")
endif()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp")
endif()
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ mkdir build && cd build
# If you do not want to build the GUI Version, add -DBUILD_GUI=OFF to the command
# If you want to disable some SDRs, you can add -DPLUGIN_HACKRF_SDR_SUPPORT=OFF or similar
# <triplet> can be arm64-osx-satdump or x64-osx-satdump
cmake -DCMAKE_TOOLCHAIN_FILE=../vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_DEPLOYMENT_TARGET=10.14 -DVCPKG_TARGET_TRIPLET=<triplet> ..
cmake -DCMAKE_TOOLCHAIN_FILE=<path-to-satdump>/vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 -DVCPKG_TARGET_TRIPLET=<triplet> ..
make -j$(sysctl -n hw.logicalcpu)

# To run without bundling
Expand Down
8 changes: 5 additions & 3 deletions macOS/Configure-vcpkg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,24 @@ if [[ "$(uname -m)" == "arm64" ]]
then
cp ../macOS/arm64-osx-satdump.cmake triplets
triplet="arm64-osx-satdump"
osx_target="11.0"
else
cp ../macOS/x64-osx-satdump.cmake triplets
triplet="x64-osx-satdump"
osx_target="10.15"
fi
./bootstrap-vcpkg.sh

echo "Installing vcpkg packages..."
./vcpkg install --triplet $triplet libjpeg-turbo tiff libpng glfw3 libusb fftw3 portaudio jemalloc nng[mbedtls] zstd
./vcpkg install --triplet $triplet libjpeg-turbo tiff libpng glfw3 libusb fftw3 portaudio jemalloc nng[mbedtls] zstd armadillo
mkdir build && cd build

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=$triplet -DCMAKE_INSTALL_PREFIX=$(cd ../installed/$triplet && pwd) -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15"
build_args="-DCMAKE_TOOLCHAIN_FILE=$(cd ../scripts/buildsystems && pwd)/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=$triplet -DCMAKE_INSTALL_PREFIX=$(cd ../installed/$triplet && pwd) -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_DEPLOYMENT_TARGET=$osx_target"
libusb_include="$(cd ../installed/$triplet/include/libusb-1.0 && pwd)"
libusb_lib="$(cd ../installed/$triplet/lib && pwd)/libusb-1.0.0.dylib"

Expand All @@ -45,7 +47,7 @@ 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 ..
cmake $build_args -DLIBOMP_INSTALL_ALIASES=OFF ..
make -j$(sysctl -n hw.logicalcpu)
make install
cd ../../..
Expand Down
2 changes: 1 addition & 1 deletion macOS/bundle.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ fi

echo "Re-linking binaries"
plugin_args=$(ls MacApp/SatDump.app/Contents/Resources/plugins | xargs printf -- '-x MacApp/SatDump.app/Contents/Resources/plugins/%s ')
dylibbundler $SIGN_FLAG -cd -s /usr/local/lib -d MacApp/SatDump.app/Contents/libs -b -x MacApp/SatDump.app/Contents/MacOS/satdump-ui -x MacApp/SatDump.app/Contents/MacOS/satdump_sdr_server -x MacApp/SatDump.app/Contents/MacOS/satdump -x MacApp/SatDump.app/Contents/MacOS/libsatdump_core.dylib $plugin_args
dylibbundler $SIGN_FLAG -cd -d MacApp/SatDump.app/Contents/libs -b -x MacApp/SatDump.app/Contents/MacOS/satdump-ui -x MacApp/SatDump.app/Contents/MacOS/satdump_sdr_server -x MacApp/SatDump.app/Contents/MacOS/satdump -x MacApp/SatDump.app/Contents/MacOS/libsatdump_core.dylib $plugin_args

if [[ -n "$MACOS_SIGNING_SIGNATURE" ]]
then
Expand Down

0 comments on commit 1072ad0

Please sign in to comment.