Show More
@@ -1,219 +1,226 b'' | |||
|
1 | 1 | # Nix environment for the community edition |
|
2 | 2 | # |
|
3 | 3 | # This shall be as lean as possible, just producing the Enterprise |
|
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 | 19 | # - set version to 1.8 |
|
20 | 20 | subversion = super.subversion18.override { |
|
21 | 21 | httpSupport = true; |
|
22 | 22 | pythonBindings = true; |
|
23 | 23 | python = self.python27Packages.python; |
|
24 | 24 | }; |
|
25 | 25 | }); |
|
26 | 26 | |
|
27 | 27 | inherit (pkgs.lib) fix extends; |
|
28 | 28 | |
|
29 | 29 | basePythonPackages = with builtins; if isAttrs pythonPackages |
|
30 | 30 | then pythonPackages |
|
31 | 31 | else getAttr pythonPackages pkgs; |
|
32 | 32 | |
|
33 | 33 | elem = builtins.elem; |
|
34 | 34 | basename = path: with pkgs.lib; last (splitString "/" path); |
|
35 | 35 | startsWith = prefix: full: let |
|
36 | 36 | actualPrefix = builtins.substring 0 (builtins.stringLength prefix) full; |
|
37 | 37 | in actualPrefix == prefix; |
|
38 | 38 | |
|
39 | 39 | src-filter = path: type: with pkgs.lib; |
|
40 | 40 | let |
|
41 | 41 | ext = last (splitString "." path); |
|
42 | 42 | in |
|
43 | 43 | !elem (basename path) [ |
|
44 | 44 | ".git" ".hg" "__pycache__" ".eggs" "node_modules" |
|
45 | 45 | "build" "data" "tmp"] && |
|
46 | 46 | !elem ext ["egg-info" "pyc"] && |
|
47 | 47 | !startsWith "result" path; |
|
48 | 48 | |
|
49 | 49 | sources = pkgs.config.rc.sources or {}; |
|
50 | 50 | rhodecode-enterprise-ce-src = builtins.filterSource src-filter ./.; |
|
51 | 51 | |
|
52 | 52 | nodeEnv = import ./pkgs/node-default.nix { |
|
53 | 53 | inherit pkgs; |
|
54 | 54 | }; |
|
55 | 55 | nodeDependencies = nodeEnv.shell.nodeDependencies; |
|
56 | 56 | |
|
57 | bowerComponents = pkgs.buildBowerComponents { | |
|
58 | name = "enterprise-ce-bower-components"; | |
|
59 | generated = ./pkgs/bower-packages.nix; | |
|
60 | src = rhodecode-enterprise-ce-src; | |
|
61 | }; | |
|
62 | ||
|
57 | 63 | pythonGeneratedPackages = self: basePythonPackages.override (a: { |
|
58 | 64 | inherit self; |
|
59 | 65 | }) |
|
60 | 66 | // (scopedImport { |
|
61 | 67 | self = self; |
|
62 | 68 | super = basePythonPackages; |
|
63 | 69 | inherit pkgs; |
|
64 | 70 | inherit (pkgs) fetchurl fetchgit; |
|
65 | 71 | } ./pkgs/python-packages.nix); |
|
66 | 72 | |
|
67 | 73 | pythonOverrides = import ./pkgs/python-packages-overrides.nix { |
|
68 | 74 | inherit |
|
69 | 75 | basePythonPackages |
|
70 | 76 | pkgs; |
|
71 | 77 | }; |
|
72 | 78 | |
|
73 | 79 | pythonLocalOverrides = self: super: { |
|
74 | 80 | rhodecode-enterprise-ce = |
|
75 | 81 | let |
|
76 | 82 | version = builtins.readFile ./rhodecode/VERSION; |
|
77 | 83 | linkNodeModules = '' |
|
78 | 84 | echo "Link node packages" |
|
79 | 85 | rm -fr node_modules |
|
80 | 86 | mkdir node_modules |
|
81 | 87 | |
|
82 | 88 | # johbo: Linking individual packages allows us to run "npm install" |
|
83 | 89 | # inside of a shell to try things out. Re-entering the shell will |
|
84 | 90 | # restore a clean environment. |
|
85 | 91 | ln -s ${nodeDependencies}/lib/node_modules/* node_modules/ |
|
86 | 92 | |
|
87 | 93 | echo "DONE: Link node packages" |
|
88 | 94 | ''; |
|
89 | 95 | in super.rhodecode-enterprise-ce.override (attrs: { |
|
90 | 96 | |
|
91 | 97 | inherit |
|
92 | 98 | doCheck |
|
93 | 99 | version; |
|
94 | 100 | name = "rhodecode-enterprise-ce-${version}"; |
|
95 | 101 | releaseName = "RhodeCodeEnterpriseCE-${version}"; |
|
96 | 102 | src = rhodecode-enterprise-ce-src; |
|
97 | 103 | |
|
98 | 104 | buildInputs = |
|
99 | 105 | attrs.buildInputs ++ |
|
100 | 106 | (with self; [ |
|
101 | 107 | pkgs.nodePackages.bower |
|
102 | 108 | pkgs.nodePackages.grunt-cli |
|
103 | 109 | pkgs.subversion |
|
104 | 110 | pytest-catchlog |
|
105 | 111 | rhodecode-testdata |
|
106 | 112 | ]); |
|
107 | 113 | |
|
108 | 114 | propagatedBuildInputs = attrs.propagatedBuildInputs ++ (with self; [ |
|
109 | 115 | rhodecode-tools |
|
110 | 116 | ]); |
|
111 | 117 | |
|
112 | 118 | # TODO: johbo: Make a nicer way to expose the parts. Maybe |
|
113 | 119 | # pkgs/default.nix? |
|
114 | 120 | passthru = { |
|
115 | 121 | inherit |
|
122 | bowerComponents | |
|
116 | 123 | linkNodeModules |
|
117 | 124 | myPythonPackagesUnfix |
|
118 | 125 | pythonLocalOverrides; |
|
119 | 126 | pythonPackages = self; |
|
120 | 127 | }; |
|
121 | 128 | |
|
122 | 129 | LC_ALL = "en_US.UTF-8"; |
|
123 | 130 | LOCALE_ARCHIVE = |
|
124 | 131 | if pkgs.stdenv ? glibc |
|
125 | 132 | then "${pkgs.glibcLocales}/lib/locale/locale-archive" |
|
126 | 133 | else ""; |
|
127 | 134 | |
|
128 | 135 | # Somewhat snappier setup of the development environment |
|
129 | 136 | # TODO: move into shell.nix |
|
130 | 137 | # TODO: think of supporting a stable path again, so that multiple shells |
|
131 | 138 | # can share it. |
|
132 | 139 | shellHook = '' |
|
133 | 140 | tmp_path=$(mktemp -d) |
|
134 | 141 | export PATH="$tmp_path/bin:$PATH" |
|
135 | 142 | export PYTHONPATH="$tmp_path/${self.python.sitePackages}:$PYTHONPATH" |
|
136 | 143 | mkdir -p $tmp_path/${self.python.sitePackages} |
|
137 | 144 | python setup.py develop --prefix $tmp_path --allow-hosts "" |
|
138 | 145 | '' + linkNodeModules; |
|
139 | 146 | |
|
140 | 147 | preCheck = '' |
|
141 | 148 | export PATH="$out/bin:$PATH" |
|
142 | 149 | ''; |
|
143 | 150 | |
|
144 | 151 | postCheck = '' |
|
145 | 152 | rm -rf $out/lib/${self.python.libPrefix}/site-packages/pytest_pylons |
|
146 | 153 | rm -rf $out/lib/${self.python.libPrefix}/site-packages/rhodecode/tests |
|
147 | 154 | ''; |
|
148 | 155 | |
|
149 | 156 | preBuild = linkNodeModules + '' |
|
150 | 157 | grunt |
|
151 | 158 | rm -fr node_modules |
|
152 | 159 | ''; |
|
153 | 160 | |
|
154 | 161 | postInstall = '' |
|
155 | 162 | # python based programs need to be wrapped |
|
156 | 163 | ln -s ${self.supervisor}/bin/supervisor* $out/bin/ |
|
157 | 164 | ln -s ${self.gunicorn}/bin/gunicorn $out/bin/ |
|
158 | 165 | ln -s ${self.PasteScript}/bin/paster $out/bin/ |
|
159 | 166 | ln -s ${self.channelstream}/bin/channelstream $out/bin/ |
|
160 | 167 | ln -s ${self.pyramid}/bin/* $out/bin/ #*/ |
|
161 | 168 | |
|
162 | 169 | # rhodecode-tools |
|
163 | 170 | # TODO: johbo: re-think this. Do the tools import anything from enterprise? |
|
164 | 171 | ln -s ${self.rhodecode-tools}/bin/rhodecode-* $out/bin/ |
|
165 | 172 | |
|
166 | 173 | # note that condition should be restricted when adding further tools |
|
167 | 174 | for file in $out/bin/*; do #*/ |
|
168 | 175 | wrapProgram $file \ |
|
169 | 176 | --prefix PYTHONPATH : $PYTHONPATH \ |
|
170 | 177 | --prefix PATH : $PATH \ |
|
171 | 178 | --set PYTHONHASHSEED random |
|
172 | 179 | done |
|
173 | 180 | |
|
174 | 181 | mkdir $out/etc |
|
175 | 182 | cp configs/production.ini $out/etc |
|
176 | 183 | |
|
177 | 184 | echo "Writing meta information for rccontrol to nix-support/rccontrol" |
|
178 | 185 | mkdir -p $out/nix-support/rccontrol |
|
179 | 186 | cp -v rhodecode/VERSION $out/nix-support/rccontrol/version |
|
180 | 187 | echo "DONE: Meta information for rccontrol written" |
|
181 | 188 | |
|
182 | 189 | # TODO: johbo: Make part of ac-tests |
|
183 | 190 | if [ ! -f rhodecode/public/js/scripts.js ]; then |
|
184 | 191 | echo "Missing scripts.js" |
|
185 | 192 | exit 1 |
|
186 | 193 | fi |
|
187 | 194 | if [ ! -f rhodecode/public/css/style.css ]; then |
|
188 | 195 | echo "Missing style.css" |
|
189 | 196 | exit 1 |
|
190 | 197 | fi |
|
191 | 198 | ''; |
|
192 | 199 | |
|
193 | 200 | }); |
|
194 | 201 | |
|
195 | 202 | rhodecode-testdata = import "${rhodecode-testdata-src}/default.nix" { |
|
196 | 203 | inherit |
|
197 | 204 | doCheck |
|
198 | 205 | pkgs |
|
199 | 206 | pythonPackages; |
|
200 | 207 | }; |
|
201 | 208 | |
|
202 | 209 | }; |
|
203 | 210 | |
|
204 | 211 | rhodecode-testdata-src = sources.rhodecode-testdata or ( |
|
205 | 212 | pkgs.fetchhg { |
|
206 | 213 | url = "https://code.rhodecode.com/upstream/rc_testdata"; |
|
207 | 214 | rev = "v0.8.0"; |
|
208 | 215 | sha256 = "0hy1ba134rq2f9si85yx7j4qhc9ky0hjzdk553s3q026i7km809m"; |
|
209 | 216 | }); |
|
210 | 217 | |
|
211 | 218 | # Apply all overrides and fix the final package set |
|
212 | 219 | myPythonPackagesUnfix = |
|
213 | 220 | (extends pythonExternalOverrides |
|
214 | 221 | (extends pythonLocalOverrides |
|
215 | 222 | (extends pythonOverrides |
|
216 | 223 | pythonGeneratedPackages))); |
|
217 | 224 | myPythonPackages = (fix myPythonPackagesUnfix); |
|
218 | 225 | |
|
219 | 226 | in myPythonPackages.rhodecode-enterprise-ce |
@@ -1,31 +1,31 b'' | |||
|
1 | 1 | { fetchbower, buildEnv }: |
|
2 | 2 | buildEnv { name = "bower-env"; ignoreCollisions = true; paths = [ |
|
3 | 3 | (fetchbower "webcomponentsjs" "0.7.22" "^0.7.22" "0ggh3k8ssafd056ib1m5bvzi7cpz3ry7gr5176d79na1w0c3i7dz") |
|
4 |
(fetchbower "polymer" "Polymer/polymer# |
|
|
5 |
(fetchbower "paper-button" "PolymerElements/paper-button# |
|
|
6 |
(fetchbower "paper-spinner" "PolymerElements/paper-spinner# |
|
|
7 |
(fetchbower "paper-tooltip" "PolymerElements/paper-tooltip# |
|
|
8 |
(fetchbower "paper-toast" "PolymerElements/paper-toast# |
|
|
9 |
(fetchbower "paper-toggle-button" "PolymerElements/paper-toggle-button# |
|
|
10 |
(fetchbower "iron-ajax" "PolymerElements/iron-ajax# |
|
|
11 |
(fetchbower "iron-flex-layout" "PolymerElements/iron-flex-layout# |
|
|
12 |
(fetchbower "paper-behaviors" "PolymerElements/paper-behaviors# |
|
|
13 |
(fetchbower "paper-material" "PolymerElements/paper-material# |
|
|
14 |
(fetchbower "paper-styles" "PolymerElements/paper-styles# |
|
|
15 |
(fetchbower "neon-animation" "PolymerElements/neon-animation# |
|
|
16 |
(fetchbower "iron-a11y-announcer" "PolymerElements/iron-a11y-announcer# |
|
|
17 |
(fetchbower "iron-overlay-behavior" "PolymerElements/iron-overlay-behavior# |
|
|
18 |
(fetchbower "iron-fit-behavior" "PolymerElements/iron-fit-behavior# |
|
|
19 |
(fetchbower "iron-checked-element-behavior" "PolymerElements/iron-checked-element-behavior# |
|
|
20 |
(fetchbower "promise-polyfill" "polymerlabs/promise-polyfill# |
|
|
21 |
(fetchbower "iron-behaviors" "PolymerElements/iron-behaviors# |
|
|
22 |
(fetchbower "paper-ripple" "PolymerElements/paper-ripple# |
|
|
23 |
(fetchbower "font-roboto" "PolymerElements/font-roboto# |
|
|
24 |
(fetchbower "iron-meta" "PolymerElements/iron-meta# |
|
|
25 |
(fetchbower "iron-resizable-behavior" "PolymerElements/iron-resizable-behavior# |
|
|
26 |
(fetchbower "iron-selector" "PolymerElements/iron-selector# |
|
|
27 |
(fetchbower "web-animations-js" "web-animations/web-animations-js# |
|
|
28 |
(fetchbower "iron-a11y-keys-behavior" "PolymerElements/iron-a11y-keys-behavior# |
|
|
29 |
(fetchbower "iron-validatable-behavior" "PolymerElements/iron-validatable-behavior# |
|
|
30 |
(fetchbower "iron-form-element-behavior" "PolymerElements/iron-form-element-behavior# |
|
|
4 | (fetchbower "polymer" "Polymer/polymer#1.6.1" "Polymer/polymer#^1.6.1" "09mm0jgk457gvwqlc155swch7gjr6fs3g7spnvhi6vh5b6518540") | |
|
5 | (fetchbower "paper-button" "PolymerElements/paper-button#1.0.13" "PolymerElements/paper-button#^1.0.13" "0i3y153nqk06pn0gk282vyybnl3g1w3w41d5i9z659cgn27g3fvm") | |
|
6 | (fetchbower "paper-spinner" "PolymerElements/paper-spinner#1.2.0" "PolymerElements/paper-spinner#^1.2.0" "1av1m6y81jw3hjhz1yqy3rwcgxarjzl58ldfn4q6sn51pgzngfqb") | |
|
7 | (fetchbower "paper-tooltip" "PolymerElements/paper-tooltip#1.1.2" "PolymerElements/paper-tooltip#^1.1.2" "1j64nprcyk2d2bbl3qwjyr0lbjngm4wclpyfwgai1c4y6g6bigd2") | |
|
8 | (fetchbower "paper-toast" "PolymerElements/paper-toast#1.3.0" "PolymerElements/paper-toast#^1.3.0" "0x9rqxsks5455s8pk4aikpp99ijdn6kxr9gvhwh99nbcqdzcxq1m") | |
|
9 | (fetchbower "paper-toggle-button" "PolymerElements/paper-toggle-button#1.2.0" "PolymerElements/paper-toggle-button#^1.2.0" "0mphcng3ngspbpg4jjn0mb91nvr4xc1phq3qswib15h6sfww1b2w") | |
|
10 | (fetchbower "iron-ajax" "PolymerElements/iron-ajax#1.4.3" "PolymerElements/iron-ajax#^1.4.3" "0m3dx27arwmlcp00b7n516sc5a51f40p9vapr1nvd57l3i3z0pzm") | |
|
11 | (fetchbower "iron-flex-layout" "PolymerElements/iron-flex-layout#1.3.1" "PolymerElements/iron-flex-layout#^1.0.0" "0nswv3ih3bhflgcd2wjfmddqswzgqxb2xbq65jk9w3rkj26hplbl") | |
|
12 | (fetchbower "paper-behaviors" "PolymerElements/paper-behaviors#1.0.12" "PolymerElements/paper-behaviors#^1.0.0" "012bqk97awgz55cn7rm9g7cckrdhkqhls3zvp8l6nd4rdwcrdzq8") | |
|
13 | (fetchbower "paper-material" "PolymerElements/paper-material#1.0.6" "PolymerElements/paper-material#^1.0.0" "0rljmknfdbm5aabvx9pk77754zckj3l127c3mvnmwkpkkr353xnh") | |
|
14 | (fetchbower "paper-styles" "PolymerElements/paper-styles#1.1.4" "PolymerElements/paper-styles#^1.0.0" "0j8vg74xrcxlni8i93dsab3y80f34kk30lv4yblqpkp9c3nrilf7") | |
|
15 | (fetchbower "neon-animation" "PolymerElements/neon-animation#1.2.4" "PolymerElements/neon-animation#^1.0.0" "16mz9i2n5w0k5j8d6gha23cnbdgm5syz3fawyh89gdbq97bi2q5j") | |
|
16 | (fetchbower "iron-a11y-announcer" "PolymerElements/iron-a11y-announcer#1.0.5" "PolymerElements/iron-a11y-announcer#^1.0.0" "0n7c7j1pwk3835s7s2jd9125wdcsqf216yi5gj07wn5s8h8p7m9d") | |
|
17 | (fetchbower "iron-overlay-behavior" "PolymerElements/iron-overlay-behavior#1.8.6" "PolymerElements/iron-overlay-behavior#^1.0.9" "14brn9gz6qqskarg3fxk91xs7vg02vgcsz9a9743kidxr0l0413m") | |
|
18 | (fetchbower "iron-fit-behavior" "PolymerElements/iron-fit-behavior#1.2.5" "PolymerElements/iron-fit-behavior#^1.1.0" "1msnlh8lp1xg6v4h6dkjwj9kzac5q5q208ayla3x9hi483ki6rlf") | |
|
19 | (fetchbower "iron-checked-element-behavior" "PolymerElements/iron-checked-element-behavior#1.0.5" "PolymerElements/iron-checked-element-behavior#^1.0.0" "0l0yy4ah454s8bzfv076s8by7h67zy9ni6xb932qwyhx8br6c1m7") | |
|
20 | (fetchbower "promise-polyfill" "polymerlabs/promise-polyfill#1.0.1" "polymerlabs/promise-polyfill#^1.0.0" "045bj2caav3famr5hhxgs1dx7n08r4s46mlzwb313vdy17is38xb") | |
|
21 | (fetchbower "iron-behaviors" "PolymerElements/iron-behaviors#1.0.17" "PolymerElements/iron-behaviors#^1.0.0" "021qvkmbk32jrrmmphpmwgby4bzi5jyf47rh1bxmq2ip07ly4bpr") | |
|
22 | (fetchbower "paper-ripple" "PolymerElements/paper-ripple#1.0.8" "PolymerElements/paper-ripple#^1.0.0" "0r9sq8ik7wwrw0qb82c3rw0c030ljwd3s466c9y4qbcrsbvfjnns") | |
|
23 | (fetchbower "font-roboto" "PolymerElements/font-roboto#1.0.1" "PolymerElements/font-roboto#^1.0.1" "02jz43r0wkyr3yp7rq2rc08l5cwnsgca9fr54sr4rhsnl7cjpxrj") | |
|
24 | (fetchbower "iron-meta" "PolymerElements/iron-meta#1.1.2" "PolymerElements/iron-meta#^1.0.0" "1wl4dx8fnsknw9z9xi8bpc4cy9x70c11x4zxwxnj73hf3smifppl") | |
|
25 | (fetchbower "iron-resizable-behavior" "PolymerElements/iron-resizable-behavior#1.0.5" "PolymerElements/iron-resizable-behavior#^1.0.0" "1fd5zmbr2hax42vmcasncvk7lzi38fmb1kyii26nn8pnnjak7zkn") | |
|
26 | (fetchbower "iron-selector" "PolymerElements/iron-selector#1.5.2" "PolymerElements/iron-selector#^1.0.0" "1ajv46llqzvahm5g6g75w7nfyjcslp53ji0wm96l2k94j87spv3r") | |
|
27 | (fetchbower "web-animations-js" "web-animations/web-animations-js#2.2.2" "web-animations/web-animations-js#^2.2.0" "1izfvm3l67vwys0bqbhidi9rqziw2f8wv289386sc6jsxzgkzhga") | |
|
28 | (fetchbower "iron-a11y-keys-behavior" "PolymerElements/iron-a11y-keys-behavior#1.1.7" "PolymerElements/iron-a11y-keys-behavior#^1.0.0" "070z46dbbz242002gmqrgy28x0y1fcqp9hnvbi05r3zphiqfx3l7") | |
|
29 | (fetchbower "iron-validatable-behavior" "PolymerElements/iron-validatable-behavior#1.1.1" "PolymerElements/iron-validatable-behavior#^1.0.0" "1yhxlvywhw2klbbgm3f3cmanxfxggagph4ii635zv0c13707wslv") | |
|
30 | (fetchbower "iron-form-element-behavior" "PolymerElements/iron-form-element-behavior#1.0.6" "PolymerElements/iron-form-element-behavior#^1.0.0" "0rdhxivgkdhhz2yadgdbjfc70l555p3y83vjh8rfj5hr0asyn6q1") | |
|
31 | 31 | ]; } |
General Comments 0
You need to be logged in to leave comments.
Login now