summary refs log tree commit diff
path: root/pkgs/applications/misc/weather
diff options
context:
space:
mode:
authorJosé Romildo Malaquias <malaquias@gmail.com>2016-03-29 07:12:47 -0300
committerJosé Romildo Malaquias <malaquias@gmail.com>2016-03-29 08:18:46 -0300
commit27eaa3775784fd520a61611e7cab1ef39345115a (patch)
treef293a2dcb454f758b45d20d526cb0a3c3def4d32 /pkgs/applications/misc/weather
parent62c29908da62fc2a11ae68830fea669cd2d4d618 (diff)
downloadnixlib-27eaa3775784fd520a61611e7cab1ef39345115a.tar
nixlib-27eaa3775784fd520a61611e7cab1ef39345115a.tar.gz
nixlib-27eaa3775784fd520a61611e7cab1ef39345115a.tar.bz2
nixlib-27eaa3775784fd520a61611e7cab1ef39345115a.tar.lz
nixlib-27eaa3775784fd520a61611e7cab1ef39345115a.tar.xz
nixlib-27eaa3775784fd520a61611e7cab1ef39345115a.tar.zst
nixlib-27eaa3775784fd520a61611e7cab1ef39345115a.zip
weather: fix file locations, add python dependency
Diffstat (limited to 'pkgs/applications/misc/weather')
-rw-r--r--pkgs/applications/misc/weather/default.nix23
1 files changed, 17 insertions, 6 deletions
diff --git a/pkgs/applications/misc/weather/default.nix b/pkgs/applications/misc/weather/default.nix
index dec18aea961d..192e4406b6d8 100644
--- a/pkgs/applications/misc/weather/default.nix
+++ b/pkgs/applications/misc/weather/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgs }:
+{ stdenv, fetchurl, pythonPackages }:
 
 stdenv.mkDerivation rec {
     version = "2.0";
@@ -9,15 +9,26 @@ stdenv.mkDerivation rec {
         sha256 = "0yil363y9iyr4mkd7xxq0p2260wh50f9i5p0map83k9i5l0gyyl0";
     };
 
+    nativeBuildInputs = [ pythonPackages.wrapPython ];
+
+    buildInputs = [ pythonPackages.python ];
+
     phases = [ "unpackPhase" "installPhase" ];
 
     installPhase = ''
-        mkdir $out/{share,man,bin} -p
-        cp weather{,.py} $out/bin/
-        cp {airports,overrides.{conf,log},places,slist,stations,weatherrc,zctas,zlist,zones} $out/share/
+        site_packages=$out/${pythonPackages.python.sitePackages}
+        mkdir -p $out/{share/{man,weather-util},bin,etc} $site_packages
+        cp weather $out/bin/
+        cp weather.py $site_packages/
         chmod +x $out/bin/weather
-        cp ./weather.1 $out/man/
-        cp ./weatherrc.5 $out/man/
+        cp airports overrides.{conf,log} places slist stations zctas zlist zones $out/share/weather-util/
+        cp weatherrc $out/etc
+        cp weather.1 weatherrc.5 $out/share/man/
+        sed -i \
+          -e "s|/etc|$out/etc|g" \
+          -e "s|else: default_setpath = \".:~/.weather|&:$out/share/weather-util|" \
+          $site_packages/weather.py
+        wrapPythonPrograms
     '';
 
     meta = {