@@ -1,27 +1,30 @@
11{ stdenv, buildPackages, fetchurl, which, autoconf, automake, flex
2−, yacc , glibc, perl, kerberos, libxslt, docbook_xsl
3−, docbook_xml_dtd_43 , libtool_2, removeReferencesTo
4−, ncurses # Extra ncurses utilities. Only needed for debugging.
2+, yacc , glibc, perl, kerberos, libxslt, docbook_xsl, file
3+, docbook_xml_dtd_43, libtool_2
4+, withDevdoc ? false, doxygen, dblatex # Extra developer documentation
5+, ncurses # Extra ncurses utilities. Needed for debugging and monitoring.
56, tsmbac ? null # Tivoli Storage Manager Backup Client from IBM
67}:
78
89with (import ./srcs.nix { inherit fetchurl; });
10+let
11+ inherit (stdenv.lib) optional optionalString optionals;
912
10−stdenv.mkDerivation {
13+in stdenv.mkDerivation {
1114 pname = "openafs";
1215 inherit version srcs;
1316
1417 depsBuildBuild = [ buildPackages.stdenv.cc ];
1518 nativeBuildInputs = [ autoconf automake flex libxslt libtool_2 perl
16− removeReferencesTo which yacc ];
19+ which yacc ] ++ optionals withDevdoc [ doxygen dblatex ];
1720
1821 buildInputs = [ kerberos ncurses ];
1922
20− patches = [ ./bosserver.patch ./cross-build.patch ] ++ stdenv.lib.optional (tsmbac != null) ./tsmbac.patch;
23+ patches = [ ./bosserver.patch ./cross-build.patch ] ++ optional (tsmbac != null) ./tsmbac.patch;
2124
22− outputs = [ "out" "dev" "man" "doc" "server" ];
25+ outputs = [ "out" "dev" "man" "doc" ] ++ optional withDevdoc "devdoc";
2326
24− enableParallelBuilding = true;
27+ enableParallelBuilding = false;
2528
2629 setOutputFlags = false;
2730
@@ -44,19 +47,19 @@ stdenv.mkDerivation {
4447
4548 ./regen.sh
4649
50+
4751 configureFlagsArray=(
4852 "--with-gssapi"
4953 "--sysconfdir=/etc"
5054 "--localstatedir=/var"
5155 "--disable-kernel-module"
5256 "--disable-fuse-client"
53− "--with-html-xsl=${docbook_xsl}/share/xml/docbook-xsl/html/chunk.xsl"
54− ${stdenv.lib.optionalString (tsmbac != null) "--enable-tivoli-tsm"}
55− ${stdenv.lib.optionalString (ncurses == null) "--disable-gtx"}
57+ "--with-docbook-stylesheets=${docbook_xsl}/share/xml/docbook-xsl"
58+ ${optionalString (tsmbac != null) "--enable-tivoli-tsm"}
59+ ${optionalString (ncurses == null) "--disable-gtx"}
5660 "--disable-linux-d_splice-alias-extra-iput"
57− "--libexecdir=$server/libexec"
5861 )
59− '' + stdenv.lib.optionalString (tsmbac != null) ''
62+ '' + optionalString (tsmbac != null) ''
6063 export XBSA_CFLAGS="-Dxbsa -DNEW_XBSA -I${tsmbac}/lib64/sample -DXBSA_TSMLIB=\\\"${tsmbac}/lib64/libApiTSM64.so\\\""
6164 export XBSA_XLIBS="-ldl"
6265 '';
@@ -67,24 +70,28 @@ stdenv.mkDerivation {
6770 for d in doc/xml/{AdminGuide,QuickStartUnix,UserGuide}; do
6871 make -C "''${d}" index.html
6972 done
73+ '' + optionalString withDevdoc ''
74+ make dox
7075 '';
7176
7277 postInstall = ''
7378 mkdir -p $doc/share/doc/openafs/{AdminGuide,QuickStartUnix,UserGuide}
74− cp -r doc/{pdf,protocol,txt} README LICENSE $doc/share/doc/openafs
79+ cp -r doc/txt README LICENSE $doc/share/doc/openafs
7580 for d in AdminGuide QuickStartUnix UserGuide ; do
7681 cp "doc/xml/''${d}"/*.html "$doc/share/doc/openafs/''${d}"
7782 done
7883
7984 rm -r $out/lib/openafs
85+ '' + optionalString withDevdoc ''
86+ mkdir -p $devdoc/share/devhelp/openafs/doxygen
87+ cp -r doc/{pdf,protocol} $devdoc/share/devhelp/openafs
88+ cp -r doc/doxygen/output/html $devdoc/share/devhelp/openafs/doxygen
8089 '';
8190
8291 # Avoid references to $TMPDIR by removing it and let patchelf cleanup the
8392 # binaries.
8493 preFixup = ''
8594 rm -rf "$(pwd)" && mkdir "$(pwd)"
86−
87− find $out -type f -exec remove-references-to -t $server '{}' '+'
8895 '';
8996
9097 meta = with stdenv.lib; {