Skip to content

Commit

Permalink
Merge branch 'sm0svx:master' into svxlink-usrp
Browse files Browse the repository at this point in the history
  • Loading branch information
dl1hrc authored Feb 11, 2024
2 parents b8e97fb + feb0340 commit d5d3c35
Show file tree
Hide file tree
Showing 37 changed files with 1,605 additions and 137 deletions.
87 changes: 63 additions & 24 deletions docker/debian-build/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,56 +1,95 @@
# Build with:
# docker build --pull -t svxlink-debian-build .
#
# Run with:
# docker run -it --rm --hostname debian-build svxlink-debian-build
# Build container image with:
# podman build --pull -t svxlink-debian-build .
#
# Optional build arguments:
# --build-arg=FROM=<base image>
# --build-arg=SOUNDS_VER=<sound pack version>
# --build-arg=SOUNDS_LANG=<sound pack language>
# --build-arg=SOUNDS_VOICE=<sound pack voice>
# --build-arg=SOUNDS_RATE=<sound pack sample rate>
# --build-arg=SOUNDS_URL=<sound pack url>
# --build-arg=GIT_URL_DEFAULT=<git repo>
# --build-arg=GIT_SSL_NO_VERIFY_DEFAULT=<true/false>
# --build-arg=GIT_BRANCH_DEFAULT=<git branch>
# --build-arg=NUM_CORES_DEFAULT=<build with # cores>
#
# Run container with:
# podman run -it --rm --hostname debian-build --userns=keep-id svxlink-debian-build
#
# For using sound inside the docker container add:
# --privileged -v /dev/snd:/dev/snd
# -e HOSTAUDIO_GID=$(stat -c "%g" /dev/snd/timer)
# --privileged -v /dev/snd:/dev/snd
#
# To import your git config add (mileage may vary):
# -v ${HOME}/.gitconfig:/home/svxlink/.gitconfig:ro
# To import your git config add:
# -v ${HOME}/.gitconfig:/home/svxlink/.gitconfig:ro
#
# To use a specific git repositoty instead of the default one:
# -e [email protected]:/path/to/svxlink.git
# To use a specific git repository instead of the default one:
# -e [email protected]:/path/to/svxlink.git
# -e GIT_URL=https://your.repo.srv/path/to/svxlink.git
# -e GIT_SSL_NO_VERIFY=true
#
# To build another branch than master:
# -e GIT_BRANCH=the_branch
# -e GIT_BRANCH=the_branch
#
# To use the local workingcopy rather then cloning the repo in the container:
# -v $(pwd)/../..:/home/svxlink/svxlink:ro
#
# To use more than one CPU core when compiling:
# -e NUM_CORES=8
# -e NUM_CORES=8
#
# Build software with:
# ./build-svxlink.sh
#
# Run software with:
# svxlink

FROM debian
ARG FROM=debian:latest

FROM ${FROM}
MAINTAINER Tobias Blomberg <[email protected]>

# Install required packages and set up the svxlink user
RUN apt-get update && \
apt-get -y install git cmake g++ make libsigc++-2.0-dev libgsm1-dev \
libpopt-dev tcl8.6-dev libgcrypt20-dev libspeex-dev \
libasound2-dev alsa-utils vorbis-tools libqt4-dev \
libopus-dev librtlsdr-dev libcurl4-openssl-dev curl sudo
libasound2-dev alsa-utils vorbis-tools qtbase5-dev \
qttools5-dev qttools5-dev-tools libopus-dev \
librtlsdr-dev libjsoncpp-dev libcurl4-openssl-dev \
libgpiod-dev libogg-dev curl sudo
#RUN apt-get -y install groff doxygen

ARG SOUNDS_VER="19.09.99.3"
ARG SOUNDS_LANG="en_US"
ARG SOUNDS_VOICE="heather"
ARG SOUNDS_RATE="16k"
ARG SOUNDS_URL="https://github.com/sm0svx/svxlink-sounds-${SOUNDS_LANG}-${SOUNDS_VOICE}/releases/download/${SOUNDS_VER}/svxlink-sounds-${SOUNDS_LANG}-${SOUNDS_VOICE}-${SOUNDS_RATE}-${SOUNDS_VER}.tar.bz2"

