Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Multimedia
Kdenlive
Commits
d8fae4d6
Commit
d8fae4d6
authored
Oct 22, 2018
by
Vincent Pinon
Browse files
Fix MinGW build
parent
b0501506
Changes
5
Hide whitespace changes
Inline
Side-by-side
CMakeLists.txt
View file @
d8fae4d6
...
...
@@ -118,7 +118,11 @@ set_package_properties(MLT PROPERTIES
TYPE RUNTIME
PURPOSE
"Required to do video processing"
)
set
(
MLT_PREFIX
${
MLT_ROOT_DIR
}
)
if
(
NOT WIN32
)
set
(
MLT_PREFIX
${
MLT_ROOT_DIR
}
)
else
()
set
(
MLT_PREFIX
".."
)
endif
()
add_subdirectory
(
data
)
if
(
KF5DocTools_FOUND
)
...
...
packaging/kdenlive-msys2.sh
View file @
d8fae4d6
...
...
@@ -9,23 +9,24 @@ set -xe
[
-z
"
$MSYSTEM
"
]
&&
echo
"Please run under MSYS/MINGW(64)"
&&
exit
1
# change this to another location if you prefer
export
SRC
=
$PWD
/src
PREFIX
=
/opt/kdenlive
# PREFIX=$MINGW_PREFIX
export
SRC
=
$PWD
/src
mkdir
-p
$SRC
if
[
-n
"
$PREFIX
"
]
;
then
mkdir
-p
$PREFIX
/lib
export
PATH
=
$PREFIX
/bin:
$PATH
export
LD_LIBRARY_PATH
=
$PREFIX
/lib:/usr/lib
export
PKG_CONFIG_PATH
=
$PREFIX
/lib/pkgconfig:/usr/lib/pkgconfig
fi
export
PREFIX
=
$MINGW_PREFIX
#if [ -n "$PREFIX" ] ; then
# mkdir -p $PREFIX/lib
# export PATH=$PREFIX/bin:$PATH
# export LD_LIBRARY_PATH=$PREFIX/lib:/usr/lib
# export PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig:/usr/lib/pkgconfig
#fi
THREADS
=
$(
grep
-c
^processor /proc/cpuinfo 2>/dev/null
||
sysctl
-n
hw.ncpu
)
[[
$THREADS
-gt
1
]]
&&
THREADS
=
$((
THREADS-1
))
# $@: package base names
function
pacman_install
{
PKG
=
"
$@
"
pacman
-Suyy
--needed
$(
for
p
in
$PKG
;
do
echo
$MINGW_PACKAGE_PREFIX
-
$p
;
done
)
pacman
-Sy
--needed
${
@/#/mingw-w64-x86_64-
}
}
# $1: repo URL, $2: branch
...
...
@@ -36,7 +37,7 @@ function git_pull {
if
[
-d
$PKG
]
;
then
echo
"
$PKG
already cloned"
cd
$PKG
git reset
--hard
#
git reset --hard
git checkout
$BRANCH
git pull
--rebase
cd
..
...
...
@@ -69,7 +70,7 @@ function cmake_ninja {
[
-n
"
$PREFIX
"
]
&&
CMAKE_ARGS+
=
" -DCMAKE_INSTALL_PREFIX:PATH=
$PREFIX
"
mkdir
-p
$SRC
/
$PKG
/build
cd
$SRC
/
$PKG
/build
cmake ..
-G
Ninja
-DCMAKE_BUILD_TYPE
=
Release
$CMAKE_ARGS
cmake ..
-G
Ninja
$CMAKE_ARGS
ninja
install
}
...
...
@@ -79,25 +80,31 @@ function configure_make {
[
-n
"
$PREFIX
"
]
&&
CONFIGURE_ARGS+
=
" --prefix=
$PREFIX
"
cd
$SRC
/
$PKG
./configure
$CONFIGURE_ARGS
make
-j
$THREADS
make
install
mingw32-
make
-j
$THREADS
mingw32-
make
install
}
pacman_install ruby ninja libtool eigen3
\
SDL2 exiv2 ladspa-sdk opencv vid.stab gavl ffmpeg gtk2 qt5 extra-cmake-modules
\
$(
for
p
in
\
breeze-icons karchive kconfig kcoreaddons kdbusaddons kguiaddons
\
ki18n kitemviews kwidgetsaddons kcompletion kwindowsystem
\
kcrash kjobwidgets kauth kcodecs kconfigwidgets kiconthemes
\
solid sonnet attica kservice kglobalaccel ktextwidgets
\
kxmlgui kbookmarks knotifications kio knewstuff
\
kpackage kdeclarative
\
;
do
echo
$p
-qt5
;
done
)
if
false
;
then
pacman
-Suy
automake-wrapper
KF5_VERSION
=
$(
pacman
-Qs
$MINGW_PACKAGE_PREFIX
-extra-cmake-modules
|
sed
-n
's/.* \(5\..*\)-.*/\1/p'
)
#### DOWNLOAD DEPS
if
pacman
-Suy
;
then
# MSYS tools
pacman
-Sy
--needed
git automake1.16
# MINGW packages
TOOLS
=
"make cmake ninja pkg-config libtool"
# ruby
DEPS
=
"gcc drmingw gavl opencv dlfcn SDL2 exiv2 libexif vid.stab ffmpeg gtk2 qt5 fftw ladspa-sdk eigen3 extra-cmake-modules"
KF5
=(
karchive kconfig kcoreaddons kdbusaddons kguiaddons
\
ki18n kitemviews kwidgetsaddons kcompletion kwindowsystem
\
kcrash kjobwidgets kauth kcodecs kconfigwidgets kiconthemes
\
solid sonnet attica kservice kglobalaccel ktextwidgets
\
kxmlgui kbookmarks knotifications kio knewstuff
\
kpackage kdeclarative
)
pacman_install
$DEPS
$TOOLS
${
KF5
[@]/%/-qt5
}
fi
#### BUILD EXTRA KF5
KF5_VERSION
=
$(
pacman
-Ss
$MINGW_PACKAGE_PREFIX
-extra-cmake-modules
|
sed
-n
's/.* \(5\..*\)-.*/\1/p'
)
for
FRAMEWORK
in
knotifyconfig purpose
;
do
#git_pull git://anongit.kde.org/$FRAMEWORK v$KF5_VERSION
wget_extract https://download.kde.org/stable/frameworks/
${
KF5_VERSION
%.*
}
/
$FRAMEWORK
-
$KF5_VERSION
.tar.xz
...
...
@@ -115,41 +122,38 @@ for FRAMEWORK in knotifyconfig purpose ; do
#-DECM_DIR=$MINGW_PREFIX/share/ECM \
done
#wget_extract https://github.com/jackaudio/jack2/releases/download/v1.9.12/jack2-1.9.12.tar.gz
#git_pull https://github.com/jackaudio/jack2.git
#pushd $SRC/jack2 #-1.9.12
#./waf configure build install -j $THREADS --prefix=$PREFIX
#popd
#git_pull https://git.sesse.net/movit
#pushd $SRC/movit
#./autogen.sh
#popd
#configure_make movit
#### BUILD MULTIMEDIA DEPS
if
false
;
then
# Still Failing
wget_extract https://github.com/jackaudio/jack2/releases/download/v1.9.12/jack2-1.9.12.tar.gz
git_pull https://github.com/jackaudio/jack2.git
pushd
$SRC
/jack2
#-1.9.12
./waf configure build
install
-j
$THREADS
--prefix
=
$PREFIX
popd
git_pull https://git.sesse.net/movit
pushd
$SRC
/movit
./autogen.sh
popd
configure_make movit
fi
git_pull https://github.com/dyne/frei0r.git
cmake_ninja frei0r
git_pull https://github.com/mltframework/mlt.git
configure_make mlt
--enable-gpl
--enable-gpl3
mv
$PREFIX
/
{
melt.exe,libmlt
*
.dll
}
$PREFIX
/bin
#### BUILD KDENLIVE
git_pull https://anongit.kde.org/kdenlive.git
#git_pull https://anongit.kde.org/releaseme.git
#pushd $SRC/kdenlive
#ruby ../releaseme/fetchpo.rb --origin stable --project kdenlive --output-dir po --output-poqm-dir poqm .
#popd
fi
cmake_ninja kdenlive
\
-DBUILD_TESTING
:BOOL
=
OFF
\
-DKDE_INSTALL_USE_QT_SYS_PATHS
:BOOL
=
ON
# -DKDE_L10N_AUTO_TRANSLATIONS:BOOL=ON
#-DKDE_INSTALL_LIBDIR=lib \
#-DKDE_INSTALL_QMLDIR=share/qt5/qml \
#-DKDE_INSTALL_QTPLUGINDIR=share/qt5/plugins \
#-DKDE_INSTALL_DBUSDIR=share/dbus-1 \
#-DKDE_INSTALL_MANDIR=share/man \
#-DKDE_INSTALL_APPDIR=share/applications \
#-DKDE_INSTALL_MIMEDIR=share/mime/packages \
#-DECM_MKSPECS_INSTALL_DIR=$MINGW_PREFIX/share/qt5/mkspecs/modules \
#-DECM_DIR=$MINGW_PREFIX/share/ECM \
mkdir
-p
$SRC
/kdenlive/build
cd
$SRC
/kdenlive/build
cmake_ninja kdenlive
-DCMAKE_BUILD_TYPE
=
RelWithDebSymbols
-DBUILD_TESTING
:BOOL
=
OFF
-DKDE_INSTALL_USE_QT_SYS_PATHS
:BOOL
=
ON
src/CMakeLists.txt
View file @
d8fae4d6
...
...
@@ -30,21 +30,26 @@ if (CMAKE_COMPILER_IS_GNUCXX)
endif
()
SET
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-Wunused-parameter -Wshadow -Wno-variadic-macros -Wno-float-conversion"
)
find_package
(
PkgConfig QUIET
)
execute_process
(
COMMAND
${
PKG_CONFIG_EXECUTABLE
}
--variable=mltdatadir mlt-framework
OUTPUT_VARIABLE MLT_DATADIR
RESULT_VARIABLE MLT_DATADIR_failed
)
if
(
NOT MLT_DATADIR_failed
)
string
(
REGEX REPLACE
"[
\r\n
]"
""
MLT_DATADIR
"
${
MLT_DATADIR
}
"
)
endif
()
execute_process
(
COMMAND
${
PKG_CONFIG_EXECUTABLE
}
--variable=meltbin mlt-framework
OUTPUT_VARIABLE MLT_MELTBIN
RESULT_VARIABLE MLT_MELTBIN_failed
)
if
(
NOT MLT_MELTBIN_failed
)
string
(
REGEX REPLACE
"[
\r\n
]"
""
MLT_MELTBIN
"
${
MLT_MELTBIN
}
"
)
if
(
NOT WIN32
)
find_package
(
PkgConfig QUIET
)
execute_process
(
COMMAND
${
PKG_CONFIG_EXECUTABLE
}
--variable=mltdatadir mlt-framework
OUTPUT_VARIABLE MLT_DATADIR
RESULT_VARIABLE MLT_DATADIR_failed
)
if
(
NOT MLT_DATADIR_failed
)
string
(
REGEX REPLACE
"[
\r\n
]"
""
MLT_DATADIR
"
${
MLT_DATADIR
}
"
)
endif
()
execute_process
(
COMMAND
${
PKG_CONFIG_EXECUTABLE
}
--variable=meltbin mlt-framework
OUTPUT_VARIABLE MLT_MELTBIN
RESULT_VARIABLE MLT_MELTBIN_failed
)
if
(
NOT MLT_MELTBIN_failed
)
string
(
REGEX REPLACE
"[
\r\n
]"
""
MLT_MELTBIN
"
${
MLT_MELTBIN
}
"
)
endif
()
else
()
set
(
MLT_MELTBIN
"melt.exe"
)
set
(
MLT_DATADIR
"../share/mlt"
)
endif
()
configure_file
(
mlt_config.h.in
${
CMAKE_BINARY_DIR
}
/generated/mlt_config.h
)
...
...
src/main.cpp
View file @
d8fae4d6
...
...
@@ -57,6 +57,9 @@ int main(int argc, char *argv[])
qt_qhash_seed
.
store
(
0
);
#endif
// Init application
QApplication
app
(
argc
,
argv
);
QCoreApplication
::
setAttribute
(
Qt
::
AA_UseHighDpiPixmaps
);
QCoreApplication
::
setAttribute
(
Qt
::
AA_ShareOpenGLContexts
,
true
);
#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC)
...
...
@@ -67,8 +70,6 @@ int main(int argc, char *argv[])
qputenv
(
"KDE_FORK_SLAVES"
,
"1"
);
#endif
// Init application
QApplication
app
(
argc
,
argv
);
app
.
setApplicationName
(
QStringLiteral
(
"kdenlive"
));
app
.
setOrganizationDomain
(
QStringLiteral
(
"kde.org"
));
app
.
setWindowIcon
(
QIcon
(
QStringLiteral
(
":/pics/kdenlive.png"
)));
...
...
src/mltconnection.cpp
View file @
d8fae4d6
...
...
@@ -9,7 +9,7 @@ the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
*/
#include
"mlt_config.h"
//
#include "mlt_config.h"
#include
"mltconnection.h"
#include
"kdenlivesettings.h"
#include
"core.h"
...
...
@@ -41,30 +41,19 @@ MltConnection::MltConnection(const QString &mltPath)
void
MltConnection
::
locateMeltAndProfilesPath
(
const
QString
&
mltPath
)
{
QString
profilePath
=
mltPath
;
if
(
!
KdenliveSettings
::
mltpath
().
isEmpty
()
&&
QFile
::
exists
(
KdenliveSettings
::
mltpath
()))
{
return
;
}
if
(
profilePath
.
isEmpty
()
||
!
QFile
::
exists
(
profilePath
))
profilePath
=
qgetenv
(
"MLT_PROFILES_PATH"
);
if
(
profilePath
.
isEmpty
()
||
!
QFile
::
exists
(
profilePath
))
profilePath
=
qgetenv
(
"MLT_DATA"
)
+
QStringLiteral
(
"/profiles/"
);
if
(
profilePath
.
isEmpty
()
||
!
QFile
::
exists
(
profilePath
))
profilePath
=
qgetenv
(
"MLT_PREFIX"
)
+
QStringLiteral
(
"/share/mlt/profiles/"
);
#ifdef Q_OS_WIN
if
(
profilePath
.
isEmpty
()
||
!
QFile
::
exists
(
profilePath
))
profilePath
=
qApp
->
applicationDirPath
()
+
QStringLiteral
(
"/share/mlt/profiles/"
);
#else
if
(
profilePath
.
isEmpty
()
||
!
QFile
::
exists
(
profilePath
))
profilePath
=
KdenliveSettings
::
mltpath
();
// build-time definition
if
((
profilePath
.
isEmpty
()
||
!
QFile
::
exists
(
profilePath
))
&&
!
QStringLiteral
(
MLT_DATADIR
).
isEmpty
())
profilePath
=
QStringLiteral
(
MLT_DATADIR
)
+
QStringLiteral
(
"/profiles/"
);
#endif
if
(
profilePath
.
isEmpty
()
||
!
QFile
::
exists
(
profilePath
))
profilePath
=
qApp
->
applicationDirPath
()
+
QStringLiteral
(
"/../share/mlt/profiles/"
);
KdenliveSettings
::
setMltpath
(
profilePath
);
#ifdef Q_OS_WIN
QString
meltPath
=
QDir
::
cleanPath
(
profilePath
+
QStringLiteral
(
"../../../melt.exe"
));
QString
meltPath
=
QDir
::
cleanPath
(
profilePath
+
QStringLiteral
(
"../../../
bin/
melt.exe"
));
#else
QString
meltPath
=
QDir
::
cleanPath
(
profilePath
+
QStringLiteral
(
"../../../bin/melt"
));
#endif
if
(
!
QFile
::
exists
(
meltPath
))
meltPath
=
qgetenv
(
"MLT_PREFIX"
)
+
QStringLiteral
(
"/bin/melt"
);
if
(
!
QFile
::
exists
(
meltPath
))
meltPath
=
KdenliveSettings
::
rendererpath
();
if
(
!
QFile
::
exists
(
meltPath
))
meltPath
=
QStandardPaths
::
findExecutable
(
"melt"
);
if
(
!
QFile
::
exists
(
meltPath
))
meltPath
=
QStringLiteral
(
MLT_MELTBIN
);
#endif
KdenliveSettings
::
setRendererpath
(
meltPath
);
if
(
meltPath
.
isEmpty
())
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment