fix pyroscope package

auto-flake-update
Yorick van Pelt 2017-02-01 14:49:55 +01:00
parent 2dacc10290
commit 02305694f8
4 changed files with 53 additions and 81 deletions

View File

@ -27,7 +27,7 @@
#wine = pkgs.wine.override { wineRelease = "staging"; wineBuild = "wineWow"; };
ftb = pkgs.callPackage ./ftb.nix {};
pyroscope = pkgs.callPackage ./pyroscope.nix {};
pyroscope = pkgs.callPackage ./pyroscope {};
peageprint = pkgs.callPackage ./peageprint.nix {};
nottetris2 = pkgs.callPackage ./nottetris2.nix {};
spotify = pkgs.spotify.overrideDerivation (attrs: rec {

View File

@ -1,80 +0,0 @@
let
pkgs = import <nixpkgs> {};
pypkg = pkgs.python27Packages;
in
{ stdenv ? pkgs.stdenv, python27 ? pkgs.python27, fetchFromGitHub ? pkgs.fetchFromGitHub,
virtualenv ? pypkg.virtualenv, lib ? pkgs.lib }:
let
inherit (lib) concatMapStringsSep mapAttrsToList concatStringsSep;
deps = {
# the script fetches two other repos from github
pyrobase = fetchFromGitHub {
owner = "pyroscope";
repo = "pyrobase";
rev = "b9253cb4a8a5781a859e3b1bc79d537d76abc326";
sha256 = "0c2vjjb9bdrd2rx0cys3jzdwr5ljzsh14s18j5np6yg2vdcya35g";
};
auvyon = fetchFromGitHub {
owner = "pyroscope";
repo = "auvyon";
rev = "5115c26f966df03df92a9934580b66c72e23d4e8";
sha256 = "1qhig6xjv62gq4mj8rbhx6ifcffg321444j2fm6j8qk3yv8w5v4c";
};
};
depnames = pkgs.lib.attrNames deps;
outputscripts = ["chtor" "hashcheck" "lstor" "mktor" "pyroadmin" "pyrotorque" "rtcontrol" "rtevent" "rtmv" "rtxmlrpc"];
in
stdenv.mkDerivation {
name = "pyroscope";
version = "0.1.0.0";
src = fetchFromGitHub {
owner = "pyroscope";
repo = "pyrocore";
rev = "75393631130258d477adf3b4c77b2db085447383";
sha256 = "02msqy40n41wzph75m5jiwphqj6wl2szp7izjwdlhrwfmr7cpamz";
};
buildInputs = [ python27 virtualenv ];
patchPhase = ''
patchShebangs src/scripts
'';
# make a virtualenv, install paver in it
# XXX: impure :/
buildPhase = ''
virtualenv --never-download .
bin/pip --no-cache-dir install "paver==1.2.4"
bin/pip --no-cache-dir install "Tempita>=0.5.1"
bin/pip --no-cache-dir install "APScheduler>=2.0.2,<3"
bin/pip --no-cache-dir install "waitress>=0.8.2"
bin/pip --no-cache-dir install "WebOb>=1.2.3"
'' +
(concatStringsSep "\n" (mapAttrsToList (depname: source:
''cp -R ${source} ./${depname}
chmod -R +w ./${depname}
(builtin cd ${depname} && ../bin/paver -q develop -U)
'') deps)) +
''
./bin/paver -q develop -U
./bin/paver bootstrap
'';
# copy the neccesary parts of the virtualenv
installPhase = ''
mkdir -p $out/bin
mkdir -p $out/venv/{lib,bin,src}
cp -R ./lib $out/venv/
install ./bin/python2.7 $out/venv/bin
cp -R src $out/venv/src/pyrocore
${concatMapStringsSep "\n" (x: ''
cp -R ${x}/src $out/venv/src/${x}
'') depnames}
${concatMapStringsSep "\n" (x: "install bin/${x} $out/bin/${x}") outputscripts}
'';
# patch the bin interpreter into the virtualenv and fix the internal .egg-links
fixupPhase =
(concatMapStringsSep "\n" (x: ''
echo -e "$out/venv/src/${x}\n../" > $out/venv/lib/python2.7/site-packages/${x}.egg-link
'') (depnames ++ ["pyrocore"])) + ''
sed -i -e "1 s|.*|#\!$out/venv/bin/python2.7|" $out/bin/*
'';
dontPatchShebangs = true;
}

View File

@ -0,0 +1,39 @@
let pkgs = import <nixpkgs> {};
in
{ fetchurl ? pkgs.fetchurl,
fetchFromGitHub ? pkgs.fetchFromGitHub,
python27Packages ? pkgs.python27Packages }:
with python27Packages;
let
ProxyTypes = buildPythonPackage rec {
name = "ProxyTypes-0.9";
src = pkgs.fetchurl {
url = "https://pypi.python.org/packages/72/bd/24f45710e7e6909b2129332363be2c981179ed2eda1166f18bc2baef98a1/${name}.zip";
sha256 = "03zfq1ib23dc9rq759n43ri2ki6841yjisdcb59jvp5dqww5bcr0";
};
};
pyrobase = buildPythonApplication rec {
name = "pyrobase-0.3";
src = fetchFromGitHub {
repo = "pyrobase"; owner = "pyroscope";
rev = "cf64da5d89df1c1174e0184c63a51a46f2f955fd";
sha256 = "12qn1gx64byi76kkx8p7y5gdrq016fw2s23l4yik0q1hdg2b99y8";
};
patches = [./fix_readme.diff];
buildInputs = [paver];
};
in
buildPythonApplication rec {
name = "pyrocore-0.4.3";
src = fetchFromGitHub {
repo = "pyrocore"; owner = "pyroscope";
rev = "a8d81af33959333a42a95714631c69870b717329";
sha256 = "1fvahnkhh4nj7qy9m4j2c0djmf4ichy29s7b9wkn7ivhlcgv9hs0";
};
doCheck = false;
buildInputs = [python27Packages.paver];
propagatedBuildInputs = [pyrobase ProxyTypes];
}

View File

@ -0,0 +1,13 @@
diff --git a/pavement.py b/pavement.py
index 8b0fab6..c466ce4 100644
--- a/pavement.py
+++ b/pavement.py
@@ -54,7 +54,7 @@ project = dict(
zip_safe = True,
data_files = [
("EGG-INFO", [
- "README", "LICENSE", "debian/changelog",
+ "README.rst", "LICENSE", "debian/changelog",
]),
],