nix: further nix changes

This commit is contained in:
Marcin Kuzminski 2020-05-19 22:14:26 +02:00
parent d0c3686b17
commit e47479eb95
3 changed files with 41 additions and 24 deletions

View file

@ -79,8 +79,8 @@ let
assert all isString (attrValues sourcesConfig);
sourcesConfig;
version = builtins.readFile "${rhodecode-enterprise-ce-src}/rhodecode/VERSION";
rhodecode-enterprise-ce-src = builtins.filterSource src-filter ./.;
version = builtins.readFile "${rhodecode-enterprise-ce-src}/rhodecode/VERSION";
nodeEnv = import ./pkgs/node-default.nix {
inherit
@ -125,6 +125,12 @@ let
'';
releaseName = "RhodeCodeEnterpriseCE-${version}";
pythonWithEnv =
self.python.buildEnv.override {
extraLibs = [ ] ++ self.rhodecode-enterprise-ce.propagatedBuildInputs;
ignoreCollisions = true;
#--set PYTHONHASHSEED random TODO
};
in super.rhodecode-enterprise-ce.override (attrs: {
inherit
doCheck
@ -145,6 +151,7 @@ let
pythonCommunityOverrides;
pythonPackages = self;
rc_pkgs = pkgs;
};
buildInputs =
@ -211,6 +218,12 @@ let
cp configs/production.ini $out/etc
echo "[DONE ]: saved enterprise-ce production.ini into $out/etc"
echo "saving env in $out/etc/env_vars.txt"
touch $out/etc/env_vars.txt
echo "# RhodeCode build env vars" >> $out/etc/env_vars.txt
echo "LOCALE_ARCHIVE=\"${pkgs.glibcLocales}/lib/locale/locale-archive\"" >> $out/etc/env_vars.txt
echo "LC_ALL=\"en_US.UTF-8\"" >> $out/etc/env_vars.txt
cp -Rf rhodecode/config/rcextensions $out/etc/rcextensions.tmpl
echo "[DONE ]: saved enterprise-ce rcextensions into $out/etc/rcextensions.tmpl"
@ -218,27 +231,21 @@ let
mkdir -p $out/bin
# expose python
ln -s ${self.python}/bin/python $out/bin/
ln -s ${pythonWithEnv}/bin/python $out/bin/
# required binaries from dependencies
ln -s ${self.supervisor}/bin/supervisorctl $out/bin/
ln -s ${self.supervisor}/bin/supervisord $out/bin/
ln -s ${self.pastescript}/bin/paster $out/bin/
ln -s ${self.channelstream}/bin/channelstream $out/bin/
ln -s ${self.celery}/bin/celery $out/bin/
ln -s ${self.gunicorn}/bin/gunicorn $out/bin/
ln -s ${self.pyramid}/bin/prequest $out/bin/
ln -s ${self.pyramid}/bin/pserve $out/bin/
ln -s ${pythonWithEnv}/bin/supervisorctl $out/bin/
ln -s ${pythonWithEnv}/bin/supervisord $out/bin/
ln -s ${pythonWithEnv}/bin/paster $out/bin/
ln -s ${pythonWithEnv}/bin/channelstream $out/bin/
ln -s ${pythonWithEnv}/bin/celery $out/bin/
ln -s ${pythonWithEnv}/bin/gunicorn $out/bin/
ln -s ${pythonWithEnv}/bin/prequest $out/bin/
ln -s ${pythonWithEnv}/bin/pserve $out/bin/
echo "[DONE ]: created symlinks into $out/bin"
DEPS="$out/bin/supervisorctl \
$out/bin/supervisord \
$out/bin/paster \
$out/bin/channelstream \
$out/bin/celery \
$out/bin/gunicorn \
$out/bin/prequest \
$out/bin/pserve"
DEPS="
"
# wrap only dependency scripts, they require to have full PYTHONPATH set
# to be able to import all packages
@ -251,16 +258,16 @@ let
done
echo "[DONE ]: enterprise-ce binary wrapping"
# rhodecode-tools don't need wrapping
ln -s ${self.rhodecode-tools}/bin/rhodecode-* $out/bin/
# expose sources of CE
ln -s $out $out/etc/rhodecode_enterprise_ce_source
# expose static files folder
cp -Rf $out/lib/${self.python.libPrefix}/site-packages/rhodecode/public/ $out/etc/static
chmod 755 -R $out/etc/static
# expose sources of rhodecode-enterprise-ce
ln -s $out $out/etc/rhodecode_enterprise_ce_source
'';
});

View file

@ -14,4 +14,12 @@ rec {
pythonPackages;
};
pip-tools = pythonPackages.pip-tools;
setuptools = pythonPackages.setuptools;
wheel = pythonPackages.wheel;
pip = pythonPackages.pip;
}

View file

@ -26,7 +26,9 @@ pkgs.stdenv.mkDerivation {
buildInputs = [
# Allows to generate python packages
pip2nix.pip2nix
pythonPackages.pip-tools
pip2nix.pip
pip2nix.pip-tools
# compile using ffi
pkgs.libffi
@ -62,10 +64,10 @@ pkgs.stdenv.mkDerivation {
export TMPDIR=/tmp
export LOCALE_ARCHIVE="${pkgs.glibcLocales}/lib/locale/locale-archive"
export LC_ALL="en_US.UTF-8"
export PYCURL_SSL_LIBRARY=openssl
# Custom prompt to distinguish from other dev envs.
export PS1="\n\[\033[1;32m\][pip2nix-generate-shell]$\[\033[0m\] "
export PYCURL_SSL_LIBRARY=openssl
'';
}