@@ -1,4 +1,4 @@
1−{ stdenv, fetchurl, pkgs }:
1+{ stdenv, fetchurl, pythonPackages }:
22
33stdenv.mkDerivation rec {
44 version = "2.0";
@@ -9,15 +9,26 @@ stdenv.mkDerivation rec {
99 sha256 = "0yil363y9iyr4mkd7xxq0p2260wh50f9i5p0map83k9i5l0gyyl0";
1010 };
1111
12+ nativeBuildInputs = [ pythonPackages.wrapPython ];
13+
14+ buildInputs = [ pythonPackages.python ];
15+
1216 phases = [ "unpackPhase" "installPhase" ];
1317
1418 installPhase = ''
15− mkdir $out/{share,man,bin} -p
16− cp weather{,.py} $out/bin/
17− cp {airports,overrides.{conf,log},places,slist,stations,weatherrc,zctas,zlist,zones} $out/share/
19+ site_packages=$out/${pythonPackages.python.sitePackages}
20+ mkdir -p $out/{share/{man,weather-util},bin,etc} $site_packages
21+ cp weather $out/bin/
22+ cp weather.py $site_packages/
1823 chmod +x $out/bin/weather
19− cp ./weather.1 $out/man/
20− cp ./weatherrc.5 $out/man/
24+ cp airports overrides.{conf,log} places slist stations zctas zlist zones $out/share/weather-util/
25+ cp weatherrc $out/etc
26+ cp weather.1 weatherrc.5 $out/share/man/
27+ sed -i \
28+ -e "s|/etc|$out/etc|g" \
29+ -e "s|else: default_setpath = \".:~/.weather|&:$out/share/weather-util|" \
30+ $site_packages/weather.py
31+ wrapPythonPrograms
2132 '';
2233
2334 meta = {