diff options
author | makefu <github@syntax-fehler.de> | 2016-08-21 12:12:13 +0200 |
---|---|---|
committer | makefu <github@syntax-fehler.de> | 2016-08-21 12:12:13 +0200 |
commit | 054475b6230ec357523b9eed143667a11db92966 (patch) | |
tree | dd60906a6b0f6a5d2252536a50044d42e6098915 /krebs/5pkgs/builders.nix | |
parent | 54ccd367175e33c0aab67e8ef46d4d73bcf8183c (diff) | |
parent | 1d9f7b4f2d1a444bb7b19f18efa3bee63c8d3770 (diff) |
Merge remote-tracking branch 'prism/master'
Diffstat (limited to 'krebs/5pkgs/builders.nix')
-rw-r--r-- | krebs/5pkgs/builders.nix | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/krebs/5pkgs/builders.nix b/krebs/5pkgs/builders.nix index 4c087bc44..841543819 100644 --- a/krebs/5pkgs/builders.nix +++ b/krebs/5pkgs/builders.nix @@ -253,5 +253,27 @@ rec { ${pkgs.cabal2nix}/bin/cabal2nix ${path} > $out ''); + writePython2 = name: src: pkgs.runCommand name {} /* sh */ '' + name=${assert types.filename.check name; name} + src=${shell.escape src} + + # syntax check + printf '%s' "$src" > src.py + ${pkgs.python2}/bin/python -m py_compile src.py + + cp src.py "$out" + ''; + + writePython3 = name: src: pkgs.runCommand name {} /* sh */ '' + name=${assert types.filename.check name; name} + src=${shell.escape src} + + # syntax check + printf '%s' "$src" > src.py + ${pkgs.python3}/bin/python -m py_compile src.py + + cp src.py "$out" + ''; + writeSed = makeScriptWriter "${pkgs.gnused}/bin/sed -f"; } |