Browse Source

Merge branch 'master' of github.com:DISTRHO/PawPaw

tags/v1.0
falkTX 4 years ago
parent
commit
ba9a338e47
13 changed files with 1510 additions and 82 deletions
  1. +4
    -2
      .travis/install.sh
  2. +115
    -37
      bootstrap.sh
  3. +64
    -13
      build-jack.sh
  4. +257
    -0
      build-qt.sh
  5. +60
    -0
      patches/fluidsynth/01_skip-drivers-build.patch
  6. +40
    -0
      patches/glib/01_skip-gettext.patch
  7. +11
    -0
      patches/portaudio19/01_build-asio-device-adapter.patch
  8. +67
    -0
      patches/portaudio19/02_fix-wdmks-wasapi-dsound.patch
  9. +14
    -0
      patches/qjackctl/01_fix-win32-build.patch
  10. +747
    -0
      patches/qtbase/01_osx10.8-compat.patch
  11. +12
    -7
      setup/env.sh
  12. +111
    -16
      setup/functions.sh
  13. +8
    -7
      setup/versions.sh

+ 4
- 2
.travis/install.sh View File

@@ -5,8 +5,10 @@ set -e
# common
sudo apt-get install -y build-essential curl cmake jq

# for cross-compilation
if [ "${TARGET}" = "macos-old" ]; then
if [ "${TARGET}" = "linux" ]; then
sudo apt-get install -y libglib2.0-dev

elif [ "${TARGET}" = "macos-old" ]; then
mkdir -p ${HOME}/PawPawBuilds/debs
pushd ${HOME}/PawPawBuilds/debs
if [ ! -f 'apple-uni-sdk-10.5_20110407-0.flosoft1_amd64.deb' ]; then


+ 115
- 37
bootstrap.sh View File

@@ -31,10 +31,19 @@ source setup/env.sh
source setup/functions.sh
source setup/versions.sh

mkdir -p ${PAWPAW_BUILDDIR}
mkdir -p ${PAWPAW_DOWNLOADDIR}
mkdir -p ${PAWPAW_PREFIX}
mkdir -p ${PAWPAW_TMPDIR}
mkdir -p "${PAWPAW_BUILDDIR}"
mkdir -p "${PAWPAW_DOWNLOADDIR}"
mkdir -p "${PAWPAW_PREFIX}"
mkdir -p "${PAWPAW_TMPDIR}"

# ---------------------------------------------------------------------------------------------------------------------
# let's use native glib for linux builds

if [ "${LINUX}" -eq 1 ] && [ ! -e "${TARGET_PKG_CONFIG_PATH}/glib-2.0.pc" ]; then
mkdir -p ${TARGET_PKG_CONFIG_PATH}
ln -s $(pkg-config --variable=pcfiledir glib-2.0)/g{io,lib,module,object,thread}-2.0.pc ${TARGET_PKG_CONFIG_PATH}/
ln -s $(pkg-config --variable=pcfiledir libpcre)/libpcre.pc ${TARGET_PKG_CONFIG_PATH}/
fi

# ---------------------------------------------------------------------------------------------------------------------
# pkgconfig
@@ -43,16 +52,47 @@ download pkg-config "${PKG_CONFIG_VERSION}" "https://pkg-config.freedesktop.org/
build_host_autoconf pkg-config "${PKG_CONFIG_VERSION}" "--enable-indirect-deps --with-internal-glib --with-pc-path=${TARGET_PKG_CONFIG_PATH}"

# ---------------------------------------------------------------------------------------------------------------------
# liblo
# file/magic (posix only)

download liblo "${LIBLO_VERSION}" "http://download.sourceforge.net/liblo"
build_autoconf liblo "${LIBLO_VERSION}" "--enable-threads --disable-examples --disable-tests --disable-tools"
# if [ "${WIN32}" -eq 0 ]; then
# download file "${FILE_VERSION}" "ftp://ftp.astron.com/pub/file"
# build_autoconf file "${FILE_VERSION}"
# fi

# ---------------------------------------------------------------------------------------------------------------------
# zlib
# glib

if [ "${MACOS}" -eq 1 ] || [ "${WIN32}" -eq 1 ]; then
if [ "${WIN32}" -eq 1 ]; then
GLIB_EXTRAFLAGS="--with-threads=win32"
else
GLIB_EXTRAFLAGS="--with-threads=posix"
fi

download glib ${GLIB_VERSION} "http://caesar.ftp.acc.umu.se/pub/GNOME/sources/glib/${GLIB_MVERSION}" "${GLIB_TAR_EXT}"

if [ "${MACOS}" -eq 1 ]; then
export EXTRA_LDFLAGS="-lresolv"
patch_file glib ${GLIB_VERSION} "glib/gconvert.c" '/#error/g'

if [ "${MACOS_OLD}" -eq 1 ]; then
GLIB_EXTRAFLAGS+=" glib_cv_stack_grows=yes"
GLIB_EXTRAFLAGS+=" glib_cv_rtldglobal_broken=no"
GLIB_EXTRAFLAGS+=" glib_cv_uscore=no"
GLIB_EXTRAFLAGS+=" ac_cv_func_posix_getpwuid_r=yes"
GLIB_EXTRAFLAGS+=" ac_cv_func_posix_getgrgid_r=yes"
patch_file glib ${GLIB_VERSION} "configure.in" 's/G_ATOMIC_I486/G_ATOMIC_I486_NOT/'
fi
fi

build_autoconfgen glib ${GLIB_VERSION} "${GLIB_EXTRAFLAGS}"
fi

download zlib "${ZLIB_VERSION}" "https://github.com/madler/zlib/archive"
build_conf zlib "${ZLIB_VERSION}" "--static --prefix=${PAWPAW_PREFIX}"
# ---------------------------------------------------------------------------------------------------------------------
# liblo

download liblo "${LIBLO_VERSION}" "http://download.sourceforge.net/liblo"
build_autoconf liblo "${LIBLO_VERSION}" "--enable-threads --disable-examples --disable-tests --disable-tools"

# ---------------------------------------------------------------------------------------------------------------------
# libogg
@@ -61,14 +101,6 @@ download libogg "${LIBOGG_VERSION}" "https://ftp.osuosl.org/pub/xiph/releases/og
patch_file libogg "${LIBOGG_VERSION}" "include/ogg/os_types.h" 's/__MACH__/__MACH_SKIP__/'
build_autoconf libogg "${LIBOGG_VERSION}"

# ---------------------------------------------------------------------------------------------------------------------
# file/magic (posix only)

# if [ "${WIN32}" -eq 0 ]; then
# download file "${FILE_VERSION}" "ftp://ftp.astron.com/pub/file"
# build_autoconf file "${FILE_VERSION}"
# fi

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

@@ -87,25 +119,6 @@ fi
download flac "${FLAC_VERSION}" "https://ftp.osuosl.org/pub/xiph/releases/flac" "tar.xz"
build_autoconf flac "${FLAC_VERSION}" "${FLAC_EXTRAFLAGS}"

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

download libsamplerate "${LIBSAMPLERATE_VERSION}" "http://www.mega-nerd.com/SRC"
build_autoconf libsamplerate "${LIBSAMPLERATE_VERSION}" "--disable-fftw --disable-sndfile"

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

download libsndfile "${LIBSNDFILE_VERSION}" "http://www.mega-nerd.com/libsndfile/files"
patch_file libsndfile "${LIBSNDFILE_VERSION}" "configure" 's/ -Wvla//'
build_autoconf libsndfile "${LIBSNDFILE_VERSION}" "--disable-full-suite --disable-alsa --disable-sqlite"

# ---------------------------------------------------------------------------------------------------------------------
# lv2

download lv2 "${LV2_VERSION}" "http://lv2plug.in/spec" "tar.bz2"
build_waf lv2 "${LV2_VERSION}" "--lv2dir=${PAWPAW_PREFIX}/lib/lv2 --no-coverage --no-plugins"

# ---------------------------------------------------------------------------------------------------------------------
# fftw

@@ -139,3 +152,68 @@ fi
build_autoconf fftwf "${FFTW_VERSION}" "${FFTWF_EXTRAFLAGS}"

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

download libsamplerate "${LIBSAMPLERATE_VERSION}" "http://www.mega-nerd.com/SRC"
build_autoconf libsamplerate "${LIBSAMPLERATE_VERSION}" "--disable-fftw --disable-sndfile"

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

download libsndfile "${LIBSNDFILE_VERSION}" "http://www.mega-nerd.com/libsndfile/files"
patch_file libsndfile "${LIBSNDFILE_VERSION}" "configure" 's/ -Wvla//'
build_autoconf libsndfile "${LIBSNDFILE_VERSION}" "--disable-full-suite --disable-alsa --disable-sqlite"

# ---------------------------------------------------------------------------------------------------------------------
# lv2

download lv2 "${LV2_VERSION}" "http://lv2plug.in/spec" "tar.bz2"
build_waf lv2 "${LV2_VERSION}" "--lv2dir=${PAWPAW_PREFIX}/lib/lv2 --no-coverage --no-plugins"

# ---------------------------------------------------------------------------------------------------------------------
# fluidsynth

FLUIDSYNTH_EXTRAFLAGS="-Denable-floats=ON"
FLUIDSYNTH_EXTRAFLAGS+=" -Denable-alsa=OFF"
FLUIDSYNTH_EXTRAFLAGS+=" -Denable-aufile=OFF"
FLUIDSYNTH_EXTRAFLAGS+=" -Denable-coreaudio=OFF"
FLUIDSYNTH_EXTRAFLAGS+=" -Denable-coremidi=OFF"
FLUIDSYNTH_EXTRAFLAGS+=" -Denable-dbus=OFF"
FLUIDSYNTH_EXTRAFLAGS+=" -Denable-debug=OFF"
FLUIDSYNTH_EXTRAFLAGS+=" -Denable-fpe-check=OFF"
FLUIDSYNTH_EXTRAFLAGS+=" -Denable-framework=OFF"
FLUIDSYNTH_EXTRAFLAGS+=" -Denable-ipv6=OFF"
FLUIDSYNTH_EXTRAFLAGS+=" -Denable-jack=OFF"
FLUIDSYNTH_EXTRAFLAGS+=" -Denable-ladcca=OFF"
FLUIDSYNTH_EXTRAFLAGS+=" -Denable-ladspa=OFF"
FLUIDSYNTH_EXTRAFLAGS+=" -Denable-lash=OFF"
FLUIDSYNTH_EXTRAFLAGS+=" -Denable-midishare=OFF"
FLUIDSYNTH_EXTRAFLAGS+=" -Denable-oss=OFF"
FLUIDSYNTH_EXTRAFLAGS+=" -Denable-portaudio=OFF"
FLUIDSYNTH_EXTRAFLAGS+=" -Denable-profiling=OFF"
FLUIDSYNTH_EXTRAFLAGS+=" -Denable-pulseaudio=OFF"
FLUIDSYNTH_EXTRAFLAGS+=" -Denable-readline=OFF"
FLUIDSYNTH_EXTRAFLAGS+=" -Denable-trap-on-fpe=OFF"

