2021-12-13 18:14:46 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, buildPackages
|
|
|
|
, fetchurl
|
|
|
|
, which
|
|
|
|
, autoconf
|
|
|
|
, automake
|
|
|
|
, flex
|
|
|
|
, bison
|
|
|
|
, glibc
|
|
|
|
, perl
|
|
|
|
, libkrb5
|
|
|
|
, libxslt
|
|
|
|
, docbook_xsl
|
|
|
|
, file
|
|
|
|
, docbook_xml_dtd_43
|
|
|
|
, libtool_2
|
|
|
|
, withDevdoc ? false
|
|
|
|
, doxygen
|
|
|
|
, dblatex # Extra developer documentation
|
2022-12-07 10:40:19 +00:00
|
|
|
, withNcurses ? false
|
2020-10-02 09:58:46 +00:00
|
|
|
, ncurses # Extra ncurses utilities. Needed for debugging and monitoring.
|
2022-08-22 12:25:36 +00:00
|
|
|
, withTsm ? false
|
|
|
|
, tsm-client # Tivoli Storage Manager Backup Client from IBM
|
2018-01-23 18:48:53 +00:00
|
|
|
}:
|
2009-11-10 16:00:52 +00:00
|
|
|
|
2018-01-23 18:48:53 +00:00
|
|
|
with (import ./srcs.nix { inherit fetchurl; });
|
2020-10-02 09:58:46 +00:00
|
|
|
let
|
2021-01-15 07:07:56 +00:00
|
|
|
inherit (lib) optional optionalString optionals;
|
2015-09-14 18:59:37 +00:00
|
|
|
|
2021-12-13 18:14:46 +00:00
|
|
|
in
|
|
|
|
stdenv.mkDerivation {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "openafs";
|
2018-01-23 18:48:53 +00:00
|
|
|
inherit version srcs;
|
2016-03-26 21:53:41 +00:00
|
|
|
|
2018-10-16 14:44:02 +00:00
|
|
|
depsBuildBuild = [ buildPackages.stdenv.cc ];
|
2021-12-13 18:14:46 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
autoconf
|
|
|
|
automake
|
|
|
|
flex
|
|
|
|
libxslt
|
|
|
|
libtool_2
|
|
|
|
perl
|
|
|
|
which
|
|
|
|
bison
|
|
|
|
] ++ optionals withDevdoc [ doxygen dblatex ];
|
2015-01-01 16:59:27 +00:00
|
|
|
|
2022-12-07 10:40:19 +00:00
|
|
|
buildInputs = [ libkrb5 ] ++ optional withNcurses ncurses;
|
2009-11-10 16:00:52 +00:00
|
|
|
|
2022-08-22 12:25:36 +00:00
|
|
|
patches = [ ./bosserver.patch ./cross-build.patch ]
|
|
|
|
++ optional withTsm ./tsmbac.patch;
|
2018-01-23 18:48:53 +00:00
|
|
|
|
2020-10-02 10:12:26 +00:00
|
|
|
outputs = [ "out" "dev" "man" "doc" ] ++ optional withDevdoc "devdoc";
|
2016-02-12 02:53:54 +00:00
|
|
|
|
2020-10-02 09:58:46 +00:00
|
|
|
enableParallelBuilding = false;
|
2018-06-29 22:34:35 +00:00
|
|
|
|
|
|
|
setOutputFlags = false;
|
|
|
|
|
|
|
|
# Makefiles don't include install targets for all new shared libs, yet.
|
|
|
|
dontDisableStatic = true;
|
2009-11-10 16:00:52 +00:00
|
|
|
|
2018-06-29 22:34:35 +00:00
|
|
|
preConfigure = ''
|
2011-10-13 12:37:15 +00:00
|
|
|
patchShebangs .
|
|
|
|
for i in `grep -l -R '/usr/\(include\|src\)' .`; do
|
|
|
|
echo "Patch /usr/include and /usr/src in $i"
|
|
|
|
substituteInPlace $i \
|
2015-04-26 17:54:51 +00:00
|
|
|
--replace "/usr/include" "${glibc.dev}/include" \
|
2011-10-13 12:37:15 +00:00
|
|
|
--replace "/usr/src" "$TMP"
|
2009-11-10 16:00:52 +00:00
|
|
|
done
|
|
|
|
|
2018-01-23 18:48:53 +00:00
|
|
|
for i in ./doc/xml/{AdminGuide,QuickStartUnix,UserGuide}/*.xml; do
|
|
|
|
substituteInPlace "''${i}" --replace "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" \
|
|
|
|
"${docbook_xml_dtd_43}/xml/dtd/docbook/docbookx.dtd"
|
|
|
|
done
|
|
|
|
|
2009-11-10 16:00:52 +00:00
|
|
|
./regen.sh
|
|
|
|
|
2020-10-02 09:58:46 +00:00
|
|
|
|
2011-10-13 12:37:15 +00:00
|
|
|
configureFlagsArray=(
|
2023-03-08 17:25:34 +00:00
|
|
|
"--with-krb5"
|
2018-01-23 18:48:53 +00:00
|
|
|
"--sysconfdir=/etc"
|
|
|
|
"--localstatedir=/var"
|
|
|
|
"--disable-kernel-module"
|
|
|
|
"--disable-fuse-client"
|
2020-10-02 09:58:46 +00:00
|
|
|
"--with-docbook-stylesheets=${docbook_xsl}/share/xml/docbook-xsl"
|
2022-08-22 12:25:36 +00:00
|
|
|
${optionalString withTsm "--enable-tivoli-tsm"}
|
2022-12-07 10:40:19 +00:00
|
|
|
${optionalString (!withNcurses) "--disable-gtx"}
|
2015-08-30 03:29:55 +00:00
|
|
|
"--disable-linux-d_splice-alias-extra-iput"
|
2011-10-13 12:37:15 +00:00
|
|
|
)
|
2022-08-22 12:25:36 +00:00
|
|
|
'' + optionalString withTsm ''
|
|
|
|
export XBSA_CFLAGS="-Dxbsa -DNEW_XBSA -I${tsm-client}/lib64/sample -DXBSA_TSMLIB=\\\"${tsm-client}/lib64/libApiTSM64.so\\\""
|
2018-01-23 18:48:53 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
buildFlags = [ "all_nolibafs" ];
|
|
|
|
|
|
|
|
postBuild = ''
|
|
|
|
for d in doc/xml/{AdminGuide,QuickStartUnix,UserGuide}; do
|
2018-06-29 22:34:35 +00:00
|
|
|
make -C "''${d}" index.html
|
2018-01-23 18:48:53 +00:00
|
|
|
done
|
2020-10-02 10:12:26 +00:00
|
|
|
'' + optionalString withDevdoc ''
|
|
|
|
make dox
|
2018-01-23 18:48:53 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
mkdir -p $doc/share/doc/openafs/{AdminGuide,QuickStartUnix,UserGuide}
|
2020-10-02 10:12:26 +00:00
|
|
|
cp -r doc/txt README LICENSE $doc/share/doc/openafs
|
2018-01-23 18:48:53 +00:00
|
|
|
for d in AdminGuide QuickStartUnix UserGuide ; do
|
|
|
|
cp "doc/xml/''${d}"/*.html "$doc/share/doc/openafs/''${d}"
|
|
|
|
done
|
|
|
|
|
2023-03-08 17:25:34 +00:00
|
|
|
cp src/tools/dumpscan/{afsdump_dirlist,afsdump_extract,afsdump_scan,dumptool} $out/bin
|
|
|
|
|
2018-06-29 22:34:35 +00:00
|
|
|
rm -r $out/lib/openafs
|
2020-10-02 10:12:26 +00:00
|
|
|
'' + 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
|
2018-06-29 22:34:35 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
# Avoid references to $TMPDIR by removing it and let patchelf cleanup the
|
|
|
|
# binaries.
|
|
|
|
preFixup = ''
|
|
|
|
rm -rf "$(pwd)" && mkdir "$(pwd)"
|
2009-11-10 16:00:52 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2018-01-23 18:48:53 +00:00
|
|
|
outputsToInstall = [ "out" "doc" "man" ];
|
2011-10-13 12:37:15 +00:00
|
|
|
description = "Open AFS client";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://www.openafs.org";
|
2016-03-26 21:53:41 +00:00
|
|
|
license = licenses.ipl10;
|
|
|
|
platforms = platforms.linux;
|
2019-10-07 14:44:58 +00:00
|
|
|
maintainers = [ maintainers.maggesi maintainers.spacefrogg ];
|
2009-11-10 16:00:52 +00:00
|
|
|
};
|
|
|
|
}
|