Skip to content

Commit

Permalink
Update build instructions and workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
williamyang98 committed Feb 17, 2024
1 parent 5955717 commit aaa4849
Show file tree
Hide file tree
Showing 12 changed files with 66 additions and 73 deletions.
16 changes: 12 additions & 4 deletions .github/workflows/macos.yml → .github/workflows/x86-macos.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: macos
name: x86-macos

on:
workflow_dispatch:
Expand All @@ -7,6 +7,8 @@ on:

env:
BUILD_TYPE: Release
BUILD_DIR: build
PACKAGE_DIR: build-out
OSX_TARGET: "12.0"

jobs:
Expand Down Expand Up @@ -52,13 +54,19 @@ jobs:
sudo cmake --build build --config ${{env.BUILD_TYPE}} --target install
- name: Configure CMake
run: cmake . -B ${{github.workspace}}/build-macos -DCMAKE_OSX_DEPLOYMENT_TARGET=${{env.OSX_TARGET}} -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -G Ninja
run: cmake . -B ${{github.workspace}}/${{env.BUILD_DIR}} -DCMAKE_OSX_DEPLOYMENT_TARGET=${{env.OSX_TARGET}} -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -G Ninja

- name: Build
run: cmake --build ${{github.workspace}}/build-macos --config ${{env.BUILD_TYPE}} --target dab_plugin
run: cmake --build ${{github.workspace}}/${{env.BUILD_DIR}} --config ${{env.BUILD_TYPE}} --target dab_plugin