download fluidsynth ${FLUIDSYNTH_VERSION} "https://github.com/FluidSynth/fluidsynth/archive"
patch_file fluidsynth ${FLUIDSYNTH_VERSION} "CMakeLists.txt" 's/_init_lib_suffix "64"/_init_lib_suffix ""/'
build_cmake fluidsynth ${FLUIDSYNTH_VERSION} "${FLUIDSYNTH_EXTRAFLAGS}"
# touch src/fluidsynth

# sed -i -e "s|-lfluidsynth|-lfluidsynth -lglib-2.0 -lgthread-2.0 -lsndfile -lFLAC -lvorbisenc -lvorbis -logg -lpthread -lm -liconv|" ${PREFIX}/lib/pkgconfig/fluidsynth.pc

# ---------------------------------------------------------------------------------------------------------------------
# mxml

download mxml ${MXML_VERSION} "https://github.com/michaelrsweet/mxml/archive"
build_autoconf mxml ${MXML_VERSION} "--disable-shared --prefix=${PAWPAW_PREFIX}"

# ---------------------------------------------------------------------------------------------------------------------
# zlib

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

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

+ 64
- 13
build-jack.sh View File

@@ -5,6 +5,9 @@ set -e
cd $(dirname ${0})
PAWPAW_ROOT="${PWD}"

JACK2_VERSION=git
QJACKCTL_VERSION=0.6.2

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

target="${1}"
@@ -18,10 +21,6 @@ fi

# TODO check that bootstrap.sh has been run

# TODO
# - portaudio (with asio support) for windows
# - readline for windows?

source setup/check_target.sh
source setup/env.sh
source setup/functions.sh
@@ -114,8 +113,22 @@ if [ "${WIN32}" -eq 1 ]; then
ASIO_DIR="${PAWPAW_BUILDDIR}/rtaudio-${RTAUDIO_VERSION}/include"
export EXTRA_CFLAGS="-I${ASIO_DIR}"
export EXTRA_CXXFLAGS="-I${ASIO_DIR}"
export EXTRA_MAKE_ARGS="-j 1"
download portaudio19 "${PORTAUDIO_VERSION}" "http://deb.debian.org/debian/pool/main/p/portaudio19" "orig.tar.gz"
build_autoconf portaudio19 "${PORTAUDIO_VERSION}" "--enable-cxx --with-asiodir="${ASIO_DIR}" --with-winapi=asio"
remove_file portaudio19 "${PORTAUDIO_VERSION}" "src/hostapi/wasapi/mingw-include/audioclient.h"
remove_file portaudio19 "${PORTAUDIO_VERSION}" "src/hostapi/wasapi/mingw-include/devicetopology.h"
remove_file portaudio19 "${PORTAUDIO_VERSION}" "src/hostapi/wasapi/mingw-include/endpointvolume.h"
remove_file portaudio19 "${PORTAUDIO_VERSION}" "src/hostapi/wasapi/mingw-include/functiondiscoverykeys.h"
remove_file portaudio19 "${PORTAUDIO_VERSION}" "src/hostapi/wasapi/mingw-include/ksguid.h"
remove_file portaudio19 "${PORTAUDIO_VERSION}" "src/hostapi/wasapi/mingw-include/ksproxy.h"
remove_file portaudio19 "${PORTAUDIO_VERSION}" "src/hostapi/wasapi/mingw-include/ksuuids.h"
remove_file portaudio19 "${PORTAUDIO_VERSION}" "src/hostapi/wasapi/mingw-include/mmdeviceapi.h"
remove_file portaudio19 "${PORTAUDIO_VERSION}" "src/hostapi/wasapi/mingw-include/propkeydef.h"
remove_file portaudio19 "${PORTAUDIO_VERSION}" "src/hostapi/wasapi/mingw-include/propsys.h"
remove_file portaudio19 "${PORTAUDIO_VERSION}" "src/hostapi/wasapi/mingw-include/rpcsal.h"
remove_file portaudio19 "${PORTAUDIO_VERSION}" "src/hostapi/wasapi/mingw-include/sal.h"
remove_file portaudio19 "${PORTAUDIO_VERSION}" "src/hostapi/wasapi/mingw-include/structuredquery.h"
build_autoconf portaudio19 "${PORTAUDIO_VERSION}" "--enable-cxx --with-asiodir="${ASIO_DIR}" --with-winapi=asio,directx,wasapi,wdmks,wmme"
fi

# ---------------------------------------------------------------------------------------------------------------------
@@ -136,12 +149,10 @@ fi
# ---------------------------------------------------------------------------------------------------------------------
# and finally jack2

if [ ! -d jack2 ]; then
git clone --recursive git@github.com:jackaudio/jack2.git
fi

jack2_args="--prefix="${PAWPAW_PREFIX}/jack2""
jack2_repo="git@github.com:jackaudio/jack2.git"
jack2_prefix="${PAWPAW_PREFIX}/jack2"

jack2_args="--prefix=${jack2_prefix}"
# if [ "${MACOS_OLD}" -eq 1 ] || [ "${WIN64}" -eq 1 ]; then
# jack2_args="${jack2_args} --mixed"
# fi
@@ -160,9 +171,49 @@ if [ "${MACOS_OLD}" -eq 1 ]; then
patch_file jack2 "git" "wscript" '/-Wno-deprecated-register/d'
fi

ln -sf "$(pwd)/jack2" "${PAWPAW_BUILDDIR}/jack2-git"
rm -f "${PAWPAW_BUILDDIR}/jack2-git/.stamp_built"
build_waf jack2 "git" "${jack2_args}"
if [ "${JACK2_VERSION}" = "git" ]; then
if [ ! -d jack2 ]; then
git clone --recursive "${jack2_repo}"
fi
if [ ! -e "${PAWPAW_BUILDDIR}/jack2-git" ]; then
ln -sf "$(pwd)/jack2" "${PAWPAW_BUILDDIR}/jack2-git"
fi
rm -f "${PAWPAW_BUILDDIR}/jack2-git/.stamp_built"
else
download jack2 "${JACK2_VERSION}" "${jack2_repo}" "" "git"
fi

build_waf jack2 "${JACK2_VERSION}" "${jack2_args}"

# patch pkg-config file for static builds in regular prefix
if [ ! -e "${PAWPAW_PREFIX}/lib/pkgconfig/jack.pc" ]; then
if [ "${WIN64}" -eq 1 ]; then
s="64"
else
s=""
fi
cp -v "${PAWPAW_PREFIX}/jack2/lib/pkgconfig/jack.pc" "${PAWPAW_PREFIX}/lib/pkgconfig/jack.pc"
if [ "${WIN32}" -eq 1 ]; then
# FIXME rule that works for server lib too
sed -i -e "s/lib -ljack${s}/lib -Wl,-Bdynamic -ljack${s} -Wl,-Bstatic/" "${PAWPAW_PREFIX}/lib/pkgconfig/jack.pc"
fi
fi

# ---------------------------------------------------------------------------------------------------------------------
# if qt is available, build qjackctl

if [ -f "${PAWPAW_PREFIX}/bin/moc" ]; then
download qjackctl "${QJACKCTL_VERSION}" https://download.sourceforge.net/qjackctl
if [ "${WIN64}" -eq 1 ]; then
patch_file qjackctl "${QJACKCTL_VERSION}" "configure" 's/-ljack /-Wl,-Bdynamic -ljack64 -Wl,-Bstatic /'
elif [ "${WIN32}" -eq 1 ]; then
patch_file qjackctl "${QJACKCTL_VERSION}" "configure" 's/-ljack /-Wl,-Bdynamic -ljack -Wl,-Bstatic /'
fi
build_autoconf qjackctl "${QJACKCTL_VERSION}" "--enable-jack-version"
if [ "${WIN32}" -eq 1 ]; then
copy_file qjackctl "${QJACKCTL_VERSION}" "src/release/qjackctl.exe" "${PAWPAW_PREFIX}/jack2/bin/qjackctl.exe"
fi
fi


if [ "${MACOS}" -eq 1 ] && [ "${CROSS_COMPILING}" -eq 0 ]; then


+ 257
- 0
build-qt.sh View File

@@ -0,0 +1,257 @@
#!/bin/bash

set -e

cd $(dirname ${0})
PAWPAW_ROOT="${PWD}"

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

target="${1}"

if [ -z "${target}" ]; then
echo "usage: ${0} <target>"
exit 1
fi

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

# TODO check that bootstrap.sh has been run

source setup/check_target.sh
source setup/env.sh
source setup/functions.sh
source setup/versions.sh

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

qtsuffix="-opensource-src"

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

function download_qt() {
local name="${1}"

local dlfile="${PAWPAW_DOWNLOADDIR}/${name}${qtsuffix}-${QT5_VERSION}.tar.xz"
local dlfolder="${PAWPAW_BUILDDIR}/${name}${qtsuffix}-${QT5_VERSION}"

if [ ! -f "${dlfile}" ]; then
dlurl="https://download.qt.io/archive/qt/${QT5_MVERSION}/${QT5_VERSION}/submodules/${name}${qtsuffix}-${QT5_VERSION}.tar.xz"
curl -L "${dlurl}" -o "${dlfile}"
fi

if [ ! -d "${dlfolder}" ]; then
mkdir "${dlfolder}"
tar -xf "${dlfile}" -C "${dlfolder}" --strip-components=1
fi
# if [ ! -d "${dlfolder}" ]; then
# unzip "${dlfile}" -d "${PAWPAW_BUILDDIR}"
# chmod +x "${dlfolder}/configure"
# dos2unix "${dlfolder}/configure"
# fi
}

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

function build_qt_conf() {
local name="${1}"
local extraconfrules="${2}"

local pkgdir="${PAWPAW_BUILDDIR}/${name}${qtsuffix}-${QT5_VERSION}"

unset AR
unset CC
unset CXX
unset LD
unset STRIP
unset CFLAGS
unset CPPFLAGS
unset CXXFLAGS
unset LDFLAGS

export PKG_CONFIG="${TARGET_PKG_CONFIG}"
export PKG_CONFIG_LIBDIR="${TARGET_PKG_CONFIG_PATH}"
export PKG_CONFIG_PATH="${TARGET_PKG_CONFIG_PATH}"
export PKG_CONFIG_SYSROOT_DIR="${TARGET_PKG_CONFIG_PATH}"

if [ -d "${PAWPAW_ROOT}/patches/${name}" ]; then
for p in $(ls "${PAWPAW_ROOT}/patches/${name}/" | grep "\.patch" | sort); do
if [ ! -f "${pkgdir}/.stamp_applied_${p}" ]; then
patch -p1 -d "${pkgdir}" -i "${PAWPAW_ROOT}/patches/${name}/${p}"
touch "${pkgdir}/.stamp_applied_${p}"
fi
done
fi

if [ ! -f "${pkgdir}/.stamp_configured" ]; then
pushd "${pkgdir}"
./configure ${extraconfrules}
touch .stamp_configured
popd
fi

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

if [ ! -f "${pkgdir}/.stamp_installed" ]; then
pushd "${pkgdir}"
make ${MAKE_ARGS} -j 1 install
touch .stamp_installed
popd
fi

unset PKG_CONFIG
unset PKG_CONFIG_LIBDIR
unset PKG_CONFIG_PATH
unset PKG_CONFIG_SYSROOT_DIR
}

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

