2022-10-13 05:57:18 +00:00
|
|
|
{ lib, stdenv, fetchurl, ncurses, ocaml, writeText }:
|
* Add ocaml packages findlib, camlzip, ocaml-ssl, ocaml-batteries, menhir, camomile, ocaml-lwt, cryptokit, ocaml-cryptgps, ounit, ocaml-react
svn path=/nixpkgs/trunk/; revision=25041
2010-12-09 15:40:04 +00:00
|
|
|
|
2016-02-01 07:59:13 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2022-10-13 05:57:18 +00:00
|
|
|
pname = "ocaml${ocaml.version}-findlib";
|
|
|
|
version = "1.9.6";
|
* Add ocaml packages findlib, camlzip, ocaml-ssl, ocaml-batteries, menhir, camomile, ocaml-lwt, cryptokit, ocaml-cryptgps, ounit, ocaml-react
svn path=/nixpkgs/trunk/; revision=25041
2010-12-09 15:40:04 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2016-02-01 07:59:13 +00:00
|
|
|
url = "http://download.camlcity.org/download/findlib-${version}.tar.gz";
|
2022-10-13 05:57:18 +00:00
|
|
|
sha256 = "sha256-LfmWJ5rha2Bttf9Yefk9v63giY258aPoL3+EX6opMKI=";
|
* Add ocaml packages findlib, camlzip, ocaml-ssl, ocaml-batteries, menhir, camomile, ocaml-lwt, cryptokit, ocaml-cryptgps, ounit, ocaml-react
svn path=/nixpkgs/trunk/; revision=25041
2010-12-09 15:40:04 +00:00
|
|
|
};
|
|
|
|
|
2022-10-13 05:57:18 +00:00
|
|
|
nativeBuildInputs = [ ocaml ];
|
|
|
|
buildInputs = lib.optional (lib.versionOlder ocaml.version "4.07") ncurses;
|
* Add ocaml packages findlib, camlzip, ocaml-ssl, ocaml-batteries, menhir, camomile, ocaml-lwt, cryptokit, ocaml-cryptgps, ounit, ocaml-react
svn path=/nixpkgs/trunk/; revision=25041
2010-12-09 15:40:04 +00:00
|
|
|
|
2019-07-31 07:18:25 +00:00
|
|
|
patches = [ ./ldconf.patch ./install_topfind.patch ];
|
* Add ocaml packages findlib, camlzip, ocaml-ssl, ocaml-batteries, menhir, camomile, ocaml-lwt, cryptokit, ocaml-cryptgps, ounit, ocaml-react
svn path=/nixpkgs/trunk/; revision=25041
2010-12-09 15:40:04 +00:00
|
|
|
|
|
|
|
dontAddPrefix=true;
|
2021-08-14 12:00:00 +00:00
|
|
|
dontAddStaticConfigureFlags = true;
|
|
|
|
configurePlatforms = [];
|
* Add ocaml packages findlib, camlzip, ocaml-ssl, ocaml-batteries, menhir, camomile, ocaml-lwt, cryptokit, ocaml-cryptgps, ounit, ocaml-react
svn path=/nixpkgs/trunk/; revision=25041
2010-12-09 15:40:04 +00:00
|
|
|
|
2021-08-14 12:00:00 +00:00
|
|
|
configureFlags = [
|
|
|
|
"-bindir" "${placeholder "out"}/bin"
|
|
|
|
"-mandir" "${placeholder "out"}/share/man"
|
|
|
|
"-sitelib" "${placeholder "out"}/lib/ocaml/${ocaml.version}/site-lib"
|
|
|
|
"-config" "${placeholder "out"}/etc/findlib.conf"
|
|
|
|
];
|
|
|
|
|
|
|
|
buildFlags = [ "all" "opt" ];
|
* Add ocaml packages findlib, camlzip, ocaml-ssl, ocaml-batteries, menhir, camomile, ocaml-lwt, cryptokit, ocaml-cryptgps, ounit, ocaml-react
svn path=/nixpkgs/trunk/; revision=25041
2010-12-09 15:40:04 +00:00
|
|
|
|
|
|
|
setupHook = writeText "setupHook.sh" ''
|
|
|
|
addOCamlPath () {
|
2016-10-05 07:32:30 +00:00
|
|
|
if test -d "''$1/lib/ocaml/${ocaml.version}/site-lib"; then
|
2019-11-06 00:43:24 +00:00
|
|
|
export OCAMLPATH="''${OCAMLPATH-}''${OCAMLPATH:+:}''$1/lib/ocaml/${ocaml.version}/site-lib/"
|
* Add ocaml packages findlib, camlzip, ocaml-ssl, ocaml-batteries, menhir, camomile, ocaml-lwt, cryptokit, ocaml-cryptgps, ounit, ocaml-react
svn path=/nixpkgs/trunk/; revision=25041
2010-12-09 15:40:04 +00:00
|
|
|
fi
|
2018-05-29 05:28:04 +00:00
|
|
|
if test -d "''$1/lib/ocaml/${ocaml.version}/site-lib/stublibs"; then
|
2019-11-14 18:44:07 +00:00
|
|
|
export CAML_LD_LIBRARY_PATH="''${CAML_LD_LIBRARY_PATH-}''${CAML_LD_LIBRARY_PATH:+:}''$1/lib/ocaml/${ocaml.version}/site-lib/stublibs"
|
2018-03-15 17:19:31 +00:00
|
|
|
fi
|
2021-08-14 12:00:00 +00:00
|
|
|
}
|
2021-12-26 12:00:00 +00:00
|
|
|
exportOcamlDestDir () {
|
2016-10-05 07:32:30 +00:00
|
|
|
export OCAMLFIND_DESTDIR="''$out/lib/ocaml/${ocaml.version}/site-lib/"
|
2021-12-26 12:00:00 +00:00
|
|
|
}
|
|
|
|
createOcamlDestDir () {
|
2019-11-07 22:12:25 +00:00
|
|
|
if test -n "''${createFindlibDestdir-}"; then
|
2012-01-18 20:16:00 +00:00
|
|
|
mkdir -p $OCAMLFIND_DESTDIR
|
2010-12-21 09:37:35 +00:00
|
|
|
fi
|
* Add ocaml packages findlib, camlzip, ocaml-ssl, ocaml-batteries, menhir, camomile, ocaml-lwt, cryptokit, ocaml-cryptgps, ounit, ocaml-react
svn path=/nixpkgs/trunk/; revision=25041
2010-12-09 15:40:04 +00:00
|
|
|
}
|
2022-12-11 12:00:00 +00:00
|
|
|
detectOcamlConflicts () {
|
|
|
|
local conflict
|
|
|
|
conflict="$(ocamlfind list |& grep "has multiple definitions" || true)"
|
|
|
|
if [[ -n "$conflict" ]]; then
|
|
|
|
echo "Conflicting ocaml packages detected";
|
|
|
|
echo "$conflict"
|
2023-05-10 01:46:02 +00:00
|
|
|
echo "Set dontDetectOcamlConflicts to true to disable this check."
|
2022-12-11 12:00:00 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
}
|
2014-07-08 12:20:05 +00:00
|
|
|
|
2021-12-26 12:00:00 +00:00
|
|
|
# run for every buildInput
|
2017-08-10 22:22:07 +00:00
|
|
|
addEnvHooks "$targetOffset" addOCamlPath
|
2022-01-23 12:00:00 +00:00
|
|
|
# run before installPhase, even without buildInputs, and not in nix-shell
|
|
|
|
preInstallHooks+=(createOcamlDestDir)
|
2021-12-26 12:00:00 +00:00
|
|
|
# run even in nix-shell, and even without buildInputs
|
|
|
|
addEnvHooks "$hostOffset" exportOcamlDestDir
|
2022-12-11 12:00:00 +00:00
|
|
|
# runs after all calls to addOCamlPath
|
|
|
|
if [[ -z "''${dontDetectOcamlConflicts-}" ]]; then
|
|
|
|
postHooks+=("detectOcamlConflicts")
|
|
|
|
fi
|
* Add ocaml packages findlib, camlzip, ocaml-ssl, ocaml-batteries, menhir, camomile, ocaml-lwt, cryptokit, ocaml-cryptgps, ounit, ocaml-react
svn path=/nixpkgs/trunk/; revision=25041
2010-12-09 15:40:04 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "O'Caml library manager";
|
2022-05-09 17:30:27 +00:00
|
|
|
homepage = "http://projects.camlcity.org/projects/findlib.html";
|
2021-01-23 12:26:19 +00:00
|
|
|
license = lib.licenses.mit;
|
2022-05-09 17:30:27 +00:00
|
|
|
maintainers = with lib.maintainers; [ maggesi vbmithr ];
|
|
|
|
mainProgram = "ocamlfind";
|
2015-12-24 17:49:07 +00:00
|
|
|
platforms = ocaml.meta.platforms or [];
|
* Add ocaml packages findlib, camlzip, ocaml-ssl, ocaml-batteries, menhir, camomile, ocaml-lwt, cryptokit, ocaml-cryptgps, ounit, ocaml-react
svn path=/nixpkgs/trunk/; revision=25041
2010-12-09 15:40:04 +00:00
|
|
|
};
|
|
|
|
}
|
2016-02-01 07:59:13 +00:00
|
|
|
|
|
|
|
|