Browse Source

Rework bootstrap-common

Signed-off-by: falkTX <falktx@falktx.com>
master
falkTX 3 weeks ago
parent
commit
d1a7209f71
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
5 changed files with 154 additions and 39 deletions
  1. +68
    -26
      bootstrap-common.sh
  2. +4
    -1
      bootstrap-qt.sh
  3. +1
    -1
      setup/env.sh
  4. +50
    -0
      setup/functions.sh
  5. +31
    -11
      setup/versions.sh

+ 68
- 26
bootstrap-common.sh View File

@@ -51,7 +51,7 @@ if [ "${LINUX}" -eq 1 ]; then
if [ ! -e "${TARGET_PKG_CONFIG_PATH}/glib-2.0.pc" ]; then
ln -s $(pkg-config --variable=pcfiledir glib-2.0)/g{io,lib,module,object,thread}-2.0.pc ${TARGET_PKG_CONFIG_PATH}/
fi
if [ "${LINUX}" -eq 1 ] && [ ! -e "${TARGET_PKG_CONFIG_PATH}/libpcre.pc" ]; then
if [ ! -e "${TARGET_PKG_CONFIG_PATH}/libpcre.pc" ]; then
ln -s $(pkg-config --variable=pcfiledir libpcre)/libpcre.pc ${TARGET_PKG_CONFIG_PATH}/
fi
fi
@@ -59,73 +59,115 @@ fi
# ---------------------------------------------------------------------------------------------------------------------
# pkgconfig

download pkg-config "${PKG_CONFIG_VERSION}" "https://pkg-config.freedesktop.org/releases"
download pkg-config "${PKG_CONFIG_VERSION}" "${PKG_CONFIG_URL}"
build_host_autoconf pkg-config "${PKG_CONFIG_VERSION}" "--enable-indirect-deps --with-internal-glib --with-pc-path=${TARGET_PKG_CONFIG_PATH}"

if [ "${CROSS_COMPILING}" -eq 1 ] && [ ! -e "${PAWPAW_PREFIX}/bin/${TOOLCHAIN_PREFIX_}pkg-config" ]; then
ln -s pkg-config "${PAWPAW_PREFIX}/bin/${TOOLCHAIN_PREFIX_}pkg-config"
fi

# ---------------------------------------------------------------------------------------------------------------------
# libogg

download libogg "${LIBOGG_VERSION}" "https://ftp.osuosl.org/pub/xiph/releases/ogg"
patch_file libogg "${LIBOGG_VERSION}" "include/ogg/os_types.h" 's/__MACH__/__MACH_SKIP__/'
download libogg "${LIBOGG_VERSION}" "${LIBOGG_URL}"
build_autoconf libogg "${LIBOGG_VERSION}"

# ---------------------------------------------------------------------------------------------------------------------
# libvorbis

download libvorbis "${LIBVORBIS_VERSION}" "https://ftp.osuosl.org/pub/xiph/releases/vorbis"
build_autoconf libvorbis "${LIBVORBIS_VERSION}" "--disable-examples"
LIBVORBIS_EXTRAFLAGS="--disable-examples"

download libvorbis "${LIBVORBIS_VERSION}" "${LIBVORBIS_URL}"
build_autoconf libvorbis "${LIBVORBIS_VERSION}" "${LIBVORBIS_EXTRAFLAGS}"

# ---------------------------------------------------------------------------------------------------------------------
# flac
# flac (forces intrinsic optimizations on macos-universal target)

FLAC_EXTRAFLAGS="--disable-doxygen-docs --disable-examples --disable-thorough-tests --disable-xmms-plugin"

if [ "${MACOS_OLD}" -eq 1 ]; then
FLAC_EXTRAFLAGS+=" --disable-asm-optimizations"
elif [ "${MACOS_UNIVERSAL}" -eq 1 ]; then
if [ "${MACOS_UNIVERSAL}" -eq 1 ]; then
FLAC_EXTRAFLAGS+=" ac_cv_header_x86intrin_h=yes asm_opt=yes"
fi

download flac "${FLAC_VERSION}" "https://ftp.osuosl.org/pub/xiph/releases/flac" "tar.xz"
patch_file flac "${FLAC_VERSION}" "configure" 's/amd64|x86_64/amd64|arm|x86_64/'
download flac "${FLAC_VERSION}" "${FLAC_URL}" "tar.xz"

if [ "${MACOS_UNIVERSAL}" -eq 1 ]; then
patch_file flac "${FLAC_VERSION}" "configure" 's/amd64|x86_64/amd64|arm|x86_64/'
fi

build_autoconf flac "${FLAC_VERSION}" "${FLAC_EXTRAFLAGS}"

if [ "${CROSS_COMPILING}" -eq 0 ]; then
run_make flac "${FLAC_VERSION}" check
fi

# ---------------------------------------------------------------------------------------------------------------------
# opus

OPUS_EXTRAFLAGS="--disable-extra-programs --enable-custom-modes --enable-float-approx"
# FIXME macos-universal proper optimizations

