nixpkgs/pkgs/by-name/sd/sdcv/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

40 lines
1.0 KiB
Nix

{ lib, stdenv, fetchFromGitHub, cmake, pkg-config, glib, gettext, readline }:
stdenv.mkDerivation rec {
pname = "sdcv";
version = "0.5.5";
src = fetchFromGitHub {
owner = "Dushistov";
repo = "sdcv";
rev = "v${version}";
sha256 = "sha256-EyvljVXhOsdxIYOGTzD+T16nvW7/RNx3DuQ2OdhjXJ4=";
};
hardeningDisable = [ "format" ];
nativeBuildInputs = [ cmake pkg-config ];
buildInputs = [ glib gettext readline ];
postPatch = ''
# https://github.com/Dushistov/sdcv/pull/104
substituteInPlace src/stardict_lib.cpp --replace-fail \
"gchar *nextchar = g_utf8_next_char(sWord)" \
"gchar *nextchar = const_cast<gchar*>(g_utf8_next_char(sWord))"
'';
preInstall = ''
mkdir locale
'';
env.NIX_CFLAGS_COMPILE = "-D__GNU_LIBRARY__";
meta = with lib; {
homepage = "https://dushistov.github.io/sdcv/";
description = "Console version of StarDict";
maintainers = with maintainers; [ lovek323 ];
license = licenses.gpl2;
platforms = platforms.unix;
mainProgram = "sdcv";
};
}