From f73ffce2d4c01011bc5454b203718f8187c189aa Mon Sep 17 00:00:00 2001 From: worldofpeace Date: Thu, 16 May 2019 13:25:41 -0400 Subject: [PATCH 1/3] gtk-doc: add missing pygments Also drop six since it was removed in the last release[0] [0]: https://gitlab.gnome.org/GNOME/gtk-doc/blob/GTK_DOC_1_29/NEWS#L4 --- pkgs/development/tools/documentation/gtk-doc/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/tools/documentation/gtk-doc/default.nix b/pkgs/development/tools/documentation/gtk-doc/default.nix index 9d617e67127..91bd12a90a2 100644 --- a/pkgs/development/tools/documentation/gtk-doc/default.nix +++ b/pkgs/development/tools/documentation/gtk-doc/default.nix @@ -26,10 +26,10 @@ stdenv.mkDerivation rec { configureFlags = [ "--disable-scrollkeeper" ]; - # Make six available for binaries, python.withPackages creates a wrapper + # Make pygments available for binaries, python.withPackages creates a wrapper # but scripts are not allowed in shebangs so we link it into sys.path. postInstall = '' - ln -s ${python3.pkgs.six}/${python3.sitePackages}/* $out/share/gtk-doc/python/ + ln -s ${python3.pkgs.pygments}/${python3.sitePackages}/* $out/share/gtk-doc/python/ ''; doCheck = false; # requires a lot of stuff From 064ca0afe9c9983d6735cf10d28be6c430409cae Mon Sep 17 00:00:00 2001 From: worldofpeace Date: Thu, 16 May 2019 14:34:57 -0400 Subject: [PATCH 2/3] gtk-doc: build with meson --- .../tools/documentation/gtk-doc/default.nix | 49 ++++++++++++++----- 1 file changed, 38 insertions(+), 11 deletions(-) diff --git a/pkgs/development/tools/documentation/gtk-doc/default.nix b/pkgs/development/tools/documentation/gtk-doc/default.nix index 91bd12a90a2..ee2ca64ffeb 100644 --- a/pkgs/development/tools/documentation/gtk-doc/default.nix +++ b/pkgs/development/tools/documentation/gtk-doc/default.nix @@ -1,5 +1,15 @@ -{ stdenv, fetchurl, autoreconfHook, pkgconfig, perl, python3, libxml2Python, libxslt, which -, docbook_xml_dtd_43, docbook_xsl, gnome-doc-utils, gettext, itstool, gnome3 +{ stdenv +, fetchFromGitLab +, meson +, ninja +, pkgconfig +, python3 +, libxml2Python +, docbook_xml_dtd_43 +, docbook_xsl +, libxslt +, gettext +, gnome3 , withDblatex ? false, dblatex }: @@ -7,9 +17,12 @@ stdenv.mkDerivation rec { pname = "gtk-doc"; version = "1.30"; - src = fetchurl { - url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz"; - sha256 = "17h6nwhis66z4dxjrc833wvfl6pqjp81yfx3fq6x7k1qp2749xm4"; + src = fetchFromGitLab { + domain = "gitlab.gnome.org"; + owner = "GNOME"; + repo = pname; + rev = "GTK_DOC_${stdenv.lib.replaceStrings ["."] ["_"] version }"; + sha256 = "05lr6apj3pd3s59a7k6p45k9ywwrp577ra4pvkhxvb5p7v90c2fi"; }; patches = [ @@ -18,13 +31,27 @@ stdenv.mkDerivation rec { outputDevdoc = "out"; - nativeBuildInputs = [ autoreconfHook ]; - buildInputs = - [ pkgconfig perl python3 libxml2Python libxslt docbook_xml_dtd_43 docbook_xsl - gnome-doc-utils gettext which itstool - ] ++ stdenv.lib.optional withDblatex dblatex; + nativeBuildInputs = [ + gettext + meson + ninja + ]; - configureFlags = [ "--disable-scrollkeeper" ]; + buildInputs = [ + docbook_xml_dtd_43 + docbook_xsl + libxslt + pkgconfig + python3 + libxml2Python + ] + ++ stdenv.lib.optional withDblatex dblatex + ; + + mesonFlags = [ + "-Dtests=false" + "-Dyelp_manual=false" + ]; # Make pygments available for binaries, python.withPackages creates a wrapper # but scripts are not allowed in shebangs so we link it into sys.path. From 0e2768050a7fee157556679b31773b75a935d01d Mon Sep 17 00:00:00 2001 From: worldofpeace Date: Sat, 18 May 2019 14:50:56 -0400 Subject: [PATCH 3/3] gtk-doc: fix css file permissions Fixes https://gitlab.gnome.org/GNOME/gtk-doc/issues/84 which was breaking the documentation build for glib. The patch was based off an upstream pr [0] but completed with the requested changes. [0]: https://gitlab.gnome.org/GNOME/gtk-doc/merge_requests/27 --- ...ghlight-fix-permission-on-file-style.patch | 24 +++++++++++++++++++ .../tools/documentation/gtk-doc/default.nix | 2 ++ 2 files changed, 26 insertions(+) create mode 100644 pkgs/development/tools/documentation/gtk-doc/0001-highlight-fix-permission-on-file-style.patch diff --git a/pkgs/development/tools/documentation/gtk-doc/0001-highlight-fix-permission-on-file-style.patch b/pkgs/development/tools/documentation/gtk-doc/0001-highlight-fix-permission-on-file-style.patch new file mode 100644 index 00000000000..f7e37a1a5e5 --- /dev/null +++ b/pkgs/development/tools/documentation/gtk-doc/0001-highlight-fix-permission-on-file-style.patch @@ -0,0 +1,24 @@ +From 95a75c95c5c4e641ce7cda0ded968d66f07f822a Mon Sep 17 00:00:00 2001 +From: worldofpeace +Date: Sat, 18 May 2019 14:44:08 -0400 +Subject: [PATCH] highlight: fix permission on file style + +--- + gtkdoc/highlight.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/gtkdoc/highlight.py b/gtkdoc/highlight.py +index 8f6e470..d11c432 100644 +--- a/gtkdoc/highlight.py ++++ b/gtkdoc/highlight.py +@@ -47,6 +47,6 @@ def highlight_code(code, lang='c'): + + + def append_style_defs(css_file_name): +- os.chmod(css_file_name, stat.S_IWRITE) ++ os.chmod(css_file_name, 0o664) + with open(css_file_name, 'at', newline='\n', encoding='utf-8') as css: + css.write(HTML_FORMATTER.get_style_defs()) +-- +2.21.0 + diff --git a/pkgs/development/tools/documentation/gtk-doc/default.nix b/pkgs/development/tools/documentation/gtk-doc/default.nix index ee2ca64ffeb..44b5384106e 100644 --- a/pkgs/development/tools/documentation/gtk-doc/default.nix +++ b/pkgs/development/tools/documentation/gtk-doc/default.nix @@ -27,6 +27,8 @@ stdenv.mkDerivation rec { patches = [ passthru.respect_xml_catalog_files_var_patch + # https://gitlab.gnome.org/GNOME/gtk-doc/issues/84 + ./0001-highlight-fix-permission-on-file-style.patch ]; outputDevdoc = "out";