# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:et:sw=4:ts=4:sts=4

PortSystem          1.0
PortGroup           elisp 1.0

name                sml-mode.el
version             6.10
categories          lang editors
license             GPL-3+
maintainers         {mcalhoun @MarcusCalhoun-Lopez} openmaintainer
description         An EMACS major mode for editing Standard ML
long_description    {*}${description}
homepage            https://elpa.gnu.org/packages/sml-mode.html
platforms           any
distname            sml-mode-${version}
master_sites        https://elpa.gnu.org/packages/

distfiles           ${distname}.el

checksums           rmd160  2140de723fd299a4229c6d5b7e391bee570bdb87 \
                    sha256  4b9fee50ddb8be6a113b21a272bc2fab3396aca424e8658d843d65728806ce07 \
                    size    75631

extract.suffix
extract.mkdir       yes
extract.cmd         cp
extract.pre_args
extract.post_args   ${worksrcpath}/${name}

supported_archs     noarch

depends_lib-append  path:${emacs_binary}:${emacs_binary_provider}

use_configure       no

build {
    system -W ${build.dir} "${emacs_binary} -batch -f batch-byte-compile sml-mode.el"
    system -W ${build.dir} "${emacs_binary} -batch --eval '(update-file-autoloads \"${build.dir}/sml-mode.el\" t \"${build.dir}/sml-mode-autoloads.el\")'"
}

destroot {
    set lisp_dir ${destroot}${emacs_lispdir}/sml-mode
    xinstall -d ${lisp_dir}
    xinstall -m 0644 -W ${worksrcpath} sml-mode.el           ${lisp_dir}
    xinstall -m 0644 -W ${worksrcpath} sml-mode.elc          ${lisp_dir}
    xinstall -m 0644 -W ${worksrcpath} sml-mode-autoloads.el ${lisp_dir}
}

notes "To use this, put the following into your ~/.emacs:
(load \"${prefix}/share/emacs/site-lisp/sml-mode/sml-mode-autoloads.el\")"

livecheck.type      regex
livecheck.regex     sml-mode-(\\d+(?:\\.\\d+)*).el
livecheck.url       https://elpa.gnu.org/packages/sml-mode.html
