about summary refs log tree commit diff
path: root/nixpkgs/pkgs/desktops/plasma-5/3rdparty/addons/krunner-symbols.nix
blob: 620d56f8e2c1001f715c1e298ac0a87857eea7a6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
{ lib
, stdenv
, cmake
, fetchFromGitHub
, extra-cmake-modules
, qtbase
, wrapQtAppsHook
, ki18n
, kdelibs4support
, krunner
}:

stdenv.mkDerivation rec {
  pname = "krunner-symbols";
  version = "1.1.0";

  src = fetchFromGitHub {
    owner = "domschrei";
    repo = "krunner-symbols";
    rev = version;
    sha256 = "sha256-YsoZdPTWpk3/YERwerrVEcaf2IfGVJwpq32onhP8Exo=";
  };

  buildInputs = [ qtbase ki18n kdelibs4support krunner ];
  nativeBuildInputs = [ cmake wrapQtAppsHook extra-cmake-modules ];

  postPatch = ''
    # symbols.cpp hardcodes the location of configuration files
    substituteInPlace symbols.cpp \
      --replace "/usr/share/config/krunner-symbol" "$out/share/config/krunner-symbol"

    # change cmake flag names to output using the correct qt-plugin prefix and kservice location
    substituteInPlace CMakeLists.txt \
      --replace "LOCATION_PLUGIN" "KDE_INSTALL_PLUGINDIR" \
      --replace "LOCATION_DESKTOP" "KDE_INSTALL_KSERVICES5DIR"
  '';

  cmakeFlags = [ "-DLOCATION_CONFIG=share/config" ];

  meta = with lib; {
    description = "Little krunner plugin (Plasma 5) to retrieve unicode symbols, or any other string, based on a corresponding keyword";
    homepage = "https://github.com/domschrei/krunner-symbols";
    license = licenses.gpl3Plus;
    maintainers = with maintainers; [ hqurve ];
    platforms = platforms.linux;
  };
}