mirror of
https://github.com/cookiengineer/audacity
synced 2026-01-12 15:45:54 +01:00
Adds an environment to check, how well Linux builds with system packages
A special mode `audacity_obey_system_dependencies` is added, so the build will fail if we could not build against a system package for some reason. The following packages are marked for the local build now: * **wxWidgets**: Ubuntu lacks support for 3.1.3. We can't build against 3.0 branch. * **portaudio**: there are issues, that prevent using a system version of portaudio. * **sqlite3**: Ubuntu package is very dated; we care about the performance and stability. * **nyquist**: Ubuntu has no package available. * **vamp**: Ubuntu has no development package available. * **portmixer**: Ubuntu has no package available. * **sbsms**: Ubuntu package is very dated; we care about the performance and stability. We use docker to create a clean build environment. Currently, `pkg-config` is used to locate the system libraries. There are few issues with `pkg-config` on Ubuntu: * It does not work with `lame` and `portmidi`. * The packaged files for `id3tag` and `mad` have wrong version. We fix such cases by copying the into `/usr/local/lib`.
This commit is contained in:
committed by
Dmitry Vedenko
parent
90903d237a
commit
9c8185545d
@@ -5,6 +5,12 @@ cmd_option( ${_OPT}lib_preference
|
|||||||
STRINGS "system" "local"
|
STRINGS "system" "local"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Special mode, that will force dependencies to the packages provided by system unless they were set to local explicitly.
|
||||||
|
cmd_option( ${_OPT}obey_system_dependencies
|
||||||
|
"Use system packages to satisfy dependencies"
|
||||||
|
Off
|
||||||
|
)
|
||||||
|
|
||||||
# Required libraries
|
# Required libraries
|
||||||
#
|
#
|
||||||
# directory option symbol req chk version
|
# directory option symbol req chk version
|
||||||
|
|||||||
@@ -574,6 +574,7 @@ function( addlib dir name symbol required check )
|
|||||||
if( ${use} STREQUAL "system" )
|
if( ${use} STREQUAL "system" )
|
||||||
# Look them up
|
# Look them up
|
||||||
pkg_check_modules( PKG_${TARGET} ${packages} )
|
pkg_check_modules( PKG_${TARGET} ${packages} )
|
||||||
|
|
||||||
if( PKG_${TARGET}_FOUND )
|
if( PKG_${TARGET}_FOUND )
|
||||||
message( STATUS "Using '${name}' system library" )
|
message( STATUS "Using '${name}' system library" )
|
||||||
|
|
||||||
@@ -586,6 +587,8 @@ function( addlib dir name symbol required check )
|
|||||||
# And add it to our target
|
# And add it to our target
|
||||||
target_include_directories( ${TARGET} INTERFACE ${INCLUDES} )
|
target_include_directories( ${TARGET} INTERFACE ${INCLUDES} )
|
||||||
target_link_libraries( ${TARGET} INTERFACE ${LIBRARIES} )
|
target_link_libraries( ${TARGET} INTERFACE ${LIBRARIES} )
|
||||||
|
elseif( ${_OPT}obey_system_dependencies )
|
||||||
|
message( FATAL_ERROR "Failed to find the system package ${name}" )
|
||||||
else()
|
else()
|
||||||
set( ${use} "local" )
|
set( ${use} "local" )
|
||||||
set_property( CACHE ${use} PROPERTY VALUE "local" )
|
set_property( CACHE ${use} PROPERTY VALUE "local" )
|
||||||
|
|||||||
66
linux/build-environment/Dockerfile
Normal file
66
linux/build-environment/Dockerfile
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
FROM ubuntu:focal
|
||||||
|
|
||||||
|
LABEL maintainer="d.vedenko@audacityteam.org"
|
||||||
|
LABEL description="A build environment to check the builds for the package maintainers"
|
||||||
|
LABEL version="3.0"
|
||||||
|
|
||||||
|
ENV TZ=Europe/London
|
||||||
|
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
||||||
|
|
||||||
|
RUN apt-get update
|
||||||
|
|
||||||
|
RUN apt-get install -y \
|
||||||
|
build-essential \
|
||||||
|
python3-minimal \
|
||||||
|
python3-pip \
|
||||||
|
g++-9 \
|
||||||
|
libstdc++-9-dev \
|
||||||
|
cmake \
|
||||||
|
git
|
||||||
|
|
||||||
|
RUN pip3 install conan
|
||||||
|
|
||||||
|
RUN apt-get install -y \
|
||||||
|
zlib1g-dev \
|
||||||
|
libgtk2.0-dev \
|
||||||
|
libasound2-dev \
|
||||||
|
libavformat-dev \
|
||||||
|
libjack-jackd2-dev \
|
||||||
|
libexpat1-dev \
|
||||||
|
libmp3lame-dev \
|
||||||
|
libsndfile-dev \
|
||||||
|
libsoxr-dev \
|
||||||
|
portaudio19-dev \
|
||||||
|
libsqlite3-dev \
|
||||||
|
libavcodec-dev \
|
||||||
|
libavformat-dev \
|
||||||
|
libavutil-dev \
|
||||||
|
libid3tag0-dev \
|
||||||
|
libmad0-dev \
|
||||||
|
libvamp-hostsdk3v5 \
|
||||||
|
libogg-dev \
|
||||||
|
libvorbis-dev \
|
||||||
|
libflac-dev \
|
||||||
|
libflac++-dev \
|
||||||
|
lv2-dev \
|
||||||
|
liblilv-dev \
|
||||||
|
libserd-dev \
|
||||||
|
libsord-dev \
|
||||||
|
libsratom-dev \
|
||||||
|
libsuil-dev \
|
||||||
|
libportmidi-dev \
|
||||||
|
libportsmf-dev \
|
||||||
|
libsbsms-dev \
|
||||||
|
libsoundtouch-dev \
|
||||||
|
libtwolame-dev \
|
||||||
|
libssl-dev \
|
||||||
|
libcurl4-openssl-dev
|
||||||
|
|
||||||
|
WORKDIR /audacity
|
||||||
|
|
||||||
|
COPY ["build_audacity.sh", "/audacity/"]
|
||||||
|
|
||||||
|
# pkg-config is so broken
|
||||||
|
COPY ["pkgconfig/*", "/usr/local/lib/pkgconfig/"]
|
||||||
|
|
||||||
|
CMD ["./build_audacity.sh"]
|
||||||
45
linux/build-environment/build_audacity.sh
Normal file
45
linux/build-environment/build_audacity.sh
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
conan --version
|
||||||
|
|
||||||
|
if [ ! -d "audacity" ]
|
||||||
|
then
|
||||||
|
git clone https://github.com/audacity/audacity
|
||||||
|
fi
|
||||||
|
|
||||||
|
mkdir -p build
|
||||||
|
|
||||||
|
cd build
|
||||||
|
|
||||||
|
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release \
|
||||||
|
-Daudacity_obey_system_dependencies=On \
|
||||||
|
-Daudacity_use_wxwidgets=local \
|
||||||
|
-Daudacity_use_expat=system \
|
||||||
|
-Daudacity_use_lame=system \
|
||||||
|
-Daudacity_use_sndfile=system \
|
||||||
|
-Daudacity_use_soxr=system \
|
||||||
|
-Daudacity_use_portaudio=local \
|
||||||
|
-Daudacity_use_sqlite=local \
|
||||||
|
-Daudacity_use_ffmpeg=loaded \
|
||||||
|
-Daudacity_use_id3tag=system \
|
||||||
|
-Daudacity_use_mad=system \
|
||||||
|
-Daudacity_use_nyquist=local \
|
||||||
|
-Daudacity_use_vamp=local \
|
||||||
|
-Daudacity_use_ogg=system \
|
||||||
|
-Daudacity_use_vorbis=system \
|
||||||
|
-Daudacity_use_flac=system \
|
||||||
|
-Daudacity_use_lv2=system \
|
||||||
|
-Daudacity_use_midi=system \
|
||||||
|
-Daudacity_use_portmixer=local \
|
||||||
|
-Daudacity_use_portsmf=system \
|
||||||
|
-Daudacity_use_sbsms=local \
|
||||||
|
-Daudacity_use_soundtouch=system \
|
||||||
|
-Daudacity_use_twolame=system \
|
||||||
|
../audacity
|
||||||
|
|
||||||
|
make -j`nproc`
|
||||||
|
|
||||||
|
cd bin/Release
|
||||||
|
mkdir -p "Portable Settings"
|
||||||
|
|
||||||
|
ls -la .
|
||||||
11
linux/build-environment/pkgconfig/id3tag.pc
Normal file
11
linux/build-environment/pkgconfig/id3tag.pc
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
prefix=/usr
|
||||||
|
exec_prefix=${prefix}
|
||||||
|
libdir=${exec_prefix}/lib/x86_64-linux-gnu
|
||||||
|
includedir=${prefix}/include
|
||||||
|
|
||||||
|
Name: id3tag
|
||||||
|
Description: ID3 tag reading library
|
||||||
|
Requires:
|
||||||
|
Version: 0.15.1b
|
||||||
|
Libs: -L${libdir} -lid3tag -lz
|
||||||
|
Cflags: -I${includedir}
|
||||||
11
linux/build-environment/pkgconfig/lame.pc
Normal file
11
linux/build-environment/pkgconfig/lame.pc
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
prefix=/usr
|
||||||
|
exec_prefix=${prefix}
|
||||||
|
libdir=${exec_prefix}/lib/x86_64-linux-gnu
|
||||||
|
includedir=${prefix}/include
|
||||||
|
|
||||||
|
Name: lame
|
||||||
|
Description: MP3 encoding library
|
||||||
|
Requires:
|
||||||
|
Version: 3.100
|
||||||
|
Libs: -L${libdir} -lmp3lame
|
||||||
|
Cflags: -I${includedir}
|
||||||
11
linux/build-environment/pkgconfig/mad.pc
Normal file
11
linux/build-environment/pkgconfig/mad.pc
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
prefix=/usr
|
||||||
|
exec_prefix=${prefix}
|
||||||
|
libdir=${exec_prefix}/lib/x86_64-linux-gnu
|
||||||
|
includedir=${prefix}/include
|
||||||
|
|
||||||
|
Name: mad
|
||||||
|
Description: MPEG Audio Decoder
|
||||||
|
Requires:
|
||||||
|
Version: 0.15.1b
|
||||||
|
Libs: -L${libdir} -lmad
|
||||||
|
Cflags: -I${includedir}
|
||||||
11
linux/build-environment/pkgconfig/portmidi.pc
Normal file
11
linux/build-environment/pkgconfig/portmidi.pc
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
prefix=/usr
|
||||||
|
exec_prefix=${prefix}
|
||||||
|
libdir=${exec_prefix}/lib/x86_64-linux-gnu
|
||||||
|
includedir=${prefix}/include
|
||||||
|
|
||||||
|
Name: portmidi
|
||||||
|
Description: library for real-time MIDI input/output
|
||||||
|
Requires:
|
||||||
|
Version: 0.1
|
||||||
|
Libs: -L${libdir} -lportmidi
|
||||||
|
Cflags: -I${includedir}
|
||||||
Reference in New Issue
Block a user