xmonad_log_applet: fix build

This commit is contained in:
Jan Tojnar 2018-08-08 06:35:10 +02:00
parent c3ce3714ac
commit ecaac2a5e8
No known key found for this signature in database
GPG key ID: 7FAB2A15F7A607A4
3 changed files with 53 additions and 45 deletions

View file

@ -1,44 +1,45 @@
{ stdenv, fetchFromGitHub, pkgconfig, autoreconfHook, glib, dbus-glib { stdenv, fetchFromGitHub, pkgconfig, autoreconfHook, glib, dbus-glib
, desktopSupport , desktopSupport, xlibs
, gtk2 , gtk2
, gtk3, gnome3
, libxfce4util, xfce4-panel , libxfce4util, xfce4-panel
}: }:
assert desktopSupport == "gnome3" || desktopSupport == "xfce4"; assert desktopSupport == "gnomeflashback" || desktopSupport == "xfce4";
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
version = "2.1.0"; version = "unstable-2017-09-15";
pname = "xmonad-log-applet"; pname = "xmonad-log-applet";
name = "${pname}-${version}-${desktopSupport}"; name = "${pname}-${desktopSupport}-${version}";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "alexkay"; owner = "kalj";
repo = pname; repo = pname;
rev = "${version}"; rev = "a1b294cad2f266e4f18d9de34167fa96a0ffdba8";
sha256 = "1g1fisyaw83v72b25fxfjln8f4wlw3rm6nyk27mrqlhsc1spnb5p"; sha256 = "042307grf4zvn61gnflhsj5xsjykrk9sjjsprprm4iij0qpybxcw";
}; };
buildInputs = with stdenv.lib; buildInputs = [ glib dbus-glib xlibs.xcbutilwm ]
[ glib dbus-glib ] ++ stdenv.lib.optionals (desktopSupport == "gnomeflashback") [ gtk3 gnome3.gnome-panel ]
# TODO: no idea where to find libpanelapplet-4.0 ++ stdenv.lib.optionals (desktopSupport == "xfce4") [ gtk2 libxfce4util xfce4-panel ]
++ optionals (desktopSupport == "gnome3") [ ] ;
++ optionals (desktopSupport == "xfce4") [ gtk2 libxfce4util xfce4-panel ]
;
nativeBuildInputs = [ autoreconfHook pkgconfig ]; nativeBuildInputs = [ autoreconfHook pkgconfig ];
configureFlags = [ "--with-panel=${desktopSupport}" ]; configureFlags = [ "--with-panel=${desktopSupport}" ];
patches = [ ./fix-paths.patch ]; patches = [ ./fix-paths.patch ];
# Setup hook replaces ${prefix} in pc files so we cannot use
# --define-variable=prefix=$prefix
PKG_CONFIG_LIBXFCE4PANEL_1_0_LIBDIR = "$(out)/lib";
meta = with stdenv.lib; { meta = with stdenv.lib; {
homepage = https://github.com/alexkay/xmonad-log-applet; homepage = https://github.com/kalj/xmonad-log-applet;
license = licenses.bsd3; license = licenses.bsd3;
description = "An applet that will display XMonad log information (${desktopSupport} version)"; description = "An applet that will display XMonad log information (${desktopSupport} version)";
platforms = platforms.linux; platforms = platforms.linux;
maintainers = with maintainers; [ abbradar ]; maintainers = with maintainers; [ abbradar ];
broken = desktopSupport == "gnome3";
}; };
} }

View file