# Install svxlink audio files
RUN mkdir -p /usr/share/svxlink/sounds && \
cd /usr/share/svxlink/sounds && \
curl -LO https://github.com/sm0svx/svxlink-sounds-en_US-heather/releases/download/14.08/svxlink-sounds-en_US-heather-16k-13.12.tar.bz2 && \
curl -LO ${SOUNDS_URL} && \
tar xvaf svxlink-sounds-* && \
ln -s en_US-heather-16k en_US && \
ln -s ${SOUNDS_LANG}-${SOUNDS_VOICE}-${SOUNDS_RATE} ${SOUNDS_LANG} && \
rm svxlink-sounds-*

# Set up password less sudo for user svxlink
# Set up password-less sudo for user svxlink
ADD sudoers-svxlink /etc/sudoers.d/svxlink
RUN chmod 0440 /etc/sudoers.d/svxlink

ENV GIT_URL=https://github.com/sm0svx/svxlink.git \
GIT_BRANCH=master \
NUM_CORES=1
ARG GIT_URL_DEFAULT="https://github.com/sm0svx/svxlink.git"
ARG GIT_SSL_NO_VERIFY_DEFAULT="false"
ARG GIT_BRANCH_DEFAULT="master"
ARG NUM_CORES_DEFAULT="1"

ENV GIT_URL=${GIT_URL_DEFAULT} \
GIT_SSL_NO_VERIFY=${GIT_SSL_NO_VERIFY_DEFAULT} \
GIT_BRANCH=${GIT_BRANCH_DEFAULT} \
NUM_CORES=${NUM_CORES_DEFAULT}

RUN useradd -s /bin/bash svxlink
ADD build-svxlink.sh /home/svxlink/
RUN chown -R svxlink.svxlink /home/svxlink
RUN chown -R svxlink:svxlink /home/svxlink

ADD entrypoint.sh /
ENTRYPOINT ["/entrypoint.sh"]
WORKDIR /home/svxlink
USER svxlink:svxlink
ENTRYPOINT ["/bin/bash"]
23 changes: 12 additions & 11 deletions docker/debian-build/build-svxlink.sh
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
#!/bin/bash -xe
#!/bin/bash -x

set -euo pipefail

GIT_BRANCH=${GIT_BRANCH:-master}

# Make sure that we are in the home directory
cd

# Clone or update the repo
if [[ ! -d svxlink ]]; then
git clone $GIT_URL svxlink
git clone --branch=$GIT_BRANCH $GIT_URL svxlink
cd svxlink
else
cd svxlink
git fetch
git checkout master
git reset --hard origin/master
fi

# Checkout the wanted branch
if [ -n "$GIT_BRANCH" ]; then
git checkout $GIT_BRANCH
if [[ -w . ]]; then
git fetch
git checkout $GIT_BRANCH
git reset --hard origin/$GIT_BRANCH
fi
fi

# Find out how many cores we've got
# How many cores to use during the build
num_cores=${NUM_CORES:-1}

