From 62a34589b8cf2da71f3e7fdb5b5003b83710d00e Mon Sep 17 00:00:00 2001 From: Michael Raitza Date: Fri, 2 Oct 2020 11:58:46 +0200 Subject: [PATCH 1/3] openafs_1_8: Cleanup build and fix build issues Parallel building is broken, leading to failing builds in very rare cases. (volint.h not yet built while alredy needed when compiling volser.) --- pkgs/servers/openafs/1.8/default.nix | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/pkgs/servers/openafs/1.8/default.nix b/pkgs/servers/openafs/1.8/default.nix index 07f5560ff20a..4189ff9d0140 100644 --- a/pkgs/servers/openafs/1.8/default.nix +++ b/pkgs/servers/openafs/1.8/default.nix @@ -1,13 +1,15 @@ { stdenv, buildPackages, fetchurl, which, autoconf, automake, flex -, yacc , glibc, perl, kerberos, libxslt, docbook_xsl , docbook_xml_dtd_43 , libtool_2, removeReferencesTo -, ncurses # Extra ncurses utilities. Only needed for debugging. +, yacc , glibc, perl, kerberos, libxslt, docbook_xsl, file +, ncurses # Extra ncurses utilities. Needed for debugging and monitoring. , tsmbac ? null # Tivoli Storage Manager Backup Client from IBM }: with (import ./srcs.nix { inherit fetchurl; }); +let + inherit (stdenv.lib) optional optionalString optionals; -stdenv.mkDerivation { +in stdenv.mkDerivation { pname = "openafs"; inherit version srcs; @@ -17,11 +19,11 @@ stdenv.mkDerivation { buildInputs = [ kerberos ncurses ]; - patches = [ ./bosserver.patch ./cross-build.patch ] ++ stdenv.lib.optional (tsmbac != null) ./tsmbac.patch; + patches = [ ./bosserver.patch ./cross-build.patch ] ++ optional (tsmbac != null) ./tsmbac.patch; outputs = [ "out" "dev" "man" "doc" "server" ]; - enableParallelBuilding = true; + enableParallelBuilding = false; setOutputFlags = false; @@ -44,19 +46,20 @@ stdenv.mkDerivation { ./regen.sh + configureFlagsArray=( "--with-gssapi" "--sysconfdir=/etc" "--localstatedir=/var" "--disable-kernel-module" "--disable-fuse-client" - "--with-html-xsl=${docbook_xsl}/share/xml/docbook-xsl/html/chunk.xsl" - ${stdenv.lib.optionalString (tsmbac != null) "--enable-tivoli-tsm"} - ${stdenv.lib.optionalString (ncurses == null) "--disable-gtx"} + "--with-docbook-stylesheets=${docbook_xsl}/share/xml/docbook-xsl" + ${optionalString (tsmbac != null) "--enable-tivoli-tsm"} + ${optionalString (ncurses == null) "--disable-gtx"} "--disable-linux-d_splice-alias-extra-iput" "--libexecdir=$server/libexec" ) - '' + stdenv.lib.optionalString (tsmbac != null) '' + '' + optionalString (tsmbac != null) '' export XBSA_CFLAGS="-Dxbsa -DNEW_XBSA -I${tsmbac}/lib64/sample -DXBSA_TSMLIB=\\\"${tsmbac}/lib64/libApiTSM64.so\\\"" export XBSA_XLIBS="-ldl" ''; From f08099d0a724bee7123eebea81914c32610f967f Mon Sep 17 00:00:00 2001 From: Michael Raitza Date: Fri, 2 Oct 2020 12:07:28 +0200 Subject: [PATCH 2/3] openafs_1_8: Merge server output with out User and server binaries cannot be shipped separately. The bos tool uses a hard-coded path to the volume salvage command (which resides with the server binaries). Splitting them into separate outputs invalidates the reference in the bos tool (due to remove-references-to). This rendered the volume salvager inoperable (which is obviously a bad thing). --- pkgs/servers/openafs/1.8/default.nix | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/pkgs/servers/openafs/1.8/default.nix b/pkgs/servers/openafs/1.8/default.nix index 4189ff9d0140..2247afbc0d95 100644 --- a/pkgs/servers/openafs/1.8/default.nix +++ b/pkgs/servers/openafs/1.8/default.nix @@ -1,6 +1,6 @@ { stdenv, buildPackages, fetchurl, which, autoconf, automake, flex -, docbook_xml_dtd_43 , libtool_2, removeReferencesTo , yacc , glibc, perl, kerberos, libxslt, docbook_xsl, file +, docbook_xml_dtd_43, libtool_2 , ncurses # Extra ncurses utilities. Needed for debugging and monitoring. , tsmbac ? null # Tivoli Storage Manager Backup Client from IBM }: @@ -15,13 +15,13 @@ in stdenv.mkDerivation { depsBuildBuild = [ buildPackages.stdenv.cc ]; nativeBuildInputs = [ autoconf automake flex libxslt libtool_2 perl - removeReferencesTo which yacc ]; + which yacc ]; buildInputs = [ kerberos ncurses ]; patches = [ ./bosserver.patch ./cross-build.patch ] ++ optional (tsmbac != null) ./tsmbac.patch; - outputs = [ "out" "dev" "man" "doc" "server" ]; + outputs = [ "out" "dev" "man" "doc" ]; enableParallelBuilding = false; @@ -57,7 +57,6 @@ in stdenv.mkDerivation { ${optionalString (tsmbac != null) "--enable-tivoli-tsm"} ${optionalString (ncurses == null) "--disable-gtx"} "--disable-linux-d_splice-alias-extra-iput" - "--libexecdir=$server/libexec" ) '' + optionalString (tsmbac != null) '' export XBSA_CFLAGS="-Dxbsa -DNEW_XBSA -I${tsmbac}/lib64/sample -DXBSA_TSMLIB=\\\"${tsmbac}/lib64/libApiTSM64.so\\\"" @@ -86,8 +85,6 @@ in stdenv.mkDerivation { # binaries. preFixup = '' rm -rf "$(pwd)" && mkdir "$(pwd)" - - find $out -type f -exec remove-references-to -t $server '{}' '+' ''; meta = with stdenv.lib; { From 54a69eb80480016341d4825f272b9017a3bd0ac1 Mon Sep 17 00:00:00 2001 From: Michael Raitza Date: Fri, 2 Oct 2020 12:12:26 +0200 Subject: [PATCH 3/3] openafs_1_8: Properly generate and split off developer documentation --- pkgs/servers/openafs/1.8/default.nix | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/pkgs/servers/openafs/1.8/default.nix b/pkgs/servers/openafs/1.8/default.nix index 2247afbc0d95..c26f8d3a23c5 100644 --- a/pkgs/servers/openafs/1.8/default.nix +++ b/pkgs/servers/openafs/1.8/default.nix @@ -1,6 +1,7 @@ { stdenv, buildPackages, fetchurl, which, autoconf, automake, flex , yacc , glibc, perl, kerberos, libxslt, docbook_xsl, file , docbook_xml_dtd_43, libtool_2 +, withDevdoc ? false, doxygen, dblatex # Extra developer documentation , ncurses # Extra ncurses utilities. Needed for debugging and monitoring. , tsmbac ? null # Tivoli Storage Manager Backup Client from IBM }: @@ -15,13 +16,13 @@ in stdenv.mkDerivation { depsBuildBuild = [ buildPackages.stdenv.cc ]; nativeBuildInputs = [ autoconf automake flex libxslt libtool_2 perl - which yacc ]; + which yacc ] ++ optionals withDevdoc [ doxygen dblatex ]; buildInputs = [ kerberos ncurses ]; patches = [ ./bosserver.patch ./cross-build.patch ] ++ optional (tsmbac != null) ./tsmbac.patch; - outputs = [ "out" "dev" "man" "doc" ]; + outputs = [ "out" "dev" "man" "doc" ] ++ optional withDevdoc "devdoc"; enableParallelBuilding = false; @@ -69,16 +70,22 @@ in stdenv.mkDerivation { for d in doc/xml/{AdminGuide,QuickStartUnix,UserGuide}; do make -C "''${d}" index.html done + '' + optionalString withDevdoc '' + make dox ''; postInstall = '' mkdir -p $doc/share/doc/openafs/{AdminGuide,QuickStartUnix,UserGuide} - cp -r doc/{pdf,protocol,txt} README LICENSE $doc/share/doc/openafs + cp -r doc/txt README LICENSE $doc/share/doc/openafs for d in AdminGuide QuickStartUnix UserGuide ; do cp "doc/xml/''${d}"/*.html "$doc/share/doc/openafs/''${d}" done rm -r $out/lib/openafs + '' + optionalString withDevdoc '' + mkdir -p $devdoc/share/devhelp/openafs/doxygen + cp -r doc/{pdf,protocol} $devdoc/share/devhelp/openafs + cp -r doc/doxygen/output/html $devdoc/share/devhelp/openafs/doxygen ''; # Avoid references to $TMPDIR by removing it and let patchelf cleanup the