summary refs log tree commit diff
path: root/pkgs/desktops/xfce/core/xfce4-panel.nix
blob: b8ecae7e4e64309e4daf44b4d8d5b3a5d1c468a3 (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
48
49
50
51
52
53
54
55
56
57
58
59
{ stdenv, fetchurl, pkgconfig, intltool, gtk, libxfce4util, libxfce4ui
, libxfce4ui_gtk3, libwnck, exo, garcon, xfconf, libstartup_notification
, makeWrapper, xfce4-mixer, hicolor-icon-theme, tzdata
, withGtk3 ? false, gtk3, gettext, glib-networking
}:
let
  inherit (stdenv.lib) optional;
  p_name  = "xfce4-panel";
  ver_maj = "4.12";
  ver_min = "2";
in
stdenv.mkDerivation rec {
  name = "${p_name}-${ver_maj}.${ver_min}";

  src = fetchurl {
    url = "mirror://xfce/src/xfce/${p_name}/${ver_maj}/${name}.tar.bz2";
    sha256 = "1s8cvsrgmkmmm84g6mghpj2k4777gm22g5lrsf8pdy5qh6xql1a2";
  };

  patches = [ ./xfce4-panel-datadir.patch ];
  patchFlags = "-p1";

  postPatch = ''
    for f in $(find . -name \*.sh); do
      substituteInPlace $f --replace gettext ${gettext}/bin/gettext
    done
    substituteInPlace plugins/clock/clock.c \
       --replace "/usr/share/zoneinfo" "${tzdata}/share/zoneinfo" \
       --replace "if (!g_file_test (filename, G_FILE_TEST_IS_SYMLINK))" ""
  '';

  outputs = [ "out" "dev" "devdoc" ];

  buildInputs =
    [ pkgconfig intltool gtk libxfce4util exo libwnck
      garcon xfconf libstartup_notification makeWrapper hicolor-icon-theme
    ] ++ xfce4-mixer.gst_plugins
      ++ optional withGtk3 gtk3;

  propagatedBuildInputs = [ (if withGtk3 then libxfce4ui_gtk3 else libxfce4ui) ];

  configureFlags = optional withGtk3 "--enable-gtk3";

  postInstall = ''
    wrapProgram "$out/bin/xfce4-panel" \
      --prefix GST_PLUGIN_SYSTEM_PATH : "$GST_PLUGIN_SYSTEM_PATH" \
      --prefix GIO_EXTRA_MODULES : "${glib-networking}/lib/gio/modules"
  '';

  enableParallelBuilding = true;

  meta = with stdenv.lib; {
    homepage = https://www.xfce.org/projects/xfce4-panel;
    description = "Xfce panel";
    license = licenses.gpl2Plus;
    platforms = platforms.linux;
    maintainers = [ maintainers.eelco ];
  };
}