summary refs log tree commit diff
diff options
context:
space:
mode:
authorVagrant Cascadian <vagrant@reproducible-builds.org>2022-05-14 17:06:48 -0700
committerVagrant Cascadian <vagrant@debian.org>2022-05-14 17:16:32 -0700
commitde68877a517ba058f67086d444d7265c9c803679 (patch)
treebf767de4f8dd5aa07fc4ce60df44fb478d0981e2
parentce1c88a29b56ac7abe8413997464508b46d4f970 (diff)
downloadguix-de68877a517ba058f67086d444d7265c9c803679.tar.gz
gnu: libxmlb: Install xb-tool in bin dir.
* gnu/packages/patches/libxmlb-install-xb-tool-into-bindir.patch: New file.
* gnu/packages/xml.scm (libxmlb)[source]: Add patch.
* gnu/local.mk (dist_patch_DATA): Add patch.
* gnu/packages/diffoscope.scm (diffoscope)[arguments]: Add
  'xb-tool-external-tool phase.
-rw-r--r--gnu/local.mk1
-rw-r--r--gnu/packages/diffoscope.scm7
-rw-r--r--gnu/packages/patches/libxmlb-install-xb-tool-into-bindir.patch100
-rw-r--r--gnu/packages/xml.scm4
4 files changed, 111 insertions, 1 deletions
diff --git a/gnu/local.mk b/gnu/local.mk
index 4ef12fd68e..d5b60bdba3 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1426,6 +1426,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/libxml2-terminating-newline.patch	\
   %D%/packages/patches/libxml2-xpath-recursion-limit.patch	\
   %D%/packages/patches/libxml2-xpath0-Add-option-xpath0.patch	\
+  %D%/packages/patches/libxmlb-install-xb-tool-into-bindir.patch \
   %D%/packages/patches/libxslt-generated-ids.patch		\
   %D%/packages/patches/libxt-guix-search-paths.patch		\
   %D%/packages/patches/lierolibre-check-unaligned-access.patch	\
diff --git a/gnu/packages/diffoscope.scm b/gnu/packages/diffoscope.scm
index da4de83373..b4279a3fb5 100644
--- a/gnu/packages/diffoscope.scm
+++ b/gnu/packages/diffoscope.scm
@@ -111,6 +111,13 @@
                          (string-append "['" (which "stat") "',"))
                         (("\\['getfacl',")
                          (string-append "['" (which "getfacl") "',")))))
