##// END OF EJS Templates
Nix: Patch subversion on Darwin...
johbo -
r74:96540e0a default
parent child Browse files
Show More
@@ -0,0 +1,63 b''
1 diff -rup subversion-1.9.4-orig/subversion/include/svn_auth.h subversion-1.9.4/subversion/include/svn_auth.h
2 --- subversion-1.9.4-orig/subversion/include/svn_auth.h 2015-02-13 12:17:40.000000000 +0100
3 +++ subversion-1.9.4/subversion/include/svn_auth.h 2016-09-21 12:55:27.000000000 +0200
4 @@ -943,7 +943,7 @@ svn_auth_get_windows_ssl_server_trust_pr
5
6 #endif /* WIN32 && !__MINGW32__ || DOXYGEN */
7
8 -#if defined(DARWIN) || defined(DOXYGEN)
9 +#if defined(SVN_HAVE_KEYCHAIN_SERVICES) || defined(DOXYGEN)
10 /**
11 * Set @a *provider to an authentication provider of type @c
12 * svn_auth_cred_simple_t that gets/sets information from the user's
13 @@ -984,7 +984,7 @@ void
14 svn_auth_get_keychain_ssl_client_cert_pw_provider(
15 svn_auth_provider_object_t **provider,
16 apr_pool_t *pool);
17 -#endif /* DARWIN || DOXYGEN */
18 +#endif /* SVN_HAVE_KEYCHAIN_SERVICES || DOXYGEN */
19
20 /* Note that the gnome keyring unlock prompt related items below must be
21 * declared for all platforms in order to allow SWIG interfaces to be
22 diff -rup subversion-1.9.4-orig/subversion/libsvn_subr/auth.h subversion-1.9.4/subversion/libsvn_subr/auth.h
23 --- subversion-1.9.4-orig/subversion/libsvn_subr/auth.h 2015-08-27 06:00:31.000000000 +0200
24 +++ subversion-1.9.4/subversion/libsvn_subr/auth.h 2016-09-21 12:56:20.000000000 +0200
25 @@ -103,7 +103,7 @@ svn_auth__get_windows_ssl_server_trust_p
26 apr_pool_t *pool);
27 #endif /* WIN32 && !__MINGW32__ || DOXYGEN */
28
29 -#if defined(DARWIN) || defined(DOXYGEN)
30 +#if defined(SVN_HAVE_KEYCHAIN_SERVICES) || defined(DOXYGEN)
31 /**
32 * Set @a *provider to an authentication provider of type @c
33 * svn_auth_cred_simple_t that gets/sets information from the user's
34 @@ -134,7 +134,7 @@ void
35 svn_auth__get_keychain_ssl_client_cert_pw_provider(
36 svn_auth_provider_object_t **provider,
37 apr_pool_t *pool);
38 -#endif /* DARWIN || DOXYGEN */
39 +#endif /* SVN_HAVE_KEYCHAIN_SERVICES || DOXYGEN */
40
41 #if !defined(WIN32) || defined(DOXYGEN)
42 /**
43 diff -rup subversion-1.9.4-orig/subversion/libsvn_subr/deprecated.c subversion-1.9.4/subversion/libsvn_subr/deprecated.c
44 --- subversion-1.9.4-orig/subversion/libsvn_subr/deprecated.c 2015-08-27 06:00:31.000000000 +0200
45 +++ subversion-1.9.4/subversion/libsvn_subr/deprecated.c 2016-09-21 12:57:08.000000000 +0200
46 @@ -1479,7 +1479,7 @@ svn_auth_get_windows_ssl_server_trust_pr
47 #endif /* WIN32 && !__MINGW32__ */
48
49 /*** From macos_keychain.c ***/
50 -#if defined(DARWIN)
51 +#if defined(SVN_HAVE_KEYCHAIN_SERVICES)
52 void
53 svn_auth_get_keychain_simple_provider(svn_auth_provider_object_t **provider,
54 apr_pool_t *pool)
55 @@ -1494,7 +1494,7 @@ svn_auth_get_keychain_ssl_client_cert_pw
56 {
57 svn_auth__get_keychain_ssl_client_cert_pw_provider(provider, pool);
58 }
59 -#endif /* DARWIN */
60 +#endif /* SVN_HAVE_KEYCHAIN_SERVICES */
61
62 #if !defined(WIN32)
63 void
@@ -1,144 +1,152 b''
1 1 # Nix environment for the community edition
2 2 #
3 3 # This shall be as lean as possible, just producing the rhodecode-vcsserver
4 4 # derivation. For advanced tweaks to pimp up the development environment we use
5 5 # "shell.nix" so that it does not have to clutter this file.
6 6
7 7 { pkgs ? (import <nixpkgs> {})
8 8 , pythonPackages ? "python27Packages"
9 9 , pythonExternalOverrides ? self: super: {}
10 10 , doCheck ? true
11 11 }:
12 12
13 13 let pkgs_ = pkgs; in
14 14
15 15 let
16 16 pkgs = pkgs_.overridePackages (self: super: {
17 17 # Override subversion derivation to
18 18 # - activate python bindings
19 subversion = super.subversion.override {
19 subversion = let
20 subversionWithPython = super.subversion.override {
20 21 httpSupport = true;
21 22 pythonBindings = true;
22 23 python = self.python27Packages.python;
23 24 };
25 in pkgs.lib.overrideDerivation subversionWithPython (oldAttrs: {
26 patches = oldAttrs.patches ++
27 pkgs.lib.optionals pkgs.stdenv.isDarwin [
28 # johbo: "import svn.client" fails on darwin currently.
29 ./pkgs/subversion-1.9.4-darwin.patch
30 ];
31 });
24 32 });
25 33
26 34 inherit (pkgs.lib) fix extends;
27 35
28 36 basePythonPackages = with builtins; if isAttrs pythonPackages
29 37 then pythonPackages
30 38 else getAttr pythonPackages pkgs;
31 39
32 40 elem = builtins.elem;
33 41 basename = path: with pkgs.lib; last (splitString "/" path);
34 42 startsWith = prefix: full: let
35 43 actualPrefix = builtins.substring 0 (builtins.stringLength prefix) full;
36 44 in actualPrefix == prefix;
37 45
38 46 src-filter = path: type: with pkgs.lib;
39 47 let
40 48 ext = last (splitString "." path);
41 49 in
42 50 !elem (basename path) [
43 51 ".git" ".hg" "__pycache__" ".eggs" "node_modules"
44 52 "build" "data" "tmp"] &&
45 53 !elem ext ["egg-info" "pyc"] &&
46 54 !startsWith "result" path;
47 55
48 56 rhodecode-vcsserver-src = builtins.filterSource src-filter ./.;
49 57
50 58 pythonGeneratedPackages = self: basePythonPackages.override (a: {
51 59 inherit self;
52 60 })
53 61 // (scopedImport {
54 62 self = self;
55 63 super = basePythonPackages;
56 64 inherit pkgs;
57 65 inherit (pkgs) fetchurl fetchgit;
58 66 } ./pkgs/python-packages.nix);
59 67
60 68 pythonOverrides = import ./pkgs/python-packages-overrides.nix {
61 69 inherit
62 70 basePythonPackages
63 71 pkgs;
64 72 };
65 73
66 74 version = builtins.readFile ./vcsserver/VERSION;
67 75
68 76 pythonLocalOverrides = self: super: {
69 77 rhodecode-vcsserver = super.rhodecode-vcsserver.override (attrs: {
70 78 inherit
71 79 doCheck
72 80 version;
73 81 name = "rhodecode-vcsserver-${version}";
74 82 releaseName = "RhodeCodeVCSServer-${version}";
75 83 src = rhodecode-vcsserver-src;
76 84
77 85 propagatedBuildInputs = attrs.propagatedBuildInputs ++ ([
78 86 pkgs.git
79 87 pkgs.subversion
80 88 ]);
81 89
82 90 # TODO: johbo: Make a nicer way to expose the parts. Maybe
83 91 # pkgs/default.nix?
84 92 passthru = {
85 93 pythonPackages = self;
86 94 };
87 95
88 96 # Somewhat snappier setup of the development environment
89 97 # TODO: move into shell.nix
90 98 # TODO: think of supporting a stable path again, so that multiple shells
91 99 # can share it.
92 100 shellHook = ''
93 101 # Set locale
94 102 export LC_ALL="en_US.UTF-8"
95 103
96 104 tmp_path=$(mktemp -d)
97 105 export PATH="$tmp_path/bin:$PATH"
98 106 export PYTHONPATH="$tmp_path/${self.python.sitePackages}:$PYTHONPATH"
99 107 mkdir -p $tmp_path/${self.python.sitePackages}
100 108 python setup.py develop --prefix $tmp_path --allow-hosts ""
101 109 '';
102 110
103 111 # Add VCSServer bin directory to path so that tests can find 'vcsserver'.
104 112 preCheck = ''
105 113 export PATH="$out/bin:$PATH"
106 114 '';
107 115
108 116 postInstall = ''
109 117 echo "Writing meta information for rccontrol to nix-support/rccontrol"
110 118 mkdir -p $out/nix-support/rccontrol
111 119 cp -v vcsserver/VERSION $out/nix-support/rccontrol/version
112 120 echo "DONE: Meta information for rccontrol written"
113 121
114 122 ln -s ${self.pyramid}/bin/* $out/bin #*/
115 123 ln -s ${self.gunicorn}/bin/gunicorn $out/bin/
116 124
117 125 # Symlink version control utilities
118 126 #
119 127 # We ensure that always the correct version is available as a symlink.
120 128 # So that users calling them via the profile path will always use the
121 129 # correct version.
122 130 ln -s ${pkgs.git}/bin/git $out/bin
123 131 ln -s ${self.mercurial}/bin/hg $out/bin
124 132 ln -s ${pkgs.subversion}/bin/svn* $out/bin
125 133
126 134 for file in $out/bin/*; do #*/
127 135 wrapProgram $file \
128 136 --prefix PYTHONPATH : $PYTHONPATH \
129 137 --set PYTHONHASHSEED random
130 138 done
131 139 '';
132 140
133 141 });
134 142 };
135 143
136 144 # Apply all overrides and fix the final package set
137 145 myPythonPackages =
138 146 (fix
139 147 (extends pythonExternalOverrides
140 148 (extends pythonLocalOverrides
141 149 (extends pythonOverrides
142 150 pythonGeneratedPackages))));
143 151
144 152 in myPythonPackages.rhodecode-vcsserver
General Comments 0
You need to be logged in to leave comments. Login now