x11-libs/libfm: Version bump to 1.2.4
authorHanno <hanno@gentoo.org>
Sun, 14 Aug 2016 06:45:08 +0000 (23:45 -0700)
committerHanno <hanno@gentoo.org>
Sun, 14 Aug 2016 06:45:08 +0000 (23:45 -0700)
Use upstream tarballs.
Change ABI version (also for live ebuild, fix #578632).
Add conditional dependency to dbus-glib (fix #560586).
Fix use after free bug.

Package-Manager: portage-2.3.0

x11-libs/libfm/Manifest
x11-libs/libfm/files/libfm-0.1.17-ssp-fix.patch [deleted file]
x11-libs/libfm/files/libfm-fix-use-after-free.diff [new file with mode: 0644]
x11-libs/libfm/libfm-1.2.4.ebuild [new file with mode: 0644]
x11-libs/libfm/libfm-9999.ebuild

index 7361d3d75317a9aeb2f8287d3ebe914236044330..0a620143c73ccc7654ac68be5a24784287ea9a88 100644 (file)
@@ -1 +1,2 @@
 DIST libfm-1.2.3.tar.xz 898256 SHA256 c692f1624a4cbc8d1dd55f3b3f3369fbf5d26f63a916e2c295230b2344e1fbf9 SHA512 f4c214daffc47f05ba31c65203ab0542a03f5a246ea4bb62b6b365ac3fa120a1a51e37b00f8a43afe56875eb69f9be327ac724dafb6fc2de13aa77deea23f443 WHIRLPOOL ae5354c5ef5154ebce8a9124b47e0a645171d50d4034fd1e6000ff084acc15261398029c58b067b9027d4ba68d36d8addf91a28678c91a3fbd9ce0806e9b6046
+DIST libfm-1.2.4.tar.gz 1259686 SHA256 30474f25e4fbf78f50c7e2493cc4eca5970243089393d25a80f3d79b478a2ce7 SHA512 7196ae4af99ef41d77e1113dea62e35244b0be57c8cd7fcef2e0559daa5564ddfb163293225708c1697068e6a41d9842f96991145c34c41a7f510f38345d2f9c WHIRLPOOL d42d7ee5d7fefd1c100a0b7f741a20a2d98e84bbea57cfe3b3f197e7731538bda51c4c916a88e185ce937bab88fcda7b511d3da81660f6f36f32ef389f480f1b
diff --git a/x11-libs/libfm/files/libfm-0.1.17-ssp-fix.patch b/x11-libs/libfm/files/libfm-0.1.17-ssp-fix.patch
deleted file mode 100644 (file)
index 25e500d..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-From 8972eaaef0bb43491b7578dd3e8c9f14455d1d6a Mon Sep 17 00:00:00 2001
-From: Richard Grenville <richardgv@users.sourceforge.net>
-Date: Wed, 9 May 2012 07:47:24 +0800
-Subject: [PATCH] Fix #3512666 - fm-archiver.c: Stack buffer overflow.
-
----
- src/base/fm-archiver.c |    4 ++--
- 1 files changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/src/base/fm-archiver.c b/src/base/fm-archiver.c
-index 2852058..edbc62b 100644
---- a/src/base/fm-archiver.c
-+++ b/src/base/fm-archiver.c
-@@ -203,8 +203,8 @@ void _fm_archiver_init()
-     GKeyFile *kf = g_key_file_new();
-     if(g_key_file_load_from_file(kf, PACKAGE_DATA_DIR "/archivers.list", 0, NULL))
-     {
--        int n_archivers;
--        char** programs = g_key_file_get_groups(kf, &n_archivers);
-+        gsize n_archivers;
-+        gchar** programs = g_key_file_get_groups(kf, &n_archivers);
-         if(programs)
-         {
-             int i;
--- 
-1.7.4.1
-
diff --git a/x11-libs/libfm/files/libfm-fix-use-after-free.diff b/x11-libs/libfm/files/libfm-fix-use-after-free.diff
new file mode 100644 (file)
index 0000000..4a0ae61
--- /dev/null
@@ -0,0 +1,23 @@
+diff -Naur libfm-1.2.3/src/base/fm-config.c libfm-1.2.3-fix-uaf-new2/src/base/fm-config.c
+--- libfm-1.2.3/src/base/fm-config.c   2014-10-14 18:29:21.000000000 +0200
++++ libfm-1.2.3-fix-uaf-new2/src/base/fm-config.c      2016-06-18 18:23:35.721837971 +0200
+@@ -346,7 +346,8 @@
+     cfg->modules_blacklist = NULL;
+     cfg->system_modules_blacklist = NULL;
+     _cfg_monitor_free(cfg);
+-    g_free(cfg->_cfg_name);
++    if(name != cfg->_cfg_name)
++        g_free(cfg->_cfg_name);
+     if(G_LIKELY(!name))
+         name = "libfm/libfm.conf";
+     else
+@@ -363,7 +364,8 @@
+         }
+     }
+ 
+-    cfg->_cfg_name = g_strdup(name);
++    if(name != cfg->_cfg_name)
++        cfg->_cfg_name = g_strdup(name);
+     dirs = g_get_system_config_dirs();
+     /* bug SF #887: first dir in XDG_CONFIG_DIRS is the most relevant
+        so we shoult process the list in reverse order */
diff --git a/x11-libs/libfm/libfm-1.2.4.ebuild b/x11-libs/libfm/libfm-1.2.4.ebuild
new file mode 100644 (file)
index 0000000..c7d5023
--- /dev/null
@@ -0,0 +1,130 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit autotools fdo-mime multilib vala
+
+MY_PV=${PV/_/}
+MY_P="${PN}-${MY_PV}"
+DESCRIPTION="A library for file management"
+HOMEPAGE="http://pcmanfm.sourceforge.net/"
+SRC_URI="https://github.com/lxde/libfm/archive/1.2.4.tar.gz -> ${MY_P}.tar.gz"
+
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~mips ~ppc ~x86 ~amd64-linux ~x86-linux"
+LICENSE="GPL-2"
+SLOT="0/4.4.0" #copy ABI_VERSION because it seems upstream change it randomly
+IUSE="+automount debug doc examples exif gtk udisks vala"
+
+COMMON_DEPEND=">=dev-libs/glib-2.18:2
+       gtk? ( >=x11-libs/gtk+-2.16:2 )
+       >=lxde-base/menu-cache-0.3.2:=
+       ~x11-libs/libfm-extra-${PV}
+       udisks? ( dev-libs/dbus-glib )"
+RDEPEND="${COMMON_DEPEND}
+       !lxde-base/lxshortcut
+       x11-misc/shared-mime-info
+       automount? (
+               udisks? ( gnome-base/gvfs[udev,udisks] )
+               !udisks? ( gnome-base/gvfs[udev] )
+       )
+       exif? ( media-libs/libexif )"
+DEPEND="${COMMON_DEPEND}
+       vala? ( $(vala_depend) )
+       doc? (
+               dev-util/gtk-doc
+       )
+       app-arch/xz-utils
+       >=dev-util/intltool-0.40
+       virtual/pkgconfig
+       sys-devel/gettext"
+
+S="${WORKDIR}"/${MY_P}
+
+REQUIRED_USE="udisks? ( automount ) doc? ( gtk )"
+
+src_prepare() {
+       # Fix use after free bug, see
+       # https://github.com/lxde/libfm/pull/11/commits/9e3a809c6a8a5079f05e04edac9457d317822321
+       epatch "${FILESDIR}"/libfm-fix-use-after-free.diff
+
+       if ! use doc; then
+               sed -ie '/^SUBDIR.*=/s#docs##' "${S}"/Makefile.am || die "sed failed"
+               sed -ie '/^[[:space:]]*docs/d' configure.ac || die "sed failed"
+       fi
+       sed -i -e "s:-O0::" -e "/-DG_ENABLE_DEBUG/s: -g::" \
+               configure.ac || die "sed failed"
+
+       #disable unused translations. Bug #356029
+       for trans in app-chooser ask-rename exec-file file-prop preferred-apps \
+               progress;do
+               echo "data/ui/"${trans}.ui >> po/POTFILES.in
+       done
+       #Remove -Werror for automake-1.12. Bug #421101
+       sed -i "s:-Werror::" configure.ac || die
+
+       # subslot sanity check
+       local sub_slot=${SLOT#*/}
+       local libfm_major_abi=$(sed -rne '/ABI_VERSION/s:.*=::p' src/Makefile.am | tr ':' '.')
+
+       if [[ ${sub_slot} != ${libfm_major_abi} ]]; then
+               eerror "Ebuild sub-slot (${sub_slot}) does not match ABI_VERSION(${libfm_major_abi})"
+               eerror "Please update SLOT variable as follows:"
+               eerror "    SLOT=\"${SLOT%%/*}/${libfm_major_abi}\""
+               eerror
+               die "sub-slot sanity check failed"
+       fi
+
+       eautoreconf
+       rm -r autom4te.cache || die
+       use vala && export VALAC="$(type -p valac-$(vala_best_api_version))"
+}
+
+src_configure() {
+       econf \
+               --sysconfdir="${EPREFIX}/etc" \
+               --disable-dependency-tracking \
+               --disable-static \
+               $(use_enable examples demo) \
+               $(use_enable exif) \
+               $(use_enable debug) \
+               $(use_enable udisks) \
+               $(use_enable vala actions) \
+               $(use_with gtk) \
+               $(use_enable doc gtk-doc) \
+               --with-html-dir=/usr/share/doc/${PF}/html
+}
+
+src_install() {
+       default
+       find "${D}" -name '*.la' -exec rm -f '{}' +
+       # Sometimes a directory is created instead of a symlink. No idea why...
+       # It is wrong anyway. We expect a libfm-1.0 directory and then a libfm
+       # symlink to it.
+       if [[ -h ${D}/usr/include/${PN} || -d ${D}/usr/include/${PN} ]]; then
+               rm -r "${D}"/usr/include/${PN}
+       fi
+       # Remove files installed by split-off libfm-extra package
+       rm "${D}"/usr/include/libfm-1.0/fm-{extra,version,xml-file}.h
+       rm "${D}"/usr/$(get_libdir)/libfm-extra*
+       rm "${D}"/usr/$(get_libdir)/pkgconfig/libfm-extra.pc
+}
+
+pkg_preinst() {
+       # Resolve the symlink mess. Bug #439570
+       [[ -d "${ROOT}"/usr/include/${PN} ]] && \
+               rm -rf "${ROOT}"/usr/include/${PN}
+       if [[ -d "${D}"/usr/include/${PN}-1.0 ]]; then
+               cd "${D}"/usr/include
+               ln -s --force ${PN}-1.0 ${PN}
+       fi
+}
+
+pkg_postinst() {
+       fdo-mime_mime_database_update
+}
+
+pkg_postrm() {
+       fdo-mime_mime_database_update
+}
index 29039c4eb2e44641e9f1d325c364c5948ff5c5dc..7da656a5b107cc7a3eb99368059ef0266c41307d 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright 1999-2015 Gentoo Foundation
+# Copyright 1999-2016 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 # $Id$
 
@@ -11,7 +11,7 @@ DESCRIPTION="A library for file management"
 HOMEPAGE="http://pcmanfm.sourceforge.net/"
 
 LICENSE="GPL-2"
-SLOT="0/4.3.0" #copy ABI_VERSION because it seems upstream change it randomly
+SLOT="0/4.4.0" #copy ABI_VERSION because it seems upstream change it randomly
 IUSE="+automount debug doc examples exif gtk udisks vala"
 KEYWORDS=""