nixpkgs-suyu/pkgs/applications/misc/weather/default.nix

42 lines
1.3 KiB
Nix
Raw Normal View History

{ stdenv, fetchurl, pythonPackages }:
2015-11-26 17:28:38 +01:00
stdenv.mkDerivation rec {
2020-09-22 06:50:04 +02:00
version = "2.4.1";
pname = "weather";
2015-11-26 17:28:38 +01:00
2020-09-22 06:50:04 +02:00
src = fetchurl {
url = "http://fungi.yuggoth.org/weather/src/${pname}-${version}.tar.xz";
sha256 = "0nf680dl7a2vlgavdhj6ljq8a7lkhvr6zghkpzad53vmilxsndys";
};
2015-11-26 17:28:38 +01:00
2020-09-22 06:50:04 +02:00
nativeBuildInputs = [ pythonPackages.wrapPython ];
2020-09-22 06:50:04 +02:00
buildInputs = [ pythonPackages.python ];
2020-09-22 06:50:04 +02:00
phases = [ "unpackPhase" "installPhase" ];
2015-11-26 17:28:38 +01:00
2020-09-22 06:50:04 +02:00
installPhase = ''
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/
chmod +x $out/bin/weather
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
2020-09-22 06:50:04 +02:00
meta = with stdenv.lib; {
homepage = "http://fungi.yuggoth.org/weather";
description = "Quick access to current weather conditions and forecasts";
license = licenses.isc;
maintainers = [ maintainers.matthiasbeyer ];
platforms = platforms.linux ++ platforms.darwin;
};
2015-11-26 17:28:38 +01:00
}