ocamlPackages: remove broken packages (#487255)
This commit is contained in:
@@ -6,8 +6,6 @@
|
||||
ounit2,
|
||||
dune-configurator,
|
||||
eqaf,
|
||||
withFreestanding ? false,
|
||||
ocaml-freestanding,
|
||||
}:
|
||||
|
||||
buildDunePackage (finalAttrs: {
|
||||
@@ -30,9 +28,6 @@ buildDunePackage (finalAttrs: {
|
||||
buildInputs = [ dune-configurator ];
|
||||
propagatedBuildInputs = [
|
||||
eqaf
|
||||
]
|
||||
++ lib.optionals withFreestanding [
|
||||
ocaml-freestanding
|
||||
];
|
||||
|
||||
meta = {
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
{
|
||||
lib,
|
||||
buildDunePackage,
|
||||
mirage-crypto,
|
||||
dune-configurator,
|
||||
@@ -12,8 +11,6 @@
|
||||
ppx_deriving_yojson,
|
||||
ppx_deriving,
|
||||
yojson,
|
||||
withFreestanding ? false,
|
||||
ocaml-freestanding,
|
||||
}:
|
||||
|
||||
buildDunePackage {
|
||||
@@ -31,9 +28,6 @@ buildDunePackage {
|
||||
propagatedBuildInputs = [
|
||||
mirage-crypto
|
||||
mirage-crypto-rng
|
||||
]
|
||||
++ lib.optionals withFreestanding [
|
||||
ocaml-freestanding
|
||||
];
|
||||
|
||||
doCheck = true;
|
||||
|
||||
@@ -1,49 +0,0 @@
|
||||
commit b273c9f7ab10475787db4d6e09bd4b71b374d0ec
|
||||
Author: sternenseemann <0rpkxez4ksa01gb3typccl0i@systemli.org>
|
||||
Date: Thu Mar 18 01:28:46 2021 +0100
|
||||
|
||||
Let user specify solo5-binding to use
|
||||
|
||||
This is a little feature for the configure script I wanted to have for
|
||||
the NixOS package: It allows the user to set PKG_CONFIG_DEPS before
|
||||
running configure.sh to disable the autodetection mechanism. This is
|
||||
useful for NixOS as we have all bindings bundled in the solo5 package,
|
||||
so the result would also be solo5-bindings-xen. Additionally, it allows
|
||||
us to do the binding selection declaratively and minimize the risk of
|
||||
accidentally switching backend.
|
||||
|
||||
PKG_CONFIG_DEPS seems like a bit of an unappropriate variable name for a
|
||||
user “interface”, let me know if you want a dedicated environment
|
||||
variable for this in case there will be more PKG_CONFIG_DEPS.
|
||||
|
||||
diff --git a/configure.sh b/configure.sh
|
||||
index c254f7b..c675a02 100755
|
||||
--- a/configure.sh
|
||||
+++ b/configure.sh
|
||||
@@ -11,13 +11,19 @@ if pkg_exists solo5-bindings-hvt solo5-bindings-spt solo5-bindings-virtio solo5-
|
||||
echo "ERROR: Only one of solo5-bindings-hvt, solo5-bindings-spt, solo5-bindings-virtio, solo5-bindings-muen, solo5-bindings-genode, solo5-bindings-xen can be installed." 1>&2
|
||||
exit 1
|
||||
fi
|
||||
-PKG_CONFIG_DEPS=
|
||||
-pkg_exists solo5-bindings-hvt && PKG_CONFIG_DEPS=solo5-bindings-hvt
|
||||
-pkg_exists solo5-bindings-spt && PKG_CONFIG_DEPS=solo5-bindings-spt
|
||||
-pkg_exists solo5-bindings-muen && PKG_CONFIG_DEPS=solo5-bindings-muen
|
||||
-pkg_exists solo5-bindings-virtio && PKG_CONFIG_DEPS=solo5-bindings-virtio
|
||||
-pkg_exists solo5-bindings-genode && PKG_CONFIG_DEPS=solo5-bindings-genode
|
||||
-pkg_exists solo5-bindings-xen && PKG_CONFIG_DEPS=solo5-bindings-xen
|
||||
+if [ -z "${PKG_CONFIG_DEPS}" ]; then
|
||||
+ PKG_CONFIG_DEPS=
|
||||
+ pkg_exists solo5-bindings-hvt && PKG_CONFIG_DEPS=solo5-bindings-hvt
|
||||
+ pkg_exists solo5-bindings-spt && PKG_CONFIG_DEPS=solo5-bindings-spt
|
||||
+ pkg_exists solo5-bindings-muen && PKG_CONFIG_DEPS=solo5-bindings-muen
|
||||
+ pkg_exists solo5-bindings-virtio && PKG_CONFIG_DEPS=solo5-bindings-virtio
|
||||
+ pkg_exists solo5-bindings-genode && PKG_CONFIG_DEPS=solo5-bindings-genode
|
||||
+ pkg_exists solo5-bindings-xen && PKG_CONFIG_DEPS=solo5-bindings-xen
|
||||
+else
|
||||
+ pkg_exists "${PKG_CONFIG_DEPS}" \
|
||||
+ || (echo "ERROR: ${PKG_CONFIG_DEPS} is not installed" 1>&2; exit 1) \
|
||||
+ || exit 1
|
||||
+fi
|
||||
if [ -z "${PKG_CONFIG_DEPS}" ]; then
|
||||
echo "ERROR: No supported Solo5 bindings package found." 1>&2
|
||||
echo "ERROR: solo5-bindings-hvt, solo5-bindings-spt, solo5-bindings-virtio, solo5-bindings-muen, solo5-bindings-genode or solo5-bindings-xen must be installed." 1>&2
|
||||
@@ -1,93 +0,0 @@
|
||||
{
|
||||
lib,
|
||||
stdenv,
|
||||
fetchFromGitHub,
|
||||
ocaml,
|
||||
pkg-config,
|
||||
solo5,
|
||||
target ? "xen",
|
||||
}:
|
||||
|
||||
# note: this is not technically an ocaml-module,
|
||||
# but can be built with different compilers, so
|
||||
# the ocamlPackages set is very useful.
|
||||
|
||||
let
|
||||
pname = "ocaml-freestanding";
|
||||
in
|
||||
|
||||
if lib.versionOlder ocaml.version "4.08" then
|
||||
throw "${pname} is not available for OCaml ${ocaml.version}"
|
||||
else
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
name = "ocaml${ocaml.version}-${pname}-${version}";
|
||||
inherit pname;
|
||||
version = "0.6.5";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "mirage";
|
||||
repo = pname;
|
||||
rev = "v${version}";
|
||||
sha256 = "sha256:1mbyjzwcs64n7i3xkkyaxgl3r46drbl0gkqf3fqgm2kh3q03638l";
|
||||
};
|
||||
|
||||
postUnpack = ''
|
||||
# get ocaml-src from the ocaml drv instead of via ocamlfind
|
||||
mkdir -p "${src.name}/ocaml"
|
||||
tar --strip-components=1 -xf ${ocaml.src} -C "${src.name}/ocaml"
|
||||
'';
|
||||
|
||||
patches = [
|
||||
./no-opam.patch
|
||||
./configurable-binding.patch
|
||||
];
|
||||
|
||||
strictDeps = true;
|
||||
|
||||
nativeBuildInputs = [
|
||||
ocaml
|
||||
pkg-config
|
||||
];
|
||||
|
||||
propagatedBuildInputs = [ solo5 ];
|
||||
|
||||
configurePhase = ''
|
||||
runHook preConfigure
|
||||
env PKG_CONFIG_DEPS=solo5-bindings-${target} sh configure.sh
|
||||
runHook postConfigure
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
./install.sh "$out"
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
meta = {
|
||||
broken = true; # Not compatible with solo5 ≥ 0.7
|
||||
description = "Freestanding OCaml runtime";
|
||||
license = lib.licenses.mit;
|
||||
maintainers = [ lib.maintainers.sternenseemann ];
|
||||
homepage = "https://github.com/mirage/ocaml-freestanding";
|
||||
platforms = map ({ arch, os }: "${arch}-${os}") (
|
||||
lib.cartesianProduct {
|
||||
arch = [
|
||||
"aarch64"
|
||||
"x86_64"
|
||||
];
|
||||
os = [ "linux" ];
|
||||
}
|
||||
++ [
|
||||
{
|
||||
arch = "x86_64";
|
||||
os = "freebsd";
|
||||
}
|
||||
{
|
||||
arch = "x86_64";
|
||||
os = "openbsd";
|
||||
}
|
||||
]
|
||||
);
|
||||
};
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
commit 637b7ce639d54e617170433aa9596176b167d085
|
||||
Author: sternenseemann <0rpkxez4ksa01gb3typccl0i@systemli.org>
|
||||
Date: Thu Mar 18 01:07:49 2021 +0100
|
||||
|
||||
Allow building without ocamlfind and opam
|
||||
|
||||
This change is the result of my first go at packaging ocaml-freestanding
|
||||
for NixOS. Our build infrastructure for ocaml there is completely
|
||||
independent of opam at the moment, so depending on opam for the build
|
||||
time is not an option, especially in this case where the information it
|
||||
would give us would be garbage.
|
||||
|
||||
Fortunately the build environment plays nicely with pkg-config which is
|
||||
already heavily used by ocaml-freestanding. This patch leaves pkg-config
|
||||
to its own devices if opam is not present (it can be assisted by a
|
||||
manually set PKG_CONFIG_PATH environment variable).
|
||||
|
||||
Additionally, in configure.sh we check if the target ocaml source
|
||||
directory already exists. This allows for building ocaml-freestanding
|
||||
without the ocaml-src package (which would be unnecessarily cumbersome
|
||||
to package for NixOS) and ocamlfind (one less dependency is always a
|
||||
nice bonus). The Makefile needs no fix since the target ocaml/Makefile
|
||||
won't be built if it's already present.
|
||||
|
||||
diff --git a/configure.sh b/configure.sh
|
||||
index 4d154ed..c254f7b 100755
|
||||
--- a/configure.sh
|
||||
+++ b/configure.sh
|
||||
@@ -1,6 +1,8 @@
|
||||
#!/bin/sh
|
||||
|
||||
-export PKG_CONFIG_PATH=$(opam config var prefix)/lib/pkgconfig
|
||||
+if command -v opam &> /dev/null; then
|
||||
+ export PKG_CONFIG_PATH=$(opam config var prefix)/lib/pkgconfig
|
||||
+fi
|
||||
pkg_exists() {
|
||||
pkg-config --exists "$@"
|
||||
}
|
||||
@@ -21,7 +23,7 @@ if [ -z "${PKG_CONFIG_DEPS}" ]; then
|
||||
echo "ERROR: solo5-bindings-hvt, solo5-bindings-spt, solo5-bindings-virtio, solo5-bindings-muen, solo5-bindings-genode or solo5-bindings-xen must be installed." 1>&2
|
||||
exit 1
|
||||
fi
|
||||
-ocamlfind query ocaml-src >/dev/null || exit 1
|
||||
+[ -e "$(dirname "$0")/ocaml" ] || ocamlfind query ocaml-src >/dev/null || exit 1
|
||||
|
||||
FREESTANDING_CFLAGS="$(pkg-config --cflags ${PKG_CONFIG_DEPS})"
|
||||
BUILD_ARCH="$(uname -m)"
|
||||
@@ -26,8 +26,6 @@
|
||||
ipaddr-cstruct,
|
||||
lru,
|
||||
metrics,
|
||||
withFreestanding ? false,
|
||||
ocaml-freestanding,
|
||||
}:
|
||||
|
||||
buildDunePackage rec {
|
||||
@@ -64,9 +62,6 @@ buildDunePackage rec {
|
||||
metrics
|
||||
arp
|
||||
mirage-flow
|
||||
]
|
||||
++ lib.optionals withFreestanding [
|
||||
ocaml-freestanding
|
||||
];
|
||||
|
||||
doCheck = true;
|
||||
|
||||
@@ -1,70 +0,0 @@
|
||||
{
|
||||
lib,
|
||||
stdenv,
|
||||
buildDunePackage,
|
||||
fetchFromGitHub,
|
||||
fetchpatch,
|
||||
cmdliner,
|
||||
ctypes,
|
||||
ctypes-foreign,
|
||||
dune-configurator,
|
||||
npy,
|
||||
ocaml-compiler-libs,
|
||||
ppx_custom_printf,
|
||||
ppx_expect,
|
||||
ppx_sexp_conv,
|
||||
sexplib,
|
||||
stdio,
|
||||
torch,
|
||||
}:
|
||||
|
||||
buildDunePackage rec {
|
||||
pname = "torch";
|
||||
version = "0.17";
|
||||
|
||||
minimalOCamlVersion = "4.08";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "LaurentMazare";
|
||||
repo = "ocaml-${pname}";
|
||||
rev = version;
|
||||
hash = "sha256-z/9NUBjeFWE63Z/e8OyzDiy8hrn6qzjaiBH8G9MPeos=";
|
||||
};
|
||||
|
||||
patches = [
|
||||
# Pytorch 2.0 support. Drop when it reaches a release
|
||||
(fetchpatch {
|
||||
url = "https://github.com/LaurentMazare/ocaml-torch/commit/ef7ef30cafecb09e45ec1ed8ce4bedae5947cfa5.patch";
|
||||
hash = "sha256-smdwKy40iIISp/25L2J4az6KmqFS1soeChBElUyhl5A=";
|
||||
})
|
||||
];
|
||||
|
||||
buildInputs = [ dune-configurator ];
|
||||
|
||||
propagatedBuildInputs = [
|
||||
cmdliner
|
||||
ctypes
|
||||
ctypes-foreign
|
||||
npy
|
||||
ocaml-compiler-libs
|
||||
ppx_custom_printf
|
||||
ppx_expect
|
||||
ppx_sexp_conv
|
||||
sexplib
|
||||
stdio
|
||||
torch
|
||||
torch.dev
|
||||
];
|
||||
|
||||
preBuild = "export LIBTORCH=${torch.dev}/";
|
||||
|
||||
doCheck = !stdenv.hostPlatform.isAarch64;
|
||||
|
||||
meta = {
|
||||
inherit (src.meta) homepage;
|
||||
description = "Ocaml bindings to Pytorch";
|
||||
maintainers = [ lib.maintainers.bcdarwin ];
|
||||
license = lib.licenses.asl20;
|
||||
broken = true; # Not compatible with libtorch ≥ 2.3.0
|
||||
};
|
||||
}
|
||||
@@ -1439,8 +1439,6 @@ let
|
||||
|
||||
ocaml_expat = callPackage ../development/ocaml-modules/expat { };
|
||||
|
||||
ocaml-freestanding = callPackage ../development/ocaml-modules/ocaml-freestanding { };
|
||||
|
||||
ocaml_gettext = callPackage ../development/ocaml-modules/ocaml-gettext { };
|
||||
|
||||
ocaml_libvirt = callPackage ../development/ocaml-modules/ocaml-libvirt { };
|
||||
@@ -2117,10 +2115,6 @@ let
|
||||
|
||||
topkg = callPackage ../development/ocaml-modules/topkg { };
|
||||
|
||||
torch = callPackage ../development/ocaml-modules/torch {
|
||||
torch = pkgs.libtorch-bin;
|
||||
};
|
||||
|
||||
trace = callPackage ../development/ocaml-modules/trace { };
|
||||
|
||||
trace-tef = callPackage ../development/ocaml-modules/trace/tef.nix { };
|
||||
@@ -2324,8 +2318,10 @@ let
|
||||
dune_2 = pkgs.dune_2; # Added 2025-12-08
|
||||
dune_3 = pkgs.dune_3; # Added 2025-12-08
|
||||
gd4o = throw "ocamlPackages.gd4o is not maintained, use ocamlPackages.gd instead";
|
||||
ocaml-freestanding = throw "ocamlPackages.ocaml-freestanding has been removed due to being broken for more than a year; see RFC 180"; # Added 2026-02-05
|
||||
ocaml-vdom = throw "2023-10-09: ocamlPackages.ocaml-vdom was renamed to ocamlPackages.vdom";
|
||||
ocaml_lwt = throw "ocamlPackages.ocaml_lwt has been renamed to ocamlPackages.lwt"; # Added 2025-12-05
|
||||
torch = throw "ocamlPackages.torch has been removed due to being broken for more than a year; see RFC 180"; # Added 2026-02-05
|
||||
}
|
||||
)).overrideScope
|
||||
liftJaneStreet;
|
||||
|
||||
Reference in New Issue
Block a user