subversionClient: fix Perl bindings with SWIG 4.4
Regenerate the Perl XS wrappers instead of mixing SWIG 4.4 runtime support with release-tarball wrappers generated by an older SWIG. This fixes SVN::Core and git-svn segfaults.
This commit is contained in:
@@ -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=";
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user