OPUS_EXTRAFLAGS="--enable-custom-modes --enable-float-approx"

# FIXME
if [ "${MACOS_OLD}" -eq 1 ] || [ "${MACOS_UNIVERSAL}" -eq 1 ]; then
OPUS_EXTRAFLAGS+=" --disable-asm --disable-rtcd --disable-intrinsics"
if [ "${CROSS_COMPILING}" -eq 1 ]; then
OPUS_EXTRAFLAGS+=" --disable-extra-programs"
fi
if [ "${MACOS_OLD}" -eq 1 ]; then
OPUS_EXTRAFLAGS+=" --disable-intrinsics"
fi

download opus "${OPUS_VERSION}" "https://archive.mozilla.org/pub/opus"
download opus "${OPUS_VERSION}" "${OPUS_URL}"
build_autoconf opus "${OPUS_VERSION}" "${OPUS_EXTRAFLAGS}"

# ---------------------------------------------------------------------------------------------------------------------
# libsamplerate

download libsamplerate "${LIBSAMPLERATE_VERSION}" "http://www.mega-nerd.com/SRC"
build_autoconf libsamplerate "${LIBSAMPLERATE_VERSION}" "--disable-fftw --disable-sndfile"
if [ "${CROSS_COMPILING}" -eq 0 ]; then
run_make opus "${OPUS_VERSION}" check
fi

# ---------------------------------------------------------------------------------------------------------------------
# libsndfile

download libsndfile "${LIBSNDFILE_VERSION}" "https://github.com/libsndfile/libsndfile/releases/download/${LIBSNDFILE_VERSION}" "tar.bz2"
LIBSNDFILE_EXTRAFLAGS="--disable-alsa --disable-full-suite --disable-sqlite"

# otherwise tests fail
export EXTRA_CFLAGS="-frounding-math -fsignaling-nans"

if [ "${MACOS_OLD}" -eq 0 ]; then
export EXTRA_CFLAGS+=" -fno-associative-math"
fi

download libsndfile "${LIBSNDFILE_VERSION}" "${LIBSNDFILE_URL}" "tar.bz2"

if [ "${MACOS_OLD}" -eq 1 ]; then
patch_file libsndfile "${LIBSNDFILE_VERSION}" "src/sfconfig.h" 's/#define USE_SSE2/#undef USE_SSE2/'
fi

build_autoconf libsndfile "${LIBSNDFILE_VERSION}" "--disable-alsa --disable-full-suite --disable-sqlite"
build_autoconf libsndfile "${LIBSNDFILE_VERSION}" "${LIBSNDFILE_EXTRAFLAGS}"

if [ "${CROSS_COMPILING}" -eq 0 ]; then
run_make libsndfile "${LIBSNDFILE_VERSION}" "check -j 8"
fi

# ---------------------------------------------------------------------------------------------------------------------
# libsamplerate

LIBSAMPLERATE_EXTRAFLAGS="--disable-fftw"

if [ "${CROSS_COMPILING}" -eq 1 ]; then
LIBSAMPLERATE_EXTRAFLAGS+=" --disable-sndfile"
fi

download libsamplerate "${LIBSAMPLERATE_VERSION}" "${LIBSAMPLERATE_URL}"
build_autoconf libsamplerate "${LIBSAMPLERATE_VERSION}" "${LIBSAMPLERATE_EXTRAFLAGS}"

if [ "${CROSS_COMPILING}" -eq 0 ]; then
run_make libsamplerate "${LIBSAMPLERATE_VERSION}" check
fi

# ---------------------------------------------------------------------------------------------------------------------
# zlib (skipped on macOS)

if [ "${MACOS}" -eq 0 ]; then
download zlib ${ZLIB_VERSION} "https://github.com/madler/zlib.git" "" "git"
build_conf zlib ${ZLIB_VERSION} "--static --prefix=${PAWPAW_PREFIX}"
git_clone zlib "${ZLIB_VERSION}" "https://github.com/madler/zlib.git"
build_conf zlib "${ZLIB_VERSION}" "--static --prefix=${PAWPAW_PREFIX}"
fi

# ---------------------------------------------------------------------------------------------------------------------

+ 4
- 1
bootstrap-qt.sh View File

@@ -306,8 +306,11 @@ build_qmake qtsvg${qtsuffix} ${QT5_VERSION}
# qttools (host only, thus not needed if cross-compiling)

if [ "${CROSS_COMPILING}" -eq 0 ]; then
if [ "${QT5_MVERSION}" = "5.12" ]; then
QTTOOLS_EXTRAFLAGS=". -- -no-feature-qdoc"
fi
download_qt qttools
build_qmake qttools${qtsuffix} ${QT5_VERSION} ". -- -no-feature-qdoc"
build_qmake qttools${qtsuffix} ${QT5_VERSION} "${QTTOOLS_EXTRAFLAGS}"
fi

# ---------------------------------------------------------------------------------------------------------------------

+ 1
- 1
setup/env.sh View File

