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