# Create a build directory and build svxlink
Expand Down
99 changes: 68 additions & 31 deletions docker/ubuntu-build/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,59 +1,96 @@
# Build with:
# docker build --pull -t svxlink-ubuntu-build .
#
# Run with:
# docker run -it --rm --hostname ubuntu-build svxlink-ubuntu-build
# Build container image with:
# podman build --pull -t svxlink-ubuntu-build .
#
# Optional build arguments:
# --build-arg=FROM=<base image>
# --build-arg=SOUNDS_VER=<sound pack version>
# --build-arg=SOUNDS_LANG=<sound pack language>
# --build-arg=SOUNDS_VOICE=<sound pack voice>
# --build-arg=SOUNDS_RATE=<sound pack sample rate>
# --build-arg=SOUNDS_URL=<sound pack url>
# --build-arg=GIT_URL_DEFAULT=<git repo>
# --build-arg=GIT_SSL_NO_VERIFY_DEFAULT=<true/false>
# --build-arg=GIT_BRANCH_DEFAULT=<git branch>
# --build-arg=NUM_CORES_DEFAULT=<build with # cores>
#
# Run container with:
# podman run -it --rm --hostname ubuntu-build --userns=keep-id svxlink-ubuntu-build
#
# For using sound inside the docker container add:
# --privileged -v /dev/snd:/dev/snd
# -e HOSTAUDIO_GID=$(stat -c "%g" /dev/snd/timer)
# --privileged -v /dev/snd:/dev/snd
#
# To import your git config add (your mileage may vary):
# -v ${HOME}/.gitconfig:/home/svxlink/.gitconfig:ro
# To import your git config add:
# -v ${HOME}/.gitconfig:/home/svxlink/.gitconfig:ro
#
# To use a specific git repositoty instead of the default one:
# -e [email protected]:/path/to/svxlink.git
# To use a specific git repository instead of the default one:
# -e [email protected]:/path/to/svxlink.git
# -e GIT_URL=https://your.repo.srv/path/to/svxlink.git
# -e GIT_SSL_NO_VERIFY=true
#
# To build another branch than master:
# -e GIT_BRANCH=the_branch
# -e GIT_BRANCH=the_branch
#
# To use the local workingcopy rather then cloning the repo in the container:
# -v $(pwd)/../..:/home/svxlink/svxlink:ro
#
# To use more than one CPU core when compiling:
# -e NUM_CORES=8
# -e NUM_CORES=8
#
# Build software with:
# ./build-svxlink.sh
#
# Run software with:
# svxlink

FROM ubuntu
MAINTAINER Tobias Blomberg <[email protected]>
ARG FROM=ubuntu:latest

FROM ${FROM}
MAINTAINER Tobias Blomberg <[email protected]>

# Install required packages and set up the svxlink user
RUN apt update && \
RUN apt-get update && \
export DEBIAN_FRONTEND=noninteractive && \
apt -y install git cmake g++ make libsigc++-2.0-dev libgsm1-dev \
libpopt-dev tcl-dev libgcrypt20-dev libspeex-dev \
libasound2-dev alsa-utils vorbis-tools qtbase5-dev \
qttools5-dev qttools5-dev-tools libopus-dev \
librtlsdr-dev libjsoncpp-dev libcurl4-openssl-dev \
curl sudo
#RUN apt -y install groff doxygen
apt-get -y install git cmake g++ make libsigc++-2.0-dev libgsm1-dev \
libpopt-dev tcl8.6-dev libgcrypt20-dev libspeex-dev \
libasound2-dev alsa-utils vorbis-tools qtbase5-dev \
qttools5-dev qttools5-dev-tools libopus-dev \
librtlsdr-dev libjsoncpp-dev libcurl4-openssl-dev \
libgpiod-dev libogg-dev curl sudo
#RUN apt-get -y install groff doxygen

ARG SOUNDS_VER="19.09.99.3"
ARG SOUNDS_LANG="en_US"
ARG SOUNDS_VOICE="heather"
ARG SOUNDS_RATE="16k"
ARG SOUNDS_URL="https://github.com/sm0svx/svxlink-sounds-${SOUNDS_LANG}-${SOUNDS_VOICE}/releases/download/${SOUNDS_VER}/svxlink-sounds-${SOUNDS_LANG}-${SOUNDS_VOICE}-${SOUNDS_RATE}-${SOUNDS_VER}.tar.bz2"

# Install svxlink audio files
RUN mkdir -p /usr/share/svxlink/sounds && \
cd /usr/share/svxlink/sounds && \
curl -LO https://github.com/sm0svx/svxlink-sounds-en_US-heather/releases/download/19.09.99.1/svxlink-sounds-en_US-heather-16k-19.09.99.1.tar.bz2 && \
curl -LO ${SOUNDS_URL} && \
tar xvaf svxlink-sounds-* && \
ln -s en_US-heather-16k en_US && \
ln -s ${SOUNDS_LANG}-${SOUNDS_VOICE}-${SOUNDS_RATE} ${SOUNDS_LANG} && \
rm svxlink-sounds-*

