mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-06 04:53:27 +00:00
571c71e6f7
We are migrating packages that meet below requirements: 1. using `callPackage` 2. called path is a directory 3. overriding set is empty (`{ }`) 4. not containing path expressions other than relative path (to makenixpkgs-vet happy) 5. not referenced by nix files outside of the directory, other than`pkgs/top-level/all-packages.nix` 6. not referencing nix files outside of the directory 7. not referencing `default.nix` (since it's changed to `package.nix`) 8. `outPath` doesn't change after migration The tool is here: https://github.com/Aleksanaa/by-name-migrate.
48 lines
1.5 KiB
Nix
48 lines
1.5 KiB
Nix
{ lib, stdenv, fetchgit, libX11, perl, ... }:
|
|
|
|
stdenv.mkDerivation rec {
|
|
pname = "xbattbar";
|
|
version = "1.4.9";
|
|
|
|
# The current active upstream of xbattbar seems to be the Debian source
|
|
# repository.
|
|
src = fetchgit {
|
|
url = "https://salsa.debian.org/debian/xbattbar.git";
|
|
rev = "upstream/${version}";
|
|
sha256 = "10w7gs0l4hzhdn38yqyr3az7n4ncmfnd6hhhly6lk5dg7k441ck6";
|
|
};
|
|
|
|
buildInputs = [ libX11 ];
|
|
|
|
# The following patches are applied:
|
|
# - sys-by-default: remove the APM checker binary, make the sys checker
|
|
# script the default. Rationale: checking battery status by /proc/apm is
|
|
# extremely oldschool and does not work on NixOS, while the sysfs script
|
|
# does.
|
|
# - perl shebang patches for acpi/sys scripts
|
|
# - unhardcode path to checker scripts
|
|
patchPhase = ''
|
|
patch -p1 < ${./sys-by-default.patch}
|
|
sed -i -e "s,/usr/lib/xbattbar/,$out/libexec/," xbattbar.c
|
|
sed -i -e "s,/usr/bin/perl,${perl}/bin/perl," xbattbar-check-acpi
|
|
sed -i -e "s,/usr/bin/perl,${perl}/bin/perl," xbattbar-check-sys
|
|
'';
|
|
|
|
installPhase = ''
|
|
mkdir -p $out/bin
|
|
mkdir -p $out/libexec
|
|
install -m 0755 xbattbar $out/bin/
|
|
install -m 0755 xbattbar-check-acpi $out/libexec/
|
|
install -m 0755 xbattbar-check-sys $out/libexec/
|
|
'';
|
|
|
|
meta = with lib; {
|
|
description = "Display battery status in X11";
|
|
homepage = "https://salsa.debian.org/debian/xbattbar";
|
|
license = licenses.gpl2Plus;
|
|
platforms = platforms.linux;
|
|
maintainers = [ maintainers.q3k ];
|
|
mainProgram = "xbattbar";
|
|
};
|
|
}
|