weather: fix file locations, add python dependency

+17 -6
+17 -6
pkgs/applications/misc/weather/default.nix
··· 1 - { stdenv, fetchurl, pkgs }: 1 + { stdenv, fetchurl, pythonPackages }: 2 2 3 3 stdenv.mkDerivation rec { 4 4 version = "2.0"; ··· 8 8 url = "http://fungi.yuggoth.org/weather/src/${name}.tar.xz"; 9 9 sha256 = "0yil363y9iyr4mkd7xxq0p2260wh50f9i5p0map83k9i5l0gyyl0"; 10 10 }; 11 + 12 + nativeBuildInputs = [ pythonPackages.wrapPython ]; 13 + 14 + buildInputs = [ pythonPackages.python ]; 11 15 12 16 phases = [ "unpackPhase" "installPhase" ]; 13 17 14 18 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/ 18 23 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 21 32 ''; 22 33 23 34 meta = {