uboot: (firmwareOdroidC2/C4) don't invoke patch tool, use patches = [] instead
https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh#L948 this can do it nicely. Signed-off-by: Anton Arapov <anton@deadbeef.mx>
This commit is contained in:
commit
56de2bcd43
30691 changed files with 3076956 additions and 0 deletions
54
pkgs/development/tools/ocaml/camlidl/default.nix
Normal file
54
pkgs/development/tools/ocaml/camlidl/default.nix
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
{ lib, stdenv, fetchurl, ocaml, writeText }:
|
||||
|
||||
let
|
||||
pname = "camlidl";
|
||||
webpage = "https://caml.inria.fr/pub/old_caml_site/camlidl/";
|
||||
in
|
||||
stdenv.mkDerivation rec {
|
||||
name = "${pname}-${version}";
|
||||
version = "1.05";
|
||||
|
||||
src = fetchurl {
|
||||
url = "http://caml.inria.fr/pub/old_caml_site/distrib/bazar-ocaml/${pname}-${version}.tar.gz";
|
||||
sha256 = "0483cs66zsxsavcllpw1qqvyhxb39ddil3h72clcd69g7fyxazl5";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ ocaml ];
|
||||
|
||||
# build fails otherwise
|
||||
enableParallelBuilding = false;
|
||||
|
||||
preBuild = ''
|
||||
mv config/Makefile.unix config/Makefile
|
||||
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 CPP=/lib/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
|
||||
'';
|
||||
|
||||
postInstall = ''
|
||||
cat >$out/lib/ocaml/${ocaml.version}/site-lib/camlidl/META <<EOF
|
||||
# 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
|
||||
'';
|
||||
|
||||
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_LDFLAGS+=" -L $1/lib/ocaml/${ocaml.version}/site-lib/camlidl"
|
||||
'';
|
||||
|
||||
meta = {
|
||||
description = "A stub code generator and COM binding for Objective Caml";
|
||||
homepage = webpage;
|
||||
license = "LGPL";
|
||||
maintainers = [ lib.maintainers.roconnor ];
|
||||
};
|
||||
}
|
||||
92
pkgs/development/tools/ocaml/camlp4/default.nix
Normal file
92
pkgs/development/tools/ocaml/camlp4/default.nix
Normal file
|
|
@ -0,0 +1,92 @@
|
|||
{ lib, stdenv, fetchzip, which, ocaml, ocamlbuild }:
|
||||
|
||||
if lib.versionAtLeast ocaml.version "4.14"
|
||||
then throw "camlp4 is not available for OCaml ${ocaml.version}"
|
||||
else
|
||||
|
||||
let param = {
|
||||
"4.02" = {
|
||||
version = "4.02+6";
|
||||
sha256 = "06yl4q0qazl7g25b0axd1gdkfd4qpqzs1gr5fkvmkrcbz113h1hj"; };
|
||||
"4.03" = {
|
||||
version = "4.03+1";
|
||||
sha256 = "1f2ndch6f1m4fgnxsjb94qbpwjnjgdlya6pard44y6n0dqxi1wsq"; };
|
||||
"4.04" = {
|
||||
version = "4.04+1";
|
||||
sha256 = "1ad7rygqjxrc1im95gw9lp8q83nhdaf383f2808f1p63yl42xm7k"; };
|
||||
"4.05" = {
|
||||
version = "4.05+1";
|
||||
sha256 = "0wm795hpwvwpib9c9z6p8kw2fh7p7b2hml6g15z8zry3y7w738sv"; };
|
||||
"4.06" = {
|
||||
version = "4.06+1";
|
||||
sha256 = "0fazfw2l7wdmbwnqc22xby5n4ri1wz27lw9pfzhsbcdrighykysf"; };
|
||||
"4.07" = {
|
||||
version = "4.07+1";
|
||||
sha256 = "0cxl4hkqcvspvkx4f2k83217rh6051fll9i2yz7cw6m3bq57mdvl"; };
|
||||
"4.08" = {
|
||||
version = "4.08+1";
|
||||
sha256 = "0qplawvxwai25bi27niw2cgz2al01kcnkj8wxwhxslpi21z6pyx1"; };
|
||||
"4.09" = {
|
||||
version = "4.09+1";
|
||||
sha256 = "1gr33x6xs1rs0bpyq4vzyfxd6vn47jfkg8imi81db2r0cbs0kxx1"; };
|
||||
"4.10" = {
|
||||
version = "4.10+1";
|
||||
sha256 = "093bc1c28wid5li0jwglnd4p3csxw09fmbs9ffybq2z41a5mgay6"; };
|
||||
"4.11" = {
|
||||
version = "4.11+1";
|
||||
sha256 = "0sn7f6im940qh0ixmx1k738xrwwdvy9g7r19bv5218jb6mh0g068"; };
|
||||
"4.12" = {
|
||||
version = "4.12+1";
|
||||
sha256 = "1cfk5ppnd511vzsr9gc0grxbafmh0m3m897aij198rppzxps5kyz"; };
|
||||
"4.13" = {
|
||||
version = "4.13+1";
|
||||
sha256 = "0fzxa1zdhk74mlxpin7p90flks6sp4gkc0mfclmj9zak15rii55n"; };
|
||||
}.${ocaml.meta.branch};
|
||||
in
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "camlp4";
|
||||
inherit (param) version;
|
||||
|
||||
src = fetchzip {
|
||||
url = "https://github.com/ocaml/camlp4/archive/${version}.tar.gz";
|
||||
inherit (param) sha256;
|
||||
};
|
||||
|
||||
buildInputs = [ which ocaml ocamlbuild ];
|
||||
|
||||
# build fails otherwise
|
||||
enableParallelBuilding = false;
|
||||
|
||||
dontAddPrefix = true;
|
||||
|
||||
preConfigure = ''
|
||||
# increase stack space for spacetime variant of the compiler
|
||||
# https://github.com/ocaml/ocaml/issues/7435
|
||||
# but disallowed by darwin sandbox
|
||||
ulimit -s unlimited || true
|
||||
|
||||
configureFlagsArray=(
|
||||
--bindir=$out/bin
|
||||
--libdir=$out/lib/ocaml/${ocaml.version}/site-lib
|
||||
--pkgdir=$out/lib/ocaml/${ocaml.version}/site-lib
|
||||
)
|
||||
'';
|
||||
|
||||
postConfigure = ''
|
||||
substituteInPlace camlp4/META.in \
|
||||
--replace +camlp4 $out/lib/ocaml/${ocaml.version}/site-lib/camlp4
|
||||
'';
|
||||
|
||||
makeFlags = [ "all" ];
|
||||
|
||||
installTargets = [ "install" "install-META" ];
|
||||
|
||||
dontStrip = true;
|
||||
|
||||
meta = with lib; {
|
||||
description = "A software system for writing extensible parsers for programming languages";
|
||||
homepage = "https://github.com/ocaml/camlp4";
|
||||
platforms = ocaml.meta.platforms or [];
|
||||
};
|
||||
}
|
||||
46
pkgs/development/tools/ocaml/camlp5/default.nix
Normal file
46
pkgs/development/tools/ocaml/camlp5/default.nix
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
{ lib, stdenv, fetchFromGitHub, ocaml, perl }:
|
||||
|
||||
if lib.versionOlder ocaml.version "4.02"
|
||||
|| lib.versionOlder "4.13" ocaml.version
|
||||
then throw "camlp5 is not available for OCaml ${ocaml.version}"
|
||||
else
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
|
||||
pname = "camlp5";
|
||||
version = "7.14";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "camlp5";
|
||||
repo = "camlp5";
|
||||
rev = "rel${builtins.replaceStrings [ "." ] [ "" ] version}";
|
||||
sha256 = "1dd68bisbpqn5lq2pslm582hxglcxnbkgfkwhdz67z4w9d5nvr7w";
|
||||
};
|
||||
|
||||
buildInputs = [ ocaml perl ];
|
||||
|
||||
prefixKey = "-prefix ";
|
||||
|
||||
preConfigure = ''
|
||||
configureFlagsArray=(--strict --libdir $out/lib/ocaml/${ocaml.version}/site-lib)
|
||||
patchShebangs ./config/find_stuffversion.pl
|
||||
'';
|
||||
|
||||
buildFlags = [ "world.opt" ];
|
||||
|
||||
dontStrip = true;
|
||||
|
||||
meta = with lib; {
|
||||
description = "Preprocessor-pretty-printer for OCaml";
|
||||
longDescription = ''
|
||||
Camlp5 is a preprocessor and pretty-printer for OCaml programs.
|
||||
It also provides parsing and printing tools.
|
||||
'';
|
||||
homepage = "https://camlp5.github.io/";
|
||||
license = licenses.bsd3;
|
||||
platforms = ocaml.meta.platforms or [];
|
||||
maintainers = with maintainers; [
|
||||
maggesi vbgl
|
||||
];
|
||||
};
|
||||
}
|
||||
67
pkgs/development/tools/ocaml/cppo/default.nix
Normal file
67
pkgs/development/tools/ocaml/cppo/default.nix
Normal file
|
|
@ -0,0 +1,67 @@
|
|||
{ lib, stdenv, fetchFromGitHub, ocaml, findlib, ocamlbuild
|
||||
, buildDunePackage
|
||||
}:
|
||||
|
||||
let
|
||||
pname = "cppo";
|
||||
|
||||
meta = with lib; {
|
||||
description = "The C preprocessor for OCaml";
|
||||
longDescription = ''
|
||||
Cppo is an equivalent of the C preprocessor targeted at the OCaml language and its variants.
|
||||
'';
|
||||
homepage = "https://github.com/ocaml-community/${pname}";
|
||||
maintainers = [ maintainers.vbgl ];
|
||||
license = licenses.bsd3;
|
||||
};
|
||||
|
||||
in
|
||||
|
||||
if lib.versionAtLeast ocaml.version "4.02" then
|
||||
|
||||
buildDunePackage rec {
|
||||
inherit pname;
|
||||
version = "1.6.9";
|
||||
|
||||
useDune2 = true;
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "ocaml-community";
|
||||
repo = pname;
|
||||
rev = "v${version}";
|
||||
sha256 = "sha256-NdN2QnVRfRq9hEcSAnO2Wha7icDlf2Zg4JQqoEWmErE=";
|
||||
};
|
||||
|
||||
doCheck = true;
|
||||
|
||||
inherit meta;
|
||||
}
|
||||
|
||||
else
|
||||
|
||||
let version = "1.5.0"; in
|
||||
|
||||
stdenv.mkDerivation {
|
||||
|
||||
name = "${pname}-${version}";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "mjambon";
|
||||
repo = pname;
|
||||
rev = "v${version}";
|
||||
sha256 = "1xqldjz9risndnabvadw41fdbi5sa2hl4fnqls7j9xfbby1izbg8";
|
||||
};
|
||||
|
||||
buildInputs = [ ocaml findlib ocamlbuild ];
|
||||
|
||||
inherit meta;
|
||||
|
||||
createFindlibDestdir = true;
|
||||
|
||||
makeFlags = [ "PREFIX=$(out)" ];
|
||||
|
||||
preBuild = ''
|
||||
mkdir -p $out/bin
|
||||
'';
|
||||
|
||||
}
|
||||
17
pkgs/development/tools/ocaml/cppo/ocamlbuild.nix
Normal file
17
pkgs/development/tools/ocaml/cppo/ocamlbuild.nix
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
{ lib, buildDunePackage, cppo, ocamlbuild }:
|
||||
|
||||
if lib.versionOlder (lib.getVersion cppo) "1.6"
|
||||
then cppo
|
||||
else
|
||||
|
||||
buildDunePackage rec {
|
||||
pname = "cppo_ocamlbuild";
|
||||
|
||||
inherit (cppo) version useDune2 src;
|
||||
|
||||
propagatedBuildInputs = [ ocamlbuild ];
|
||||
|
||||
meta = cppo.meta // {
|
||||
description = "Plugin to use cppo with ocamlbuild";
|
||||
};
|
||||
}
|
||||
30
pkgs/development/tools/ocaml/crunch/default.nix
Normal file
30
pkgs/development/tools/ocaml/crunch/default.nix
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
{ lib, buildDunePackage, fetchurl, ocaml, cmdliner, ptime }:
|
||||
|
||||
buildDunePackage rec {
|
||||
|
||||
pname = "crunch";
|
||||
version = "3.1.0";
|
||||
|
||||
useDune2 = true;
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://github.com/mirage/ocaml-crunch/releases/download/v${version}/crunch-v${version}.tbz";
|
||||
sha256 = "0d26715a4h9r1wibnc12xy690m1kan7hrcgbb5qk8x78zsr67lnf";
|
||||
};
|
||||
|
||||
propagatedBuildInputs = [ cmdliner ptime ];
|
||||
|
||||
outputs = [ "lib" "bin" "out" ];
|
||||
|
||||
installPhase = ''
|
||||
dune install --prefix=$bin --libdir=$lib/lib/ocaml/${ocaml.version}/site-lib/
|
||||
'';
|
||||
|
||||
meta = {
|
||||
homepage = "https://github.com/mirage/ocaml-crunch";
|
||||
description = "Convert a filesystem into a static OCaml module";
|
||||
license = lib.licenses.isc;
|
||||
maintainers = [ lib.maintainers.vbgl ];
|
||||
};
|
||||
|
||||
}
|
||||
62
pkgs/development/tools/ocaml/dune-release/default.nix
Normal file
62
pkgs/development/tools/ocaml/dune-release/default.nix
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
{ lib, buildDunePackage, fetchurl, makeWrapper, fetchpatch
|
||||
, curly, fmt, bos, cmdliner, re, rresult, logs, fpath
|
||||
, odoc, opam-format, opam-core, opam-state, yojson, astring
|
||||
, opam, git, findlib, mercurial, bzip2, gnutar, coreutils
|
||||
, alcotest
|
||||
}:
|
||||
|
||||
# don't include dune as runtime dep, so user can
|
||||
# choose between dune and dune_2
|
||||
let runtimeInputs = [ opam findlib git mercurial bzip2 gnutar coreutils ];
|
||||
in buildDunePackage rec {
|
||||
pname = "dune-release";
|
||||
version = "1.5.2";
|
||||
|
||||
minimumOCamlVersion = "4.06";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://github.com/ocamllabs/${pname}/releases/download/${version}/${pname}-${version}.tbz";
|
||||
sha256 = "1r6bz1zz1al5y762ws3w98d8bnyi5ipffajgczixacmbrxvp3zgx";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ makeWrapper ];
|
||||
buildInputs = [ curly fmt cmdliner re opam-format opam-state opam-core
|
||||
rresult logs odoc bos yojson astring fpath ];
|
||||
checkInputs = [ alcotest ] ++ runtimeInputs;
|
||||
doCheck = true;
|
||||
|
||||
useDune2 = true;
|
||||
|
||||
patches = [
|
||||
# add missing git config calls to avoid failing due to the lack of a global git config
|
||||
(fetchpatch {
|
||||
name = "tests-missing-git-config.patch";
|
||||
url = "https://github.com/ocamllabs/dune-release/commit/87e7ffe2a9c574620d4e2fc0d79eed8772eab973.patch";
|
||||
sha256 = "0wrzcpzr54dwrdjdc75mijh78xk4bmsmqs1pci06fb2nf03vbd2k";
|
||||
})
|
||||
];
|
||||
|
||||
postPatch = ''
|
||||
# remove check for curl in PATH, since curly is patched
|
||||
# to have a fixed path to the binary in nix store
|
||||
sed -i '/must_exist (Cmd\.v "curl"/d' lib/github.ml
|
||||
'';
|
||||
|
||||
preCheck = ''
|
||||
# it fails when it tries to reference "./make_check_deterministic.exe"
|
||||
rm -r tests/bin/check
|
||||
'';
|
||||
|
||||
# tool specific env vars have been deprecated, use PATH
|
||||
preFixup = ''
|
||||
wrapProgram $out/bin/dune-release \
|
||||
--prefix PATH : "${lib.makeBinPath runtimeInputs}"
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "Release dune packages in opam";
|
||||
homepage = "https://github.com/ocamllabs/dune-release";
|
||||
license = licenses.isc;
|
||||
maintainers = with maintainers; [ sternenseemann ];
|
||||
};
|
||||
}
|
||||
37
pkgs/development/tools/ocaml/dune/1.nix
Normal file
37
pkgs/development/tools/ocaml/dune/1.nix
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
{ stdenv, lib, fetchurl, ocaml, findlib, ncurses }:
|
||||
|
||||
if lib.versionOlder ocaml.version "4.02"
|
||||
|| lib.versionAtLeast ocaml.version "4.12"
|
||||
then throw "dune 1 is not available for OCaml ${ocaml.version}"
|
||||
else
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "dune";
|
||||
version = "1.11.4";
|
||||
src = fetchurl {
|
||||
url = "https://github.com/ocaml/dune/releases/download/${version}/dune-build-info-${version}.tbz";
|
||||
sha256 = "1rkc8lqw30ifjaz8d81la6i8j05ffd0whpxqsbg6dci16945zjvp";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ ocaml findlib ];
|
||||
buildInputs = [ ncurses ];
|
||||
strictDeps = true;
|
||||
|
||||
buildFlags = [ "release" ];
|
||||
makeFlags = [
|
||||
"PREFIX=${placeholder "out"}"
|
||||
"LIBDIR=$(OCAMLFIND_DESTDIR)"
|
||||
];
|
||||
|
||||
dontAddPrefix = true;
|
||||
dontAddStaticConfigureFlags = true;
|
||||
configurePlatforms = [];
|
||||
|
||||
meta = with lib; {
|
||||
homepage = "https://dune.build/";
|
||||
description = "A composable build system";
|
||||
maintainers = [ maintainers.vbgl maintainers.marsam ];
|
||||
license = licenses.mit;
|
||||
inherit (ocaml.meta) platforms;
|
||||
};
|
||||
}
|
||||
35
pkgs/development/tools/ocaml/dune/2.nix
Normal file
35
pkgs/development/tools/ocaml/dune/2.nix
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
{ lib, stdenv, fetchurl, ocaml, findlib }:
|
||||
|
||||
if lib.versionOlder ocaml.version "4.08"
|
||||
then throw "dune 2 is not available for OCaml ${ocaml.version}"
|
||||
else
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "dune";
|
||||
version = "2.9.3";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://github.com/ocaml/dune/releases/download/${version}/dune-site-${version}.tbz";
|
||||
sha256 = "sha256:1ml8bxym8sdfz25bx947al7cvsi2zg5lcv7x9w6xb01cmdryqr9y";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ ocaml findlib ];
|
||||
strictDeps = true;
|
||||
|
||||
buildFlags = "release";
|
||||
|
||||
dontAddPrefix = true;
|
||||
dontAddStaticConfigureFlags = true;
|
||||
configurePlatforms = [];
|
||||
|
||||
installFlags = [ "PREFIX=${placeholder "out"}" "LIBDIR=$(OCAMLFIND_DESTDIR)" ];
|
||||
|
||||
meta = {
|
||||
homepage = "https://dune.build/";
|
||||
description = "A composable build system";
|
||||
changelog = "https://github.com/ocaml/dune/raw/${version}/CHANGES.md";
|
||||
maintainers = [ lib.maintainers.vbgl lib.maintainers.marsam ];
|
||||
license = lib.licenses.mit;
|
||||
inherit (ocaml.meta) platforms;
|
||||
};
|
||||
}
|
||||
40
pkgs/development/tools/ocaml/dune/3.nix
Normal file
40
pkgs/development/tools/ocaml/dune/3.nix
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
{ lib, stdenv, fetchurl, ocaml, findlib, darwin }:
|
||||
|
||||
if lib.versionOlder ocaml.version "4.08"
|
||||
then throw "dune 3 is not available for OCaml ${ocaml.version}"
|
||||
else
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "dune";
|
||||
version = "3.2.0";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://github.com/ocaml/dune/releases/download/${version}/chrome-trace-${version}.tbz";
|
||||
sha256 = "sha256-vR+85q557R6yb6ibsuLiOXivzrP1P1V4zxvasIoa1bw=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ ocaml findlib ];
|
||||
|
||||
buildInputs = lib.optionals stdenv.isDarwin [
|
||||
darwin.apple_sdk.frameworks.Foundation
|
||||
];
|
||||
|
||||
strictDeps = true;
|
||||
|
||||
buildFlags = "release";
|
||||
|
||||
dontAddPrefix = true;
|
||||
dontAddStaticConfigureFlags = true;
|
||||
configurePlatforms = [];
|
||||
|
||||
installFlags = [ "PREFIX=${placeholder "out"}" "LIBDIR=$(OCAMLFIND_DESTDIR)" ];
|
||||
|
||||
meta = {
|
||||
homepage = "https://dune.build/";
|
||||
description = "A composable build system";
|
||||
changelog = "https://github.com/ocaml/dune/raw/${version}/CHANGES.md";
|
||||
maintainers = [ lib.maintainers.vbgl lib.maintainers.marsam ];
|
||||
license = lib.licenses.mit;
|
||||
inherit (ocaml.meta) platforms;
|
||||
};
|
||||
}
|
||||
66
pkgs/development/tools/ocaml/findlib/default.nix
Normal file
66
pkgs/development/tools/ocaml/findlib/default.nix
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
{ lib, stdenv, fetchurl, fetchpatch, m4, ncurses, ocaml, writeText }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "ocaml-findlib";
|
||||
version = "1.9.3";
|
||||
|
||||
src = fetchurl {
|
||||
url = "http://download.camlcity.org/download/findlib-${version}.tar.gz";
|
||||
sha256 = "sha256:0hfcwamcvinmww59b5i4yxbf0kxyzkp5qv3d1c7ybn9q52vgq463";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [m4 ocaml];
|
||||
buildInputs = [ ncurses ];
|
||||
|
||||
patches = [ ./ldconf.patch ./install_topfind.patch ];
|
||||
|
||||
dontAddPrefix=true;
|
||||
dontAddStaticConfigureFlags = true;
|
||||
configurePlatforms = [];
|
||||
|
||||
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" ];
|
||||
|
||||
setupHook = writeText "setupHook.sh" ''
|
||||
addOCamlPath () {
|
||||
if test -d "''$1/lib/ocaml/${ocaml.version}/site-lib"; then
|
||||
export OCAMLPATH="''${OCAMLPATH-}''${OCAMLPATH:+:}''$1/lib/ocaml/${ocaml.version}/site-lib/"
|
||||
fi
|
||||
if test -d "''$1/lib/ocaml/${ocaml.version}/site-lib/stublibs"; then
|
||||
export CAML_LD_LIBRARY_PATH="''${CAML_LD_LIBRARY_PATH-}''${CAML_LD_LIBRARY_PATH:+:}''$1/lib/ocaml/${ocaml.version}/site-lib/stublibs"
|
||||
fi
|
||||
}
|
||||
exportOcamlDestDir () {
|
||||
export OCAMLFIND_DESTDIR="''$out/lib/ocaml/${ocaml.version}/site-lib/"
|
||||
}
|
||||
createOcamlDestDir () {
|
||||
if test -n "''${createFindlibDestdir-}"; then
|
||||
mkdir -p $OCAMLFIND_DESTDIR
|
||||
fi
|
||||
}
|
||||
|
||||
# run for every buildInput
|
||||
addEnvHooks "$targetOffset" addOCamlPath
|
||||
# run before installPhase, even without buildInputs, and not in nix-shell
|
||||
preInstallHooks+=(createOcamlDestDir)
|
||||
# run even in nix-shell, and even without buildInputs
|
||||
addEnvHooks "$hostOffset" exportOcamlDestDir
|
||||
'';
|
||||
|
||||
meta = {
|
||||
description = "O'Caml library manager";
|
||||
homepage = "http://projects.camlcity.org/projects/findlib.html";
|
||||
license = lib.licenses.mit;
|
||||
maintainers = with lib.maintainers; [ maggesi vbmithr ];
|
||||
mainProgram = "ocamlfind";
|
||||
platforms = ocaml.meta.platforms or [];
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
12
pkgs/development/tools/ocaml/findlib/install_topfind.patch
Normal file
12
pkgs/development/tools/ocaml/findlib/install_topfind.patch
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
--- a/src/findlib/Makefile
|
||||
+++ b/src/findlib/Makefile
|
||||
@@ -123,7 +123,7 @@ clean:
|
||||
install: all
|
||||
mkdir -p "$(prefix)$(OCAML_SITELIB)/$(NAME)"
|
||||
mkdir -p "$(prefix)$(OCAMLFIND_BIN)"
|
||||
- test $(INSTALL_TOPFIND) -eq 0 || cp topfind "$(prefix)$(OCAML_CORE_STDLIB)"
|
||||
+ test $(INSTALL_TOPFIND) -eq 0 || cp topfind "$(prefix)$(OCAML_SITELIB)"
|
||||
files=`$(SH) $(TOP)/tools/collect_files $(TOP)/Makefile.config \
|
||||
findlib.cmi findlib.mli findlib.cma findlib.cmxa findlib$(LIB_SUFFIX) findlib.cmxs \
|
||||
findlib_config.cmi findlib_config.ml topfind.cmi topfind.mli \
|
||||
|
||||
8
pkgs/development/tools/ocaml/findlib/ldconf.patch
Normal file
8
pkgs/development/tools/ocaml/findlib/ldconf.patch
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
Setting paths to search for dnynmic libraries isn't very useful in Nix.
|
||||
|
||||
--- findlib-1.2.6/findlib.conf.in 2010-08-17 14:50:28.000000000 -0400
|
||||
+++ findlib-1.2.6/findlib.conf.in 2010-11-24 09:46:55.179648354 -0500
|
||||
@@ -1,2 +1,3 @@
|
||||
destdir="@SITELIB@"
|
||||
path="@SITELIB@"
|
||||
+ldconf="ignore"
|
||||
10
pkgs/development/tools/ocaml/js_of_ocaml/Makefile.conf.diff
Normal file
10
pkgs/development/tools/ocaml/js_of_ocaml/Makefile.conf.diff
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
--- old/Makefile.conf 2014-05-19 16:53:09.263564921 +0200
|
||||
+++ new/Makefile.conf 2014-05-19 16:53:42.213152994 +0200
|
||||
@@ -1,6 +1,6 @@
|
||||
|
||||
# Where binaries are installed:
|
||||
-BINDIR := `dirname \`which ocamlc\``
|
||||
+BINDIR := $(out)/bin
|
||||
|
||||
####
|
||||
|
||||
21
pkgs/development/tools/ocaml/js_of_ocaml/camlp4.nix
Normal file
21
pkgs/development/tools/ocaml/js_of_ocaml/camlp4.nix
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
{ buildDunePackage, fetchFromGitHub, js_of_ocaml-compiler
|
||||
, camlp4, ocsigen_deriving
|
||||
}:
|
||||
|
||||
buildDunePackage rec {
|
||||
version = "3.2.1";
|
||||
pname = "js_of_ocaml-camlp4";
|
||||
|
||||
useDune2 = false;
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "ocsigen";
|
||||
repo = "js_of_ocaml";
|
||||
rev = version;
|
||||
sha256 = "1v2hfq0ra9j07yz6pj6m03hrvgys4vmx0gclchv94yywpb2wc7ik";
|
||||
};
|
||||
|
||||
buildInputs = [ camlp4 ocsigen_deriving ];
|
||||
|
||||
meta = builtins.removeAttrs js_of_ocaml-compiler.meta [ "mainProgram" ];
|
||||
}
|
||||
29
pkgs/development/tools/ocaml/js_of_ocaml/compiler.nix
Normal file
29
pkgs/development/tools/ocaml/js_of_ocaml/compiler.nix
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
{ lib, fetchurl, buildDunePackage
|
||||
, cmdliner, yojson, ppxlib
|
||||
, menhir, menhirLib
|
||||
}:
|
||||
|
||||
buildDunePackage rec {
|
||||
pname = "js_of_ocaml-compiler";
|
||||
version = "4.0.0";
|
||||
useDune2 = true;
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://github.com/ocsigen/js_of_ocaml/releases/download/${version}/js_of_ocaml-${version}.tbz";
|
||||
sha256 = "sha256:0pj9jjrmi0xxrzmygv4b5whsibw1jxy3wgibmws85x5jwlczh0nz";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ menhir ];
|
||||
buildInputs = [ cmdliner ppxlib ];
|
||||
|
||||
configurePlatforms = [];
|
||||
propagatedBuildInputs = [ menhirLib yojson ];
|
||||
|
||||
meta = {
|
||||
description = "Compiler from OCaml bytecode to Javascript";
|
||||
homepage = "https://ocsigen.org/js_of_ocaml/";
|
||||
license = lib.licenses.gpl2;
|
||||
maintainers = [ lib.maintainers.vbgl ];
|
||||
mainProgram = "js_of_ocaml";
|
||||
};
|
||||
}
|
||||
15
pkgs/development/tools/ocaml/js_of_ocaml/default.nix
Normal file
15
pkgs/development/tools/ocaml/js_of_ocaml/default.nix
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
{ buildDunePackage, js_of_ocaml-compiler
|
||||
, ppxlib, uchar
|
||||
}:
|
||||
|
||||
buildDunePackage {
|
||||
pname = "js_of_ocaml";
|
||||
|
||||
inherit (js_of_ocaml-compiler) version src useDune2;
|
||||
|
||||
buildInputs = [ ppxlib ];
|
||||
|
||||
propagatedBuildInputs = [ js_of_ocaml-compiler uchar ];
|
||||
|
||||
meta = builtins.removeAttrs js_of_ocaml-compiler.meta [ "mainProgram" ];
|
||||
}
|
||||
15
pkgs/development/tools/ocaml/js_of_ocaml/lwt.nix
Normal file
15
pkgs/development/tools/ocaml/js_of_ocaml/lwt.nix
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
{ buildDunePackage, js_of_ocaml-compiler, js_of_ocaml-ppx
|
||||
, js_of_ocaml, ocaml_lwt, lwt_log
|
||||
}:
|
||||
|
||||
buildDunePackage {
|
||||
pname = "js_of_ocaml-lwt";
|
||||
|
||||
inherit (js_of_ocaml-compiler) version src useDune2;
|
||||
|
||||
buildInputs = [ js_of_ocaml-ppx ];
|
||||
|
||||
propagatedBuildInputs = [ js_of_ocaml ocaml_lwt lwt_log ];
|
||||
|
||||
meta = builtins.removeAttrs js_of_ocaml-compiler.meta [ "mainProgram" ];
|
||||
}
|
||||
26
pkgs/development/tools/ocaml/js_of_ocaml/ocamlbuild.nix
Normal file
26
pkgs/development/tools/ocaml/js_of_ocaml/ocamlbuild.nix
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
{ lib, buildDunePackage, fetchFromGitHub
|
||||
, ocamlbuild
|
||||
}:
|
||||
|
||||
buildDunePackage rec {
|
||||
pname = "js_of_ocaml-ocamlbuild";
|
||||
version = "4.0.0";
|
||||
|
||||
minimalOCamlVersion = "4.02";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "ocsigen";
|
||||
repo = pname;
|
||||
rev = "852302c8f35b946e2ec275c529a79e46d8749be6";
|
||||
sha256 = "sha256:03ayvakvbh4wi4dwcgd7r9y8ka8cv3d59hb81yk2dxyd94bln145";
|
||||
};
|
||||
|
||||
propagatedBuildInputs = [ ocamlbuild ];
|
||||
|
||||
meta = {
|
||||
description = "An ocamlbuild plugin to compile to JavaScript";
|
||||
license = lib.licenses.lgpl2Only;
|
||||
maintainers = [ lib.maintainers.vbgl ];
|
||||
inherit (src.meta) homepage;
|
||||
};
|
||||
}
|
||||
15
pkgs/development/tools/ocaml/js_of_ocaml/ppx.nix
Normal file
15
pkgs/development/tools/ocaml/js_of_ocaml/ppx.nix
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
{ buildDunePackage, js_of_ocaml-compiler
|
||||
, ppxlib
|
||||
, js_of_ocaml
|
||||
}:
|
||||
|
||||
buildDunePackage {
|
||||
pname = "js_of_ocaml-ppx";
|
||||
|
||||
inherit (js_of_ocaml-compiler) version src useDune2;
|
||||
|
||||
buildInputs = [ js_of_ocaml ];
|
||||
propagatedBuildInputs = [ ppxlib ];
|
||||
|
||||
meta = builtins.removeAttrs js_of_ocaml-compiler.meta [ "mainProgram" ];
|
||||
}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
{ buildDunePackage, js_of_ocaml-compiler
|
||||
, js_of_ocaml, ppxlib
|
||||
}:
|
||||
|
||||
buildDunePackage {
|
||||
pname = "js_of_ocaml-ppx_deriving_json";
|
||||
|
||||
inherit (js_of_ocaml-compiler) version src useDune2;
|
||||
|
||||
propagatedBuildInputs = [ js_of_ocaml ppxlib ];
|
||||
|
||||
meta = builtins.removeAttrs js_of_ocaml-compiler.meta [ "mainProgram" ];
|
||||
}
|
||||
16
pkgs/development/tools/ocaml/js_of_ocaml/tyxml.nix
Normal file
16
pkgs/development/tools/ocaml/js_of_ocaml/tyxml.nix
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
{ buildDunePackage, js_of_ocaml-compiler
|
||||
, js_of_ocaml-ppx
|
||||
, js_of_ocaml, reactivedata, tyxml
|
||||
}:
|
||||
|
||||
buildDunePackage {
|
||||
pname = "js_of_ocaml-tyxml";
|
||||
|
||||
inherit (js_of_ocaml-compiler) version src useDune2;
|
||||
|
||||
buildInputs = [ js_of_ocaml-ppx ];
|
||||
|
||||
propagatedBuildInputs = [ js_of_ocaml reactivedata tyxml ];
|
||||
|
||||
meta = builtins.removeAttrs js_of_ocaml-compiler.meta [ "mainProgram" ];
|
||||
}
|
||||
88
pkgs/development/tools/ocaml/merlin/4.x.nix
Normal file
88
pkgs/development/tools/ocaml/merlin/4.x.nix
Normal file
|
|
@ -0,0 +1,88 @@
|
|||
{ lib
|
||||
, substituteAll
|
||||
, fetchurl
|
||||
, ocaml
|
||||
, dune_2
|
||||
, buildDunePackage
|
||||
, yojson
|
||||
, csexp
|
||||
, result
|
||||
, dot-merlin-reader
|
||||
, jq
|
||||
, menhir
|
||||
, menhirLib
|
||||
, menhirSdk
|
||||
}:
|
||||
|
||||
let
|
||||
merlinVersion = "4.5";
|
||||
|
||||
hashes = {
|
||||
"4.5-411" = "sha256:05nz6y7r91rh0lj8b6xdv3s3yknmvjc7y60v17kszgqnr887bvpn";
|
||||
"4.5-412" = "sha256:0i5c3rfzinmwdjya7gv94zyknsm32qx9dlg472xpfqivwvnnhf1z";
|
||||
"4.5-413" = "sha256:1sphq9anfg1qzrvj7hdcqflj6cmc1qiyfkljhng9fxnnr0i7550s";
|
||||
"4.5-414" = "sha256:13h588kwih05zd9p3p7q528q4zc0d1l983kkvbmkxgay5d17nn1i";
|
||||
};
|
||||
|
||||
ocamlVersionShorthand = lib.concatStrings
|
||||
(lib.take 2 (lib.splitVersion ocaml.version));
|
||||
|
||||
version = "${merlinVersion}-${ocamlVersionShorthand}";
|
||||
in
|
||||
|
||||
if !lib.hasAttr version hashes
|
||||
then builtins.throw "merlin ${merlinVersion} is not available for OCaml ${ocaml.version}"
|
||||
else
|
||||
|
||||
buildDunePackage {
|
||||
pname = "merlin";
|
||||
inherit version;
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://github.com/ocaml/merlin/releases/download/v${version}/merlin-${version}.tbz";
|
||||
sha256 = hashes."${version}";
|
||||
};
|
||||
|
||||
patches = [
|
||||
(substituteAll {
|
||||
src = ./fix-paths.patch;
|
||||
dot_merlin_reader = "${dot-merlin-reader}/bin/dot-merlin-reader";
|
||||
dune = "${dune_2}/bin/dune";
|
||||
})
|
||||
] ++ lib.optional (lib.versionOlder ocaml.version "4.12")
|
||||
# This fixes the test-suite on macOS
|
||||
# See https://github.com/ocaml/merlin/pull/1399
|
||||
# Fixed in 4.4 for OCaml ≥ 4.12
|
||||
./test.patch
|
||||
;
|
||||
|
||||
strictDeps = true;
|
||||
|
||||
nativeBuildInputs = [
|
||||
menhir
|
||||
jq
|
||||
];
|
||||
buildInputs = [
|
||||
dot-merlin-reader
|
||||
yojson
|
||||
csexp
|
||||
result
|
||||
menhirSdk
|
||||
menhirLib
|
||||
];
|
||||
|
||||
doCheck = true;
|
||||
checkPhase = ''
|
||||
runHook preCheck
|
||||
patchShebangs tests/merlin-wrapper
|
||||
dune runtest # filtering with -p disables tests
|
||||
runHook postCheck
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "An editor-independent tool to ease the development of programs in OCaml";
|
||||
homepage = "https://github.com/ocaml/merlin";
|
||||
license = licenses.mit;
|
||||
maintainers = [ maintainers.vbgl maintainers.sternenseemann ];
|
||||
};
|
||||
}
|
||||
35
pkgs/development/tools/ocaml/merlin/default.nix
Normal file
35
pkgs/development/tools/ocaml/merlin/default.nix
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
{ lib, fetchurl, buildDunePackage, substituteAll
|
||||
, dot-merlin-reader, dune_2, yojson, csexp, result, menhirSdk }:
|
||||
|
||||
buildDunePackage rec {
|
||||
pname = "merlin";
|
||||
version = "3.4.2";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://github.com/ocaml/merlin/releases/download/v${version}/merlin-v${version}.tbz";
|
||||
sha256 = "e1b7b897b11119d92995c558530149fd07bd67a4aaf140f55f3c4ffb5e882a81";
|
||||
};
|
||||
|
||||
useDune2 = true;
|
||||
|
||||
minimumOCamlVersion = "4.02.3";
|
||||
|
||||
patches = [
|
||||
(substituteAll {
|
||||
src = ./fix-paths.patch;
|
||||
dot_merlin_reader = "${dot-merlin-reader}/bin/dot-merlin-reader";
|
||||
dune = "${dune_2}/bin/dune";
|
||||
})
|
||||
];
|
||||
|
||||
strictDeps = true;
|
||||
|
||||
buildInputs = [ dot-merlin-reader yojson csexp result menhirSdk ];
|
||||
|
||||
meta = with lib; {
|
||||
description = "An editor-independent tool to ease the development of programs in OCaml";
|
||||
homepage = "https://github.com/ocaml/merlin";
|
||||
license = licenses.mit;
|
||||
maintainers = [ maintainers.vbgl ];
|
||||
};
|
||||
}
|
||||
24
pkgs/development/tools/ocaml/merlin/dot-merlin-reader.nix
Normal file
24
pkgs/development/tools/ocaml/merlin/dot-merlin-reader.nix
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
{ lib, fetchurl, yojson, csexp, result, buildDunePackage }:
|
||||
|
||||
buildDunePackage rec {
|
||||
pname = "dot-merlin-reader";
|
||||
version = "4.1";
|
||||
|
||||
useDune2 = true;
|
||||
|
||||
minimumOCamlVersion = "4.06";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://github.com/ocaml/merlin/releases/download/v${version}/dot-merlin-reader-v${version}.tbz";
|
||||
sha256 = "14a36d6fb8646a5df4530420a7861722f1a4ee04753717947305e3676031e7cd";
|
||||
};
|
||||
|
||||
buildInputs = [ yojson csexp result ];
|
||||
|
||||
meta = with lib; {
|
||||
description = "Reads config files for merlin";
|
||||
homepage = "https://github.com/ocaml/merlin";
|
||||
license = licenses.mit;
|
||||
maintainers = [ maintainers.hongchangwu ];
|
||||
};
|
||||
}
|
||||
15
pkgs/development/tools/ocaml/merlin/fix-paths.patch
Normal file
15
pkgs/development/tools/ocaml/merlin/fix-paths.patch
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
--- a/src/kernel/mconfig_dot.ml
|
||||
+++ b/src/kernel/mconfig_dot.ml
|
||||
@@ -126,10 +126,10 @@ module Configurator = struct
|
||||
let prog, args =
|
||||
match cfg with
|
||||
| Dot_merlin ->
|
||||
- let prog = "dot-merlin-reader" in
|
||||
+ let prog = "@dot_merlin_reader@" in
|
||||
prog, [| prog |]
|
||||
| Dune ->
|
||||
- let prog = "dune" in
|
||||
+ let prog = "@dune@" in
|
||||
prog, [| prog; "ocaml-merlin"; "--no-print-directory" |]
|
||||
in
|
||||
log ~title:"get_config" "Using %s configuration provider." (to_string cfg);
|
||||
19
pkgs/development/tools/ocaml/merlin/test.patch
Normal file
19
pkgs/development/tools/ocaml/merlin/test.patch
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
commit 282eed37f39ff216add8d53766fd59f3737eb87f
|
||||
Author: Vincent Laporte <Vincent.Laporte@gmail.com>
|
||||
Date: Thu Nov 4 06:24:07 2021 +0100
|
||||
|
||||
Ignore dune stderr in tests
|
||||
|
||||
diff --git a/tests/test-dirs/document/src-documentation.t/run.t b/tests/test-dirs/document/src-documentation.t/run.t
|
||||
index 2c9e1419..4f4c4327 100644
|
||||
--- a/tests/test-dirs/document/src-documentation.t/run.t
|
||||
+++ b/tests/test-dirs/document/src-documentation.t/run.t
|
||||
@@ -42,7 +42,7 @@ documentation for the non-last defined value (in the same file) is show
|
||||
> jq '.value'
|
||||
" List reversal. "
|
||||
|
||||
- $ dune build --root=. ./doc.exe
|
||||
+ $ dune build --root=. ./doc.exe 2> /dev/null
|
||||
$ cat >.merlin <<EOF
|
||||
> B _build/default/.doc.eobjs/byte
|
||||
> S .
|
||||
49
pkgs/development/tools/ocaml/oasis/default.nix
Normal file
49
pkgs/development/tools/ocaml/oasis/default.nix
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
{ lib, stdenv, fetchurl, ocaml, findlib, ocamlbuild, ocamlmod, ocamlify }:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
version = "0.4.10";
|
||||
pname = "ocaml-oasis";
|
||||
|
||||
# You must manually update the url, not just the version. OCamlforge keys off
|
||||
# the number after download.php, not the filename.
|
||||
src = fetchurl {
|
||||
url = "https://forge.ocamlcore.org/frs/download.php/1694/oasis-0.4.10.tar.gz";
|
||||
sha256 = "13ah03pbcvrjv5lmx971hvkm9rvbvimska5wmjfvgvd20ca0gn8w";
|
||||
};
|
||||
|
||||
createFindlibDestdir = true;
|
||||
|
||||
strictDeps = true;
|
||||
|
||||
nativeBuildInputs =
|
||||
[
|
||||
ocaml findlib ocamlbuild ocamlmod ocamlify
|
||||
];
|
||||
|
||||
buildInputs = [ ocamlbuild ];
|
||||
|
||||
configurePhase = ''
|
||||
runHook preConfigure
|
||||
ocaml setup.ml -configure --prefix $out
|
||||
runHook postConfigure
|
||||
'';
|
||||
buildPhase = ''
|
||||
runHook preBuild
|
||||
ocaml setup.ml -build
|
||||
runHook postBuild
|
||||
'';
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
ocaml setup.ml -install
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "Configure, build and install system for OCaml projects";
|
||||
homepage = "http://oasis.forge.ocamlcore.org/";
|
||||
license = licenses.lgpl21;
|
||||
maintainers = with maintainers; [ vbgl maggesi ];
|
||||
mainProgram = "oasis";
|
||||
platforms = ocaml.meta.platforms or [];
|
||||
};
|
||||
}
|
||||
25
pkgs/development/tools/ocaml/obelisk/default.nix
Normal file
25
pkgs/development/tools/ocaml/obelisk/default.nix
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
{ lib, fetchFromGitHub, ocamlPackages, menhir }:
|
||||
|
||||
ocamlPackages.buildDunePackage rec {
|
||||
pname = "obelisk";
|
||||
version = "0.6.0";
|
||||
useDune2 = true;
|
||||
src = fetchFromGitHub {
|
||||
owner = "Lelio-Brun";
|
||||
repo = pname;
|
||||
rev = "v${version}";
|
||||
sha256 = "1jjaqa2b7msl9qd3x7j34vdh1s9alq8hbvzk8a5srb4yyfyim15b";
|
||||
};
|
||||
|
||||
strictDeps = true;
|
||||
|
||||
nativeBuildInputs = [ menhir ];
|
||||
buildInputs = with ocamlPackages; [ re ];
|
||||
|
||||
meta = {
|
||||
description = "A simple tool which produces pretty-printed output from a Menhir parser file (.mly)";
|
||||
license = lib.licenses.mit;
|
||||
maintainers = [ lib.maintainers.vbgl ];
|
||||
homepage = "https://github.com/Lelio-Brun/Obelisk";
|
||||
};
|
||||
}
|
||||
33
pkgs/development/tools/ocaml/obuild/default.nix
Normal file
33
pkgs/development/tools/ocaml/obuild/default.nix
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
{ lib, stdenv, fetchFromGitHub, ocaml }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "obuild";
|
||||
version = "0.1.10";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "ocaml-obuild";
|
||||
repo = "obuild";
|
||||
rev = "obuild-v${version}";
|
||||
sha256 = "sha256-dqWP9rwWmr7i3O29v/kipJL01B3qQozaToOFCdfTWZU=";
|
||||
};
|
||||
|
||||
buildInputs = [ ocaml ];
|
||||
|
||||
buildPhase = ''
|
||||
patchShebangs ./bootstrap
|
||||
./bootstrap
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/bin
|
||||
cp dist/build/obuild/obuild dist/build/obuild-from-oasis/obuild-from-oasis dist/build/obuild-simple/obuild-simple $out/bin/
|
||||
'';
|
||||
|
||||
meta = {
|
||||
homepage = "https://github.com/ocaml-obuild/obuild";
|
||||
platforms = ocaml.meta.platforms or [ ];
|
||||
description = "Simple package build system for OCaml";
|
||||
license = lib.licenses.lgpl21;
|
||||
maintainers = with lib.maintainers; [ volth ];
|
||||
};
|
||||
}
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
{ lib
|
||||
, fetchFromGitHub
|
||||
, buildDunePackage
|
||||
, fix
|
||||
, menhirLib
|
||||
, menhirSdk
|
||||
}:
|
||||
|
||||
buildDunePackage rec {
|
||||
pname = "ocaml-recovery-parser";
|
||||
version = "0.2.2";
|
||||
|
||||
minimalOCamlVersion = "4.08";
|
||||
useDune2 = true;
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "serokell";
|
||||
repo = pname;
|
||||
rev = version;
|
||||
sha256 = "qQHvAPNQBbsvlQRh19sz9BtfhhMOp3uPthVozc1fpw8=";
|
||||
};
|
||||
|
||||
propagatedBuildInputs = [
|
||||
fix
|
||||
menhirLib
|
||||
menhirSdk
|
||||
];
|
||||
|
||||
meta = with lib; {
|
||||
description = "A simple fork of OCaml parser with support for error recovery";
|
||||
homepage = "https://github.com/serokell/ocaml-recovery-parser";
|
||||
license = with licenses; [ lgpl2Only mit mpl20 ];
|
||||
maintainers = with maintainers; [ romildo ];
|
||||
mainProgram = "menhir-recover";
|
||||
};
|
||||
}
|
||||
29
pkgs/development/tools/ocaml/ocaml-top/default.nix
Normal file
29
pkgs/development/tools/ocaml/ocaml-top/default.nix
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
{ lib, fetchFromGitHub, ncurses, ocamlPackages }:
|
||||
|
||||
with ocamlPackages; buildDunePackage rec {
|
||||
pname = "ocaml-top";
|
||||
version = "1.2.0-rc";
|
||||
|
||||
useDune2 = true;
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "OCamlPro";
|
||||
repo = "ocaml-top";
|
||||
rev = version;
|
||||
sha256 = "sha256-ZXnPnPvJmHshkTwYWeBojrgJYAF/R6vUo0XkvVMFSeQ=";
|
||||
};
|
||||
|
||||
buildInputs = [ ncurses ocp-build lablgtk3-sourceview3 ocp-index ];
|
||||
|
||||
configurePhase = ''
|
||||
export TERM=xterm
|
||||
ocp-build -init
|
||||
'';
|
||||
|
||||
meta = {
|
||||
homepage = "https://www.typerex.org/ocaml-top.html";
|
||||
license = lib.licenses.gpl3;
|
||||
description = "A simple cross-platform OCaml code editor built for top-level evaluation";
|
||||
maintainers = with lib.maintainers; [ vbgl ];
|
||||
};
|
||||
}
|
||||
41
pkgs/development/tools/ocaml/ocamlbuild/default.nix
Normal file
41
pkgs/development/tools/ocaml/ocamlbuild/default.nix
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
{ lib, stdenv, fetchFromGitHub, ocaml, findlib }:
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "ocaml${ocaml.version}-ocamlbuild";
|
||||
version = "0.14.1";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "ocaml";
|
||||
repo = "ocamlbuild";
|
||||
rev = version;
|
||||
sha256 = "sha256-ZL0BwOCWTNDjNkrwNAmzHjHF1Rpg3CUuV4lSqcwDqgI=";
|
||||
};
|
||||
|
||||
createFindlibDestdir = true;
|
||||
|
||||
nativeBuildInputs = [ ocaml findlib ];
|
||||
strictDeps = true;
|
||||
|
||||
# x86_64-unknown-linux-musl-ld: -r and -pie may not be used together
|
||||
hardeningDisable = lib.optional stdenv.hostPlatform.isStatic "pie";
|
||||
|
||||
configurePhase = ''
|
||||
runHook preConfigure
|
||||
|
||||
make -f configure.make Makefile.config \
|
||||
"OCAMLBUILD_PREFIX=$out" \
|
||||
"OCAMLBUILD_BINDIR=$out/bin" \
|
||||
"OCAMLBUILD_MANDIR=$out/share/man" \
|
||||
"OCAMLBUILD_LIBDIR=$OCAMLFIND_DESTDIR"
|
||||
|
||||
runHook postConfigure
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "A build system with builtin rules to easily build most OCaml projects";
|
||||
homepage = "https://github.com/ocaml/ocamlbuild/";
|
||||
license = licenses.lgpl2;
|
||||
maintainers = with maintainers; [ vbgl ];
|
||||
mainProgram = "ocamlbuild";
|
||||
inherit (ocaml.meta) platforms;
|
||||
};
|
||||
}
|
||||
31
pkgs/development/tools/ocaml/ocamlformat/default.nix
Normal file
31
pkgs/development/tools/ocaml/ocamlformat/default.nix
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
{ lib, fetchurl, fetchzip, callPackage }:
|
||||
|
||||
let mkOCamlformat = callPackage ./generic.nix; in
|
||||
|
||||
# Older versions should be removed when their usage decrease
|
||||
# This script scraps Github looking for OCamlformat's options and versions usage:
|
||||
# https://gist.github.com/Julow/110dc94308d6078225e0665e3eccd433
|
||||
|
||||
rec {
|
||||
ocamlformat_0_19_0 = mkOCamlformat {
|
||||
version = "0.19.0";
|
||||
};
|
||||
|
||||
ocamlformat_0_20_0 = mkOCamlformat {
|
||||
version = "0.20.0";
|
||||
};
|
||||
|
||||
ocamlformat_0_20_1 = mkOCamlformat {
|
||||
version = "0.20.1";
|
||||
};
|
||||
|
||||
ocamlformat_0_21_0 = mkOCamlformat {
|
||||
version = "0.21.0";
|
||||
};
|
||||
|
||||
ocamlformat_0_22_4 = mkOCamlformat {
|
||||
version = "0.22.4";
|
||||
};
|
||||
|
||||
ocamlformat = ocamlformat_0_22_4;
|
||||
}
|
||||
64
pkgs/development/tools/ocaml/ocamlformat/generic.nix
Normal file
64
pkgs/development/tools/ocaml/ocamlformat/generic.nix
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
{ lib, fetchurl, fetchzip, ocaml-ng
|
||||
, version
|
||||
, tarballName ? "ocamlformat-${version}.tbz",
|
||||
}:
|
||||
|
||||
let src =
|
||||
fetchurl {
|
||||
url = "https://github.com/ocaml-ppx/ocamlformat/releases/download/${version}/${tarballName}";
|
||||
sha256 = {
|
||||
"0.19.0" = "0ihgwl7d489g938m1jvgx8azdgq9f5np5mzqwwya797hx2m4dz32";
|
||||
"0.20.0" = "sha256-JtmNCgwjbCyUE4bWqdH5Nc2YSit+rekwS43DcviIfgk=";
|
||||
"0.20.1" = "sha256-fTpRZFQW+ngoc0T6A69reEUAZ6GmHkeQvxspd5zRAjU=";
|
||||
"0.21.0" = "sha256-KhgX9rxYH/DM6fCqloe4l7AnJuKrdXSe6Y1XY3BXMy0=";
|
||||
"0.22.4" = "sha256-61TeK4GsfMLmjYGn3ICzkagbc3/Po++Wnqkb2tbJwGA=";
|
||||
}."${version}";
|
||||
};
|
||||
ocamlPackages = ocaml-ng.ocamlPackages;
|
||||
in
|
||||
|
||||
with ocamlPackages;
|
||||
|
||||
buildDunePackage {
|
||||
pname = "ocamlformat";
|
||||
inherit src version;
|
||||
|
||||
minimumOCamlVersion = "4.08";
|
||||
|
||||
useDune2 = true;
|
||||
|
||||
strictDeps = true;
|
||||
|
||||
nativeBuildInputs = [
|
||||
menhir
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
base
|
||||
dune-build-info
|
||||
fix
|
||||
fpath
|
||||
menhirLib
|
||||
menhirSdk
|
||||
ocp-indent
|
||||
re
|
||||
stdio
|
||||
uuseg
|
||||
uutf
|
||||
]
|
||||
++ lib.optionals (lib.versionAtLeast version "0.20.0") [ ocaml-version either ]
|
||||
++ (if lib.versionAtLeast version "0.20.1"
|
||||
then [ odoc-parser ]
|
||||
else [ (odoc-parser.override { version = "0.9.0"; }) ])
|
||||
++ (if lib.versionAtLeast version "0.21.0"
|
||||
then [ cmdliner_1_1 ]
|
||||
else [ cmdliner_1_0 ])
|
||||
++ lib.optionals (lib.versionAtLeast version "0.22.4") [ csexp ];
|
||||
|
||||
meta = {
|
||||
homepage = "https://github.com/ocaml-ppx/ocamlformat";
|
||||
description = "Auto-formatter for OCaml code";
|
||||
maintainers = [ lib.maintainers.Zimmi48 lib.maintainers.marsam ];
|
||||
license = lib.licenses.mit;
|
||||
};
|
||||
}
|
||||
36
pkgs/development/tools/ocaml/ocamlify/default.nix
Normal file
36
pkgs/development/tools/ocaml/ocamlify/default.nix
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
{ lib, stdenv, fetchurl, ocaml, findlib, ocamlbuild }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "ocamlify";
|
||||
version = "0.0.2";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://forge.ocamlcore.org/frs/download.php/1209/${pname}-${version}.tar.gz";
|
||||
sha256 = "1f0fghvlbfryf5h3j4as7vcqrgfjb4c8abl5y0y5h069vs4kp5ii";
|
||||
};
|
||||
|
||||
buildInputs = [ ocaml findlib ocamlbuild ];
|
||||
|
||||
configurePhase = ''
|
||||
substituteInPlace src/ocamlify.ml --replace 'OCamlifyConfig.version' '"0.0.2"'
|
||||
'';
|
||||
|
||||
buildPhase = "ocamlbuild src/ocamlify.native";
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/bin
|
||||
mv _build/src/ocamlify.native $out/bin/ocamlify
|
||||
'';
|
||||
|
||||
dontStrip = true;
|
||||
|
||||
meta = {
|
||||
homepage = "https://forge.ocamlcore.org/projects/ocamlmod/ocamlmod";
|
||||
description = "Generate OCaml modules from source files";
|
||||
platforms = ocaml.meta.platforms or [];
|
||||
license = lib.licenses.lgpl21;
|
||||
maintainers = with lib.maintainers; [
|
||||
maggesi
|
||||
];
|
||||
};
|
||||
}
|
||||
39
pkgs/development/tools/ocaml/ocamlmod/default.nix
Normal file
39
pkgs/development/tools/ocaml/ocamlmod/default.nix
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
{ lib, stdenv, fetchurl, ocaml, findlib, ocamlbuild, ounit }:
|
||||
|
||||
let
|
||||
# ounit is only available for OCaml >= 4.04
|
||||
doCheck = lib.versionAtLeast ocaml.version "4.04";
|
||||
in
|
||||
|
||||
stdenv.mkDerivation {
|
||||
pname = "ocamlmod";
|
||||
version = "0.0.9";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://forge.ocamlcore.org/frs/download.php/1702/ocamlmod-0.0.9.tar.gz";
|
||||
sha256 = "0cgp9qqrq7ayyhddrmqmq1affvfqcn722qiakjq4dkywvp67h4aa";
|
||||
};
|
||||
|
||||
buildInputs = [ ocaml findlib ocamlbuild ];
|
||||
|
||||
configurePhase = "ocaml setup.ml -configure --prefix $out"
|
||||
+ lib.optionalString doCheck " --enable-tests";
|
||||
buildPhase = "ocaml setup.ml -build";
|
||||
installPhase = "ocaml setup.ml -install";
|
||||
|
||||
inherit doCheck;
|
||||
checkInputs = [ ounit ];
|
||||
|
||||
checkPhase = "ocaml setup.ml -test";
|
||||
|
||||
dontStrip = true;
|
||||
|
||||
meta = {
|
||||
homepage = "https://forge.ocamlcore.org/projects/ocamlmod/ocamlmod";
|
||||
description = "Generate OCaml modules from source files";
|
||||
platforms = ocaml.meta.platforms or [];
|
||||
maintainers = with lib.maintainers; [
|
||||
maggesi
|
||||
];
|
||||
};
|
||||
}
|
||||
67
pkgs/development/tools/ocaml/ocamlscript/Makefile.patch
Normal file
67
pkgs/development/tools/ocaml/ocamlscript/Makefile.patch
Normal file
|
|
@ -0,0 +1,67 @@
|
|||
diff --git a/Makefile b/Makefile
|
||||
index 894e94d..9adc44b 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -17,7 +17,7 @@ ifndef BINDIR
|
||||
endif
|
||||
export BINDIR
|
||||
|
||||
-PACKS = unix str
|
||||
+PACKS = unix str findlib
|
||||
# PP = camlp4o -I . -parser pa_opt.cmo
|
||||
# export PP
|
||||
|
||||
diff --git a/main.ml b/main.ml
|
||||
index 288526a..b67c5e9 100644
|
||||
--- a/main.ml
|
||||
+++ b/main.ml
|
||||
@@ -247,6 +247,11 @@ let write_header ~pos ~source ~source_option ~verbose ~prog_file lines =
|
||||
Sys.getcwd ())
|
||||
| `File script_name -> "", get_dir script_name in
|
||||
|
||||
+ let findlibdir =
|
||||
+ Filename.(
|
||||
+ concat (Findlib.package_directory "findlib") parent_dir_name
|
||||
+ ) in
|
||||
+
|
||||
let file, oc = Filename.open_temp_file "meta" ".ml" in
|
||||
fprintf oc "\
|
||||
#%i %S;;
|
||||
@@ -255,6 +260,7 @@ let () =
|
||||
try Topdirs.dir_directory (Sys.getenv \"OCAML_TOPLEVEL_PATH\")
|
||||
with Not_found -> ()
|
||||
;;
|
||||
+#directory \"%s\";;
|
||||
#use \"topfind\";;
|
||||
#require \"ocamlscript\";;
|
||||
Ocamlscript.Common.verbose := %s;;
|
||||
@@ -263,7 +269,7 @@ Ocamlscript.Common.script_dir := %S;;
|
||||
open Ocamlscript;;
|
||||
open Utils;;
|
||||
#%i %S;;\n"
|
||||
- pos source verbose script_dir extra_args trash pos source;
|
||||
+ pos source findlibdir verbose script_dir extra_args trash pos source;
|
||||
|
||||
List.iter (output_line oc) lines;
|
||||
|
||||
@@ -550,6 +556,7 @@ let main () =
|
||||
exit compilation_status
|
||||
|
||||
let _ =
|
||||
+ Findlib.init ();
|
||||
try main ()
|
||||
with Failure s ->
|
||||
eprintf "ocamlscript: %s\n%!" s;
|
||||
diff --git a/ocaml.ml b/ocaml.ml
|
||||
index a1824c6..b8f287e 100644
|
||||
--- a/ocaml.ml
|
||||
+++ b/ocaml.ml
|
||||
@@ -14,7 +14,7 @@ let ocamlfind = ref "ocamlfind"
|
||||
let packs = ref [] (* findlib packages *)
|
||||
let sources = ref [] (* extra sources *)
|
||||
let use_ocamllex = ref false (* preprocess with ocamllex before camlp4 *)
|
||||
-let use_camlp4 = ref true (* by default camlp4 is used *)
|
||||
+let use_camlp4 = ref false (* by default camlp4 is not used *)
|
||||
let use_ocamlc = ref false (* by default we want native code *)
|
||||
let use_ocamlfind = ref false (* used only if necessary *)
|
||||
let revised = ref false (* use this to use the revised syntax *)
|
||||
34
pkgs/development/tools/ocaml/ocamlscript/default.nix
Normal file
34
pkgs/development/tools/ocaml/ocamlscript/default.nix
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
{ lib, stdenv, fetchFromGitHub, ocaml, findlib }:
|
||||
|
||||
lib.throwIfNot (lib.versionAtLeast ocaml.version "4.08")
|
||||
"ocamlscript is not available for OCaml ${ocaml.version}"
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "ocaml${ocaml.version}-ocamlscript";
|
||||
version = "3.0.0";
|
||||
src = fetchFromGitHub {
|
||||
owner = "mjambon";
|
||||
repo = "ocamlscript";
|
||||
rev = "v${version}";
|
||||
sha256 = "sha256:10xz8jknlmcgnf233nahd04q98ijnxpijhpvb8hl7sv94dgkvpql";
|
||||
};
|
||||
|
||||
propagatedBuildInputs = [ ocaml findlib ];
|
||||
|
||||
patches = [ ./Makefile.patch ];
|
||||
|
||||
buildFlags = [ "PREFIX=$(out)" ];
|
||||
installFlags = [ "PREFIX=$(out)" ];
|
||||
|
||||
preInstall = "mkdir -p $out/bin";
|
||||
createFindlibDestdir = true;
|
||||
|
||||
meta = with lib; {
|
||||
inherit (src.meta) homepage;
|
||||
license = licenses.boost;
|
||||
inherit (ocaml.meta) platforms;
|
||||
description = "Natively-compiled OCaml scripts";
|
||||
maintainers = [ maintainers.vbgl ];
|
||||
mainProgram = "ocamlscript";
|
||||
};
|
||||
}
|
||||
41
pkgs/development/tools/ocaml/ocp-build/default.nix
Normal file
41
pkgs/development/tools/ocaml/ocp-build/default.nix
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
{ lib, stdenv, fetchFromGitHub, fetchpatch, ocaml, findlib, ncurses, cmdliner, re }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "ocaml${ocaml.version}-ocp-build";
|
||||
version = "1.99.21";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "OCamlPro";
|
||||
repo = "ocp-build";
|
||||
rev = "v${version}";
|
||||
sha256 = "1641xzik98c7xnjwxpacijd6d9jzx340fmdn6i372z8h554jjlg9";
|
||||
};
|
||||
|
||||
patches = [
|
||||
# Fix compilation with OCaml 4.12
|
||||
(fetchpatch {
|
||||
url = "https://github.com/OCamlPro/ocp-build/commit/104e4656ca6dba9edb03b62539c9f1e10abcaae8.patch";
|
||||
sha256 = "0sbyi4acig9q8x1ky4hckfg5pm2nad6zasi51ravaf1spgl148c2";
|
||||
})
|
||||
];
|
||||
|
||||
buildInputs = [ ocaml findlib cmdliner re ];
|
||||
propagatedBuildInputs = [ ncurses ];
|
||||
preInstall = "mkdir -p $out/bin";
|
||||
|
||||
meta = with lib; {
|
||||
description = "A build tool for OCaml";
|
||||
longDescription = ''
|
||||
ocp-build is a build system for OCaml application, based on simple
|
||||
descriptions of packages. ocp-build combines the descriptions of
|
||||
packages, and optimize the parallel compilation of files depending on
|
||||
the number of cores and the automatically-inferred dependencies
|
||||
between source files.
|
||||
'';
|
||||
homepage = "https://www.typerex.org/ocp-build.html";
|
||||
license = licenses.gpl3;
|
||||
maintainers = [ maintainers.jirkamarsik ];
|
||||
mainProgram = "ocp-build";
|
||||
inherit (ocaml.meta) platforms;
|
||||
};
|
||||
}
|
||||
26
pkgs/development/tools/ocaml/ocp-indent/default.nix
Normal file
26
pkgs/development/tools/ocaml/ocp-indent/default.nix
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
{ lib, fetchFromGitHub, buildDunePackage, cmdliner }:
|
||||
|
||||
buildDunePackage rec {
|
||||
version = "1.8.2";
|
||||
pname = "ocp-indent";
|
||||
|
||||
useDune2 = true;
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "OCamlPro";
|
||||
repo = "ocp-indent";
|
||||
rev = version;
|
||||
sha256 = "sha256-IyvURw/6R0eKrnahV1fqLV0iIeypykrmxDbliECgbLc=";
|
||||
};
|
||||
|
||||
minimumOCamlVersion = "4.02";
|
||||
|
||||
buildInputs = [ cmdliner ];
|
||||
|
||||
meta = with lib; {
|
||||
homepage = "http://typerex.ocamlpro.com/ocp-indent.html";
|
||||
description = "A customizable tool to indent OCaml code";
|
||||
license = licenses.gpl3;
|
||||
maintainers = [ maintainers.jirkamarsik ];
|
||||
};
|
||||
}
|
||||
30
pkgs/development/tools/ocaml/ocp-index/default.nix
Normal file
30
pkgs/development/tools/ocaml/ocp-index/default.nix
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
{ lib, fetchFromGitHub, buildDunePackage, cppo, ocp-indent, cmdliner, re }:
|
||||
|
||||
buildDunePackage rec {
|
||||
pname = "ocp-index";
|
||||
version = "1.3.1";
|
||||
|
||||
useDune2 = true;
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "OCamlPro";
|
||||
repo = "ocp-index";
|
||||
rev = version;
|
||||
sha256 = "120w72fqymjp6ibicbp31jyx9yv34mdvgkr0zdfpzvfb7lgd8rc7";
|
||||
};
|
||||
|
||||
strictDeps = true;
|
||||
|
||||
nativeBuildInputs = [ cppo ];
|
||||
buildInputs = [ cmdliner re ];
|
||||
|
||||
propagatedBuildInputs = [ ocp-indent ];
|
||||
|
||||
meta = {
|
||||
homepage = "https://www.typerex.org/ocp-index.html";
|
||||
description = "A simple and light-weight documentation extractor for OCaml";
|
||||
changelog = "https://github.com/OCamlPro/ocp-index/raw/${version}/CHANGES.md";
|
||||
license = lib.licenses.lgpl3;
|
||||
maintainers = with lib.maintainers; [ vbgl ];
|
||||
};
|
||||
}
|
||||
30
pkgs/development/tools/ocaml/ocsigen-i18n/default.nix
Normal file
30
pkgs/development/tools/ocaml/ocsigen-i18n/default.nix
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
{ lib, stdenv, fetchFromGitHub, ocamlPackages }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "ocsigen-i18n";
|
||||
version = "3.7.0";
|
||||
|
||||
buildInputs = with ocamlPackages; [ ocaml findlib ppx_tools ];
|
||||
|
||||
dontStrip = true;
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/bin
|
||||
make bindir=$out/bin install
|
||||
'';
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "besport";
|
||||
repo = "ocsigen-i18n";
|
||||
rev = version;
|
||||
sha256 = "sha256-PmdDyn+MUcNFrZpP/KLGQzdXUFRr+dYRAZjTZxHSeaw=";
|
||||
};
|
||||
|
||||
meta = {
|
||||
homepage = "https://github.com/besport/ocsigen-i18n";
|
||||
description = "I18n made easy for web sites written with eliom";
|
||||
license = lib.licenses.lgpl21;
|
||||
maintainers = [ lib.maintainers.gal_bolle ];
|
||||
};
|
||||
|
||||
}
|
||||
44
pkgs/development/tools/ocaml/omake/0.9.8.6-rc1.nix
Normal file
44
pkgs/development/tools/ocaml/omake/0.9.8.6-rc1.nix
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
{lib, stdenv, fetchurl, makeWrapper, ocaml, ncurses}:
|
||||
let
|
||||
pname = "omake";
|
||||
version = "0.9.8.6-0.rc1";
|
||||
webpage = "http://omake.metaprl.org";
|
||||
in
|
||||
|
||||
if lib.versionAtLeast ocaml.version "4.06"
|
||||
then throw "${pname}-${version} is not available for OCaml ${ocaml.version}"
|
||||
else
|
||||
|
||||
stdenv.mkDerivation {
|
||||
|
||||
name = "${pname}-${version}";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://src.fedoraproject.org/repo/pkgs/ocaml-omake/${pname}-${version}.tar.gz/fe39a476ef4e33b7ba2ca77a6bcaded2/${pname}-${version}.tar.gz";
|
||||
sha256 = "1sas02pbj56m7wi5vf3vqrrpr4ynxymw2a8ybvfj2dkjf7q9ii13";
|
||||
};
|
||||
patchFlags = [ "-p0" ];
|
||||
patches = [ ./warn.patch ];
|
||||
|
||||
nativeBuildInputs = [ makeWrapper ];
|
||||
buildInputs = [ ocaml ncurses ];
|
||||
|
||||
dontInstall = true;
|
||||
buildPhase = ''
|
||||
make bootstrap
|
||||
make PREFIX=$out all
|
||||
make PREFIX=$out install
|
||||
'';
|
||||
# prefixKey = "-prefix ";
|
||||
#
|
||||
# configureFlags = if transitional then "--transitional" else "--strict";
|
||||
#
|
||||
# buildFlags = [ "world.opt" ];
|
||||
|
||||
meta = {
|
||||
description = "Omake build system";
|
||||
homepage = webpage;
|
||||
license = "GPL";
|
||||
platforms = ocaml.meta.platforms or [];
|
||||
};
|
||||
}
|
||||
24
pkgs/development/tools/ocaml/omake/default.nix
Normal file
24
pkgs/development/tools/ocaml/omake/default.nix
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
{ lib, stdenv, fetchurl, ocaml, ncurses }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
|
||||
pname = "omake";
|
||||
version = "0.10.3";
|
||||
|
||||
src = fetchurl {
|
||||
url = "http://download.camlcity.org/download/${pname}-${version}.tar.gz";
|
||||
sha256 = "07bdg1h5i7qnlv9xq81ad5hfypl10hxm771h4rjyl5cn8plhfcgz";
|
||||
};
|
||||
|
||||
buildInputs = [ ocaml ncurses ];
|
||||
|
||||
meta = {
|
||||
description = "A build system designed for scalability and portability";
|
||||
homepage = "http://projects.camlcity.org/projects/omake.html";
|
||||
license = with lib.licenses; [
|
||||
mit /* scripts */
|
||||
gpl2 /* program */
|
||||
];
|
||||
inherit (ocaml.meta) platforms;
|
||||
};
|
||||
}
|
||||
10
pkgs/development/tools/ocaml/omake/warn.patch
Normal file
10
pkgs/development/tools/ocaml/omake/warn.patch
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
diff -p1 -aur ../omake-0.9.8.6.ori/lib/build/OCaml.om ./lib/build/OCaml.om
|
||||
--- ../omake-0.9.8.6.ori/lib/build/OCaml.om 2008-03-05 01:07:25.000000000 +0000
|
||||
+++ ./lib/build/OCaml.om 2013-06-01 15:52:37.000000000 +0000
|
||||
@@ -178,3 +178,3 @@ declare OCAMLDEPFLAGS
|
||||
public.OCAMLPPFLAGS =
|
||||
-public.OCAMLFLAGS = -warn-error A
|
||||
+public.OCAMLFLAGS =
|
||||
public.OCAMLCFLAGS = -g
|
||||
Seulement dans ./lib/build: OCaml.om~
|
||||
Seulement dans .: warn.patch
|
||||
28
pkgs/development/tools/ocaml/opaline/default.nix
Normal file
28
pkgs/development/tools/ocaml/opaline/default.nix
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
{ lib, stdenv, fetchFromGitHub, ocamlPackages }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
version = "0.3.3";
|
||||
pname = "opaline";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "jaapb";
|
||||
repo = "opaline";
|
||||
rev = "v${version}";
|
||||
sha256 = "sha256-6htaiFIcRMUYWn0U7zTNfCyDaTgDEvPch2q57qzvND4=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = with ocamlPackages; [ ocaml findlib ocamlbuild ];
|
||||
buildInputs = with ocamlPackages; [ opam-file-format ];
|
||||
|
||||
preInstall = "mkdir -p $out/bin";
|
||||
|
||||
installFlags = [ "PREFIX=$(out)" ];
|
||||
|
||||
meta = {
|
||||
description = "OPAm Light INstaller Engine";
|
||||
license = lib.licenses.mit;
|
||||
maintainers = [ lib.maintainers.vbgl ];
|
||||
inherit (src.meta) homepage;
|
||||
inherit (ocamlPackages.ocaml.meta) platforms;
|
||||
};
|
||||
}
|
||||
93
pkgs/development/tools/ocaml/opam/1.2.2.nix
Normal file
93
pkgs/development/tools/ocaml/opam/1.2.2.nix
Normal file
|
|
@ -0,0 +1,93 @@
|
|||
{ stdenv, lib, fetchurl, makeWrapper,
|
||||
ocaml, unzip, ncurses, curl, aspcud
|
||||
}:
|
||||
|
||||
assert lib.versionAtLeast ocaml.version "3.12.1";
|
||||
|
||||
let
|
||||
srcs = {
|
||||
cudf = fetchurl {
|
||||
url = "https://gforge.inria.fr/frs/download.php/file/33593/cudf-0.7.tar.gz";
|
||||
sha256 = "92c8a9ed730bbac73f3513abab41127d966c9b9202ab2aaffcd02358c030a701";
|
||||
};
|
||||
extlib = fetchurl {
|
||||
url = "http://ocaml-extlib.googlecode.com/files/extlib-1.5.3.tar.gz";
|
||||
sha256 = "c095eef4202a8614ff1474d4c08c50c32d6ca82d1015387785cf03d5913ec021";
|
||||
};
|
||||
ocaml_re = fetchurl {
|
||||
url = "https://github.com/ocaml/ocaml-re/archive/ocaml-re-1.2.0.tar.gz";
|
||||
sha256 = "a34dd9d6136731436a963bbab5c4bbb16e5d4e21b3b851d34887a3dec451999f";
|
||||
};
|
||||
ocamlgraph = fetchurl {
|
||||
url = "http://ocamlgraph.lri.fr/download/ocamlgraph-1.8.5.tar.gz";
|
||||
sha256 = "d167466435a155c779d5ec25b2db83ad851feb42ebc37dca8ffa345ddaefb82f";
|
||||
};
|
||||
dose3 = fetchurl {
|
||||
url = "https://gforge.inria.fr/frs/download.php/file/34277/dose3-3.3.tar.gz";
|
||||
sha256 = "8dc4dae9b1a81bb3a42abb283df785ba3eb00ade29b13875821c69f03e00680e";
|
||||
};
|
||||
cmdliner = fetchurl {
|
||||
url = "https://erratique.ch/software/cmdliner/releases/cmdliner-0.9.7.tbz";
|
||||
sha256 = "9c19893cffb5d3c3469ee0cce85e3eeeba17d309b33b9ace31aba06f68f0bf7a";
|
||||
};
|
||||
uutf = fetchurl {
|
||||
url = "https://erratique.ch/software/uutf/releases/uutf-0.9.3.tbz";
|
||||
sha256 = "1f364f89b1179e5182a4d3ad8975f57389d45548735d19054845e06a27107877";
|
||||
};
|
||||
jsonm = fetchurl {
|
||||
url = "https://erratique.ch/software/jsonm/releases/jsonm-0.9.1.tbz";
|
||||
sha256 = "3fd4dca045d82332da847e65e981d8b504883571d299a3f7e71447d46bc65f73";
|
||||
};
|
||||
opam = fetchurl {
|
||||
url = "https://github.com/ocaml/opam/archive/1.2.2.zip";
|
||||
sha256 = "c590ce55ae69ec74f46215cf16a156a02b23c5f3ecb22f23a3ad9ba3d91ddb6e";
|
||||
};
|
||||
};
|
||||
in stdenv.mkDerivation {
|
||||
pname = "opam";
|
||||
version = "1.2.2";
|
||||
|
||||
nativeBuildInputs = [ makeWrapper unzip ];
|
||||
buildInputs = [ curl ncurses ocaml ];
|
||||
|
||||
src = srcs.opam;
|
||||
|
||||
postUnpack = ''
|
||||
ln -sv ${srcs.cudf} $sourceRoot/src_ext/${srcs.cudf.name}
|
||||
ln -sv ${srcs.extlib} $sourceRoot/src_ext/${srcs.extlib.name}
|
||||
ln -sv ${srcs.ocaml_re} $sourceRoot/src_ext/${srcs.ocaml_re.name}
|
||||
ln -sv ${srcs.ocamlgraph} $sourceRoot/src_ext/${srcs.ocamlgraph.name}
|
||||
ln -sv ${srcs.dose3} $sourceRoot/src_ext/${srcs.dose3.name}
|
||||
ln -sv ${srcs.cmdliner} $sourceRoot/src_ext/${srcs.cmdliner.name}
|
||||
ln -sv ${srcs.uutf} $sourceRoot/src_ext/${srcs.uutf.name}
|
||||
ln -sv ${srcs.jsonm} $sourceRoot/src_ext/${srcs.jsonm.name}
|
||||
'';
|
||||
|
||||
preConfigure = ''
|
||||
substituteInPlace ./src_ext/Makefile --replace "%.stamp: %.download" "%.stamp:"
|
||||
'';
|
||||
|
||||
postConfigure = "make lib-ext";
|
||||
|
||||
# Dirty, but apparently ocp-build requires a TERM
|
||||
makeFlags = ["TERM=screen"];
|
||||
|
||||
# change argv0 to "opam" as a workaround for
|
||||
# https://github.com/ocaml/opam/issues/2142
|
||||
postInstall = ''
|
||||
mv $out/bin/opam $out/bin/.opam-wrapped
|
||||
makeWrapper $out/bin/.opam-wrapped $out/bin/opam \
|
||||
--argv0 "opam" \
|
||||
--suffix PATH : ${aspcud}/bin:${unzip}/bin:${curl}/bin
|
||||
'';
|
||||
|
||||
doCheck = false;
|
||||
|
||||
meta = with lib; {
|
||||
description = "A package manager for OCaml";
|
||||
homepage = "http://opam.ocamlpro.com/";
|
||||
maintainers = [ maintainers.henrytill ];
|
||||
platforms = platforms.all;
|
||||
license = licenses.lgpl21Plus;
|
||||
};
|
||||
}
|
||||
136
pkgs/development/tools/ocaml/opam/default.nix
Normal file
136
pkgs/development/tools/ocaml/opam/default.nix
Normal file
|
|
@ -0,0 +1,136 @@
|
|||
{ stdenv, lib, fetchurl, makeWrapper, getconf,
|
||||
ocaml, unzip, ncurses, curl, aspcud, bubblewrap
|
||||
}:
|
||||
|
||||
assert lib.versionAtLeast ocaml.version "4.02.3";
|
||||
|
||||
let
|
||||
srcs = {
|
||||
"0install-solver" = fetchurl {
|
||||
url = "https://github.com/0install/0install/releases/download/v2.17/0install-v2.17.tbz";
|
||||
sha256 = "08q95mzmf9pyyqs68ff52422f834hi313cxmypwrxmxsabcfa10p";
|
||||
};
|
||||
"cmdliner" = fetchurl {
|
||||
url = "http://erratique.ch/software/cmdliner/releases/cmdliner-1.0.4.tbz";
|
||||
sha256 = "1h04q0zkasd0mw64ggh4y58lgzkhg6yhzy60lab8k8zq9ba96ajw";
|
||||
};
|
||||
"cppo" = fetchurl {
|
||||
url = "https://github.com/ocaml-community/cppo/releases/download/v1.6.7/cppo-v1.6.7.tbz";
|
||||
sha256 = "17ajdzrnmnyfig3s6hinb56mcmhywbssxhsq32dz0v90dhz3wmfv";
|
||||
};
|
||||
"cudf" = fetchurl {
|
||||
url = "https://github.com/ocaml/opam-source-archives/raw/main/cudf-0.9.tar.gz";
|
||||
sha256 = "0771lwljqwwn3cryl0plny5a5dyyrj4z6bw66ha5n8yfbpcy8clr";
|
||||
};
|
||||
"dose3" = fetchurl {
|
||||
url = "https://gitlab.com/irill/dose3/-/archive/5.0.1/dose3-5.0.1.tar.gz";
|
||||
sha256 = "1mh6fv8qbf8xx4h2dc0dpv2lzygvikzjhw1idrknibbwsjw3jg9c";
|
||||
};
|
||||
"dune-local" = fetchurl {
|
||||
url = "https://github.com/ocaml/dune/releases/download/2.9.0/dune-2.9.0.tbz";
|
||||
sha256 = "07m476kgagpd6kzm3jq30yfxqspr2hychah0xfqs14z82zxpq8dv";
|
||||
};
|
||||
"extlib" = fetchurl {
|
||||
url = "https://ygrek.org/p/release/ocaml-extlib/extlib-1.7.7.tar.gz";
|
||||
sha256 = "1sxmzc1mx3kg62j8kbk0dxkx8mkf1rn70h542cjzrziflznap0s1";
|
||||
};
|
||||
"mccs" = fetchurl {
|
||||
url = "https://github.com/AltGr/ocaml-mccs/archive/1.1+13.tar.gz";
|
||||
sha256 = "05nnji9h8mss3hzjr5faid2v3xfr7rcv2ywmpcxxp28y6h2kv9gv";
|
||||
};
|
||||
"ocamlgraph" = fetchurl {
|
||||
url = "https://github.com/backtracking/ocamlgraph/releases/download/2.0.0/ocamlgraph-2.0.0.tbz";
|
||||
sha256 = "029692bvdz3hxpva9a2jg5w5381fkcw55ysdi8424lyyjxvjdzi0";
|
||||
};
|
||||
"opam-0install-cudf" = fetchurl {
|
||||
url = "https://github.com/ocaml-opam/opam-0install-solver/releases/download/v0.4.2/opam-0install-cudf-v0.4.2.tbz";
|
||||
sha256 = "10wma4hh9l8hk49rl8nql6ixsvlz3163gcxspay5fwrpbg51fmxr";
|
||||
};
|
||||
"opam-file-format" = fetchurl {
|
||||
url = "https://github.com/ocaml/opam-file-format/archive/2.1.3.tar.gz";
|
||||
sha256 = "1bqyrlsvmjf4gqzmzbiyja9m1ph30ic9i18x23p5ziymyylw2sfg";
|
||||
};
|
||||
"re" = fetchurl {
|
||||
url = "https://github.com/ocaml/ocaml-re/releases/download/1.9.0/re-1.9.0.tbz";
|
||||
sha256 = "1gas4ky49zgxph3870nffzkr6y41kkpqp4nj38pz1gh49zcf12aj";
|
||||
};
|
||||
"result" = fetchurl {
|
||||
url = "https://github.com/janestreet/result/releases/download/1.5/result-1.5.tbz";
|
||||
sha256 = "0cpfp35fdwnv3p30a06wd0py3805qxmq3jmcynjc3x2qhlimwfkw";
|
||||
};
|
||||
"seq" = fetchurl {
|
||||
url = "https://github.com/c-cube/seq/archive/0.2.2.tar.gz";
|
||||
sha256 = "1ck15v3pg8bacdg6d6iyp2jc3kgrzxk5jsgzx3287x2ycb897j53";
|
||||
};
|
||||
"stdlib-shims" = fetchurl {
|
||||
url = "https://github.com/ocaml/stdlib-shims/releases/download/0.3.0/stdlib-shims-0.3.0.tbz";
|
||||
sha256 = "0jnqsv6pqp5b5g7lcjwgd75zqqvcwcl5a32zi03zg1kvj79p5gxs";
|
||||
};
|
||||
opam = fetchurl {
|
||||
url = "https://github.com/ocaml/opam/archive/2.1.2.zip";
|
||||
sha256 = "0yq3dgx869016xrf65xv0glmqill1nk2ad12x3l36l70pn90rmyd";
|
||||
};
|
||||
};
|
||||
in stdenv.mkDerivation {
|
||||
pname = "opam";
|
||||
version = "2.1.2";
|
||||
|
||||
nativeBuildInputs = [ makeWrapper unzip ];
|
||||
buildInputs = [ curl ncurses ocaml getconf ] ++ lib.optional stdenv.isLinux bubblewrap;
|
||||
|
||||
src = srcs.opam;
|
||||
|
||||
postUnpack = ''
|
||||
ln -sv ${srcs."0install-solver"} $sourceRoot/src_ext/0install-solver.tbz
|
||||
ln -sv ${srcs."cmdliner"} $sourceRoot/src_ext/cmdliner.tbz
|
||||
ln -sv ${srcs."cppo"} $sourceRoot/src_ext/cppo.tbz
|
||||
ln -sv ${srcs."cudf"} $sourceRoot/src_ext/cudf.tar.gz
|
||||
ln -sv ${srcs."dose3"} $sourceRoot/src_ext/dose3.tar.gz
|
||||
ln -sv ${srcs."dune-local"} $sourceRoot/src_ext/dune-local.tbz
|
||||
ln -sv ${srcs."extlib"} $sourceRoot/src_ext/extlib.tar.gz
|
||||
ln -sv ${srcs."mccs"} $sourceRoot/src_ext/mccs.tar.gz
|
||||
ln -sv ${srcs."ocamlgraph"} $sourceRoot/src_ext/ocamlgraph.tbz
|
||||
ln -sv ${srcs."opam-0install-cudf"} $sourceRoot/src_ext/opam-0install-cudf.tbz
|
||||
ln -sv ${srcs."opam-file-format"} $sourceRoot/src_ext/opam-file-format.tar.gz
|
||||
ln -sv ${srcs."re"} $sourceRoot/src_ext/re.tbz
|
||||
ln -sv ${srcs."result"} $sourceRoot/src_ext/result.tbz
|
||||
ln -sv ${srcs."seq"} $sourceRoot/src_ext/seq.tar.gz
|
||||
ln -sv ${srcs."stdlib-shims"} $sourceRoot/src_ext/stdlib-shims.tbz
|
||||
'';
|
||||
|
||||
patches = [ ./opam-shebangs.patch ];
|
||||
|
||||
preConfigure = ''
|
||||
substituteInPlace ./src_ext/Makefile --replace "%.stamp: %.download" "%.stamp:"
|
||||
patchShebangs src/state/shellscripts
|
||||
'';
|
||||
|
||||
postConfigure = "make lib-ext";
|
||||
|
||||
# Dirty, but apparently ocp-build requires a TERM
|
||||
makeFlags = ["TERM=screen"];
|
||||
|
||||
outputs = [ "out" "installer" ];
|
||||
setOutputFlags = false;
|
||||
|
||||
# change argv0 to "opam" as a workaround for
|
||||
# https://github.com/ocaml/opam/issues/2142
|
||||
postInstall = ''
|
||||
mv $out/bin/opam $out/bin/.opam-wrapped
|
||||
makeWrapper $out/bin/.opam-wrapped $out/bin/opam \
|
||||
--argv0 "opam" \
|
||||
--suffix PATH : ${aspcud}/bin:${unzip}/bin:${curl}/bin:${lib.optionalString stdenv.isLinux "${bubblewrap}/bin:"}${getconf}/bin \
|
||||
--set OPAM_USER_PATH_RO /run/current-system/sw/bin:/nix/
|
||||
$out/bin/opam-installer --prefix=$installer opam-installer.install
|
||||
'';
|
||||
|
||||
doCheck = false;
|
||||
|
||||
meta = with lib; {
|
||||
description = "A package manager for OCaml";
|
||||
homepage = "https://opam.ocaml.org/";
|
||||
maintainers = [ maintainers.henrytill maintainers.marsam ];
|
||||
platforms = platforms.all;
|
||||
};
|
||||
}
|
||||
# Generated by: ./opam.nix.pl -v 2.1.2 -p opam-shebangs.patch
|
||||
17
pkgs/development/tools/ocaml/opam/installer.nix
Normal file
17
pkgs/development/tools/ocaml/opam/installer.nix
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
{ lib, unzip, opam, ocamlPackages }:
|
||||
|
||||
ocamlPackages.buildDunePackage {
|
||||
pname = "opam-installer";
|
||||
|
||||
useDune2 = true;
|
||||
|
||||
inherit (opam) version src;
|
||||
nativeBuildInputs = [ unzip ];
|
||||
|
||||
configureFlags = [ "--disable-checks" "--prefix=$out" ];
|
||||
buildInputs = with ocamlPackages; [ opam-format cmdliner ];
|
||||
|
||||
meta = opam.meta // {
|
||||
description = "Handle (un)installation from opam install files";
|
||||
};
|
||||
}
|
||||
131
pkgs/development/tools/ocaml/opam/opam-shebangs.patch
Normal file
131
pkgs/development/tools/ocaml/opam/opam-shebangs.patch
Normal file
|
|
@ -0,0 +1,131 @@
|
|||
diff --git a/src/client/opamInitDefaults.ml b/src/client/opamInitDefaults.ml
|
||||
index eca13a7c..1fd66f43 100644
|
||||
--- a/src/client/opamInitDefaults.ml
|
||||
+++ b/src/client/opamInitDefaults.ml
|
||||
@@ -35,14 +35,18 @@ let eval_variables = [
|
||||
let os_filter os =
|
||||
FOp (FIdent ([], OpamVariable.of_string "os", None), `Eq, FString os)
|
||||
|
||||
+let os_distribution_filter distro =
|
||||
+ FOp (FIdent ([], OpamVariable.of_string "os-distribution", None), `Eq, FString distro)
|
||||
+
|
||||
let linux_filter = os_filter "linux"
|
||||
let macos_filter = os_filter "macos"
|
||||
let openbsd_filter = os_filter "openbsd"
|
||||
let freebsd_filter = os_filter "freebsd"
|
||||
let not_open_free_bsd_filter =
|
||||
FNot (FOr (openbsd_filter, freebsd_filter))
|
||||
let win32_filter = os_filter "win32"
|
||||
let sandbox_filter = FOr (linux_filter, macos_filter)
|
||||
+let nixos_filter = os_distribution_filter "nixos"
|
||||
|
||||
let gpatch_filter = FOr (openbsd_filter, freebsd_filter)
|
||||
let patch_filter = FNot gpatch_filter
|
||||
@@ -50,6 +54,11 @@ let wrappers ~sandboxing () =
|
||||
CString t, None;
|
||||
] in
|
||||
let w = OpamFile.Wrappers.empty in
|
||||
+ let w = { w with
|
||||
+ OpamFile.Wrappers.
|
||||
+ pre_build = [[CString "%{hooks}%/shebangs.sh", None], Some nixos_filter];
|
||||
+ }
|
||||
+ in
|
||||
if sandboxing then
|
||||
{ w with
|
||||
OpamFile.Wrappers.
|
||||
@@ -113,6 +122,7 @@ let required_tools ~sandboxing () =
|
||||
let init_scripts () = [
|
||||
("sandbox.sh", OpamScript.bwrap), Some bwrap_filter;
|
||||
("sandbox.sh", OpamScript.sandbox_exec), Some macos_filter;
|
||||
+ ("shebangs.sh", OpamScript.patch_shebangs), Some nixos_filter;
|
||||
]
|
||||
|
||||
module I = OpamFile.InitConfig
|
||||
diff --git a/src/state/opamScript.mli b/src/state/opamScript.mli
|
||||
index 03449970..83de0b53 100644
|
||||
--- a/src/state/opamScript.mli
|
||||
+++ b/src/state/opamScript.mli
|
||||
@@ -20,3 +20,4 @@ val env_hook : string
|
||||
val env_hook_zsh : string
|
||||
val env_hook_csh : string
|
||||
val env_hook_fish : string
|
||||
+val patch_shebangs : string
|
||||
diff --git a/src/state/shellscripts/patch_shebangs.sh b/src/state/shellscripts/patch_shebangs.sh
|
||||
new file mode 100755
|
||||
index 00000000..3ea84e2d
|
||||
--- /dev/null
|
||||
+++ b/src/state/shellscripts/patch_shebangs.sh
|
||||
@@ -0,0 +1,73 @@
|
||||
+#!/usr/bin/env bash
|
||||
+# This setup hook causes the fixup phase to rewrite all script
|
||||
+# interpreter file names (`#! /path') to paths found in $PATH. E.g.,
|
||||
+# /bin/sh will be rewritten to /nix/store/<hash>-some-bash/bin/sh.
|
||||
+# /usr/bin/env gets special treatment so that ".../bin/env python" is
|
||||
+# rewritten to /nix/store/<hash>/bin/python. Interpreters that are
|
||||
+# already in the store are left untouched.
|
||||
+
|
||||
+header() { echo "$1"; }
|
||||
+stopNest() { true; }
|
||||
+
|
||||
+fixupOutputHooks+=('if [ -z "${dontPatchShebangs-}" -a -e "$prefix" ]; then patchShebangs "$prefix"; fi')
|
||||
+
|
||||
+patchShebangs() {
|
||||
+ local dir="$1"
|
||||
+ header "patching script interpreter paths in $dir"
|
||||
+ local f
|
||||
+ local oldPath
|
||||
+ local newPath
|
||||
+ local arg0
|
||||
+ local args
|
||||
+ local oldInterpreterLine
|
||||
+ local newInterpreterLine
|
||||
+
|
||||
+ find "$dir" -type f -perm -0100 | while read f; do
|
||||
+ if [ "$(head -1 "$f" | head -c+2)" != '#!' ]; then
|
||||
+ # missing shebang => not a script
|
||||
+ continue
|
||||
+ fi
|
||||
+
|
||||
+ oldInterpreterLine=$(head -1 "$f" | tail -c+3)
|
||||
+ read -r oldPath arg0 args <<< "$oldInterpreterLine"
|
||||
+
|
||||
+ if $(echo "$oldPath" | grep -q "/bin/env$"); then
|
||||
+ # Check for unsupported 'env' functionality:
|
||||
+ # - options: something starting with a '-'
|
||||
+ # - environment variables: foo=bar
|
||||
+ if $(echo "$arg0" | grep -q -- "^-.*\|.*=.*"); then
|
||||
+ echo "unsupported interpreter directive \"$oldInterpreterLine\" (set dontPatchShebangs=1 and handle shebang patching yourself)"
|
||||
+ exit 1
|
||||
+ fi
|
||||
+ newPath="$(command -v "$arg0" || true)"
|
||||
+ else
|
||||
+ if [ "$oldPath" = "" ]; then
|
||||
+ # If no interpreter is specified linux will use /bin/sh. Set
|
||||
+ # oldpath="/bin/sh" so that we get /nix/store/.../sh.
|
||||
+ oldPath="/bin/sh"
|
||||
+ fi
|
||||
+ newPath="$(command -v "$(basename "$oldPath")" || true)"
|
||||
+ args="$arg0 $args"
|
||||
+ fi
|
||||
+
|
||||
+ # Strip trailing whitespace introduced when no arguments are present
|
||||
+ newInterpreterLine="$(echo "$newPath $args" | sed 's/[[:space:]]*$//')"
|
||||
+
|
||||
+ if [ -n "$oldPath" -a "${oldPath:0:${#NIX_STORE}}" != "$NIX_STORE" ]; then
|
||||
+ if [ -n "$newPath" -a "$newPath" != "$oldPath" ]; then
|
||||
+ echo "$f: interpreter directive changed from \"$oldInterpreterLine\" to \"$newInterpreterLine\""
|
||||
+ # escape the escape chars so that sed doesn't interpret them
|
||||
+ escapedInterpreterLine=$(echo "$newInterpreterLine" | sed 's|\\|\\\\|g')
|
||||
+ # Preserve times, see: https://github.com/NixOS/nixpkgs/pull/33281
|
||||
+ touch -r "$f" "$f.timestamp"
|
||||
+ sed -i -e "1 s|.*|#\!$escapedInterpreterLine|" "$f"
|
||||
+ touch -r "$f.timestamp" "$f"
|
||||
+ rm "$f.timestamp"
|
||||
+ fi
|
||||
+ fi
|
||||
+ done
|
||||
+
|
||||
+ stopNest
|
||||
+}
|
||||
+
|
||||
+patchShebangs .
|
||||
132
pkgs/development/tools/ocaml/opam/opam.nix.pl
Executable file
132
pkgs/development/tools/ocaml/opam/opam.nix.pl
Executable file
|
|
@ -0,0 +1,132 @@
|
|||
#!/usr/bin/env perl
|
||||
|
||||
use strict;
|
||||
use warnings qw<all>;
|
||||
use Getopt::Std;
|
||||
|
||||
my $gencmd = "# Generated by: " . join(" ", $0, @ARGV) . "\n";
|
||||
|
||||
our $opt_v;
|
||||
our $opt_p;
|
||||
our $opt_r;
|
||||
our $opt_t;
|
||||
getopts "v:p:t:r:";
|
||||
|
||||
my $OPAM_RELEASE = $opt_v // "2.0.0";
|
||||
my $OPAM_TAG = $opt_t // $OPAM_RELEASE;
|
||||
my $OPAM_GITHUB_REPO = $opt_r // "ocaml/opam";
|
||||
my $OPAM_RELEASE_URL = "https://github.com/$OPAM_GITHUB_REPO/archive/$OPAM_TAG.zip";
|
||||
my $OPAM_RELEASE_SHA256 = `nix-prefetch-url \Q$OPAM_RELEASE_URL\E`;
|
||||
chomp $OPAM_RELEASE_SHA256;
|
||||
|
||||
my $OPAM_BASE_URL = "https://raw.githubusercontent.com/$OPAM_GITHUB_REPO/$OPAM_TAG";
|
||||
my $OPAM_OPAM = `curl -L --url \Q$OPAM_BASE_URL\E/opam-devel.opam`;
|
||||
my($OCAML_MIN_VERSION) = $OPAM_OPAM =~ /^ "ocaml" {>= "(.*)"}$/m
|
||||
or die "could not parse ocaml version bound\n";
|
||||
|
||||
print <<"EOF";
|
||||
{ stdenv, lib, fetchurl, makeWrapper, getconf,
|
||||
ocaml, unzip, ncurses, curl, aspcud, bubblewrap
|
||||
}:
|
||||
|
||||
assert lib.versionAtLeast ocaml.version "$OCAML_MIN_VERSION";
|
||||
|
||||
let
|
||||
srcs = {
|
||||
EOF
|
||||
|
||||
my %urls = ();
|
||||
my %md5s = ();
|
||||
|
||||
open(SOURCES, "-|", "curl", "-L", "--url", "$OPAM_BASE_URL/src_ext/Makefile.sources");
|
||||
while (<SOURCES>) {
|
||||
if (/^URL_(?!PKG_)([-\w]+)\s*=\s*(\S+)$/) {
|
||||
$urls{$1} = $2;
|
||||
} elsif (/^MD5_(?!PKG_)([-\w]+)\s*=\s*(\S+)$/) {
|
||||
$md5s{$1} = $2;
|
||||
}
|
||||
}
|
||||
for my $src (sort keys %urls) {
|
||||
my ($sha256,$store_path) = split /\n/, `nix-prefetch-url --print-path \Q$urls{$src}\E`;
|
||||
system "echo \Q$md5s{$src}\E' *'\Q$store_path\E | md5sum -c 1>&2";
|
||||
die "md5 check failed for $urls{$src}\n" if $?;
|
||||
print <<"EOF";
|
||||
"$src" = fetchurl {
|
||||
url = "$urls{$src}";
|
||||
sha256 = "$sha256";
|
||||
};
|
||||
EOF
|
||||
}
|
||||
|
||||
print <<"EOF";
|
||||
opam = fetchurl {
|
||||
url = "$OPAM_RELEASE_URL";
|
||||
sha256 = "$OPAM_RELEASE_SHA256";
|
||||
};
|
||||
};
|
||||
in stdenv.mkDerivation {
|
||||
pname = "opam";
|
||||
version = "$OPAM_RELEASE";
|
||||
|
||||
nativeBuildInputs = [ makeWrapper unzip ];
|
||||
buildInputs = [ curl ncurses ocaml getconf ] ++ lib.optional stdenv.isLinux bubblewrap;
|
||||
|
||||
src = srcs.opam;
|
||||
|
||||
postUnpack = ''
|
||||
EOF
|
||||
for my $src (sort keys %urls) {
|
||||
my($ext) = $urls{$src} =~ /(\.(?:t(?:ar\.|)|)(?:gz|bz2?))$/
|
||||
or die "could not find extension for $urls{$src}\n";
|
||||
print <<"EOF";
|
||||
ln -sv \${srcs."$src"} \$sourceRoot/src_ext/$src$ext
|
||||
EOF
|
||||
}
|
||||
print <<'EOF';
|
||||
'';
|
||||
|
||||
EOF
|
||||
if (defined $opt_p) {
|
||||
print " patches = [ ";
|
||||
for my $patch (split /[, ]/, $opt_p) {
|
||||
$patch =~ s/^(?=[^\/]*$)/.\//;
|
||||
print "$patch ";
|
||||
}
|
||||
print "];\n\n";
|
||||
}
|
||||
print <<'EOF';
|
||||
preConfigure = ''
|
||||
substituteInPlace ./src_ext/Makefile --replace "%.stamp: %.download" "%.stamp:"
|
||||
patchShebangs src/state/shellscripts
|
||||
'';
|
||||
|
||||
postConfigure = "make lib-ext";
|
||||
|
||||
# Dirty, but apparently ocp-build requires a TERM
|
||||
makeFlags = ["TERM=screen"];
|
||||
|
||||
outputs = [ "out" "installer" ];
|
||||
setOutputFlags = false;
|
||||
|
||||
# change argv0 to "opam" as a workaround for
|
||||
# https://github.com/ocaml/opam/issues/2142
|
||||
postInstall = ''
|
||||
mv $out/bin/opam $out/bin/.opam-wrapped
|
||||
makeWrapper $out/bin/.opam-wrapped $out/bin/opam \
|
||||
--argv0 "opam" \
|
||||
--suffix PATH : ${aspcud}/bin:${unzip}/bin:${curl}/bin:${lib.optionalString stdenv.isLinux "${bubblewrap}/bin:"}${getconf}/bin \
|
||||
--set OPAM_USER_PATH_RO /run/current-system/sw/bin:/nix/
|
||||
$out/bin/opam-installer --prefix=$installer opam-installer.install
|
||||
'';
|
||||
|
||||
doCheck = false;
|
||||
|
||||
meta = with lib; {
|
||||
description = "A package manager for OCaml";
|
||||
homepage = "https://opam.ocaml.org/";
|
||||
maintainers = [ maintainers.henrytill maintainers.marsam ];
|
||||
platforms = platforms.all;
|
||||
};
|
||||
}
|
||||
EOF
|
||||
print $gencmd;
|
||||
76
pkgs/development/tools/ocaml/utop/default.nix
Normal file
76
pkgs/development/tools/ocaml/utop/default.nix
Normal file
|
|
@ -0,0 +1,76 @@
|
|||
{ lib, stdenv, fetchurl, ocaml, findlib
|
||||
, lambda-term, cppo, makeWrapper, buildDunePackage
|
||||
}:
|
||||
|
||||
buildDunePackage rec {
|
||||
pname = "utop";
|
||||
version = "2.9.1";
|
||||
|
||||
useDune2 = true;
|
||||
|
||||
minimalOCamlVersion = "4.03";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://github.com/ocaml-community/utop/releases/download/${version}/utop-${version}.tbz";
|
||||
sha256 = "sha256-6TQxLYN/qjTABZuK6rp+daCSNWyJIXzB8q2QpZeBwaY=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ makeWrapper cppo ];
|
||||
|
||||
propagatedBuildInputs = [ lambda-term ];
|
||||
|
||||
postFixup =
|
||||
let
|
||||
path = "etc/utop/env";
|
||||
|
||||
# derivation of just runtime deps so env vars created by
|
||||
# setup-hooks can be saved for use at runtime
|
||||
runtime = stdenv.mkDerivation {
|
||||
pname = "utop-runtime-env";
|
||||
inherit version;
|
||||
|
||||
buildInputs = [ findlib ] ++ propagatedBuildInputs;
|
||||
|
||||
dontUnpack = true;
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p "$out"/${path}
|
||||
for e in OCAMLPATH CAML_LD_LIBRARY_PATH; do
|
||||
[[ -v "$e" ]] || continue
|
||||
printf %s "''${!e}" > "$out"/${path}/$e
|
||||
done
|
||||
'';
|
||||
};
|
||||
|
||||
get = key: ''$(cat "${runtime}/${path}/${key}")'';
|
||||
in ''
|
||||
for prog in "$out"/bin/*
|
||||
do
|
||||
|
||||
# Note: wrapProgram by default calls 'exec -a $0 ...', but this
|
||||
# breaks utop on Linux with OCaml 4.04, and is disabled with
|
||||
# '--argv0 ""' flag. See https://github.com/NixOS/nixpkgs/issues/24496
|
||||
wrapProgram "$prog" \
|
||||
--argv0 "" \
|
||||
--prefix CAML_LD_LIBRARY_PATH ":" "${get "CAML_LD_LIBRARY_PATH"}" \
|
||||
--prefix OCAMLPATH ":" "${get "OCAMLPATH"}" \
|
||||
--prefix OCAMLPATH ":" $(unset OCAMLPATH; addOCamlPath "$out"; printf %s "$OCAMLPATH") \
|
||||
--add-flags "-I ${findlib}/lib/ocaml/${lib.getVersion ocaml}/site-lib"
|
||||
done
|
||||
'';
|
||||
|
||||
meta = {
|
||||
description = "Universal toplevel for OCaml";
|
||||
longDescription = ''
|
||||
utop is an improved toplevel for OCaml. It can run in a terminal or in Emacs. It supports line edition, history, real-time and context sensitive completion, colors, and more.
|
||||
|
||||
It integrates with the tuareg mode in Emacs.
|
||||
'';
|
||||
homepage = "https://github.com/diml/utop";
|
||||
license = lib.licenses.bsd3;
|
||||
platforms = ocaml.meta.platforms or [];
|
||||
maintainers = [
|
||||
lib.maintainers.gal_bolle
|
||||
];
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue