Skip to content
Permalink
Browse files

cabal: Submission of Haskell Cabal: Common Architecture for Building …

…Applications

* Bootsrapped build of cabal
  • Loading branch information
essandess authored and mf2k committed Sep 16, 2019
1 parent aa8057f commit 51c700870f0490118e5a4261d6d65bcbef9f807a
Showing with 89 additions and 0 deletions.
  1. +89 −0 lang/cabal/Portfile
@@ -0,0 +1,89 @@
# -*- 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.0.0.0
categories lang haskell
platforms darwin
license BSD
maintainers nomaintainer

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

# Bootstrapped cabal is the default build
variant prebuilt \
description {Do not bootstrap cabal; install the pre-built binary.} {}

master_sites https://downloads.haskell.org/~${name}/${name}-install-${version}/
distname ${name}-install-${version}-x86_64-apple-darwin17.7.0
extract.suffix .tar.xz

checksums [lindex ${distfiles} end] \
rmd160 9b5fbf25fe1f9473766a3466aaa9d66d66cfb884 \
sha256 d4857e068560515e4cbb0e8ca124c370e07892f2a28804d87152834e5fe2b845 \
size 5022564

extract.only [lindex ${distfiles} end]

supported_archs x86_64

depends_build-append \
port:ghc

use_configure no

# the PATH environment must provide /usr/bin/clang, not ${prefix}/bin/gcc,
# along with bootstrap path
build.env \
PATH=/usr/bin:${workpath}:$env(PATH) \
PREFIX=${prefix} \
CC=${configure.cc}

# cabal must bootstrap itself
pre-build {
# binary extract to ${workpath}/${name}
xinstall -W ${workpath} -d ./bin
xinstall -m 0755 -W ${workpath} ./${name} ./bin
}

if { [variant_isset "prebuilt"] } {
build {}
} else {
distfiles-append \
${name}-install-${version}.tar.gz
checksums-append \
${name}-install-${version}.tar.gz \
rmd160 7217d6334bdf98f18341fb0aff8208b20717f695 \
sha256 a432a7853afe96c0fd80f434bd80274601331d8c46b628cd19a0d8e96212aaf1 \
size 654045
extract.only-append \
${name}-install-${version}.tar.gz
worksrcdir ${name}-install-${version}

build {
# build cabal and overwrite ${workpath}/bin/${name}
# the PATH environment must provide /usr/bin/clang, not ${prefix}/bin/gcc
system -W ${worksrcpath} \
"${worksrcpath}/bootstrap.sh"
delete ${workpath}/bin/${name}
xinstall -m 0755 -W ${worksrcpath}/dist/build/${name} ${name} ${workpath}/bin/${name}
}

post-destroot {
xinstall -m 0755 -d ${destroot}${prefix}/share/man/man1
xinstall -m 0644 -W ${worksrcpath}/dist/build/${name} ${name}.1 ${destroot}${prefix}/share/man/man1
}
}

destroot {
xinstall -m 0755 -W ${workpath} ./bin/${name} ${destroot}${prefix}/bin
}

0 comments on commit 51c7008

Please sign in to comment.
You can’t perform that action at this time.