nixpkgs/pkgs/by-name/fa/fastfetch/package.nix

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

162 lines
3.4 KiB
Nix
Raw Normal View History

{ lib
, stdenv
, fetchFromGitHub
, chafa
, cmake
2023-12-26 02:35:07 +00:00
, darwin
, dbus
, dconf
, ddcutil
, glib
, hwdata
, imagemagick_light
2024-02-04 22:40:33 +00:00
, libXrandr
, libglvnd
, libpulseaudio
2024-02-04 22:40:33 +00:00
, libselinux
, libsepol
, libxcb
, makeBinaryWrapper
, networkmanager
, nix-update-script
, ocl-icd
, opencl-headers
, overrideSDK
2024-02-04 22:40:33 +00:00
, pcre
, pcre2
, pkg-config
2024-02-04 22:40:33 +00:00
, python3
, rpm
, sqlite
, testers
2024-02-04 22:40:33 +00:00
, util-linux
, vulkan-loader
, wayland
, xfce
2024-02-04 22:40:33 +00:00
, xorg
, yyjson
, zlib
2024-02-04 22:34:08 +00:00
, rpmSupport ? false
2024-02-04 22:25:46 +00:00
, vulkanSupport ? true
2024-02-04 22:23:29 +00:00
, waylandSupport ? true
2024-02-04 18:53:52 +00:00
, x11Support ? true
}:
let
stdenv' = if stdenv.isDarwin then overrideSDK stdenv "11.0" else stdenv;
in
stdenv'.mkDerivation (finalAttrs: {
pname = "fastfetch";
2024-04-18 05:00:22 +00:00
version = "2.9.2";
src = fetchFromGitHub {
owner = "fastfetch-cli";
repo = "fastfetch";
rev = finalAttrs.version;
2024-04-18 05:00:22 +00:00
hash = "sha256-SEt/qw8ixlgRY2+fqyCmhqzLVoAw/BMl//JqQxbuB0s=";
};
2024-02-05 13:59:45 +00:00
outputs = [ "out" "man" ];
nativeBuildInputs = [
cmake
makeBinaryWrapper
pkg-config
2024-02-04 22:40:33 +00:00
python3
];
buildInputs = [
chafa
imagemagick_light
2024-02-04 22:40:33 +00:00
pcre
pcre2
sqlite
yyjson
2024-02-04 22:40:33 +00:00
] ++ lib.optionals stdenv.isLinux [
dbus
dconf
ddcutil
glib
hwdata
libpulseaudio
2024-02-04 22:40:33 +00:00
libselinux
libsepol
networkmanager
ocl-icd
opencl-headers
2024-02-04 22:40:33 +00:00
util-linux
zlib
2024-02-04 22:34:08 +00:00
] ++ lib.optionals rpmSupport [
rpm
2024-02-04 22:25:46 +00:00
] ++ lib.optionals vulkanSupport [
vulkan-loader
2024-02-04 22:23:29 +00:00
] ++ lib.optionals waylandSupport [
wayland
2024-02-04 18:53:52 +00:00
] ++ lib.optionals x11Support [
libXrandr
libglvnd
libxcb
2024-02-04 22:40:33 +00:00
xorg.libXau
xorg.libXdmcp
xorg.libXext
2024-02-10 05:47:51 +00:00
] ++ lib.optionals (x11Support && (!stdenv.isDarwin)) [
2024-02-04 18:53:52 +00:00
xfce.xfconf
] ++ lib.optionals stdenv.isDarwin (with darwin.apple_sdk_11_0.frameworks; [
2023-11-02 19:56:52 +00:00
Apple80211
AppKit
2024-02-10 05:47:51 +00:00
AVFoundation
Cocoa
CoreDisplay
CoreVideo
CoreWLAN
DisplayServices
IOBluetooth
MediaRemote
OpenCL
2023-12-26 02:35:07 +00:00
SystemConfiguration
darwin.moltenvk
]);
cmakeFlags = [
2024-02-04 18:53:52 +00:00
(lib.cmakeOptionType "filepath" "CMAKE_INSTALL_SYSCONFDIR" "${placeholder "out"}/etc")
2024-02-04 22:40:33 +00:00
(lib.cmakeBool "ENABLE_DIRECTX_HEADERS" false)
(lib.cmakeBool "ENABLE_DRM" false)
(lib.cmakeBool "ENABLE_IMAGEMAGICK6" false)
(lib.cmakeBool "ENABLE_OSMESA" false)
2024-02-04 18:53:52 +00:00
(lib.cmakeBool "ENABLE_SYSTEM_YYJSON" true)
(lib.cmakeBool "ENABLE_GLX" x11Support)
2024-02-04 22:34:08 +00:00
(lib.cmakeBool "ENABLE_RPM" rpmSupport)
2024-02-04 22:25:46 +00:00
(lib.cmakeBool "ENABLE_VULKAN" x11Support)
2024-02-04 22:23:29 +00:00
(lib.cmakeBool "ENABLE_WAYLAND" waylandSupport)
2024-02-04 18:53:52 +00:00
(lib.cmakeBool "ENABLE_X11" x11Support)
(lib.cmakeBool "ENABLE_XCB" x11Support)
(lib.cmakeBool "ENABLE_XCB_RANDR" x11Support)
(lib.cmakeBool "ENABLE_XFCONF" (x11Support && (!stdenv.isDarwin)))
(lib.cmakeBool "ENABLE_XRANDR" x11Support)
];
postInstall = ''
wrapProgram $out/bin/fastfetch \
--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath finalAttrs.buildInputs}"
wrapProgram $out/bin/flashfetch \
--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath finalAttrs.buildInputs}"
'';
passthru = {
updateScript = nix-update-script { };
tests.version = testers.testVersion {
package = finalAttrs.finalPackage;
command = "fastfetch -v | cut -d '(' -f 1";
version = "fastfetch ${finalAttrs.version}";
};
};
meta = {
description = "Like neofetch, but much faster because written in C";
homepage = "https://github.com/fastfetch-cli/fastfetch";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ gerg-l khaneliman ];
platforms = lib.platforms.all;
mainProgram = "fastfetch";
};
})