nixpkgs/pkgs/by-name/po/polybar/package.nix

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

117 lines
2.5 KiB
Nix
Raw Normal View History

{ config
, cairo
2021-02-12 12:34:35 +01:00
, cmake
, fetchFromGitHub
, libuv
2021-02-12 12:34:35 +01:00
, libXdmcp
, libpthreadstubs
, libxcb
, pcre
, pkg-config
, python3
2021-04-21 05:10:35 +02:00
, python3Packages # sphinx-build
2021-02-12 12:34:35 +01:00
, lib
, stdenv
, xcbproto
, xcbutil
, xcbutilcursor
, xcbutilimage
, xcbutilrenderutil
, xcbutilwm
, xcbutilxrm
, makeWrapper
, removeReferencesTo
, alsa-lib
2021-04-21 05:22:25 +02:00
, curl
, libmpdclient
, libpulseaudio
, wirelesstools
, libnl
, i3
, jsoncpp
2021-07-13 21:16:20 +02:00
# override the variables ending in 'Support' to enable or disable modules
, alsaSupport ? true
2021-04-21 05:22:25 +02:00
, githubSupport ? false
2021-07-13 21:16:20 +02:00
, mpdSupport ? false
, pulseSupport ? config.pulseaudio or false
, iwSupport ? false
, nlSupport ? true
, i3Support ? false
}:
2023-11-06 00:32:00 +01:00
stdenv.mkDerivation (finalAttrs: {
2021-07-13 21:16:20 +02:00
pname = "polybar";
2023-12-01 20:37:42 +01:00
version = "3.7.1";
2019-04-14 18:26:31 +02:00
2021-07-13 21:16:20 +02:00
src = fetchFromGitHub {
2023-11-06 00:32:00 +01:00
owner = "polybar";
repo = "polybar";
rev = finalAttrs.version;
2023-12-01 20:37:42 +01:00
hash = "sha256-DX648jY1vewl3ImK84gF6/vtcSCg3wtgq6Ie3fCwZoA=";
2021-07-13 21:16:20 +02:00
fetchSubmodules = true;
};
2021-07-13 21:16:20 +02:00
nativeBuildInputs = [
cmake
pkg-config
python3Packages.sphinx
removeReferencesTo
] ++ lib.optional i3Support makeWrapper;
2021-04-21 05:10:35 +02:00
2021-07-13 21:16:20 +02:00
buildInputs = [
cairo
libuv
2021-07-13 21:16:20 +02:00
libXdmcp
libpthreadstubs
libxcb
pcre
python3
xcbproto
xcbutil
xcbutilcursor
xcbutilimage
xcbutilrenderutil
xcbutilwm
xcbutilxrm
] ++ lib.optional alsaSupport alsa-lib
++ lib.optional githubSupport curl
++ lib.optional mpdSupport libmpdclient
++ lib.optional pulseSupport libpulseaudio
++ lib.optional iwSupport wirelesstools
++ lib.optional nlSupport libnl
++ lib.optionals i3Support [ jsoncpp i3 ];
patches = [ ./remove-hardcoded-etc.diff ];
# Replace hardcoded /etc when copying and reading the default config.
postPatch = ''
substituteInPlace CMakeLists.txt --replace "/etc" $out
substituteAllInPlace src/utils/file.cpp
'';
2021-07-13 21:16:20 +02:00
postInstall =
lib.optionalString i3Support ''
2021-07-13 21:16:20 +02:00
wrapProgram $out/bin/polybar \
--prefix PATH : "${i3}/bin"
'';
2018-05-07 01:39:32 +02:00
2021-07-13 21:16:20 +02:00
postFixup = ''
remove-references-to -t ${stdenv.cc} $out/bin/polybar
'';
2021-02-12 12:34:35 +01:00
2021-07-13 21:16:20 +02:00
meta = with lib; {
homepage = "https://polybar.github.io/";
changelog = "https://github.com/polybar/polybar/releases/tag/${version}";
description = "A fast and easy-to-use tool for creating status bars";
longDescription = ''
Polybar aims to help users build beautiful and highly customizable
status bars for their desktop environment, without the need of
having a black belt in shell scripting.
'';
license = licenses.mit;
2023-11-17 11:03:27 +01:00
maintainers = with maintainers; [ afldcr Br1ght0ne moni ckie ];
2021-07-13 21:16:20 +02:00
platforms = platforms.linux;
};
2023-11-06 00:32:00 +01:00
})