git » mlt.git » commit 3900ba9

Switch back to autotools, cmake is utterly broken

author Antonio Rojas
2020-08-01 18:43:18 UTC
committer Antonio Rojas
2020-08-01 18:43:18 UTC
parent 08feb6a7948b4aeb344fb6d5a7f516855a597119

Switch back to autotools, cmake is utterly broken

PKGBUILD +15 -24
mlt-cmake-fix-build.patch +0 -17
mlt-cmake-fix-python-bindings.patch +0 -13

diff --git a/PKGBUILD b/PKGBUILD
index 8d7b057..81fc372 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -8,7 +8,7 @@
 
 pkgname=mlt
 pkgver=6.22.1
-pkgrel=1
+pkgrel=2
 pkgdesc="An open source multimedia framework"
 arch=(x86_64)
 url="https://www.mltframework.org"
@@ -37,41 +37,32 @@ makedepends=(cmake ladspa frei0r-plugins libdv sdl_image libsamplerate sox ffmpe
 conflicts=(python-mlt)
 provides=(python-mlt)
 replaces=(python-mlt)
-source=($pkgname-$pkgver.tar.gz::"https://github.com/mltframework/mlt/archive/v$pkgver.tar.gz"
-        mlt-cmake-fix-build.patch
-        mlt-cmake-fix-python-bindings.patch)
-sha256sums=('a3debdf0b8811f0d20c902cc3df3d05dad7d3ff36d1db16c0a7338d0d5989998'
-            '5871dee1c2153cf70d2a27782eba38eb694421dd089d83636b2a7f1d60938264'
-            'db0430533324ad65c1846e5391d012b97f856025ce661241f5584b681dfe0075')
-
-prepare() {
-  patch -d $pkgname-$pkgver -p1 -i ../mlt-cmake-fix-build.patch # Fix build with cmake
-  patch -d $pkgname-$pkgver -p1 -i ../mlt-cmake-fix-python-bindings.patch # Fix python bindings build with cmake
-}
+source=($pkgname-$pkgver.tar.gz::"https://github.com/mltframework/mlt/archive/v$pkgver.tar.gz")
+sha256sums=('a3debdf0b8811f0d20c902cc3df3d05dad7d3ff36d1db16c0a7338d0d5989998')
 
 build() {
-  cmake -B build -S $pkgname-$pkgver \
-    -DCMAKE_INSTALL_PREFIX=/usr
-  cmake --build build
+  cd mlt-$pkgver
+
+  ./configure --prefix=/usr \
+	--avformat-swscale \
+	--enable-gpl \
+        --enable-gpl3 \
+        --enable-opencv
+  make
 
 # python bindings
-  cd $pkgname-$pkgver/src/swig/python
+  cd src/swig/python
   ./build
 }
 
 package() {
-  DESTDIR="$pkgdir" cmake --install build
+  cd mlt-$pkgver
+  make DESTDIR="$pkgdir" install
 
 # Install python bindings
   _pythonpath=`python -c "from sysconfig import get_path; print(get_path('platlib'))"`
-  cd $pkgname-$pkgver/src/swig/python
+  cd src/swig/python
   mkdir -p "$pkgdir/$_pythonpath"
   install -m755 mlt.py "$pkgdir/$_pythonpath" 
   install -m755 _mlt.so "$pkgdir/$_pythonpath"
-
-# Compress lumas
-  for pgm in "$pkgdir"/usr/share/mlt/lumas/*/*.pgm; do
-    convert $pgm{,.png}
-    rm -f $pgm
-  done
 }
diff --git a/mlt-cmake-fix-build.patch b/mlt-cmake-fix-build.patch
deleted file mode 100644
index 69dd304..0000000
--- a/mlt-cmake-fix-build.patch
+++ /dev/null
@@ -1,17 +0,0 @@
-diff --git a/src/melt/CMakeLists.txt b/src/melt/CMakeLists.txt
-index b79afaf8..e8402276 100644
---- a/src/melt/CMakeLists.txt
-+++ b/src/melt/CMakeLists.txt
-@@ -1,11 +1,7 @@
- set(melt_lib mlt Threads::Threads)
- find_package(SDL2 QUIET)
- if(SDL2_FOUND)
--    add_library(sdl2 SHARED IMPORTED GLOBAL)
--    set_target_properties(sdl2 PROPERTIES
--        INTERFACE_INCLUDE_DIRECTORIES ${SDL2_INCLUDE_DIRS}
--        IMPORTED_LOCATION ${libdir}/libSDL2.so
--    )
-+    add_library(sdl2 ALIAS SDL2::SDL2)
- else()
-     pkg_check_modules(sdl2 IMPORTED_TARGET GLOBAL sdl2)
-     if(TARGET PkgConfig::sdl2)
diff --git a/mlt-cmake-fix-python-bindings.patch b/mlt-cmake-fix-python-bindings.patch
deleted file mode 100644
index 815e0a3..0000000
--- a/mlt-cmake-fix-python-bindings.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff --git a/src/swig/python/build b/src/swig/python/build
-index 9b86703c..1c51399f 100755
---- a/src/swig/python/build
-+++ b/src/swig/python/build
-@@ -25,7 +25,7 @@ then
- 	${CXX} -fPIC -D_GNU_SOURCE ${CXXFLAGS} -c -I../.. $PYTHON_INCLUDE mlt_wrap.cxx || exit $?
- 
- 	# Create the module
--	${CXX} ${CXXFLAGS} -shared mlt_wrap.o -L../../mlt++ -lmlt++ -L../../framework -lmlt $("${PYTHON}-config" --ldflags) -o _mlt.so || exit $?
-+	${CXX} ${CXXFLAGS} -shared mlt_wrap.o -L../../../../build/src/mlt++ -lmlt++ -L../../../../build/src/framework -lmlt ${LDFLAGS} $("${PYTHON}-config" --ldflags) -o _mlt.so || exit $?
- else
- 	echo Python not installed.
- 	exit 1