2020-04-24 23:36:52 +00:00
|
|
|
{ bdbSupport ? true # build support for Berkeley DB repositories
|
|
|
|
, httpServer ? false # build Apache DAV module
|
|
|
|
, httpSupport ? true # client must support http
|
|
|
|
, pythonBindings ? false
|
|
|
|
, perlBindings ? false
|
|
|
|
, javahlBindings ? false
|
|
|
|
, saslSupport ? false
|
2021-01-15 22:18:51 +00:00
|
|
|
, lib, stdenv, fetchurl, apr, aprutil, zlib, sqlite, openssl, lz4, utf8proc
|
2022-06-16 17:23:12 +00:00
|
|
|
, CoreServices, Security
|
2021-05-28 09:39:13 +00:00
|
|
|
, autoconf, libtool
|
2021-05-03 20:48:10 +00:00
|
|
|
, apacheHttpd ? null, expat, swig ? null, jdk ? null, python3 ? null, py3c ? null, perl ? null
|
2020-04-24 23:36:52 +00:00
|
|
|
, sasl ? null, serf ? null
|
|
|
|
}:
|
|
|
|
|
|
|
|
assert bdbSupport -> aprutil.bdbSupport;
|
|
|
|
assert httpServer -> apacheHttpd != null;
|
2021-05-03 20:48:10 +00:00
|
|
|
assert pythonBindings -> swig != null && python3 != null && py3c != null;
|
2020-04-24 23:36:52 +00:00
|
|
|
assert javahlBindings -> jdk != null && perl != null;
|
|
|
|
|
|
|
|
let
|
2021-05-28 09:39:13 +00:00
|
|
|
# Update libtool for macOS 11 support
|
|
|
|
needsAutogen = stdenv.hostPlatform.isDarwin && lib.versionAtLeast stdenv.hostPlatform.darwinMinVersion "11";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-04-26 19:14:03 +00:00
|
|
|
common = { version, sha256, extraPatches ? [ ] }: stdenv.mkDerivation (rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
inherit version;
|
2022-04-15 01:41:22 +00:00
|
|
|
pname = "subversion${lib.optionalString (!bdbSupport && perlBindings && pythonBindings) "-client"}";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2022-04-15 01:41:22 +00:00
|
|
|
url = "mirror://apache/subversion/subversion-${version}.tar.bz2";
|
2020-04-24 23:36:52 +00:00
|
|
|
inherit sha256;
|
|
|
|
};
|
|
|
|
|
|
|
|
# Can't do separate $lib and $bin, as libs reference bins
|
|
|
|
outputs = [ "out" "dev" "man" ];
|
|
|
|
|
2021-05-28 09:39:13 +00:00
|
|
|
nativeBuildInputs = lib.optionals needsAutogen [ autoconf libtool python3 ];
|
|
|
|
|
2021-04-22 02:08:21 +00:00
|
|
|
buildInputs = [ zlib apr aprutil sqlite openssl lz4 utf8proc ]
|
2021-01-17 00:15:33 +00:00
|
|
|
++ lib.optional httpSupport serf
|
2021-05-03 20:48:10 +00:00
|
|
|
++ lib.optionals pythonBindings [ python3 py3c ]
|
2021-01-17 00:15:33 +00:00
|
|
|
++ lib.optional perlBindings perl
|
2022-06-16 17:23:12 +00:00
|
|
|
++ lib.optional saslSupport sasl
|
2022-10-30 15:09:59 +00:00
|
|
|
++ lib.optionals stdenv.hostPlatform.isDarwin [ CoreServices Security ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-04-26 19:14:03 +00:00
|
|
|
patches = [ ./apr-1.patch ] ++ extraPatches;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
# We are hitting the following issue even with APR 1.6.x
|
|
|
|
# -> https://issues.apache.org/jira/browse/SVN-4813
|
|
|
|
# "-P" CPPFLAG is needed to build Python bindings and subversionClient
|
|
|
|
CPPFLAGS = [ "-P" ];
|
|
|
|
|
2021-05-28 09:39:13 +00:00
|
|
|
preConfigure = lib.optionalString needsAutogen ''
|
|
|
|
./autogen.sh
|
|
|
|
'';
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
configureFlags = [
|
2021-01-17 00:15:33 +00:00
|
|
|
(lib.withFeature bdbSupport "berkeley-db")
|
|
|
|
(lib.withFeatureAs httpServer "apxs" "${apacheHttpd.dev}/bin/apxs")
|
|
|
|
(lib.withFeatureAs (pythonBindings || perlBindings) "swig" swig)
|
|
|
|
(lib.withFeatureAs saslSupport "sasl" sasl)
|
|
|
|
(lib.withFeatureAs httpSupport "serf" serf)
|
2020-04-24 23:36:52 +00:00
|
|
|
"--with-zlib=${zlib.dev}"
|
|
|
|
"--with-sqlite=${sqlite.dev}"
|
2023-04-29 16:46:19 +00:00
|
|
|
"--with-apr=${apr.dev}"
|
|
|
|
"--with-apr-util=${aprutil.dev}"
|
2021-01-17 00:15:33 +00:00
|
|
|
] ++ lib.optionals javahlBindings [
|
2020-04-24 23:36:52 +00:00
|
|
|
"--enable-javahl"
|
|
|
|
"--with-jdk=${jdk}"
|
|
|
|
];
|
|
|
|
|
|
|
|
preBuild = ''
|
|
|
|
makeFlagsArray=(APACHE_LIBEXECDIR=$out/modules)
|
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
if test -n "$pythonBindings"; then
|
|
|
|
make swig-py swig_pydir=$(toPythonPath $out)/libsvn swig_pydir_extra=$(toPythonPath $out)/svn
|
|
|
|
make install-swig-py swig_pydir=$(toPythonPath $out)/libsvn swig_pydir_extra=$(toPythonPath $out)/svn
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test -n "$perlBindings"; then
|
|
|
|
make swig-pl-lib
|
|
|
|
make install-swig-pl-lib
|
|
|
|
cd subversion/bindings/swig/perl/native
|
|
|
|
perl Makefile.PL PREFIX=$out
|
|
|
|
make install
|
|
|
|
cd -
|
|
|
|
fi
|
|
|
|
|
|
|
|
mkdir -p $out/share/bash-completion/completions
|
|
|
|
cp tools/client-side/bash_completion $out/share/bash-completion/completions/subversion
|
|
|
|
|
|
|
|
for f in $out/lib/*.la $out/lib/python*/site-packages/*/*.la; do
|
|
|
|
substituteInPlace $f \
|
|
|
|
--replace "${expat.dev}/lib" "${expat.out}/lib" \
|
|
|
|
--replace "${zlib.dev}/lib" "${zlib.out}/lib" \
|
|
|
|
--replace "${sqlite.dev}/lib" "${sqlite.out}/lib" \
|
2022-04-03 18:54:34 +00:00
|
|
|
--replace "${openssl.dev}/lib" "${lib.getLib openssl}/lib"
|
2020-04-24 23:36:52 +00:00
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
|
|
|
inherit perlBindings pythonBindings;
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
2023-03-27 19:17:25 +00:00
|
|
|
# Missing install dependencies:
|
|
|
|
# libtool: error: error: relink 'libsvn_ra_serf-1.la' with the above command before installing it
|
|
|
|
# make: *** [build-outputs.mk:1316: install-serf-lib] Error 1
|
|
|
|
enableParallelInstalling = false;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [ python3 ];
|
2020-04-24 23:36:52 +00:00
|
|
|
doCheck = false; # fails 10 out of ~2300 tests
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "A version control system intended to be a compelling replacement for CVS in the open source community";
|
|
|
|
license = licenses.asl20;
|
2022-01-03 16:56:52 +00:00
|
|
|
homepage = "https://subversion.apache.org/";
|
2020-04-24 23:36:52 +00:00
|
|
|
maintainers = with maintainers; [ eelco lovek323 ];
|
|
|
|
platforms = platforms.linux ++ platforms.darwin;
|
|
|
|
};
|
|
|
|
|
2021-01-17 00:15:33 +00:00
|
|
|
} // lib.optionalAttrs stdenv.isDarwin {
|
2020-04-24 23:36:52 +00:00
|
|
|
CXX = "clang++";
|
|
|
|
CC = "clang";
|
|
|
|
CPP = "clang -E";
|
|
|
|
CXXCPP = "clang++ -E";
|
|
|
|
});
|
|
|
|
|
|
|
|
in {
|
|
|
|
subversion = common {
|
2022-04-15 01:41:22 +00:00
|
|
|
version = "1.14.2";
|
|
|
|
sha256 = "sha256-yRMOjQt1copm8OcDj8dwUuZxgw14W1YWqtU7SBDTzCg=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|