# -*- 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.2.1
revision                0

checksums               rmd160  04b6e4d554a99846517e1531a6acdbaf01d1f4c0 \
                        sha256  0f99222a3063377c91fbf78d9850edab7a0b91bdbed201cf79da48ea3a41f393 \
                        size    3012808

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
"
