From 46336b6961b7a674491b04454bb0d449fbe5bf6e Mon Sep 17 00:00:00 2001 From: Pallav Agarwal Date: Fri, 10 Nov 2017 23:34:00 +0530 Subject: [PATCH] sdcv: 0.4.2 -> 0.5.2 --- pkgs/applications/misc/sdcv/default.nix | 43 +++++++++---------- pkgs/applications/misc/sdcv/sdcv.cpp.patch | 12 ------ .../misc/sdcv/sdcv.cpp.patch-darwin | 19 -------- pkgs/applications/misc/sdcv/utils.hpp.patch | 10 ----- 4 files changed, 20 insertions(+), 64 deletions(-) delete mode 100644 pkgs/applications/misc/sdcv/sdcv.cpp.patch delete mode 100644 pkgs/applications/misc/sdcv/sdcv.cpp.patch-darwin delete mode 100644 pkgs/applications/misc/sdcv/utils.hpp.patch diff --git a/pkgs/applications/misc/sdcv/default.nix b/pkgs/applications/misc/sdcv/default.nix index a538e53276bd..bf2de3a5f1b9 100644 --- a/pkgs/applications/misc/sdcv/default.nix +++ b/pkgs/applications/misc/sdcv/default.nix @@ -1,35 +1,32 @@ -{ stdenv, fetchurl, pkgconfig, glib, gettext }: +{ stdenv, fetchFromGitHub, cmake, pkgconfig, glib, gettext, readline }: stdenv.mkDerivation rec { - name= "sdcv-0.4.2"; + name = "sdcv-${version}"; + version = "0.5.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.linux; - }; - - src = fetchurl { - url = "mirror://sourceforge/sdcv/${name}.tar.bz2"; - sha256 = "1cnyv7gd1qvz8ma8545d3aq726wxrx4km7ykl97831irx5wz0r51"; + src = fetchFromGitHub { + owner = "Dushistov"; + repo = "sdcv"; + rev = "v${version}"; + sha256 = "1b67s4nj0s5fh3cjk7858qvhiisc557xx72xwzrb8hq6ijpwx5k0"; }; hardeningDisable = [ "format" ]; + nativeBuildInputs = [ cmake pkgconfig ]; + buildInputs = [ glib gettext readline ]; - patches = ( if stdenv.isDarwin - then [ ./sdcv.cpp.patch-darwin ./utils.hpp.patch ] - else [ ./sdcv.cpp.patch ] ); - - nativeBuildInputs = [ pkgconfig ]; - buildInputs = [ glib gettext ]; - - preBuild = '' - sed -i 's/guint32 page_size/size_t page_size/' src/lib/lib.cpp + preInstall = '' + touch locale ''; NIX_CFLAGS_COMPILE = "-D__GNU_LIBRARY__" + stdenv.lib.optionalString stdenv.isDarwin " -lintl"; -} + meta = with stdenv.lib; { + homepage = https://dushistov.github.io/sdcv/; + description = "Console version of StarDict"; + maintainers = with maintainers; [ lovek323 ]; + license = licenses.gpl2; + platforms = platforms.linux; + }; +} diff --git a/pkgs/applications/misc/sdcv/sdcv.cpp.patch b/pkgs/applications/misc/sdcv/sdcv.cpp.patch deleted file mode 100644 index 6f835f16e458..000000000000 --- a/pkgs/applications/misc/sdcv/sdcv.cpp.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- a/src/utils.hpp -+++ b/src/utils.hpp -@@ -2,6 +2,9 @@ - #define _UTILS_HPP_ - - #include -+#include -+#include -+ - using std::string; - - extern bool stdio_getline(FILE *in, string &str); diff --git a/pkgs/applications/misc/sdcv/sdcv.cpp.patch-darwin b/pkgs/applications/misc/sdcv/sdcv.cpp.patch-darwin deleted file mode 100644 index 2ee9a24e0347..000000000000 --- a/pkgs/applications/misc/sdcv/sdcv.cpp.patch-darwin +++ /dev/null @@ -1,19 +0,0 @@ ---- a/src/sdcv.cpp -+++ b/src/sdcv.cpp -@@ -27,13 +27,13 @@ - #include - #include - #include -+#include -+#include -+#include - #include - #include - #include - #include --#include --#include --#include - - #include "libwrapper.hpp" - #include "readline.hpp" diff --git a/pkgs/applications/misc/sdcv/utils.hpp.patch b/pkgs/applications/misc/sdcv/utils.hpp.patch deleted file mode 100644 index c08641abd6b9..000000000000 --- a/pkgs/applications/misc/sdcv/utils.hpp.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/src/utils.hpp -+++ b/src/utils.hpp -@@ -2,6 +2,7 @@ - #define _UTILS_HPP_ - - #include -+#include - using std::string; - - extern bool stdio_getline(FILE *in, string &str);