depext cygwin
depext-cygwinports provides all functions that are necessary in order to support opam-depext under cygwin. The installation of external libraries (like pcre, gtk2, or gmp) is very convenient this way.
depext-cygwinports will also install a wrapper for pkg-config
inside $(opam config var bin). pkg-config is available as either
i686-w64-mingw32-pkg-config or x86_64-w64-mingw32-pkg-config under
cygwin and most build instructions will just look for pkg-config.
Preparation
-
Add
/usr/i686-w64-mingw32/sys-root/mingw/binor/usr/x86_64-w64-mingw32/sys-root/mingw/binto your $PATH (in front of/usr/bin, not after it!). The cygwin maintainer use this convention to avoid name clashes. There is for example onecurl-configscript at/usr/bin(for cygwin’s version of libcurl that is linked againstcygwin1.dll), one in/usr/x86_64-w64-mingw32/sys-root/mingw/bin(64-bit native windows) and one in/usr/i686-w64-mingw32/sys-root/mingw/bin. The dlls at/usr/x86_64-w64-mingw32/sys-root/mingw/binand/usr/i686-w64-mingw32/sys-root/mingw/binusually also have identical names. Therefore you have to configure your PATH manually. (As an alternative you can useeval $(ocaml-env cygwin)instead ofeval $(opam config env), see ocaml-env) -
Install
depext-cygwinportswith:
opam install depext depext-cygwinportsUsage
Now you can use opam depext in the same way as under linux.
The following command for example will install
OCaml-Top including all
dependencies (gtk2, gtksourceview, etc.):
opam depext -i ocaml-topCaveats
depext-cygwinportswon’t work in multiuser contexts - you need write access to your root directory of cygwin. If you use the graphical installer and start it as normal user, the installer will configure it correct for you. If you want to install additonal cygwin packages later or update your installation, start cygwin’s setup withcygwin-install gui(cygwin-installis the wrapper installed bydepext-cygwinports, it will call cygwin’s setup with the right parameters for you).
And by the way, you can create multiple, independent cygwin installations without any problems. Every user could create its own version, it would just waste disk space.depext-cygwinportsis a misnomer at the moment. Yaakov Selkowitz recently moved all relevant packages from his repository (‘cygwinports’) to the main repository. The latest release ofdepext-cygwinportstherefore does not longer install any packages from cygwinports. But this might change again in the future.