diff --git a/pkgs/applications/misc/xsw/default.nix b/pkgs/applications/misc/xsw/default.nix new file mode 100644 index 000000000000..57ea8fe19218 --- /dev/null +++ b/pkgs/applications/misc/xsw/default.nix @@ -0,0 +1,28 @@ +{ stdenv, fetchFromGitHub, pkgconfig, autoconf, automake, SDL, SDL_image, SDL_ttf, SDL_gfx, flex, bison }: + +stdenv.mkDerivation rec { + name = "xsw-${version}"; + version = "0.1.2"; + + src = fetchFromGitHub { + owner = "andrenho"; + repo = "xsw"; + rev = version; + sha256 = "092vp61ngd2vscsvyisi7dv6qrk5m1i81gg19hyfl5qvjq5p0p8g"; + }; + + buildInputs = [ pkgconfig autoconf automake SDL SDL_image SDL_ttf SDL_gfx flex bison ]; + + patches = [ + ./parse.patch # Fixes compilation error by avoiding redundant definitions. + ]; + + meta = with stdenv.lib; { + inherit (src.meta) homepage; + description = "A slide show presentation tool"; + + platforms = platforms.unix; + license = licenses.gpl3; + maintainers = [ maintainers.vrthra ]; + }; +} diff --git a/pkgs/applications/misc/xsw/parse.patch b/pkgs/applications/misc/xsw/parse.patch new file mode 100644 index 000000000000..6db6c14c26a7 --- /dev/null +++ b/pkgs/applications/misc/xsw/parse.patch @@ -0,0 +1,21 @@ +The `%code` causes Color definition to be added in both parser.h and parser.c +causing duplicate definitions error. This ensures that once it has been included +as part of parser.h, it wont be redefined in parser.c + +--- xsw-0.1.2-src/src/parser.y 1969-12-31 16:00:01.000000000 -0800 ++++ xsw-0.1.2-src/src/parser.y 2016-06-28 13:21:35.707027770 -0700 +@@ -38,7 +38,13 @@ + + %} + +-%code requires { typedef struct { unsigned char c; } Color; } ++%code requires ++{ ++#ifndef COLORDEF ++#define COLORDEF ++typedef struct { unsigned char c; } Color; ++#endif ++} + + %token SLIDE COLON HIFEN TEXT X Y W H IMAGE SIZE SCALE TEMPLATE BACKGROUND FONT + %token STYLE ALIGN EXPAND PLUS IMAGE_PATH diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index bb593854d5bf..bd53a7de54cd 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -17184,6 +17184,13 @@ in libpng = libpng12; }; + xsw = callPackage ../applications/misc/xsw { + # Enable the next line to use this in terminal. + # Note that it requires sixel capable terminals such as mlterm + # or xterm -ti 340 + SDL = SDL_sixel; + }; + xwiimote = callPackage ../misc/drivers/xwiimote { bluez = pkgs.bluez5.override { enableWiimote = true;