mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 06:53:01 +00:00
ocamlPackages.ctypes: 0.20.2 → 0.21.1
This commit is contained in:
parent
bfa8b30043
commit
d6d96bdff4
@ -1,4 +1,4 @@
|
|||||||
{ lib, stdenv, fetchFromGitHub, bap, ocaml, findlib, ctypes, autoreconfHook,
|
{ lib, stdenv, fetchFromGitHub, bap, ocaml, findlib, ctypes, ctypes-foreign, autoreconfHook,
|
||||||
which }:
|
which }:
|
||||||
|
|
||||||
stdenv.mkDerivation {
|
stdenv.mkDerivation {
|
||||||
@ -13,7 +13,7 @@ stdenv.mkDerivation {
|
|||||||
};
|
};
|
||||||
|
|
||||||
nativeBuildInputs = [ autoreconfHook which ocaml findlib ];
|
nativeBuildInputs = [ autoreconfHook which ocaml findlib ];
|
||||||
buildInputs = [ bap ctypes ];
|
buildInputs = [ bap ctypes ctypes-foreign ];
|
||||||
|
|
||||||
preInstall = ''
|
preInstall = ''
|
||||||
mkdir -p $out/lib
|
mkdir -p $out/lib
|
||||||
|
@ -1,49 +1,35 @@
|
|||||||
{ lib, stdenv, fetchFromGitHub, ocaml, findlib, libffi, pkg-config, ncurses, integers, bigarray-compat }:
|
{ lib
|
||||||
|
, ocaml
|
||||||
|
, fetchFromGitHub
|
||||||
|
, buildDunePackage
|
||||||
|
, dune-configurator
|
||||||
|
, integers
|
||||||
|
, bigarray-compat
|
||||||
|
, ounit2
|
||||||
|
}:
|
||||||
|
|
||||||
if lib.versionOlder ocaml.version "4.02"
|
buildDunePackage rec {
|
||||||
then throw "ctypes is not available for OCaml ${ocaml.version}"
|
pname = "ctypes";
|
||||||
else
|
version = "0.21.1";
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
|
||||||
pname = "ocaml${ocaml.version}-ctypes";
|
|
||||||
version = "0.20.2";
|
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
owner = "ocamllabs";
|
owner = "ocamllabs";
|
||||||
repo = "ocaml-ctypes";
|
repo = "ocaml-ctypes";
|
||||||
rev = version;
|
rev = version;
|
||||||
hash = "sha256-LzUrR8K88CjY/R5yUK3y6KG85hUMjbzuebHGqI8KhhM=";
|
hash = "sha256-Cay+8dwFxw4d1OgMP4CR94l4ic2269YCAaziesEqwHM=";
|
||||||
};
|
};
|
||||||
|
|
||||||
nativeBuildInputs = [ pkg-config ocaml findlib ];
|
buildInputs = [ dune-configurator ];
|
||||||
buildInputs = [ ncurses ];
|
|
||||||
propagatedBuildInputs = [ integers libffi bigarray-compat ];
|
|
||||||
|
|
||||||
strictDeps = true;
|
propagatedBuildInputs = [ integers bigarray-compat ];
|
||||||
|
|
||||||
preConfigure = ''
|
doCheck = lib.versionAtLeast ocaml.version "4.08";
|
||||||
substituteInPlace META --replace ' bytes ' ' '
|
checkInputs = [ ounit2 ];
|
||||||
'';
|
|
||||||
|
|
||||||
buildPhase = ''
|
|
||||||
runHook preBuild
|
|
||||||
make XEN=false libffi.config ctypes-base ctypes-stubs
|
|
||||||
make XEN=false ctypes-foreign
|
|
||||||
runHook postBuild
|
|
||||||
'';
|
|
||||||
|
|
||||||
installPhase = ''
|
|
||||||
runHook preInstall
|
|
||||||
mkdir -p $out/lib/ocaml/${ocaml.version}/site-lib/stublibs
|
|
||||||
make install XEN=false
|
|
||||||
runHook postInstall
|
|
||||||
'';
|
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
homepage = "https://github.com/ocamllabs/ocaml-ctypes";
|
homepage = "https://github.com/ocamllabs/ocaml-ctypes";
|
||||||
description = "Library for binding to C libraries using pure OCaml";
|
description = "Library for binding to C libraries using pure OCaml";
|
||||||
license = licenses.mit;
|
license = licenses.mit;
|
||||||
maintainers = [ maintainers.ericbmerritt ];
|
maintainers = [ maintainers.ericbmerritt ];
|
||||||
inherit (ocaml.meta) platforms;
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
23
pkgs/development/ocaml-modules/ctypes/foreign.nix
Normal file
23
pkgs/development/ocaml-modules/ctypes/foreign.nix
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
{ buildDunePackage
|
||||||
|
, ctypes
|
||||||
|
, dune-configurator
|
||||||
|
, libffi
|
||||||
|
, ounit2
|
||||||
|
, lwt
|
||||||
|
}:
|
||||||
|
|
||||||
|
buildDunePackage rec {
|
||||||
|
pname = "ctypes-foreign";
|
||||||
|
|
||||||
|
inherit (ctypes) version src doCheck;
|
||||||
|
|
||||||
|
buildInputs = [ dune-configurator ];
|
||||||
|
|
||||||
|
propagatedBuildInputs = [ ctypes libffi ];
|
||||||
|
|
||||||
|
checkInputs = [ ounit2 lwt ];
|
||||||
|
|
||||||
|
meta = ctypes.meta // {
|
||||||
|
description = "Dynamic access to foreign C libraries using Ctypes";
|
||||||
|
};
|
||||||
|
}
|
@ -27,7 +27,10 @@ stdenv.mkDerivation rec {
|
|||||||
# strictoverflow is disabled because it breaks aarch64-darwin
|
# strictoverflow is disabled because it breaks aarch64-darwin
|
||||||
hardeningDisable = [ "strictoverflow" ];
|
hardeningDisable = [ "strictoverflow" ];
|
||||||
|
|
||||||
|
# Compatibility with ctypes ≥ 0.21
|
||||||
|
# see: https://github.com/cryspen/hacl-packages/commit/81303b83a54a92d3b5f54f1b8ddbea60438cc2bf
|
||||||
postPatch = ''
|
postPatch = ''
|
||||||
|
substituteInPlace hacl-star-raw/META --replace-warn 'requires="ctypes"' 'requires="ctypes ctypes.stubs"'
|
||||||
patchShebangs ./
|
patchShebangs ./
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
@ -130,7 +130,7 @@ with self;
|
|||||||
hash = "0ykys3ckpsx5crfgj26v2q3gy6wf684aq0bfb4q8p92ivwznvlzy";
|
hash = "0ykys3ckpsx5crfgj26v2q3gy6wf684aq0bfb4q8p92ivwznvlzy";
|
||||||
meta.description = "Async wrappers for SSL";
|
meta.description = "Async wrappers for SSL";
|
||||||
buildInputs = [ dune-configurator ];
|
buildInputs = [ dune-configurator ];
|
||||||
propagatedBuildInputs = [ async ctypes openssl ];
|
propagatedBuildInputs = [ async ctypes ctypes-foreign openssl ];
|
||||||
# in ctypes.foreign 0.18.0 threaded and unthreaded have been merged
|
# in ctypes.foreign 0.18.0 threaded and unthreaded have been merged
|
||||||
postPatch = ''
|
postPatch = ''
|
||||||
substituteInPlace bindings/dune \
|
substituteInPlace bindings/dune \
|
||||||
|
@ -144,7 +144,7 @@ with self;
|
|||||||
hash = "1b7f7p3xj4jr2n2dxy2lp7a9k7944w6x2nrg6524clvcsd1ax4hn";
|
hash = "1b7f7p3xj4jr2n2dxy2lp7a9k7944w6x2nrg6524clvcsd1ax4hn";
|
||||||
meta.description = "Async wrappers for SSL";
|
meta.description = "Async wrappers for SSL";
|
||||||
buildInputs = [ dune-configurator ];
|
buildInputs = [ dune-configurator ];
|
||||||
propagatedBuildInputs = [ async ctypes openssl ];
|
propagatedBuildInputs = [ async ctypes ctypes-foreign openssl ];
|
||||||
# in ctypes.foreign 0.18.0 threaded and unthreaded have been merged
|
# in ctypes.foreign 0.18.0 threaded and unthreaded have been merged
|
||||||
postPatch = ''
|
postPatch = ''
|
||||||
substituteInPlace bindings/dune \
|
substituteInPlace bindings/dune \
|
||||||
|
@ -146,7 +146,7 @@ with self;
|
|||||||
hash = "sha256-83YKxvVb/JwBnQG4R/R1Ztik9T/hO4cbiNTfFnErpG4=";
|
hash = "sha256-83YKxvVb/JwBnQG4R/R1Ztik9T/hO4cbiNTfFnErpG4=";
|
||||||
meta.description = "Async wrappers for SSL";
|
meta.description = "Async wrappers for SSL";
|
||||||
buildInputs = [ dune-configurator ];
|
buildInputs = [ dune-configurator ];
|
||||||
propagatedBuildInputs = [ async ctypes openssl ];
|
propagatedBuildInputs = [ async ctypes ctypes-foreign openssl ];
|
||||||
};
|
};
|
||||||
|
|
||||||
async_unix = janePackage {
|
async_unix = janePackage {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ lib, buildDunePackage, fetchFromGitHub, dune-configurator, ctypes, lilv }:
|
{ lib, buildDunePackage, fetchFromGitHub, dune-configurator, ctypes, ctypes-foreign, lilv }:
|
||||||
|
|
||||||
buildDunePackage rec {
|
buildDunePackage rec {
|
||||||
pname = "lilv";
|
pname = "lilv";
|
||||||
@ -14,7 +14,7 @@ buildDunePackage rec {
|
|||||||
minimalOCamlVersion = "4.03.0";
|
minimalOCamlVersion = "4.03.0";
|
||||||
|
|
||||||
buildInputs = [ dune-configurator ];
|
buildInputs = [ dune-configurator ];
|
||||||
propagatedBuildInputs = [ ctypes lilv ];
|
propagatedBuildInputs = [ ctypes ctypes-foreign lilv ];
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
homepage = "https://github.com/savonet/ocaml-lilv";
|
homepage = "https://github.com/savonet/ocaml-lilv";
|
||||||
|
@ -15,10 +15,16 @@ stdenv.mkDerivation rec {
|
|||||||
sha256 = "sha256-3/C1Gz6luUzS7oaudLlDHMT6JB2v5OdbLVzJhtayHGM=";
|
sha256 = "sha256-3/C1Gz6luUzS7oaudLlDHMT6JB2v5OdbLVzJhtayHGM=";
|
||||||
};
|
};
|
||||||
|
|
||||||
patches = fetchpatch {
|
patches = lib.lists.map (x:
|
||||||
url = "https://github.com/andrenth/ocaml-mariadb/commit/9db2e4d8dec7c584213d0e0f03d079a36a35d9d5.patch";
|
fetchpatch {
|
||||||
hash = "sha256-heROtU02cYBJ5edIHMdYP1xNXcLv8h79GYGBuudJhgE=";
|
url = "https://github.com/andrenth/ocaml-mariadb/commit/${x.path}.patch";
|
||||||
};
|
inherit (x) hash;
|
||||||
|
})
|
||||||
|
[ { path = "9db2e4d8dec7c584213d0e0f03d079a36a35d9d5";
|
||||||
|
hash = "sha256-heROtU02cYBJ5edIHMdYP1xNXcLv8h79GYGBuudJhgE="; }
|
||||||
|
{ path = "40cd3102bc7cce4ed826ed609464daeb1bbb4581";
|
||||||
|
hash = "sha256-YVsAMJiOgWRk9xPaRz2sDihBYLlXv+rhWtQIMOVLtSg="; }
|
||||||
|
];
|
||||||
|
|
||||||
postPatch = ''
|
postPatch = ''
|
||||||
substituteInPlace setup.ml --replace '#use "topfind"' \
|
substituteInPlace setup.ml --replace '#use "topfind"' \
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
, dune-configurator
|
, dune-configurator
|
||||||
, posix-socket
|
, posix-socket
|
||||||
, srt
|
, srt
|
||||||
|
, ctypes-foreign
|
||||||
}:
|
}:
|
||||||
|
|
||||||
buildDunePackage rec {
|
buildDunePackage rec {
|
||||||
@ -9,7 +10,6 @@ buildDunePackage rec {
|
|||||||
version = "0.3.0";
|
version = "0.3.0";
|
||||||
|
|
||||||
minimalOCamlVersion = "4.08";
|
minimalOCamlVersion = "4.08";
|
||||||
duneVersion = "3";
|
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
owner = "savonet";
|
owner = "savonet";
|
||||||
@ -19,7 +19,7 @@ buildDunePackage rec {
|
|||||||
};
|
};
|
||||||
|
|
||||||
buildInputs = [ dune-configurator ];
|
buildInputs = [ dune-configurator ];
|
||||||
propagatedBuildInputs = [ posix-socket srt ];
|
propagatedBuildInputs = [ ctypes-foreign posix-socket srt ];
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
description = "OCaml bindings for the libsrt library";
|
description = "OCaml bindings for the libsrt library";
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
, fetchpatch
|
, fetchpatch
|
||||||
, cmdliner
|
, cmdliner
|
||||||
, ctypes
|
, ctypes
|
||||||
|
, ctypes-foreign
|
||||||
, dune-configurator
|
, dune-configurator
|
||||||
, npy
|
, npy
|
||||||
, ocaml-compiler-libs
|
, ocaml-compiler-libs
|
||||||
@ -42,6 +43,7 @@ buildDunePackage rec {
|
|||||||
propagatedBuildInputs = [
|
propagatedBuildInputs = [
|
||||||
cmdliner
|
cmdliner
|
||||||
ctypes
|
ctypes
|
||||||
|
ctypes-foreign
|
||||||
npy
|
npy
|
||||||
ocaml-compiler-libs
|
ocaml-compiler-libs
|
||||||
ppx_custom_printf
|
ppx_custom_printf
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ lib, stdenv, fetchurl, ocaml, findlib, ocamlbuild, topkg, ctypes, result, SDL2, pkg-config
|
{ lib, stdenv, fetchurl, ocaml, findlib, ocamlbuild, topkg, ctypes, ctypes-foreign, result, SDL2, pkg-config
|
||||||
, AudioToolbox, Cocoa, CoreAudio, CoreVideo, ForceFeedback }:
|
, AudioToolbox, Cocoa, CoreAudio, CoreVideo, ForceFeedback }:
|
||||||
|
|
||||||
if lib.versionOlder ocaml.version "4.03"
|
if lib.versionOlder ocaml.version "4.03"
|
||||||
@ -24,7 +24,7 @@ stdenv.mkDerivation {
|
|||||||
|
|
||||||
nativeBuildInputs = [ pkg-config ocaml findlib ocamlbuild topkg ];
|
nativeBuildInputs = [ pkg-config ocaml findlib ocamlbuild topkg ];
|
||||||
buildInputs = [ topkg ];
|
buildInputs = [ topkg ];
|
||||||
propagatedBuildInputs = [ SDL2 ctypes ]
|
propagatedBuildInputs = [ SDL2 ctypes ctypes-foreign ]
|
||||||
++ lib.optionals stdenv.isDarwin [ AudioToolbox Cocoa CoreAudio CoreVideo ForceFeedback ];
|
++ lib.optionals stdenv.isDarwin [ AudioToolbox Cocoa CoreAudio CoreVideo ForceFeedback ];
|
||||||
|
|
||||||
preConfigure = ''
|
preConfigure = ''
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
, buildDunePackage
|
, buildDunePackage
|
||||||
, xxHash
|
, xxHash
|
||||||
, ctypes
|
, ctypes
|
||||||
|
, ctypes-foreign
|
||||||
, dune-configurator
|
, dune-configurator
|
||||||
, ppx_expect
|
, ppx_expect
|
||||||
}:
|
}:
|
||||||
@ -20,12 +21,17 @@ buildDunePackage rec {
|
|||||||
hash = "sha256-0+ac5EWV9DCVMT4wOcXC95GVEwsUIZzFn2laSzmK6jE=";
|
hash = "sha256-0+ac5EWV9DCVMT4wOcXC95GVEwsUIZzFn2laSzmK6jE=";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
postPatch = ''
|
||||||
|
substituteInPlace stubs/dune --replace-warn 'ctypes))' 'ctypes ctypes.stubs))'
|
||||||
|
'';
|
||||||
|
|
||||||
buildInputs = [
|
buildInputs = [
|
||||||
dune-configurator
|
dune-configurator
|
||||||
];
|
];
|
||||||
|
|
||||||
propagatedBuildInputs = [
|
propagatedBuildInputs = [
|
||||||
ctypes
|
ctypes
|
||||||
|
ctypes-foreign
|
||||||
xxHash
|
xxHash
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -22209,7 +22209,7 @@ with pkgs;
|
|||||||
libbacktrace = callPackage ../development/libraries/libbacktrace { };
|
libbacktrace = callPackage ../development/libraries/libbacktrace { };
|
||||||
|
|
||||||
libbap = callPackage ../development/libraries/libbap {
|
libbap = callPackage ../development/libraries/libbap {
|
||||||
inherit (ocaml-ng.ocamlPackages_4_14) bap ocaml findlib ctypes;
|
inherit (ocaml-ng.ocamlPackages_4_14) bap ocaml findlib ctypes ctypes-foreign;
|
||||||
};
|
};
|
||||||
|
|
||||||
libbaseencode = callPackage ../development/libraries/libbaseencode { };
|
libbaseencode = callPackage ../development/libraries/libbaseencode { };
|
||||||
|
@ -283,6 +283,8 @@ let
|
|||||||
|
|
||||||
ctypes = callPackage ../development/ocaml-modules/ctypes { };
|
ctypes = callPackage ../development/ocaml-modules/ctypes { };
|
||||||
|
|
||||||
|
ctypes-foreign = callPackage ../development/ocaml-modules/ctypes/foreign.nix { };
|
||||||
|
|
||||||
ctypes_stubs_js = callPackage ../development/ocaml-modules/ctypes_stubs_js {
|
ctypes_stubs_js = callPackage ../development/ocaml-modules/ctypes_stubs_js {
|
||||||
inherit (pkgs) nodejs;
|
inherit (pkgs) nodejs;
|
||||||
};
|
};
|
||||||
@ -786,7 +788,7 @@ let
|
|||||||
inherit conduit ipaddr-sexp;
|
inherit conduit ipaddr-sexp;
|
||||||
};
|
};
|
||||||
in {
|
in {
|
||||||
inherit (self) dune-configurator alcotest re num octavius uutf ounit ctypes;
|
inherit (self) dune-configurator alcotest re num octavius uutf ounit ctypes ctypes-foreign;
|
||||||
ppxlib = self.ppxlib.override { inherit (self') stdio; };
|
ppxlib = self.ppxlib.override { inherit (self') stdio; };
|
||||||
cohttp-async = self.cohttp-async.override {
|
cohttp-async = self.cohttp-async.override {
|
||||||
inherit (self') ppx_sexp_conv base async async_kernel async_unix core_unix sexplib0 core;
|
inherit (self') ppx_sexp_conv base async async_kernel async_unix core_unix sexplib0 core;
|
||||||
|
Loading…
Reference in New Issue
Block a user