- name: Create package
run: |
mkdir -p ${{env.PACKAGE_DIR}}
cp ${{env.BUILD_DIR}}/src/*.dylib ${{env.PACKAGE_DIR}}/
cp README.md ${{env.PACKAGE_DIR}}/
- name: Upload files (Release)
uses: actions/upload-artifact@v3
with:
name: sdrpp_dab_radio_plugin_macos
path: ${{github.workspace}}/build-macos/src
path: ${{github.workspace}}/${{env.PACKAGE_DIR}}
26 changes: 15 additions & 11 deletions .github/workflows/x86-ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ on:

env:
BUILD_TYPE: Release
BUILD_DIR: build
PACKAGE_DIR: build-out

jobs:
skip_check:
Expand All @@ -21,7 +23,7 @@ jobs:
concurrent_skipping: 'same_content'
cancel_others: 'true'
skip_after_successful_duplicate: 'true'
paths_ignore: '["**/README.md", "**/docs/**", "**/LICENSE.txt", "vcpkg.json", "toolchains/windows/*"]'
paths_ignore: '["**/README.md", "**/docs/**", "**/LICENSE.txt", "vcpkg.json", "toolchains/windows/*", "toolchains/macos/*"]'
do_not_skip: '["workflow_dispatch", "schedule"]'

build:
Expand All @@ -34,25 +36,27 @@ jobs:
- uses: actions/checkout@v3
with:
submodules: recursive

- name: Install packages
shell: bash
run: ./toolchains/ubuntu/install_packages.sh

run: |
sudo apt-get update
./toolchains/ubuntu/install_packages.sh
- name: Configure CMake
shell: bash
run: cmake -B ${{github.workspace}}/build-ubuntu -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -G Ninja -DCMAKE_TOOLCHAIN_FILE=${{github.workspace}}/toolchains/ubuntu/linux-gnu-toolchain.cmake
run: cmake . -B ${{github.workspace}}/${{env.BUILD_DIR}} -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -G Ninja

- name: Build
run: ninja -C ${{github.workspace}}/build-ubuntu dab_plugin
run: cmake --build ${{github.workspace}}/${{env.BUILD_DIR}} --target dab_plugin

- name: Create package
shell: sh
run: ./toolchains/ubuntu/create_package.sh
run: |
mkdir -p ${{env.PACKAGE_DIR}}
cp ${{env.BUILD_DIR}}/src/*.so ${{env.PACKAGE_DIR}}/
cp README.md ${{env.PACKAGE_DIR}}/
- name: Upload files (Release)
uses: actions/upload-artifact@v3
with:
name: sdrpp_dab_radio_plugin_ubuntu
path: ${{github.workspace}}/plugin_package
path: ${{github.workspace}}/${{env.PACKAGE_DIR}}

17 changes: 11 additions & 6 deletions .github/workflows/x86-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ on:

env:
BUILD_TYPE: Release
BUILD_DIR: build
PACKAGE_DIR: build-out

jobs:
skip_check:
Expand All @@ -21,7 +23,7 @@ jobs:
concurrent_skipping: 'same_content'
cancel_others: 'true'
skip_after_successful_duplicate: 'true'
paths_ignore: '["**/README.md", "**/docs/**", "**/LICENSE.txt", "toolchains/ubuntu/*"]'
paths_ignore: '["**/README.md", "**/docs/**", "**/LICENSE.txt", "toolchains/ubuntu/*", "toolchains/macos/*"]'
do_not_skip: '["workflow_dispatch", "schedule"]'

build:
Expand Down Expand Up @@ -49,17 +51,20 @@ jobs:
run: python -m pip install mako

- name: Configure CMake
run: cmake -B ${{github.workspace}}/build-windows -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_TOOLCHAIN_FILE:STRING=${{github.workspace}}/vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -G "Ninja"
run: cmake -B ${{github.workspace}}/${{env.BUILD_DIR}} -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_TOOLCHAIN_FILE:STRING=${{github.workspace}}/vcpkg/scripts/buildsystems/vcpkg.cmake -G Ninja

- name: Build
run: cmake --build ${{github.workspace}}/build-windows --config ${{env.BUILD_TYPE}} --target dab_plugin
run: cmake --build ${{github.workspace}}/${{env.BUILD_DIR}} --config ${{env.BUILD_TYPE}} --target dab_plugin

- name: Create package
shell: sh
run: ./toolchains/windows/create_package.sh
shell: bash
run: |
mkdir -p ${{env.PACKAGE_DIR}}
cp ${{env.BUILD_DIR}}/src/*.dll ${{env.PACKAGE_DIR}}/
cp README.md ${{env.PACKAGE_DIR}}/
- name: Upload files (Release)
uses: actions/upload-artifact@v3
with:
name: sdrpp_dab_radio_plugin_windows
path: ${{github.workspace}}/plugin_package
path: ${{github.workspace}}/${{env.PACKAGE_DIR}}
7 changes: 2 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## Introduction
[![x86-windows](https://github.com/williamyang98/SDRPlusPlus-DAB-Radio-Plugin/actions/workflows/x86-windows.yml/badge.svg)](https://github.com/williamyang98/SDRPlusPlus-DAB-Radio-Plugin/actions/workflows/x86-windows.yml)
[![x86-ubuntu](https://github.com/williamyang98/SDRPlusPlus-DAB-Radio-Plugin/actions/workflows/x86-ubuntu.yml/badge.svg)](https://github.com/williamyang98/SDRPlusPlus-DAB-Radio-Plugin/actions/workflows/x86-ubuntu.yml)
[![macos](https://github.com/williamyang98/SDRPlusPlus-DAB-Radio-Plugin/actions/workflows/macos.yml/badge.svg)](https://github.com/williamyang98/SDRPlusPlus-DAB-Radio-Plugin/actions/workflows/macos.yml)
[![x86-macos](https://github.com/williamyang98/SDRPlusPlus-DAB-Radio-Plugin/actions/workflows/x86-macos.yml/badge.svg)](https://github.com/williamyang98/SDRPlusPlus-DAB-Radio-Plugin/actions/workflows/x86-macos.yml)

SDR++ DAB radio plugin.

Expand Down Expand Up @@ -35,11 +35,8 @@ Download from releases page or build using the instructions below. Make sure you
7. If no sound is present, check the ```Sinks``` tab and make sure that ```DAB Radio``` is set to ```Audio``` and to the correct audio device.
8. You may also copy ```fftw3f.dll``` into the main SDR++ folder since it is compiled with AVX2 which may improve performance. Be sure to backup the original file before replacing it.

### Ubuntu
Build using the instructions at ```./toolchains/ubuntu/README.md```.

## Build instructions
Refer to ```./toolchains/*/README.md``` for build instructions.
Refer to ```toolchains/*/README.md``` for build instructions. The github workflows in ```.github/workflows``` can also be used as a reference for a working build setup.

## TODO
- Improve the user interface so that you can view as much information as the original GUI found [here](https://github.com/williamyang98/DAB-Radio).
Expand Down
20 changes: 20 additions & 0 deletions toolchains/macos/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Instructions
Clone the repository recursively so all the submodules are installed.
```git clone https://github.com/williamyang98/SDRPlusPlus-DAB-Radio-Plugin.git --recurse-submodules```

## Steps
1. Update brew: ```brew update```
2. Install packages: ```brew bundle install --file=./toolchains/macos/Brewfile```
3. Install mako: ```pip3 install mako```
4. Install volk:
- Change to volk: ```cd vendor/volk```
- Configure cmake: ```cmake . -B build -DCMAKE_BUILD_TYPE=Release -G Ninja```
- Build and install: ```sudo cmake --build build --config Release --target install```
5. Configure cmake: ```cmake . -B build -DCMAKE_BUILD_TYPE=Release -G Ninja```
6. Build: ```cmake --build build --config Release --target dab_plugin```

## Install files
Copy ```build/src/dab_plugin.dylib``` into your SDR++ modules directory.

Make sure that the version of SDR++ in ```vendor/sdrplusplus``` is the same as your SDR++ installation.

11 changes: 5 additions & 6 deletions toolchains/ubuntu/README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
# Instructions
Clone the repository recursively so all the submodules are installed.
```git clone https://github.com/williamyang98/SDRPlusPlus-DAB-Radio-Plugin```
```git clone https://github.com/williamyang98/SDRPlusPlus-DAB-Radio-Plugin.git --recurse-submodules```

## Steps
1. ```./toolchains/ubuntu/install_packages.sh```.
2. ```./toolchains/ubuntu/cmake_configure.sh```.
3. ```ninja -C build-ubuntu dab_plugin```.
4. ```./toolchains/ubuntu/create_package.sh```.
1. Install packages: ```./toolchains/ubuntu/install_packages.sh```.
2. Configure cmake: ```cmake . -B build -DCMAKE_BUILD_TYPE=Release -G Ninja```.
3. Build: ```cmake --build build --config Release```.

## Install files
Copy the contents of ```plugin_package/``` into ```/usr/lib/sdrpp/plugins/```.
Copy ```build/src/dab_plugin.so``` into ```/usr/lib/sdrpp/plugins/```.

Make sure that the version of SDR++ in ```vendor/sdrplusplus``` is the same as your SDR++ installation.

11 changes: 0 additions & 11 deletions toolchains/ubuntu/cmake_configure.sh

This file was deleted.

8 changes: 0 additions & 8 deletions toolchains/ubuntu/create_package.sh

This file was deleted.

2 changes: 0 additions & 2 deletions toolchains/ubuntu/linux-gnu-toolchain.cmake

This file was deleted.

2 changes: 1 addition & 1 deletion toolchains/windows/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Instructions
Clone the repository recursively so all the submodules are installed.

```git clone https://github.com/williamyang98/SDRPlusPlus-DAB-Radio-Plugin --recurse-submodules```
```git clone https://github.com/williamyang98/SDRPlusPlus-DAB-Radio-Plugin.git --recurse-submodules```

## Prerequistes
### Volk
Expand Down
11 changes: 0 additions & 11 deletions toolchains/windows/cmake_configure.sh

This file was deleted.

8 changes: 0 additions & 8 deletions toolchains/windows/create_package.sh

This file was deleted.

0 comments on commit aaa4849

Please sign in to comment.