Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ 2 stdenv, 3 lib, 4 buildPythonPackage, 5 pythonAtLeast, 6 fetchurl, 7 isPy3k, 8 python, 9 apr, 10 aprutil, 11 bash, 12 e2fsprogs, 13 expat, 14 gcc, 15 neon, 16 glibcLocales, 17 openssl, 18 pycxx, 19 subversion, 20}: 21 22buildPythonPackage rec { 23 pname = "pysvn"; 24 version = "1.9.22"; 25 format = "other"; 26 27 src = fetchurl { 28 url = "mirror://sourceforge/project/pysvn/pysvn/V${version}/pysvn-${version}.tar.gz"; 29 hash = "sha256-KfLg9tuuKpXxJoniD002kDXGCTwOZ9jurCoPrWMRo7g="; 30 }; 31 32 patches = [ ./replace-python-first.patch ]; 33 34 buildInputs = [ 35 bash 36 subversion 37 apr 38 aprutil 39 expat 40 neon 41 openssl 42 ] ++ lib.optionals stdenv.isLinux [ e2fsprogs ] ++ lib.optionals stdenv.isDarwin [ gcc ]; 43 44 preConfigure = '' 45 cd Source 46 ${python.pythonOnBuildForHost.interpreter} setup.py backport 47 ${python.pythonOnBuildForHost.interpreter} setup.py configure \ 48 --apr-inc-dir=${apr.dev}/include \ 49 --apu-inc-dir=${aprutil.dev}/include \ 50 --pycxx-dir=${pycxx.dev}/include \ 51 --svn-inc-dir=${subversion.dev}/include/subversion-1 \ 52 --pycxx-src-dir=${pycxx.dev}/src \ 53 --apr-lib-dir=${apr.out}/lib \ 54 --svn-lib-dir=${subversion.out}/lib \ 55 --svn-bin-dir=${subversion.out}/bin 56 ''; 57 58 nativeCheckInputs = [ glibcLocales ]; 59 60 checkPhase = '' 61 runHook preCheck 62 63 # It is not only shebangs, some tests also write scripts dynamically 64 # so it is easier to simply search and replace 65 sed -i "s|/bin/bash|${lib.getExe bash}|" ../Tests/test-*.sh 66 make -C ../Tests 67 68 runHook postCheck 69 ''; 70 71 pythonImportsCheck = [ "pysvn" ]; 72 73 installPhase = '' 74 dest=$(toPythonPath $out)/pysvn 75 mkdir -p $dest 76 cp pysvn/__init__.py $dest/ 77 cp pysvn/_pysvn*.so $dest/ 78 mkdir -p $out/share/doc 79 mv -v ../Docs $out/share/doc/pysvn-${version} 80 rm -v $out/share/doc/pysvn-${version}/generate_cpp_docs_from_html_docs.py 81 ''; 82 83 meta = with lib; { 84 description = "Python bindings for Subversion"; 85 homepage = "https://pysvn.sourceforge.io/"; 86 license = licenses.asl20; 87 maintainers = with maintainers; [ dotlambda ]; 88 # g++: command not found 89 broken = stdenv.isDarwin; 90 }; 91}