nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 cmake,
6 pkg-config,
7 glib,
8 gettext,
9 readline,
10}:
11
12stdenv.mkDerivation rec {
13 pname = "sdcv";
14 version = "0.5.5";
15
16 src = fetchFromGitHub {
17 owner = "Dushistov";
18 repo = "sdcv";
19 rev = "v${version}";
20 sha256 = "sha256-EyvljVXhOsdxIYOGTzD+T16nvW7/RNx3DuQ2OdhjXJ4=";
21 };
22
23 hardeningDisable = [ "format" ];
24 nativeBuildInputs = [
25 cmake
26 pkg-config
27 ];
28 buildInputs = [
29 glib
30 gettext
31 readline
32 ];
33
34 postPatch = ''
35 # https://github.com/Dushistov/sdcv/pull/104
36 substituteInPlace src/stardict_lib.cpp --replace-fail \
37 "gchar *nextchar = g_utf8_next_char(sWord)" \
38 "gchar *nextchar = const_cast<gchar*>(g_utf8_next_char(sWord))"
39 '';
40
41 preInstall = ''
42 mkdir locale
43 '';
44
45 env.NIX_CFLAGS_COMPILE = "-D__GNU_LIBRARY__";
46
47 meta = with lib; {
48 homepage = "https://dushistov.github.io/sdcv/";
49 description = "Console version of StarDict";
50 maintainers = with maintainers; [ lovek323 ];
51 license = licenses.gpl2;
52 platforms = platforms.unix;
53 mainProgram = "sdcv";
54 };
55}