ocaml / opam-repository

Main public package repository for opam, the source package manager of OCaml.
https://opam.ocaml.org
Creative Commons Zero v1.0 Universal
517 stars 1.14k forks source link

curses doesn't search for ncursesw #19600

Open LAC-Tech opened 3 years ago

LAC-Tech commented 3 years ago

When installing curses, it does a pkg-config for ncurses. However, on some system what we really want to look for is ncursesw.

IE, the following would work if it did pkg-config ncursesw after pkg-config ncurses fails.

[NOTE] External dependency handling not supported for OS family 'void'.
       You can disable this check using 'opam option --global depext=false'
The following actions will be performed:
  ∗ install conf-ncurses 1     [required by curses]
  ∗ install curses       1.0.6
===== ∗ 2 =====
Do you want to continue? [Y/n] y

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
⬇ retrieved curses.1.0.6  (cached)
[ERROR] The compilation of conf-ncurses.1 failed at "pkg-config ncurses".

#=== ERROR while compiling conf-ncurses.1 =====================================#
# context     2.1.0 | linux/x86_64 | ocaml.4.12.0 | https://opam.ocaml.org#0a2c13f3
# path        ~/.opam/default/.opam-switch/build/conf-ncurses.1
# command     /usr/sbin/pkg-config ncurses
# exit-code   1
# env-file    ~/.opam/log/conf-ncurses-14-63385f.env
# output-file ~/.opam/log/conf-ncurses-14-63385f.out

<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
┌─ The following actions failed
│ λ build conf-ncurses 1
└─
╶─ No changes have been performed
mbacarella commented 2 years ago

The reporter says curses but this is actually an issue with conf-ncurses, which is depended on by several opam packages.

The actual problem here is some distributions provide hacks so that you can either pkg-config ncurses or pkg-config ncursesw. But at least one, Void Linux, does not, so it fails and they consider this a feature not a bug.

So. I've never heard of Void Linux and perhaps I never will again after this. This does bring up an interesting question though: what do we do for depexts if two libraries provide equivalent functionality under different names and we're not sure which one will be available?