# -*- 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

name                slib-guile
version             1.0
revision            5
categories          devel
maintainers         nomaintainer
platforms           any
license             public-domain
supported_archs     noarch
description         Wrapper port to properly set up slib and guile together
long_description    Create a symbolic link and a catalog file \
                    so that guile can find the slib library files.
homepage            https://www.macports.org
distfiles

use_configure       no

set guile-version   2.2
depends_lib         port:slib port:guile-${guile-version}

build {}

destroot {
    set site-dir [exec ${prefix}/bin/guile-config-${guile-version} info sitedir]

    file mkdir "${destroot}${site-dir}"
    ln -s "${prefix}/lib/slib" "${destroot}${site-dir}/slib"
}

post-activate {
    system "${prefix}/bin/guile-${guile-version} -c \"(use-modules (ice-9 slib)) (require 'new-catalog)\""
}
