|
root / lang / ocaml-cmdliner
ocaml-cmdliner Plain Text 70 lines 1.6 KB
 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
#!/bin/zsh
# Build script for OCaml cmdliner library
set -e
cd "$SRCDIR"

export PATH="$PREFIX/bin:$PATH"
export LD_LIBRARY_PATH="/usr/lib:${LD_LIBRARY_PATH:-}"
export LIBRARY_PATH="/usr/lib:${LIBRARY_PATH:-}"

# Build
mkdir -p _build
gmake -j1 all PREFIX=$PREFIX

# Manual install — Hammerhead's /usr/sbin/install (SVR4) breaks PATH
local B="_build"
local LIBDIR="$PKGDIR$PREFIX/lib/ocaml/cmdliner"
local DOCDIR="$PKGDIR$PREFIX/doc/cmdliner"

mkdir -p "$LIBDIR"
mkdir -p "$DOCDIR/odoc-pages"

# Common: META, interface files
cp pkg/META "$LIBDIR/"
cp "$B/cmdliner.mli" "$B/cmdliner.cmi" "$B/cmdliner.cmti" "$LIBDIR/"
cp cmdliner.opam "$LIBDIR/opam"

# Byte code
cp "$B/cmdliner.cma" "$LIBDIR/"

# Native
cp "$B/cmdliner.cmxa" "$B/cmdliner.a" "$LIBDIR/"
for f in "$B"/cmdliner*.cmx; do
    [ -f "$f" ] && cp "$f" "$LIBDIR/"
done

# Native dynlink
[ -f "$B/cmdliner.cmxs" ] && cp "$B/cmdliner.cmxs" "$LIBDIR/"

# Documentation
cp CHANGES.md LICENSE.md README.md "$DOCDIR/"
cp doc/index.mld doc/cli.mld doc/examples.mld doc/tutorial.mld \
   doc/tool_man.mld "$DOCDIR/odoc-pages/"
# OCaml cmdliner - Declarative command line interfaces
# https://github.com/dbuenzli/cmdliner

[package]
name = "ocaml-cmdliner"
version = "1.3.0"
release = 1
description = "OCaml declarative command line interfaces"
url = "https://github.com/dbuenzli/cmdliner"
license = "ISC"
maintainer = "Chris Tusa <chris.tusa@leafscale.com>"
arch = "x86_64"

[dependencies]
runtime = ["ocaml"]
build = ["ocaml"]

[[source]]
file = "cmdliner-1.3.0.tar.gz"
urls = [
    "https://github.com/dbuenzli/cmdliner/archive/refs/tags/v1.3.0.tar.gz"
]
checksum = "skip"
extract = true

[build]
parallel = false