3
0
Fork 0
forked from mirrors/nixpkgs

conky: build the docs, fixes #11461

This commit is contained in:
Jan Malakhovski 2015-12-04 16:15:44 +00:00 committed by Rok Garbas
parent 5bd92c0197
commit 43a1cfccf5

View file

@ -8,6 +8,12 @@
, ibmSupport ? true # IBM/Lenovo notebooks
# optional features with extra dependencies
# ouch, this is ugly, but this gives the man page
, docsSupport ? true, docbook2x, libxslt ? null
, man ? null, less ? null
, docbook_xsl ? null , docbook_xml_dtd_44 ? null
, ncursesSupport ? true , ncurses ? null
, x11Support ? true , xlibsWrapper ? null
, xdamageSupport ? x11Support, libXdamage ? null
@ -27,6 +33,10 @@
, libxml2 ? null
}:
assert docsSupport -> docbook2x != null && libxslt != null
&& man != null && less != null
&& docbook_xsl != null && docbook_xml_dtd_44 != null;
assert ncursesSupport -> ncurses != null;
assert x11Support -> xlibsWrapper != null;
@ -63,11 +73,20 @@ stdenv.mkDerivation rec {
postPatch = ''
sed -i -e '/include.*CheckIncludeFile)/i include(CheckIncludeFiles)' \
cmake/ConkyPlatformChecks.cmake
'' + optionalString docsSupport ''
# 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"
'';
NIX_LDFLAGS = "-lgcc_s";
buildInputs = [ pkgconfig glib cmake ]
++ optionals docsSupport [ docbook2x libxslt man less ]
++ optional ncursesSupport ncurses
++ optional x11Support xlibsWrapper
++ optional xdamageSupport libXdamage
@ -82,6 +101,7 @@ stdenv.mkDerivation rec {
;
cmakeFlags = [ "-DCMAKE_BUILD_TYPE=Release" ]
++ optional docsSupport "-DMAINTAINER_MODE=ON"
++ optional curlSupport "-DBUILD_CURL=ON"
++ optional (!ibmSupport) "-DBUILD_IBM=OFF"
++ optional imlib2Support "-DBUILD_IMLIB2=ON"