# base
qtbase_conf_args="-opensource -confirm-license"
qtbase_conf_args+=" -c++std c++11"
# qtbase_conf_args+=" -optimized-qmake"
qtbase_conf_args+=" -optimize-size"
qtbase_conf_args+=" -release -strip"
# qtbase_conf_args+=" -static"
qtbase_conf_args+=" -shared"
qtbase_conf_args+=" -silent"
# qtbase_conf_args+=" -verbose"

# build type
qtbase_conf_args+=" -make libs"
qtbase_conf_args+=" -make tools"
qtbase_conf_args+=" -gui"
qtbase_conf_args+=" -widgets"

# paths
qtbase_conf_args+=" -prefix ${PAWPAW_PREFIX}"
qtbase_conf_args+=" -headerdir ${PAWPAW_PREFIX}/include/qt5"
qtbase_conf_args+=" -libexecdir ${PAWPAW_PREFIX}/libexec"
qtbase_conf_args+=" -plugindir ${PAWPAW_PREFIX}/lib/qt5/plugins"

# enable optimizations (sse2 only)
qtbase_conf_args+=" -sse2"
qtbase_conf_args+=" -no-sse3 -no-ssse3 -no-sse4.1 -no-sse4.2 -no-avx -no-avx2 -no-avx512"

# enable some basic stuff
qtbase_conf_args+=" -opengl desktop"
qtbase_conf_args+=" -qt-doubleconversion"
qtbase_conf_args+=" -qt-pcre"
qtbase_conf_args+=" -qt-sqlite"

# disable examples and tests
qtbase_conf_args+=" -nomake examples"
qtbase_conf_args+=" -nomake tests"
qtbase_conf_args+=" -no-compile-examples"

# disable a couple of things
qtbase_conf_args+=" -no-cups"
qtbase_conf_args+=" -no-dbus"
qtbase_conf_args+=" -no-directfb"
qtbase_conf_args+=" -no-eglfs"
qtbase_conf_args+=" -no-evdev"
qtbase_conf_args+=" -no-eventfd"
qtbase_conf_args+=" -no-journald"
qtbase_conf_args+=" -no-glib"
qtbase_conf_args+=" -no-gtk"
qtbase_conf_args+=" -no-icu"
qtbase_conf_args+=" -no-inotify"
qtbase_conf_args+=" -no-libinput"
qtbase_conf_args+=" -no-libproxy"
qtbase_conf_args+=" -no-mtdev"
qtbase_conf_args+=" -no-openssl"
qtbase_conf_args+=" -no-pch"
qtbase_conf_args+=" -no-sctp"
qtbase_conf_args+=" -no-securetransport"
qtbase_conf_args+=" -no-syslog"
qtbase_conf_args+=" -no-tslib"
qtbase_conf_args+=" -no-xinput2"
qtbase_conf_args+=" -no-xkbcommon-evdev"
qtbase_conf_args+=" -no-xkbcommon-x11"

# font stuff
qtbase_conf_args+=" -qt-freetype"
qtbase_conf_args+=" -no-fontconfig"
qtbase_conf_args+=" -no-harfbuzz"

# supported image formats
qtbase_conf_args+=" -qt-libjpeg"
qtbase_conf_args+=" -qt-libpng"
qtbase_conf_args+=" -no-gif"
qtbase_conf_args+=" -no-ico"

# use pkg-config
qtbase_conf_args+=" -pkg-config"
qtbase_conf_args+=" -force-pkg-config"

# platform specific
if [ "${CROSS_COMPILING}" -eq 1 ]; then
if [ "${LINUX}" -eq 1 ]; then
qtbase_conf_args+=" -xplatform linux-g++"
elif [ "${MACOS}" -eq 1 ]; then
qtbase_conf_args+=" -xplatform macx-clang"
elif [ "${WIN32}" -eq 1 ]; then
qtbase_conf_args+=" -xplatform win32-g++"
fi
qtbase_conf_args+=" -device-option CROSS_COMPILE=${TOOLCHAIN_PREFIX_}"
else
if [ "${LINUX}" -eq 1 ]; then
qtbase_conf_args+=" -platform linux-g++"
elif [ "${MACOS}" -eq 1 ]; then
qtbase_conf_args+=" -platform macx-clang"
elif [ "${WIN32}" -eq 1 ]; then
qtbase_conf_args+=" -platform win32-g++"
fi
fi

# platform specific
if [ "${LINUX}" -eq 1 ]; then
qtbase_conf_args+=" -qpa xcb"
qtbase_conf_args+=" -qt-xcb"
qtbase_conf_args+=" -xcb-xlib"
elif [ "${MACOS}" -eq 1 ]; then
qtbase_conf_args+=" -qpa cocoa"
elif [ "${WIN32}" -eq 1 ]; then
qtbase_conf_args+=" -qpa windows"
fi

# zlib
if [ "${MACOS}" -eq 1 ]; then
qtbase_conf_args+=" -system-zlib"
else
qtbase_conf_args+=" -qt-zlib"
fi

download_qt qtbase
# patch_file qtbase${qtsuffix} ${QT5_VERSION} "configure" 's/ --sdk $sdk / /'
# patch_file qtbase${qtsuffix} ${QT5_VERSION} "mkspecs/features/mac/sdk.prf" 's/ --sdk $$sdk / /'
patch_file qtbase${qtsuffix} ${QT5_VERSION} "mkspecs/macx-clang/qmake.conf" 's/10.10/10.8/'
patch_file qtbase${qtsuffix} ${QT5_VERSION} "mkspecs/win32-g++/qmake.conf" 's/= -shared/= -static -shared/'
patch_file qtbase${qtsuffix} ${QT5_VERSION} "src/plugins/platforms/direct2d/direct2d.pro" 's/-lVersion/-lversion/'
build_qt_conf qtbase "${qtbase_conf_args}"

if [ "${MACOS}" -eq 1 ] && [ ! -e "ln -s ${PAWPAW_PREFIX}/include/qt5/QtCore" ]; then
ln -sfv ${PAWPAW_PREFIX}/lib/QtCore.framework/Headers ${PAWPAW_PREFIX}/include/qt5/QtCore
ln -sfv ${PAWPAW_PREFIX}/lib/QtGui.framework/Headers ${PAWPAW_PREFIX}/include/qt5/QtGui
ln -sfv ${PAWPAW_PREFIX}/lib/QtWidgets.framework/Headers ${PAWPAW_PREFIX}/include/qt5/QtWidgets
fi

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

download_qt qtsvg
build_qmake qtsvg${qtsuffix} ${QT5_VERSION}

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

if [ "${CROSS_COMPILING}" -eq 0 ]; then
download_qt qttools
build_qmake qttools${qtsuffix} ${QT5_VERSION}
fi

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

+ 60
- 0
patches/fluidsynth/01_skip-drivers-build.patch View File

