opam-version: "2.0"
maintainer: "7895506+MSoegtropIMC@users.noreply.github.com"
homepage: "https://www.gnu.org/software/bison/"
bug-reports: "https://lists.gnu.org/mailman/listinfo/bug-bison"
license: "GPL-3.0-or-later"
authors: [
  "Robert Corbett" 
  "Richard Stallman"
  "Wilfred Hansen"
  "Akim Demaille"
  "Paul Hilfinger" 
  "Joel E. Denny"
  "Paolo Bonzini"
  "Alex Rozenman"
  "Paul Eggert"
]
build: [
  ["bison" "--version"] {os-family != "homebrew"}
  ["sh" "-c" "\"$(brew --prefix bison)/bin/bison\" --version"] {os-family = "homebrew"}
]
install: [
  # Note: Mac homebrew installs bison to a path not in PATH, so symlink it in the opam switch bin folder.
  # This affects only the current opam switch and is thus least invasive.
  ["sh" "-c" "ln -s \"$(brew --prefix bison)/bin/bison\" \"%{bin}%/bison\""] {os-family = "homebrew"}
  ["sh" "-c" "ln -s \"$(brew --prefix bison)/bin/yacc\" \"%{bin}%/yacc\""] {os-family = "homebrew"}
]
depexts: [
  # The list of supported os-family names can be derived from the opam sources (thanks Enrico)
  #   https://github.com/ocaml/opam/blob/6aefe95e60084e63d01b1c7c028b6b77de1f839f/src/state/opamSysInteract.ml#L84-L123
  # The package name for many Linux/BSD/macOS/cygwin/msys platforms can be searched here (thanks Théo)
  #   https://repology.org specifically https://repology.org/project/bison/versions
  #   Not listed above but supported by opam are suse, oraclelinix, ol, rhel
  # On macOS bison seems to be installed by default, but the homebrew and macports package is listed anyway
  [ "bison" ] {os-family = "alpine"}
  [ "bison" ] {os-family = "amzn"}
  [ "bison" ] {os-family = "arch"}
  [ "bison" ] {os-family = "archlinux"}
  [ "bison" ] {os-family = "centos"}
  [ "bison" ] {os-family = "debian"}
  [ "bison" ] {os-family = "fedora"}
  [ "sys-devel/bison" ] {os-family = "gentoo"}
  [ "bison" ] {os-family = "homebrew"}
  [ "bison" ] {os-family = "macports"}
  [ "bison" ] {os-family = "mageia"}
  [ "bison" ] {os-family = "opensuse"}
  [ "devel/bison" ] {os-family = "bsd"}
]
synopsis: "Virtual package relying on GNU bison"
description: "This package can only install if GNU bison is installed on the system."
# Not technically a conf package for homebrew (has an install step)
# flags: conf
