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
69 lines
1.4 KiB
Nix
69 lines
1.4 KiB
Nix
{
|
|
lib,
|
|
stdenv,
|
|
fetchurl,
|
|
ocaml,
|
|
findlib,
|
|
ocamlbuild,
|
|
topkg,
|
|
ctypes,
|
|
ctypes-foreign,
|
|
result,
|
|
SDL2,
|
|
pkg-config,
|
|
}:
|
|
|
|
if lib.versionOlder ocaml.version "4.03" then
|
|
throw "tsdl is not available for OCaml ${ocaml.version}"
|
|
else
|
|
|
|
let
|
|
pname = "tsdl";
|
|
version = "1.1.0";
|
|
webpage = "https://erratique.ch/software/${pname}";
|
|
in
|
|
|
|
stdenv.mkDerivation {
|
|
pname = "ocaml${ocaml.version}-${pname}";
|
|
inherit version;
|
|
|
|
src = fetchurl {
|
|
url = "${webpage}/releases/${pname}-${version}.tbz";
|
|
hash = "sha256-ZN4+trqesU1IREKcwm1Ro37jszKG8XcVigoE4BdGhzs=";
|
|
};
|
|
|
|
strictDeps = true;
|
|
|
|
nativeBuildInputs = [
|
|
pkg-config
|
|
ocaml
|
|
findlib
|
|
ocamlbuild
|
|
topkg
|
|
];
|
|
buildInputs = [ topkg ];
|
|
propagatedBuildInputs = [
|
|
SDL2
|
|
ctypes
|
|
ctypes-foreign
|
|
];
|
|
|
|
preConfigure = ''
|
|
# The following is done to avoid an additional dependency (ncurses)
|
|
# due to linking in the custom bytecode runtime. Instead, just
|
|
# compile directly into a native binary, even if it's just a
|
|
# temporary build product.
|
|
substituteInPlace myocamlbuild.ml \
|
|
--replace ".byte" ".native"
|
|
'';
|
|
|
|
inherit (topkg) buildPhase installPhase;
|
|
|
|
meta = with lib; {
|
|
homepage = webpage;
|
|
description = "Thin bindings to the cross-platform SDL library";
|
|
license = licenses.isc;
|
|
inherit (ocaml.meta) platforms;
|
|
};
|
|
}
|