# -*- 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           github 1.0
PortGroup           qt5 1.0
PortGroup           boost 1.0

github.setup        litecoin-project litecoin 0.16.3 v
# Change github.tarball_from to 'releases' or 'archive' next update
github.tarball_from tarball
revision            11
checksums           rmd160  aa2470a9e4f32c62953c5aae460471e0e3f1f801 \
                    sha256  0dccc577d704bd48226d11b749cca3bd7cadd23694ccbb15a87a0806704a69c3 \
                    size    6045235

categories          finance
maintainers         nomaintainer

description         Litecoin is a P2P Internet currency that enables instant payments to anyone in the world.
long_description    Litecoin is a peer-to-peer Internet currency that enables instant payments\
                    to anyone in the world. It is based on the Bitcoin protocol but differs\
                    from Bitcoin in that it can be efficiently mined with consumer-grade hardware.\
                    Litecoin provides faster transaction confirmations (2.5 minutes on average)\
                    and uses memory-hard, scrypt-based mining proof-of-work algorithm to target\
                    the regular computers and GPUs most people already have. The Litecoin network\
                    is scheduled to produce 84 million currency units.\
                    \
                    One of the aims of Litecoin was to provide a mining algorithm that could run\
                    at the same time, on the same hardware used to mine bitcoins. With the rise\
                    of specialized ASICs for Bitcoin, Litecoin continues to satisfy these goals.\
                    It is unlikely for ASIC mining to be developed for Litecoin until the currency\
                    is widely used.

license             MIT

homepage            https://litecoin.org
master_sites        https://download.litecoin.org/litecoin-${version}/src/

boost.version       1.71

qt5.depends_build_component \
                    qttools

depends_lib-append  path:lib/libssl.dylib:openssl \
                    port:db48 \
                    port:libevent \
                    port:miniupnpc \
                    port:protobuf3-cpp \
                    port:qrencode \
                    port:zmq

patchfiles-append   configure.patch

post-patch {
    reinplace "s|@PREFIX@|${prefix}|g" ${worksrcpath}/configure
}

configure.args      --enable-zmq \
                    --disable-ccache \
                    --disable-silent-rules \
                    --with-boost=[boost::install_area] \
                    --with-gui=qt5 \
                    --with-miniupnpc \
                    --with-protoc-bindir=${prefix}/bin \
                    --with-qrencode \
                    --with-qtdbus

# error: Qt requires a C++11 compiler and yours does not seem to be that.
compiler.cxx_standard   2011
configure.cxxflags-append \
                    -std=c++11

use_parallel_build  yes

build.target        appbundle

test.run            yes
test.target check

post-destroot {
    xinstall -m 0755 -d ${destroot}${qt_apps_dir}
    copy ${worksrcpath}/Litecoin-Qt.app ${destroot}${qt_apps_dir}
    ln -sf ${qt_apps_dir}/Litecoin-Qt.app/Contents/MacOS/Litecoin-Qt ${destroot}${prefix}/bin/litecoin-qt
}