# Set up password less sudo for user svxlink
# Set up password-less sudo for user svxlink
ADD sudoers-svxlink /etc/sudoers.d/svxlink
RUN chmod 0440 /etc/sudoers.d/svxlink

ENV GIT_URL=https://github.com/sm0svx/svxlink.git \
GIT_BRANCH=master \
NUM_CORES=1
ARG GIT_URL_DEFAULT="https://github.com/sm0svx/svxlink.git"
ARG GIT_SSL_NO_VERIFY_DEFAULT="false"
ARG GIT_BRANCH_DEFAULT="master"
ARG NUM_CORES_DEFAULT="1"

ENV GIT_URL=${GIT_URL_DEFAULT} \
GIT_SSL_NO_VERIFY=${GIT_SSL_NO_VERIFY_DEFAULT} \
GIT_BRANCH=${GIT_BRANCH_DEFAULT} \
NUM_CORES=${NUM_CORES_DEFAULT}

RUN useradd -s /bin/bash svxlink
ADD build-svxlink.sh /home/svxlink/
RUN chown -R svxlink.svxlink /home/svxlink
RUN chown -R svxlink:svxlink /home/svxlink

ADD entrypoint.sh /
ENTRYPOINT ["/entrypoint.sh"]
WORKDIR /home/svxlink
USER svxlink:svxlink
ENTRYPOINT ["/bin/bash"]
23 changes: 12 additions & 11 deletions docker/ubuntu-build/build-svxlink.sh
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
#!/bin/bash -xe
#!/bin/bash -x

set -euo pipefail

GIT_BRANCH=${GIT_BRANCH:-master}

# Make sure that we are in the home directory
cd

# Clone or update the repo
if [[ ! -d svxlink ]]; then
git clone $GIT_URL svxlink
git clone --branch=$GIT_BRANCH $GIT_URL svxlink
cd svxlink
else
cd svxlink
git fetch
git checkout master
git reset --hard origin/master
fi

# Checkout the wanted branch
if [ -n "$GIT_BRANCH" ]; then
git checkout $GIT_BRANCH
if [[ -w . ]]; then
git fetch
git checkout $GIT_BRANCH
git reset --hard origin/$GIT_BRANCH
fi
fi

# Find out how many cores we've got
# How many cores to use during the build
num_cores=${NUM_CORES:-1}

# Create a build directory and build svxlink
Expand Down
18 changes: 17 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
##############################################################################
# Project setup
##############################################################################
cmake_minimum_required(VERSION 2.8.12)
cmake_minimum_required(VERSION 3.5)
project(svxlink C CXX)
#enable_testing()

Expand Down Expand Up @@ -295,6 +295,22 @@ add_definitions(${SIGC2_DEFINITIONS})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${SIGC2_CXX_FLAGS}")
set(LIBS ${LIBS} ${SIGC2_LIBRARIES})

find_package(LADSPA)
if(LADSPA_FOUND)
if(DEFINED LADSPA_VERSION_MAJOR)
include_directories(${LADSPA_INCLUDE_DIRS})
add_definitions(${LADSPA_DEFINITIONS})
else()
message(WARNING
"Found LADSPA but version could not be resolved. "
"Will proceed without LADSPA.")
endif()
else(LADSPA_FOUND)
message("-- LADSPA is an optional dependency. The build will complete")
message("-- without it but support for loading LADSPA plugins will")
message("-- be unavailable.")
endif(LADSPA_FOUND)

# Find the chown utility
include(FindCHOWN)

Expand Down
3 changes: 3 additions & 0 deletions src/async/ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@
* Bugfix Async::HttpServerConnection: EOL handling failed with newer
compilers.

* New class Async::AudioLADSPAPlugin which enable the use of LADSPA plugins to
process audio.



1.6.0 -- 01 Sep 2019
Expand Down
1 change: 1 addition & 0 deletions src/async/audio/AsyncAudioContainerWav.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ An example of how to use the Async::AudioContainer class

#include <sigc++/sigc++.h>
#include <cstring>
#include <cstdint>


/****************************************************************************
Expand Down
Loading

0 comments on commit d5d3c35

Please sign in to comment.