diff --git a/Project/BuildAllFromSource/build b/Project/BuildAllFromSource/build deleted file mode 100755 index 19ca1146f..000000000 --- a/Project/BuildAllFromSource/build +++ /dev/null @@ -1,30 +0,0 @@ -#! /bin/bash - -# if on Ubuntu start with this setup -# sudo apt-get install git qt5-default cmake g++ yasm libbz2-dev - -# could be also required (Ubuntu 14.04 LTS): -# sudo apt-get install zlib1g-dev -# sudo apt-get install libgl1-mesa-dev -# sudo apt-get install pkg-config - -if qmake --version >/dev/null 2>&1 ; then - BINQMAKE=qmake -elif qmake-qt5 --version >/dev/null 2>&1 ; then - BINQMAKE=qmake-qt5 -elif qmake5 --version >/dev/null 2>&1 ; then - BINQMAKE=qmake5 -else - echo qmake not found - exit -fi - -SCRIPT_DIR=$(cd $(dirname "$0") && pwd) -echo "SCRIPT_DIR: " + $SCRIPT_DIR - -INSTALL_DIR=$(cd $(dirname "$0") && cd ../../.. && pwd) -cd "$INSTALL_DIR" - -source $SCRIPT_DIR/init_ffmpeg.sh -source $SCRIPT_DIR/init_qwt.sh -source $SCRIPT_DIR/build_qctools.sh \ No newline at end of file diff --git a/Project/BuildAllFromSource/build.ps1 b/Project/BuildAllFromSource/build.ps1 index df08650e9..296ce54c6 100644 --- a/Project/BuildAllFromSource/build.ps1 +++ b/Project/BuildAllFromSource/build.ps1 @@ -9,6 +9,7 @@ # - pkg-config binary in the PATH # # - Meson binary in the PATH # # - Ninja binary in the PATH # +# - Git binary in the PATH # # - Configured WSL2 Linux environment with pkgconf, make and nasm packages installed # ################################################################################################### @@ -20,12 +21,17 @@ function Cmd-Result { } # setup environment +$SCRIPT_DIR=$PSScriptRoot +Push-Location "$SCRIPT_DIR\..\..\.." + $INSTALL_DIR=(Get-Location).Path +Pop-Location +Set-Location $INSTALL_DIR + $ErrorActionPreference="Stop" $Env:SUBDIR= # Prevent ffmpeg build error -$Env:PKG_CONFIG_PATH="$Pwd\output\lib\pkgconfig" +$Env:PKG_CONFIG_PATH="$INSTALL_DIR\output\lib\pkgconfig" $FFmpeg_CmdLine=@( '--toolchain=msvc', - '--prefix=.', '--enable-shared', '--disable-static', '--disable-doc', @@ -39,6 +45,21 @@ $FFmpeg_CmdLine=@( '--extra-libs=msvcrt.lib' ) +# get dependencies +Write-Output "Get Dependencies" +Get-Content "$SCRIPT_DIR\dependencies.txt" | ForEach-Object { + $DIR=($_ -Split ':', 2)[0] + $URL=($_ -Split ':', 2)[1] + if (-not (Test-Path "$DIR")) { + New-Item -ItemType Directory -Path "$DIR" + Push-Location "$DIR" + curl.exe -LO "$URL" ; Cmd-Result + tar --extract --strip-components=1 --file="$($URL.Split('/')[-1])" ; Cmd-Result + Remove-Item -Force -Path "$($URL.Split('/')[-1])" + Pop-Location + } +} + # freetype Write-Output "Build FreeType" if (Test-Path -Path freetype\build) { @@ -46,7 +67,7 @@ if (Test-Path -Path freetype\build) { } New-Item -ItemType directory -Name freetype\build Push-Location -Path freetype\build - meson setup --prefix $Pwd\..\..\output --buildtype=release -Db_vscrt=md -Dbrotli=disabled -Dbzip2=disabled -Dharfbuzz=disabled -Dpng=disabled -Dzlib=internal .. ; Cmd-Result + meson setup --prefix "$INSTALL_DIR\output" --buildtype=release -Db_vscrt=md -Dbrotli=disabled -Dbzip2=disabled -Dharfbuzz=disabled -Dpng=disabled -Dzlib=internal .. ; Cmd-Result ninja install ; Cmd-Result Pop-Location @@ -57,7 +78,7 @@ if (Test-Path -Path harfbuzz\build) { } New-Item -ItemType directory -Name harfbuzz\build Push-Location -Path harfbuzz\build - meson setup --prefix $Pwd\..\..\output --buildtype=release -Db_vscrt=md -Dglib=disabled -Dgobject=disabled -Dcairo=disabled -Dchafa=disabled -Dicu=disabled -Dgraphite=disabled -Dgraphite2=disabled -Dgdi=disabled -Ddirectwrite=disabled -Dcoretext=disabled -Dwasm=disabled -Dtests=disabled -Dintrospection=disabled -Ddocs=disabled -Ddoc_tests=false -Dutilities=disabled .. ; Cmd-Result + meson setup --prefix "$INSTALL_DIR\output" --buildtype=release -Db_vscrt=md -Dglib=disabled -Dgobject=disabled -Dcairo=disabled -Dchafa=disabled -Dicu=disabled -Dgraphite=disabled -Dgraphite2=disabled -Dgdi=disabled -Ddirectwrite=disabled -Dcoretext=disabled -Dwasm=disabled -Dtests=disabled -Dintrospection=disabled -Ddocs=disabled -Ddoc_tests=false -Dutilities=disabled .. ; Cmd-Result ninja install ; Cmd-Result Pop-Location @@ -72,26 +93,27 @@ Pop-Location # ffmpeg Write-Output "Build FFmpeg" Push-Location ffmpeg - if (Test-Path -Path Makefile) { - wsl --shell-type standard -- make clean - } - wsl --shell-type standard -- PKG_CONFIG_PATH=`$PWD/../output/lib/pkgconfig ./configure @FFmpeg_CmdLine ; Cmd-Result - wsl --shell-type standard -- make install ; Cmd-Result + wsl --shell-type standard -- PKG_CONFIG_PATH=`$PWD/../output/lib/pkgconfig ./configure --prefix=`$PWD/../output @FFmpeg_CmdLine ; Cmd-Result + wsl --shell-type standard -- make install ; Cmd-Result Pop-Location - # qwt Write-Output "Build Qwt" -Push-Location -Path qwt - $Env:QWT_STATIC=1 +if (Test-Path -Path qwt\build) { + Remove-Item -Recurse -Force -Path qwt\build +} +New-Item -ItemType directory -Name qwt\build +Push-Location -Path qwt\build + git -C .. apply "$SCRIPT_DIR\qwt.patch" ; Cmd-Result $Env:QWT_NO_SVG=1 $Env:QWT_NO_OPENGL=1 $Env:QWT_NO_DESIGNER=1 - if (Test-Path -Path Makefile) { - nmake distclean - } - qmake -recursive ; Cmd-Result - nmake Release ; Cmd-Result + $Env:QWT_NO_EXAMPLES=1 + $Env:QWT_NO_PLAYGROUND=1 + $Env:QWT_NO_TESTS=1 + $Env:QWT_INSTALL_PREFIX="$INSTALL_DIR\output" + qmake .. ; Cmd-Result + nmake install ; Cmd-Result Pop-Location # qctools @@ -101,8 +123,13 @@ if (Test-Path -Path qctools\Project\QtCreator\build) { } New-Item -ItemType directory -Name qctools\Project\QtCreator\build Push-Location -Path qctools\Project\QtCreator\build + $Env:QWT_ROOT="$INSTALL_DIR/output" + $Env:FFMPEG="$INSTALL_DIR/output" qmake QMAKE_CXXFLAGS+=/Zi QMAKE_LFLAGS+=/INCREMENTAL:NO QMAKE_LFLAGS+=/Debug DEFINES+=QT_AVPLAYER_MULTIMEDIA .. ; Cmd-Result nmake Release ; Cmd-Result windeployqt qctools-gui/release/QCTools.exe ; Cmd-Result windeployqt qctools-cli/release/qcli.exe ; Cmd-Result Pop-Location + +Write-Output "QCTools binary is in $INSTALL_DIR/qctools/Project/QtCreator/build/qctools-gui" +Write-Output "qcli binary is in $INSTALL_DIR/qctools/Project/QtCreator/build/qctools-cli" diff --git a/Project/BuildAllFromSource/build.sh b/Project/BuildAllFromSource/build.sh new file mode 100755 index 000000000..d556c3462 --- /dev/null +++ b/Project/BuildAllFromSource/build.sh @@ -0,0 +1,231 @@ +#! /bin/bash + +################################################################################################### +# build.sh - Batch script for building the Unix version of QCTools # +# # +# Script requirements: # +# - qctools_AllInclusive source # +# - Qt bin directory in the PATH # +# - Python3 binary in the PATH # +# - pkg-config binary in the PATH # +# - Meson binary in the PATH # +# - Ninja binary in the PATH # +# - Git binary in the PATH # +# Environment: # +# - MULTIARCH: Compile for arm64 and x86_64 into the same binary (macOS) # +################################################################################################### +# setup environment +set -e + +if qmake --version >/dev/null 2>&1 ; then + BINQMAKE=qmake +elif qmake-qt6 --version >/dev/null 2>&1 ; then + BINQMAKE=qmake-qt6 +elif qmake6 --version >/dev/null 2>&1 ; then + BINQMAKE=qmake6 +else + echo qmake not found + exit 1 +fi + +SCRIPT_DIR=$(cd $(dirname "$0") && pwd) +INSTALL_DIR=$(cd $(dirname "$0") && cd ../../.. && pwd) +cd "$INSTALL_DIR" + +FFMPEG_CONFIGURE_OPTS=( + --enable-gpl + --enable-version3 + --disable-doc + --disable-debug + --disable-programs + --disable-autodetect + --enable-static + --disable-shared + --enable-libfreetype + --enable-libharfbuzz +) + +QT_CONFIGURE_OPTS=() + +if sw_vers >/dev/null 2>&1 ; then + OS=mac + export CFLAGS="-mmacosx-version-min=11.0 $CFLAGS" + export CXXFLAGS="-mmacosx-version-min=11.0 $CXXFLAGS" + export LDFLAGS="-mmacosx-version-min=11.0 $LDFLAGS" + FFMPEG_CONFIGURE_OPTS+=(--extra-cflags="-mmacosx-version-min=11.0" --extra-ldflags="-mmacosx-version-min=11.0") + if [[ -n "$MULTIARCH" ]] ; then + QT_CONFIGURE_OPTS+=(QMAKE_APPLE_DEVICE_ARCHS="x86_64 arm64") + mkdir -p $INSTALL_DIR/output/lib + fi +fi + +# get dependencies +while read LINE; do + DIR=$(echo "$LINE" | cut -d: -f1) + URL=$(echo "$LINE" | cut -d: -f2-) + if [[ -z "$DIR" || -z "$URL" ]] ; then + continue + fi + if [[ ! -e "$DIR" ]] ; then + mkdir "$DIR" + pushd "$DIR" + curl -LO "$URL" + tar --extract --strip-components=1 --file=${URL##*/} + rm -f ${URL##*/} + popd + fi +done < $SCRIPT_DIR/dependencies.txt + +# freetype +echo "Build FreeType" +if [[ -d freetype/build ]] ; then + rm -fr freetype/build +fi +mkdir freetype/build +pushd freetype/build + if [[ "$OS" == "mac" && -n "$MULTIARCH" ]] ; then + mkdir x86_64 + pushd x86_64 + ( + export PKG_CONFIG_PATH=$INSTALL_DIR/output/x86_64/lib/pkgconfig + export CFLAGS="$CFLAGS -arch x86_64" + export CXXFLAGS="$CXXFLAGS -arch x86_64" + export LDFLAGS="$LDFLAGS -arch x86_64" + meson setup --prefix $INSTALL_DIR/output/x86_64 --default-library=static -Dzlib=internal -Dbzip2=disabled -Dpng=disabled -Dharfbuzz=disabled -Dbrotli=disabled ../.. + ninja install + ) + popd + mkdir arm64 + pushd arm64 + ( + export PKG_CONFIG_PATH=$INSTALL_DIR/output/arm64/lib/pkgconfig + export CFLAGS="$CFLAGS -arch arm64" + export CXXFLAGS="$CXXFLAGS -arch arm64" + export LDFLAGS="$LDFLAGS -arch arm64" + meson setup --prefix $INSTALL_DIR/output/arm64 --default-library=static -Dzlib=disabled -Dbzip2=disabled -Dpng=disabled -Dharfbuzz=disabled -Dbrotli=disabled ../.. + ninja install + ) + popd + lipo -create $INSTALL_DIR/output/x86_64/lib/libfreetype.a $INSTALL_DIR/output/arm64/lib/libfreetype.a -output $INSTALL_DIR/output/lib/libfreetype.a + else + ( + export PKG_CONFIG_PATH=$INSTALL_DIR/output/lib/pkgconfig + meson setup --prefix $INSTALL_DIR/output --default-library=static -Dzlib=disabled -Dbzip2=disabled -Dpng=disabled -Dharfbuzz=disabled -Dbrotli=disabled .. + ninja install + ) + fi +popd + +# harfbuzz +echo "Build HarfBuzz" +if [[ -d harfbuzz/build ]] ; then + rm -fr harfbuzz/build +fi +mkdir harfbuzz/build +pushd harfbuzz/build + if [[ "$OS" == "mac" && -n "$MULTIARCH" ]] ; then + mkdir x86_64 + pushd x86_64 + ( + export PKG_CONFIG_PATH=$INSTALL_DIR/output/x86_64/lib/pkgconfig + export CFLAGS="$CFLAGS -arch x86_64" + export CXXFLAGS="$CXXFLAGS -arch x86_64" + export LDFLAGS="$LDFLAGS -arch x86_64" + meson setup --prefix $INSTALL_DIR/output/x86_64 --default-library=static -Dglib=disabled -Dgobject=disabled -Dcairo=disabled -Dchafa=disabled -Dicu=disabled -Dgraphite=disabled -Dgraphite2=disabled -Dgdi=disabled -Ddirectwrite=disabled -Dcoretext=disabled -Dwasm=disabled -Dtests=disabled -Dintrospection=disabled -Ddocs=disabled -Ddoc_tests=false -Dutilities=disabled ../.. + ninja install + ) + popd + mkdir arm64 + pushd arm64 + ( + export PKG_CONFIG_PATH=$INSTALL_DIR/output/arm64/lib/pkgconfig + export CFLAGS="$CFLAGS -arch arm64" + export CXXFLAGS="$CXXFLAGS -arch arm64" + export LDFLAGS="$LDFLAGS -arch arm64" + meson setup --prefix $INSTALL_DIR/output/arm64 --default-library=static -Dglib=disabled -Dgobject=disabled -Dcairo=disabled -Dchafa=disabled -Dicu=disabled -Dgraphite=disabled -Dgraphite2=disabled -Dgdi=disabled -Ddirectwrite=disabled -Dcoretext=disabled -Dwasm=disabled -Dtests=disabled -Dintrospection=disabled -Ddocs=disabled -Ddoc_tests=false -Dutilities=disabled ../.. + ninja install + ) + popd + lipo -create $INSTALL_DIR/output/x86_64/lib/libharfbuzz.a $INSTALL_DIR/output/arm64/lib/libharfbuzz.a -output $INSTALL_DIR/output/lib/libharfbuzz.a + else + ( + export PKG_CONFIG_PATH=$INSTALL_DIR/output/lib/pkgconfig + meson setup --prefix $INSTALL_DIR/output --default-library=static -Dglib=disabled -Dgobject=disabled -Dcairo=disabled -Dchafa=disabled -Dicu=disabled -Dgraphite=disabled -Dgraphite2=disabled -Dgdi=disabled -Ddirectwrite=disabled -Dcoretext=disabled -Dwasm=disabled -Dtests=disabled -Dintrospection=disabled -Ddocs=disabled -Ddoc_tests=false -Dutilities=disabled .. + ninja install + ) + fi +popd + +# ffmpeg +echo "Build FFmpeg" +if [[ -d ffmpeg/build ]] ; then + rm -fr ffmpeg/build +fi +mkdir ffmpeg/build +pushd ffmpeg/build + if [[ "$OS" == "mac" && -n "$MULTIARCH" ]] ; then + mkdir x86_64 + pushd x86_64 + ( + export PKG_CONFIG_PATH=$INSTALL_DIR/output/x86_64/lib/pkgconfig + ../../configure --arch=x86_64 --extra-cflags="-arch x86_64" --extra-ldflags="-arch x86_64" --prefix=$INSTALL_DIR/output/x86_64 "${FFMPEG_CONFIGURE_OPTS[@]}" + make install + ) + popd + mkdir arm64 + pushd arm64 + ( + export PKG_CONFIG_PATH=$INSTALL_DIR/output/arm64/lib/pkgconfig + ../../configure --arch=arm64 --extra-cflags="-arch arm64" --extra-ldflags="-arch arm64" --prefix=$INSTALL_DIR/output/arm64 "${FFMPEG_CONFIGURE_OPTS[@]}" + make install + ) + popd + lipo -create $INSTALL_DIR/output/x86_64/lib/libavcodec.a $INSTALL_DIR/output/arm64/lib/libavcodec.a -output $INSTALL_DIR/output/lib/libavcodec.a + lipo -create $INSTALL_DIR/output/x86_64/lib/libavdevice.a $INSTALL_DIR/output/arm64/lib/libavdevice.a -output $INSTALL_DIR/output/lib/libavdevice.a + lipo -create $INSTALL_DIR/output/x86_64/lib/libavfilter.a $INSTALL_DIR/output/arm64/lib/libavfilter.a -output $INSTALL_DIR/output/lib/libavfilter.a + lipo -create $INSTALL_DIR/output/x86_64/lib/libavformat.a $INSTALL_DIR/output/arm64/lib/libavformat.a -output $INSTALL_DIR/output/lib/libavformat.a + lipo -create $INSTALL_DIR/output/x86_64/lib/libavutil.a $INSTALL_DIR/output/arm64/lib/libavutil.a -output $INSTALL_DIR/output/lib/libavutil.a + lipo -create $INSTALL_DIR/output/x86_64/lib/libpostproc.a $INSTALL_DIR/output/arm64/lib/libpostproc.a -output $INSTALL_DIR/output/lib/libpostproc.a + lipo -create $INSTALL_DIR/output/x86_64/lib/libswresample.a $INSTALL_DIR/output/arm64/lib/libswresample.a -output $INSTALL_DIR/output/lib/libswresample.a + lipo -create $INSTALL_DIR/output/x86_64/lib/libswscale.a $INSTALL_DIR/output/arm64/lib/libswscale.a -output $INSTALL_DIR/output/lib/libswscale.a + cp -r $INSTALL_DIR/output/x86_64/include $INSTALL_DIR/output + else + ( + export PKG_CONFIG_PATH=$INSTALL_DIR/output/lib/pkgconfig + ../configure --prefix=$INSTALL_DIR/output "${FFMPEG_CONFIGURE_OPTS[@]}" + make install + ) + fi +popd + +# qwt +echo "Build Qwt" +if [[ -d qwt/build ]] ; then + rm -fr qwt/build +fi +mkdir qwt/build +pushd qwt/build +( + git -C .. apply "$SCRIPT_DIR/qwt.patch" + export QWT_STATIC=1 QWT_NO_SVG=1 QWT_NO_OPENGL=1 QWT_NO_DESIGNER=1 QWT_NO_EXAMPLES=1 QWT_NO_PLAYGROUND=1 QWT_NO_TESTS=1 QWT_INSTALL_PREFIX=$INSTALL_DIR/output + $BINQMAKE "${QT_CONFIGURE_OPTS[@]}" .. + make install +) +popd + +# qctools +echo "Build QCTools" +if [[ -d qctools/Project/QtCreator/build ]] ; then + rm -fr qctools/Project/QtCreator/build +fi +mkdir qctools/Project/QtCreator/build +pushd qctools/Project/QtCreator/build +( + export QWT_ROOT=$INSTALL_DIR/output FFMPEG=$INSTALL_DIR/output + $BINQMAKE "${QT_CONFIGURE_OPTS[@]}" STATIC=1 .. + make +) +popd + +echo QCTools binary is in $INSTALL_DIR/qctools/Project/QtCreator/build/qctools-gui +echo qcli binary is in $INSTALL_DIR/qctools/Project/QtCreator/build/qctools-cli diff --git a/Project/BuildAllFromSource/build_qctools.sh b/Project/BuildAllFromSource/build_qctools.sh deleted file mode 100755 index 9d8acdd90..000000000 --- a/Project/BuildAllFromSource/build_qctools.sh +++ /dev/null @@ -1,9 +0,0 @@ -rm -fr qctools/Project/QtCreator/build -mkdir qctools/Project/QtCreator/build -pushd qctools/Project/QtCreator/build >/dev/null 2>&1 -$BINQMAKE .. DEFINES+=QT_AVPLAYER_MULTIMEDIA -sed -i'' 's/-framework QtAVPlayer//g' qctools-gui/Makefile.* -make -popd >/dev/null 2>&1 - -echo QCTools binary is in qctools/Project/QtCreator/build/qctools-gui diff --git a/Project/BuildAllFromSource/dependencies.txt b/Project/BuildAllFromSource/dependencies.txt new file mode 100644 index 000000000..7677fba5b --- /dev/null +++ b/Project/BuildAllFromSource/dependencies.txt @@ -0,0 +1,4 @@ +freetype:https://download.savannah.gnu.org/releases/freetype/freetype-2.13.2.tar.xz +harfbuzz:https://github.com/harfbuzz/harfbuzz/releases/download/10.2.0/harfbuzz-10.2.0.tar.xz +ffmpeg:https://ffmpeg.org/releases/ffmpeg-6.1.2.tar.xz +qwt:https://sourceforge.net/projects/qwt/files/qwt/6.3.0/qwt-6.3.0.tar.bz2 diff --git a/Project/BuildAllFromSource/init.sh b/Project/BuildAllFromSource/init.sh deleted file mode 100755 index e0abec61f..000000000 --- a/Project/BuildAllFromSource/init.sh +++ /dev/null @@ -1,24 +0,0 @@ -#! /bin/bash - -if qmake --version >/dev/null 2>&1 ; then - BINQMAKE=qmake -elif qmake-qt5 --version >/dev/null 2>&1 ; then - BINQMAKE=qmake-qt5 -elif qmake5 --version >/dev/null 2>&1 ; then - BINQMAKE=qmake5 -else - echo qmake not found - exit -fi - -echo "PWD: " + $PWD - -START_DIR=$(cd $(dirname "$0") && pwd) -INSTALL_DIR=$(cd .. && pwd) -SCRIPT_DIR=$PWD/Project/BuildAllFromSource - -echo "SCRIPT_DIR: " + $SCRIPT_DIR -echo "INSTALL_DIR: " + $INSTALL_DIR -echo "START_DIR: " + $START_DIR - -echo "BINQMAKE: " + $BINQMAKE diff --git a/Project/BuildAllFromSource/init_ffmpeg.sh b/Project/BuildAllFromSource/init_ffmpeg.sh deleted file mode 100755 index cf5305958..000000000 --- a/Project/BuildAllFromSource/init_ffmpeg.sh +++ /dev/null @@ -1,93 +0,0 @@ -#! /bin/bash - -echo "PWD: " + $PWD - -_install_yasm(){ - wget -q http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz - tar -zxf yasm-1.3.0.tar.gz - mv yasm-1.3.0 yasm -} - -if [ ! -d ffmpeg ] ; then - git clone --depth 1 git://source.ffmpeg.org/ffmpeg.git ffmpeg -fi - -if [ ! -d freetype ] ; then - curl -LO https://download.savannah.gnu.org/releases/freetype/freetype-2.10.0.tar.bz2 - tar -xf freetype-2.10.0.tar.bz2 - mv freetype-2.10.0 freetype -fi - -if [ ! -d harfbuzz ] ; then - curl -LO https://github.com/harfbuzz/harfbuzz/releases/download/8.2.2/harfbuzz-8.2.2.tar.xz - tar -Jxf harfbuzz-8.2.2.tar.xz - rm harfbuzz-8.2.2.tar.xz - mv harfbuzz-8.2.2 harfbuzz -fi - -cd freetype -chmod u+x configure -if sw_vers >/dev/null 2>&1 ; then -./configure --prefix="$(pwd)/usr" --without-harfbuzz --without-zlib --without-bzip2 --without-png --enable-static --disable-shared CFLAGS=-mmacosx-version-min=10.12 LDFLAGS=-mmacosx-version-min=10.12 -else -./configure --prefix="$(pwd)/usr" --without-harfbuzz --without-zlib --without-bzip2 --without-png --enable-static --disable-shared -fi -make -make install -cd .. - -cd harfbuzz -mkdir build -cd build -if sw_vers >/dev/null 2>&1 ; then -CFLAGS=-mmacosx-version-min=10.12 LDFLAGS=-mmacosx-version-min=10.12 PKG_CONFIG_PATH=$PWD/../../freetype/usr/lib/pkgconfig meson setup --prefix $(pwd)/../usr --default-library=static -Dglib=disabled -Dgobject=disabled -Dcairo=disabled -Dchafa=disabled -Dicu=disabled -Dgraphite=disabled -Dgraphite2=disabled -Dgdi=disabled -Ddirectwrite=disabled -Dcoretext=disabled -Dwasm=disabled -Dtests=disabled -Dintrospection=disabled -Ddocs=disabled -Ddoc_tests=false -Dutilities=disabled .. -else -PKG_CONFIG_PATH=$PWD/../../freetype/usr/lib/pkgconfig meson setup --prefix $(pwd)/../usr --default-library=static -Dglib=disabled -Dgobject=disabled -Dcairo=disabled -Dchafa=disabled -Dicu=disabled -Dgraphite=disabled -Dgraphite2=disabled -Dgdi=disabled -Ddirectwrite=disabled -Dcoretext=disabled -Dwasm=disabled -Dtests=disabled -Dintrospection=disabled -Ddocs=disabled -Ddoc_tests=false -Dutilities=disabled .. -fi -ninja -ninja install -cd .. -cd .. - -cd ffmpeg -FFMPEG_CONFIGURE_OPTS=(--enable-gpl --enable-version3 --disable-autodetect --disable-programs --disable-securetransport --disable-videotoolbox --enable-static --disable-shared --disable-doc --disable-debug --disable-lzma --disable-iconv --enable-pic --prefix="$(pwd)" --enable-libfreetype --enable-libharfbuzz --extra-cflags="-I../freetype/usr/include/freetype2" --extra-cflags="-I../harfbuzz/usr/include/harfbuzz" --extra-libs="../freetype/usr/lib/libfreetype.a" --extra-libs="../harfbuzz/usr/lib/libharfbuzz.a") -if sw_vers >/dev/null 2>&1 ; then - FFMPEG_CONFIGURE_OPTS+=(--extra-cflags="-mmacosx-version-min=10.12" --extra-ldflags="-mmacosx-version-min=10.12") -fi - -chmod u+x configure -chmod u+x version.sh -if yasm --version >/dev/null 2>&1 ; then - echo "FFMPEG_CONFIGURE_OPTS = ${FFMPEG_CONFIGURE_OPTS[@]}" - ./configure "${FFMPEG_CONFIGURE_OPTS[@]}" - if [ "$?" -ne 0 ] ; then #on some distro, yasm version is too old - cd "$INSTALL_DIR" - if [ ! -d yasm ] ; then - _install_yasm - fi - cd yasm/ - ./configure --prefix="$(pwd)/usr" - make - make install - cd "${INSTALL_DIR}/ffmpeg" - FFMPEG_CONFIGURE_OPTS+=(--x86asmexe=../yasm/usr/bin/yasm) - echo "FFMPEG_CONFIGURE_OPTS = ${FFMPEG_CONFIGURE_OPTS[@]}" - ./configure "${FFMPEG_CONFIGURE_OPTS[@]}" - fi -else - cd "$INSTALL_DIR" - if [ ! -d yasm ] ; then - _install_yasm - fi - cd yasm/ - ./configure --prefix=`pwd`/usr - make - make install - cd "${INSTALL_DIR}/ffmpeg" - FFMPEG_CONFIGURE_OPTS+=(--x86asmexe=../yasm/usr/bin/yasm) - echo "FFMPEG_CONFIGURE_OPTS = ${FFMPEG_CONFIGURE_OPTS[@]}" - ./configure "${FFMPEG_CONFIGURE_OPTS[@]}" -fi -make -make install -cd "$INSTALL_DIR" diff --git a/Project/BuildAllFromSource/init_qwt.sh b/Project/BuildAllFromSource/init_qwt.sh deleted file mode 100755 index 7e15efe9d..000000000 --- a/Project/BuildAllFromSource/init_qwt.sh +++ /dev/null @@ -1,15 +0,0 @@ -#! /bin/bash - -echo "PWD: " + $PWD - -if [ ! -d qwt ] ; then - wget wget -q https://github.com/ElderOrb/qwt/archive/master.zip - unzip master.zip - mv qwt-master qwt - rm master.zip -fi -cd qwt -export QWT_STATIC=1 QWT_NO_SVG=1 QWT_NO_OPENGL=1 QWT_NO_DESIGNER=1 -$BINQMAKE -make -cd "$INSTALL_DIR" diff --git a/Project/BuildAllFromSource/qwt.patch b/Project/BuildAllFromSource/qwt.patch new file mode 100644 index 000000000..49ee492cf --- /dev/null +++ b/Project/BuildAllFromSource/qwt.patch @@ -0,0 +1,136 @@ +diff --git a/qwtconfig.pri b/qwtconfig.pri +index d0b5d7c..4f05e09 100644 +--- a/qwtconfig.pri ++++ b/qwtconfig.pri +@@ -16,16 +16,19 @@ QWT_VERSION = $${QWT_VER_MAJ}.$${QWT_VER_MIN}.$${QWT_VER_PAT} + # Install paths + ###################################################################### + +-QWT_INSTALL_PREFIX = $$[QT_INSTALL_PREFIX] +- +-unix { +- QWT_INSTALL_PREFIX = /usr/local/qwt-$$QWT_VERSION +- # QWT_INSTALL_PREFIX = /usr/local/qwt-$$QWT_VERSION-qt-$$QT_VERSION +-} +- +-win32 { +- QWT_INSTALL_PREFIX = C:/Qwt-$$QWT_VERSION +- # QWT_INSTALL_PREFIX = C:/Qwt-$$QWT_VERSION-qt-$$QT_VERSION ++QWT_INSTALL_PREFIX = $$(QWT_INSTALL_PREFIX) ++ ++isEmpty(QWT_INSTALL_PREFIX) { ++ QWT_INSTALL_PREFIX = $$[QT_INSTALL_PREFIX] ++ unix { ++ QWT_INSTALL_PREFIX = /usr/local/qwt-$$QWT_VERSION-dev ++ # QWT_INSTALL_PREFIX = /usr/local/qwt-$$QWT_VERSION-dev-qt-$$QT_VERSION ++ } ++ ++ win32 { ++ QWT_INSTALL_PREFIX = C:/Qwt-$$QWT_VERSION-dev ++ # QWT_INSTALL_PREFIX = C:/Qwt-$$QWT_VERSION-dev-qt-$$QT_VERSION ++ } + } + + QWT_INSTALL_DOCS = $${QWT_INSTALL_PREFIX}/doc +@@ -72,7 +75,13 @@ QWT_INSTALL_FEATURES = $${QWT_INSTALL_PREFIX}/features + # it will be a static library. + ###################################################################### + +-QWT_CONFIG += QwtDll ++QWT_STATIC=$$(QWT_STATIC) ++isEmpty(QWT_STATIC) { ++ QWT_CONFIG += QwtDll ++ message('using dynamic build') ++} else { ++ message('using static build') ++} + + ###################################################################### + # QwtPlot enables all classes, that are needed to use the QwtPlot +@@ -100,13 +109,25 @@ QWT_CONFIG += QwtWidgets + # export a plot to a SVG document + ###################################################################### + +-QWT_CONFIG += QwtSvg ++QWT_NO_SVG=$$(QWT_NO_SVG) ++isEmpty(QWT_NO_SVG) { ++ QWT_CONFIG += QwtSvg ++ message('enable svg support') ++} else { ++ message('disable svg support') ++} + + ###################################################################### + # If you want to use a OpenGL plot canvas + ###################################################################### + +-QWT_CONFIG += QwtOpenGL ++QWT_NO_OPENGL=$$(QWT_NO_OPENGL) ++isEmpty(QWT_NO_OPENGL) { ++ QWT_CONFIG += QwtOpenGL ++ message('enable opengl support') ++} else { ++ message('disable opengl support') ++} + + ###################################################################### + # If you want to build the Qwt designer plugin, +@@ -114,7 +135,13 @@ QWT_CONFIG += QwtOpenGL + # Otherwise you have to build it from the designer directory. + ###################################################################### + +-QWT_CONFIG += QwtDesigner ++QWT_NO_DESIGNER=$$(QWT_NO_DESIGNER) ++isEmpty(QWT_NO_DESIGNER) { ++ QWT_CONFIG += QwtDesigner ++ message('enable designer plugin') ++} else { ++ message('disable designer plugin') ++} + + ###################################################################### + # Compile all Qwt classes into the designer plugin instead +@@ -137,7 +164,13 @@ win32 { + # Otherwise you have to build them from the examples directory. + ###################################################################### + +-QWT_CONFIG += QwtExamples ++QWT_NO_EXAMPLES=$$(QWT_NO_EXAMPLES) ++isEmpty(QWT_NO_EXAMPLES) { ++ QWT_CONFIG += QwtExamples ++ message('enable examples') ++} else { ++ message('disable examples') ++} + + ###################################################################### + # The playground is primarily intended for the Qwt development +@@ -148,14 +181,26 @@ QWT_CONFIG += QwtExamples + # Otherwise you have to build them from the playground directory. + ###################################################################### + +-QWT_CONFIG += QwtPlayground ++QWT_NO_PLAYGROUND=$$(QWT_NO_PLAYGROUND) ++isEmpty(QWT_NO_PLAYGROUND) { ++ QWT_CONFIG += QwtPlayground ++ message('enable playground') ++} else { ++ message('disable playground') ++} + + ###################################################################### + # If you want to auto build the tests, enable the line below + # Otherwise you have to build them from the tests directory. + ###################################################################### + +-QWT_CONFIG += QwtTests ++QWT_TESTS=$$(QWT_NO_TESTS) ++isEmpty(QWT_NO_EXAMPLES) { ++ QWT_CONFIG += QwtTests ++ message('enable tests') ++} else { ++ message('disable tests') ++} + + ###################################################################### + # When Qt has been built as framework qmake wants diff --git a/Project/GNU/PKGBUILD b/Project/GNU/PKGBUILD index 4a14f1f87..87059f931 100644 --- a/Project/GNU/PKGBUILD +++ b/Project/GNU/PKGBUILD @@ -11,11 +11,25 @@ source=(${pkgname}_${pkgver}-1.tar.gz) md5sums=('00000000000000000000000000000000') arch=('i686' 'x86_64') -depends=('qt5-base' 'qt5-multimedia' 'qt5-declarative' 'bzip2' 'zlib' 'yasm') +depends=('qt6-base' 'qt6-multimedia' 'qt6-multimedia-ffmpeg' 'qt6-declarative' 'freetype2' 'harfbuzz' 'bzip2' 'zlib' 'yasm') build() { + cd "${srcdir}/qctools/ffmpeg" + ./configure --enable-gpl --enable-version3 --disable-autodetect --disable-programs --disable-securetransport --disable-videotoolbox --enable-static --disable-shared --disable-doc --disable-debug --disable-lzma --disable-iconv --enable-pic --prefix="$(pwd)" --enable-libfreetype --enable-libharfbuzz + make + + cd "${srcdir}/qctools/qwt" + export QWT_STATIC=1 QWT_NO_SVG=1 QWT_NO_OPENGL=1 QWT_NO_DESIGNER=1 + qmake6 + make + cd "${srcdir}/qctools/qctools" - ./Project/BuildAllFromSource/build + chmod 644 History.txt + chmod 644 License.html + mkdir Project/QtCreator/build + cd Project/QtCreator/build + qmake6 DEFINES+=QT_AVPLAYER_MULTIMEDIA .. + make } package_qctools() { diff --git a/Project/GNU/qctools.dsc b/Project/GNU/qctools.dsc index e9671d5a0..2e9b3044e 100644 --- a/Project/GNU/qctools.dsc +++ b/Project/GNU/qctools.dsc @@ -6,7 +6,7 @@ Version: 1.4-1 Maintainer: MediaArea.net SARL Homepage: http://www.bavc.org/qctools Standards-Version: 3.7.3 -Build-Depends: debhelper (>= 9), qtbase5-dev, qtdeclarative5-dev, libqt5svg5-dev, libqt5xmlpatterns5-dev, qtmultimedia5-dev, qtquickcontrols2-5-dev, libqt5opengl5-dev, qtchooser, libegl1-mesa-dev, libxv-dev, libxcb-shm0-dev, libxcb-render0-dev, libxcb-xfixes0-dev, libxcb-shape0-dev, zlib1g-dev, libbz2-dev, pkg-config, yasm +Build-Depends: debhelper (>= 9), qt6-base-dev, qt6-base-private-dev, qt6-declarative-dev, qt6-svg-dev, qt6-multimedia-dev, qmake6, libavcodec59, libavdevice59, libavformat59, libavfilter8, libfreetype-dev, libharfbuzz-dev, libegl1-mesa-dev, libxv-dev, libxcb-shm0-dev, libxcb-render0-dev, libxcb-xfixes0-dev, libxcb-shape0-dev, zlib1g-dev, libbz2-dev, pkg-config, nasm Package-List: qcli deb utils optional arch=any qcli-dbg deb debug optional arch=any diff --git a/Project/GNU/qctools.spec b/Project/GNU/qctools.spec index c30d39cae..658fdd699 100644 --- a/Project/GNU/qctools.spec +++ b/Project/GNU/qctools.spec @@ -18,6 +18,8 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildRequires: gcc-c++ BuildRequires: pkgconfig BuildRequires: zlib-devel +BuildRequires: freetype-devel +BuildRequires: harfbuzz-devel %if 0%{?fedora_version} >= 24 BuildRequires: bzip2-devel %else @@ -26,7 +28,6 @@ BuildRequires: libbz2-devel %endif %endif BuildRequires: yasm -BuildRequires: cmake %if 0%{?suse_version} BuildRequires: update-desktop-files %endif @@ -36,63 +37,46 @@ BuildRequires: alternatives %endif %if 0%{?suse_version} >= 1200 -BuildRequires: pkgconfig(Qt5Qml) -BuildRequires: pkgconfig(Qt5Svg) -BuildRequires: pkgconfig(Qt5Core) -BuildRequires: pkgconfig(Qt5Widgets) -BuildRequires: pkgconfig(Qt5Network) -BuildRequires: pkgconfig(Qt5Concurrent) -BuildRequires: pkgconfig(Qt5PrintSupport) -BuildRequires: pkgconfig(Qt5QuickControls2) -BuildRequires: pkgconfig(Qt5XmlPatterns) -BuildRequires: pkgconfig(Qt5Multimedia) +BuildRequires: pkgconfig(Qt6Qml) +BuildRequires: pkgconfig(Qt6Svg) +BuildRequires: pkgconfig(Qt6Core) +BuildRequires: pkgconfig(Qt6Widgets) +BuildRequires: pkgconfig(Qt6Network) +BuildRequires: pkgconfig(Qt6Concurrent) +BuildRequires: pkgconfig(Qt6PrintSupport) +BuildRequires: pkgconfig(Qt6QuickControls2) +BuildRequires: pkgconfig(Qt6Multimedia) BuildRequires: libXv-devel %endif %if 0%{?fedora_version} || 0%{?rhel} > 7 -BuildRequires: pkgconfig(Qt5) -BuildRequires: pkgconfig(Qt5Qml) -BuildRequires: pkgconfig(Qt5QuickControls2) -BuildRequires: pkgconfig(Qt5Svg) -BuildRequires: pkgconfig(Qt5XmlPatterns) -BuildRequires: pkgconfig(Qt5Multimedia) +BuildRequires: pkgconfig(Qt6) +BuildRequires: pkgconfig(Qt6Qml) +BuildRequires: pkgconfig(Qt6QuickControls2) +BuildRequires: pkgconfig(Qt6Svg) +BuildRequires: pkgconfig(Qt6Multimedia) +BuildRequires: qt6-qtbase-private-devel BuildRequires: desktop-file-utils +BuildRequires: libxkbcommon-devel BuildRequires: libXv-devel + +%if 0%{?fedora_version} > 39 +BuildRequires: libvpl +%endif %endif %if 0%{?mageia} -%ifarch x86_64 BuildRequires: lib64bzip2-devel -BuildRequires: lib64qt5qml-devel -BuildRequires: lib64qt5base5-devel -BuildRequires: lib64qt5quicktemplates2-devel -BuildRequires: lib64qt5quicktemplates2_5 -BuildRequires: lib64qt5quickcontrols2-devel -BuildRequires: lib64qt5quickcontrols2_5 -BuildRequires: lib64qt5quickwidgets-devel -BuildRequires: lib64qt5multimedia-devel -BuildRequires: lib64qt5svg-devel -BuildRequires: lib64qt5xmlpatterns-devel -BuildRequires: lib64qt5xmlpatterns5 -%else -BuildRequires: libbzip2-devel -BuildRequires: libqt5qml-devel -BuildRequires: libqt5base5-devel -BuildRequires: libqt5quicktemplates2-devel -BuildRequires: libqt5quicktemplates2_5 -BuildRequires: libqt5quickcontrols2-devel -BuildRequires: libqt5quickcontrols2_5 -BuildRequires: libqt5quickwidgets-devel -BuildRequires: libqt5multimedia-devel -BuildRequires: libqt5svg-devel -BuildRequires: libqt5xmlpatterns-devel -BuildRequires: libqt5xmlpatterns5 -%endif -%if 0%{?mageia} > 5 -BuildRequires: libproxy-pacrunner -%endif -BuildRequires: sane-backends-iscan -BuildRequires: libuuid-devel +BuildRequires: lib64qt6qml-devel +BuildRequires: lib64qt6base6-devel +BuildRequires: lib64qt6quicktemplates2-devel +BuildRequires: lib64qt6quicktemplates26 +BuildRequires: lib64qt6quickcontrols2-devel +BuildRequires: lib64qt6quickcontrols26 +BuildRequires: lib64qt6quickwidgets-devel +BuildRequires: lib64qt6multimedia-devel +BuildRequires: lib64qt6multimediawidgets-devel +BuildRequires: lib64qt6svg-devel %endif %package -n qcli @@ -131,10 +115,25 @@ the digital object, and the associated catalog record. %setup -q -n qctools # build +pushd ffmpeg + ./configure --enable-gpl --enable-version3 --disable-autodetect --disable-programs --disable-securetransport --disable-videotoolbox --enable-static --disable-shared --disable-doc --disable-debug --disable-lzma --disable-iconv --enable-pic --prefix="$(pwd)" --enable-libfreetype --enable-libharfbuzz + %__make %{?jobs:-j%{jobs}} +popd + +pushd qwt + export QWT_STATIC=1 QWT_NO_SVG=1 QWT_NO_OPENGL=1 QWT_NO_DESIGNER=1 + qmake + %__make %{?jobs:-j%{jobs}} +popd + pushd qctools chmod 644 History.txt chmod 644 License.html - ./Project/BuildAllFromSource/build + mkdir Project/QtCreator/build + pushd Project/QtCreator/build + qmake DEFINES+=QT_AVPLAYER_MULTIMEDIA .. + %__make %{?jobs:-j%{jobs}} + popd popd %install diff --git a/Project/QtCreator/brew.pri b/Project/QtCreator/brew.pri new file mode 100644 index 000000000..700880cd7 --- /dev/null +++ b/Project/QtCreator/brew.pri @@ -0,0 +1,66 @@ +USE_BREW = $$(QCTOOLS_USE_BREW) +USE_SYSTEM = $${QCTOOLS_USE_SYSTEM} + +QCTOOLS_USE_BREW_NOT_EMPTY = false +QCTOOLS_USE_SYSTEM_NOT_EMPTY = false + +!isEmpty(USE_BREW) { + message("USE_BREW not empty") + QCTOOLS_USE_BREW_NOT_EMPTY = true +} + +!isEmpty(USE_SYSTEM) { + message("USE_SYSTEM not empty") + QCTOOLS_USE_SYSTEM_NOT_EMPTY = true +} + +QCTOOLS_USE_BREW_EQUALS_TRUE = false +QCTOOLS_USE_SYSTEM_EQUALS_TRUE = false + +equals(USE_BREW, true) { + message("USE_BREW equals true") + QCTOOLS_USE_BREW_EQUALS_TRUE = true +} + +equals(USE_SYSTEM, true) { + message("USE_SYSTEM equals true") + QCTOOLS_USE_SYSTEM_EQUALS_TRUE = true +} + +message("QCTOOLS_USE_BREW_NOT_EMPTY = " $$QCTOOLS_USE_BREW_NOT_EMPTY ) +message("QCTOOLS_USE_BREW_EQUALS_TRUE = " $$QCTOOLS_USE_BREW_EQUALS_TRUE ) + +message("QCTOOLS_USE_SYSTEM_NOT_EMPTY = " $$QCTOOLS_USE_SYSTEM_NOT_EMPTY ) +message("QCTOOLS_USE_SYSTEM_EQUALS_TRUE = " $$QCTOOLS_USE_SYSTEM_EQUALS_TRUE ) + +!isEmpty(USE_BREW):equals(USE_BREW, true) { + message("DEFINES += USE_BREW") + DEFINES += USE_BREW +} + +!isEmpty(USE_SYSTEM):equals(USE_SYSTEM, true) { + message("DEFINES += USE_SYSTEM") + DEFINES += USE_SYSTEM +} + +macx:contains(DEFINES, USE_BREW) { + + message("use brew") + CONFIG += qwt release + + QMAKE_TARGET_BUNDLE_PREFIX = org.bavc + QT_CONFIG -= no-pkg-config + + include ( $$system(brew --prefix qwt)/features/qwt.prf ) + + CONFIG += link_pkgconfig + +} else:unix:contains(DEFINES, USE_SYSTEM) { + + message("use system libraries") + PKGCONFIG += Qt5Qwt6 + + CONFIG += link_pkgconfig +} else { + CONFIG += debug_and_release +} diff --git a/Project/QtCreator/ffmpeg.pri b/Project/QtCreator/ffmpeg.pri index e5e6927d3..c4f7ccddd 100644 --- a/Project/QtCreator/ffmpeg.pri +++ b/Project/QtCreator/ffmpeg.pri @@ -3,7 +3,6 @@ message('entering ffmpeg.pri') USE_BREW = $$(USE_BREW) macx:!isEmpty(USE_BREW):equals(USE_BREW, true) { - message("use qwt from brew") message("use ffmpeg from brew") PKGCONFIG += libavdevice libavcodec libavfilter libavformat libpostproc @@ -26,26 +25,29 @@ macx:!isEmpty(USE_BREW):equals(USE_BREW, true) { FFMPEG_INCLUDES=$$FFMPEG } - exists($$FFMPEG/lib) { - FFMPEG_AVDEVICE=$$absolute_path($$FFMPEG/lib) - FFMPEG_AVCODEC=$$absolute_path($$FFMPEG/lib) - FFMPEG_AVFILTER=$$absolute_path($$FFMPEG/lib) - FFMPEG_AVFORMAT=$$absolute_path($$FFMPEG/lib) - FFMPEG_POSTPROC=$$absolute_path($$FFMPEG/lib) - FFMPEG_SWRESAMPLE=$$absolute_path($$FFMPEG/lib) - FFMPEG_SWSCALE=$$absolute_path($$FFMPEG/lib) - FFMPEG_AVUTIL=$$absolute_path($$FFMPEG/lib) - + win32:!contains(STATIC, yes|1):exists($$FFMPEG/bin/avcodec.lib) { + FFMPEG_LIBS += -L$$absolute_path($$FFMPEG/bin) \ + -lavdevice \ + -lavcodec \ + -lavfilter \ + -lavformat \ + -lpostproc \ + -lswresample \ + -lswscale \ + -lavutil + } else:exists($$FFMPEG/lib/avcodec.lib) { FFMPEG_LIBS += -L$$absolute_path($$FFMPEG/lib) \ -lavdevice \ - -lavcodec \ -lavfilter \ -lavformat \ + -lavcodec \ -lpostproc \ -lswresample \ -lswscale \ -lavutil - + win32 { + FFMPEG_LIBS += -lUser32 -lOle32 -lSecur32 -lbcrypt -lwsock32 -lws2_32 -lVfw32 -lmfplat -lmfuuid -lstrmiids + } } else { FFMPEG_AVDEVICE=$$absolute_path($$FFMPEG/libavdevice) FFMPEG_AVCODEC=$$absolute_path($$FFMPEG/libavcodec) @@ -58,14 +60,18 @@ macx:!isEmpty(USE_BREW):equals(USE_BREW, true) { FFMPEG_LIBS += \ -L$$FFMPEG_AVDEVICE -lavdevice \ - -L$$FFMPEG_AVCODEC -lavcodec \ -L$$FFMPEG_AVFILTER -lavfilter \ -L$$FFMPEG_AVFORMAT -lavformat \ + -L$$FFMPEG_AVCODEC -lavcodec \ -L$$FFMPEG_POSTPROC -lpostproc \ -L$$FFMPEG_SWRESAMPLE -lswresample \ -L$$FFMPEG_SWSCALE -lswscale \ -L$$FFMPEG_AVUTIL -lavutil + } + contains(STATIC, yes|1) { + FFMPEG_LIBS += -L$$absolute_path($$FFMPEG/../output/lib) -lharfbuzz + FFMPEG_LIBS += -L$$absolute_path($$FFMPEG/../output/lib) -lfreetype } INCLUDEPATH += $$FFMPEG_INCLUDES diff --git a/Project/QtCreator/qctools-cli/qcli.rc b/Project/QtCreator/qctools-cli/qcli.rc new file mode 100644 index 000000000..2885976ce --- /dev/null +++ b/Project/QtCreator/qctools-cli/qcli.rc @@ -0,0 +1,37 @@ +#include + +VS_VERSION_INFO VERSIONINFO + FILEVERSION 1,4,0,0 + PRODUCTVERSION 1,4,0,0 + FILEFLAGSMASK 0x17L +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x40004L + FILETYPE 0x2L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "CompanyName", "MediaArea.net" + VALUE "FileDescription", "QCTools" + VALUE "FileVersion", "1.4.0.0" + VALUE "InternalName", "QCTools - GUI - MSVC 2017" + VALUE "LegalCopyright", "BAVC.org" + VALUE "OriginalFilename", "QCTools.exe" + VALUE "ProductName", "QCTools" + VALUE "ProductVersion", "1.4.0.0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END + +//Icons +aaaaaaaa ICON "../../../Source/Resource/Logo.ico" diff --git a/Project/QtCreator/qctools-cli/qctools-cli.pro b/Project/QtCreator/qctools-cli/qctools-cli.pro index 9170127c6..005eefb42 100644 --- a/Project/QtCreator/qctools-cli/qctools-cli.pro +++ b/Project/QtCreator/qctools-cli/qctools-cli.pro @@ -13,6 +13,8 @@ TEMPLATE = app message("PWD = " $$PWD) +win32:RC_FILE = qcli.rc + # link against libqctools win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../qctools-lib/release/ -lqctools else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../qctools-lib/debug/ -lqctools @@ -53,9 +55,6 @@ DEFINES += QT_DEPRECATED_WARNING # You can also select to disable deprecated APIs only up to a certain version of Qt. #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 include(../zlib.pri) -win32 { - LIBS += -lbcrypt -lwsock32 -lws2_32 -} !win32 { LIBS += -lbz2 @@ -81,10 +80,10 @@ macx:LIBS += -liconv \ HEADERS += \ version.h -message('qctools-lib: including ffmpeg') -include(../ffmpeg.pri) - INCLUDEPATH += ../qctools-QtAVPlayer/src include(../qctools-QtAVPlayer/src/QtAVPlayer/QtAVPlayer.pri) +message('qctools-lib: including ffmpeg') +include(../ffmpeg.pri) + message('leaving qctools-cli.pro') diff --git a/Project/QtCreator/qctools-gui/QCTools.rc b/Project/QtCreator/qctools-gui/QCTools.rc new file mode 100644 index 000000000..2885976ce --- /dev/null +++ b/Project/QtCreator/qctools-gui/QCTools.rc @@ -0,0 +1,37 @@ +#include + +VS_VERSION_INFO VERSIONINFO + FILEVERSION 1,4,0,0 + PRODUCTVERSION 1,4,0,0 + FILEFLAGSMASK 0x17L +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x40004L + FILETYPE 0x2L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "CompanyName", "MediaArea.net" + VALUE "FileDescription", "QCTools" + VALUE "FileVersion", "1.4.0.0" + VALUE "InternalName", "QCTools - GUI - MSVC 2017" + VALUE "LegalCopyright", "BAVC.org" + VALUE "OriginalFilename", "QCTools.exe" + VALUE "ProductName", "QCTools" + VALUE "ProductVersion", "1.4.0.0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END + +//Icons +aaaaaaaa ICON "../../../Source/Resource/Logo.ico" diff --git a/Project/QtCreator/qctools-gui/qctools-gui.pro b/Project/QtCreator/qctools-gui/qctools-gui.pro index 320ab5611..2d0df38de 100644 --- a/Project/QtCreator/qctools-gui/qctools-gui.pro +++ b/Project/QtCreator/qctools-gui/qctools-gui.pro @@ -7,10 +7,12 @@ greaterThan(QT_MAJOR_VERSION, 4): QT += widgets printsupport qml TARGET = QCTools TEMPLATE = app -CONFIG += c++1z qt +CONFIG += c++17 qt message("PWD = " $$PWD) +win32:RC_FILE = QCTools.rc + # link against libqctools win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../qctools-lib/release/ -lqctools else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../qctools-lib/debug/ -lqctools @@ -208,7 +210,6 @@ for(resource, DRESOURCES) { INCLUDEPATH += $$SOURCES_PATH INCLUDEPATH += $$SOURCES_PATH/ThirdParty/cqmarkdown include(../qwt.pri) -include(../ffmpeg.pri) CONFIG -= no_keywords @@ -216,6 +217,8 @@ DEFINES += QT_AVPLAYER_MULTIMEDIA INCLUDEPATH += ../qctools-QtAVPlayer/src include(../qctools-QtAVPlayer/src/QtAVPlayer/QtAVPlayer.pri) +include(../ffmpeg.pri) + greaterThan(QT_MAJOR_VERSION, 5) { win32-msvc* { message("/ENTRY:mainCRTStartup") @@ -223,13 +226,14 @@ greaterThan(QT_MAJOR_VERSION, 5) { } } -win32-g++* { - LIBS += -lbcrypt -lwsock32 -lws2_32 +macx { + QMAKE_MACOSX_DEPLOYMENT_TARGET = 11.0 + QMAKE_INFO_PLIST = ../../Mac/Info.plist } macx:ICON = $$SOURCES_PATH/Resource/Logo.icns macx:LIBS += -liconv \ - -framework CoreFoundation \ + -framework CoreFoundation \ -framework Foundation \ -framework AppKit \ -framework AudioToolBox \ diff --git a/Project/QtCreator/qctools-lib/qctools-lib.pro b/Project/QtCreator/qctools-lib/qctools-lib.pro index 6c3dfec20..0843b9bf4 100644 --- a/Project/QtCreator/qctools-lib/qctools-lib.pro +++ b/Project/QtCreator/qctools-lib/qctools-lib.pro @@ -5,6 +5,9 @@ TEMPLATE = lib CONFIG += c++1z CONFIG += staticlib + +include(../brew.pri) + message('qctools-lib: including ffmpeg') include(../ffmpeg.pri) diff --git a/Project/QtCreator/qwt.pri b/Project/QtCreator/qwt.pri index 98c0dd34f..7c11f32da 100644 --- a/Project/QtCreator/qwt.pri +++ b/Project/QtCreator/qwt.pri @@ -26,10 +26,11 @@ macx:!isEmpty(USE_BREW):equals(USE_BREW, true) { include( $${QWT_ROOT}/qwtfunctions.pri ) macx { - macx:LIBS += -F$${QWT_ROOT}/lib -framework qwt + contains(STATIC, yes|1):LIBS += -L$${QWT_ROOT}/lib -lqwt + else: LIBS += -F$${QWT_ROOT}/lib -framework qwt } - win32-msvc* { + !contains(STATIC, yes|1):win32-msvc* { DEFINES += QWT_DLL } @@ -40,6 +41,7 @@ macx:!isEmpty(USE_BREW):equals(USE_BREW, true) { } INCLUDEPATH += $$QWT_ROOT/src + INCLUDEPATH += $$QWT_ROOT/include # copy qwt if(equals(MAKEFILE_GENERATOR, MSVC.NET)|equals(MAKEFILE_GENERATOR, MSBUILD)) { diff --git a/Project/QtCreator/zlib.pri b/Project/QtCreator/zlib.pri index e56950507..cfc4f9602 100644 --- a/Project/QtCreator/zlib.pri +++ b/Project/QtCreator/zlib.pri @@ -1,34 +1,6 @@ win32 { - message("QT_INSTALL_PREFIX = " $$[QT_INSTALL_PREFIX]) - message("3rdparty path = " $$absolute_path($$[QT_INSTALL_PREFIX]/../src/qtbase/src/3rdparty)) - - exists($$[QT_INSTALL_PREFIX]/../src/qtbase/src/3rdparty) { - greaterThan(QT_MINOR_VERSION, 8) || greaterThan(QT_MAJOR_VERSION, 5): { - ZLIB_INCLUDE_PATH = $$absolute_path($$[QT_INSTALL_PREFIX]/../src/qtbase/src/3rdparty/zlib/src) - greaterThan(QT_MINOR_VERSION, 13): { - zlibPri = $$absolute_path($$[QT_INSTALL_PREFIX]/../src/qtbase/src/3rdparty/zlib.pri) - include($${zlibPri}) - } else { - ZLIB_INCLUDE_PATH = $$absolute_path($$[QT_INSTALL_PREFIX]/../src/qtbase/src/3rdparty/zlib/src) - } - } else { - ZLIB_INCLUDE_PATH = $$absolute_path($$[QT_INSTALL_PREFIX]/../src/qtbase/src/3rdparty/zlib) - } - - message("use zlib from Qt sources: " $${ZLIB_INCLUDE_PATH}) - } else { - ZLIB_INCLUDE_PATH = $${THIRD_PARTY_PATH}/zlib/include - - win32-msvc* { - LIBS += $${THIRD_PARTY_PATH}/zlib/lib/zlibstatic.lib - } - - win32-g++* { - LIBS += $${THIRD_PARTY_PATH}/zlib/lib/libzlibstatic.a - } - } - - message("qctools: ZLIB_INCLUDE_PATH = " $$ZLIB_INCLUDE_PATH) + ZLIB_INCLUDE_PATH = $$[QT_INSTALL_HEADERS]/QtZlib + message("qctools-lib: ZLIB_INCLUDE_PATH = " $$ZLIB_INCLUDE_PATH) INCLUDEPATH += $$ZLIB_INCLUDE_PATH } diff --git a/Release/Release_CLI_Windows_x64.ps1 b/Release/Release_CLI_Windows_x64.ps1 index 35cf3e857..92da9910d 100644 --- a/Release/Release_CLI_Windows_x64.ps1 +++ b/Release/Release_CLI_Windows_x64.ps1 @@ -56,14 +56,15 @@ Push-Location -Path QCli_${version}_Windows_x64 Copy-Item -Path $build_path\qctools\Project\QtCreator\build\qctools-cli\release\tls\qopensslbackend.dll Copy-Item -Path $build_path\qctools\Project\QtCreator\build\qctools-cli\release\tls\qschannelbackend.dll Pop-Location - Copy-Item -Path $build_path\ffmpeg\bin\avdevice-*.dll - Copy-Item -Path $build_path\ffmpeg\bin\avcodec-*.dll - Copy-Item -Path $build_path\ffmpeg\bin\avfilter-*.dll - Copy-Item -Path $build_path\ffmpeg\bin\avformat-*.dll - Copy-Item -Path $build_path\ffmpeg\bin\avutil-*.dll - Copy-Item -Path $build_path\ffmpeg\bin\postproc-*.dll - Copy-Item -Path $build_path\ffmpeg\bin\swresample-*.dll - Copy-Item -Path $build_path\ffmpeg\bin\swscale-*.dll + Copy-Item -Path $build_path\output\lib\qwt.dll + Copy-Item -Path $build_path\output\bin\avdevice-*.dll + Copy-Item -Path $build_path\output\bin\avcodec-*.dll + Copy-Item -Path $build_path\output\bin\avfilter-*.dll + Copy-Item -Path $build_path\output\bin\avformat-*.dll + Copy-Item -Path $build_path\output\bin\avutil-*.dll + Copy-Item -Path $build_path\output\bin\postproc-*.dll + Copy-Item -Path $build_path\output\bin\swresample-*.dll + Copy-Item -Path $build_path\output\bin\swscale-*.dll Copy-Item -Path $build_path\output\bin\freetype-*.dll Copy-Item -Path $build_path\output\bin\harfbuzz.dll Copy-Item -Path $Env:VCToolsRedistDir\x64\Microsoft.VC143.CRT\concrt140.dll diff --git a/Release/Release_GUI_Windows_x64.ps1 b/Release/Release_GUI_Windows_x64.ps1 index f9d79ca60..bd2cf75c7 100644 --- a/Release/Release_GUI_Windows_x64.ps1 +++ b/Release/Release_GUI_Windows_x64.ps1 @@ -73,14 +73,15 @@ Push-Location -Path QCTools_${version}_Windows_x64 Copy-Item -Path $build_path\qctools\Project\QtCreator\build\qctools-gui\release\tls\qopensslbackend.dll Copy-Item -Path $build_path\qctools\Project\QtCreator\build\qctools-gui\release\tls\qschannelbackend.dll Pop-Location - Copy-Item -Path $build_path\ffmpeg\bin\avdevice-*.dll - Copy-Item -Path $build_path\ffmpeg\bin\avcodec-*.dll - Copy-Item -Path $build_path\ffmpeg\bin\avfilter-*.dll - Copy-Item -Path $build_path\ffmpeg\bin\avformat-*.dll - Copy-Item -Path $build_path\ffmpeg\bin\avutil-*.dll - Copy-Item -Path $build_path\ffmpeg\bin\postproc-*.dll - Copy-Item -Path $build_path\ffmpeg\bin\swresample-*.dll - Copy-Item -Path $build_path\ffmpeg\bin\swscale-*.dll + Copy-Item -Path $build_path\output\lib\qwt.dll + Copy-Item -Path $build_path\output\bin\avdevice-*.dll + Copy-Item -Path $build_path\output\bin\avcodec-*.dll + Copy-Item -Path $build_path\output\bin\avfilter-*.dll + Copy-Item -Path $build_path\output\bin\avformat-*.dll + Copy-Item -Path $build_path\output\bin\avutil-*.dll + Copy-Item -Path $build_path\output\bin\postproc-*.dll + Copy-Item -Path $build_path\output\bin\swresample-*.dll + Copy-Item -Path $build_path\output\bin\swscale-*.dll Copy-Item -Path $build_path\output\bin\freetype-*.dll Copy-Item -Path $build_path\output\bin\harfbuzz.dll Copy-Item -Path $Env:VCToolsRedistDir\x64\Microsoft.VC143.CRT\concrt140.dll diff --git a/Source/GUI/filterselector.h b/Source/GUI/filterselector.h index 5b4f182b9..a222ca316 100644 --- a/Source/GUI/filterselector.h +++ b/Source/GUI/filterselector.h @@ -9,6 +9,7 @@ #include #include #include +#include #include "doublespinboxwithslider.h" #include "filters.h" diff --git a/Source/GUI/main.cpp b/Source/GUI/main.cpp index 3ba0e45b8..73b69b733 100755 --- a/Source/GUI/main.cpp +++ b/Source/GUI/main.cpp @@ -10,6 +10,9 @@ #include #include +#if defined(_WIN32) && !defined(_DLL) + Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin) +#endif #include diff --git a/Source/Install/QCTools.nsi b/Source/Install/QCTools.nsi index 6d555f06c..102d8be41 100644 --- a/Source/Install/QCTools.nsi +++ b/Source/Install/QCTools.nsi @@ -95,14 +95,15 @@ Section "SectionPrincipale" SEC01 File "..\..\History.txt" File "..\..\License.html" !ifndef STATIC - File "..\..\..\ffmpeg\bin\avdevice-*.dll" - File "..\..\..\ffmpeg\bin\avcodec-*.dll" - File "..\..\..\ffmpeg\bin\avfilter-*.dll" - File "..\..\..\ffmpeg\bin\avformat-*.dll" - File "..\..\..\ffmpeg\bin\avutil-*.dll" - File "..\..\..\ffmpeg\bin\postproc-*.dll" - File "..\..\..\ffmpeg\bin\swresample-*.dll" - File "..\..\..\ffmpeg\bin\swscale-*.dll" + File "..\..\..\output\lib\qwt.dll" + File "..\..\..\output\bin\avdevice-*.dll" + File "..\..\..\output\bin\avcodec-*.dll" + File "..\..\..\output\bin\avfilter-*.dll" + File "..\..\..\output\bin\avformat-*.dll" + File "..\..\..\output\bin\avutil-*.dll" + File "..\..\..\output\bin\postproc-*.dll" + File "..\..\..\output\bin\swresample-*.dll" + File "..\..\..\output\bin\swscale-*.dll" File "..\..\..\output\bin\freetype-*.dll" File "..\..\..\output\bin\harfbuzz.dll" File "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Redist\MSVC\14.42.34433\X64\Microsoft.VC143.CRT\concrt140.dll" @@ -201,6 +202,7 @@ Section Uninstall Delete "$INSTDIR\vcruntime140.dll" Delete "$INSTDIR\vcruntime140_1.dll" Delete "$INSTDIR\vcruntime140_threads.dll" + Delete "$INSTDIR\qwt.dll" Delete "$INSTDIR\Qt6Core.dll" Delete "$INSTDIR\Qt6Gui.dll" Delete "$INSTDIR\Qt6Multimedia.dll" diff --git a/debian/control b/debian/control index 48d63e0de..caa89a372 100644 --- a/debian/control +++ b/debian/control @@ -1,7 +1,7 @@ Source: qctools Priority: optional Maintainer: MediaArea.net SARL -Build-Depends: debhelper (>= 9), qtbase5-dev, qtdeclarative5-dev, libqt5svg5-dev, libqt5xmlpatterns5-dev, qtmultimedia5-dev, qtquickcontrols2-5-dev, libqt5opengl5-dev, qtchooser, libegl1-mesa-dev, libxv-dev, libxcb-shm0-dev, libxcb-render0-dev, libxcb-xfixes0-dev, libxcb-shape0-dev, zlib1g-dev, libbz2-dev, pkg-config, yasm +Build-Depends: debhelper (>= 9), qt6-base-dev, qt6-base-private-dev, qt6-declarative-dev, qt6-svg-dev, qt6-multimedia-dev, qmake6, libfreetype-dev, libharfbuzz-dev, libegl1-mesa-dev, libxv-dev, libxcb-shm0-dev, libxcb-render0-dev, libxcb-xfixes0-dev, libxcb-shape0-dev, zlib1g-dev, libbz2-dev, pkg-config, nasm Standards-Version: 3.7.3 Section: utils Homepage: http://www.bavc.org/qctools diff --git a/debian/rules b/debian/rules index 3f16d0736..d1eb2ff52 100644 --- a/debian/rules +++ b/debian/rules @@ -3,7 +3,10 @@ # Uncomment this to turn on verbose mode. export DH_VERBOSE=1 -export QT_SELECT=qt5 +export QWT_STATIC=1 +export QWT_NO_SVG=1 +export QWT_NO_OPENGL=1 +export QWT_NO_DESIGNER=1 configure: configure-stamp configure-stamp: @@ -18,10 +21,17 @@ build-stamp: configure-stamp dh_testdir # Add here commands to compile the package. - cd qctools && ./Project/BuildAllFromSource/build + cd ffmpeg && ./configure --enable-gpl --enable-version3 --disable-autodetect --disable-programs --disable-securetransport --disable-videotoolbox --enable-static --disable-shared --disable-doc --disable-debug --disable-lzma --disable-iconv --enable-pic --prefix="$(pwd)" --enable-libfreetype --enable-libharfbuzz + cd ffmpeg && $(MAKE) + + cd qwt && qmake6 + cd qwt && $(MAKE) - touch $@ + mkdir qctools/Project/QtCreator/build + cd qctools/Project/QtCreator/build && qmake6 DEFINES+=QT_AVPLAYER_MULTIMEDIA .. + cd qctools/Project/QtCreator/build && $(MAKE) + touch $@ clean: dh_testdir dh_testroot