Merge pull request #14292 from romildo/fix.weather

weather: fix file locations, add python dependency
This commit is contained in:
Franz Pletz 2016-03-30 07:30:54 +02:00
commit 315982049f

View file

@ -1,4 +1,4 @@
{ stdenv, fetchurl, pkgs }: { stdenv, fetchurl, pythonPackages }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
version = "2.0"; version = "2.0";
@ -9,15 +9,26 @@ stdenv.mkDerivation rec {
sha256 = "0yil363y9iyr4mkd7xxq0p2260wh50f9i5p0map83k9i5l0gyyl0"; sha256 = "0yil363y9iyr4mkd7xxq0p2260wh50f9i5p0map83k9i5l0gyyl0";
}; };
nativeBuildInputs = [ pythonPackages.wrapPython ];
buildInputs = [ pythonPackages.python ];
phases = [ "unpackPhase" "installPhase" ]; phases = [ "unpackPhase" "installPhase" ];
installPhase = '' installPhase = ''
mkdir $out/{share,man,bin} -p site_packages=$out/${pythonPackages.python.sitePackages}
cp weather{,.py} $out/bin/ mkdir -p $out/{share/{man,weather-util},bin,etc} $site_packages
cp {airports,overrides.{conf,log},places,slist,stations,weatherrc,zctas,zlist,zones} $out/share/ cp weather $out/bin/
cp weather.py $site_packages/
chmod +x $out/bin/weather chmod +x $out/bin/weather
cp ./weather.1 $out/man/ cp airports overrides.{conf,log} places slist stations zctas zlist zones $out/share/weather-util/
cp ./weatherrc.5 $out/man/ 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 = { meta = {