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

PortSystem      1.0

name            haskell-platform

if {$subport == $name} {
    version         2014.2.0.0
    categories      devel haskell
    maintainers     cal openmaintainer
    description     \
        The Haskell Platform is the easiest way to get started with programming \
        Haskell. It comes with all you need to get up and running. Think of it as \
        \"Haskell: batteries included\".
    long_description \
        The Haskell Platform is a comprehensive, robust development environment for \
        programming in Haskell. For new users the platform makes it trivial to get \
        up and running with a full Haskell development environment. For experienced \
        developers, the platform provides a comprehensive, standard base for \
        commercial and open source Haskell development that maximises \
        interoperability and stability of your code.

    platforms       darwin
    homepage        http://hackage.haskell.org/platform/
    master_sites    ${homepage}
    license         Permissive

    depends_run     port:ghc

    fetch {}
    checksum {}
    extract {}
    configure {}
    build {}
    destroot {
        xinstall -d ${destroot}${prefix}/share/doc/${name}
        system "echo ${long_description} > ${destroot}${prefix}/share/doc/${name}/README.txt"
    }

    use_configure       no
    universal_variant   no

    livecheck.type      regex
    livecheck.url       ${homepage}
    livecheck.regex     "Current release: <a href=\"changelog.html\">(\\d+\\.\\d\\.\\d\\.\\d)</a>"
}

##
# Helper proc containing the defaults for the haskell platform ports following
# after this block. Modeled after the subport mechanism in base, it creates
# a subport for each given port and executes Portfile code in the context of
# the newly created subport.
#
# @param[in] pkgname     the name of the haskell package, case-sensitive
# @param[in] pkgversion  the version to be packaged in haskell platform
# @param[in] pkgrevision the current revision of the port in MacPorts
# @param[in] block       a block of code to be executed in the subport, optional
proc haskell_platform_port {pkgname pkgversion pkgrevision {block {}}} {
    # To see what this little bit of magic does, replace "uplevel 1" with
    # "ui_warn".
    uplevel 1 [subst {
        subport hs-[string tolower ${pkgname}] {
            PortGroup               haskellplatform 2.0
            haskellplatform.setup   [list ${pkgname}] [list ${pkgversion}]
            revision                [list ${pkgrevision}]

            # Make sure to check this for every port!
            license                 BSD
            maintainers             cal openmaintainer
            platforms               darwin

            ${block}
        }

        # Add a dependency from haskell-platform -> hs-[string tolower $pkgname]
        if [list {$subport eq $name}] {
            depends_run-append  port:hs-[string tolower ${pkgname}]
        }
    }]
}

##
# Helper proc for tools and programs in the Haskell Platform. This behaves
# exactly like \c haskell_platform_port, with the exception of passing "no" as
# third argument to \c haskellplatform.setup of the haskellplatform PortGroup.
#
# @param[in] pkgname     the name of the haskell package, case-sensitive
# @param[in] pkgversion  the version to be packaged in haskell platform
# @param[in] pkgrevision the current revision of the port in MacPorts
# @param[in] block       a block of code to be executed in the subport, optional
proc haskell_platform_tool {pkgname pkgversion pkgrevision {block {}}} {
    # To see what this little bit of magic does, replace "uplevel 1" with
    # "ui_warn".
    uplevel 1 [subst {
        subport hs-[string tolower ${pkgname}] {
            PortGroup               haskellplatform 2.0
            haskellplatform.setup   [list ${pkgname}] [list ${pkgversion}] no
            revision                [list ${pkgrevision}]

            # Make sure to check this for every port!
            license                 BSD
            maintainers             cal openmaintainer
            platforms               darwin

            ${block}
        }

        # Add a dependency from haskell-platform -> hs-[string tolower $pkgname]
        if [list {$subport eq $name}] {
            depends_run-append  port:hs-[string tolower ${pkgname}]
        }
    }]
}


#################################
# Additional Platform Libraries #
#################################

haskell_platform_port async 2.0.1.5 1 {
    checksums               rmd160  0ec360bc373c4ca0b3c7617ec611f2414804e9cd \
                            sha256  cd13ac558f4f63e567100805770648e89307a3210852b17038c9be4fcc3aa83c

    depends_lib-append      port:hs-stm

    description             Run IO operations asynchronously and wait for their results
    long_description        \
        This package provides a higher-level interface over threads, in which an \
        Async a is a concurrent thread that will eventually deliver a value of type \
        a. The package provides ways to create Async computations, wait for their \
        results, and cancel them. \
        Using Async is safer than using threads in two ways:\n\
        - When waiting for a thread to return a result, if the thread dies with an \
        exception then the caller must either re-throw the exception (wait) or \
        handle it (waitCatch)\; the exception cannot be ignored.\n\
        - The API makes it possible to build a tree of threads that are \
        automatically killed when their parent dies (see withAsync).
}

