mail-notification: remove unneeded patches, fix die, fix license

This commit is contained in:
Dejan Lukan 2016-12-04 22:25:09 +01:00
parent d78b890178
commit 6295d387d0
4 changed files with 16 additions and 1727 deletions

View file

@ -15,30 +15,7 @@ stdenv.mkDerivation rec {
buildInputs = [ pkgconfig glib dbus_glib gmime libnotify libgnome_keyring openssl cyrus_sasl gnonlin sylpheed gob2 gettext intltool gnome2.GConf gnome2.libgnomeui dbus_glib gmime libnotify gnome2.gnome_keyring gnome2.scrollkeeper libxml2 gnome2.gnome_icon_theme hicolor_icon_theme tango-icon-theme ];
prePatch = ''
sed -i -e '/jb_rule_set_install_message/d' -e '/jb_rule_add_install_command/d' jbsrc/jb.c || die
# Ensure we never append -Werror
sed -i -e 's/ -Werror//' jb jbsrc/jb.c || die
'';
patches = [
./patches/mail-notification-5.4-remove-ubuntu-special-case.patch
# ./patches/mail-notification-aarch64.patch
./patches/mail-notification-dont-link-against-bsd-compat.patch
# ./patches/mail-notification-jb-gcc-format.patch
];
patchFlags = "-p0";
configurePhase = ''
./jb configure
runHook postConfigure
'';
postConfigure = ''
sed -i -e "/^prefix/c prefix|string|1|$out" \
-e 's/^pkgdatadir.*/pkgdatadir|string|0|$datadir/g' \
build/config
sed -i -e '/jb_rule_set_install_message/d' -e '/jb_rule_add_install_command/d' jbsrc/jb.c
# currently disable the check for missing sheme until a better solution
# is found; needed, because otherwise the application doesn't even start
@ -46,41 +23,30 @@ stdenv.mkDerivation rec {
sed -i -e 's/(schema_missing)/(!schema_missing)/g' src/mn-conf.c
'';
patches = [
./patches/mail-notification-dont-link-against-bsd-compat.patch
];
buildPhase = ''
./jb build
patchFlags = "-p0";
NIX_CFLAGS_COMPILE = "-Wno-error";
preConfigure = "./jb configure prefix=$out";
postConfigure = ''
substituteInPlace build/config \
--replace "omf-dir|string|1|${gnome2.scrollkeeper}/share/omf" "omf-dir|string|1|$out/share/omf" \
--replace "scrollkeeper-dir|string|1|${gnome2.scrollkeeper}/var/lib/scrollkeeper" "omf-dir|string|1|$out/var/lib/scrollkeeper" \
'';
# the "./jb install" tries to install directly to nix store, which is not
# writable, so we have to copy the files ourselves
installPhase = ''
#GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL="1" ./jb install
# create directories
mkdir -p $out/{bin,lib,libexec,share,etc,var}
# copy executable
cp ./build/src/mail-notification $out/bin/
# copy icons
#mkdir -p $out/share/icons/hicolor
cp -r art/* $out/share/
# copy schemas
mkdir -p $out/etc/gconf/schemas/
#GCONF_CONFIG_SOURCE="xml:merged:${gnome2.GConf}/etc/gconf/gconf.xml.defaults" ${gnome2.GConf}/bin/gconftool-2 --makefile-install-rule data/mail-notification.schemas.in.in
cp data/mail-notification.schemas.in.in $out/etc/gconf/schemas/
# copy properties dialogs
cp ui/* $out/share/
'';
buildPhase = "./jb build";
installPhase = "./jb install";
enableParallelBuilding = true;
meta = with stdenv.lib; {
description = "Tray status icon, which notifies us when new email arrives";
homepage = "http://www.nongnu.org/mailnotify/";
license = "GPL-3";
license = with licenses; [ gpl3 ];
platforms = platforms.unix;
maintainers = [ maintainers.eleanor ];
};

View file

@ -1,33 +0,0 @@
--- jbsrc/lib/src/core/jb-feature.c.~1~ 2008-04-27 16:47:27.000000000 +0200
+++ jbsrc/lib/src/core/jb-feature.c 2008-07-22 11:40:50.856886210 +0200
@@ -164,8 +164,6 @@
static void
gconf_configure (void)
{
- JBVariable *variable;
-
jb_require_program("gconftool-2");
if (! strcmp(jb_variable_get_string("gconf-config-source"), "autodetect"))
@@ -178,21 +176,6 @@
jb_variable_set_string("gconf-config-source", config_source);
g_free(config_source);
}
-
- /* fix the default schemas dir on Ubuntu */
- variable = jb_variable_get_variable_or_error("gconf-schemas-dir");
- if (! variable->user_set)
- {
- static const char *ubuntu_dir = "$datadir/gconf/schemas";
- char *expanded;
-
- expanded = jb_variable_expand(ubuntu_dir, NULL);
-
- if (g_file_test(expanded, G_FILE_TEST_IS_DIR))
- jb_variable_set_string("gconf-schemas-dir", ubuntu_dir);
-
- g_free(expanded);
- }
}
static void

View file

@ -1,15 +0,0 @@
Index: epienbroek-mail-notification-eab5c13/jbsrc/lib/src/core/jb-util.c
===================================================================
--- epienbroek-mail-notification-eab5c13.orig/jbsrc/lib/src/core/jb-util.c
+++ epienbroek-mail-notification-eab5c13/jbsrc/lib/src/core/jb-util.c
@@ -208,6 +208,10 @@ jb_message_result_string_format (const c
g_free(message);
}
+#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4)
+static void print_warning_or_error (const char *prefix, const char *format, va_list args) __attribute__ ((format(printf, 1, 0)));
+#endif
+
static void
print_warning_or_error (const char *prefix, const char *format, va_list args)
{