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

142 lines
2.4 KiB
Nix

{
lib,
alsa-lib,
cmake,
enet,
fetchFromGitHub,
fetchpatch2,
fixDarwinDylibNames,
flac,
freetype,
gitUpdater,
gtk3,
libGL,
libGLU,
libjpeg,
libpng,
libpthreadstubs,
libpulseaudio,
libtheora,
libvorbis,
libwebp,
libX11,
libXcursor,
libXdmcp,
libXext,
libXfixes,
libXi,
libXpm,
libXt,
libXxf86dga,
libXxf86misc,
libXxf86vm,
openal,
physfs,
pkg-config,
stdenv,
texinfo,
xorgproto,
zlib,
# https://github.com/liballeg/allegro5/blob/master/README_sdl.txt
useSDL ? false,
sdl2-compat ? null,
}:
assert useSDL -> sdl2-compat != null;
stdenv.mkDerivation rec {
pname = "allegro";
version = "5.2.10.1";
src = fetchFromGitHub {
owner = "liballeg";
repo = "allegro5";
rev = version;
sha256 = "sha256-agE3K+6VhhG/LO52fiesCsOq1fNYVRhdW7aKdPCbTOo=";
};
patches = [
(fetchpatch2 {
name = "Bump-CMake-minimum-version-to-3.5";
url = "https://github.com/liballeg/allegro5/commit/6e93fcaabaafd81701f4cd1b74f4b69dd598bc9b.patch?full_index=1";
hash = "sha256-IEnn66bS2m6MVFCNf341yLtd7jTl2gflL5EFJFmbEt4=";
})
];
nativeBuildInputs = [
cmake
pkg-config
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
fixDarwinDylibNames
];
buildInputs = [
enet
flac
freetype
gtk3
libGL
libGLU
libjpeg
libpng
libtheora
libvorbis
libwebp
openal
physfs
texinfo
zlib
]
++ lib.optionals stdenv.hostPlatform.isLinux [
alsa-lib
libpthreadstubs
libpulseaudio
libX11
libXcursor
libXdmcp
libXext
libXfixes
libXi
libXpm
libXt
libXxf86dga
libXxf86misc
libXxf86vm
xorgproto
]
++ lib.optionals useSDL [
sdl2-compat
];
postPatch = ''
sed -e 's@/XInput2.h@/XI2.h@g' -i CMakeLists.txt "src/"*.c
sed -e 's@Kernel/IOKit/hidsystem/IOHIDUsageTables.h@IOKit/hid/IOHIDUsageTables.h@g' -i include/allegro5/platform/alosx.h
sed -e 's@OpenAL/@AL/@g' -i addons/audio/openal.c
'';
cmakeFlags = [
"-DCMAKE_SKIP_RPATH=ON"
]
++ lib.optionals useSDL [
"ALLEGRO_SDL=ON"
];
outputs = [
"out"
"dev"
];
strictDeps = true;
passthru.updateScript = gitUpdater { };
meta = with lib; {
description = "Game programming library";
homepage = "https://liballeg.org/";
license = licenses.zlib;
maintainers = [ maintainers.raskin ];
platforms = platforms.linux ++ platforms.darwin;
};
}