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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

49 lines
1.3 KiB
Nix
Raw Normal View History

2022-01-28 20:12:28 +00:00
{ lib, stdenv, fetchurl, python3, installShellFiles }:
2015-11-26 16:28:38 +00:00
stdenv.mkDerivation rec {
2021-12-22 02:37:49 +00:00
version = "2.4.2";
2020-09-22 04:50:04 +00:00
pname = "weather";
2015-11-26 16:28:38 +00:00
2020-09-22 04:50:04 +00:00
src = fetchurl {
url = "http://fungi.yuggoth.org/weather/src/${pname}-${version}.tar.xz";
2021-12-22 02:37:49 +00:00
sha256 = "sha256-qJl5rFDk31Fm+tmR6+Iiihcx6qyd9alHz2L672pNJsc=";
2020-09-22 04:50:04 +00:00
};
2015-11-26 16:28:38 +00:00
2020-09-22 05:45:00 +00:00
nativeBuildInputs = [
installShellFiles
2022-01-28 20:12:28 +00:00
python3.pkgs.wrapPython
2020-09-22 05:45:00 +00:00
];
2020-09-22 05:45:00 +00:00
dontConfigure = true;
dontBuild = true;
2015-11-26 16:28:38 +00:00
2020-09-22 05:45:00 +00:00
# Upstream doesn't provide a setup.py or alike, so we follow:
# http://fungi.yuggoth.org/weather/doc/install.rst#id3
2020-09-22 04:50:04 +00:00
installPhase = ''
2022-01-28 20:12:28 +00:00
site_packages=$out/${python3.sitePackages}
2020-09-22 05:45:00 +00:00
install -Dt $out/bin -m 755 weather
install -Dt $site_packages weather.py
install -Dt $out/share/weather-util \
airports overrides.{conf,log} places slist stations \
zctas zlist zones
install -Dt $out/etc weatherrc
2020-09-22 04:50:04 +00:00
sed -i \
-e "s|/etc|$out/etc|g" \
-e "s|else: default_setpath = \".:~/.weather|&:$out/share/weather-util|" \
$site_packages/weather.py
2020-09-22 05:45:00 +00:00
2020-09-22 04:50:04 +00:00
wrapPythonPrograms
2020-09-22 05:45:00 +00:00
installManPage weather.1 weatherrc.5
2020-09-22 04:50:04 +00:00
'';
2015-11-26 16:28:38 +00:00
meta = with lib; {
2020-09-22 04:50:04 +00:00
homepage = "http://fungi.yuggoth.org/weather";
description = "Quick access to current weather conditions and forecasts";
license = licenses.isc;
maintainers = [ maintainers.matthiasbeyer ];
2020-09-22 05:45:17 +00:00
platforms = platforms.unix;
2020-09-22 04:50:04 +00:00
};
2015-11-26 16:28:38 +00:00
}