From 369230cc760816fd2d7931bf05aac372b6bdea5a Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Mon, 13 Mar 2017 20:17:29 +0000 Subject: [PATCH] ocamlPackages.cpuid: init at 0.1.0 cpuid allows detection of CPU features from OCaml. Homepage: https://github.com/pqwy/cpuid --- .../ocaml-modules/cpuid/default.nix | 24 +++++++++++++++++++ pkgs/top-level/ocaml-packages.nix | 2 ++ 2 files changed, 26 insertions(+) create mode 100644 pkgs/development/ocaml-modules/cpuid/default.nix diff --git a/pkgs/development/ocaml-modules/cpuid/default.nix b/pkgs/development/ocaml-modules/cpuid/default.nix new file mode 100644 index 000000000000..1bdf70e86c5a --- /dev/null +++ b/pkgs/development/ocaml-modules/cpuid/default.nix @@ -0,0 +1,24 @@ +{ stdenv, fetchurl, ocaml, findlib, ocamlbuild, opam, topkg, ocb-stubblr }: + +stdenv.mkDerivation { + name = "ocaml${ocaml.version}-cpuid-0.1.0"; + + src = fetchurl { + url = http://github.com/pqwy/cpuid/releases/download/v0.1.0/cpuid-0.1.0.tbz; + sha256 = "08k2558a3dnxn8msgpz8c93sfn0y027ganfdi2yvql0fp1ixv97p"; + }; + + unpackCmd = "tar xjf $src"; + + buildInputs = [ ocaml findlib ocamlbuild opam topkg ocb-stubblr ]; + + inherit (topkg) buildPhase installPhase; + + meta = { + homepage = https://github.com/pqwy/cpuid; + description = "Detect CPU features from OCaml"; + license = stdenv.lib.licenses.isc; + maintainers = [ stdenv.lib.maintainers.vbgl ]; + inherit (ocaml.meta) platforms; + }; +} diff --git a/pkgs/top-level/ocaml-packages.nix b/pkgs/top-level/ocaml-packages.nix index bb4d2abed22b..b695e0a073e6 100644 --- a/pkgs/top-level/ocaml-packages.nix +++ b/pkgs/top-level/ocaml-packages.nix @@ -138,6 +138,8 @@ let cppo = callPackage ../development/tools/ocaml/cppo { }; + cpuid = callPackage ../development/ocaml-modules/cpuid { }; + cryptokit = callPackage ../development/ocaml-modules/cryptokit { }; cstruct = callPackage ../development/ocaml-modules/cstruct {