@@ -0,0 +1,60 @@
--- fluidsynth-static-1.1.11.orig/src/CMakeLists.txt
+++ fluidsynth-static-1.1.11/src/CMakeLists.txt
@@ -175,11 +175,6 @@ set ( libfluidsynth_SOURCES
midi/fluid_midi_router.h
midi/fluid_seqbind.c
midi/fluid_seq.c
- drivers/fluid_adriver.c
- drivers/fluid_adriver.h
- drivers/fluid_mdriver.c
- drivers/fluid_mdriver.h
- drivers/fluid_aufile.c
bindings/fluid_cmd.c
bindings/fluid_cmd.h
bindings/fluid_filerenderer.c
@@ -335,32 +330,14 @@ target_link_libraries ( libfluidsynth
${LIBFLUID_LIBS}
)
-# ************ CLI program ************
-
-set ( fluidsynth_SOURCES fluidsynth.c )
-
-add_executable ( fluidsynth
- ${fluidsynth_SOURCES}
-)
-
-if ( FLUID_CPPFLAGS )
- set_target_properties ( fluidsynth
- PROPERTIES COMPILE_FLAGS ${FLUID_CPPFLAGS} )
-endif ( FLUID_CPPFLAGS )
-
-target_link_libraries ( fluidsynth
- libfluidsynth
- ${FLUID_LIBS}
-)
-
if ( MACOSX_FRAMEWORK )
- install ( TARGETS fluidsynth libfluidsynth
+ install ( TARGETS libfluidsynth
RUNTIME DESTINATION ${BIN_INSTALL_DIR}
FRAMEWORK DESTINATION ${FRAMEWORK_INSTALL_DIR}
ARCHIVE DESTINATION ${FRAMEWORK_INSTALL_DIR}
)
else ( MACOSX_FRAMEWORK )
- install ( TARGETS fluidsynth libfluidsynth
+ install ( TARGETS libfluidsynth
RUNTIME DESTINATION ${BIN_INSTALL_DIR}
LIBRARY DESTINATION ${LIB_INSTALL_DIR}
ARCHIVE DESTINATION ${LIB_INSTALL_DIR}
--- fluidsynth-static-1.1.11.orig/src/utils/fluid_settings.c
+++ fluidsynth-static-1.1.11/src/utils/fluid_settings.c
@@ -297,8 +297,6 @@ fluid_settings_init(fluid_settings_t* se
fluid_shell_settings(settings);
fluid_player_settings(settings);
fluid_file_renderer_settings(settings);
- fluid_audio_driver_settings(settings);
- fluid_midi_driver_settings(settings);
}
static int

+ 40
- 0
patches/glib/01_skip-gettext.patch View File

@@ -0,0 +1,40 @@
diff --git a/Makefile.in b/Makefile.in
index 3402627..27210f1 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -401,7 +401,7 @@ EXTRA_DIST = ChangeLog.pre-2-20 ChangeLog.pre-2-18 ChangeLog.pre-2-16 \
gio-2.0-uninstalled.pc.in gio-unix-2.0-uninstalled.pc.in
TEST_PROGS =
AUTOMAKE_OPTIONS = 1.7
-SUBDIRS = . m4macros glib gmodule gthread gobject gio tests po docs
+SUBDIRS = . m4macros glib gmodule gthread gobject gio tests po
DIST_SUBDIRS = $(SUBDIRS) build
bin_SCRIPTS = glib-gettextize
AM_CPPFLAGS = \
diff --git a/configure.in b/configure.in
index b9c3342..e421aa0 100644
--- a/configure.in
+++ b/configure.in
@@ -465,13 +465,6 @@ ALL_LINGUAS="`grep -v '^#' "$srcdir/po/LINGUAS" | tr '\n' ' '`"
AC_SUBST([CONFIG_STATUS_DEPENDENCIES],['$(top_srcdir)/po/LINGUAS'])
GLIB_GNU_GETTEXT
-if test "$gt_cv_have_gettext" != "yes" ; then
- AC_MSG_ERROR([
-*** You must have either have gettext support in your C library, or use the
-*** GNU gettext library. (http://www.gnu.org/software/gettext/gettext.html
-])
-fi
-
LIBS="$INTLLIBS $LIBS"
GETTEXT_PACKAGE=glib20
@@ -2682,8 +2675,6 @@ dnl **************************
dnl *** Checks for gtk-doc ***
dnl **************************
-GTK_DOC_CHECK([1.11])
-
AC_ARG_ENABLE(man,
[AC_HELP_STRING([--enable-man],
[regenerate man pages from Docbook [default=no]])],enable_man=yes,

+ 11
- 0
patches/portaudio19/01_build-asio-device-adapter.patch View File

@@ -0,0 +1,11 @@
diff --git a/bindings/cpp/source/portaudiocpp/Device.cxx b/bindings/cpp/source/portaudiocpp/Device.cxx
index 7b21b03..04e75b1 100644
--- a/bindings/cpp/source/portaudiocpp/Device.cxx
+++ b/bindings/cpp/source/portaudiocpp/Device.cxx
@@ -166,3 +166,6 @@ namespace portaudio
} // namespace portaudio
+#ifdef _WIN32
+#include "AsioDeviceAdapter.cxx"
+#endif

+ 67
- 0
patches/portaudio19/02_fix-wdmks-wasapi-dsound.patch View File

@@ -0,0 +1,67 @@
diff -Naur configure.in configure.in
--- a/configure.in 2016-10-30 02:23:04.000000000 +0100
+++ b/configure.in 2017-05-29 22:20:15.000000000 +0200
@@ -346,7 +346,7 @@
add_objects src/hostapi/wasapi/pa_win_wasapi.o src/common/pa_ringbuffer.o src/os/win/pa_win_hostapis.o src/os/win/pa_win_util.o src/os/win/pa_win_coinitialize.o src/os/win/pa_win_waveformat.o
LIBS="${LIBS} -lwinmm -lm -lole32 -luuid"
DLL_LIBS="${DLL_LIBS} -lwinmm -lole32"
- CFLAGS="$CFLAGS -I\$(top_srcdir)/src/hostapi/wasapi/mingw-include -UPA_USE_WASAPI -DPA_USE_WASAPI=1"
+ CFLAGS="$CFLAGS -UPA_USE_WASAPI -DPA_USE_WASAPI=1"
fi
;;
diff -Naur src/hostapi/dsound/pa_win_ds.c src/hostapi/dsound/pa_win_ds.c
--- a/src/hostapi/dsound/pa_win_ds.c 2016-10-30 02:23:04.000000000 +0100
+++ b/src/hostapi/dsound/pa_win_ds.c 2017-05-29 22:20:15.000000000 +0200
@@ -904,7 +904,10 @@
case DSSPEAKER_STEREO: count = 2; break;
case DSSPEAKER_SURROUND: count = 4; break;
case DSSPEAKER_5POINT1: count = 6; break;
- case DSSPEAKER_7POINT1: count = 8; break;
+#ifndef DSSPEAKER_7POINT1
+#define DSSPEAKER_7POINT1 0x00000007
+#endif
+ case DSSPEAKER_7POINT1: count = 8; break;
#ifndef DSSPEAKER_7POINT1_SURROUND
#define DSSPEAKER_7POINT1_SURROUND 0x00000008
#endif
@@ -2136,7 +2139,7 @@
}
else
{
- CalculateBufferSettings( &stream->hostBufferSizeFrames, &pollingPeriodFrames,
+ CalculateBufferSettings( (unsigned long*)&stream->hostBufferSizeFrames, &pollingPeriodFrames,
/* isFullDuplex = */ (inputParameters && outputParameters),
suggestedInputLatencyFrames,
suggestedOutputLatencyFrames,
diff -Naur src/hostapi/wasapi/pa_win_wasapi.c src/hostapi/wasapi/pa_win_wasapi.c
--- a/src/hostapi/wasapi/pa_win_wasapi.c 2016-10-30 02:23:04.000000000 +0100
+++ b/src/hostapi/wasapi/pa_win_wasapi.c 2017-05-29 22:20:15.000000000 +0200
@@ -54,16 +54,22 @@
#endif
// WASAPI
+// using adjustments for MinGW build from @mgeier/MXE
+// https://github.com/mxe/mxe/commit/f4bbc45682f021948bdaefd9fd476e2a04c4740f
#include <mmreg.h> // must be before other Wasapi headers
-#if defined(_MSC_VER) && (_MSC_VER >= 1400)
- #include <Avrt.h>
+#if defined(_MSC_VER) && (_MSC_VER >= 1400) || defined(__MINGW64_VERSION_MAJOR)
+ #include <avrt.h>
#define COBJMACROS
- #include <Audioclient.h>
+ #include <audioclient.h>
#include <endpointvolume.h>
#define INITGUID // Avoid additional linkage of static libs, excessive code will be optimized out by the compiler
#include <mmdeviceapi.h>
- #include <functiondiscoverykeys.h>
- #include <devicetopology.h> // Used to get IKsJackDescription interface
+#ifndef _MSC_VER
+ #include <functiondiscoverykeys_devpkey.h>
+#endif
+ #include <functiondiscoverykeys.h>
+ #include <mmdeviceapi.h>
+ #include <devicetopology.h> // Used to get IKsJackDescription interface
#undef INITGUID
#endif
#ifndef __MWERKS__

+ 14
- 0
patches/qjackctl/01_fix-win32-build.patch View File

@@ -0,0 +1,14 @@
diff --git a/src/qjackctlMainForm.cpp b/src/qjackctlMainForm.cpp
index ddc448b..3f4814d 100644
--- a/src/qjackctlMainForm.cpp
+++ b/src/qjackctlMainForm.cpp
@@ -2645,9 +2645,6 @@ void qjackctlMainForm::exitNotifyEvent (void)
jackFinished();
break;
case QProcess::Crashed:
- #if defined(__WIN32__) || defined(_WIN32) || defined(WIN32)
- if (!m_bJackStopped)
- #endif
appendMessagesColor(tr("JACK has crashed."), "#cc3366");
break;
case QProcess::Timedout:

+ 747
- 0
patches/qtbase/01_osx10.8-compat.patch View File

@@ -0,0 +1,751 @@
diff --git a/mkspecs/common/clang-mac.conf b/mkspecs/common/clang-mac.conf
index cbae2e6..ed6132c 100644
--- a/mkspecs/common/clang-mac.conf
+++ b/mkspecs/common/clang-mac.conf
@@ -10,4 +10,4 @@ QMAKE_CXXFLAGS += -stdlib=libc++
QMAKE_LFLAGS += -stdlib=libc++
QMAKE_AR_LTCG = libtool -static -o
-QMAKE_CFLAGS_APPLICATION_EXTENSION = -fapplication-extension
+QMAKE_CFLAGS_APPLICATION_EXTENSION =
diff --git a/src/corelib/global/qoperatingsystemversion_darwin.mm b/src/corelib/global/qoperatingsystemversion_darwin.mm
index d8b927f..9a690ad 100644
--- a/src/corelib/global/qoperatingsystemversion_darwin.mm
+++ b/src/corelib/global/qoperatingsystemversion_darwin.mm
@@ -40,16 +40,37 @@
#include "qoperatingsystemversion_p.h"
#import <Foundation/Foundation.h>
+typedef qint16 (*GestaltFunction)(quint32 selector, qint32 *response);
+
QT_BEGIN_NAMESPACE
QOperatingSystemVersion QOperatingSystemVersion::current()
{
- NSOperatingSystemVersion osv = NSProcessInfo.processInfo.operatingSystemVersion;
QOperatingSystemVersion v;
v.m_os = currentType();
- v.m_major = osv.majorVersion;
- v.m_minor = osv.minorVersion;
- v.m_micro = osv.patchVersion;
+ v.m_major = -1;
+ v.m_minor = -1;
+ v.m_micro = -1;
+ static GestaltFunction pGestalt = 0;
+ if (!pGestalt) {
+ CFBundleRef b = CFBundleGetBundleWithIdentifier(CFSTR("com.apple.CoreServices"));
+ pGestalt = reinterpret_cast<GestaltFunction>(CFBundleGetFunctionPointerForName(b,
+ CFSTR("Gestalt")));
+ }
+ // Use temporary variables so we can return 0.0.0 (unknown version)
+ // in case of an error partway through determining the OS version
+ qint32 major = 0, minor = 0, patch = 0;
+ if (!pGestalt)
+ return v;
+ if (pGestalt('sys1', &major) != 0)
+ return v;
+ if (pGestalt('sys2', &minor) != 0)
+ return v;
+ if (pGestalt('sys3', &patch) != 0)
+ return v;
+ v.m_major = major;
+ v.m_minor = minor;
+ v.m_micro = patch;
return v;
}
diff --git a/src/corelib/io/qfilesystemengine_unix.cpp b/src/corelib/io/qfilesystemengine_unix.cpp
index 7fed54f..bbf5e6d 100644
--- a/src/corelib/io/qfilesystemengine_unix.cpp
+++ b/src/corelib/io/qfilesystemengine_unix.cpp
@@ -126,8 +126,11 @@ static bool isPackage(const QFileSystemMetaData &data, const QFileSystemEntry &e
#ifdef Q_OS_MACOS
// Find if an application other than Finder claims to know how to handle the package
- QCFType<CFURLRef> application = LSCopyDefaultApplicationURLForURL(url,
- kLSRolesEditor | kLSRolesViewer, nullptr);
+ QCFType<CFURLRef> application;
+ LSGetApplicationForURL(url,
+ kLSRolesEditor|kLSRolesViewer,
+ NULL,
+ &application);
if (application) {
QCFType<CFBundleRef> bundle = CFBundleCreate(kCFAllocatorDefault, application);
diff --git a/src/corelib/kernel/qcore_foundation.mm b/src/corelib/kernel/qcore_foundation.mm
index 56eabc4..c48a797 100644
--- a/src/corelib/kernel/qcore_foundation.mm
+++ b/src/corelib/kernel/qcore_foundation.mm
@@ -46,7 +46,7 @@
#include <QtCore/qbytearray.h>
#include <QtCore/qrect.h>
-#if QT_CONFIG(timezone) && !defined(QT_NO_SYSTEMLOCALE)
+#if 0
#include <QtCore/qtimezone.h>
#include <QtCore/private/qtimezoneprivate_p.h>
#include <QtCore/private/qcore_mac_p.h>
@@ -433,7 +433,7 @@ NSDate *QDateTime::toNSDate() const
// ----------------------------------------------------------------------------
-#if QT_CONFIG(timezone) && !defined(QT_NO_SYSTEMLOCALE)
+#if 0
/*!
\since 5.9
diff --git a/src/corelib/tools/qtimezone.h b/src/corelib/tools/qtimezone.h
index bd87139..d154cbf 100644
--- a/src/corelib/tools/qtimezone.h
+++ b/src/corelib/tools/qtimezone.h
@@ -47,7 +47,7 @@
QT_REQUIRE_CONFIG(timezone);
-#if (defined(Q_OS_DARWIN) || defined(Q_QDOC)) && !defined(QT_NO_SYSTEMLOCALE)
+#if 0
Q_FORWARD_DECLARE_CF_TYPE(CFTimeZone);
Q_FORWARD_DECLARE_OBJC_CLASS(NSTimeZone);
#endif
@@ -147,7 +147,7 @@ public:
static QList<QByteArray> windowsIdToIanaIds(const QByteArray &windowsId,
QLocale::Country country);
-#if (defined(Q_OS_DARWIN) || defined(Q_QDOC)) && !defined(QT_NO_SYSTEMLOCALE)
+#if 0
static QTimeZone fromCFTimeZone(CFTimeZoneRef timeZone);
CFTimeZoneRef toCFTimeZone() const Q_DECL_CF_RETURNS_RETAINED;
static QTimeZone fromNSTimeZone(const NSTimeZone *timeZone);
diff --git a/src/gui/painting/qcoregraphics.mm b/src/gui/painting/qcoregraphics.mm
index c4fb8af..91875cd 100644
--- a/src/gui/painting/qcoregraphics.mm
+++ b/src/gui/painting/qcoregraphics.mm
@@ -47,6 +47,21 @@
#include <QtCore/qcoreapplication.h>
#include <QtCore/qoperatingsystemversion.h>
+@interface NSGraphicsContext (QtAdditions)
+
+
+@end
+
+@implementation NSGraphicsContext (QtAdditions)
+
+{
+ return [self graphicsContextWithGraphicsPort:graphicsPort flipped:initialFlippedState];
+}
+
+@end
+
QT_BEGIN_NAMESPACE
// ---------------------- Images ----------------------
@@ -147,7 +162,7 @@ QPixmap qt_mac_toQPixmap(const NSImage *image, const QSizeF &size)
QMacCGContext ctx(&pixmap);
if (!ctx)
return QPixmap();
- NSGraphicsContext *gc = [NSGraphicsContext graphicsContextWithCGContext:ctx flipped:YES];
+ NSGraphicsContext *gc = [NSGraphicsContext qt_graphicsContextWithCGContext:ctx flipped:YES];
if (!gc)
return QPixmap();
[NSGraphicsContext saveGraphicsState];
diff --git a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm
index f8fe160..3c350b3 100644
--- a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm
+++ b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm
@@ -456,7 +456,6 @@ QFontEngine *QCoreTextFontDatabaseEngineFactory<QFontEngineFT>::fontEngine(const
return QFontEngineFT::create(*fontData, fontDef.pixelSize,
static_cast<QFont::HintingPreference>(fontDef.hintingPreference));
} else if (NSURL *url = descriptorAttribute<NSURL>(descriptor, kCTFontURLAttribute)) {
- Q_ASSERT(url.fileURL);
QFontEngine::FaceId faceId;
faceId.filename = QString::fromNSString(url.path).toUtf8();
return QFontEngineFT::create(fontDef, faceId);
diff --git a/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm b/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm
index aa61245..2423378 100644
--- a/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm
+++ b/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm
@@ -78,7 +78,7 @@ QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSColorPanelDelegate);
mHelper = 0;
mStolenContentView = 0;
mPanelButtons = nil;
- mResultCode = NSModalResponseCancel;
+ mResultCode = NSCancelButton;
mDialogIsExecuting = false;
mResultSet = false;
mClosingDueToKnownButton = false;
@@ -166,7 +166,7 @@ QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSColorPanelDelegate);
mClosingDueToKnownButton = true;
[mColorPanel close];
[self updateQtColor];
- [self finishOffWithCode:NSModalResponseOK];
+ [self finishOffWithCode:NSOKButton];
}
- (void)onCancelClicked
@@ -175,7 +175,7 @@ QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSColorPanelDelegate);
mClosingDueToKnownButton = true;
[mColorPanel close];
mQtColor = QColor();
- [self finishOffWithCode:NSModalResponseCancel];
+ [self finishOffWithCode:NSCancelButton];
}
}
@@ -236,12 +236,12 @@ QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSColorPanelDelegate);
[NSApp runModalForWindow:mColorPanel];
mDialogIsExecuting = false;
- return (mResultCode == NSModalResponseOK);
+ return (mResultCode == NSOKButton);
}
- (QPlatformDialogHelper::DialogCode)dialogResultCode
{
- return (mResultCode == NSModalResponseOK) ? QPlatformDialogHelper::Accepted : QPlatformDialogHelper::Rejected;
+ return (mResultCode == NSOKButton) ? QPlatformDialogHelper::Accepted : QPlatformDialogHelper::Rejected;
}
- (BOOL)windowShouldClose:(id)window
@@ -250,7 +250,7 @@ QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSColorPanelDelegate);
if (!mPanelButtons)
[self updateQtColor];
if (mDialogIsExecuting) {
- [self finishOffWithCode:NSModalResponseCancel];
+ [self finishOffWithCode:NSCancelButton];
} else {
mResultSet = true;
if (mHelper)
@@ -276,7 +276,7 @@ QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSColorPanelDelegate);
// This check will prevent any such recursion.
if (!mResultSet) {
mResultSet = true;
- if (mResultCode == NSModalResponseCancel) {
+ if (mResultCode == NSCancelButton) {
emit mHelper->reject();
} else {
emit mHelper->accept();
diff --git a/src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm b/src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm
index b22f1b1..d2dd645 100644
--- a/src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm
+++ b/src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm
@@ -401,7 +401,7 @@ bool QCocoaEventDispatcher::processEvents(QEventLoop::ProcessEventsFlags flags)
// [NSApp run], which is the normal code path for cocoa applications.
if (NSModalSession session = d->currentModalSession()) {
QBoolBlocker execGuard(d->currentExecIsNSAppRun, false);
- while ([NSApp runModalSession:session] == NSModalResponseContinue && !d->interrupt) {
+ while ([NSApp runModalSession:session] == NSRunContinuesResponse && !d->interrupt) {
qt_mac_waitForMoreEvents(NSModalPanelRunLoopMode);
if (session != d->currentModalSessionCached) {
// It's possible to release the current modal session
@@ -445,7 +445,7 @@ bool QCocoaEventDispatcher::processEvents(QEventLoop::ProcessEventsFlags flags)
if (flags & QEventLoop::WaitForMoreEvents)
qt_mac_waitForMoreEvents(NSModalPanelRunLoopMode);
NSInteger status = [NSApp runModalSession:session];
- if (status != NSModalResponseContinue && session == d->currentModalSessionCached) {
+ if (status != NSRunContinuesResponse && session == d->currentModalSessionCached) {
// INVARIANT: Someone called [NSApp stopModal:] from outside the event
// dispatcher (e.g to stop a native dialog). But that call wrongly stopped
// 'session' as well. As a result, we need to restart all internal sessions:
diff --git a/src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm b/src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm
index 9a96895..b227794 100644
--- a/src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm
+++ b/src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm
@@ -104,7 +104,7 @@ QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSFontPanelDelegate);
mHelper = 0;
mStolenContentView = 0;
mPanelButtons = 0;
- mResultCode = NSModalResponseCancel;
+ mResultCode = NSCancelButton;
mDialogIsExecuting = false;
mResultSet = false;
@@ -169,7 +169,7 @@ QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSFontPanelDelegate);
- (void)onOkClicked
{
[mFontPanel close];
- [self finishOffWithCode:NSModalResponseOK];
+ [self finishOffWithCode:NSOKButton];
}
- (void)onCancelClicked
@@ -177,7 +177,7 @@ QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSFontPanelDelegate);
if (mPanelButtons) {
[mFontPanel close];
mQtFont = QFont();
- [self finishOffWithCode:NSModalResponseCancel];
+ [self finishOffWithCode:NSCancelButton];
}
}
@@ -222,12 +222,12 @@ QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSFontPanelDelegate);
[NSApp runModalForWindow:mFontPanel];
mDialogIsExecuting = false;
- return (mResultCode == NSModalResponseOK);
+ return (mResultCode == NSOKButton);
}
- (QPlatformDialogHelper::DialogCode)dialogResultCode
{
- return (mResultCode == NSModalResponseOK) ? QPlatformDialogHelper::Accepted : QPlatformDialogHelper::Rejected;
+ return (mResultCode == NSOKButton) ? QPlatformDialogHelper::Accepted : QPlatformDialogHelper::Rejected;
}
- (BOOL)windowShouldClose:(id)window
@@ -236,7 +236,7 @@ QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSFontPanelDelegate);
if (!mPanelButtons)
[self updateQtFont];
if (mDialogIsExecuting) {
- [self finishOffWithCode:NSModalResponseCancel];
+ [self finishOffWithCode:NSCancelButton];
} else {
mResultSet = true;
if (mHelper)
@@ -262,7 +262,7 @@ QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSFontPanelDelegate);
// This check will prevent any such recursion.
if (!mResultSet) {
mResultSet = true;
- if (mResultCode == NSModalResponseCancel) {
+ if (mResultCode == NSCancelButton) {
emit mHelper->reject();
} else {
emit mHelper->accept();
diff --git a/src/plugins/platforms/cocoa/qcocoaintegration.mm b/src/plugins/platforms/cocoa/qcocoaintegration.mm
index bac49cf..83b51cd 100644
--- a/src/plugins/platforms/cocoa/qcocoaintegration.mm
+++ b/src/plugins/platforms/cocoa/qcocoaintegration.mm
@@ -144,7 +144,7 @@ void QCocoaScreen::updateGeometry()
// The reference screen for the geometry is always the primary screen, but since
// we may be in the process of creating and registering the primary screen, we
// must special-case that and assign it direcly.
- QCocoaScreen *primaryScreen = (nsScreen == [[NSScreen screens] firstObject]) ?
+ QCocoaScreen *primaryScreen = (nsScreen == [[NSScreen screens] objectAtIndex:0]) ?
this : static_cast<QCocoaScreen*>(QGuiApplication::primaryScreen()->handle());
m_geometry = primaryScreen->mapFromNative(m_geometry).toRect();
diff --git a/src/plugins/platforms/cocoa/qcocoamenu.mm b/src/plugins/platforms/cocoa/qcocoamenu.mm
index e41c70b..815028b 100644
--- a/src/plugins/platforms/cocoa/qcocoamenu.mm
+++ b/src/plugins/platforms/cocoa/qcocoamenu.mm
@@ -329,13 +329,6 @@ void QCocoaMenu::insertMenuItem(QPlatformMenuItem *menuItem, QPlatformMenuItem *
}
insertNative(cocoaItem, beforeItem);
-
- // Empty menus on a menubar are hidden by default. If the menu gets
- // added to the menubar before it contains any item, we need to sync.
- if (isVisible() && attachedItem().hidden) {
- if (auto *mb = qobject_cast<QCocoaMenuBar *>(menuParent()))
- mb->syncMenu(this);
- }
}
void QCocoaMenu::insertNative(QCocoaMenuItem *item, QCocoaMenuItem *beforeItem)
diff --git a/src/plugins/platforms/cocoa/qcocoamenubar.mm b/src/plugins/platforms/cocoa/qcocoamenubar.mm
index a4cd465..06d63f7 100644
--- a/src/plugins/platforms/cocoa/qcocoamenubar.mm
+++ b/src/plugins/platforms/cocoa/qcocoamenubar.mm
@@ -369,7 +369,7 @@ void QCocoaMenuBar::updateMenuBarImmediately()
QCocoaMenuLoader *loader = [QCocoaMenuLoader sharedMenuLoader];
[loader ensureAppMenuInMenu:mb->nsMenu()];
- NSMutableSet *mergedItems = [[NSMutableSet setWithCapacity:mb->merged().count()] retain];
+ NSMutableSet *mergedItems = [[NSMutableSet setWithCapacity:0] retain];
foreach (QCocoaMenuItem *m, mb->merged()) {
[mergedItems addObject:m->nsItem()];
m->syncMerged();
diff --git a/src/plugins/platforms/cocoa/qcocoanativeinterface.mm b/src/plugins/platforms/cocoa/qcocoanativeinterface.mm
index 5504c24..fa0b7f7 100644
--- a/src/plugins/platforms/cocoa/qcocoanativeinterface.mm
+++ b/src/plugins/platforms/cocoa/qcocoanativeinterface.mm
@@ -172,12 +172,11 @@ void *QCocoaNativeInterface::NSPrintInfoForPrintEngine(QPrintEngine *printEngine
QPixmap QCocoaNativeInterface::defaultBackgroundPixmapForQWizard()
{
+ QCFType<CFURLRef> url;
const int ExpectedImageWidth = 242;
const int ExpectedImageHeight = 414;
- QCFType<CFArrayRef> urls = LSCopyApplicationURLsForBundleIdentifier(
- CFSTR("com.apple.KeyboardSetupAssistant"), nullptr);
- if (urls && CFArrayGetCount(urls) > 0) {
- CFURLRef url = (CFURLRef)CFArrayGetValueAtIndex(urls, 0);
+ if (LSFindApplicationForInfo(kLSUnknownCreator, CFSTR("com.apple.KeyboardSetupAssistant"),
+ 0, 0, &url) == noErr) {
QCFType<CFBundleRef> bundle = CFBundleCreate(kCFAllocatorDefault, url);
if (bundle) {
url = CFBundleCopyResourceURL(bundle, CFSTR("Background"), CFSTR("png"), 0);
diff --git a/src/plugins/platforms/cocoa/qcocoawindow.h b/src/plugins/platforms/cocoa/qcocoawindow.h
index aa8fffd..e6abf49 100644
--- a/src/plugins/platforms/cocoa/qcocoawindow.h
+++ b/src/plugins/platforms/cocoa/qcocoawindow.h
@@ -217,7 +217,9 @@ public:
Q_NOTIFICATION_HANDLER(NSWindowDidExitFullScreenNotification) void windowDidExitFullScreen();
Q_NOTIFICATION_HANDLER(NSWindowDidOrderOffScreenNotification) void windowDidOrderOffScreen();
Q_NOTIFICATION_HANDLER(NSWindowDidOrderOnScreenAndFinishAnimatingNotification) void windowDidOrderOnScreen();
+#if 0
Q_NOTIFICATION_HANDLER(NSWindowDidChangeOcclusionStateNotification) void windowDidChangeOcclusionState();
+#endif
Q_NOTIFICATION_HANDLER(NSWindowDidChangeScreenNotification) void windowDidChangeScreen();
Q_NOTIFICATION_HANDLER(NSWindowWillCloseNotification) void windowWillClose();
@@ -316,6 +318,8 @@ public: // for QNSView
bool m_viewIsEmbedded; // true if the m_view is actually embedded in a "foreign" NSView hiearchy
bool m_viewIsToBeEmbedded; // true if the m_view is intended to be embedded in a "foreign" NSView hiearchy
+ QCocoaWindow *m_parentCocoaWindow;
+
Qt::WindowFlags m_windowFlags;
Qt::WindowState m_lastReportedWindowState;
Qt::WindowModality m_windowModality;
diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm
index 86fd7b8..5d63dea 100644
--- a/src/plugins/platforms/cocoa/qcocoawindow.mm
+++ b/src/plugins/platforms/cocoa/qcocoawindow.mm
@@ -325,7 +325,7 @@ static void qt_closePopups()
+ (void)applicationActivationChanged:(NSNotification*)notification
{
const id sender = self;
- NSEnumerator<NSWindow*> *windowEnumerator = nullptr;
+ NSEnumerator* windowEnumerator = nullptr;
NSApplication *application = [NSApplication sharedApplication];
#if QT_MACOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_12)
@@ -526,6 +526,7 @@ QCocoaWindow::QCocoaWindow(QWindow *tlw, WId nativeHandle)
, m_nsWindow(0)
, m_viewIsEmbedded(false)
, m_viewIsToBeEmbedded(false)
+ , m_parentCocoaWindow(0)
, m_lastReportedWindowState(Qt::WindowNoState)
, m_windowModality(Qt::NonModal)
, m_windowUnderMouse(false)
@@ -594,10 +595,12 @@ QCocoaWindow::~QCocoaWindow()
[m_nsWindow makeFirstResponder:nil];
[m_nsWindow setContentView:nil];
[m_nsWindow.helper detachFromPlatformWindow];
- if (m_view.window.parentWindow)
- [m_view.window.parentWindow removeChildWindow:m_view.window];
- else if ([m_view superview])
+ if (m_view.window.parentWindow) {
+ if (m_parentCocoaWindow)
+ m_parentCocoaWindow->removeChildWindow(this);
+ } else if ([m_view superview]) {
[m_view removeFromSuperview];
+ }
removeMonitor();
@@ -614,6 +617,7 @@ QCocoaWindow::~QCocoaWindow()
foreachChildNSWindow(^(QCocoaWindow *childWindow) {
[m_nsWindow removeChildWindow:childWindow->m_nsWindow];
+ childWindow->m_parentCocoaWindow = 0;
});
[m_view release];
@@ -690,7 +694,7 @@ void QCocoaWindow::setCocoaGeometry(const QRect &rect)
if (isChildNSWindow()) {
QPlatformWindow::setGeometry(rect);
- NSWindow *parentNSWindow = m_view.window.parentWindow;
+ NSWindow *parentNSWindow = m_parentCocoaWindow->m_nsWindow;
NSRect parentWindowFrame = [parentNSWindow contentRectForFrameRect:parentNSWindow.frame];
clipWindow(parentWindowFrame);
@@ -744,7 +748,7 @@ void QCocoaWindow::clipWindow(const NSRect &clipRect)
m_hiddenByClipping = false;
if (!m_hiddenByAncestor) {
[m_nsWindow orderFront:nil];
- static_cast<QCocoaWindow *>(QPlatformWindow::parent())->reinsertChildWindow(this);
+ m_parentCocoaWindow->reinsertChildWindow(this);
}
}
}
@@ -781,7 +785,7 @@ void QCocoaWindow::show(bool becauseOfAncestor)
if ([m_nsWindow isVisible])
return;
- if (m_view.window.parentWindow && !m_view.window.parentWindow.visible) {
+ if (m_parentCocoaWindow && ![m_parentCocoaWindow->m_nsWindow isVisible]) {
m_hiddenByAncestor = true; // Parent still hidden, don't show now
} else if ((becauseOfAncestor == m_hiddenByAncestor) // Was NEITHER explicitly hidden
&& !m_hiddenByClipping) { // ... NOR clipped
@@ -792,7 +796,7 @@ void QCocoaWindow::show(bool becauseOfAncestor)
if (!m_hiddenByClipping) { // setCocoaGeometry() can change the clipping status
[m_nsWindow orderFront:nil];
if (isChildNSWindow())
- static_cast<QCocoaWindow *>(QPlatformWindow::parent())->reinsertChildWindow(this);
+ m_parentCocoaWindow->reinsertChildWindow(this);
foreachChildNSWindow(^(QCocoaWindow *childWindow) {
childWindow->show(true);
});
@@ -854,12 +858,7 @@ void QCocoaWindow::setVisible(bool visible)
applyWindowState(window()->windowState());
if (window()->windowState() != Qt::WindowMinimized) {
- if ((window()->modality() == Qt::WindowModal
- || window()->type() == Qt::Sheet)
- && parentCocoaWindow) {
- // show the window as a sheet
- [parentCocoaWindow->m_nsWindow beginSheet:m_nsWindow completionHandler:nil];
- } else if (window()->modality() != Qt::NonModal) {
+ if (window()->modality() != Qt::NonModal) {
// show the window as application modal
QCocoaEventDispatcher *cocoaEventDispatcher = qobject_cast<QCocoaEventDispatcher *>(QGuiApplication::instance()->eventDispatcher());
Q_ASSERT(cocoaEventDispatcher != 0);
@@ -919,11 +918,6 @@ void QCocoaWindow::setVisible(bool visible)
if (cocoaEventDispatcherPrivate)
cocoaEventDispatcherPrivate->endModalSession(window());
m_hasModalSession = false;
- } else {
- if ([m_nsWindow isSheet]) {
- Q_ASSERT_X(parentCocoaWindow, "QCocoaWindow", "Window modal dialog has no transient parent.");
- [parentCocoaWindow->m_nsWindow endSheet:m_nsWindow];
- }
}
hide();
@@ -1190,7 +1184,7 @@ void QCocoaWindow::raise()
// -[NSWindow orderFront:] doesn't work with attached windows.
// The only solution is to remove and add the child window.
// This will place it on top of all the other NSWindows.
- NSWindow *parentNSWindow = m_view.window.parentWindow;
+ NSWindow *parentNSWindow = m_parentCocoaWindow->m_nsWindow;
[parentNSWindow removeChildWindow:m_nsWindow];
[parentNSWindow addChildWindow:m_nsWindow ordered:NSWindowAbove];
} else {
@@ -1226,7 +1220,7 @@ void QCocoaWindow::lower()
// The only solution is to remove and add all the child windows except this one.
// This will keep the current window at the bottom while adding the others on top of it,
// hopefully in the same order (this is not documented anywhere in the Cocoa documentation).
- NSWindow *parentNSWindow = m_view.window.parentWindow;
+ NSWindow *parentNSWindow = m_parentCocoaWindow->m_nsWindow;
NSArray *children = [parentNSWindow.childWindows copy];
for (NSWindow *child in children)
if (m_nsWindow != child) {
@@ -1528,6 +1522,7 @@ void QCocoaWindow::windowDidOrderOnScreen()
exposeWindow();
}
+#if 0
void QCocoaWindow::windowDidChangeOcclusionState()
{
// Several unit tests expect paint and/or expose events for windows that are
@@ -1543,6 +1538,7 @@ void QCocoaWindow::windowDidChangeOcclusionState()
}
}
}
+#endif
void QCocoaWindow::windowDidChangeScreen()
{
@@ -1698,14 +1694,15 @@ void QCocoaWindow::recreateWindowIfNeeded()
qCDebug(lcQpaCocoaWindow) << "Reconfiguring NSWindow due to" << recreateReason;
- QCocoaWindow *parentCocoaWindow = static_cast<QCocoaWindow *>(parentWindow);
+ // FIXME: Replace member with direct parentWindow usage (possibly cast)
+ m_parentCocoaWindow = static_cast<QCocoaWindow *>(parentWindow);
if (shouldBeChildNSWindow) {
QWindow *parentQWindow = parentWindow->window();
// Ensure that all parents in the hierarchy are also child NSWindows
if (!parentQWindow->property("_q_platform_MacUseNSWindow").toBool()) {
parentQWindow->setProperty("_q_platform_MacUseNSWindow", QVariant(true));
- parentCocoaWindow->recreateWindowIfNeeded();
+ m_parentCocoaWindow->recreateWindowIfNeeded();
}
}
@@ -1713,8 +1710,8 @@ void QCocoaWindow::recreateWindowIfNeeded()
if ((isContentView() && !shouldBeContentView) || (recreateReason & PanelChanged)) {
qCDebug(lcQpaCocoaWindow) << "Getting rid of existing window" << m_nsWindow;
[m_nsWindow closeAndRelease];
- if (isChildNSWindow())
- [m_view.window.parentWindow removeChildWindow:m_view.window];
+ if (isChildNSWindow() && oldParentCocoaWindow)
+ oldParentCocoaWindow->removeChildWindow(this);
if (isContentView()) {
// We explicitly disassociate m_view from the window's contentView,
// as AppKit does not automatically do this in response to removing
@@ -1730,9 +1727,9 @@ void QCocoaWindow::recreateWindowIfNeeded()
if (noPreviousWindow)
m_nsWindow = createNSWindow(shouldBeChildNSWindow, shouldBePanel);
- if (m_view.window.parentWindow) {
- if (!shouldBeChildNSWindow || (recreateReason & ParentChanged))
- [m_view.window.parentWindow removeChildWindow:m_view.window];
+ if (oldParentCocoaWindow) {
+ if (!shouldBeChildNSWindow || oldParentCocoaWindow != m_parentCocoaWindow)
+ oldParentCocoaWindow->removeChildWindow(this);
m_forwardWindow = oldParentCocoaWindow;
}
@@ -1759,8 +1756,8 @@ void QCocoaWindow::recreateWindowIfNeeded()
setWindowState(window()->windowState());
} else if (shouldBeChildNSWindow) {
if (!m_hiddenByClipping) {
- [parentCocoaWindow->m_nsWindow addChildWindow:m_nsWindow ordered:NSWindowAbove];
- parentCocoaWindow->reinsertChildWindow(this);
+ [m_parentCocoaWindow->m_nsWindow addChildWindow:m_nsWindow ordered:NSWindowAbove];
+ m_parentCocoaWindow->reinsertChildWindow(this);
}
// Set properties after the window has been made a child NSWindow
@@ -1771,7 +1768,7 @@ void QCocoaWindow::recreateWindowIfNeeded()
if ([m_view superview])
[m_view removeFromSuperview];
- [parentCocoaWindow->m_view addSubview:m_view];
+ [m_parentCocoaWindow->m_view addSubview:m_view];
QRect rect = windowGeometry();
// Prevent setting a (0,0) window size; causes opengl context
// "Invalid Drawable" warnings.
@@ -1915,6 +1912,11 @@ bool QCocoaWindow::alwaysShowToolWindow() const
return qt_mac_resolveOption(false, window(), "_q_macAlwaysShowToolWindow", "");
}
+void QCocoaWindow::removeChildWindow(QCocoaWindow *child)
+{
+ [m_nsWindow removeChildWindow:child->m_nsWindow];
+}
+
void QCocoaWindow::removeMonitor()
{
if (!monitor)
@@ -2046,12 +2048,14 @@ Qt::WindowState QCocoaWindow::windowState() const
// FIXME: Support compound states (Qt::WindowStates)
NSWindow *window = m_view.window;
+ /*
if (window.miniaturized)
return Qt::WindowMinimized;
+ */
if (window.qt_fullScreen)
return Qt::WindowFullScreen;
- if ((window.zoomed && !isTransitioningToFullScreen())
- || (m_lastReportedWindowState == Qt::WindowMaximized && isTransitioningToFullScreen()))
+ if (/*(window.zoomed && !isTransitioningToFullScreen())
+ ||*/ (m_lastReportedWindowState == Qt::WindowMaximized && isTransitioningToFullScreen()))
return Qt::WindowMaximized;
// Note: We do not report Qt::WindowActive, even if isActive()
@@ -2181,7 +2185,6 @@ void QCocoaWindow::applyContentBorderThickness(NSWindow *window)
if (!m_drawContentBorderGradient) {
[window setStyleMask:[window styleMask] & ~NSTexturedBackgroundWindowMask];
[[[window contentView] superview] setNeedsDisplay:YES];
- window.titlebarAppearsTransparent = NO;
return;
}
@@ -2206,7 +2209,6 @@ void QCocoaWindow::applyContentBorderThickness(NSWindow *window)
int effectiveBottomContentBorderThickness = m_bottomContentBorderThickness;
[window setStyleMask:[window styleMask] | NSTexturedBackgroundWindowMask];
- window.titlebarAppearsTransparent = YES;
[window setContentBorderThickness:effectiveTopContentBorderThickness forEdge:NSMaxYEdge];
[window setAutorecalculatesContentBorderThickness:NO forEdge:NSMaxYEdge];
diff --git a/src/printsupport/dialogs/qpagesetupdialog_mac.mm b/src/printsupport/dialogs/qpagesetupdialog_mac.mm
index 1e39845..9305566 100644
--- a/src/printsupport/dialogs/qpagesetupdialog_mac.mm
+++ b/src/printsupport/dialogs/qpagesetupdialog_mac.mm
@@ -77,7 +77,7 @@ QT_USE_NAMESPACE
QPageSetupDialog *dialog = static_cast<QPageSetupDialog *>(contextInfo);
QPrinter *printer = dialog->printer();
- if (returnCode == NSModalResponseOK) {
+ if (returnCode == NSOKButton) {
PMPageFormat format = static_cast<PMPageFormat>([printInfo PMPageFormat]);
PMRect paperRect;
PMGetUnadjustedPaperRect(format, &paperRect);
@@ -88,7 +88,7 @@ QT_USE_NAMESPACE
printer->printEngine()->setProperty(QPrintEngine::PPK_Orientation, orientation == kPMLandscape ? QPrinter::Landscape : QPrinter::Portrait);
}
- dialog->done((returnCode == NSModalResponseOK) ? QDialog::Accepted : QDialog::Rejected);
+ dialog->done((returnCode == NSOKButton) ? QDialog::Accepted : QDialog::Rejected);
}
@end
diff --git a/src/printsupport/dialogs/qprintdialog_mac.mm b/src/printsupport/dialogs/qprintdialog_mac.mm
index 8547799..f7bbb59 100644
--- a/src/printsupport/dialogs/qprintdialog_mac.mm
+++ b/src/printsupport/dialogs/qprintdialog_mac.mm
@@ -101,7 +101,7 @@ QT_USE_NAMESPACE
QPrintDialog *dialog = static_cast<QPrintDialog *>(contextInfo);
QPrinter *printer = dialog->printer();
- if (returnCode == NSModalResponseOK) {
+ if (returnCode == NSOKButton) {
PMPrintSession session = static_cast<PMPrintSession>([printInfo PMPrintSession]);
PMPrintSettings settings = static_cast<PMPrintSettings>([printInfo PMPrintSettings]);
@@ -190,7 +190,7 @@ QT_USE_NAMESPACE
printer->setPageSize(pageSize);
printer->setOrientation(orientation == kPMLandscape ? QPrinter::Landscape : QPrinter::Portrait);
- dialog->done((returnCode == NSModalResponseOK) ? QDialog::Accepted : QDialog::Rejected);
+ dialog->done((returnCode == NSOKButton) ? QDialog::Accepted : QDialog::Rejected);
}
@end
diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp
index 4c5c9e1..5b4a95e 100644
--- a/src/testlib/qtestcase.cpp
+++ b/src/testlib/qtestcase.cpp
@@ -147,6 +147,7 @@ static bool debuggerPresent()
return CFStringCompare(str1, str2, kCFCompareCaseInsensitive) == kCFCompareEqualTo;
};
+#if 0
// Check if there is an exception handler for the process:
mach_msg_type_number_t portCount = 0;
exception_mask_t masks[EXC_TYPES_COUNT];
@@ -163,6 +164,7 @@ static bool debuggerPresent()
}
}
}
+#endif
// Ok, no debugger attached. So, let's see if CrashReporter will throw up a dialog. If so, we
// leave it to the OS to do the stack trace.
diff --git a/src/widgets/styles/qmacstyle_mac.mm b/src/widgets/styles/qmacstyle_mac.mm
index e6436f8..db1878a 100644
--- a/src/widgets/styles/qmacstyle_mac.mm
+++ b/src/widgets/styles/qmacstyle_mac.mm
@@ -137,6 +137,21 @@
#include <qpa/qplatformtheme.h>
#include <QtGui/private/qcoregraphics_p.h>
+@interface NSGraphicsContext (QtAdditions)
+
+
+@end
+
+@implementation NSGraphicsContext (QtAdditions)
+
+{
+ return [self graphicsContextWithGraphicsPort:graphicsPort flipped:initialFlippedState];
+}
+
+@end
+
QT_USE_NAMESPACE
static QWindow *qt_getWindow(const QWidget *widget)
@@ -1036,8 +1051,8 @@ void QMacStylePrivate::drawFocusRing(QPainter *p, const QRect &targetRect, int h
CGContextSetAlpha(ctx, 0.5); // As applied to the stroke color below
[NSGraphicsContext saveGraphicsState];
- [NSGraphicsContext setCurrentContext:[NSGraphicsContext graphicsContextWithCGContext:ctx
- flipped:NO]];
+ [NSGraphicsContext setCurrentContext:[NSGraphicsContext qt_graphicsContextWithCGContext:ctx
+ flipped:NO]];
CGRect focusRingRect = CGRectMake(hMargin, vMargin, size, size);
NSBezierPath *focusRingPath;
if (radius > 0) {

+ 12
- 7
setup/env.sh View File

@@ -3,7 +3,11 @@
# ---------------------------------------------------------------------------------------------------------------------
# OS setup

if [ "${MACOS}" -eq 1 ]; then
if [ "${LINUX}" -eq 1 ]; then
CMAKE_SYSTEM_NAME="Linux"
PAWPAW_TARGET="linux"

elif [ "${MACOS}" -eq 1 ]; then
CMAKE_SYSTEM_NAME="Darwin"
if [ "${MACOS_OLD}" -eq 1 ]; then
PAWPAW_TARGET="macos-old"
@@ -19,10 +23,6 @@ elif [ "${WIN32}" -eq 1 ]; then
PAWPAW_TARGET="win32"
fi

elif [ "${LINUX}" -eq 1 ]; then
CMAKE_SYSTEM_NAME="Linux"
PAWPAW_TARGET="linux"

else
echo "Unknown target '${target}'"
exit 4
@@ -78,7 +78,7 @@ if [ "${MACOS}" -eq 1 ]; then
else
LINK_FLAGS="${LINK_FLAGS} -Wl,-O1 -Wl,--as-needed -Wl,--gc-sections -Wl,--no-undefined -Wl,--strip-all"
if [ "${WIN32}" -eq 1 ]; then
LINK_FLAGS="${LINK_FLAGS} -static -static-libgcc -static-libstdc++"
LINK_FLAGS="${LINK_FLAGS} -static -lssp_nonshared -Wl,-Bstatic"
fi
fi

@@ -111,8 +111,13 @@ TARGET_PKG_CONFIG_PATH="${PAWPAW_PREFIX}/lib/pkgconfig"
# ---------------------------------------------------------------------------------------------------------------------
# other

# "-j 2"
MAKE_ARGS=""
WAF_ARGS=""

if which nproc > /dev/null; then
MAKE_ARGS+="-j $(nproc)"
WAF_ARGS+="-j $(nproc)"
fi

if [ "${CROSS_COMPILING}" -eq 1 ]; then
MAKE_ARGS="${MAKE_ARGS} CROSS_COMPILING=true"


+ 111
- 16
setup/functions.sh View File

@@ -92,6 +92,15 @@ function _prebuild() {
done
fi

if [ -d "${PAWPAW_ROOT}/patches/${name}/${PAWPAW_TARGET}" ]; then
for p in $(ls "${PAWPAW_ROOT}/patches/${name}/${PAWPAW_TARGET}/" | grep "\.patch" | sort); do
if [ ! -f "${pkgdir}/.stamp_applied_${p}" ]; then
patch -p1 -d "${pkgdir}" -i "${PAWPAW_ROOT}/patches/${name}/${PAWPAW_TARGET}/${p}"
touch "${pkgdir}/.stamp_applied_${p}"
fi
done
fi

if [ ! -f "${pkgdir}/.stamp_configured" ]; then
rm -f "${pkgdir}/.stamp_built"
rm -f "${pkgdir}/.stamp_installed"
@@ -118,6 +127,7 @@ function _postbuild() {
unset EXTRA_CFLAGS
unset EXTRA_CXXFLAGS
unset EXTRA_LDFLAGS
unset EXTRA_MAKE_ARGS

export PATH="${OLD_PATH}"
}
@@ -139,21 +149,21 @@ function build_autoconf() {

if [ ! -f "${pkgdir}/.stamp_configured" ]; then
pushd "${pkgdir}"
./configure --enable-static --disable-shared --disable-debug --disable-doc --disable-maintainer-mode --prefix="${PAWPAW_PREFIX}" ${extraconfrules}
./configure --enable-static --disable-shared --disable-debug --disable-doc --disable-docs --disable-maintainer-mode --prefix="${PAWPAW_PREFIX}" ${extraconfrules}
touch .stamp_configured
popd
fi

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

if [ ! -f "${pkgdir}/.stamp_installed" ]; then
pushd "${pkgdir}"
make ${MAKE_ARGS} install
make ${MAKE_ARGS} install -j 1
touch .stamp_installed
popd
fi
@@ -161,6 +171,37 @@ function build_autoconf() {
_postbuild
}

function build_autoconfgen() {
local name="${1}"
local version="${2}"
local extraconfrules="${3}"

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

local EXTRA_CFLAGS2="${EXTRA_CFLAGS}"
local EXTRA_CXXFLAGS2="${EXTRA_CXXFLAGS}"
local EXTRA_LDFLAGS2="${EXTRA_LDFLAGS}"
local EXTRA_MAKE_ARGS2="${EXTRA_MAKE_ARGS}"

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

if [ ! -f "${pkgdir}/.stamp_preconfigured" ]; then
pushd "${pkgdir}"
autoconf
touch .stamp_preconfigured
popd
fi

_postbuild

export EXTRA_CFLAGS="${EXTRA_CFLAGS2}"
export EXTRA_CXXFLAGS="${EXTRA_CXXFLAGS2}"
export EXTRA_LDFLAGS="${EXTRA_LDFLAGS2}"
export EXTRA_MAKE_ARGS="${EXTRA_MAKE_ARGS2}"

build_autoconf "${name}" "${version}" "${extraconfrules}"
}

function build_conf() {
local name="${1}"
local version="${2}"
@@ -179,14 +220,14 @@ function build_conf() {

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

if [ ! -f "${pkgdir}/.stamp_installed" ]; then
pushd "${pkgdir}"
make ${MAKE_ARGS} install
make ${MAKE_ARGS} -j 1 install
touch .stamp_installed
popd
fi
@@ -210,21 +251,21 @@ function build_cmake() {

if [ ! -f "${pkgdir}/.stamp_configured" ]; then
pushd "${pkgdir}/build"
cmake -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_INSTALL_PREFIX="${PAWPAW_PREFIX}" ${extraconfrules} ..
cmake -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_INSTALL_PREFIX="${PAWPAW_PREFIX}" ${extraconfrules} ..
touch ../.stamp_configured
popd
fi

if [ ! -f "${pkgdir}/.stamp_built" ]; then
pushd "${pkgdir}/build"
make ${MAKE_ARGS}
make ${MAKE_ARGS} ${EXTRA_MAKE_ARGS}
touch ../.stamp_built
popd
fi

if [ ! -f "${pkgdir}/.stamp_installed" ]; then
pushd "${pkgdir}/build"
make ${MAKE_ARGS} install
make ${MAKE_ARGS} -j 1 install
touch ../.stamp_installed
popd
fi
@@ -252,7 +293,7 @@ function build_make() {

if [ ! -f "${pkgdir}/.stamp_installed" ]; then
pushd "${pkgdir}"
make PREFIX="${PAWPAW_PREFIX}" PKG_CONFIG="${TARGET_PKG_CONFIG}" ${MAKE_ARGS} install
make PREFIX="${PAWPAW_PREFIX}" PKG_CONFIG="${TARGET_PKG_CONFIG}" ${MAKE_ARGS} -j 1 install
touch .stamp_installed
popd
fi
@@ -297,32 +338,70 @@ function build_meson() {
_postbuild
}

function build_qmake() {
local name="${1}"
local version="${2}"
local extraconfrules="${3}"

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

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

if [ ! -f "${pkgdir}/.stamp_configured" ]; then
pushd "${pkgdir}"
qmake ${extraconfrules}
touch .stamp_configured
popd
fi

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

if [ ! -f "${pkgdir}/.stamp_installed" ]; then
pushd "${pkgdir}"
make ${MAKE_ARGS} -j 1 install
touch .stamp_installed
popd
fi

_postbuild
}

function build_waf() {
local name="${1}"
local version="${2}"
local extraconfrules="${3}"

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

if ! which python3 > /dev/null; then
python=python
fi

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

if [ ! -f "${pkgdir}/.stamp_configured" ]; then
pushd "${pkgdir}"
./waf configure --prefix="${PAWPAW_PREFIX}" ${extraconfrules}
${python} waf configure --prefix="${PAWPAW_PREFIX}" ${extraconfrules}
touch .stamp_configured
popd
fi

if [ ! -f "${pkgdir}/.stamp_built" ]; then
pushd "${pkgdir}"
./waf build
${python} waf build ${WAF_ARGS}
touch .stamp_built
popd
fi

if [ ! -f "${pkgdir}/.stamp_installed" ]; then
pushd "${pkgdir}"
./waf install
${python} waf install ${WAF_ARGS} -j 1
touch .stamp_installed
popd
fi
@@ -365,7 +444,7 @@ function build_host_autoconf() {

if [ ! -f "${pkgdir}/.stamp_installed" ]; then
pushd "${pkgdir}"
make install
make ${MAKE_ARGS} install -j 1
touch .stamp_installed
popd
fi
@@ -384,6 +463,21 @@ function patch_file() {
sed -i -e "${rule}" "${pkgdir}/${file}"
}

function copy_file() {
local name="${1}"
local version="${2}"
local source="${3}"
local target="${4}"

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

if [ ! -e "${pkgdir}/${target}" ]; then
pushd "${pkgdir}"
cp -v "${source}" "${target}"
popd
fi
}

function link_file() {
local name="${1}"
local version="${2}"
@@ -394,7 +488,7 @@ function link_file() {

if [ ! -e "${pkgdir}/${target}" ]; then
pushd "${pkgdir}"
ln -sf "${source}" "${target}"
ln -sfv "${source}" "${target}"
popd
fi
}
@@ -406,8 +500,9 @@ function remove_file() {

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

echo rm -f "${pkgdir}/${file}"
rm -f "${pkgdir}/${file}"
if [ ! -e "${pkgdir}/${file}" ]; then
rm -fv "${pkgdir}/${file}"
fi
}

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

+ 8
- 7
setup/versions.sh View File

@@ -6,24 +6,25 @@ PKG_CONFIG_VERSION=0.28
# common
FILE_VERSION=5.34
FLAC_VERSION=1.3.2
FLUIDSYNTH_VERSION=1.1.11
FFTW_VERSION=3.3.8
GLIB_VERSION=2.22.5
GLIB_MVERSION=2.22
LIBLO_VERSION=0.30
LIBOGG_VERSION=1.3.4
LIBSAMPLERATE_VERSION=0.1.9
LIBSNDFILE_VERSION=1.0.28
LIBVORBIS_VERSION=1.3.6
LV2_VERSION=1.18.0
MXML_VERSION=3.1
ZLIB_VERSION=1.2.11

# FLUIDSYNTH_VERSION=1.1.11
# GLIB_VERSION=2.44.1
# GLIB_MVERSION=2.44
# MXML_VERSION=2.12

# carla builds only
# CXFREEZE_VERSION=6.1
# qt stuff
QT5_VERSION=5.9.8
QT5_MVERSION=5.9
# PYTHON_VERSION=3.7.4
# PYLIBLO_VERSION=0.9.2
# CXFREEZE_VERSION=6.1

# jack builds only
AFTEN_VERSION=0.0.8


Loading…
Cancel
Save