nixpkgs/pkgs/by-name/pt/pterm/package.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

49 lines
1.0 KiB
Nix

{ lib
, stdenv
, fetchurl
, libsndfile
, wxGTK32
, SDL
}:
stdenv.mkDerivation rec {
pname = "pterm";
version = "6.0.4";
buildInputs = [ libsndfile SDL wxGTK32 ];
src = fetchurl {
url = "https://www.cyber1.org/download/linux/pterm-${version}.tar.bz2";
hash = "sha256-0OJvoCOGx/a51Ja7n3fOTeQJEcdyn/GhaJ0NtVCyuC8=";
};
patches = [ ./0001-dtnetsubs-remove-null-check.patch ];
preBuild = ''
substituteInPlace Makefile.common Makefile.wxpterm --replace "/bin/echo" "echo"
echo "exit 0" > wxversion.py
'';
hardeningDisable = [ "format" ];
env.PTERMVERSION = "${version}";
installPhase = ''
runHook preInstall
install -Dm755 "pterm" "$out/bin/pterm"
runHook postInstall
'';
meta = with lib; {
description = "terminal emulator for the Cyber1 mainframe-based CYBIS system";
homepage = "https://www.cyber1.org/";
license = licenses.zlib;
maintainers = with maintainers; [ sarcasticadmin ];
mainProgram = "pterm";
platforms = platforms.unix;
broken = stdenv.hostPlatform.isDarwin;
};
}