e0464e4788
In preparation for the deprecation of `stdenv.isX`. These shorthands are not conducive to cross-compilation because they hide the platforms. Darwin might get cross-compilation for which the continued usage of `stdenv.isDarwin` will get in the way One example of why this is bad and especially affects compiler packages https://www.github.com/NixOS/nixpkgs/pull/343059 There are too many files to go through manually but a treewide should get users thinking when they see a `hostPlatform.isX` in a place where it doesn't make sense. ``` fd --type f "\.nix" | xargs sd --fixed-strings "stdenv.is" "stdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "stdenv'.is" "stdenv'.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "clangStdenv.is" "clangStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "gccStdenv.is" "gccStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "stdenvNoCC.is" "stdenvNoCC.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "inherit (stdenv) is" "inherit (stdenv.hostPlatform) is" fd --type f "\.nix" | xargs sd --fixed-strings "buildStdenv.is" "buildStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "effectiveStdenv.is" "effectiveStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "originalStdenv.is" "originalStdenv.hostPlatform.is" ```
58 lines
1.4 KiB
Nix
58 lines
1.4 KiB
Nix
{
|
|
lib,
|
|
fetchFromGitHub,
|
|
buildPythonPackage,
|
|
socat,
|
|
psutil,
|
|
python-hglib,
|
|
pygit2,
|
|
pyuv,
|
|
i3ipc,
|
|
stdenv,
|
|
}:
|
|
|
|
# TODO: bzr support is missing because nixpkgs switched to `breezy`
|
|
|
|
buildPythonPackage rec {
|
|
version = "2.8.4";
|
|
pname = "powerline";
|
|
format = "setuptools";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = pname;
|
|
repo = pname;
|
|
rev = "refs/tags/${version}";
|
|
hash = "sha256-snJrfUvP11lBIy6F0WtqJt9fiYm5jxMwm9u3u5XFO84=";
|
|
};
|
|
|
|
propagatedBuildInputs = [
|
|
socat
|
|
psutil
|
|
python-hglib
|
|
pygit2
|
|
pyuv
|
|
] ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ i3ipc ];
|
|
|
|
# tests are travis-specific
|
|
doCheck = false;
|
|
|
|
postInstall = ''
|
|
install -dm755 "$out/share/fonts/OTF/"
|
|
install -dm755 "$out/etc/fonts/conf.d"
|
|
install -m644 "font/PowerlineSymbols.otf" "$out/share/fonts/OTF/PowerlineSymbols.otf"
|
|
install -m644 "font/10-powerline-symbols.conf" "$out/etc/fonts/conf.d/10-powerline-symbols.conf"
|
|
|
|
install -dm755 "$out/share/fish/vendor_functions.d"
|
|
install -m644 "powerline/bindings/fish/powerline-setup.fish" "$out/share/fish/vendor_functions.d/powerline-setup.fish"
|
|
|
|
cp -ra powerline/bindings/{bash,shell,tcsh,tmux,vim,zsh} $out/share/
|
|
rm $out/share/*/*.py
|
|
'';
|
|
|
|
meta = {
|
|
homepage = "https://github.com/powerline/powerline";
|
|
description = "Ultimate statusline/prompt utility";
|
|
license = lib.licenses.mit;
|
|
};
|
|
}
|