##// 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 # Nix environment for the community edition
1 # Nix environment for the community edition
2 #
2 #
3 # This shall be as lean as possible, just producing the rhodecode-vcsserver
3 # This shall be as lean as possible, just producing the rhodecode-vcsserver
4 # derivation. For advanced tweaks to pimp up the development environment we use
4 # derivation. For advanced tweaks to pimp up the development environment we use
5 # "shell.nix" so that it does not have to clutter this file.
5 # "shell.nix" so that it does not have to clutter this file.
6
6
7 { pkgs ? (import <nixpkgs> {})
7 { pkgs ? (import <nixpkgs> {})
8 , pythonPackages ? "python27Packages"
8 , pythonPackages ? "python27Packages"
9 , pythonExternalOverrides ? self: super: {}
9 , pythonExternalOverrides ? self: super: {}
10 , doCheck ? true
10 , doCheck ? true
11 }:
11 }:
12
12
13 let pkgs_ = pkgs; in
13 let pkgs_ = pkgs; in
14
14
15 let
15 let
16 pkgs = pkgs_.overridePackages (self: super: {
16 pkgs = pkgs_.overridePackages (self: super: {
17 # Override subversion derivation to
17 # Override subversion derivation to
18 # - activate python bindings
18 # - activate python bindings
19 subversion = super.subversion.override {
19 subversion = let
20 httpSupport = true;
20 subversionWithPython = super.subversion.override {
21 pythonBindings = true;
21 httpSupport = true;
22 python = self.python27Packages.python;
22 pythonBindings = true;
23 };
23 python = self.python27Packages.python;
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 inherit (pkgs.lib) fix extends;
34 inherit (pkgs.lib) fix extends;
27
35
28 basePythonPackages = with builtins; if isAttrs pythonPackages
36 basePythonPackages = with builtins; if isAttrs pythonPackages
29 then pythonPackages
37 then pythonPackages
30 else getAttr pythonPackages pkgs;
38 else getAttr pythonPackages pkgs;
31
39
32 elem = builtins.elem;
40 elem = builtins.elem;
33 basename = path: with pkgs.lib; last (splitString "/" path);
41 basename = path: with pkgs.lib; last (splitString "/" path);
34 startsWith = prefix: full: let
42 startsWith = prefix: full: let
35 actualPrefix = builtins.substring 0 (builtins.stringLength prefix) full;
43 actualPrefix = builtins.substring 0 (builtins.stringLength prefix) full;
36 in actualPrefix == prefix;
44 in actualPrefix == prefix;
37
45
38 src-filter = path: type: with pkgs.lib;
46 src-filter = path: type: with pkgs.lib;
39 let
47 let
40 ext = last (splitString "." path);
48 ext = last (splitString "." path);
41 in
49 in
42 !elem (basename path) [
50 !elem (basename path) [
43 ".git" ".hg" "__pycache__" ".eggs" "node_modules"
51 ".git" ".hg" "__pycache__" ".eggs" "node_modules"
44 "build" "data" "tmp"] &&
52 "build" "data" "tmp"] &&
45 !elem ext ["egg-info" "pyc"] &&
53 !elem ext ["egg-info" "pyc"] &&
46 !startsWith "result" path;
54 !startsWith "result" path;
47
55
48 rhodecode-vcsserver-src = builtins.filterSource src-filter ./.;
56 rhodecode-vcsserver-src = builtins.filterSource src-filter ./.;
49
57
50 pythonGeneratedPackages = self: basePythonPackages.override (a: {
58 pythonGeneratedPackages = self: basePythonPackages.override (a: {
51 inherit self;
59 inherit self;
52 })
60 })
53 // (scopedImport {
61 // (scopedImport {
54 self = self;
62 self = self;
55 super = basePythonPackages;
63 super = basePythonPackages;
56 inherit pkgs;
64 inherit pkgs;
57 inherit (pkgs) fetchurl fetchgit;
65 inherit (pkgs) fetchurl fetchgit;
58 } ./pkgs/python-packages.nix);
66 } ./pkgs/python-packages.nix);
59
67
60 pythonOverrides = import ./pkgs/python-packages-overrides.nix {
68 pythonOverrides = import ./pkgs/python-packages-overrides.nix {
61 inherit
69 inherit
62 basePythonPackages
70 basePythonPackages
63 pkgs;
71 pkgs;
64 };
72 };
65
73
66 version = builtins.readFile ./vcsserver/VERSION;
74 version = builtins.readFile ./vcsserver/VERSION;
67
75
68 pythonLocalOverrides = self: super: {
76 pythonLocalOverrides = self: super: {
69 rhodecode-vcsserver = super.rhodecode-vcsserver.override (attrs: {
77 rhodecode-vcsserver = super.rhodecode-vcsserver.override (attrs: {
70 inherit
78 inherit
71 doCheck
79 doCheck
72 version;
80 version;
73 name = "rhodecode-vcsserver-${version}";
81 name = "rhodecode-vcsserver-${version}";
74 releaseName = "RhodeCodeVCSServer-${version}";
82 releaseName = "RhodeCodeVCSServer-${version}";
75 src = rhodecode-vcsserver-src;
83 src = rhodecode-vcsserver-src;
76
84
77 propagatedBuildInputs = attrs.propagatedBuildInputs ++ ([
85 propagatedBuildInputs = attrs.propagatedBuildInputs ++ ([
78 pkgs.git
86 pkgs.git
79 pkgs.subversion
87 pkgs.subversion
80 ]);
88 ]);
81
89
82 # TODO: johbo: Make a nicer way to expose the parts. Maybe
90 # TODO: johbo: Make a nicer way to expose the parts. Maybe
83 # pkgs/default.nix?
91 # pkgs/default.nix?
84 passthru = {
92 passthru = {
85 pythonPackages = self;
93 pythonPackages = self;
86 };
94 };
87
95
88 # Somewhat snappier setup of the development environment
96 # Somewhat snappier setup of the development environment
89 # TODO: move into shell.nix
97 # TODO: move into shell.nix
90 # TODO: think of supporting a stable path again, so that multiple shells
98 # TODO: think of supporting a stable path again, so that multiple shells
91 # can share it.
99 # can share it.
92 shellHook = ''
100 shellHook = ''
93 # Set locale
101 # Set locale
94 export LC_ALL="en_US.UTF-8"
102 export LC_ALL="en_US.UTF-8"
95
103
96 tmp_path=$(mktemp -d)
104 tmp_path=$(mktemp -d)
97 export PATH="$tmp_path/bin:$PATH"
105 export PATH="$tmp_path/bin:$PATH"
98 export PYTHONPATH="$tmp_path/${self.python.sitePackages}:$PYTHONPATH"
106 export PYTHONPATH="$tmp_path/${self.python.sitePackages}:$PYTHONPATH"
99 mkdir -p $tmp_path/${self.python.sitePackages}
107 mkdir -p $tmp_path/${self.python.sitePackages}
100 python setup.py develop --prefix $tmp_path --allow-hosts ""
108 python setup.py develop --prefix $tmp_path --allow-hosts ""
101 '';
109 '';
102
110
103 # Add VCSServer bin directory to path so that tests can find 'vcsserver'.
111 # Add VCSServer bin directory to path so that tests can find 'vcsserver'.
104 preCheck = ''
112 preCheck = ''
105 export PATH="$out/bin:$PATH"
113 export PATH="$out/bin:$PATH"
106 '';
114 '';
107
115
108 postInstall = ''
116 postInstall = ''
109 echo "Writing meta information for rccontrol to nix-support/rccontrol"
117 echo "Writing meta information for rccontrol to nix-support/rccontrol"
110 mkdir -p $out/nix-support/rccontrol
118 mkdir -p $out/nix-support/rccontrol
111 cp -v vcsserver/VERSION $out/nix-support/rccontrol/version
119 cp -v vcsserver/VERSION $out/nix-support/rccontrol/version
112 echo "DONE: Meta information for rccontrol written"
120 echo "DONE: Meta information for rccontrol written"
113
121
114 ln -s ${self.pyramid}/bin/* $out/bin #*/
122 ln -s ${self.pyramid}/bin/* $out/bin #*/
115 ln -s ${self.gunicorn}/bin/gunicorn $out/bin/
123 ln -s ${self.gunicorn}/bin/gunicorn $out/bin/
116
124
117 # Symlink version control utilities
125 # Symlink version control utilities
118 #
126 #
119 # We ensure that always the correct version is available as a symlink.
127 # We ensure that always the correct version is available as a symlink.
120 # So that users calling them via the profile path will always use the
128 # So that users calling them via the profile path will always use the
121 # correct version.
129 # correct version.
122 ln -s ${pkgs.git}/bin/git $out/bin
130 ln -s ${pkgs.git}/bin/git $out/bin
123 ln -s ${self.mercurial}/bin/hg $out/bin
131 ln -s ${self.mercurial}/bin/hg $out/bin
124 ln -s ${pkgs.subversion}/bin/svn* $out/bin
132 ln -s ${pkgs.subversion}/bin/svn* $out/bin
125
133
126 for file in $out/bin/*; do #*/
134 for file in $out/bin/*; do #*/
127 wrapProgram $file \
135 wrapProgram $file \
128 --prefix PYTHONPATH : $PYTHONPATH \
136 --prefix PYTHONPATH : $PYTHONPATH \
129 --set PYTHONHASHSEED random
137 --set PYTHONHASHSEED random
130 done
138 done
131 '';
139 '';
132
140
133 });
141 });
134 };
142 };
135
143
136 # Apply all overrides and fix the final package set
144 # Apply all overrides and fix the final package set
137 myPythonPackages =
145 myPythonPackages =
138 (fix
146 (fix
139 (extends pythonExternalOverrides
147 (extends pythonExternalOverrides
140 (extends pythonLocalOverrides
148 (extends pythonLocalOverrides
141 (extends pythonOverrides
149 (extends pythonOverrides
142 pythonGeneratedPackages))));
150 pythonGeneratedPackages))));
143
151
144 in myPythonPackages.rhodecode-vcsserver
152 in myPythonPackages.rhodecode-vcsserver
General Comments 0
You need to be logged in to leave comments. Login now