Merge pull request #619 from lovek323/sdcv

sdcv: add expression
This commit is contained in:
Evgeny Egorochkin 2013-06-17 16:29:53 -07:00
commit 88eff1efac
5 changed files with 74 additions and 0 deletions

View File

@ -0,0 +1,31 @@
{ stdenv, fetchurl, pkgconfig, glib, gettext }:
stdenv.mkDerivation rec {
name= "sdcv-0.4.2";
meta = {
homepage = http://sdcv.sourceforge.net/;
description = "Console version of StarDict program";
maintainers = with stdenv.lib.maintainers; [ lovek323 ];
license = stdenv.lib.licenses.gpl2;
platforms = stdenv.lib.platforms.unix;
};
src = fetchurl {
url = "mirror://sourceforge/sdcv/${name}.tar.bz2";
sha256 = "1cnyv7gd1qvz8ma8545d3aq726wxrx4km7ykl97831irx5wz0r51";
};
patches = ( if stdenv.isDarwin
then [ ./sdcv.cpp.patch-darwin ./utils.hpp.patch ]
else [ ./sdcv.cpp.patch ] );
buildInputs = [ pkgconfig glib gettext ];
preBuild = ''
sed -i 's/guint32 page_size/size_t page_size/' src/lib/lib.cpp
'';
NIX_CFLAGS_COMPILE = "-D__GNU_LIBRARY__";
}

View File

@ -0,0 +1,12 @@
--- a/src/utils.hpp
+++ b/src/utils.hpp
@@ -2,6 +2,9 @@
#define _UTILS_HPP_
#include <string>
+#include <stdio.h>
+#include <cstdlib>
+
using std::string;
extern bool stdio_getline(FILE *in, string &str);

View File

@ -0,0 +1,19 @@
--- a/src/sdcv.cpp
+++ b/src/sdcv.cpp
@@ -27,13 +27,13 @@
#include <cstdlib>
#include <cstdio>
#include <clocale>
+#include <string>
+#include <vector>
+#include <memory>
#include <glib.h>
#include <glib/gi18n.h>
#include <glib/gstdio.h>
#include <getopt.h>
-#include <string>
-#include <vector>
-#include <memory>
#include "libwrapper.hpp"
#include "readline.hpp"

View File

@ -0,0 +1,10 @@
--- a/src/utils.hpp
+++ b/src/utils.hpp
@@ -2,6 +2,7 @@
#define _UTILS_HPP_
#include <string>
+#include <cstdlib>
using std::string;
extern bool stdio_getline(FILE *in, string &str);

View File

@ -1617,6 +1617,8 @@ let
scrot = callPackage ../tools/graphics/scrot { };
sdcv = callPackage ../applications/misc/sdcv { };
seccure = callPackage ../tools/security/seccure/0.4.nix { };
setserial = builderDefsPackage (import ../tools/system/setserial) {