# -*- 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           kde4   1.1

name                qtruby
version             4.14.3
revision            3
categories          kde kde4 devel
license             GPL-2+ LGPL-2.1+
maintainers         nomaintainer
description         Binding to Ruby for KDE.
long_description    Very complete bindings to both the KDE API and the Qt APIs. The Korundum \
                    package includes both a QtRuby Qt-only binding along with the full combined Qt/KDE one. \
                    The QtRuby package contains just Qt bindings with no dependencies on KDE.
homepage            https://techbase.kde.org/Development/Languages/Ruby
master_sites        kde:stable/${version}/src/
use_xz              yes
distname            ${name}-${version}
checksums           rmd160  a8a7dcef68b7e20c9d20f46ad0d4293c2c1c2a49 \
                    sha256  2050e79b5e116eefef97d9b2dc96b3be635621bcbf856a8009b56dc40f953c9d

depends_lib-append  port:smokeqt

patchfiles          patch-CMakeLists.diff \
                    patch-ptr-comparison.diff

variant ruby18 conflicts ruby19 ruby32 description {Select Ruby 1.8} {
    depends_lib-append      port:ruby
    configure.args-append   -DRUBY_EXECUTABLE=${prefix}/bin/ruby1.8 \
                            -DRUBY_LIBRARY=${prefix}/lib/libruby.dylib
}
variant ruby19 conflicts ruby18 ruby32 description {Select Ruby 1.9} {
    depends_lib-append      port:ruby19
    configure.args-append   -DRUBY_EXECUTABLE=${prefix}/bin/ruby1.9 \
                            -DRUBY_INCLUDE_DIRS=${prefix}/include/ruby-1.9.1/ruby \
                            -DRUBY_LIBRARY=${prefix}/lib/libruby1.9.dylib
}
variant ruby32 conflicts ruby18 ruby19 description {Select Ruby 3.2} {
    depends_lib-append      port:ruby32
    configure.args-append   -DRUBY_EXECUTABLE=${prefix}/bin/ruby3.2 \
                            -DRUBY_INCLUDE_DIRS=${prefix}/include/ruby-3.2.2/ruby \
                            -DRUBY_LIBRARY=${prefix}/lib/libruby3.2.dylib
    configure.cxxflags-append \
                            -std=c++11
    compiler.cxx_standard   2011
}

if {![variant_isset ruby18] && ![variant_isset ruby19] && ![variant_isset ruby32]} {
    default_variants +ruby18
}

livecheck.url       ${kde4.mirror}
livecheck.regex     (\\d+(\\.\\d+)+)
