Files
nixpkgs/pkgs/development/ocaml-modules/tsdl/default.nix
T
Ihar Hrachyshka 567e8dfd8e treewide: clean up 'meta = with' pattern
This commit was created by a combination of scripts and tools:
- an ast-grep script to prefix things in meta with `lib.`,
- a modified nixf-diagnose / nixf combination to remove unused `with
lib;`, and
- regular nixfmt.

Co-authored-by: Wolfgang Walther <walther@technowledgy.de>
2025-12-10 18:09:49 +01:00

66 lines
1.3 KiB
Nix

{
lib,
stdenv,
fetchurl,
ocaml,
findlib,
ocamlbuild,
topkg,
ctypes,
ctypes-foreign,
result,
SDL2,
pkg-config,
}:
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 = {
homepage = webpage;
description = "Thin bindings to the cross-platform SDL library";
license = lib.licenses.isc;
inherit (ocaml.meta) platforms;
broken = lib.versionOlder ocaml.version "4.03";
};
}