2016-03-29 12:12:47 +02:00
|
|
|
{ stdenv, fetchurl, pythonPackages }:
|
2015-11-26 17:28:38 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2017-01-03 14:49:29 +01:00
|
|
|
version = "2.3";
|
2015-11-26 17:28:38 +01:00
|
|
|
name = "weather-${version}";
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "http://fungi.yuggoth.org/weather/src/${name}.tar.xz";
|
2017-01-03 14:49:29 +01:00
|
|
|
sha256 = "0inij30prqqcmzjwcmfzjjn0ya5klv18qmajgxipz1jr3lpqs546";
|
2015-11-26 17:28:38 +01:00
|
|
|
};
|
|
|
|
|
2016-03-29 12:12:47 +02:00
|
|
|
nativeBuildInputs = [ pythonPackages.wrapPython ];
|
|
|
|
|
|
|
|
buildInputs = [ pythonPackages.python ];
|
|
|
|
|
2015-11-26 17:28:38 +01:00
|
|
|
phases = [ "unpackPhase" "installPhase" ];
|
|
|
|
|
|
|
|
installPhase = ''
|
2016-03-29 12:12:47 +02:00
|
|
|
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/
|
2015-11-26 17:28:38 +01:00
|
|
|
chmod +x $out/bin/weather
|
2016-03-29 12:12:47 +02:00
|
|
|
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
|
2015-11-26 17:28:38 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
homepage = "http://fungi.yuggoth.org/weather";
|
|
|
|
description = "Quick access to current weather conditions and forecasts";
|
|
|
|
license = stdenv.lib.licenses.isc;
|
|
|
|
maintainers = [ stdenv.lib.maintainers.matthiasbeyer ];
|
|
|
|
platforms = with stdenv.lib.platforms; linux; # my only platform
|
|
|
|
};
|
|
|
|
}
|