# -*- 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 cabal version 3.10.3.0 revision 0 categories lang haskell devel platforms darwin license BSD maintainers {ieee.org:s.t.smith @essandess} openmaintainer description Haskell Cabal: Common Architecture for \ Building Applications and Libraries long_description Cabal is a system for building and packaging \ Haskell libraries and programs. It defines a \ common interface for package authors and \ distributors to easily build their applications in \ a portable way. Cabal is part of a larger \ infrastructure for distributing, organizing, and \ cataloging Haskell libraries and programs. homepage https://www.haskell.org/cabal master_sites https://downloads.haskell.org/~${name}/${name}-install-${version}/:haskell installs_libs no platform arm { set cabal_build_arch aarch64 } platform i386 { set cabal_build_arch x86_64 } platform powerpc { set cabal_build_arch ppc_not_supported_by_cabal } if {${os.arch} ni [list arm i386]} { known_fail yes pre-fetch { ui_error "Cabal is only available on macOS \ with [join ${supported_archs} " or "] architectures." error {unsupported platform} } } if {${os.platform} eq "darwin" && ${os.major} < 16} { known_fail yes pre-fetch { ui_error "${name} @${version} requires macOS 10.12 or later." return -code error "incompatible macOS version" } } set cabal_distname ${name}-install-${version}-${cabal_build_arch}-darwin set distfile_haskell ${cabal_distname}.tar.xz distfiles ${distfile_haskell}:haskell # set build_arch by hand on arm64/x86_64 systems to get x86_64/arm64 checksums # sudo port -d checksum cabal-prebuilt os.arch=arm build_arch=arm64 # run `port clean --all cabal-prebuilt` afterwards if {${build_arch} eq {arm64}} { checksums ${distfile_haskell} \ rmd160 2ba95f233a0ec06d6a2fcef1783fa6bbef7d4066 \ sha256 f4f606b1488a4b24c238f7e09619959eed89c550ed8f8478b350643f652dc08c \ size 11676488 } elseif {${build_arch} eq {x86_64}} { checksums ${distfile_haskell} \ rmd160 4b44b2fea41b91cd08e94957a414ecc8e5ed7778 \ sha256 3aed78619b2164dd61eb61afb024073ae2c50f6655fa60fcc1080980693e3220 \ size 5623520 } # cabal may use these MacPorts build tools: # alex, ar, strip, cpphs, happy, hscolour, ld, pkg-config # https://github.com/haskell/cabal/blob/master/Cabal/src/Distribution/Simple/Program/Builtin.hs depends_lib-append port:cctools \ port:ld64 \ port:pkgconfig # cabal uses curl or wget depends_lib-append port:curl \ port:wget if {${name} eq ${subport}} { PortGroup haskell_cabal 1.0 haskell_cabal.use_prebuilt yes set distfile_github \ [string totitle ${name}]-v${version}.tar.gz master_sites https://github.com/haskell/${name}/archive/refs/tags:github distfiles ${distfile_github}:github checksums ${distfile_github} \ rmd160 d72a00040f2b717de39e1b2386e81d86cc44c06f \ sha256 29d622886624f72f1c5be1fb385b1eb612a72e487c2c91ca8cbefb84abdbf352 \ size 2285154 extract.only-append \ ${distfile_github} if {[exists extract.rename]} { extract.rename yes } variant prebuilt \ description {This variant is deprecated.} { ui_error "Please install the port ${name}-prebuilt." return -code error "deprecated variant." } # use these to specify python versions, python3 required # use ${prefix}/var/macports/sources/rsync.macports.org/macports/release/tarballs/ports/_resources/port1.0/group/python-1.0.tcl set python3_version 312 set python3_branch [string index ${python3_version} 0].[string range ${python3_version} 1 end] set python3_prefix ${frameworks_dir}/Python.framework/Versions/${python3_branch} set python3_bin ${python3_prefix}/bin/python${python3_branch} depends_build-append \ port:python${python3_version} \ port:py${python3_version}-importlib-metadata \ port:py${python3_version}-parsing \ port:py${python3_version}-setuptools \ port:py${python3_version}-sphinx \ port:py${python3_version}-sphinx-jsonschema \ port:py${python3_version}-sphinx_rtd_theme \ port:py${python3_version}-sphinxnotes-strike \ port:py${python3_version}-tz \ port:py${python3_version}-yaml \ port:py${python3_version}-zipp depends_lib-append \ port:gmp \ port:libiconv \ port:zlib # alex, happy, and hscolour are bootstrapped using cabal-prebuilt depends_lib-append \ path:bin/alex:alex \ path:bin/happy:happy \ path:bin/HsColour:hscolour # use bootstrapped ghc -- reconfigure settings from PG haskell_cabal depends_build-delete \ port:ghc-prebuilt depends_lib-append \ path:bin/ghc:ghc post-extract { delete ${haskell_cabal.cabal_root}/bin/ghc delete ${haskell_cabal.cabal_root}/bin/ghc-pkg } haskell_cabal.env \ "CABAL_CONFIG=${haskell_cabal.cabal_root}/config" \ "GHC=${prefix}/bin/ghc" build.target ${name}-install \ --project-file=cabal.project.release build.post_args-append \ --bindir=${prefix}/bin \ --datadir=${prefix}/share/${subport} post-build { # https://github.com/haskell/cabal/blob/c1f490a50782cc89030889fae8edd9f95db7c1e4/Makefile#L207 system -W ${worksrcpath} \ "sphinx-build-${python3_branch} -n --keep-going -E\ doc ${haskell_cabal.build_dir}/doc/users-guide" } post-destroot { xinstall -d ${destroot}${prefix}/share/doc/${distname} xinstall -d ${destroot}${prefix}/share/man/man1 system -W ${destroot}${prefix}/share/man/man1 \ "${destroot}${prefix}/bin/${name} man --raw > ${name}.1" copy ${haskell_cabal.build_dir}/doc/users-guide \ ${destroot}${prefix}/share/doc/${distname} } notes \ "The Cabal User Guide is available at: file://${prefix}/share/doc/${distname}/users-guide/index.html " } subport cabal-prebuilt { revision 0 supported_archs arm64 x86_64 use_configure no build {} destroot { move ${workpath}/${name} \ ${destroot}${prefix}/bin/${subport} } notes \ "The Cabal prebuilt binary is installed at `${prefix}/bin/${subport}`.\ It is intended to be used to bootstrap ghc and other Haskell-based tools. " }