nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 stdenv,
3 lib,
4 fetchFromGitHub,
5 pkg-config,
6 SDL,
7 SDL_image,
8 SDL_ttf,
9 SDL_gfx,
10 flex,
11 bison,
12}:
13
14let
15 makeSDLFlags = map (p: "-I${lib.getDev p}/include/SDL");
16
17in
18stdenv.mkDerivation rec {
19 pname = "xsw";
20 version = "0.1.2";
21
22 src = fetchFromGitHub {
23 owner = "andrenho";
24 repo = "xsw";
25 rev = version;
26 sha256 = "092vp61ngd2vscsvyisi7dv6qrk5m1i81gg19hyfl5qvjq5p0p8g";
27 };
28
29 nativeBuildInputs = [
30 pkg-config
31 flex
32 bison
33 ];
34
35 buildInputs = [
36 SDL
37 SDL_image
38 SDL_ttf
39 SDL_gfx
40 ];
41
42 env.NIX_CFLAGS_COMPILE =
43 toString (makeSDLFlags [
44 SDL
45 SDL_image
46 SDL_ttf
47 SDL_gfx
48 ])
49 + " -lSDL";
50
51 patches = [
52 ./parse.patch # Fixes compilation error by avoiding redundant definitions.
53 ./sdl-error.patch # Adds required include for SDL_GetError.
54 ];
55
56 meta = with lib; {
57 inherit (src.meta) homepage;
58 description = "Slide show presentation tool";
59
60 platforms = platforms.unix;
61 license = licenses.gpl3;
62 maintainers = [ ];
63 mainProgram = "xsw";
64 };
65}