about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/bamf
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/bamf')
-rw-r--r--nixpkgs/pkgs/development/libraries/bamf/default.nix104
-rw-r--r--nixpkgs/pkgs/development/libraries/bamf/gtester2xunit-python3.patch53
2 files changed, 157 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/bamf/default.nix b/nixpkgs/pkgs/development/libraries/bamf/default.nix
new file mode 100644
index 000000000000..95d54993e069
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/bamf/default.nix
@@ -0,0 +1,104 @@
+{ lib, stdenv
+, pantheon
+, autoconf
+, automake
+, libtool
+, gnome3
+, which
+, fetchgit
+, libgtop
+, libwnck3
+, glib
+, vala
+, pkg-config
+, libstartup_notification
+, gobject-introspection
+, gtk-doc
+, docbook_xsl
+, xorgserver
+, dbus
+, python3
+, wrapGAppsHook
+}:
+
+stdenv.mkDerivation rec {
+  pname = "bamf";
+  version = "0.5.4";
+
+  outputs = [ "out" "dev" "devdoc" ];
+
+  src = fetchgit {
+    url = "https://git.launchpad.net/~unity-team/bamf";
+    rev = version;
+    sha256 = "1klvij1wyhdj5d8sr3b16pfixc1yk8ihglpjykg7zrr1f50jfgsz";
+  };
+
+  nativeBuildInputs = [
+    (python3.withPackages (ps: with ps; [ lxml ])) # Tests
+    autoconf
+    automake
+    dbus
+    docbook_xsl
+    gnome3.gnome-common
+    gobject-introspection
+    gtk-doc
+    libtool
+    pkg-config
+    vala
+    which
+    wrapGAppsHook
+    xorgserver
+  ];
+
+  buildInputs = [
+    glib
+    libgtop
+    libstartup_notification
+    libwnck3
+  ];
+
+  patches = [
+    # Port tests and checks to python3 lxml.
+    ./gtester2xunit-python3.patch
+  ];
+
+  # Fix hard-coded path
+  # https://bugs.launchpad.net/bamf/+bug/1780557
+  postPatch = ''
+    substituteInPlace data/Makefile.am \
+      --replace '/usr/lib/systemd/user' '@prefix@/lib/systemd/user'
+  '';
+
+  configureFlags = [
+    "--enable-gtk-doc"
+    "--enable-headless-tests"
+  ];
+
+  # fix paths
+  makeFlags = [
+    "INTROSPECTION_GIRDIR=${placeholder "dev"}/share/gir-1.0/"
+    "INTROSPECTION_TYPELIBDIR=${placeholder "out"}/lib/girepository-1.0"
+  ];
+
+  preConfigure = ''
+    ./autogen.sh
+  '';
+
+  # TODO: Requires /etc/machine-id
+  doCheck = false;
+
+  # glib-2.62 deprecations
+  NIX_CFLAGS_COMPILE = "-DGLIB_DISABLE_DEPRECATION_WARNINGS";
+
+  meta = with lib; {
+    description = "Application matching framework";
+    longDescription = ''
+      Removes the headache of applications matching
+      into a simple DBus daemon and c wrapper library.
+    '';
+    homepage = "https://launchpad.net/bamf";
+    license = licenses.lgpl3;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ davidak ] ++ pantheon.maintainers;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/bamf/gtester2xunit-python3.patch b/nixpkgs/pkgs/development/libraries/bamf/gtester2xunit-python3.patch
new file mode 100644
index 000000000000..8dc478541943
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/bamf/gtester2xunit-python3.patch
@@ -0,0 +1,53 @@
+diff --git a/configure.ac b/configure.ac
+index 41cb7db..93ef0ec 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -115,9 +115,9 @@ GTK_DOC_CHECK(1.0)
+ 
+ AC_PATH_PROG([PYTHON],[python])
+ AC_MSG_CHECKING(for gtester2xunit dependencies)
+-if !($PYTHON -c "import libxslt, libxml2" 2> /dev/null); then
++if !($PYTHON -c "import lxml" 2> /dev/null); then
+   AC_MSG_RESULT([no])
+-  AC_MSG_ERROR([You need to install python-libxslt1 and python-libxml2]);
++  AC_MSG_ERROR([You need to install python-lxml]);
+ fi
+ AC_MSG_RESULT([yes])
+ 
+@@ -189,6 +189,6 @@ ${PACKAGE}-${VERSION}
+     Introspection:        ${enable_introspection}
+     Headless tests:       ${enable_headless_tests}
+     Coverage Reporting:   ${use_gcov}
+-    Export actions menus: ${enable_export_actions_menu} 
++    Export actions menus: ${enable_export_actions_menu}
+ 
+ EOF
+diff --git a/tests/gtester2xunit.py b/tests/gtester2xunit.py
+index fbe3c66..861d541 100755
+--- a/tests/gtester2xunit.py
++++ b/tests/gtester2xunit.py
+@@ -1,18 +1,17 @@
+ #! /usr/bin/python
+ from argparse import ArgumentParser
+-import libxslt
+-import libxml2
+ import sys
+ import os
++from lxml import etree
+ 
+ XSL_TRANSFORM='/usr/share/gtester2xunit/gtester.xsl'
+ 
+ def transform_file(input_filename, output_filename, xsl_file):
+-    gtester = libxml2.parseFile(xsl_file)
+-    style = libxslt.parseStylesheetDoc(gtester)
+-    doc = libxml2.parseFile(input_filename)
+-    result = style.applyStylesheet(doc, None)
+-    result.saveFormatFile(filename=output_filename, format=True)
++    gtester = etree.parse(xsl_file)
++    style = etree.XSLT(gtester)
++    doc = etree.parse(input_filename)
++    result = style(doc)
++    result.write(filename=output_filename, format=True)
+ 
+ 
+ def get_output_filename(input_filename):