haskell_platform_port attoparsec 0.10.4.0 4 {
    checksums               rmd160  1fc9845e60fb0cddc9ffa8838c446b3046cd3522 \
                            sha256  b6b84e0dbd1c3beec1dedea578ac2f4d62afbe66b383582b7b3349406866d346

    depends_lib-append      port:hs-text

    description             Fast combinator parsing for bytestrings and text
    long_description        \
        A fast parser combinator library, aimed particularly at dealing \
        efficiently with network protocols and complicated text/binary file \
        formats.
}

haskell_platform_port case-insensitive 1.1.0.3 1 {
    checksums               rmd160  351ebf0ae84c4c580b910dbd3ed0828b309874c7 \
                            sha256  7b255fe63155d53ab84b248ab5ba9306fd4bec47a6198e3275cf9cb41c4d263b

    depends_lib-append      port:hs-hashable \
                            port:hs-text

    description             Case insensitive string comparison
    long_description        \
        The module Data.CaseInsensitive provides the CI type constructor which \
        can be parameterised by a string-like type like: String, ByteString, \
        Text, etc.. Comparisons of values of the resulting type will be \
        insensitive to cases.
}

haskell_platform_port fgl 5.5.0.1 1 {
    checksums               rmd160  c6c1f89db51d8d3ce6687dab13109c7f40c9c10c \
                            sha256  aa61664ba38db3e54124b702b1ee92a72a569c981b759e48cfb567078b038763

    depends_lib-append      port:hs-mtl

    description             Martin Erwig's Functional Graph Library
    long_description        ${description}
}

haskell_platform_port GLUT 2.5.1.1 1 {
    checksums               rmd160  b6e4bad4109307a614c3ba93aa1f3f8857ae45dc \
                            sha256  4a8177e154ead5a7bcc110f8fe408f9cf720783dde024ac1936cd95b659b2d59

    depends_lib-append      port:hs-opengl

    description             A binding for the OpenGL Utility Toolkit
    long_description        \
        A Haskell binding for the OpenGL Utility Toolkit, a window system \
        independent toolkit for writing OpenGL programs.
}

haskell_platform_port GLURaw 1.4.0.1 1 {
    checksums               rmd160  1fa7a906c6f99d9540b200de038a2a734e576cea \
                            sha256  9655644beb54ff8fac68f2e0fd8a8e9a1e8409272e2e4c963ccce9bcd60e0ecc

    depends_lib-append      port:hs-openglraw

    description             A raw binding for the OpenGL graphics system
    long_description        \
        GLURaw is a raw Haskell binding for the GLU 1.3 OpenGL utility library. \
        It is basically a 1:1 mapping of GLU's C API, intended as a basis for \
        a nicer interface.
}

haskell_platform_port hashable 1.2.2.0 1 {
    checksums               rmd160  33f9040f2afcb93d6475d8872aef4c164a4cff5e \
                            sha256  033a90b0369af59bf922d0c2af8d73a18432b46b0a47607f436d38f873a88e21

    depends_lib-append      port:hs-text

    description             A class for types that can be converted to a hash value
    long_description        \
        This package defines a class, Hashable, for types that can be converted \
        to a hash value. This class exists for the benefit of hashing-based \
        data structures. The package provides instances for basic types and \
        a way to combine hash values.
}

haskell_platform_port haskell-src 1.0.1.6 1 {
    checksums               rmd160  649a0f9f116cb90f03411a9e8d53b17409c38134 \
                            sha256  c7c556366025d9895d1110ecfa30a29e29d7d0a8cb447716fe601e4ff5da4cef

    depends_lib-append      port:hs-syb

    description             Support for manipulating Haskell source code
    long_description        \
        The haskell-src package provides support for manipulating Haskell \
        source code. The package provides a lexer, parser and pretty-printer, \
        and a definition of a Haskell abstract syntax tree (AST). Common uses \
        of this package are to parse or generate Haskell 98 code.
}

haskell_platform_port html 1.0.1.2 6 {
    checksums               rmd160  55d95a42c297c9c4b0b0c3bbd077a5ed59e48878 \
                            sha256  0c35495ea33d65e69c69bc7441ec8e1af69fbb43433c2aa3406c0a13a3ab3061

    description             HTML combinator library
    long_description        \
        This package contains a combinator library for constructing HTML documents.
}

