forgejo-lts: 7.0.10 -> 7.0.11
[NixPkgs.git] / pkgs / development / libraries / allegro / 5.nix
blobee337673ee070af896aaeb17caacebb16de2c058
1 { lib
2 , alsa-lib
3 , cmake
4 , enet
5 , fetchFromGitHub
6 , flac
7 , freetype
8 , gtk3
9 , libGL
10 , libGLU
11 , libjpeg
12 , libopus
13 , libpng
14 , libpthreadstubs
15 , libpulseaudio
16 , libtheora
17 , libvorbis
18 , libwebp
19 , libX11
20 , libXcursor
21 , libXdmcp
22 , libXext
23 , libXfixes
24 , libXi
25 , libXpm
26 , libXt
27 , libXxf86dga
28 , libXxf86misc
29 , libXxf86vm
30 , openal
31 , pcre
32 , physfs
33 , pkg-config
34 , stdenv
35 , texinfo
36 , xorgproto
37 , zlib
40 stdenv.mkDerivation rec {
41   pname = "allegro";
42   version = "5.2.9.1";
44   src = fetchFromGitHub {
45     owner = "liballeg";
46     repo = "allegro5";
47     rev = version;
48     sha256 = "sha256-n2OCmZmAqeXjtnCTqJgQ5q4j8/lnPfH+5tpWKIFKle0=";
49   };
51   nativeBuildInputs = [
52     cmake
53     pkg-config
54   ];
56   buildInputs = [
57     enet
58     flac
59     freetype
60     gtk3
61     libGL
62     libGLU
63     libjpeg
64     libopus
65     libpng
66     libtheora
67     libvorbis
68     libwebp
69     openal
70     pcre
71     physfs
72     texinfo
73     zlib
74   ] ++ lib.optionals stdenv.hostPlatform.isLinux [
75     alsa-lib
76     libpthreadstubs
77     libpulseaudio
78     libX11
79     libXcursor
80     libXdmcp
81     libXext
82     libXfixes
83     libXi
84     libXpm
85     libXt
86     libXxf86dga
87     libXxf86misc
88     libXxf86vm
89     xorgproto
90   ];
92   postPatch = ''
93     sed -e 's@/XInput2.h@/XI2.h@g' -i CMakeLists.txt "src/"*.c
94     sed -e 's@Kernel/IOKit/hidsystem/IOHIDUsageTables.h@IOKit/hid/IOHIDUsageTables.h@g' -i include/allegro5/platform/alosx.h
95     sed -e 's@OpenAL/@AL/@g' -i addons/audio/openal.c
96   '';
98   cmakeFlags = [ "-DCMAKE_SKIP_RPATH=ON" ];
100   meta = with lib; {
101     description = "Game programming library";
102     homepage = "https://liballeg.org/";
103     license = licenses.zlib;
104     maintainers = [ maintainers.raskin ];
105     platforms = platforms.linux ++ platforms.darwin;
106   };