# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4

PortSystem          1.0
PortGroup           qt5 1.0
PortGroup           cmake 1.1
PortGroup           github 1.0

github.setup        OpenShot libopenshot 0.7.0 v
revision            0
github.tarball_from archive
checksums           rmd160  cc5b77e10f8483a49e990774a2f03c326e2394e9 \
                    sha256  a7954c6af479fbd2e83059d4b6cbb13228de183f9a4eefcbcc8b3fd8de630dd2 \
                    size    27078138
homepage            https://www.openshot.org/
categories          multimedia devel
license             GPL-3+
# qt-qtmultimedia, qt-svg, qt-qtwebkit all have OpenSSLException
# does not link with or use anything else that depends on openssl
license_noconflict  openssl openssl10 libpaper
maintainers         nomaintainer

description         Library for creating and editing videos
long_description    {*}${description}. Includes python bindings but not ruby.

# qt5.min_version     ??  # Project does not indicate
qt5.depends_component \
                    qtsvg

depends_build-append \
                    port:cppzmq \
                    port:swig-python

depends_lib         path:lib/pkgconfig/babl-0.1.pc:babl \
                    path:lib/libavcodec.dylib:ffmpeg \
                    port:ImageMagick \
                    port:jsoncpp \
                    port:python314 \
                    port:libopenshot-audio \
                    port:zlib \
                    port:zmq

#depends_test        port:unittest-cpp \
#                    port:catch2

patchfiles          patch-cmake.diff

compiler.openmp_version 4.0
if {[info exists compiler.log_verbose_output]} {
    compiler.log_verbose_output no
} else {
    configure.cppflags-append -fopenmp
    configure.ldflags-append  -fopenmp
}

configure.args-append \
                    -DDISABLE_TESTS=ON \
                    -DPYTHON_EXECUTABLE:FILEPATH=${prefix}/bin/python3.14 \
                    -DPYTHON_INCLUDE_DIR:PATH=${frameworks_dir}/Python.framework/Versions/3.14/include/python3.14 \
                    -DPYTHON_LIBRARY:FILEPATH=${frameworks_dir}/Python.framework/Versions/3.14/lib/libpython3.14.dylib \
                    -DPYTHON_MODULE_PATH:FILEPATH=${frameworks_dir}/Python.framework/Versions/3.14/lib/python3.14/site-packages

# ruby bindings - if ruby27, need swig 4.0.3 which is not currently in MacPorts
# depends_build-append \
#                     port:ruby26 \
#                     port:py38-protobuf3

# swig ruby bindings fail to build
configure.args-append \
                    -DENABLE_RUBY=OFF
