mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-08-27 02:34:53 +00:00
This reverts commit65a333600d. This wasn't tested for correctness with something like fodwatch [0], and should not have been (self-)merged so quickly, especially without further review. It also resulted in the breakage of at least one package [1] (and that's the one we know of and was caught). A few packages that were updated in between this commit and this revert were not reverted back to using `rev`, but other than that, this is a 1:1 revert. [0]: https://codeberg.org/raphaelr/fodwatch [1]: https://github.com/NixOS/nixpkgs/pull/396904 /758551e458
64 lines
1.3 KiB
Nix
64 lines
1.3 KiB
Nix
{
|
|
stdenv,
|
|
lib,
|
|
fetchFromGitHub,
|
|
fetchurl,
|
|
ocaml,
|
|
findlib,
|
|
}:
|
|
|
|
let
|
|
params =
|
|
if lib.versionAtLeast ocaml.version "4.07" then
|
|
rec {
|
|
version = "0.2";
|
|
src = fetchFromGitHub {
|
|
owner = "grain-lang";
|
|
repo = "dypgen";
|
|
rev = version;
|
|
hash = "sha256-fKuO/e5YbA2B7XcghWl9pXxwvKw9YlhnmZDZcuKe3cs=";
|
|
};
|
|
}
|
|
else if lib.versionOlder ocaml.version "4.06" then
|
|
{
|
|
version = "20120619-1";
|
|
src = fetchurl {
|
|
url = "http://dypgen.free.fr/dypgen-20120619-1.tar.bz2";
|
|
sha256 = "ecb53d6e469e9ec4d57ee6323ff498d45b78883ae13618492488e7c5151fdd97";
|
|
};
|
|
}
|
|
else
|
|
throw "dypgen is not available for OCaml ${ocaml.version}";
|
|
in
|
|
|
|
stdenv.mkDerivation {
|
|
pname = "ocaml${ocaml.version}-dypgen";
|
|
inherit (params) src version;
|
|
|
|
nativeBuildInputs = [
|
|
ocaml
|
|
findlib
|
|
];
|
|
|
|
strictDeps = true;
|
|
|
|
createFindlibDestdir = true;
|
|
|
|
buildPhase = ''
|
|
make
|
|
'';
|
|
|
|
makeFlags = [
|
|
"BINDIR=$(out)/bin"
|
|
"MANDIR=$(out)/usr/share/man/man1"
|
|
"DYPGENLIBDIR=$(out)/lib/ocaml/${ocaml.version}/site-lib"
|
|
];
|
|
|
|
meta = {
|
|
homepage = "http://dypgen.free.fr";
|
|
description = "Dypgen GLR self extensible parser generator";
|
|
license = lib.licenses.cecill-b;
|
|
inherit (ocaml.meta) platforms;
|
|
};
|
|
}
|