From 99af040ee10c762a1f413b32c0961f7389feb25f Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Sat, 7 Oct 2017 00:05:38 +0200 Subject: [PATCH 1/7] docbook_{xml,xsl}*: propagate findXMLCatalogs --- pkgs/data/sgml+xml/schemas/xml-dtd/docbook/4.1.2.nix | 4 ++-- pkgs/data/sgml+xml/schemas/xml-dtd/docbook/4.2.nix | 4 ++-- pkgs/data/sgml+xml/schemas/xml-dtd/docbook/4.3.nix | 4 ++-- pkgs/data/sgml+xml/schemas/xml-dtd/docbook/4.4.nix | 4 ++-- pkgs/data/sgml+xml/schemas/xml-dtd/docbook/4.5.nix | 4 ++-- pkgs/data/sgml+xml/schemas/xml-dtd/docbook/generic.nix | 3 ++- pkgs/data/sgml+xml/stylesheets/xslt/docbook-xsl/default.nix | 4 +++- 7 files changed, 15 insertions(+), 12 deletions(-) diff --git a/pkgs/data/sgml+xml/schemas/xml-dtd/docbook/4.1.2.nix b/pkgs/data/sgml+xml/schemas/xml-dtd/docbook/4.1.2.nix index 7ff79488a89f..d4cb7bc889d3 100644 --- a/pkgs/data/sgml+xml/schemas/xml-dtd/docbook/4.1.2.nix +++ b/pkgs/data/sgml+xml/schemas/xml-dtd/docbook/4.1.2.nix @@ -1,4 +1,4 @@ -{stdenv, fetchurl, unzip}: +{stdenv, fetchurl, unzip, findXMLCatalogs}: let @@ -12,7 +12,7 @@ let in import ./generic.nix { - inherit stdenv fetchurl unzip; + inherit stdenv fetchurl unzip findXMLCatalogs; name = "docbook-xml-4.1.2"; src = fetchurl { url = http://www.docbook.org/xml/4.1.2/docbkx412.zip; diff --git a/pkgs/data/sgml+xml/schemas/xml-dtd/docbook/4.2.nix b/pkgs/data/sgml+xml/schemas/xml-dtd/docbook/4.2.nix index 3875362dcb3d..d2cc69559b86 100644 --- a/pkgs/data/sgml+xml/schemas/xml-dtd/docbook/4.2.nix +++ b/pkgs/data/sgml+xml/schemas/xml-dtd/docbook/4.2.nix @@ -1,7 +1,7 @@ -{stdenv, fetchurl, unzip}: +{stdenv, fetchurl, unzip, findXMLCatalogs}: import ./generic.nix { - inherit stdenv fetchurl unzip; + inherit stdenv fetchurl unzip findXMLCatalogs; name = "docbook-xml-4.2"; src = fetchurl { url = http://www.docbook.org/xml/4.2/docbook-xml-4.2.zip; diff --git a/pkgs/data/sgml+xml/schemas/xml-dtd/docbook/4.3.nix b/pkgs/data/sgml+xml/schemas/xml-dtd/docbook/4.3.nix index 19ad49aa9280..e1f9337df941 100644 --- a/pkgs/data/sgml+xml/schemas/xml-dtd/docbook/4.3.nix +++ b/pkgs/data/sgml+xml/schemas/xml-dtd/docbook/4.3.nix @@ -1,7 +1,7 @@ -{stdenv, fetchurl, unzip}: +{stdenv, fetchurl, unzip, findXMLCatalogs}: import ./generic.nix { - inherit stdenv fetchurl unzip; + inherit stdenv fetchurl unzip findXMLCatalogs; name = "docbook-xml-4.3"; src = fetchurl { url = http://www.docbook.org/xml/4.3/docbook-xml-4.3.zip; diff --git a/pkgs/data/sgml+xml/schemas/xml-dtd/docbook/4.4.nix b/pkgs/data/sgml+xml/schemas/xml-dtd/docbook/4.4.nix index 98a1853e4942..1a9d622affc6 100644 --- a/pkgs/data/sgml+xml/schemas/xml-dtd/docbook/4.4.nix +++ b/pkgs/data/sgml+xml/schemas/xml-dtd/docbook/4.4.nix @@ -1,7 +1,7 @@ -{stdenv, fetchurl, unzip}: +{stdenv, fetchurl, unzip, findXMLCatalogs}: import ./generic.nix { - inherit stdenv fetchurl unzip; + inherit stdenv fetchurl unzip findXMLCatalogs; name = "docbook-xml-4.4"; src = fetchurl { url = http://www.docbook.org/xml/4.4/docbook-xml-4.4.zip; diff --git a/pkgs/data/sgml+xml/schemas/xml-dtd/docbook/4.5.nix b/pkgs/data/sgml+xml/schemas/xml-dtd/docbook/4.5.nix index 669536962a12..301b400ac7e1 100644 --- a/pkgs/data/sgml+xml/schemas/xml-dtd/docbook/4.5.nix +++ b/pkgs/data/sgml+xml/schemas/xml-dtd/docbook/4.5.nix @@ -1,7 +1,7 @@ -{stdenv, fetchurl, unzip}: +{stdenv, fetchurl, unzip, findXMLCatalogs}: import ./generic.nix { - inherit stdenv fetchurl unzip; + inherit stdenv fetchurl unzip findXMLCatalogs; name = "docbook-xml-4.5"; src = fetchurl { url = http://www.docbook.org/xml/4.5/docbook-xml-4.5.zip; diff --git a/pkgs/data/sgml+xml/schemas/xml-dtd/docbook/generic.nix b/pkgs/data/sgml+xml/schemas/xml-dtd/docbook/generic.nix index fc3c4c3c8410..373778d43de6 100644 --- a/pkgs/data/sgml+xml/schemas/xml-dtd/docbook/generic.nix +++ b/pkgs/data/sgml+xml/schemas/xml-dtd/docbook/generic.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, unzip, src, name, postInstall ? "true", meta ? {} }: +{ stdenv, fetchurl, unzip, src, name, postInstall ? "true", meta ? {}, findXMLCatalogs }: assert unzip != null; @@ -6,6 +6,7 @@ stdenv.mkDerivation { inherit src name postInstall; builder = ./builder.sh; buildInputs = [unzip]; + propagatedBuildInputs = [ findXMLCatalogs ]; meta = meta // { platforms = stdenv.lib.platforms.unix; diff --git a/pkgs/data/sgml+xml/stylesheets/xslt/docbook-xsl/default.nix b/pkgs/data/sgml+xml/stylesheets/xslt/docbook-xsl/default.nix index a955f5cf8a48..7bae913ed5e6 100644 --- a/pkgs/data/sgml+xml/stylesheets/xslt/docbook-xsl/default.nix +++ b/pkgs/data/sgml+xml/stylesheets/xslt/docbook-xsl/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchurl }: +{ lib, stdenv, fetchurl, findXMLCatalogs }: let @@ -10,6 +10,8 @@ let inherit sha256; }; + propagatedBuildInputs = [ findXMLCatalogs ]; + dontBuild = true; installPhase = '' From 407db7b0196417296677f2a4ef929bb092ec382b Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Sat, 7 Oct 2017 00:07:40 +0200 Subject: [PATCH 2/7] gtk_doc: replace catalog lookup hack MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In the previous commit, we added a setup hook to docbook dtd and xsl packages, that adds derivation’s catalog file to an environment variable. That should, in theory, remove the need for declaring their catalogs manually. Unfortunately, xmlcatalog utility expects exactly one catalog file, completely disregarding the environment variable in non-interactive context. In the same spirit, the design of gtk-doc m4 files only admits a single catalog file, resulting in another ugly hack. --- .../tools/documentation/gtk-doc/default.nix | 25 ++++++----------- .../respect-xml-catalog-files-var.patch | 28 +++++++++++++++++++ 2 files changed, 36 insertions(+), 17 deletions(-) create mode 100644 pkgs/development/tools/documentation/gtk-doc/respect-xml-catalog-files-var.patch diff --git a/pkgs/development/tools/documentation/gtk-doc/default.nix b/pkgs/development/tools/documentation/gtk-doc/default.nix index 506684088343..5f31a2dfb7c6 100644 --- a/pkgs/development/tools/documentation/gtk-doc/default.nix +++ b/pkgs/development/tools/documentation/gtk-doc/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, pkgconfig, perl, python, libxml2Python, libxslt, which +{ stdenv, fetchurl, autoreconfHook, pkgconfig, perl, python, libxml2Python, libxslt, which , docbook_xml_dtd_43, docbook_xsl, gnome_doc_utils, dblatex, gettext, itstool }: stdenv.mkDerivation rec { @@ -10,29 +10,20 @@ stdenv.mkDerivation rec { sha256 = "0hpxcij9xx9ny3gs9p0iz4r8zslw8wqymbyababiyl7603a6x90y"; }; + patches = [ + ./respect-xml-catalog-files-var.patch + ]; + outputDevdoc = "out"; - # maybe there is a better way to pass the needed dtd and xsl files - # "-//OASIS//DTD DocBook XML V4.1.2//EN" and "http://docbook.sourceforge.net/release/xsl/current/html/chunk.xsl" - preConfigure = '' - mkdir -p $out/nix-support - cat > $out/nix-support/catalog.xml << EOF - - - - - - - EOF - - configureFlags="--with-xml-catalog=$out/nix-support/catalog.xml --disable-scrollkeeper"; - ''; - + nativeBuildInputs = [ autoreconfHook ]; buildInputs = [ pkgconfig perl python libxml2Python libxslt docbook_xml_dtd_43 docbook_xsl gnome_doc_utils dblatex gettext which itstool ]; + configureFlags = "--disable-scrollkeeper"; + meta = with stdenv.lib; { homepage = https://www.gtk.org/gtk-doc; description = "Tools to extract documentation embedded in GTK+ and GNOME source code"; diff --git a/pkgs/development/tools/documentation/gtk-doc/respect-xml-catalog-files-var.patch b/pkgs/development/tools/documentation/gtk-doc/respect-xml-catalog-files-var.patch new file mode 100644 index 000000000000..78c57306b797 --- /dev/null +++ b/pkgs/development/tools/documentation/gtk-doc/respect-xml-catalog-files-var.patch @@ -0,0 +1,28 @@ +diff --git a/m4/gtkdoc_jh_check_xml_catalog.m4 b/m4/gtkdoc_jh_check_xml_catalog.m4 +index 618c1c9..1842a0d 100644 +--- a/m4/gtkdoc_jh_check_xml_catalog.m4 ++++ b/m4/gtkdoc_jh_check_xml_catalog.m4 +@@ -10,7 +10,21 @@ AC_DEFUN([JH_CHECK_XML_CATALOG], + AC_MSG_RESULT([found]) + ifelse([$3],,,[$3]) + else +- AC_MSG_RESULT([not found]) +- ifelse([$4],,[AC_MSG_ERROR([could not find ifelse([$2],,[$1],[$2]) in XML catalog])],[$4]) ++ jh_check_xml_catalog_saved_ifs="$IFS" ++ IFS=' ' ++ for f in $XML_CATALOG_FILES; do ++ if [[ -f "$f" ]] && \ ++ AC_RUN_LOG([$XMLCATALOG --noout "$f" "$1" >&2]); then ++ jh_found_xmlcatalog=true ++ AC_MSG_RESULT([found]) ++ ifelse([$3],,,[$3]) ++ break ++ fi ++ done ++ IFS="$jh_check_xml_catalog_saved_ifs" ++ if ! $jh_found_xmlcatalog; then ++ AC_MSG_RESULT([not found]) ++ ifelse([$4],,[AC_MSG_ERROR([could not find ifelse([$2],,[$1],[$2]) in XML catalog])],[$4]) ++ fi + fi + ]) From 7c690aec1619fe85ef5c8bfbf05374597aceff1d Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Sat, 7 Oct 2017 13:07:52 +0200 Subject: [PATCH 3/7] conky: Rely on XML_CATALOG_FILES variable --- pkgs/os-specific/linux/conky/default.nix | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/pkgs/os-specific/linux/conky/default.nix b/pkgs/os-specific/linux/conky/default.nix index c09fc0f7dc41..8aa1cec9e12f 100644 --- a/pkgs/os-specific/linux/conky/default.nix +++ b/pkgs/os-specific/linux/conky/default.nix @@ -80,10 +80,6 @@ stdenv.mkDerivation rec { # Drop examples, since they contain non-ASCII characters that break docbook2x :( sed -i 's/ Example: .*$//' doc/config_settings.xml - substituteInPlace cmake/Docbook.cmake \ - --replace "http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl" "${docbook_xsl}/xml/xsl/docbook/html/docbook.xsl" - substituteInPlace doc/docs.xml \ - --replace "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" "${docbook_xml_dtd_44}/xml/dtd/docbook/docbookx.dtd" substituteInPlace cmake/Conky.cmake --replace "#set(RELEASE true)" "set(RELEASE true)" ''; @@ -91,7 +87,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ pkgconfig ]; buildInputs = [ glib cmake libXinerama ] - ++ optionals docsSupport [ docbook2x libxslt man less ] + ++ optionals docsSupport [ docbook2x docbook_xsl docbook_xml_dtd_44 libxslt man less ] ++ optional ncursesSupport ncurses ++ optional x11Support xlibsWrapper ++ optional xdamageSupport libXdamage From 08b283b37e02a02ab5767de9be3ddd41db923cf1 Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Sat, 7 Oct 2017 13:24:29 +0200 Subject: [PATCH 4/7] criu: Rely on XML_CATALOG_FILES variable --- pkgs/os-specific/linux/criu/default.nix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pkgs/os-specific/linux/criu/default.nix b/pkgs/os-specific/linux/criu/default.nix index 20b64907c22b..6f14e713139a 100644 --- a/pkgs/os-specific/linux/criu/default.nix +++ b/pkgs/os-specific/linux/criu/default.nix @@ -12,14 +12,13 @@ stdenv.mkDerivation rec { }; enableParallelBuilding = true; - nativeBuildInputs = [ pkgconfig ]; + nativeBuildInputs = [ pkgconfig docbook_xsl ]; buildInputs = [ protobuf protobufc asciidoc xmlto libpaper libnl libcap python ]; patchPhase = '' chmod +w ./scripts/gen-offsets.sh substituteInPlace ./scripts/gen-offsets.sh --replace hexdump ${utillinux}/bin/hexdump substituteInPlace ./Documentation/Makefile --replace "2>/dev/null" "" - substituteInPlace ./Documentation/Makefile --replace "--skip-validation" "--skip-validation -x ${docbook_xsl}/xml/xsl/docbook/manpages/docbook.xsl" substituteInPlace ./criu/Makefile --replace "-I/usr/include/libnl3" "-I${libnl.dev}/include/libnl3" substituteInPlace ./Makefile --replace "tar-name := $(shell git tag -l v$(CRIU_VERSION))" "tar-name = 2.0" # --replace "-Werror" "" ln -sf ${protobuf}/include/google/protobuf/descriptor.proto ./images/google/protobuf/descriptor.proto From 757c43fd990d3d03afeacbb6523daf9dcb108cd9 Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Sat, 7 Oct 2017 14:25:06 +0200 Subject: [PATCH 5/7] neomutt: Rely on XML_CATALOG_FILES variable --- .../networking/mailreaders/neomutt/default.nix | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/pkgs/applications/networking/mailreaders/neomutt/default.nix b/pkgs/applications/networking/mailreaders/neomutt/default.nix index e18d95dc1220..5161443cd1a1 100644 --- a/pkgs/applications/networking/mailreaders/neomutt/default.nix +++ b/pkgs/applications/networking/mailreaders/neomutt/default.nix @@ -1,5 +1,5 @@ { stdenv, fetchFromGitHub, which, autoreconfHook, ncurses, perl -, cyrus_sasl, gss, gpgme, kerberos, libidn, notmuch, openssl, lmdb, libxslt, docbook_xsl }: +, cyrus_sasl, gss, gpgme, kerberos, libidn, notmuch, openssl, lmdb, libxslt, docbook_xsl, docbook_xml_dtd_42 }: stdenv.mkDerivation rec { version = "20170912"; @@ -12,19 +12,12 @@ stdenv.mkDerivation rec { sha256 = "0qndszmaihly3pp2wqiqm31nxbv9ys3j05kzffaqhzngfilmar9g"; }; - nativeBuildInputs = [ autoreconfHook docbook_xsl libxslt.bin which ]; + nativeBuildInputs = [ autoreconfHook docbook_xsl docbook_xml_dtd_42 libxslt.bin which ]; buildInputs = [ cyrus_sasl gss gpgme kerberos libidn ncurses notmuch openssl perl lmdb ]; - postPatch = '' - for f in doc/*.xsl ; do - substituteInPlace $f \ - --replace http://docbook.sourceforge.net/release/xsl/current ${docbook_xsl}/share/xml/docbook-xsl - done - ''; - configureFlags = [ "--enable-debug" "--enable-gpgme" From c3c844a0f54cb2ae6b95de7719e203de34ea3961 Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Sat, 7 Oct 2017 14:25:27 +0200 Subject: [PATCH 6/7] apt: Rely on XML_CATALOG_FILES variable --- pkgs/tools/package-management/apt/default.nix | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/pkgs/tools/package-management/apt/default.nix b/pkgs/tools/package-management/apt/default.nix index fe7327e7d855..8077fb1d93d0 100644 --- a/pkgs/tools/package-management/apt/default.nix +++ b/pkgs/tools/package-management/apt/default.nix @@ -29,7 +29,7 @@ stdenv.mkDerivation rec { buildInputs = [ cmake perl curl gtest lzma bzip2 lz4 db dpkg libxslt.bin ] ++ lib.optionals withDocs [ - doxygen Po4a w3m + doxygen Po4a w3m docbook_xml_dtd_45 ] ++ lib.optionals withNLS [ gettext ]; @@ -44,15 +44,6 @@ stdenv.mkDerivation rec { -DWITH_DOC=${if withDocs then "ON" else "OFF"} -DUSE_NLS=${if withNLS then "ON" else "OFF"} ) - - for f in doc/*; do - if [[ -f "$f" ]]; then - substituteInPlace "$f" \ - --replace \ - "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" \ - "${docbook_xml_dtd_45}/xml/dtd/docbook/docbookx.dtd" - fi - done ''; enableParallelBuilding = true; From 2cc8173c74a7c67986761c09ae128d8a258251f6 Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Sat, 7 Oct 2017 14:51:12 +0200 Subject: [PATCH 7/7] drumstick: Rely on XML_CATALOG_FILES variable --- pkgs/development/libraries/drumstick/default.nix | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/pkgs/development/libraries/drumstick/default.nix b/pkgs/development/libraries/drumstick/default.nix index 7ec72afc2bff..a46c6bab6479 100644 --- a/pkgs/development/libraries/drumstick/default.nix +++ b/pkgs/development/libraries/drumstick/default.nix @@ -15,25 +15,12 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; - # Prevent the manpage builds from attempting to access the Internet. - prePatch = '' - substituteInPlace cmake_admin/CreateManpages.cmake --replace \ - http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl \ - ${docbook_xsl}/xml/xsl/docbook/manpages/docbook.xsl - - for xml in doc/*.xml.in; do - substituteInPlace "$xml" --replace \ - http://www.docbook.org/xml/4.5/docbookx.dtd \ - ${docbook_xml_dtd_45}/xml/dtd/docbook/docbookx.dtd - done - ''; - #Temporarily remove drumstick-piano; Gives segment fault. Submitted ticket postInstall = '' rm $out/bin/drumstick-vpiano ''; - nativeBuildInputs = [ cmake pkgconfig ]; + nativeBuildInputs = [ cmake pkgconfig docbook_xsl docbook_xml_dtd_45 docbook_xml_dtd_45 ]; buildInputs = [ alsaLib doxygen fluidsynth qt5.qtbase qt5.qtsvg ];