vamchale/polyglot
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
{- Imports -}
let prelude = https://raw.githubusercontent.com/vmchale/atspkg/master/ats-pkg/dhall/atspkg-prelude.dhall
in

let not = https://ipfs.io/ipfs/QmdtKd5Q7tebdo6rXfZed4kN6DXmErRQHJ4PsNCtca9GbB/Prelude/Bool/not
in

{- Configuration -}
let cross = False
in

let parallel = True
in

let cc = "icc"
in

-- TODO figure out icc configuration options
-- -fuse-ld=gold
-- -static-intel

{- Configuration helpers -}
let srcFile =
  if parallel
    then "polyglot"
    else "compat"
in

let deps =
  if parallel
    then [ "concurrency", "specats" ]
    else [ "specats" ]
in

let native =
  if not cross
    then [ "-mtune=native" ]
    else ([] : List Text)
in

prelude.default ⫽
  { bin =
    [
      prelude.bin ⫽
      { src = "src/${srcFile}.dats"
      , target = "target/poly"
      , gcBin = True
      , libs = [ "pthread" ]
      }
    ]
  , test =
    [ prelude.bin ⫽
      { src = "test/test.dats"
      , target = "target/test"
      , gcBin = True
      }
    ]
  , man = [ "man/poly.md" ] : Optional Text
  , completions = [ "compleat/poly.usage" ] : Optional Text
  , dependencies = prelude.mapPlainDeps deps
  , cflags = [ "-flto", "-O2" ] # native
  , ccompiler = cc
  , debPkg =
      [
        prelude.debian "polyglot" ⫽
          { version = [0,4,32]
          , maintainer = "Vanessa McHale <vamchale@gmail.com>"
          , description = "Determine project contents"
          , manpage = [ "man/poly.1" ]
            : Optional Text
          , binaries = [ "target/poly" ]
          }
      ] : Optional prelude.Debian
  }