ocamlPackages.camlidl: 1.05 → 1.11

This commit is contained in:
Vincent Laporte 2022-11-12 07:05:58 +01:00 committed by Vincent Laporte
parent f86d80320e
commit d8508f380f

View file

@ -1,16 +1,17 @@
{ lib, stdenv, fetchurl, ocaml, writeText }: { lib, stdenv, fetchFromGitHub, ocaml, writeText }:
lib.throwIfNot (lib.versionAtLeast ocaml.version "4.03")
"camlidl is not available for OCaml ${ocaml.version}"
let
pname = "camlidl";
webpage = "https://caml.inria.fr/pub/old_caml_site/camlidl/";
in
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "${pname}-${version}"; pname = "ocaml${ocaml.version}-camlidl";
version = "1.05"; version = "1.11";
src = fetchurl { src = fetchFromGitHub {
url = "http://caml.inria.fr/pub/old_caml_site/distrib/bazar-ocaml/${pname}-${version}.tar.gz"; owner = "xavierleroy";
sha256 = "0483cs66zsxsavcllpw1qqvyhxb39ddil3h72clcd69g7fyxazl5"; repo = "camlidl";
rev = "camlidl111";
sha256 = "sha256-8m0zem/6nvpEJtjJNP/+vafeVLlMvNQGdl8lyf/OeBg=";
}; };
nativeBuildInputs = [ ocaml ]; nativeBuildInputs = [ ocaml ];
@ -21,10 +22,10 @@ stdenv.mkDerivation rec {
preBuild = '' preBuild = ''
mv config/Makefile.unix config/Makefile mv config/Makefile.unix config/Makefile
substituteInPlace config/Makefile --replace BINDIR=/usr/local/bin BINDIR=$out substituteInPlace config/Makefile --replace BINDIR=/usr/local/bin BINDIR=$out
substituteInPlace config/Makefile --replace OCAMLLIB=/usr/local/lib/ocaml OCAMLLIB=$out/lib/ocaml/${ocaml.version}/site-lib/camlidl substituteInPlace config/Makefile --replace 'OCAMLLIB=$(shell $(OCAMLC) -where)' OCAMLLIB=$out/lib/ocaml/${ocaml.version}/site-lib/camlidl
substituteInPlace config/Makefile --replace CPP=/lib/cpp CPP=${stdenv.cc}/bin/cpp substituteInPlace config/Makefile --replace CPP=cpp CPP=${stdenv.cc}/bin/cpp
substituteInPlace config/Makefile --replace "OCAMLC=ocamlc -g" "OCAMLC=ocamlc -g -warn-error -31"
mkdir -p $out/lib/ocaml/${ocaml.version}/site-lib/camlidl/caml mkdir -p $out/lib/ocaml/${ocaml.version}/site-lib/camlidl/caml
mkdir -p $out/lib/ocaml/${ocaml.version}/site-lib/camlidl/stublibs
''; '';
postInstall = '' postInstall = ''
@ -40,15 +41,14 @@ stdenv.mkDerivation rec {
''; '';
setupHook = writeText "setupHook.sh" '' setupHook = writeText "setupHook.sh" ''
export CAML_LD_LIBRARY_PATH="''${CAML_LD_LIBRARY_PATH-}''${CAML_LD_LIBRARY_PATH:+:}''$1/lib/ocaml/${ocaml.version}/site-lib/${name}/"
export NIX_CFLAGS_COMPILE+=" -isystem $1/lib/ocaml/${ocaml.version}/site-lib/camlidl" 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" export NIX_LDFLAGS+=" -L $1/lib/ocaml/${ocaml.version}/site-lib/camlidl"
''; '';
meta = { meta = {
description = "A stub code generator and COM binding for Objective Caml"; description = "A stub code generator and COM binding for Objective Caml";
homepage = webpage; homepage = "https://xavierleroy.org/camlidl/";
license = "LGPL"; license = lib.licenses.lgpl21;
maintainers = [ lib.maintainers.roconnor ]; maintainers = [ lib.maintainers.roconnor ];
}; };
} }