@@ -106,7 +106,7 @@ else
LINK_FLAGS+=" -lssp_nonshared"
fi
else
LINK_FLAGS+=" -static-libgcc -static-libstdc++ -Wl,-Bstatic"
LINK_FLAGS+=" -static-libgcc -static-libstdc++"
fi
fi



+ 50
- 0
setup/functions.sh View File

@@ -71,6 +71,35 @@ function copy_download() {
fi
}

function git_clone() {
local name="${1}"
local hash="${2}"
local repourl="${3}"
local dlname="${4}"

if [ -z "${dlname}" ]; then
dlname="${name}"
fi

local dlfile="${PAWPAW_DOWNLOADDIR}/${dlname}-${hash}.tar.gz"
local dlfolder="${PAWPAW_BUILDDIR}/${name}-${hash}"

if [ ! -f "${dlfile}" ]; then
local tmprepodir="${PAWPAW_TMPDIR}/${dlname}-${hash}"
rm -rf "${tmprepodir}"
git clone --recursive "${repourl}" "${tmprepodir}"
git -C "${tmprepodir}" checkout "${hash}"
git -C "${tmprepodir}" submodule update
tar --exclude=".git" -czf "${dlfile}" -C "${PAWPAW_TMPDIR}" "${dlname}-${hash}"
rm -rf "${tmprepodir}"
fi

if [ ! -d "${dlfolder}" ]; then
mkdir "${dlfolder}"
tar -xf "${dlfile}" -C "${dlfolder}" --strip-components=1
fi
}

# ---------------------------------------------------------------------------------------------------------------------

function _prebuild() {
@@ -494,6 +523,27 @@ function build_waf() {

# ---------------------------------------------------------------------------------------------------------------------

function run_make() {
local name="${1}"
local version="${2}"
local makerule="${3}"

local pkgdir="${PAWPAW_BUILDDIR}/${name}-${version}"

_prebuild "${name}" "${pkgdir}"

if [ ! -f "${pkgdir}/.stamp_custom_run" ]; then
pushd "${pkgdir}"
make ${makerule}
touch .stamp_custom_run
popd
fi

_postbuild
}

# ---------------------------------------------------------------------------------------------------------------------

function build_host_autoconf() {
local name="${1}"
local version="${2}"


+ 31
- 11
setup/versions.sh View File

@@ -1,26 +1,47 @@
#!/bin/bash

# ---------------------------------------------------------------------------------------------------------------------
# base
# common URLs

XIPH_URL=https://downloads.xiph.org/releases

# ---------------------------------------------------------------------------------------------------------------------
# bootstrap base

PKG_CONFIG_URL=https://pkg-config.freedesktop.org/releases
PKG_CONFIG_VERSION=0.28

# ---------------------------------------------------------------------------------------------------------------------
# common
# bootstrap common

FLAC_VERSION=1.3.3
FLUIDSYNTH_VERSION=f65c6ba25fb2c7e37c89fc6a4afc5aa645e208c2 # 1.1.11
GLIB_VERSION=2.22.5
GLIB_MVERSION=2.22
LIBLO_VERSION=0.30
LIBOGG_URL=${XIPH_URL}/ogg
LIBOGG_VERSION=1.3.5
LIBSAMPLERATE_VERSION=0.1.9
LIBSNDFILE_VERSION=1.0.31

LIBVORBIS_URL=${XIPH_URL}/vorbis
LIBVORBIS_VERSION=1.3.7

FLAC_URL=${XIPH_URL}/flac
FLAC_VERSION=1.3.3

OPUS_URL=https://archive.mozilla.org/pub/opus
OPUS_VERSION=1.3.1

LIBSNDFILE_URL=https://github.com/libsndfile/libsndfile/releases/download/1.0.31
LIBSNDFILE_VERSION=1.0.31

LIBSAMPLERATE_URL=http://www.mega-nerd.com/SRC
LIBSAMPLERATE_VERSION=0.1.9

ZLIB_URL=https://github.com/madler/zlib.git
ZLIB_VERSION=cacf7f1d4e3d44d871b605da3b647f07d718623f # 1.2.11

# ---------------------------------------------------------------------------------------------------------------------
# plugins
# bootstrap plugins

FLUIDSYNTH_VERSION=f65c6ba25fb2c7e37c89fc6a4afc5aa645e208c2 # 1.1.11
GLIB_VERSION=2.22.5
GLIB_MVERSION=2.22
LIBLO_VERSION=0.30

CARLA_VERSION=ca44f4bc538690e76f4e02544f047ad9d559a1b8
FFTW_VERSION=3.3.9
@@ -34,7 +55,6 @@ PCRE_VERSION=8.44
SERD_VERSION=0.30.8
SORD_VERSION=0.16.8
SRATOM_VERSION=0.6.8
ZLIB_VERSION=cacf7f1d4e3d44d871b605da3b647f07d718623f # 1.2.11

LV2LINT_SUPPORTED=1



Loading…
Cancel
Save