Merge pull request #30189 from jtojnar/docbook-xml-catalogs-hook

Rely on XML_CATALOG_FILES variable for DocBook
This commit is contained in:
Jörg Thalheim 2017-10-08 00:44:21 +01:00 committed by GitHub
commit ca720961f5
14 changed files with 57 additions and 69 deletions

View file

@ -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"

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -1,4 +1,4 @@
{ lib, stdenv, fetchurl }:
{ lib, stdenv, fetchurl, findXMLCatalogs }:
let
@ -10,6 +10,8 @@ let
inherit sha256;
};
propagatedBuildInputs = [ findXMLCatalogs ];
dontBuild = true;
installPhase = ''

View file

@ -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
];

View file

@ -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
<?xml version="1.0"?>
<!DOCTYPE catalog PUBLIC "-//OASIS//DTD Entity Resolution XML Catalog V1.0//EN" "http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd">
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
<nextCatalog catalog="${docbook_xsl}/xml/xsl/docbook/catalog.xml" />
<nextCatalog catalog="${docbook_xml_dtd_43}/xml/dtd/docbook/catalog.xml" />
</catalog>
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";

View file

@ -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
])

View file

@ -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

View file

@ -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

View file

@ -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;