# -*- 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               cmake 1.1
PortGroup               legacysupport 1.0

github.setup            fish-shell fish-shell 4.1.2
revision                0

checksums               rmd160  1a315346e812d87ad0fffab3671832f977bdc037 \
                        sha256  52873934fc1ee21a1496e9f4521409013e540f77cbf29142a1b17ab93ffaafac \
                        size    2968176

name                    fish
conflicts               fish3
license                 GPL-2
categories              shells
maintainers             {@akierig fastmail.de:akierig} openmaintainer

description             The friendly interactive shell: a command line shell for the 90s
long_description        fish is a smart and user-friendly command line shell for OS X, Linux, and the rest of the family

homepage                https://fishshell.com/
github.tarball_from     releases
distname                ${name}-${version}
use_xz                  yes

depends_build-append    port:gettext \
                        port:rust \
                        port:cargo \
                        path:bin/pkg-config:pkgconfig

depends_lib-append      port:gettext-runtime \
                        port:libiconv \
                        port:ncurses \
                        port:pcre2

patchfiles              patch-share_config_fish.diff

post-patch {
    reinplace "s|@@PREFIX@@|${prefix}/bin|g"     "${worksrcpath}/share/config.fish"
}

configure.args-append   -DFISH_USE_SYSTEM_PCRE2=ON \
                        -DMAC_CODESIGN_ID=OFF \
                        -DCMAKE_BUILD_TYPE=Release

notes "
To set MacPorts' ${name} as default login shell, run:

    sudo chpass -s ${prefix}/bin/${name} \${USER}

To be able to switch default shells to or from ${name} without superuser\
privileges, add it to /etc/shells:

    sudo sh -c 'echo ${prefix}/bin/${name} >> /etc/shells'

For X clipboard integration, install the xsel port:

    sudo port install xsel
"
