From 42d52fb3e8438d73357a10376704246956474075 Mon Sep 17 00:00:00 2001 From: Sergey Fedorov Date: Tue, 16 Jul 2024 18:31:22 +0800 Subject: [PATCH] kchmviewer: fix port for legacy systems --- devel/kchmviewer/Portfile | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/devel/kchmviewer/Portfile b/devel/kchmviewer/Portfile index c5df7cbb9a34d..be22d0617864f 100644 --- a/devel/kchmviewer/Portfile +++ b/devel/kchmviewer/Portfile @@ -2,10 +2,6 @@ PortSystem 1.0 -# kchmviewer's KDE variant still requires KDE4 and will thus not be shipped for now. -# The pure Qt variant is obtained by using QMake instead of CMake. -PortGroup qmake5 1.0 - name kchmviewer version 7.7 revision 1 @@ -26,7 +22,23 @@ distname ${name}-${version} master_sites sourceforge:project/${name}/${name}/${version} checksums rmd160 3b072a3225c5a4c796a9406232c3f696285d9aa4 \ - sha256 27cbac45c786b1718550a87e6f86010e161302b426c6396ff2a3091b913b17dd + sha256 27cbac45c786b1718550a87e6f86010e161302b426c6396ff2a3091b913b17dd \ + size 345952 + +# kchmviewer's KDE variant still requires KDE4 and will thus not be shipped for now. +# The pure Qt variant is obtained by using QMake instead of CMake. +if {${os.platform} ne "darwin" || ${os.major} > 11} { + PortGroup qmake5 1.0 + + # kchmviewer is transitioning to QtWebEngine, but that adaptation is not yet functional. + # (and WebKit is a much more appropriate choice anyway.) + qt5.depends_component \ + qtwebkit +} else { + # Fallback for older systems without Qt5: + PortGroup qmake 1.0 + +} depends_build-append \ port:dos2unix @@ -34,11 +46,6 @@ depends_build-append \ depends_lib-append port:libzip \ port:chmlib -# kchmviewer is transitioning to QtWebEngine, but that adaptation is not yet functional. -# (and WebKit is a much more appropriate choice anyway.) -qt5.depends_component \ - qtwebkit - post-extract { # force consistent line-endings system -W ${worksrcpath} "find . \\\( -name \"*.cpp\" -o -name \"*.h\" -o -name \"*.pro\" \\\) -exec dos2unix '{}' \";\"" @@ -62,6 +69,9 @@ post-patch { ${worksrcpath}/src/src.pro } +# zip.h: error: wrong number of arguments specified for ‘deprecated’ attribute +compiler.blacklist-append *gcc-4.0 *gcc-4.2 + configure.cppflags-append -I${prefix}/lib/libzip/include configure.pre_args-append ${worksrcpath}/${name}.pro configure.args-append -recursive