@ -1,50 +1,57 @@
diff --git a/Makefile.am b/Makefile.am
index 619012d..dcc6d3c 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,4 +1,5 @@
plugindir = $(PLUGIN_DIR)
+SESSION_BUS_SERVICES_DIR = $(prefix)/share/dbus-1/services
plugin_PROGRAMS = xmonad-log-applet
xmonad_log_applet_SOURCES = main.c
diff --git a/configure.ac b/configure.ac
index ad4cffb..110c953 100644
--- a/configure.ac --- a/configure.ac
+++ b/configure.ac +++ b/configure.ac
@@ -27,28 +27,28 @@ AC_ARG_WITH( @@ -20,7 +20,7 @@
PKG_CHECK_MODULES(XCB, xcb xcb-ewmh)
PKG_CHECK_MODULES(DBUS_GLIB, dbus-glib-1 >= 0.80)
-SESSION_BUS_SERVICES_DIR=`$PKG_CONFIG --variable=session_bus_services_dir dbus-1`
+SESSION_BUS_SERVICES_DIR=$prefix/share/dbus-1/services
AC_SUBST([SESSION_BUS_SERVICES_DIR])
AC_ARG_WITH(
@@ -32,35 +32,35 @@
AS_IF( AS_IF(
[test "x$panel" = xgnome2], [test "x$panel" = xgnome2],
[PKG_CHECK_MODULES(LIBPANEL, libpanelapplet-3.0 >= 2.32.0)] [PKG_CHECK_MODULES(LIBPANEL, libpanelapplet-3.0 >= 2.32.0)]
- LIBPANEL_APPLET_DIR=`$PKG_CONFIG --variable=prefix libpanelapplet-3.0`/share/gnome-panel/applets - LIBPANEL_APPLET_DIR=`$PKG_CONFIG --variable=prefix libpanelapplet-3.0`/share/gnome-panel/applets
- PLUGIN_DIR=`$PKG_CONFIG --variable=prefix libpanelapplet-3.0`/libexec - PLUGIN_DIR=`$PKG_CONFIG --variable=prefix libpanelapplet-3.0`/libexec
+ LIBPANEL_APPLET_DIR=${prefix}/share/gnome-panel/applets + LIBPANEL_APPLET_DIR=$prefix/share/gnome-panel/applets
+ PLUGIN_DIR=${prefix}/libexec + PLUGIN_DIR=$prefix/libexec
[AC_DEFINE(PANEL_GNOME, 1, [panel type])] [AC_DEFINE(PANEL_GNOME, 1, [panel type])]
[AC_DEFINE(PANEL_GNOME2, 1, [panel type])] [AC_DEFINE(PANEL_GNOME2, 1, [panel type])]
, ,
[test "x$panel" = xgnome3], [test "x$panel" = xgnome3],
[PKG_CHECK_MODULES(LIBPANEL, libpanelapplet-4.0 >= 3.0.0)] [PKG_CHECK_MODULES(LIBPANEL, libpanelapplet-4.0 >= 3.0.0)]
LIBPANEL_APPLET_DIR=`$PKG_CONFIG --variable=libpanel_applet_dir libpanelapplet-4.0` - LIBPANEL_APPLET_DIR=`$PKG_CONFIG --variable=libpanel_applet_dir libpanelapplet-4.0`
- PLUGIN_DIR=`$PKG_CONFIG --variable=prefix libpanelapplet-4.0`/libexec - PLUGIN_DIR=`$PKG_CONFIG --variable=prefix libpanelapplet-4.0`/libexec
+ PLUGIN_DIR=${prefix}/libexec + LIBPANEL_APPLET_DIR=`$PKG_CONFIG --define-variable=prefix=$prefix --variable=libpanel_applet_dir libpanelapplet-4.0`
+ PLUGIN_DIR=$prefix/libexec
[AC_DEFINE(PANEL_GNOME, 1, [panel type])] [AC_DEFINE(PANEL_GNOME, 1, [panel type])]
[AC_DEFINE(PANEL_GNOME3, 1, [panel type])] [AC_DEFINE(PANEL_GNOME3, 1, [panel type])]
, ,
[test "x$panel" = xgnomeflashback],
[PKG_CHECK_MODULES(LIBPANEL, libpanel-applet >= 3.0.0)]
- LIBPANEL_APPLET_DIR=`$PKG_CONFIG --variable=libpanel_applet_dir libpanel-applet`
- PLUGIN_DIR=`$PKG_CONFIG --variable=prefix libpanel-applet`/libexec
+ LIBPANEL_APPLET_DIR=`$PKG_CONFIG --define-variable=prefix=$prefix --variable=libpanel_applet_dir libpanel-applet`
+ PLUGIN_DIR=$prefix/libexec
[AC_DEFINE(PANEL_GNOME, 1, [panel type])]
[AC_DEFINE(PANEL_GNOMEFLASHBACK, 1, [panel type])]
,
[test "x$panel" = xmate], [test "x$panel" = xmate],
[PKG_CHECK_MODULES(LIBPANEL, libmatepanelapplet-3.0 >= 1.4.0)] [PKG_CHECK_MODULES(LIBPANEL, libmatepanelapplet-4.0 >= 1.4.0)]
- LIBPANEL_APPLET_DIR=`$PKG_CONFIG --variable=prefix libmatepanelapplet-3.0`/share/mate-panel/applets - LIBPANEL_APPLET_DIR=`$PKG_CONFIG --variable=prefix libmatepanelapplet-4.0`/share/mate-panel/applets
- PLUGIN_DIR=`$PKG_CONFIG --variable=prefix libmatepanelapplet-3.0`/libexec - PLUGIN_DIR=`$PKG_CONFIG --variable=prefix libmatepanelapplet-4.0`/libexec
+ LIBPANEL_APPLET_DIR=${prefix}/share/mate-panel/applets + LIBPANEL_APPLET_DIR=$prefix/share/mate-panel/applets
+ PLUGIN_DIR=${prefix}/libexec + PLUGIN_DIR=$prefix/libexec
[AC_DEFINE(PANEL_MATE, 1, [panel type])] [AC_DEFINE(PANEL_MATE, 1, [panel type])]
, ,
[test "x$panel" = xxfce4], [test "x$panel" = xxfce4],
[PKG_CHECK_MODULES(LIBPANEL, libxfce4panel-1.0 >= 4.6.0)] [PKG_CHECK_MODULES(LIBPANEL, libxfce4panel-1.0 >= 4.6.0)]
- LIBPANEL_APPLET_DIR=`$PKG_CONFIG --variable=prefix libxfce4panel-1.0`/share/xfce4/panel-plugins - LIBPANEL_APPLET_DIR=`$PKG_CONFIG --variable=prefix libxfce4panel-1.0`/share/xfce4/panel-plugins
- PLUGIN_DIR=`$PKG_CONFIG --variable=libdir libxfce4panel-1.0`/xfce4/panel/plugins - PLUGIN_DIR=`$PKG_CONFIG --variable=libdir libxfce4panel-1.0`/xfce4/panel/plugins
+ LIBPANEL_APPLET_DIR=${prefix}/share/xfce4/panel-plugins + LIBPANEL_APPLET_DIR=$prefix/share/xfce4/panel-plugins
+ PLUGIN_DIR=${prefix}/lib/xfce4/panel/plugins + PLUGIN_DIR=`$PKG_CONFIG --define-variable=prefix=$prefix --variable=libdir libxfce4panel-1.0`/xfce4/panel/plugins
[AC_DEFINE(PANEL_XFCE4, 1, [panel type])] [AC_DEFINE(PANEL_XFCE4, 1, [panel type])]
, ,
[AC_MSG_ERROR([Unknown panel type, use gnome2, gnome3, mate or xfce4])] [AC_MSG_ERROR([Unknown panel type, use gnome2, gnome3, gnomeflashback, mate or xfce4])]

View file

@ -19284,7 +19284,7 @@ with pkgs;
}; };
xmonad_log_applet = callPackage ../applications/window-managers/xmonad/log-applet { xmonad_log_applet = callPackage ../applications/window-managers/xmonad/log-applet {
desktopSupport = "gnome3"; desktopSupport = "gnomeflashback";
inherit (xfce) libxfce4util xfce4-panel; inherit (xfce) libxfce4util xfce4-panel;
}; };