2022-02-10 20:34:41 +00:00
|
|
|
{ lib, stdenv, fetchurl, python3, installShellFiles }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2024-06-05 15:53:02 +00:00
|
|
|
version = "2.5.0";
|
2020-09-25 04:45:31 +00:00
|
|
|
pname = "weather";
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "http://fungi.yuggoth.org/weather/src/${pname}-${version}.tar.xz";
|
2024-06-05 15:53:02 +00:00
|
|
|
sha256 = "sha256-wn3cpgfrlqntMIiVFh4317DrbGgQ4YRnFz3KHXacTw4=";
|
2020-09-25 04:45:31 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
installShellFiles
|
2022-02-10 20:34:41 +00:00
|
|
|
python3.pkgs.wrapPython
|
2020-09-25 04:45:31 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
dontConfigure = true;
|
|
|
|
dontBuild = true;
|
|
|
|
|
|
|
|
# Upstream doesn't provide a setup.py or alike, so we follow:
|
|
|
|
# http://fungi.yuggoth.org/weather/doc/install.rst#id3
|
|
|
|
installPhase = ''
|
2022-02-10 20:34:41 +00:00
|
|
|
site_packages=$out/${python3.sitePackages}
|
2020-09-25 04:45:31 +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
|
|
|
|
|
|
|
|
sed -i \
|
|
|
|
-e "s|/etc|$out/etc|g" \
|
|
|
|
-e "s|else: default_setpath = \".:~/.weather|&:$out/share/weather-util|" \
|
|
|
|
$site_packages/weather.py
|
|
|
|
|
|
|
|
wrapPythonPrograms
|
|
|
|
|
|
|
|
installManPage weather.1 weatherrc.5
|
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-09-25 04:45:31 +00:00
|
|
|
homepage = "http://fungi.yuggoth.org/weather";
|
|
|
|
description = "Quick access to current weather conditions and forecasts";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "weather";
|
2020-09-25 04:45:31 +00:00
|
|
|
license = licenses.isc;
|
|
|
|
maintainers = [ maintainers.matthiasbeyer ];
|
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
2020-04-24 23:36:52 +00:00
|
|
|
}
|