opam-version: "2.0"
authors: ["Daniel de Rauglaudre" "Nicolas Pouillard"]
maintainer: "jeremie@dimino.org"
homepage: "https://github.com/ocaml/camlp4"
license: "LGPL-2.1-only"
build: [
  [
    "./configure"
    "--bindir=%{bin}%"
    "--libdir=%{lib}%/ocaml"
    "--pkgdir=%{lib}%"
  ]
  [make "all"] {ocaml:native-dynlink}
  [make "byte"] {!ocaml:native-dynlink}
]
depends: [
  "ocaml" {>= "4.03" & < "4.04"}
  "ocamlbuild" {build}
  "conf-which" {build}
]
install: [
  [make "install" "install-META"]
]
remove: [
  ["rm" "-rf" "%{lib}%/camlp4"]
  ["rm" "-f" "%{bin}%/camlp4"  "%{bin}%/camlp4boot" "%{bin}%/mkcamlp4"
             "%{bin}%/camlp4r" "%{bin}%/camlp4rf"   "%{bin}%/camlp4orf"
             "%{bin}%/camlp4o" "%{bin}%/camlp4of"   "%{bin}%/camlp4oof"
             "%{bin}%/camlp4prof"  "%{bin}%/camlp4rf.opt"  "%{bin}%/camlp4orf.opt"
             "%{bin}%/camlp4o.opt" "%{bin}%/camlp4oof.opt" "%{bin}%/camlp4r.opt"
  ]
]
patches: [ "termux.patch" "f0ea53725465260556832398096cef8d3f20b49d.patch" ]
bug-reports: "https://github.com/ocaml/camlp4/issues"
dev-repo: "git+https://github.com/ocaml/camlp4.git"
synopsis:
  "Camlp4 is a system for writing extensible parsers for programming languages"
description: """
It provides a set of OCaml libraries that are used to define grammars as well
as loadable syntax extensions of such grammars. Camlp4 stands for Caml
Preprocessor and Pretty-Printer and one of its most important applications is
the definition of domain-specific extensions of the syntax of OCaml.

Camlp4 was part of the official OCaml distribution until its version 4.01.0.
Since then it has been replaced by a simpler system which is easier to maintain
and to learn: ppx rewriters and extension points.

This version of Camlp4 installs using the `ocamlfind` packaging utility.  If
you were using `+I camlp4` to directly locate Camlp4, this will no longer work."""
conflicts: ["ocaml-system"]
flags: light-uninstall
extra-files: [
  ["termux.patch" "md5=91fbe07cda753ad87789fd5717371494"]
  [
    "f0ea53725465260556832398096cef8d3f20b49d.patch"
    "md5=4e15b0fb960be4be48b154bfafbb9a16"
  ]
]
url {
  src: "https://github.com/ocaml/camlp4/archive/4.03+1.tar.gz"
  checksum: "md5=65ece8d2c8f4b1e06d62323e78759a7c"
}
