Skip to content
This repository was archived by the owner on Apr 12, 2021. It is now read-only.
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs-channels
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 9fba490258e1
Choose a base ref
...
head repository: NixOS/nixpkgs-channels
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 1a04bd44145d
Choose a head ref
  • 2 commits
  • 3 files changed
  • 1 contributor

Commits on Dec 11, 2018

  1. ocamlPackages.optint: init at 0.0.2

    This library provide one module Optint which internally uses an int if
    you are in a x64 architecture or an int32 (boxed value) if you are in a
    x86 architecture.
    
    Homepage: https://github.com/mirage/optint
    vbgl committed Dec 11, 2018

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    e9b43ad View commit details
  2. ocamlPackages.checkseum: init at 0.0.3

    Chekseum is an OCaml library which implements ADLER-32 and CRC32C Cyclic
    Redundancy Check. It provides 2 implementation, the first in C and the
    second in OCaml.
    
    Homepage: https://github.com/mirage/checkseum
    vbgl committed Dec 11, 2018
    Copy the full SHA
    1a04bd4 View commit details
Showing with 71 additions and 0 deletions.
  1. +39 −0 pkgs/development/ocaml-modules/checkseum/default.nix
  2. +28 −0 pkgs/development/ocaml-modules/optint/default.nix
  3. +4 −0 pkgs/top-level/ocaml-packages.nix
39 changes: 39 additions & 0 deletions pkgs/development/ocaml-modules/checkseum/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{ stdenv, fetchurl, ocaml, findlib, dune, alcotest, cmdliner, fmt, optint, rresult }:

if !stdenv.lib.versionAtLeast ocaml.version "4.03"
then throw "checkseum is not available for OCaml ${ocaml.version}"
else

# The C implementation is not portable: x86 only
let hasC = stdenv.isi686 || stdenv.isx86_64; in

stdenv.mkDerivation rec {
version = "0.0.3";
name = "ocaml${ocaml.version}-checkseum-${version}";
src = fetchurl {
url = "https://github.com/mirage/checkseum/releases/download/v0.0.3/checkseum-v0.0.3.tbz";
sha256 = "12j45zsvil1ynwx1x8fbddhqacc8r1zf7f6h576y3f3yvbg7l1fm";
};

postPatch = stdenv.lib.optionalString (!hasC) ''
rm -r bin src-c
'';

buildInputs = [ ocaml findlib dune alcotest cmdliner fmt rresult ];
propagatedBuildInputs = [ optint ];

buildPhase = "dune build";

doCheck = hasC;
checkPhase = "dune runtest";

inherit (dune) installPhase;

meta = {
homepage = "https://github.com/mirage/checkseum";
description = "ADLER-32 and CRC32C Cyclic Redundancy Check";
license = stdenv.lib.licenses.mit;
maintainers = [ stdenv.lib.maintainers.vbgl ];
inherit (ocaml.meta) platforms;
};
}
28 changes: 28 additions & 0 deletions pkgs/development/ocaml-modules/optint/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{ stdenv, fetchurl, ocaml, findlib, dune }:

if !stdenv.lib.versionAtLeast ocaml.version "4.02"
then throw "optint is not available for OCaml ${ocaml.version}"
else

stdenv.mkDerivation rec {
version = "0.0.2";
name = "ocaml${ocaml.version}-optint-${version}";
src = fetchurl {
url = "https://github.com/mirage/optint/releases/download/v0.0.2/optint-v0.0.2.tbz";
sha256 = "1lmb7nycmkr05y93slqi98i1lcs1w4kcngjzjwz7i230qqjpw9w1";
};

buildInputs = [ ocaml findlib dune ];

buildPhase = "dune build";

inherit (dune) installPhase;

meta = {
homepage = "https://github.com/mirage/optint";
description = "Abstract type of integer between x64 and x86 architecture";
license = stdenv.lib.licenses.mit;
maintainers = [ stdenv.lib.maintainers.vbgl ];
inherit (ocaml.meta) platforms;
};
}
4 changes: 4 additions & 0 deletions pkgs/top-level/ocaml-packages.nix
Original file line number Diff line number Diff line change
@@ -138,6 +138,8 @@ let

cairo2 = callPackage ../development/ocaml-modules/cairo2 { };

checkseum = callPackage ../development/ocaml-modules/checkseum { };

cil = callPackage ../development/ocaml-modules/cil { };

cmdliner = callPackage ../development/ocaml-modules/cmdliner { };
@@ -557,6 +559,8 @@ let

opti = callPackage ../development/ocaml-modules/opti { };

optint = callPackage ../development/ocaml-modules/optint { };

otfm = callPackage ../development/ocaml-modules/otfm { };

otr = callPackage ../development/ocaml-modules/otr { };