haskell_platform_port HTTP 4000.2.10 1 {
    checksums               rmd160  b1e3a1aec27c3e09fe1f93f93ab717cc4e576504 \
                            sha256  efde6d9f2e8cd7b72068579f0a75449703c0fa7aee76dfc0f3af175295a127d1

    depends_lib-append      port:hs-network \
                            port:hs-mtl \
                            port:hs-parsec

    description             A library for client-side HTTP
    long_description        \
        The HTTP package supports client-side web programming in Haskell. It \
        lets you set up HTTP connections, transmitting requests and processing \
        the responses coming back, all from within the comforts of Haskell. \
        It's dependent on the network package to operate, but other than that, \
        the implementation is all written in Haskell.
}

haskell_platform_port HUnit 1.2.5.2 3 {
    checksums               rmd160  f6ac9ac12c152609174ea80a3a0c694210c81594 \
                            sha256  0af5ad34dba27de48b94ce6d5f7ee3aa6af6183bdc4a3967b811e28520369a41

    description             A unit testing framework for Haskell
    long_description        \
        HUnit is a unit testing framework for Haskell, inspired by the JUnit \
        tool for Java, see: http://www.junit.org.
}

haskell_platform_port mtl 2.1.3.1 1 {
    checksums               rmd160  f6432fb7e64d66eff69f02ccca9fc30ac5dce502 \
                            sha256  77af766957fb49361fe63446f272a698bddb13398669edc363022e5c2517f6f6

    description             Monad classes, using functional dependencies
    long_description        \
        Monad classes using functional dependencies, with instances for various \
        monad transformers, inspired by the paper Functional Programming with \
        Overloading and Higher-Order Polymorphism, by Mark P Jones, in Advanced \
        School of Functional Programming, 1995
}

haskell_platform_port network 2.4.2.3 1 {
    checksums               rmd160  38f20be22e51a902a00416bad1e63480316e8348 \
                            sha256  801b9c652dae626bf4a96175162b1290e7fe7ff20d802d62434d5ae1d363c16d

    depends_lib-append      port:hs-parsec

    description             Low-level networking interface
    long_description        ${description}
}

haskell_platform_port OpenGL 2.9.2.0 1 {
    checksums               rmd160  b238630bd16d37485c58835a643d965ac6c61ef2 \
                            sha256  1758f6cacc9ea8f0d410fd0abc1a19f2a50dffdb62736d66d4e62b20619545e9

    depends_lib-append      port:hs-gluraw \
                            port:hs-openglraw \
                            port:hs-text

    description             A binding for the OpenGL graphics system
    long_description        \
        A Haskell binding for the OpenGL graphics system (GL, version 4.4) and \
        its accompanying utility library (GLU, version 1.3).
}

haskell_platform_port OpenGLRaw 1.5.0.0 1 {
    checksums               rmd160  6ede61cb59090ede7d3ec1df41311a8e14496080 \
                            sha256  852aa5229722269d70daed3c04b95e9dc7b7013efd62ebc4f2873a81768b9a12

    description             A raw binding for the OpenGL graphics system
    long_description        \
        OpenGLRaw is a raw Haskell binding for the OpenGL 3.2 graphics system \
        and lots of OpenGL extensions. It is basically a 1:1 mapping of \
        OpenGL's C API, intended as a basis for a nicer interface. OpenGLRaw \
        offers access to all necessary functions, tokens and types plus \
        a general facility for loading extension entries. The module hierarchy \
        closely mirrors the naming structure of the OpenGL extensions, making \
        it easy to find the right module to import. All API entries are loaded \
        dynamically, so no special C header files are needed for building this \
        package. If an API entry is not found at runtime, a userError is \
        thrown.
}

haskell_platform_port parallel 3.2.0.4 1 {
    checksums               rmd160  4bc31de0b3dd63ca8d24c967f32a2ee40f0a2d64 \
                            sha256  8cdb637fc04e4dd62f9deb0fe3c191b8068526009960f297f54dc9cf5616146d

    description             Parallel programming library
    long_description        This package provides a library for parallel programming.
}

haskell_platform_port parsec 3.1.5 1 {
    checksums               rmd160  4d27dffd266c38cc3266ea17b792e00f180b3968 \
                            sha256  c572245d72bc3aff3491ce4f89215fcaa1e01c5e7b280d4c105a87db31793cb8

    depends_lib-append      port:hs-mtl \
                            port:hs-text

    description             Monadic parser combinators
    long_description        \
        Parsec is designed from scratch as an industrial-strength parser \
        library. It is simple, safe, well documented (on the package homepage), \
        has extensive libraries and good error messages, and is also fast. It \
        is defined as a monad transformer that can be stacked on arbitrary \
        monads, and it is also parametric in the input stream type.
}

