subversion: Use callPackages

+86 -76
+67 -64
pkgs/applications/version-management/subversion/default.nix
··· 8 8 , stdenv, fetchurl, apr, aprutil, zlib, sqlite 9 9 , apacheHttpd ? null, expat, swig ? null, jdk ? null, python ? null, perl ? null 10 10 , sasl ? null, serf ? null 11 - , branch ? "1.9" 12 11 }: 13 12 14 13 assert bdbSupport -> aprutil.bdbSupport; ··· 17 16 assert javahlBindings -> jdk != null && perl != null; 18 17 19 18 let 20 - config = { 21 - "1.9".ver_min = "2"; 22 - "1.9".sha1 = "fb9db3b7ddf48ae37aa8785872301b59bfcc7017"; 23 19 24 - "1.8".ver_min = "14"; 25 - "1.8".sha1 = "0698efc58373e7657f6dd3ce13cab7b002ffb497"; 26 - }; 27 - in 28 - assert builtins.hasAttr branch config; 20 + common = { version, sha1 }: stdenv.mkDerivation (rec { 21 + inherit version; 22 + name = "subversion-${version}"; 29 23 30 - stdenv.mkDerivation (rec { 24 + src = fetchurl { 25 + url = "mirror://apache/subversion/${name}.tar.bz2"; 26 + inherit sha1; 27 + }; 31 28 32 - version = "${branch}." + config.${branch}.ver_min; 29 + buildInputs = [ zlib apr aprutil sqlite ] 30 + ++ stdenv.lib.optional httpSupport serf 31 + ++ stdenv.lib.optional pythonBindings python 32 + ++ stdenv.lib.optional perlBindings perl 33 + ++ stdenv.lib.optional saslSupport sasl; 33 34 34 - name = "subversion-${version}"; 35 + configureFlags = '' 36 + ${if bdbSupport then "--with-berkeley-db" else "--without-berkeley-db"} 37 + ${if httpServer then "--with-apxs=${apacheHttpd}/bin/apxs" else "--without-apxs"} 38 + ${if pythonBindings || perlBindings then "--with-swig=${swig}" else "--without-swig"} 39 + ${if javahlBindings then "--enable-javahl --with-jdk=${jdk}" else ""} 40 + --disable-keychain 41 + ${if saslSupport then "--with-sasl=${sasl}" else "--without-sasl"} 42 + ${if httpSupport then "--with-serf=${serf}" else "--without-serf"} 43 + --with-zlib=${zlib} 44 + --with-sqlite=${sqlite} 45 + ''; 35 46 36 - src = fetchurl { 37 - url = "mirror://apache/subversion/${name}.tar.bz2"; 38 - inherit (config.${branch}) sha1; 39 - }; 47 + preBuild = '' 48 + makeFlagsArray=(APACHE_LIBEXECDIR=$out/modules) 49 + ''; 50 + 51 + postInstall = '' 52 + if test -n "$pythonBindings"; then 53 + make swig-py swig_pydir=$(toPythonPath $out)/libsvn swig_pydir_extra=$(toPythonPath $out)/svn 54 + make install-swig-py swig_pydir=$(toPythonPath $out)/libsvn swig_pydir_extra=$(toPythonPath $out)/svn 55 + fi 40 56 41 - buildInputs = [ zlib apr aprutil sqlite ] 42 - ++ stdenv.lib.optional httpSupport serf 43 - ++ stdenv.lib.optional pythonBindings python 44 - ++ stdenv.lib.optional perlBindings perl 45 - ++ stdenv.lib.optional saslSupport sasl; 57 + if test -n "$perlBindings"; then 58 + make swig-pl-lib 59 + make install-swig-pl-lib 60 + cd subversion/bindings/swig/perl/native 61 + perl Makefile.PL PREFIX=$out 62 + make install 63 + cd - 64 + fi 46 65 47 - configureFlags = '' 48 - ${if bdbSupport then "--with-berkeley-db" else "--without-berkeley-db"} 49 - ${if httpServer then "--with-apxs=${apacheHttpd}/bin/apxs" else "--without-apxs"} 50 - ${if pythonBindings || perlBindings then "--with-swig=${swig}" else "--without-swig"} 51 - ${if javahlBindings then "--enable-javahl --with-jdk=${jdk}" else ""} 52 - --disable-keychain 53 - ${if saslSupport then "--with-sasl=${sasl}" else "--without-sasl"} 54 - ${if httpSupport then "--with-serf=${serf}" else "--without-serf"} 55 - --with-zlib=${zlib} 56 - --with-sqlite=${sqlite} 57 - ''; 66 + mkdir -p $out/share/bash-completion/completions 67 + cp tools/client-side/bash_completion $out/share/bash-completion/completions/subversion 68 + ''; 58 69 59 - preBuild = '' 60 - makeFlagsArray=(APACHE_LIBEXECDIR=$out/modules) 61 - ''; 70 + inherit perlBindings pythonBindings; 62 71 63 - postInstall = '' 64 - if test -n "$pythonBindings"; then 65 - make swig-py swig_pydir=$(toPythonPath $out)/libsvn swig_pydir_extra=$(toPythonPath $out)/svn 66 - make install-swig-py swig_pydir=$(toPythonPath $out)/libsvn swig_pydir_extra=$(toPythonPath $out)/svn 67 - fi 72 + enableParallelBuilding = true; 68 73 69 - if test -n "$perlBindings"; then 70 - make swig-pl-lib 71 - make install-swig-pl-lib 72 - cd subversion/bindings/swig/perl/native 73 - perl Makefile.PL PREFIX=$out 74 - make install 75 - cd - 76 - fi 74 + meta = { 75 + description = "A version control system intended to be a compelling replacement for CVS in the open source community"; 76 + homepage = http://subversion.apache.org/; 77 + maintainers = with stdenv.lib.maintainers; [ eelco lovek323 ]; 78 + hydraPlatforms = stdenv.lib.platforms.linux ++ stdenv.lib.platforms.darwin; 79 + }; 77 80 78 - mkdir -p $out/share/bash-completion/completions 79 - cp tools/client-side/bash_completion $out/share/bash-completion/completions/subversion 80 - ''; 81 + } // stdenv.lib.optionalAttrs stdenv.isDarwin { 82 + CXX = "clang++"; 83 + CC = "clang"; 84 + CPP = "clang -E"; 85 + CXXCPP = "clang++ -E"; 86 + }); 81 87 82 - inherit perlBindings pythonBindings; 88 + in { 83 89 84 - enableParallelBuilding = true; 90 + subversion18 = common { 91 + version = "1.8.14"; 92 + sha1 = "0698efc58373e7657f6dd3ce13cab7b002ffb497"; 93 + }; 85 94 86 - meta = { 87 - description = "A version control system intended to be a compelling replacement for CVS in the open source community"; 88 - homepage = http://subversion.apache.org/; 89 - maintainers = with stdenv.lib.maintainers; [ eelco lovek323 ]; 90 - hydraPlatforms = stdenv.lib.platforms.linux ++ stdenv.lib.platforms.darwin; 95 + subversion19 = common { 96 + version = "1.9.2"; 97 + sha1 = "fb9db3b7ddf48ae37aa8785872301b59bfcc7017"; 91 98 }; 92 - } // stdenv.lib.optionalAttrs stdenv.isDarwin { 93 - CXX = "clang++"; 94 - CC = "clang"; 95 - CPP = "clang -E"; 96 - CXXCPP = "clang++ -E"; 97 - }) 99 + 100 + }
+19 -12
pkgs/top-level/all-packages.nix
··· 13217 13217 13218 13218 sublime3 = lowPrio (callPackage ../applications/editors/sublime3 { }); 13219 13219 13220 - subversion = callPackage ../applications/version-management/subversion/default.nix { 13221 - bdbSupport = true; 13222 - httpServer = false; 13223 - httpSupport = true; 13224 - pythonBindings = false; 13225 - perlBindings = false; 13226 - javahlBindings = false; 13227 - saslSupport = false; 13228 - sasl = cyrus_sasl; 13229 - }; 13220 + inherit (callPackages ../applications/version-management/subversion/default.nix { 13221 + bdbSupport = true; 13222 + httpServer = false; 13223 + httpSupport = true; 13224 + pythonBindings = false; 13225 + perlBindings = false; 13226 + javahlBindings = false; 13227 + saslSupport = false; 13228 + sasl = cyrus_sasl; 13229 + }) 13230 + subversion18 subversion19; 13231 + 13232 + subversion = pkgs.subversion19; 13230 13233 13231 - subversionClient = appendToName "client" (subversion.override { 13234 + subversionClient = appendToName "client" (pkgs.subversion.override { 13232 13235 bdbSupport = false; 13233 13236 perlBindings = true; 13234 13237 pythonBindings = true; ··· 14527 14530 libcanberra = libcanberra_kde; 14528 14531 boost = boost155; 14529 14532 kdelibs = kdeApps_15_08.kdelibs; 14530 - subversionClient = subversionClient.override { branch = "1.8"; }; 14533 + subversionClient = pkgs.subversion18.override { 14534 + bdbSupport = false; 14535 + perlBindings = true; 14536 + pythonBindings = true; 14537 + }; 14531 14538 } 14532 14539 ../desktops/kde-4.14; 14533 14540