Ticket #53097: kchmviewer.diff

File kchmviewer.diff, 4.4 KB (added by RJVB (René Bertin), 7 years ago)
  • kchmviewer/Portfile

    old new  
    1 # $Id$
     1# -*- 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
    22
    3 PortSystem      1.0
     3PortSystem          1.0
     4# kchmviewer's KDE variant still requires KDE4 and will thus not be shipped for now.
     5# The pure Qt variant is obtained by using QMake instead of CMake.
     6PortGroup           qmake5 1.0
     7
     8name                kchmviewer
     9version             7.7
     10
     11categories          devel
     12description         A CHM (Winhelp) files viewer written for Qt.
     13long_description    kchmviewer is a reader for CHM (Winhelp) and EPUB \
     14                    files using the Qt toolkit. \
     15                    The main point of kchmviewer is compatibility with \
     16                    non-English chm files, including most international charsets.
     17
     18maintainers         gmail.com:rjvbertin mk openmaintainer
     19platforms           darwin linux
     20license             GPL-3
     21
     22homepage            https://sourceforge.net/projects/kchmviewer
     23distname            ${name}-${version}
     24master_sites        sourceforge:project/${name}/${name}/${version}
     25
     26checksums           rmd160  3b072a3225c5a4c796a9406232c3f696285d9aa4 \
     27                    sha256  27cbac45c786b1718550a87e6f86010e161302b426c6396ff2a3091b913b17dd
     28
     29depends_build-append \
     30                    port:dos2unix
     31
     32depends_lib-append  port:libzip \
     33                    port:chmlib
     34
     35# kchmviewer is transitioning to QtWebEngine, but that adaptation is not yet functional.
     36if {[info exists qt5.using_kde] && ${qt5.using_kde}} {
     37    qt5.depends_component \
     38                    qtwebkit
     39} else {
     40    # qt5.depends_component is not yet available
     41    if {${os.major} == 11} {
     42        depends_lib-append \
     43                    port:qt55-qtwebkit
     44    } else {
     45        depends_lib-append \
     46                    port:qt5-qtwebkit
     47    }
     48}
     49
     50post-extract {
     51    # force consistent line-endings
     52    system -W ${worksrcpath} "find . \\\( -name \"*.cpp\" -o -name \"*.h\" -o -name \"*.pro\" \\\) -exec dos2unix '{}' \";\""
     53}
     54
     55patch.pre_args      -Np1
     56# make it build and work as intended.
     57# Some of these patches have been submitted upstream:
     58# https://sourceforge.net/p/kchmviewer/patches/9/
     59patchfiles-append   patch-release-build.diff \
     60                    patch-libzip-incpath.diff \
     61                    patch-use-webkit-and-dbus.diff \
     62                    patch-avoid-private-member.diff \
     63                    patch-main-mac.diff \
     64                    patch-encoding-no-abort.diff
     65
     66post-patch {
     67    reinplace "s|@PREFIX@|${prefix}|g" \
     68                    ${worksrcpath}/lib/libebook/libebook.pro \
     69                    ${worksrcpath}/src/src.pro
     70}
     71
     72configure.cppflags-append   -I${prefix}/lib/libzip/include
     73default configure.dir       {${workpath}/build}
     74configure.pre_args-append   ../${worksrcdir}/${name}.pro
     75configure.args-append       -nocache -recursive
     76default build.dir           {${workpath}/build}
     77
     78platform darwin {
     79    destroot {
     80        xinstall -m 755 -d ${destroot}${qt_apps_dir}
     81        file copy ${build.dir}/bin/kchmviewer.app ${destroot}${qt_apps_dir}
     82        if {[info procs qt5.add_app_wrapper] ne ""} {
     83            qt5.add_app_wrapper kchmviewer
     84        }
     85    }
     86}
     87
     88platform linux {
     89    destroot {
     90        xinstall -m 755 ${build.dir}/bin/kchmviewer ${destroot}${prefix}/bin
     91    }
     92}
    493
    5 name                    kchmviewer
    6 version                 3.1-2
    7 revision                1
    8 categories              x11
    9 maintainers             nomaintainer
    10 platforms               darwin
    11 
    12 description             A CHM (Winhelp) files viewer written on Qt/KDE.
    13 long_description        A CHM (Winhelp) files viewer written on Qt/KDE. It \
    14                         can be build as a standalone Qt-based application, \
    15                         or a KDE application. The main point of kchmviewer \
    16                         is compatibility with non-English chm files, including \
    17                         most international charsets.
    18 
    19 homepage                http://www.kchmviewer.net/
    20 master_sites            sourceforge
    21 checksums               md5 bc376ce29784f33bf0b5f8d1ae5141bf
    22 # for version 3.1-2 ...
    23 worksrcdir              kchmviewer-3.1
    24 
    25 depends_lib             port:qt3 port:chmlib
    26 
    27 configure.args          --with-qt-dir=${prefix} \
    28                         --with-qt-includes=${prefix}/include/qt3 \
    29                         --with-extra-includes=${prefix}/include \
    30                         --with-extra-libs=${prefix}/lib
    31 
    32 #Variant made stub on 2014/09/28
    33 variant kde description "Stub variant" {}
     94livecheck.regex /${name}-(\[0-9.\]+)${extract.suffix}