##// END OF EJS Templates
packaging: dropped bower, it's now replaced by npm and webcomponents from polymer.
marcink -
r3176:4660c673 default
parent child
Show More

The requested changes are too big and content was truncated. Show full diff

@@ -1,68 +1,66
1 syntax: glob
1 syntax: glob
2 *.egg
2 *.egg
3 *.egg-info
3 *.egg-info
4 *.idea
4 *.idea
5 *.orig
5 *.orig
6 *.pyc
6 *.pyc
7 *.sqlite-journal
7 *.sqlite-journal
8 *.swp
8 *.swp
9 *.tox
9 *.tox
10 *.DS_Store*
10 *.DS_Store*
11 rhodecode/public/js/src/components/**/*.css
11 rhodecode/public/js/src/components/**/*.css
12
12
13 syntax: regexp
13 syntax: regexp
14
14
15 #.filename
15 #.filename
16 ^\.settings$
16 ^\.settings$
17 ^\.project$
17 ^\.project$
18 ^\.pydevproject$
18 ^\.pydevproject$
19 ^\.coverage$
19 ^\.coverage$
20 ^\.cache.*$
20 ^\.cache.*$
21 ^\.rhodecode$
21 ^\.rhodecode$
22
22
23 ^rcextensions
23 ^rcextensions
24 ^.dev
24 ^.dev
25 ^._dev
25 ^._dev
26 ^build/
26 ^build/
27 ^bower_components/
28 ^coverage\.xml$
27 ^coverage\.xml$
29 ^data$
28 ^data$
30 ^\.eggs/
29 ^\.eggs/
31 ^configs/data$
30 ^configs/data$
32 ^dev.ini$
31 ^dev.ini$
33 ^acceptance_tests/dev.*\.ini$
32 ^acceptance_tests/dev.*\.ini$
34 ^dist/
33 ^dist/
35 ^fabfile.py
34 ^fabfile.py
36 ^htmlcov
35 ^htmlcov
37 ^junit\.xml$
36 ^junit\.xml$
38 ^node_modules/
37 ^node_modules/
39 ^node_binaries/
38 ^node_binaries/
40 ^pylint.log$
39 ^pylint.log$
41 ^rcextensions/
40 ^rcextensions/
42 ^result$
41 ^result$
43 ^rhodecode/public/css/style.css$
42 ^rhodecode/public/css/style.css$
44 ^rhodecode/public/css/style-polymer.css$
43 ^rhodecode/public/css/style-polymer.css$
45 ^rhodecode/public/js/rhodecode-components.html$
44 ^rhodecode/public/js/rhodecode-components.html$
45 ^rhodecode/public/js/rhodecode-components.js$
46 ^rhodecode/public/js/scripts.js$
46 ^rhodecode/public/js/scripts.js$
47 ^rhodecode/public/js/rhodecode-components.js$
48 ^rhodecode/public/js/app-bundle.js$
49 ^rhodecode/public/js/src/components/root-styles.gen.html$
47 ^rhodecode/public/js/src/components/root-styles.gen.html$
50 ^rhodecode/public/js/vendors/webcomponentsjs/
48 ^rhodecode/public/js/vendors/webcomponentsjs/
51 ^rhodecode\.db$
49 ^rhodecode\.db$
52 ^rhodecode\.log$
50 ^rhodecode\.log$
53 ^rhodecode_dev\.log$
51 ^rhodecode_dev\.log$
54 ^test\.db$
52 ^test\.db$
55
53
56 # ac-tests
54 # ac-tests
57 ^acceptance_tests/\.cache.*$
55 ^acceptance_tests/\.cache.*$
58 ^acceptance_tests/externals
56 ^acceptance_tests/externals
59 ^acceptance_tests/ghostdriver.log$
57 ^acceptance_tests/ghostdriver.log$
60 ^acceptance_tests/local(_.+)?\.ini$
58 ^acceptance_tests/local(_.+)?\.ini$
61
59
62 # docs
60 # docs
63 ^docs/_build$
61 ^docs/_build$
64 ^docs/result$
62 ^docs/result$
65 ^docs-internal/_build$
63 ^docs-internal/_build$
66
64
67 # Cythonized things
65 # Cythonized things
68 ^rhodecode/.*\.(c|so)$
66 ^rhodecode/.*\.(c|so)$
@@ -1,298 +1,284
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 enterprise-ce
3 # This shall be as lean as possible, just producing the enterprise-ce
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 # Configuration, set values in "~/.nixpkgs/config.nix".
7 # Configuration, set values in "~/.nixpkgs/config.nix".
8 # example
8 # example
9 # {
9 # {
10 # # Thoughts on how to configure the dev environment
10 # # Thoughts on how to configure the dev environment
11 # rc = {
11 # rc = {
12 # codeInternalUrl = "https://usr:token@internal-code.rhodecode.com";
12 # codeInternalUrl = "https://usr:token@internal-code.rhodecode.com";
13 # sources = {
13 # sources = {
14 # rhodecode-vcsserver = "/home/user/work/rhodecode-vcsserver";
14 # rhodecode-vcsserver = "/home/user/work/rhodecode-vcsserver";
15 # rhodecode-enterprise-ce = "/home/user/work/rhodecode-enterprise-ce";
15 # rhodecode-enterprise-ce = "/home/user/work/rhodecode-enterprise-ce";
16 # rhodecode-enterprise-ee = "/home/user/work/rhodecode-enterprise-ee";
16 # rhodecode-enterprise-ee = "/home/user/work/rhodecode-enterprise-ee";
17 # };
17 # };
18 # };
18 # };
19 # }
19 # }
20
20
21 args@
21 args@
22 { pythonPackages ? "python27Packages"
22 { pythonPackages ? "python27Packages"
23 , pythonExternalOverrides ? self: super: {}
23 , pythonExternalOverrides ? self: super: {}
24 , doCheck ? false
24 , doCheck ? false
25 , ...
25 , ...
26 }:
26 }:
27 let pkgs_ = (import <nixpkgs> {}); in
27 let pkgs_ = (import <nixpkgs> {}); in
28
28
29 let
29 let
30 # Use nixpkgs from args or import them. We use this indirect approach
30 # Use nixpkgs from args or import them. We use this indirect approach
31 # through args to be able to use the name `pkgs` for our customized packages.
31 # through args to be able to use the name `pkgs` for our customized packages.
32 # Otherwise we will end up with an infinite recursion.
32 # Otherwise we will end up with an infinite recursion.
33 pkgs = args.pkgs or (import <nixpkgs> {
33 pkgs = args.pkgs or (import <nixpkgs> {
34 overlays = [
34 overlays = [
35 (import ./pkgs/overlays.nix)
35 (import ./pkgs/overlays.nix)
36 ];
36 ];
37 inherit
37 inherit
38 (pkgs_)
38 (pkgs_)
39 system;
39 system;
40 });
40 });
41
41
42 # Works with the new python-packages, still can fallback to the old
42 # Works with the new python-packages, still can fallback to the old
43 # variant.
43 # variant.
44 basePythonPackagesUnfix = basePythonPackages.__unfix__ or (
44 basePythonPackagesUnfix = basePythonPackages.__unfix__ or (
45 self: basePythonPackages.override (a: { inherit self; }));
45 self: basePythonPackages.override (a: { inherit self; }));
46
46
47 # Evaluates to the last segment of a file system path.
47 # Evaluates to the last segment of a file system path.
48 basename = path: with pkgs.lib; last (splitString "/" path);
48 basename = path: with pkgs.lib; last (splitString "/" path);
49
49
50 # source code filter used as arugment to builtins.filterSource.
50 # source code filter used as arugment to builtins.filterSource.
51 src-filter = path: type: with pkgs.lib;
51 src-filter = path: type: with pkgs.lib;
52 let
52 let
53 ext = last (splitString "." path);
53 ext = last (splitString "." path);
54 in
54 in
55 !builtins.elem (basename path) [
55 !builtins.elem (basename path) [
56 ".git" ".hg" "__pycache__" ".eggs" ".idea" ".dev"
56 ".git" ".hg" "__pycache__" ".eggs" ".idea" ".dev"
57 "bower_components" "node_modules" "node_binaries"
57 "node_modules" "node_binaries"
58 "build" "data" "result" "tmp"] &&
58 "build" "data" "result" "tmp"] &&
59 !builtins.elem ext ["egg-info" "pyc"] &&
59 !builtins.elem ext ["egg-info" "pyc"] &&
60 # TODO: johbo: This check is wrong, since "path" contains an absolute path,
60 # TODO: johbo: This check is wrong, since "path" contains an absolute path,
61 # it would still be good to restore it since we want to ignore "result-*".
61 # it would still be good to restore it since we want to ignore "result-*".
62 !hasPrefix "result" path;
62 !hasPrefix "result" path;
63
63
64 sources =
64 sources =
65 let
65 let
66 inherit
66 inherit
67 (pkgs.lib)
67 (pkgs.lib)
68 all
68 all
69 isString
69 isString
70 attrValues;
70 attrValues;
71 sourcesConfig = pkgs.config.rc.sources or {};
71 sourcesConfig = pkgs.config.rc.sources or {};
72 in
72 in
73 # Ensure that sources are configured as strings. Using a path
73 # Ensure that sources are configured as strings. Using a path
74 # would result in a copy into the nix store.
74 # would result in a copy into the nix store.
75 assert all isString (attrValues sourcesConfig);
75 assert all isString (attrValues sourcesConfig);
76 sourcesConfig;
76 sourcesConfig;
77
77
78 version = builtins.readFile "${rhodecode-enterprise-ce-src}/rhodecode/VERSION";
78 version = builtins.readFile "${rhodecode-enterprise-ce-src}/rhodecode/VERSION";
79 rhodecode-enterprise-ce-src = builtins.filterSource src-filter ./.;
79 rhodecode-enterprise-ce-src = builtins.filterSource src-filter ./.;
80
80
81 buildBowerComponents = pkgs.buildBowerComponents;
82 nodeEnv = import ./pkgs/node-default.nix {
81 nodeEnv = import ./pkgs/node-default.nix {
83 inherit
82 inherit
84 pkgs;
83 pkgs;
85 };
84 };
86 nodeDependencies = nodeEnv.shell.nodeDependencies;
85 nodeDependencies = nodeEnv.shell.nodeDependencies;
87
86
88 bowerComponents = buildBowerComponents {
89 name = "enterprise-ce-${version}";
90 generated = ./pkgs/bower-packages.nix;
91 src = rhodecode-enterprise-ce-src;
92 };
93
94 rhodecode-testdata-src = sources.rhodecode-testdata or (
87 rhodecode-testdata-src = sources.rhodecode-testdata or (
95 pkgs.fetchhg {
88 pkgs.fetchhg {
96 url = "https://code.rhodecode.com/upstream/rc_testdata";
89 url = "https://code.rhodecode.com/upstream/rc_testdata";
97 rev = "v0.10.0";
90 rev = "v0.10.0";
98 sha256 = "0zn9swwvx4vgw4qn8q3ri26vvzgrxn15x6xnjrysi1bwmz01qjl0";
91 sha256 = "0zn9swwvx4vgw4qn8q3ri26vvzgrxn15x6xnjrysi1bwmz01qjl0";
99 });
92 });
100
93
101 rhodecode-testdata = import "${rhodecode-testdata-src}/default.nix" {
94 rhodecode-testdata = import "${rhodecode-testdata-src}/default.nix" {
102 inherit
95 inherit
103 doCheck
96 doCheck
104 pkgs
97 pkgs
105 pythonPackages;
98 pythonPackages;
106 };
99 };
107
100
108 pythonLocalOverrides = self: super: {
101 pythonLocalOverrides = self: super: {
109 rhodecode-enterprise-ce =
102 rhodecode-enterprise-ce =
110 let
103 let
111 linkNodeAndBowerPackages = ''
104 linkNodePackages = ''
112 export RHODECODE_CE_PATH=${rhodecode-enterprise-ce-src}
105 export RHODECODE_CE_PATH=${rhodecode-enterprise-ce-src}
113
106
114 echo "[BEGIN]: Link node packages and binaries"
107 echo "[BEGIN]: Link node packages and binaries"
115 # johbo: Linking individual packages allows us to run "npm install"
108 # johbo: Linking individual packages allows us to run "npm install"
116 # inside of a shell to try things out. Re-entering the shell will
109 # inside of a shell to try things out. Re-entering the shell will
117 # restore a clean environment.
110 # restore a clean environment.
118 rm -fr node_modules
111 rm -fr node_modules
119 mkdir node_modules
112 mkdir node_modules
120 ln -s ${nodeDependencies}/lib/node_modules/* node_modules/
113 ln -s ${nodeDependencies}/lib/node_modules/* node_modules/
121 export NODE_PATH=./node_modules
114 export NODE_PATH=./node_modules
122
115
123 rm -fr node_binaries
116 rm -fr node_binaries
124 mkdir node_binaries
117 mkdir node_binaries
125 ln -s ${nodeDependencies}/bin/* node_binaries/
118 ln -s ${nodeDependencies}/bin/* node_binaries/
126 echo "[DONE ]: Link node packages and binaries"
119 echo "[DONE ]: Link node packages and binaries"
127
128 echo "[BEGIN]: Link bower packages"
129 rm -fr bower_components
130 mkdir bower_components
131 ln -s ${bowerComponents}/bower_components/* bower_components/
132 echo "[DONE ]: Link bower packages"
133 '';
120 '';
134
121
135 releaseName = "RhodeCodeEnterpriseCE-${version}";
122 releaseName = "RhodeCodeEnterpriseCE-${version}";
136 in super.rhodecode-enterprise-ce.override (attrs: {
123 in super.rhodecode-enterprise-ce.override (attrs: {
137 inherit
124 inherit
138 doCheck
125 doCheck
139 version;
126 version;
140
127
141 name = "rhodecode-enterprise-ce-${version}";
128 name = "rhodecode-enterprise-ce-${version}";
142 releaseName = releaseName;
129 releaseName = releaseName;
143 src = rhodecode-enterprise-ce-src;
130 src = rhodecode-enterprise-ce-src;
144 dontStrip = true; # prevent strip, we don't need it.
131 dontStrip = true; # prevent strip, we don't need it.
145
132
146 # expose following attributed outside
133 # expose following attributed outside
147 passthru = {
134 passthru = {
148 inherit
135 inherit
149 rhodecode-testdata
136 rhodecode-testdata
150 bowerComponents
137 linkNodePackages
151 linkNodeAndBowerPackages
152 myPythonPackagesUnfix
138 myPythonPackagesUnfix
153 pythonLocalOverrides
139 pythonLocalOverrides
154 pythonCommunityOverrides;
140 pythonCommunityOverrides;
155
141
156 pythonPackages = self;
142 pythonPackages = self;
157 };
143 };
158
144
159 buildInputs =
145 buildInputs =
160 attrs.buildInputs or [] ++ [
146 attrs.buildInputs or [] ++ [
161 rhodecode-testdata
147 rhodecode-testdata
162 ];
148 ];
163
149
164 #NOTE: option to inject additional propagatedBuildInputs
150 #NOTE: option to inject additional propagatedBuildInputs
165 propagatedBuildInputs =
151 propagatedBuildInputs =
166 attrs.propagatedBuildInputs or [] ++ [
152 attrs.propagatedBuildInputs or [] ++ [
167
153
168 ];
154 ];
169
155
170 LC_ALL = "en_US.UTF-8";
156 LC_ALL = "en_US.UTF-8";
171 LOCALE_ARCHIVE =
157 LOCALE_ARCHIVE =
172 if pkgs.stdenv.isLinux
158 if pkgs.stdenv.isLinux
173 then "${pkgs.glibcLocales}/lib/locale/locale-archive"
159 then "${pkgs.glibcLocales}/lib/locale/locale-archive"
174 else "";
160 else "";
175
161
176 # Add bin directory to path so that tests can find 'rhodecode'.
162 # Add bin directory to path so that tests can find 'rhodecode'.
177 preCheck = ''
163 preCheck = ''
178 export PATH="$out/bin:$PATH"
164 export PATH="$out/bin:$PATH"
179 '';
165 '';
180
166
181 # custom check phase for testing
167 # custom check phase for testing
182 checkPhase = ''
168 checkPhase = ''
183 runHook preCheck
169 runHook preCheck
184 PYTHONHASHSEED=random py.test -vv -p no:sugar -r xw --cov-config=.coveragerc --cov=rhodecode --cov-report=term-missing rhodecode
170 PYTHONHASHSEED=random py.test -vv -p no:sugar -r xw --cov-config=.coveragerc --cov=rhodecode --cov-report=term-missing rhodecode
185 runHook postCheck
171 runHook postCheck
186 '';
172 '';
187
173
188 postCheck = ''
174 postCheck = ''
189 echo "Cleanup of rhodecode/tests"
175 echo "Cleanup of rhodecode/tests"
190 rm -rf $out/lib/${self.python.libPrefix}/site-packages/rhodecode/tests
176 rm -rf $out/lib/${self.python.libPrefix}/site-packages/rhodecode/tests
191 '';
177 '';
192
178
193 preBuild = ''
179 preBuild = ''
194 echo "[BEGIN]: Building frontend assets"
180 echo "[BEGIN]: Building frontend assets"
195 ${linkNodeAndBowerPackages}
181 ${linkNodePackages}
196 make web-build
182 make web-build
197 rm -fr node_modules
183 rm -fr node_modules
198 rm -fr node_binaries
184 rm -fr node_binaries
199 echo "[DONE ]: Building frontend assets"
185 echo "[DONE ]: Building frontend assets"
200 '';
186 '';
201
187
202 postInstall = ''
188 postInstall = ''
203 # check required files
189 # check required files
204 if [ ! -f rhodecode/public/js/scripts.js ]; then
190 if [ ! -f rhodecode/public/js/scripts.js ]; then
205 echo "Missing scripts.js"
191 echo "Missing scripts.js"
206 exit 1
192 exit 1
207 fi
193 fi
208 if [ ! -f rhodecode/public/css/style.css ]; then
194 if [ ! -f rhodecode/public/css/style.css ]; then
209 echo "Missing style.css"
195 echo "Missing style.css"
210 exit 1
196 exit 1
211 fi
197 fi
212
198
213 echo "Writing enterprise-ce meta information for rccontrol to nix-support/rccontrol"
199 echo "Writing enterprise-ce meta information for rccontrol to nix-support/rccontrol"
214 mkdir -p $out/nix-support/rccontrol
200 mkdir -p $out/nix-support/rccontrol
215 cp -v rhodecode/VERSION $out/nix-support/rccontrol/version
201 cp -v rhodecode/VERSION $out/nix-support/rccontrol/version
216 echo "[DONE ]: enterprise-ce meta information for rccontrol written"
202 echo "[DONE ]: enterprise-ce meta information for rccontrol written"
217
203
218 mkdir -p $out/etc
204 mkdir -p $out/etc
219 cp configs/production.ini $out/etc
205 cp configs/production.ini $out/etc
220 echo "[DONE ]: saved enterprise-ce production.ini into $out/etc"
206 echo "[DONE ]: saved enterprise-ce production.ini into $out/etc"
221
207
222 cp -r rhodecode/config/rcextensions $out/etc/rcextensions.tmpl
208 cp -r rhodecode/config/rcextensions $out/etc/rcextensions.tmpl
223 echo "[DONE ]: saved enterprise-ce rcextensions into $out/etc/rcextensions.tmpl"
209 echo "[DONE ]: saved enterprise-ce rcextensions into $out/etc/rcextensions.tmpl"
224
210
225 # python based programs need to be wrapped
211 # python based programs need to be wrapped
226 mkdir -p $out/bin
212 mkdir -p $out/bin
227
213
228 # required binaries from dependencies
214 # required binaries from dependencies
229 ln -s ${self.supervisor}/bin/supervisorctl $out/bin/
215 ln -s ${self.supervisor}/bin/supervisorctl $out/bin/
230 ln -s ${self.supervisor}/bin/supervisord $out/bin/
216 ln -s ${self.supervisor}/bin/supervisord $out/bin/
231 ln -s ${self.pastescript}/bin/paster $out/bin/
217 ln -s ${self.pastescript}/bin/paster $out/bin/
232 ln -s ${self.channelstream}/bin/channelstream $out/bin/
218 ln -s ${self.channelstream}/bin/channelstream $out/bin/
233 ln -s ${self.celery}/bin/celery $out/bin/
219 ln -s ${self.celery}/bin/celery $out/bin/
234 ln -s ${self.gunicorn}/bin/gunicorn $out/bin/
220 ln -s ${self.gunicorn}/bin/gunicorn $out/bin/
235 ln -s ${self.pyramid}/bin/prequest $out/bin/
221 ln -s ${self.pyramid}/bin/prequest $out/bin/
236 ln -s ${self.pyramid}/bin/pserve $out/bin/
222 ln -s ${self.pyramid}/bin/pserve $out/bin/
237
223
238 echo "[DONE ]: created symlinks into $out/bin"
224 echo "[DONE ]: created symlinks into $out/bin"
239 DEPS="$out/bin/supervisorctl \
225 DEPS="$out/bin/supervisorctl \
240 $out/bin/supervisord \
226 $out/bin/supervisord \
241 $out/bin/paster \
227 $out/bin/paster \
242 $out/bin/channelstream \
228 $out/bin/channelstream \
243 $out/bin/celery \
229 $out/bin/celery \
244 $out/bin/gunicorn \
230 $out/bin/gunicorn \
245 $out/bin/prequest \
231 $out/bin/prequest \
246 $out/bin/pserve"
232 $out/bin/pserve"
247
233
248 # wrap only dependency scripts, they require to have full PYTHONPATH set
234 # wrap only dependency scripts, they require to have full PYTHONPATH set
249 # to be able to import all packages
235 # to be able to import all packages
250 for file in $DEPS;
236 for file in $DEPS;
251 do
237 do
252 wrapProgram $file \
238 wrapProgram $file \
253 --prefix PATH : $PATH \
239 --prefix PATH : $PATH \
254 --prefix PYTHONPATH : $PYTHONPATH \
240 --prefix PYTHONPATH : $PYTHONPATH \
255 --set PYTHONHASHSEED random
241 --set PYTHONHASHSEED random
256 done
242 done
257
243
258 echo "[DONE ]: enterprise-ce binary wrapping"
244 echo "[DONE ]: enterprise-ce binary wrapping"
259
245
260 # rhodecode-tools don't need wrapping
246 # rhodecode-tools don't need wrapping
261 ln -s ${self.rhodecode-tools}/bin/rhodecode-* $out/bin/
247 ln -s ${self.rhodecode-tools}/bin/rhodecode-* $out/bin/
262
248
263 '';
249 '';
264 });
250 });
265
251
266 };
252 };
267
253
268 basePythonPackages = with builtins;
254 basePythonPackages = with builtins;
269 if isAttrs pythonPackages then
255 if isAttrs pythonPackages then
270 pythonPackages
256 pythonPackages
271 else
257 else
272 getAttr pythonPackages pkgs;
258 getAttr pythonPackages pkgs;
273
259
274 pythonGeneratedPackages = import ./pkgs/python-packages.nix {
260 pythonGeneratedPackages = import ./pkgs/python-packages.nix {
275 inherit
261 inherit
276 pkgs;
262 pkgs;
277 inherit
263 inherit
278 (pkgs)
264 (pkgs)
279 fetchurl
265 fetchurl
280 fetchgit
266 fetchgit
281 fetchhg;
267 fetchhg;
282 };
268 };
283
269
284 pythonCommunityOverrides = import ./pkgs/python-packages-overrides.nix {
270 pythonCommunityOverrides = import ./pkgs/python-packages-overrides.nix {
285 inherit pkgs basePythonPackages;
271 inherit pkgs basePythonPackages;
286 };
272 };
287
273
288 # Apply all overrides and fix the final package set
274 # Apply all overrides and fix the final package set
289 myPythonPackagesUnfix = with pkgs.lib;
275 myPythonPackagesUnfix = with pkgs.lib;
290 (extends pythonExternalOverrides
276 (extends pythonExternalOverrides
291 (extends pythonLocalOverrides
277 (extends pythonLocalOverrides
292 (extends pythonCommunityOverrides
278 (extends pythonCommunityOverrides
293 (extends pythonGeneratedPackages
279 (extends pythonGeneratedPackages
294 basePythonPackagesUnfix))));
280 basePythonPackagesUnfix))));
295
281
296 myPythonPackages = (pkgs.lib.fix myPythonPackagesUnfix);
282 myPythonPackages = (pkgs.lib.fix myPythonPackagesUnfix);
297
283
298 in myPythonPackages.rhodecode-enterprise-ce
284 in myPythonPackages.rhodecode-enterprise-ce
@@ -1,60 +1,16
1
1
2 =======================
2 =======================
3 Dependency management
3 Dependency management
4 =======================
4 =======================
5
5
6
6
7 Overview
7 Overview
8 ========
8 ========
9
9
10 We use the Nix package manager to handle our dependencies. In general we use the
10 We use the Nix package manager to handle our dependencies. In general we use the
11 packages out of the package collection `nixpkgs`. For frequently changing
11 packages out of the package collection `nixpkgs`. For frequently changing
12 dependencies for Python and JavaScript we use the tools which are described in
12 dependencies for Python and JavaScript we use the tools which are described in
13 this section to generate the needed Nix derivations.
13 this section to generate the needed Nix derivations.
14
14
15
15
16 Python dependencies
16 Please check pkgs/README.rst file for mor information on how to build the packages.
17 ===================
18
19 We use the tool `pip2nix` to generate the Nix derivations for our Python
20 dependencies.
21
22 Generating the dependencies should be done with the following command:
23
24 .. code:: shell
25
26 pip2nix generate --license
27
28
29 .. note::
30
31 License extraction support is still experimental, use the version from the
32 following pull request: https://github.com/ktosiek/pip2nix/pull/30
33
34
35
36 Node dependencies
37 =================
38
39 After adding new dependencies via ``npm install --save``, use `node2nix` to
40 update the corresponding Nix derivations:
41
42 .. code:: shell
43
44 cd pkgs
45 node2nix --input ../package.json \
46 -o node-packages.nix \
47 -e node-env.nix \
48 -c node-default.nix \
49 -d --flatten
50
51
52 Bower dependencies
53 ==================
54
55 Frontend dependencies are managed based on `bower`, with `bower2nix` a tool
56 exists which can generate the needed Nix derivations:
57
58 .. code:: shell
59
60 bower2nix bower.json pkgs/bower-packages.nix
@@ -1,176 +1,175
1 {
1 {
2 "dirs": {
2 "dirs": {
3 "css": {
3 "css": {
4 "src":"rhodecode/public/css",
4 "src":"rhodecode/public/css",
5 "dest":"rhodecode/public/css"
5 "dest":"rhodecode/public/css"
6 },
6 },
7 "js": {
7 "js": {
8 "src": "rhodecode/public/js/src",
8 "src": "rhodecode/public/js/src",
9 "src_rc": "rhodecode/public/js/rhodecode",
9 "src_rc": "rhodecode/public/js/rhodecode",
10 "dest": "rhodecode/public/js",
10 "dest": "rhodecode/public/js",
11 "bower": "bower_components",
12 "node_modules": "node_modules"
11 "node_modules": "node_modules"
13 }
12 }
14 },
13 },
15 "copy": {
14 "copy": {
16 "main": {
15 "main": {
17 "expand": true,
16 "expand": true,
18 "cwd": "bower_components",
17 "cwd": "node_modules/@webcomponents",
19 "src": "webcomponentsjs/*.*",
18 "src": "webcomponentsjs/*.*",
20 "dest": "<%= dirs.js.dest %>/vendors"
19 "dest": "<%= dirs.js.dest %>/vendors"
21 }
20 }
22 },
21 },
23 "concat": {
22 "concat": {
24 "polymercss": {
23 "polymercss": {
25 "src": [
24 "src": [
26 "<%= dirs.js.src %>/components/root-styles-prefix.html",
25 "<%= dirs.js.src %>/components/root-styles-prefix.html",
27 "<%= dirs.css.src %>/style-polymer.css",
26 "<%= dirs.css.src %>/style-polymer.css",
28 "<%= dirs.js.src %>/components/root-styles-suffix.html"
27 "<%= dirs.js.src %>/components/root-styles-suffix.html"
29 ],
28 ],
30 "dest": "<%= dirs.js.dest %>/src/components/root-styles.gen.html",
29 "dest": "<%= dirs.js.dest %>/src/components/root-styles.gen.html",
31 "nonull": true
30 "nonull": true
32 },
31 },
33 "dist": {
32 "dist": {
34 "src": [
33 "src": [
35 "<%= dirs.js.node_modules %>/jquery/dist/jquery.min.js",
34 "<%= dirs.js.node_modules %>/jquery/dist/jquery.min.js",
36 "<%= dirs.js.node_modules %>/mousetrap/mousetrap.min.js",
35 "<%= dirs.js.node_modules %>/mousetrap/mousetrap.min.js",
37 "<%= dirs.js.node_modules %>/moment/min/moment.min.js",
36 "<%= dirs.js.node_modules %>/moment/min/moment.min.js",
38 "<%= dirs.js.node_modules %>/clipboard/dist/clipboard.min.js",
37 "<%= dirs.js.node_modules %>/clipboard/dist/clipboard.min.js",
39 "<%= dirs.js.node_modules %>/favico.js/favico-0.3.10.min.js",
38 "<%= dirs.js.node_modules %>/favico.js/favico-0.3.10.min.js",
40 "<%= dirs.js.node_modules %>/sticky-sidebar/dist/sticky-sidebar.min.js",
39 "<%= dirs.js.node_modules %>/sticky-sidebar/dist/sticky-sidebar.min.js",
41 "<%= dirs.js.node_modules %>/sticky-sidebar/dist/jquery.sticky-sidebar.min.js",
40 "<%= dirs.js.node_modules %>/sticky-sidebar/dist/jquery.sticky-sidebar.min.js",
42 "<%= dirs.js.node_modules %>/waypoints/lib/noframework.waypoints.min.js",
41 "<%= dirs.js.node_modules %>/waypoints/lib/noframework.waypoints.min.js",
43 "<%= dirs.js.node_modules %>/waypoints/lib/jquery.waypoints.min.js",
42 "<%= dirs.js.node_modules %>/waypoints/lib/jquery.waypoints.min.js",
44 "<%= dirs.js.node_modules %>/appenlight-client/appenlight-client.min.js",
43 "<%= dirs.js.node_modules %>/appenlight-client/appenlight-client.min.js",
45 "<%= dirs.js.src %>/logging.js",
44 "<%= dirs.js.src %>/logging.js",
46 "<%= dirs.js.src %>/bootstrap.js",
45 "<%= dirs.js.src %>/bootstrap.js",
47 "<%= dirs.js.src %>/i18n_utils.js",
46 "<%= dirs.js.src %>/i18n_utils.js",
48 "<%= dirs.js.src %>/deform.js",
47 "<%= dirs.js.src %>/deform.js",
49 "<%= dirs.js.src %>/ejs.js",
48 "<%= dirs.js.src %>/ejs.js",
50 "<%= dirs.js.src %>/ejs_templates/utils.js",
49 "<%= dirs.js.src %>/ejs_templates/utils.js",
51 "<%= dirs.js.src %>/plugins/jquery.pjax.js",
50 "<%= dirs.js.src %>/plugins/jquery.pjax.js",
52 "<%= dirs.js.src %>/plugins/jquery.dataTables.js",
51 "<%= dirs.js.src %>/plugins/jquery.dataTables.js",
53 "<%= dirs.js.src %>/plugins/flavoured_checkbox.js",
52 "<%= dirs.js.src %>/plugins/flavoured_checkbox.js",
54 "<%= dirs.js.src %>/plugins/jquery.auto-grow-input.js",
53 "<%= dirs.js.src %>/plugins/jquery.auto-grow-input.js",
55 "<%= dirs.js.src %>/plugins/jquery.autocomplete.js",
54 "<%= dirs.js.src %>/plugins/jquery.autocomplete.js",
56 "<%= dirs.js.src %>/plugins/jquery.debounce.js",
55 "<%= dirs.js.src %>/plugins/jquery.debounce.js",
57 "<%= dirs.js.src %>/plugins/jquery.mark.js",
56 "<%= dirs.js.src %>/plugins/jquery.mark.js",
58 "<%= dirs.js.src %>/plugins/jquery.timeago.js",
57 "<%= dirs.js.src %>/plugins/jquery.timeago.js",
59 "<%= dirs.js.src %>/plugins/jquery.timeago-extension.js",
58 "<%= dirs.js.src %>/plugins/jquery.timeago-extension.js",
60 "<%= dirs.js.src %>/select2/select2.js",
59 "<%= dirs.js.src %>/select2/select2.js",
61 "<%= dirs.js.src %>/codemirror/codemirror.js",
60 "<%= dirs.js.src %>/codemirror/codemirror.js",
62 "<%= dirs.js.src %>/codemirror/codemirror_loadmode.js",
61 "<%= dirs.js.src %>/codemirror/codemirror_loadmode.js",
63 "<%= dirs.js.src %>/codemirror/codemirror_hint.js",
62 "<%= dirs.js.src %>/codemirror/codemirror_hint.js",
64 "<%= dirs.js.src %>/codemirror/codemirror_overlay.js",
63 "<%= dirs.js.src %>/codemirror/codemirror_overlay.js",
65 "<%= dirs.js.src %>/codemirror/codemirror_placeholder.js",
64 "<%= dirs.js.src %>/codemirror/codemirror_placeholder.js",
66 "<%= dirs.js.src %>/codemirror/codemirror_simplemode.js",
65 "<%= dirs.js.src %>/codemirror/codemirror_simplemode.js",
67 "<%= dirs.js.dest %>/mode/meta.js",
66 "<%= dirs.js.dest %>/mode/meta.js",
68 "<%= dirs.js.dest %>/mode/meta_ext.js",
67 "<%= dirs.js.dest %>/mode/meta_ext.js",
69 "<%= dirs.js.src_rc %>/i18n/select2/translations.js",
68 "<%= dirs.js.src_rc %>/i18n/select2/translations.js",
70 "<%= dirs.js.src %>/rhodecode/utils/array.js",
69 "<%= dirs.js.src %>/rhodecode/utils/array.js",
71 "<%= dirs.js.src %>/rhodecode/utils/string.js",
70 "<%= dirs.js.src %>/rhodecode/utils/string.js",
72 "<%= dirs.js.src %>/rhodecode/utils/pyroutes.js",
71 "<%= dirs.js.src %>/rhodecode/utils/pyroutes.js",
73 "<%= dirs.js.src %>/rhodecode/utils/ajax.js",
72 "<%= dirs.js.src %>/rhodecode/utils/ajax.js",
74 "<%= dirs.js.src %>/rhodecode/utils/autocomplete.js",
73 "<%= dirs.js.src %>/rhodecode/utils/autocomplete.js",
75 "<%= dirs.js.src %>/rhodecode/utils/colorgenerator.js",
74 "<%= dirs.js.src %>/rhodecode/utils/colorgenerator.js",
76 "<%= dirs.js.src %>/rhodecode/utils/ie.js",
75 "<%= dirs.js.src %>/rhodecode/utils/ie.js",
77 "<%= dirs.js.src %>/rhodecode/utils/os.js",
76 "<%= dirs.js.src %>/rhodecode/utils/os.js",
78 "<%= dirs.js.src %>/rhodecode/utils/topics.js",
77 "<%= dirs.js.src %>/rhodecode/utils/topics.js",
79 "<%= dirs.js.src %>/rhodecode/init.js",
78 "<%= dirs.js.src %>/rhodecode/init.js",
80 "<%= dirs.js.src %>/rhodecode/changelog.js",
79 "<%= dirs.js.src %>/rhodecode/changelog.js",
81 "<%= dirs.js.src %>/rhodecode/codemirror.js",
80 "<%= dirs.js.src %>/rhodecode/codemirror.js",
82 "<%= dirs.js.src %>/rhodecode/comments.js",
81 "<%= dirs.js.src %>/rhodecode/comments.js",
83 "<%= dirs.js.src %>/rhodecode/constants.js",
82 "<%= dirs.js.src %>/rhodecode/constants.js",
84 "<%= dirs.js.src %>/rhodecode/files.js",
83 "<%= dirs.js.src %>/rhodecode/files.js",
85 "<%= dirs.js.src %>/rhodecode/followers.js",
84 "<%= dirs.js.src %>/rhodecode/followers.js",
86 "<%= dirs.js.src %>/rhodecode/menus.js",
85 "<%= dirs.js.src %>/rhodecode/menus.js",
87 "<%= dirs.js.src %>/rhodecode/notifications.js",
86 "<%= dirs.js.src %>/rhodecode/notifications.js",
88 "<%= dirs.js.src %>/rhodecode/permissions.js",
87 "<%= dirs.js.src %>/rhodecode/permissions.js",
89 "<%= dirs.js.src %>/rhodecode/pjax.js",
88 "<%= dirs.js.src %>/rhodecode/pjax.js",
90 "<%= dirs.js.src %>/rhodecode/pullrequests.js",
89 "<%= dirs.js.src %>/rhodecode/pullrequests.js",
91 "<%= dirs.js.src %>/rhodecode/settings.js",
90 "<%= dirs.js.src %>/rhodecode/settings.js",
92 "<%= dirs.js.src %>/rhodecode/select2_widgets.js",
91 "<%= dirs.js.src %>/rhodecode/select2_widgets.js",
93 "<%= dirs.js.src %>/rhodecode/tooltips.js",
92 "<%= dirs.js.src %>/rhodecode/tooltips.js",
94 "<%= dirs.js.src %>/rhodecode/users.js",
93 "<%= dirs.js.src %>/rhodecode/users.js",
95 "<%= dirs.js.src %>/rhodecode/appenlight.js",
94 "<%= dirs.js.src %>/rhodecode/appenlight.js",
96 "<%= dirs.js.src %>/rhodecode.js",
95 "<%= dirs.js.src %>/rhodecode.js",
97 "<%= dirs.js.dest %>/rhodecode-components.js"
96 "<%= dirs.js.dest %>/rhodecode-components.js"
98 ],
97 ],
99 "dest": "<%= dirs.js.dest %>/scripts.js",
98 "dest": "<%= dirs.js.dest %>/scripts.js",
100 "nonull": true
99 "nonull": true
101 }
100 }
102 },
101 },
103 "less": {
102 "less": {
104 "development": {
103 "development": {
105 "options": {
104 "options": {
106 "compress": false,
105 "compress": false,
107 "yuicompress": false,
106 "yuicompress": false,
108 "optimization": 0
107 "optimization": 0
109 },
108 },
110 "files": {
109 "files": {
111 "<%= dirs.css.dest %>/style.css": "<%= dirs.css.src %>/main.less",
110 "<%= dirs.css.dest %>/style.css": "<%= dirs.css.src %>/main.less",
112 "<%= dirs.css.dest %>/style-polymer.css": "<%= dirs.css.src %>/polymer.less"
111 "<%= dirs.css.dest %>/style-polymer.css": "<%= dirs.css.src %>/polymer.less"
113 }
112 }
114 },
113 },
115 "production": {
114 "production": {
116 "options": {
115 "options": {
117 "compress": true,
116 "compress": true,
118 "yuicompress": true,
117 "yuicompress": true,
119 "optimization": 2
118 "optimization": 2
120 },
119 },
121 "files": {
120 "files": {
122 "<%= dirs.css.dest %>/style.css": "<%= dirs.css.src %>/main.less",
121 "<%= dirs.css.dest %>/style.css": "<%= dirs.css.src %>/main.less",
123 "<%= dirs.css.dest %>/style-polymer.css": "<%= dirs.css.src %>/polymer.less"
122 "<%= dirs.css.dest %>/style-polymer.css": "<%= dirs.css.src %>/polymer.less"
124 }
123 }
125 },
124 },
126 "components": {
125 "components": {
127 "files": [
126 "files": [
128 {
127 {
129 "cwd": "<%= dirs.js.src %>/components/",
128 "cwd": "<%= dirs.js.src %>/components/",
130 "dest": "<%= dirs.js.src %>/components/",
129 "dest": "<%= dirs.js.src %>/components/",
131 "src": [
130 "src": [
132 "**/*.less"
131 "**/*.less"
133 ],
132 ],
134 "expand": true,
133 "expand": true,
135 "ext": ".css"
134 "ext": ".css"
136 }
135 }
137 ]
136 ]
138 }
137 }
139 },
138 },
140 "watch": {
139 "watch": {
141 "less": {
140 "less": {
142 "files": [
141 "files": [
143 "<%= dirs.css.src %>/**/*.less",
142 "<%= dirs.css.src %>/**/*.less",
144 "<%= dirs.js.src %>/components/**/*.less"
143 "<%= dirs.js.src %>/components/**/*.less"
145 ],
144 ],
146 "tasks": [
145 "tasks": [
147 "less:development",
146 "less:development",
148 "less:components",
147 "less:components",
149 "concat:polymercss",
148 "concat:polymercss",
150 "webpack",
149 "webpack",
151 "concat:dist"
150 "concat:dist"
152 ]
151 ]
153 },
152 },
154 "js": {
153 "js": {
155 "files": [
154 "files": [
156 "!<%= dirs.js.src %>/components/root-styles.gen.html",
155 "!<%= dirs.js.src %>/components/root-styles.gen.html",
157 "<%= dirs.js.src %>/**/*.js",
156 "<%= dirs.js.src %>/**/*.js",
158 "<%= dirs.js.src %>/components/**/*.html"
157 "<%= dirs.js.src %>/components/**/*.html"
159 ],
158 ],
160 "tasks": [
159 "tasks": [
161 "less:components",
160 "less:components",
162 "concat:polymercss",
161 "concat:polymercss",
163 "webpack",
162 "webpack",
164 "concat:dist"
163 "concat:dist"
165 ]
164 ]
166 }
165 }
167 },
166 },
168 "jshint": {
167 "jshint": {
169 "rhodecode": {
168 "rhodecode": {
170 "src": "<%= dirs.js.src %>/rhodecode/**/*.js",
169 "src": "<%= dirs.js.src %>/rhodecode/**/*.js",
171 "options": {
170 "options": {
172 "jshintrc": ".jshintrc"
171 "jshintrc": ".jshintrc"
173 }
172 }
174 }
173 }
175 }
174 }
176 }
175 }
@@ -1,59 +1,58
1 {
1 {
2 "name": "rhodecode-enterprise",
2 "name": "rhodecode-enterprise",
3 "version": "2.0.0",
3 "version": "2.0.0",
4 "private": true,
4 "private": true,
5 "description" : "RhodeCode JS packaged",
5 "description" : "RhodeCode JS packaged",
6 "license": "SEE LICENSE IN LICENSE.txt",
6 "license": "SEE LICENSE IN LICENSE.txt",
7 "repository" : {
7 "repository" : {
8 "type" : "hg",
8 "type" : "hg",
9 "url" : "https://code.rhodecode.com/rhodecode-enterprise-ce"
9 "url" : "https://code.rhodecode.com/rhodecode-enterprise-ce"
10 },
10 },
11 "devDependencies": {
11 "devDependencies": {
12 "appenlight-client": "git+https://git@github.com/AppEnlight/appenlight-client-js.git#0.5.1",
12 "appenlight-client": "git+https://git@github.com/AppEnlight/appenlight-client-js.git#0.5.1",
13 "bower": "^1.8.4",
14 "clipboard": "^2.0.1",
13 "clipboard": "^2.0.1",
15 "exports-loader": "^0.6.4",
14 "exports-loader": "^0.6.4",
16 "favico.js": "^0.3.10",
15 "favico.js": "^0.3.10",
17 "grunt": "^0.4.5",
16 "grunt": "^0.4.5",
18 "grunt-cli": "^1.3.1",
17 "grunt-cli": "^1.3.1",
19 "grunt-contrib-concat": "^0.5.1",
18 "grunt-contrib-concat": "^0.5.1",
20 "grunt-contrib-copy": "^1.0.0",
19 "grunt-contrib-copy": "^1.0.0",
21 "grunt-contrib-jshint": "^0.12.0",
20 "grunt-contrib-jshint": "^0.12.0",
22 "grunt-contrib-less": "^1.1.0",
21 "grunt-contrib-less": "^1.1.0",
23 "grunt-contrib-watch": "^0.6.1",
22 "grunt-contrib-watch": "^0.6.1",
24 "grunt-webpack": "^3.1.3",
23 "grunt-webpack": "^3.1.3",
25 "jquery": "1.11.3",
24 "jquery": "1.11.3",
26 "jshint": "^2.9.1-rc3",
25 "jshint": "^2.9.1-rc3",
27 "moment": "^2.18.1",
26 "moment": "^2.18.1",
28 "mousetrap": "^1.6.1",
27 "mousetrap": "^1.6.1",
29 "qrious": "^4.0.2",
28 "qrious": "^4.0.2",
30 "sticky-sidebar": "3.3.1",
29 "sticky-sidebar": "3.3.1",
31 "waypoints": "4.0.1",
30 "waypoints": "4.0.1",
32 "webpack": "4.23.1",
31 "webpack": "4.23.1",
33 "webpack-cli": "3.1.2",
32 "webpack-cli": "3.1.2",
34 "babel-core": "^6.26.3",
33 "babel-core": "^6.26.3",
35 "babel-loader": "^7.1.2",
34 "babel-loader": "^7.1.2",
36 "babel-plugin-transform-object-rest-spread": "^6.26.0",
35 "babel-plugin-transform-object-rest-spread": "^6.26.0",
37 "babel-preset-env": "^1.6.0",
36 "babel-preset-env": "^1.6.0",
38 "copy-webpack-plugin": "^4.4.2",
37 "copy-webpack-plugin": "^4.4.2",
39 "css-loader": "^0.28.11",
38 "css-loader": "^0.28.11",
40 "html-loader": "^0.4.4",
39 "html-loader": "^0.4.4",
41 "html-webpack-plugin": "^3.2.0",
40 "html-webpack-plugin": "^3.2.0",
42 "imports-loader": "^0.7.1",
41 "imports-loader": "^0.7.1",
43 "polymer-webpack-loader": "^2.0.1",
42 "polymer-webpack-loader": "^2.0.1",
44 "style-loader": "^0.21.0",
43 "style-loader": "^0.21.0",
45 "webpack-uglify-js-plugin": "^1.1.9",
44 "webpack-uglify-js-plugin": "^1.1.9",
46 "raw-loader": "1.0.0-beta.0",
45 "raw-loader": "1.0.0-beta.0",
47 "ts-loader": "^1.3.3",
46 "ts-loader": "^1.3.3",
48 "@webcomponents/webcomponentsjs": "^2.0.0",
47 "@webcomponents/webcomponentsjs": "^2.0.0",
49 "@polymer/polymer": "^3.0.0",
48 "@polymer/polymer": "^3.0.0",
50 "@polymer/paper-button": "^3.0.0",
49 "@polymer/paper-button": "^3.0.0",
51 "@polymer/paper-spinner": "^3.0.0",
50 "@polymer/paper-spinner": <