2018-10-26 16:42:09 +01:00
|
|
|
{ stdenv
|
2020-11-01 13:32:31 +00:00
|
|
|
, lib
|
2018-10-26 16:42:09 +01:00
|
|
|
, buildPythonPackage
|
|
|
|
, fetchurl
|
|
|
|
, isPy3k
|
|
|
|
, python
|
2020-11-01 13:32:31 +00:00
|
|
|
, apr
|
|
|
|
, aprutil
|
|
|
|
, bash
|
|
|
|
, e2fsprogs
|
|
|
|
, expat
|
|
|
|
, gcc
|
|
|
|
, glibcLocales
|
|
|
|
, neon
|
|
|
|
, openssl
|
|
|
|
, pycxx
|
|
|
|
, subversion
|
2018-10-26 16:42:09 +01:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pysvn";
|
2020-11-01 13:32:31 +00:00
|
|
|
version = "1.9.12";
|
2018-10-26 16:42:09 +01:00
|
|
|
format = "other";
|
|
|
|
|
|
|
|
src = fetchurl {
|
2021-03-03 00:56:40 +00:00
|
|
|
url = "https://pysvn.barrys-emacs.org/source_kits/${pname}-${version}.tar.gz";
|
2020-11-01 13:32:31 +00:00
|
|
|
sha256 = "sRPa4wNyjDmGdF1gTOgLS0pnrdyZwkkH4/9UCdh/R9Q=";
|
2018-10-26 16:42:09 +01:00
|
|
|
};
|
|
|
|
|
2020-11-01 13:32:31 +00:00
|
|
|
buildInputs = [ bash subversion apr aprutil expat neon openssl ]
|
|
|
|
++ lib.optionals stdenv.isLinux [ e2fsprogs ]
|
|
|
|
++ lib.optionals stdenv.isDarwin [ gcc ];
|
2018-10-26 16:42:09 +01:00
|
|
|
|
2020-11-01 13:32:31 +00:00
|
|
|
postPatch = ''
|
|
|
|
sed -i "117s|append(|insert(0, |" Tests/benchmark_diff.py
|
|
|
|
'';
|
2018-10-26 16:42:09 +01:00
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
cd Source
|
|
|
|
${python.interpreter} setup.py backport
|
|
|
|
${python.interpreter} setup.py configure \
|
2020-11-01 13:32:31 +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
|
|
|
|
'' + (lib.optionalString (stdenv.isDarwin && !isPy3k) ''
|
2018-10-26 16:42:09 +01:00
|
|
|
sed -i -e 's|libpython2.7.dylib|lib/libpython2.7.dylib|' Makefile
|
|
|
|
'');
|
|
|
|
|
2020-11-01 13:32:31 +00:00
|
|
|
checkInputs = [ glibcLocales ];
|
|
|
|
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
|
|
|
|
|
2020-12-30 20:37:18 +00:00
|
|
|
${python.interpreter} -c "import pysvn"
|
|
|
|
|
2020-11-01 13:32:31 +00:00
|
|
|
runHook postCheck
|
|
|
|
'';
|
|
|
|
|
2018-10-26 16:42:09 +01: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-11-01 13:32:31 +00:00
|
|
|
mv -v ../Docs $out/share/doc/pysvn-${version}
|
|
|
|
rm -v $out/share/doc/pysvn-${version}/generate_cpp_docs_from_html_docs.py
|
2018-10-26 16:42:09 +01:00
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2018-10-26 16:42:09 +01:00
|
|
|
description = "Python bindings for Subversion";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "http://pysvn.tigris.org/";
|
2018-10-26 16:42:09 +01:00
|
|
|
license = licenses.asl20;
|
2021-03-03 00:56:40 +00:00
|
|
|
# g++: command not found
|
|
|
|
broken = stdenv.isDarwin;
|
2018-10-26 16:42:09 +01:00
|
|
|
};
|
|
|
|
}
|