Skip to content

Commit

Permalink
Build vlq with buildDunePackage and dune2
Browse files Browse the repository at this point in the history
  • Loading branch information
nomeata committed May 19, 2021
1 parent 486d2b3 commit d5e3399
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 17 deletions.
4 changes: 2 additions & 2 deletions nix/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ let
# Additional ocaml package
ocamlPackages = super.ocamlPackages // {
vlq = import ./ocaml-vlq.nix {
inherit (self) stdenv fetchFromGitHub ocaml dune_1;
inherit (self.ocamlPackages) findlib;
inherit (self) fetchFromGitHub;
inherit (self.ocamlPackages) buildDunePackage;
};
obelisk = import ./ocaml-obelisk.nix {
inherit (self) stdenv lib fetchFromGitHub ocaml dune_2;
Expand Down
21 changes: 6 additions & 15 deletions nix/ocaml-vlq.nix
Original file line number Diff line number Diff line change
@@ -1,25 +1,16 @@
{ stdenv, fetchFromGitHub, ocaml, findlib, dune_1 }:
{ buildDunePackage, fetchFromGitHub }:

let version = "v0.2.0"; in
stdenv.mkDerivation {
name = "ocaml${ocaml.version}-vlq-${version}";
buildDunePackage {
pname = "vlq";
inherit version;

useDune2 = true;

src = fetchFromGitHub {
owner = "flowtype";
repo = "ocaml-vlq";
rev = version;
sha256 = "09jdgih2n2qwpxnlbcca4xa193rwbd1nw7prxaqlg134l4mbya83";
};

buildInputs = [ ocaml findlib dune_1 ];

buildPhase = "dune build";

installPhase = "dune install --prefix $out --libdir $OCAMLFIND_DESTDIR vlq";

meta = {
homepage = https://github.com/flowtype/ocaml-vlq;
platforms = ocaml.meta.platforms or [];
description = "A simple library for encoding variable-length quantities";
};
}

0 comments on commit d5e3399

Please sign in to comment.