-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
/
Portfile
126 lines (99 loc) · 4.39 KB
/
Portfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
# -*- 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
PortGroup github 1.0
PortGroup gpg_verify 1.0
PortGroup haskell_stack 1.0
PortGroup legacysupport 1.1
github.setup commercialhaskell stack 2.7.3 v
revision 0
name stack
categories lang haskell
maintainers {ieee.org:s.t.smith @essandess} openmaintainer
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.
homepage https://haskellstack.org
variant prebuilt \
description {Do not bootstrap stack; install the pre-built binary.} {}
supported_archs x86_64
distname ${name}-${github.version}-osx-x86_64
worksrcdir ${name}-${github.version}
master_sites ${github.homepage}/releases/download/${github.tag_prefix}${github.version}/:release \
${github.homepage}/archive/refs/tags/:archive
distfiles ${distname}-bin:release \
${github.tag_prefix}${github.version}${extract.suffix}:archive
extract.only ${github.tag_prefix}${github.version}${extract.suffix}
checksums ${distname}-bin \
rmd160 fbe0175e8fb6f2c328aecb2052223871dc5ca74b \
sha256 8efba112e7cb3cabbe96bad7c70b8a1c3ed63bb1f0fa50815ac7d5e60e794eb8 \
size 36142208 \
${github.tag_prefix}${github.version}${extract.suffix} \
rmd160 0d38bb22f8a980f67ccef926713912ded02acbad \
sha256 37f4bc0177534782609ec3a67ec413548d3f2cabff7c4c0bc8a92a36e49c6877 \
size 689876 \
${distname}-bin.asc \
size 488
gpg_verify.use_gpg_verification \
yes
if {[option gpg_verify.use_gpg_verification]} {
distfiles-append \
${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}-bin.asc \
${distpath}/${distname}-bin
}
}
post-extract {
xinstall -W ${workpath} -d ./bin
xinstall -m 0755 -W ${distpath} ./${distname}-bin ${workpath}/bin
}
# bootstrap binaries seg fault on 10.7 and older
set max_darwin 12
if { ${os.platform} eq "darwin" && ${os.major} < ${max_darwin} } {
known_fail yes
pre-fetch {
ui_error "${name} @${version} requires OS X 10.[expr ${max_darwin} - 4] or later"
return -code error "unsupported Mac OS X version"
}
}
# Builds fail if ccache is enabled in MacPorts
configure.ccache no
# Darwin 16 and older fails to build from source, e.g.
# Undefined symbols for architecture x86_64:
# "_utimensat", referenced from:
# _Lc6xB_info in libHSdirectory-1.3.6.0.a(Posix.o)
if { ${os.platform} eq "darwin" && ${os.major} <= 16 } {
default_variants-append +prebuilt
}
if { [variant_isset "prebuilt"] } {
use_configure no
build {}
if { ${os.major} <= [option legacysupport.newest_darwin_requires_legacy] } {
depends_build-append port:cctools
}
destroot {
copy ${workpath}/bin/${distname}-bin \
${destroot}${prefix}/bin/${name}
legacysupport::relink_libSystem ${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"
# bootstrap using the pre-built ./stack binary
ln -s ${workpath}/bin/${distname}-bin \
${workpath}/bin/${name}
}
set haskell_stack.bin ${workpath}/bin/stack
}