+                  (add-after 'unpack 'xb-tool-external-tool
+                    ;; Fixed upstream, remove this phase when updating to
+                    ;; diffoscope 213
+                    (lambda _
+                      (substitute* "diffoscope/external_tools.py"
+                        ((".debian.: .libxmlb-dev.")
+                         "\"debian\": \"libxmlb-dev\", \"guix\": \"libxmlb\""))))
                   (add-after 'build 'build-man-page
                     (lambda* (#:key (make-flags '()) #:allow-other-keys)
                       (apply invoke "make" "-C" "doc" make-flags)))
diff --git a/gnu/packages/patches/libxmlb-install-xb-tool-into-bindir.patch b/gnu/packages/patches/libxmlb-install-xb-tool-into-bindir.patch
new file mode 100644
index 0000000000..97f0f5fbd3
--- /dev/null
+++ b/gnu/packages/patches/libxmlb-install-xb-tool-into-bindir.patch
@@ -0,0 +1,100 @@
+From f91a9cfcd70178404ac2aafdfa124c9a4efe8866 Mon Sep 17 00:00:00 2001
+From: Richard Hughes <richard@hughsie.com>
+Date: Mon, 18 Apr 2022 10:50:42 +0100
+Subject: [PATCH 11/11] Install xb-tool into bindir
+
+Fixes https://github.com/hughsie/libxmlb/issues/123
+---
+ contrib/libxmlb.spec.in |  3 ++-
+ meson.build             |  4 +++-
+ src/meson.build         |  9 ++++++++-
+ src/xb-tool.1           | 19 +++++++++++++++++++
+ 4 files changed, 32 insertions(+), 3 deletions(-)
+ create mode 100644 src/xb-tool.1
+
+diff --git a/contrib/libxmlb.spec.in b/contrib/libxmlb.spec.in
+index 6be65d1..24478fe 100644
+--- a/contrib/libxmlb.spec.in
++++ b/contrib/libxmlb.spec.in
+@@ -71,7 +71,8 @@ Executable and data files for installed tests.
+ %files
+ %doc README.md
+ %license LICENSE
+-%{_libexecdir}/xb-tool
++%{_bindir}/xb-tool
++%{_mandir}/man1/xb-tool.1*
+ %dir %{_libdir}/girepository-1.0
+ %{_libdir}/girepository-1.0/Xmlb-2.0.typelib
+ %{_libdir}/libxmlb.so.2*
+diff --git a/meson.build b/meson.build
+index 6870907..53b1324 100644
+--- a/meson.build
++++ b/meson.build
+@@ -103,16 +103,18 @@ add_project_link_arguments(
+ )
+ 
+ if host_machine.system() == 'windows'
+-  libexecdir = get_option('libexecdir')
++  bindir = get_option('bindir')
+   installed_test_bindir = get_option('libexecdir')
+   installed_test_datadir = get_option('datadir')
+ else
+   prefix = get_option('prefix')
+   datadir = join_paths(prefix, get_option('datadir'))
++  bindir = join_paths(prefix, get_option('bindir'))
+   libexecdir = join_paths(prefix, get_option('libexecdir'))
+   installed_test_bindir = join_paths(libexecdir, 'installed-tests', meson.project_name())
+   installed_test_datadir = join_paths(datadir, 'installed-tests', meson.project_name())
+ endif
++mandir = join_paths(prefix, get_option('mandir'))
+ 
+ gio = dependency('gio-2.0', version : '>= 2.45.8')
+ giounix = dependency('gio-unix-2.0', version : '>= 2.45.8', required: false)
+diff --git a/src/meson.build b/src/meson.build
+index d7a1401..93fb8ba 100644
+--- a/src/meson.build
++++ b/src/meson.build
+@@ -96,7 +96,14 @@ xb_tool = executable(
+     libxmlb,
+   ],
+   install : true,
+-  install_dir : libexecdir
++  install_dir : bindir
++)
++configure_file(
++  input : 'xb-tool.1',
++  output : 'xb-tool.1',
++  configuration : conf,
++  install: true,
++  install_dir: join_paths(mandir, 'man1'),
+ )
+ endif
+ 
+diff --git a/src/xb-tool.1 b/src/xb-tool.1
+new file mode 100644
+index 0000000..348d1b1
+--- /dev/null
++++ b/src/xb-tool.1
+@@ -0,0 +1,19 @@
++.\" Report problems in https://github.com/hughsie/libxmlb
++.TH man 1 "18 April 2022" @PACKAGE_VERSION@ "xb-tool man page"
++.SH NAME
++xb-tool \- standalone XMLb utility
++.SH SYNOPSIS
++xb-tool [CMD]
++.SH DESCRIPTION
++This tool allows creating, dumping and querying binary XML blobs.
++.PP
++Additionally \fBxb-tool\fR can be used to profile specfic tokenized queries.
++.SH OPTIONS
++The xb-tool command takes various options depending on the action.
++Run \fBxb-tool --help\fR for the full list.
++.SH EXIT STATUS
++Commands that successfully execute will return "0", otherwise "1".
++.SH BUGS
++No known bugs.
++.SH AUTHOR
++Richard Hughes (richard@hughsie.com)
+-- 
+2.35.1
+
diff --git a/gnu/packages/xml.scm b/gnu/packages/xml.scm
index a0d8d20102..11b0a4ef54 100644
--- a/gnu/packages/xml.scm
+++ b/gnu/packages/xml.scm
@@ -99,7 +99,9 @@
          (commit version)))
        (file-name (git-file-name name version))
        (sha256
-        (base32 "0znz2y1ig2kvlda44a3kxa8x7f222nbg50rjz6nlngzka0ccsgxx"))))
+        (base32 "0znz2y1ig2kvlda44a3kxa8x7f222nbg50rjz6nlngzka0ccsgxx"))
+       ;; Drop xb-tool patch after libxmlb 0.3.8, merged upstream
+       (patches (search-patches "libxmlb-install-xb-tool-into-bindir.patch"))))
     (build-system meson-build-system)
     (arguments
      `(#:glib-or-gtk? #t))