2024-09-22 21:46:26 +00:00
|
|
|
{
|
|
|
|
pkgs,
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
fetchgit,
|
|
|
|
fetchurl,
|
|
|
|
makeWrapper,
|
|
|
|
darwin,
|
|
|
|
version ? "git",
|
2024-09-28 00:46:33 +00:00
|
|
|
testers,
|
2024-09-22 21:46:26 +00:00
|
|
|
}:
|
|
|
|
let
|
2024-09-28 00:46:33 +00:00
|
|
|
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
|
2024-09-22 21:46:26 +00:00
|
|
|
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
|
2024-09-28 00:46:33 +00:00
|
|
|
] ++ lib.optionals (stdenv.isDarwin && stdenv.isAarch64) [ darwin.autoSignDarwinBinariesHook ];
|
2024-09-22 21:46:26 +00:00
|
|
|
|
|
|
|
meta = {
|
|
|
|
homepage = "https://libsdl.org/";
|
|
|
|
license = lib.licenses.bsd3;
|
|
|
|
platforms = lib.platforms.unix;
|
|
|
|
description = "SDL3";
|
|
|
|
longDescription = ''
|
2024-09-28 00:46:33 +00:00
|
|
|
SDL3
|
2024-09-22 21:46:26 +00:00
|
|
|
'';
|
2024-09-28 00:46:33 +00:00
|
|
|
};
|
|
|
|
|
2024-09-22 21:46:26 +00:00
|
|
|
})
|