Skip to content

Commit

Permalink
stack: Update to version rc/v2.7.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
essandess authored and cjones051073 committed Apr 26, 2021
1 parent a5c104b commit 05945e4
Showing 1 changed file with 43 additions and 33 deletions.
76 changes: 43 additions & 33 deletions lang/stack/Portfile
Expand Up @@ -5,7 +5,8 @@ PortGroup github 1.0
PortGroup gpg_verify 1.0
PortGroup haskell_stack 1.0

github.setup commercialhaskell stack 2.5.1 v
github.setup commercialhaskell stack 2.7.0.1 rc/v
version ${github.version}.[lindex [split ${github.tag_prefix} /] 0]
revision 0

name stack
Expand All @@ -15,82 +16,91 @@ license BSD
platforms darwin

description The Haskell Tool Stack
long_description Stack is a cross-platform command line interface\
for developing Haskell projects. It features:\
installing GHC automatically, installing packages\
needed for your project, building your project,\
testing your project, benchmarking your project.\
It is intended for Haskellers both new and\
experienced.
long_description Stack is a cross-platform command line interface \
for developing Haskell projects. It features: \
installing GHC automatically, installing packages \
needed for your project, building your project, \
testing your project, benchmarking your project. \
It is intended for Haskellers both new and experienced.

homepage https://haskellstack.org

variant prebuilt \
description {Do not bootstrap stack; install the pre-built binary.} {}

# workaround for stack bootstrap issue; remove after this issue is resolved
# https://github.com/commercialhaskell/stack/issues/5491
default_variants +prebuilt

supported_archs x86_64

distname ${name}-${github.version}-osx-x86_64

worksrcdir ${name}-${github.version}

set worksrcpath_prebuilt \
${workpath}/${distname}
set github_tag_prefix_quote \
{rc%2Fv}

master_sites ${github.homepage}/releases/download/v${github.version}:release \
${github.homepage}/archive:archive
master_sites ${github.homepage}/releases/download/${github_tag_prefix_quote}${github.version}:release \
${github.homepage}/archive/refs/tags/[lindex [split ${github.tag_prefix} /] 0]/:archive

distfiles ${distname}${extract.suffix}:release \
v${github.version}${extract.suffix}:archive
distfiles ${distname}-bin:release \
[lindex [split ${github.tag_prefix} /] 1]${github.version}${extract.suffix}:archive

checksums ${distname}${extract.suffix} \
rmd160 3634157a25bf329370e26c76d8d8fca96f8721d4 \
sha256 f4aedfa8fbe371f77286ee97ec5c3c553842e7ae15b2952a8b8442dccba04bf0 \
size 8032226 \
v${github.version}${extract.suffix} \
rmd160 9d47c92ae94a961cdc4f35b08793c1f31df7906f \
sha256 f29d63b91ff2bddd130b29ddee90a1f450706271a13d5d80b653b50379ffa076 \
size 684865 \
${distname}${extract.suffix}.asc \
extract.only [lindex [split ${github.tag_prefix} /] 1]${github.version}${extract.suffix}

checksums ${distname}-bin \
rmd160 3c858ee4ee7c1b64c59be3ef23a8d3641873dfe7 \
sha256 813e673f63b544edcd7cb5f4772b6952c2f8df518f79b913600036bed66b3f5a \
size 33467768 \
[lindex [split ${github.tag_prefix} /] 1]${github.version}${extract.suffix} \
rmd160 fcaf9e12522fe21e1369ad656079d6fdc1ba6149 \
sha256 440fd140ad5e64aaeb3f61032f511cdb4be6e361af71f2b77445206433acd8a5 \
size 686876 \
${distname}-bin.asc \
size 488

gpg_verify.use_gpg_verification \
yes

if {[option gpg_verify.use_gpg_verification]} {
distfiles-append \
${distname}${extract.suffix}.asc:release
${distname}-bin.asc:release

post-checksum {
# check GPG signature: https://docs.haskellstack.org/en/stable/SIGNING_KEY/
set gpg_keyid 575159689befb442

gpg_verify.verify_gpg_signature \
${filespath}/keyid-${gpg_keyid}.txt \
${distpath}/${distname}${extract.suffix}.asc \
${distpath}/${distname}${extract.suffix}
${distpath}/${distname}-bin.asc \
${distpath}/${distname}-bin
}
}

supported_archs x86_64
post-extract {
xinstall -W ${workpath} -d ./bin
xinstall -m 0755 -W ${distpath} ./${distname}-bin ${workpath}/bin
}

if { [variant_isset "prebuilt"] } {
use_configure no

build {}

destroot {
xinstall -m 0755 -W ${workpath}/${distname} \
./${name} ${destroot}${prefix}/bin
copy ${workpath}/bin/${distname}-bin \
${destroot}${prefix}/bin/${name}
}
} else {
post-extract {
xinstall -m 0755 -d "[option haskell_stack.stack_root]"

# standard stack install with 'curl | sh'; don't use
# system -W ${worksrcpath} "/bin/mkdir ./bin && /usr/bin/curl -sSL https://get.haskellstack.org/ | /bin/sh -s - -d ./bin"
# copy the pre-built ./stack binary to ./bin, then bootstrap
xinstall -W ${workpath} -d ./bin
xinstall -m 0755 -W ${worksrcpath_prebuilt} \
./${name} ${workpath}/bin
# bootstrap using the pre-built ./stack binary
ln -s ${workpath}/bin/${distname}-bin \
${workpath}/bin/${name}
}

set haskell_stack.bin ${workpath}/bin/stack
Expand Down

0 comments on commit 05945e4

Please sign in to comment.