diff --git a/pkgs/applications/misc/weather/default.nix b/pkgs/applications/misc/weather/default.nix index 69a32430f96..454831a391d 100644 --- a/pkgs/applications/misc/weather/default.nix +++ b/pkgs/applications/misc/weather/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, pythonPackages }: +{ stdenv, fetchurl, pythonPackages, installShellFiles }: stdenv.mkDerivation rec { version = "2.4.1"; @@ -9,26 +9,33 @@ stdenv.mkDerivation rec { sha256 = "0nf680dl7a2vlgavdhj6ljq8a7lkhvr6zghkpzad53vmilxsndys"; }; - nativeBuildInputs = [ pythonPackages.wrapPython ]; + nativeBuildInputs = [ + installShellFiles + pythonPackages.wrapPython + ]; - buildInputs = [ pythonPackages.python ]; - - phases = [ "unpackPhase" "installPhase" ]; + 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 = '' 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/ + 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 ''; meta = with stdenv.lib; {