mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-10-20 11:11:43 -04:00
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" ```
40 lines
1.2 KiB
Nix
40 lines
1.2 KiB
Nix
{ lib, stdenv, fetchFromGitHub, fetchpatch, ncurses, pkg-config }:
|
|
|
|
stdenv.mkDerivation rec {
|
|
pname = "tty-clock";
|
|
version = "2.3+unstable=2021-04-07";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "xorg62";
|
|
repo = "tty-clock";
|
|
# Use unreleased version to pull in fix for ncurses-6.3
|
|
rev = "9e00c32098524c30dac4dab701f7e33f8bc7c880";
|
|
sha256 = "14jrzz06jr29887bxgad1x6kd26c2fnqrc26864wqm3838fpcqw0";
|
|
};
|
|
|
|
patches = [
|
|
# Pull upstream patch pending inclusion fir more ncurses-6.3 fixes:
|
|
# https://github.com/xorg62/tty-clock/pull/100
|
|
(fetchpatch {
|
|
name = "ncurses-6.2.patch";
|
|
url = "https://github.com/xorg62/tty-clock/commit/4cfd73080da1964557484da620c401745d73881c.patch";
|
|
sha256 = "13pj1v6yrfc4vynsa746974kixfxxsy2jzzpl73c8bp7msr9d3md";
|
|
})
|
|
];
|
|
|
|
nativeBuildInputs = [ pkg-config ];
|
|
buildInputs = [ ncurses ];
|
|
|
|
makeFlags = [ "PREFIX=$(out)" ];
|
|
|
|
meta = with lib; {
|
|
broken = stdenv.hostPlatform.isDarwin;
|
|
homepage = "https://github.com/xorg62/tty-clock";
|
|
license = licenses.bsd3;
|
|
description = "Digital clock in ncurses";
|
|
platforms = platforms.all;
|
|
maintainers = [ maintainers.koral ];
|
|
mainProgram = "tty-clock";
|
|
};
|
|
}
|