2018-07-21 01:44:44 +01:00
|
|
|
{ stdenv, fetchurl, ocaml, writeText }:
|
2016-10-05 08:32:30 +01:00
|
|
|
|
2011-10-04 02:40:45 +01:00
|
|
|
let
|
|
|
|
pname = "camlidl";
|
|
|
|
webpage = "http://caml.inria.fr/pub/old_caml_site/camlidl/";
|
|
|
|
in
|
2016-10-05 08:32:30 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2011-10-04 02:40:45 +01:00
|
|
|
name = "${pname}-${version}";
|
2016-10-05 08:32:30 +01:00
|
|
|
version = "1.05";
|
2011-10-04 02:40:45 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "http://caml.inria.fr/pub/old_caml_site/distrib/bazar-ocaml/${pname}-${version}.tar.gz";
|
|
|
|
sha256 = "0483cs66zsxsavcllpw1qqvyhxb39ddil3h72clcd69g7fyxazl5";
|
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [ ocaml ];
|
|
|
|
|
|
|
|
preBuild = ''
|
|
|
|
mv config/Makefile.unix config/Makefile
|
|
|
|
substituteInPlace config/Makefile --replace BINDIR=/usr/local/bin BINDIR=$out
|
2016-10-05 08:32:30 +01:00
|
|
|
substituteInPlace config/Makefile --replace OCAMLLIB=/usr/local/lib/ocaml OCAMLLIB=$out/lib/ocaml/${ocaml.version}/site-lib/camlidl
|
2016-10-03 20:22:53 +01:00
|
|
|
substituteInPlace config/Makefile --replace CPP=/lib/cpp CPP=${stdenv.cc}/bin/cpp
|
2016-10-12 11:20:40 +01:00
|
|
|
substituteInPlace config/Makefile --replace "OCAMLC=ocamlc -g" "OCAMLC=ocamlc -g -warn-error -31"
|
2016-10-05 08:32:30 +01:00
|
|
|
mkdir -p $out/lib/ocaml/${ocaml.version}/site-lib/camlidl/caml
|
2011-10-04 02:40:45 +01:00
|
|
|
'';
|
|
|
|
|
2015-01-25 21:08:33 +00:00
|
|
|
postInstall = ''
|
2016-10-05 08:32:30 +01:00
|
|
|
cat >$out/lib/ocaml/${ocaml.version}/site-lib/camlidl/META <<EOF
|
2015-01-25 21:08:33 +00:00
|
|
|
# Courtesy of GODI
|
|
|
|
description = "Stub generator"
|
|
|
|
version = "${version}"
|
|
|
|
archive(byte) = "com.cma"
|
|
|
|
archive(native) = "com.cmxa"
|
|
|
|
EOF
|
|
|
|
mkdir -p $out/bin
|
|
|
|
ln -s $out/camlidl $out/bin
|
|
|
|
'';
|
|
|
|
|
2017-06-15 19:37:43 +01:00
|
|
|
setupHook = writeText "setupHook.sh" ''
|
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/${name}/"
|
2017-06-15 19:37:43 +01:00
|
|
|
export NIX_CFLAGS_COMPILE+=" -isystem $1/lib/ocaml/${ocaml.version}/site-lib/camlidl"
|
|
|
|
export NIX_LDFLAGS+=" -L $1/lib/ocaml/${ocaml.version}/site-lib/camlidl"
|
|
|
|
'';
|
|
|
|
|
2011-10-04 02:40:45 +01:00
|
|
|
meta = {
|
2015-04-30 16:05:14 +01:00
|
|
|
description = "A stub code generator and COM binding for Objective Caml";
|
2019-09-09 00:38:31 +01:00
|
|
|
homepage = webpage;
|
2011-10-04 02:40:45 +01:00
|
|
|
license = "LGPL";
|
|
|
|
maintainers = [ stdenv.lib.maintainers.roconnor ];
|
|
|
|
};
|
|
|
|
}
|