1{ lib
2, stdenv
3, fetchFromGitHub
4, autoreconfHook
5, pkg-config
6, boost
7, SDL2
8, SDL2_ttf
9, SDL2_image
10}:
11
12stdenv.mkDerivation (finalAttrs: {
13 pname = "libwtk-sdl2";
14 version = "unstable-2023-02-28";
15
16 src = fetchFromGitHub {
17 owner = "muesli4";
18 repo = "libwtk-sdl2";
19 rev = "0504f8342c8c97d0c8b43d33751427c564ad8d44";
20 sha256 = "sha256-NAjsDQ4/hklYRfa85uleOr50tmc6UJVo2xiDnEbmIxk=";
21 };
22
23 nativeBuildInputs = [
24 pkg-config
25 autoreconfHook
26 ];
27 buildInputs = [
28 boost
29 SDL2
30 SDL2_ttf
31 SDL2_image
32 ];
33 # From some reason, this is needed as otherwise SDL.h is not found
34 NIX_CFLAGS_COMPILE = "-I${SDL2.dev}/include/SDL2";
35
36 outputs = [ "out" "dev" "lib" ];
37
38 meta = with lib; {
39 description = "Simplistic SDL2 GUI framework in early developement";
40 homepage = "https://github.com/muesli4/libwtk-sdl2";
41 # See: https://github.com/muesli4/mpd-touch-screen-gui/tree/master/LICENSES
42 license = licenses.lgpl3Plus;
43 maintainers = with maintainers; [ doronbehar ];
44 /* Partial darwin build failure log (from ofborg):
45 geometry.cpp:95:34: error: no member named 'abs' in namespace 'std'
46 > return { std::abs(v.w), std::abs(v.h) };
47 > ~~~~~^
48 */
49 platforms = platforms.linux;
50 };
51})