nixpkgs/pkgs/applications/networking/gopher/phetch/default.nix
Artturin e0464e4788 treewide: replace stdenv.is with stdenv.hostPlatform.is
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"
```
2024-09-25 00:04:37 +03:00

58 lines
1.5 KiB
Nix

{ lib
, stdenv
, fetchFromGitHub
, installShellFiles
, rustPlatform
, pkg-config
, openssl
, scdoc
, Security
, which
}:
rustPlatform.buildRustPackage rec {
pname = "phetch";
version = "1.2.0";
outputs = [ "out" "man" ];
src = fetchFromGitHub {
owner = "xvxx";
repo = pname;
rev = "refs/tags/v${version}";
hash = "sha256-J+ka7/B37WzVPPE2Krkd/TIiVwuKfI2QYWmT0JHgBGQ=";
};
cargoHash = "sha256-y3Y5PnZ51Zc3LmVTijUGnb0KaGm28sWOSYxjuM3A1Zk=";
nativeBuildInputs = [ installShellFiles pkg-config scdoc which ];
buildInputs = [ openssl ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ Security ];
postInstall = ''
make manual
installManPage doc/phetch.1
'';
doCheck = true;
meta = with lib; {
description = "Quick lil gopher client for your terminal, written in rust";
mainProgram = "phetch";
longDescription = ''
phetch is a terminal client designed to help you quickly navigate the gophersphere.
- <1MB executable for Linux, Mac, and NetBSD
- Technicolor design (based on GILD)
- No-nonsense keyboard navigation
- Supports Gopher searches, text and menu pages, and downloads
- Save your favorite Gopher sites with bookmarks
- Opt-in history tracking
- Secure Gopher support (TLS)
- Tor support
'';
changelog = "https://github.com/xvxx/phetch/releases/tag/v${version}";
homepage = "https://github.com/xvxx/phetch";
license = licenses.mit;
maintainers = with maintainers; [ felixalbrigtsen ];
};
}