2016-03-29 11:12:47 +01:00
|
|
|
{ stdenv, fetchurl, pythonPackages }:
|
2015-11-26 16:28:38 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2020-09-10 10:01:02 +01:00
|
|
|
version = "2.4.1";
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "weather";
|
2015-11-26 16:28:38 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2019-08-15 13:41:18 +01:00
|
|
|
url = "http://fungi.yuggoth.org/weather/src/${pname}-${version}.tar.xz";
|
2020-09-10 10:01:02 +01:00
|
|
|
sha256 = "0nf680dl7a2vlgavdhj6ljq8a7lkhvr6zghkpzad53vmilxsndys";
|
2015-11-26 16:28:38 +00:00
|
|
|
};
|
|
|
|
|
2016-03-29 11:12:47 +01:00
|
|
|
nativeBuildInputs = [ pythonPackages.wrapPython ];
|
|
|
|
|
|
|
|
buildInputs = [ pythonPackages.python ];
|
|
|
|
|
2015-11-26 16:28:38 +00:00
|
|
|
phases = [ "unpackPhase" "installPhase" ];
|
|
|
|
|
|
|
|
installPhase = ''
|
2016-03-29 11:12:47 +01: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 16:28:38 +00:00
|
|
|
chmod +x $out/bin/weather
|
2016-03-29 11:12:47 +01: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 16:28:38 +00:00
|
|
|
'';
|
|
|
|
|
2020-09-10 10:00:15 +01:00
|
|
|
meta = with stdenv.lib; {
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "http://fungi.yuggoth.org/weather";
|
2015-11-26 16:28:38 +00:00
|
|
|
description = "Quick access to current weather conditions and forecasts";
|
2020-09-10 10:00:15 +01:00
|
|
|
license = licenses.isc;
|
|
|
|
maintainers = [ maintainers.matthiasbeyer ];
|
|
|
|
platforms = platforms.linux; # my only platform
|
2015-11-26 16:28:38 +00:00
|
|
|
};
|
|
|
|
}
|