56 lines
1.1 KiB
Nix
56 lines
1.1 KiB
Nix
|
{
|
||
|
pkgs,
|
||
|
lib,
|
||
|
stdenv,
|
||
|
fetchgit,
|
||
|
fetchurl,
|
||
|
makeWrapper,
|
||
|
darwin,
|
||
|
version ? "git",
|
||
|
testers
|
||
|
}:
|
||
|
let
|
||
|
platform = with stdenv;
|
||
|
if isDarwin then "macosx"
|
||
|
else if isCygwin then "cygwin"
|
||
|
else if (isFreeBSD || isOpenBSD) then "bsd"
|
||
|
else if isSunOS then "solaris"
|
||
|
else "linux"; # Should be a sane default
|
||
|
in
|
||
|
stdenv.mkDerivation (finalAttrs: {
|
||
|
pname = "SDL3";
|
||
|
inherit version;
|
||
|
|
||
|
src = fetchgit {
|
||
|
url = "https://github.com/libsdl-org/SDL";
|
||
|
rev = "3bc2bd790c04071aa65f09e71d41f7aa9ad9e639";
|
||
|
sha256 = "sha256-jaojRirdyhCrFRSy187xhyNVSbSGhqhsyCt92AG0Sd0=";
|
||
|
};
|
||
|
|
||
|
# -fno-strict-overflow is not a supported argument in clang
|
||
|
hardeningDisable = lib.optionals stdenv.cc.isClang [ "strictoverflow" ];
|
||
|
|
||
|
cmakeFlags = [
|
||
|
"-DCMAKE_BUILD_TYPE=Release"
|
||
|
];
|
||
|
|
||
|
nativeBuildInputs = [
|
||
|
makeWrapper
|
||
|
pkgs.hostname
|
||
|
pkgs.cmake
|
||
|
] ++ lib.optionals (stdenv.isDarwin && stdenv.isAarch64) [
|
||
|
darwin.autoSignDarwinBinariesHook
|
||
|
];
|
||
|
|
||
|
meta = {
|
||
|
homepage = "https://libsdl.org/";
|
||
|
license = lib.licenses.bsd3;
|
||
|
platforms = lib.platforms.unix;
|
||
|
description = "SDL3";
|
||
|
longDescription = ''
|
||
|
SDL3
|
||
|
'';
|
||
|
};
|
||
|
|
||
|
})
|