2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
stdenv,
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchurl,
|
|
|
|
isPy3k,
|
|
|
|
python,
|
|
|
|
apr,
|
|
|
|
aprutil,
|
|
|
|
bash,
|
|
|
|
e2fsprogs,
|
|
|
|
expat,
|
|
|
|
gcc,
|
|
|
|
glibcLocales,
|
|
|
|
neon,
|
|
|
|
openssl,
|
|
|
|
pycxx,
|
|
|
|
subversion,
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pysvn";
|
2023-02-02 18:25:31 +00:00
|
|
|
version = "1.9.20";
|
2020-04-24 23:36:52 +00:00
|
|
|
format = "other";
|
|
|
|
|
|
|
|
src = fetchurl {
|
2023-02-02 18:25:31 +00:00
|
|
|
url = "mirror://sourceforge/project/pysvn/pysvn/V${version}/pysvn-${version}.tar.gz";
|
|
|
|
hash = "sha256-LbAz+KjEY3nkSJAzJNwlnSRYoWr4i1ITRUPV3ZBH7cc=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
patches = [ ./replace-python-first.patch ];
|
2022-11-21 17:40:18 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
buildInputs = [
|
|
|
|
bash
|
|
|
|
subversion
|
|
|
|
apr
|
|
|
|
aprutil
|
|
|
|
expat
|
|
|
|
neon
|
|
|
|
openssl
|
|
|
|
] ++ lib.optionals stdenv.isLinux [ e2fsprogs ] ++ lib.optionals stdenv.isDarwin [ gcc ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
cd Source
|
2023-11-16 04:20:00 +00:00
|
|
|
${python.pythonOnBuildForHost.interpreter} setup.py backport
|
|
|
|
${python.pythonOnBuildForHost.interpreter} setup.py configure \
|
2020-12-07 07:45:13 +00:00
|
|
|
--apr-inc-dir=${apr.dev}/include \
|
|
|
|
--apu-inc-dir=${aprutil.dev}/include \
|
|
|
|
--pycxx-dir=${pycxx.dev}/include \
|
|
|
|
--svn-inc-dir=${subversion.dev}/include/subversion-1 \
|
|
|
|
--pycxx-src-dir=${pycxx.dev}/src \
|
|
|
|
--apr-lib-dir=${apr.out}/lib \
|
|
|
|
--svn-lib-dir=${subversion.out}/lib \
|
|
|
|
--svn-bin-dir=${subversion.out}/bin
|
2022-11-21 17:40:18 +00:00
|
|
|
'';
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [ glibcLocales ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-12-07 07:45:13 +00:00
|
|
|
checkPhase = ''
|
|
|
|
runHook preCheck
|
|
|
|
|
|
|
|
# It is not only shebangs, some tests also write scripts dynamically
|
|
|
|
# so it is easier to simply search and replace
|
|
|
|
sed -i "s|/bin/bash|${bash}/bin/bash|" ../Tests/test-*.sh
|
|
|
|
make -C ../Tests
|
|
|
|
|
|
|
|
runHook postCheck
|
|
|
|
'';
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
pythonImportsCheck = [ "pysvn" ];
|
2022-11-21 17:40:18 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
installPhase = ''
|
|
|
|
dest=$(toPythonPath $out)/pysvn
|
|
|
|
mkdir -p $dest
|
|
|
|
cp pysvn/__init__.py $dest/
|
|
|
|
cp pysvn/_pysvn*.so $dest/
|
|
|
|
mkdir -p $out/share/doc
|
2020-12-07 07:45:13 +00:00
|
|
|
mv -v ../Docs $out/share/doc/pysvn-${version}
|
|
|
|
rm -v $out/share/doc/pysvn-${version}/generate_cpp_docs_from_html_docs.py
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Python bindings for Subversion";
|
2022-11-21 17:40:18 +00:00
|
|
|
homepage = "https://pysvn.sourceforge.io/";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.asl20;
|
2022-11-21 17:40:18 +00:00
|
|
|
maintainers = with maintainers; [ dotlambda ];
|
2021-03-09 03:18:52 +00:00
|
|
|
# g++: command not found
|
|
|
|
broken = stdenv.isDarwin;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|