Files
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

78 lines
1.5 KiB
Nix

{
stdenv,
lib,
fetchurl,
makeWrapper,
getconf,
ocaml,
unzip,
ncurses,
curl,
bubblewrap,
}:
assert lib.versionAtLeast ocaml.version "4.08.0";
stdenv.mkDerivation (finalAttrs: {
pname = "opam";
version = "2.4.1";
src = fetchurl {
url = "https://github.com/ocaml/opam/releases/download/${finalAttrs.version}/opam-full-${finalAttrs.version}.tar.gz";
hash = "sha256-xNBTApeTxxTk5zQLEVdCjA+QeDWF+xfzUVgkemQEZ9k=";
};
strictDeps = true;
nativeBuildInputs = [
makeWrapper
unzip
ocaml
curl
];
buildInputs = [
ncurses
getconf
]
++ lib.optionals stdenv.hostPlatform.isLinux [ bubblewrap ];
patches = [ ./opam-shebangs.patch ];
configureFlags = [
"--with-vendored-deps"
"--with-mccs"
];
outputs = [
"out"
"installer"
];
setOutputFlags = false;
postInstall = ''
wrapProgram $out/bin/opam \
--suffix PATH : ${
lib.makeBinPath (
[
curl
getconf
unzip
]
++ lib.optionals stdenv.hostPlatform.isLinux [ bubblewrap ]
)
}
$out/bin/opam-installer --prefix=$installer opam-installer.install
'';
doCheck = false;
meta = {
description = "Package manager for OCaml";
homepage = "https://opam.ocaml.org/";
changelog = "https://github.com/ocaml/opam/raw/${finalAttrs.version}/CHANGES";
maintainers = [ ];
license = lib.licenses.lgpl21Only;
platforms = lib.platforms.all;
};
})