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

95 lines
2.0 KiB
Nix

{
lib,
stdenv,
fetchFromGitHub,
pkg-config,
SDL2,
libGLU,
libGL,
openal,
luajit,
lua5_1,
freetype,
physfs,
libmodplug,
mpg123,
libvorbis,
libogg,
libtheora,
which,
autoconf,
automake,
libtool,
xorg,
}:
stdenv.mkDerivation rec {
pname = "love";
version = "11.5";
src = fetchFromGitHub {
owner = "love2d";
repo = "love";
rev = version;
sha256 = "sha256-wZktNh4UB3QH2wAIIlnYUlNoXbjEDwUmPnT4vesZNm0=";
};
nativeBuildInputs = [
pkg-config
autoconf
automake
];
buildInputs = [
SDL2
openal
(if stdenv.isDarwin then lua5_1 else luajit)
freetype
physfs
libmodplug
mpg123
libvorbis
libogg
libtheora
which
libtool
]
++ lib.optionals stdenv.isLinux [
xorg.libX11 # SDL2 optional depend, for SDL_syswm.h
libGLU
libGL
];
preConfigure = "$shell ./platform/unix/automagic";
configureFlags = [
(if stdenv.isDarwin then "--with-lua=lua" else "--with-lua=luajit")
];
env.NIX_CFLAGS_COMPILE = "-DluaL_reg=luaL_Reg"; # needed since luajit-2.1.0-beta3
# Fix Darwin bundle/dylib linking and macOS function calls
preBuild = lib.optionalString stdenv.isDarwin ''
# Fix libtool to use dynamiclib instead of bundle for Darwin
substituteInPlace libtool \
--replace "-bundle" "-dynamiclib" \
--replace "-Wl,-bundle" "-Wl,-dynamiclib"
substituteInPlace src/love.cpp \
--replace "love::macosx::checkDropEvents()" "std::string(\"\")" \
--replace "love::macosx::getLoveInResources()" "std::string(\"\")"
'';
postFixup = lib.optionalString stdenv.isDarwin ''
install_name_tool -change ".libs/liblove-11.5.so" "$out/lib/liblove-11.5.so" "$out/bin/love"
'';
meta = {
homepage = "https://love2d.org";
description = "Lua-based 2D game engine/scripting language";
mainProgram = "love";
license = lib.licenses.zlib;
platforms = lib.platforms.linux ++ lib.platforms.darwin;
maintainers = [ lib.maintainers.raskin ];
};
}