diff --git a/pkgs/applications/version-management/subversion/default.nix b/pkgs/applications/version-management/subversion/default.nix index ac5a3e8216ce..79c096c0944a 100644 --- a/pkgs/applications/version-management/subversion/default.nix +++ b/pkgs/applications/version-management/subversion/default.nix @@ -40,7 +40,7 @@ let common = { version, - sha256, + hash, extraPatches ? [ ], }: stdenv.mkDerivation (finalAttrs: { @@ -49,7 +49,7 @@ let src = fetchurl { url = "mirror://apache/subversion/subversion-${finalAttrs.version}.tar.bz2"; - inherit sha256; + inherit hash; }; # Can't do separate $lib and $bin, as libs reference bins @@ -98,10 +98,15 @@ let ] ++ extraPatches; - # remove vendored swig-3 files as these will shadow the swig provided - # ones and result in compile errors + # Remove vendored swig-3 files as these will shadow the swig provided + # ones and result in compile errors. + # Also remove the generated Perl wrappers from the release tarball + # so they are rebuilt with the same SWIG runtime as libsvn_swig_perl. postPatch = '' rm subversion/bindings/swig/proxy/{perlrun.swg,pyrun.swg,python.swg,rubydef.swg,rubyhead.swg,rubytracking.swg,runtime.swg,swigrun.swg} + '' + + lib.optionalString perlBindings '' + rm subversion/bindings/swig/perl/native/{core.c,svn_*.c} ''; env = { @@ -141,32 +146,26 @@ let 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 + postInstall = + lib.optionalString pythonBindings '' + 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 + '' + + lib.optionalString perlBindings '' + make install-swig-pl + '' + + '' + mkdir -p $out/share/bash-completion/completions + cp tools/client-side/bash_completion $out/share/bash-completion/completions/subversion - 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" \ - --replace "${openssl.dev}/lib" "${lib.getLib openssl}/lib" - done - ''; + 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" \ + --replace "${openssl.dev}/lib" "${lib.getLib openssl}/lib" + done + ''; inherit perlBindings pythonBindings; @@ -195,6 +194,6 @@ in { subversion = common { version = "1.14.5"; - sha256 = "sha256-54op53Zri3s1RJfQj3GlVkGrxTZ1zhh1WEeBquNWRKE="; + hash = "sha256-54op53Zri3s1RJfQj3GlVkGrxTZ1zhh1WEeBquNWRKE="; }; }