nixpkgs/pkgs/by-name/ue/ueberzugpp/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

100 lines
2.0 KiB
Nix

{ lib
, stdenv
, fetchFromGitHub
, cmake
, pkg-config
, openssl
, zeromq
, cppzmq
, tbb_2021_11
, spdlog
, libsodium
, fmt
, vips
, nlohmann_json
, libsixel
, microsoft-gsl
, chafa
, cli11
, libexif
, range-v3
, enableOpencv ? stdenv.hostPlatform.isLinux
, opencv
, enableWayland ? stdenv.hostPlatform.isLinux
, extra-cmake-modules
, wayland
, wayland-protocols
, wayland-scanner
, enableX11 ? stdenv.hostPlatform.isLinux
, xorg
}:
stdenv.mkDerivation rec {
pname = "ueberzugpp";
version = "2.9.6";
src = fetchFromGitHub {
owner = "jstkdng";
repo = "ueberzugpp";
rev = "v${version}";
hash = "sha256-qo9Rwnx6Oh8DRcCBUMS3JVdNyx1iZSB2Z1qfptUoPFQ=";
};
strictDeps = true;
nativeBuildInputs = [
cmake
pkg-config
] ++ lib.optionals enableWayland [
wayland-scanner
];
buildInputs = [
openssl
zeromq
cppzmq
tbb_2021_11
spdlog
libsodium
fmt
vips
nlohmann_json
libsixel
microsoft-gsl
chafa
cli11
libexif
range-v3
] ++ lib.optionals enableOpencv [
opencv
] ++ lib.optionals enableWayland [
extra-cmake-modules
wayland
wayland-protocols
] ++ lib.optionals enableX11 [
xorg.libX11
xorg.xcbutilimage
];
cmakeFlags = lib.optionals (!enableOpencv) [
"-DENABLE_OPENCV=OFF"
] ++ lib.optionals enableWayland [
"-DENABLE_WAYLAND=ON"
] ++ lib.optionals (!enableX11) [
"-DENABLE_X11=OFF"
];
# error: aligned deallocation function of type 'void (void *, std::align_val_t) noexcept' is only available on macOS 10.14 or newer
preBuild = lib.optionalString (stdenv.hostPlatform.isDarwin && lib.versionOlder stdenv.hostPlatform.darwinMinVersion "11.0") ''
export MACOSX_DEPLOYMENT_TARGET=10.14
'';
meta = with lib; {
description = "Drop in replacement for ueberzug written in C++";
homepage = "https://github.com/jstkdng/ueberzugpp";
license = licenses.gpl3Plus;
maintainers = with maintainers; [ aleksana wegank ];
platforms = platforms.unix;
};
}