From 18bc687d8784000346c8d0c93ebfb3023cd7ea69 Mon Sep 17 00:00:00 2001 From: Angel J <78835633+iamanaws@users.noreply.github.com> Date: Wed, 6 May 2026 10:35:35 -0700 Subject: [PATCH 1/2] 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. --- .../version-management/subversion/default.nix | 59 +++++++++---------- 1 file changed, 29 insertions(+), 30 deletions(-) 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="; }; } From 06844ef6f1360c715eef66157234ebb651e7a242 Mon Sep 17 00:00:00 2001 From: Angel J <78835633+iamanaws@users.noreply.github.com> Date: Wed, 6 May 2026 09:49:37 -0700 Subject: [PATCH 2/2] git: add passthru test for git-svn version --- pkgs/by-name/gi/git/package.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkgs/by-name/gi/git/package.nix b/pkgs/by-name/gi/git/package.nix index 06d755e4a403..d398f055fac2 100644 --- a/pkgs/by-name/gi/git/package.nix +++ b/pkgs/by-name/gi/git/package.nix @@ -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; };