File: pkg.ml

package info (click to toggle)
ocaml-topkg 1.1.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 840 kB
  • sloc: ml: 7,434; sh: 111; makefile: 25
file content (57 lines) | stat: -rwxr-xr-x 1,869 bytes parent folder | download | duplicates (2)
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
#!/usr/bin/env ocaml
#use "topfind"

(* Bootstrap from source, note #mod_use is 4.01 *)
#directory "src"
#mod_use "topkg_result.ml"
#mod_use "topkg_string.ml"
#mod_use "topkg_log.ml"
#mod_use "topkg_fpath.ml"
#mod_use "topkg_cmd.ml"
#mod_use "topkg_os.ml"
#mod_use "topkg_vcs.ml"
#mod_use "topkg_codec.ml"
#mod_use "topkg_conf.ml"
#mod_use "topkg_fexts.ml"
#mod_use "topkg_opam.ml"
#mod_use "topkg_test.ml"
#mod_use "topkg_install.ml"
#mod_use "topkg_build.ml"
#mod_use "topkg_distrib.ml"
#mod_use "topkg_publish.ml"
#mod_use "topkg_pkg.ml"
#mod_use "topkg_ipc.ml"
#mod_use "topkg_main.ml"
#mod_use "topkg.ml"

open Topkg

let () =
  let metas = [ Pkg.meta_file ~install:false "pkg/META" ] in
  let opams =
    let install = false in
    let not_topkg_deps =
      Some ["fmt"; "logs"; "bos"; "cmdliner"; "webbrowser"; "opam-format"]
    in
    [ Pkg.opam_file ~install "topkg.opam" ~lint_deps_excluding:not_topkg_deps;
      Pkg.opam_file ~install "topkg-care.opam" ]
  in
  Pkg.describe ~metas ~opams "topkg" @@ fun c ->
  match (* bootstrap, Conf doesn't work, eqs *) Topkg_conf.pkg_name c with
  | "topkg" ->
      Ok [ Pkg.lib "pkg/META";
           Pkg.lib "topkg.opam" ~dst:"opam";
           Pkg.mllib ~api:["Topkg"] "src/topkg.mllib";
           Pkg.doc "doc/index-topkg.mld" ~dst:"odoc-pages/index.mld";
           Pkg.test "test/test"; ]
  | "topkg-care" ->
      Ok [ Pkg.lib "topkg-care.opam" ~dst:"opam";
           Pkg.mllib ~api:["Topkg_care"] "src-care/topkg_care.mllib";
           Pkg.bin "src-bin/topkg_bin" ~dst:"topkg";
           Pkg.bin "src-bin/toy_github_delegate"
             ~dst:"toy-github-topkg-delegate";
           Pkg.doc "doc/index-topkg-care.mld" ~dst:"odoc-pages/index.mld";
           Pkg.doc "test/unsupportive-delegate";
           Pkg.doc "test/echo-delegate" ]
  | other ->
      R.error_msgf "unknown package name: %s" other