haskell_platform_port primitive 0.5.2.1 1 {
    checksums               rmd160  b456047baa641acc897a871cc2212f9f3a2c576f \
                            sha256  0e516b81c2ef2c96d47dc40561663cc2cbfece0f135948e77e9b53025ff1c3ee

    description             Primitive memory-related operations
    long_description        This package provides various primitive memory-related operations.
}

haskell_platform_port QuickCheck 2.6 3 {
    checksums               rmd160  94bab2dcefdd7a6eddd5af7211db1babf39e0df8 \
                            sha256  8001c00a1892714d914e5007ba72cdd428c1ea4c6b8418c6cb5e7809753d970d

    depends_lib-append      port:hs-random

    description             Automatic testing of Haskell programs
    long_description        \
        QuickCheck is a library for random testing of program properties. The \
        programmer provides a specification of the program, in the form of \
        properties which functions should satisfy, and QuickCheck then tests \
        that the properties hold in a large number of randomly generated cases.
}

haskell_platform_port random 1.0.1.1 5 {
    checksums               rmd160  a13a4d7fefd15611cf863f11caf212efede320c3 \
                            sha256  df7c3b405de0ac27a2ee8fdc8dad87cb42e8eac01fef53861e43bc47c8111559

    description             random number library
    long_description        \
        This package provides a basic random number generation library, including \
        the ability to split random number generators.
}

haskell_platform_port regex-base 0.93.2 5 {
    checksums               rmd160  c009e193dd453666c7c3b585a25f3a8add7ec6b6 \
                            sha256  20dc5713a16f3d5e2e6d056b4beb9cfdc4368cd09fd56f47414c847705243278

    depends_lib-append      port:hs-mtl

    description             Replaces/Enhances Text.Regex
    long_description        Interface API for regex-posix,pcre,parsec,tdfa,dfa
}

haskell_platform_port regex-compat 0.95.1 5 {
    checksums               rmd160  b2fe02ca3c4e9027b2d433c8a265b19a85c8bd17 \
                            sha256  d57cb1a5a4d66753b18eaa37a1621246f660472243b001894f970037548d953b

    depends_lib-append      port:hs-regex-base \
                            port:hs-regex-posix

    description             Replaces/Enhances Text.Regex
    long_description        One module layer over regex-posix to replace Text.Regex
}

haskell_platform_port regex-posix 0.95.2 4 {
    checksums               rmd160  7ee59eb760bb8c0c7fe17e17d90eb0623b9fd5bb \
                            sha256  56019921cd4a4c9682b81ec614236fea816ba8ed8785a1640cd66d8b24fc703e

    depends_lib-append      port:hs-regex-base

    description             Replaces/Enhances Text.Regex
    long_description        The posix regex backend for regex-base
}

haskell_platform_port split 0.2.2 3 {
    checksums               rmd160  7d4fe221283836386807f0e73a90df1255061f6f \
                            sha256  f9cf9e571357f227aed5be9a78f5bbf78ef55c99df2edf7fdc659acc1f904375

    description             Combinator library for splitting lists.
    long_description        \
        A collection of various methods for splitting lists into parts, akin to \
        the "split" function found in several mainstream languages.
}

haskell_platform_port stm 2.4.2 3 {
    checksums               rmd160  7d49257f7e2de7cf18e02dc3ceeb4619d7980dd8 \
                            sha256  c8ee3cd64c266133902619cfff2d04e5f66206f91dbce8dd1182037fbe4858db

    description             Software Transactional Memory
    long_description        A modular composable concurrency abstraction.
}

