subversionClient: fix Perl bindings with SWIG 4.4 (#517383)

This commit is contained in:
Vladimír Čunát 2026-05-20 06:46:11 +00:00 committed by GitHub
commit e1dbbfb25a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 38 additions and 31 deletions

View file

@ -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=";
};
}

View file

@ -51,6 +51,7 @@
deterministic-host-uname, # trick Makefile into targeting the host platform when cross-compiling
doInstallCheck ? !stdenv.hostPlatform.isDarwin, # extremely slow on darwin
tests,
testers,
rustSupport ? lib.meta.availableOn stdenv.hostPlatform rustc,
cargo,
rustc,
@ -592,6 +593,13 @@ stdenv.mkDerivation (finalAttrs: {
});
buildbot-integration = nixosTests.buildbot;
}
// lib.optionalAttrs svnSupport {
git-svn-version = testers.testVersion {
package = finalAttrs.finalPackage;
command = "git svn --version";
version = "git-svn version ${version}";
};
}
// tests.fetchgit;
updateScript = ./update.sh;
};