##// END OF EJS Templates
Added tag v4.27.1 for changeset 6195da4fc454
Added tag v4.27.1 for changeset 6195da4fc454

File last commit:

r989:4fa1c36e python3
r1001:515c2584 master stable
Show More
default.nix
197 lines | 5.8 KiB | text/x-nix | NixLexer
initial commit
r0 # Nix environment for the community edition
#
# This shall be as lean as possible, just producing the rhodecode-vcsserver
# derivation. For advanced tweaks to pimp up the development environment we use
# "shell.nix" so that it does not have to clutter this file.
nix: updated to 18.03 packages....
r472 args@
build: fix 32bit builds
r639 { system ? builtins.currentSystem
, pythonPackages ? "python27Packages"
initial commit
r0 , pythonExternalOverrides ? self: super: {}
nix: updated to 18.03 packages....
r472 , doCheck ? false
, ...
initial commit
r0 }:
nix: don't allow overriding the import packages. This causes overlays to fail
r571 let
build: fix 32bit builds
r639 pkgs_ = args.pkgs or (import <nixpkgs> { inherit system; });
nix: don't allow overriding the import packages. This causes overlays to fail
r571 in
initial commit
r0
let
nix: don't allow overriding the import packages. This causes overlays to fail
r571 pkgs = import <nixpkgs> {
nix: updated to 18.03 packages....
r472 overlays = [
(import ./pkgs/overlays.nix)
];
nix: use some more consistent formatting
r570 inherit
(pkgs_)
nix: updated to 18.03 packages....
r472 system;
nix: don't allow overriding the import packages. This causes overlays to fail
r571 };
dependencies: bumped git version to 2.9.3
r116
nix: updated to 18.03 packages....
r472 # Works with the new python-packages, still can fallback to the old
# variant.
basePythonPackagesUnfix = basePythonPackages.__unfix__ or (
self: basePythonPackages.override (a: { inherit self; }));
initial commit
r0
nix: updated to 18.03 packages....
r472 # Evaluates to the last segment of a file system path.
basename = path: with pkgs.lib; last (splitString "/" path);
initial commit
r0
nix: updated to 18.03 packages....
r472 # source code filter used as arugment to builtins.filterSource.
initial commit
r0 src-filter = path: type: with pkgs.lib;
let
ext = last (splitString "." path);
in
nix: updated to 18.03 packages....
r472 !builtins.elem (basename path) [
".git" ".hg" "__pycache__" ".eggs" ".idea" ".dev"
nix: don't allow overriding the import packages. This causes overlays to fail
r571 "node_modules" "node_binaries"
nix: updated to 18.03 packages....
r472 "build" "data" "result" "tmp"] &&
!builtins.elem ext ["egg-info" "pyc"] &&
# TODO: johbo: This check is wrong, since "path" contains an absolute path,
# it would still be good to restore it since we want to ignore "result-*".
!hasPrefix "result" path;
initial commit
r0
nix: updated to 18.03 packages....
r472 sources =
let
nix: use some more consistent formatting
r570 inherit
(pkgs.lib)
all
isString
attrValues;
nix: updated to 18.03 packages....
r472 sourcesConfig = pkgs.config.rc.sources or {};
in
# Ensure that sources are configured as strings. Using a path
# would result in a copy into the nix store.
assert all isString (attrValues sourcesConfig);
sourcesConfig;
version = builtins.readFile "${rhodecode-vcsserver-src}/vcsserver/VERSION";
initial commit
r0 rhodecode-vcsserver-src = builtins.filterSource src-filter ./.;
pythonLocalOverrides = self: super: {
nix: updated to 18.03 packages....
r472 rhodecode-vcsserver =
let
releaseName = "RhodeCodeVCSServer-${version}";
in super.rhodecode-vcsserver.override (attrs: {
inherit
doCheck
version;
nix: added custom checkPhase to remove sugar output during package building.
r135
packaging: Include version in name
r18 name = "rhodecode-vcsserver-${version}";
nix: updated to 18.03 packages....
r472 releaseName = releaseName;
initial commit
r0 src = rhodecode-vcsserver-src;
packaging: don't run strip on sources for python packages
r174 dontStrip = true; # prevent strip, we don't need it.
initial commit
r0
nix: updated to 18.03 packages....
r472 # expose following attributed outside
initial commit
r0 passthru = {
pythonPackages = self;
};
nix: updated to 18.03 packages....
r472 propagatedBuildInputs =
attrs.propagatedBuildInputs or [] ++ [
pkgs.git
pkgs.subversion
];
nix-shell: set the LOCALE_ARCHIVE paths so it uses nix-es local-archive instead of the system one.
r496 # set some default locale env variables
LC_ALL = "en_US.UTF-8";
LOCALE_ARCHIVE =
if pkgs.stdenv.isLinux
then "${pkgs.glibcLocales}/lib/locale/locale-archive"
else "";
nix: updated to 18.03 packages....
r472 # Add bin directory to path so that tests can find 'vcsserver'.
initial commit
r0 preCheck = ''
export PATH="$out/bin:$PATH"
'';
nix: updated to 18.03 packages....
r472 # custom check phase for testing
nix: added custom checkPhase to remove sugar output during package building.
r135 checkPhase = ''
runHook preCheck
nix: updated to 18.03 packages....
r472 PYTHONHASHSEED=random py.test -vv -p no:sugar -r xw --cov-config=.coveragerc --cov=vcsserver --cov-report=term-missing vcsserver
nix: added custom checkPhase to remove sugar output during package building.
r135 runHook postCheck
'';
nix: updated to 18.03 packages....
r472 postCheck = ''
echo "Cleanup of vcsserver/tests"
rm -rf $out/lib/${self.python.libPrefix}/site-packages/vcsserver/tests
'';
initial commit
r0 postInstall = ''
nix: updated to 18.03 packages....
r472 echo "Writing vcsserver meta information for rccontrol to nix-support/rccontrol"
initial commit
r0 mkdir -p $out/nix-support/rccontrol
cp -v vcsserver/VERSION $out/nix-support/rccontrol/version
nix: updated to 18.03 packages....
r472 echo "DONE: vcsserver meta information for rccontrol written"
mkdir -p $out/etc
cp configs/production.ini $out/etc
echo "DONE: saved vcsserver production.ini into $out/etc"
initial commit
r0
default.nix:updated format to be consistent with CE package
r226 # python based programs need to be wrapped
nix: updated to 18.03 packages....
r472 mkdir -p $out/bin
packaging: new wrapping logic on binary scripts:...
r567 ln -s ${self.python}/bin/python $out/bin/
initial commit
r0 ln -s ${self.gunicorn}/bin/gunicorn $out/bin/
packaging: new wrapping logic on binary scripts:...
r567 ln -s ${self.pyramid}/bin/prequest $out/bin/
ln -s ${self.pyramid}/bin/pserve $out/bin/
initial commit
r0
# Symlink version control utilities
# We ensure that always the correct version is available as a symlink.
# So that users calling them via the profile path will always use the
packaging: new wrapping logic on binary scripts:...
r567 # correct version. Wrapping is required so those can "import"
# vcsserver python hooks.
nix: updated to 18.03 packages....
r472
initial commit
r0 ln -s ${pkgs.git}/bin/git $out/bin
ln -s ${self.mercurial}/bin/hg $out/bin
ln -s ${pkgs.subversion}/bin/svn* $out/bin
packaging: new wrapping logic on binary scripts:...
r567
nix: updated to 18.03 packages....
r472 echo "DONE: created symlinks into $out/bin"
packaging: new wrapping logic on binary scripts:...
r567 DEPS="$out/bin/*"
initial commit
r0
packaging: new wrapping logic on binary scripts:...
r567 # wrap only dependency scripts, they require to have full PYTHONPATH set
# to be able to import all packages
for file in $DEPS;
default.nix:updated format to be consistent with CE package
r226 do
initial commit
r0 wrapProgram $file \
nix: updated to 18.03 packages....
r472 --prefix PATH : $PATH \
--prefix PYTHONPATH : $PYTHONPATH \
initial commit
r0 --set PYTHONHASHSEED random
done
packaging: new wrapping logic on binary scripts:...
r567
nix: updated to 18.03 packages....
r472 echo "DONE: vcsserver binary wrapping"
default.nix:updated format to be consistent with CE package
r226
initial commit
r0 '';
});
};
nix: updated to 18.03 packages....
r472 basePythonPackages = with builtins;
if isAttrs pythonPackages then
pythonPackages
else
getAttr pythonPackages pkgs;
pythonGeneratedPackages = import ./pkgs/python-packages.nix {
nix: use some more consistent formatting
r570 inherit
pkgs;
inherit
(pkgs)
fetchurl
fetchgit
fetchhg;
nix: updated to 18.03 packages....
r472 };
pythonVCSServerOverrides = import ./pkgs/python-packages-overrides.nix {
nix: use some more consistent formatting
r570 inherit
pkgs
basePythonPackages;
nix: updated to 18.03 packages....
r472 };
initial commit
r0 # Apply all overrides and fix the final package set
nix: updated to 18.03 packages....
r472 myPythonPackagesUnfix = with pkgs.lib;
initial commit
r0 (extends pythonExternalOverrides
(extends pythonLocalOverrides
nix: updated to 18.03 packages....
r472 (extends pythonVCSServerOverrides
(extends pythonGeneratedPackages
basePythonPackagesUnfix))));
myPythonPackages = (pkgs.lib.fix myPythonPackagesUnfix);
initial commit
r0
in myPythonPackages.rhodecode-vcsserver