haskell_platform_port syb 0.4.1 1 {
    checksums               rmd160  4ed2329f3c915adb91fb5b1f6b3735e219d1fdd6 \
                            sha256  aa32cb3d9a0cbcfb24ac1c5d567886e8908dd017fd009ffd446bff86732670d2

    description             Scrap Your Boilerplate
    long_description        \
        This package contains the generics system described in the Scrap Your \
        Boilerplate papers (see \
        http://www.cs.uu.nl/wiki/GenericProgramming/SYB). It defines the Data \
        class of types permitting folding and unfolding of constructor \
        applications, instances of this class for primitive types, and \
        a variety of traversals.
}

haskell_platform_port text 1.1.0.0 1 {
    checksums               rmd160  b57efc9cbf277cd914a9e148129e42ae861771b8 \
                            sha256  80f1ada824f0e3886bb49dc7fd128707ca1a34e06bbf4419873b1677c4d7ba92

    description             An efficient packed Unicode text type
    long_description        \
        An efficient packed, immutable Unicode text type (both strict and lazy), \
        with a powerful loop fusion optimization framework.
}

haskell_platform_port unordered-containers 0.2.4.0 1 {
    checksums               rmd160  0d62b6b8f95e65890e07934413cd1377ed1e85e5 \
                            sha256  34eaeb0c96d84169aca7085cf21f89bedb4bdb4de2ac78358a087faeea93cdf4

    depends_lib-append      port:hs-hashable

    description             Efficient hashing-based container types
    long_description        \
        Efficient hashing-based container types. The containers have been \
        optimized for performance critical use, both in terms of large data \
        quantities and high speed.
}

haskell_platform_port vector 0.10.9.1 1 {
    checksums               rmd160  885ba057a05219ae6a35170539c68996d2074668 \
                            sha256  205656e9741aad406e427e988dbf1665bf5dbdf3e9d574e309c274be4e06bde5

    depends_lib-append      port:hs-primitive

    description             Efficient Arrays
    long_description        \
        An efficient implementation of Int-indexed arrays (both mutable and \
        immutable), with a powerful loop optimisation framework.
}

haskell_platform_port zlib 0.5.4.1 4 {
    checksums               rmd160  9ed49e79e239604958a9c385cca75747fafc2713 \
                            sha256  cca365e4c52c90be41a5754943134da5ce6c60bb52fa00c128fd118e0505a550

    depends_lib-append      port:zlib

    description             Compression and decompression in the gzip and zlib formats
    long_description        \
        This package provides a pure interface for compressing and \
        decompressing streams of data represented as lazy ByteStrings. It uses \
        the zlib C library so it has high performance. It supports the \"zlib\", \
        \"gzip\" and \"raw\" compression formats.
}

######################
# Programs and Tools #
######################

haskell_platform_tool cabal-install 1.18.0.5 1 {
    checksums               rmd160  f07279510e03678ad5e3720d9e01707681f874ea \
                            sha256  477df8ef73916e8bc23c727280a1700939131a3e2809a057668c883b0b521782

    depends_lib-append      port:hs-http \
                            port:hs-mtl \
                            port:hs-network \
                            port:hs-random \
                            port:hs-stm \
                            port:hs-zlib

    description             The command-line interface for Cabal and Hackage
    long_description        \
        The 'cabal' command-line program simplifies the process of managing Haskell \
        software by automating the fetching, configuration, compilation and \
        installation of Haskell libraries and programs.
}

haskell_platform_tool alex 3.1.3 1 {
    checksums               rmd160  2325ccfc770264c517d2dfa38cece9376d4e252d \
                            sha256  8d41a6e72a016155f00c846f7146ab4b27fe9640668a4b592d6a9b856f970a92

    depends_lib-append      port:hs-quickcheck

    description             A tool for generating lexical analysers in Haskell
    long_description        \
        Alex is a tool for generating lexical analysers in Haskell. It takes \
        a description of tokens based on regular expressions and generates \
        a Haskell module containing code for scanning text efficiently. It is \
        similar to the tool lex or flex for C/C++.
}

haskell_platform_tool happy 1.19.4 1 {
    checksums               rmd160  8ec09c4743d85ae493354e49df07f0ee423267cf \
                            sha256  6be499f66c61f8c48cbbbcb70515eb8e62c2bfa08adcc8c9474e7ae343a6936d

    depends_lib-append      port:hs-mtl
    description             A parser generator for Haskell
    long_description        \
        Happy is a parser generator for Haskell. Given a grammar specification \
        in BNF, Happy generates Haskell code to parse the grammar. Happy works \
        in a similar way to the yacc tool for C.
}

haskell_platform_tool hscolour 1.20.3 1 {
    checksums               rmd160  2d875ecdb910a5955a5ec049935a74c60edbc4cc \
                            sha256  3adb816fba3ecdf9f1ee5fb23feb0611b0762f7e8c2a282c2def5cc2f5483d96

    license                 GPL-2+

    description             Colourise Haskell code
    long_description        \
        hscolour is a small Haskell script to colourise Haskell code. It \
        currently has six output formats: ANSI terminal codes (optionally \
        XTerm-256colour codes), HTML 3.2 with font tags, HTML 4.01 with CSS, \
        HTML 4.01 with CSS and mouseover annotations, XHTML 1.0 with inline CSS \
        styling, LaTeX, and mIRC chat codes.
}