nixpkgs/pkgs/applications/radio/limesuite/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

55 lines
1.3 KiB
Nix

{ lib, stdenv, fetchFromGitHub, cmake
, sqlite, wxGTK32, libusb1, soapysdr
, mesa_glu, libX11, gnuplot, fltk
, GLUT
, withGui ? false
}:
stdenv.mkDerivation rec {
pname = "limesuite";
version = "23.11.0";
src = fetchFromGitHub {
owner = "myriadrf";
repo = "LimeSuite";
rev = "v${version}";
sha256 = "sha256-f1cXrkVCIc1MqTvlCUBFqzHLhIVueybVxipNZRlF2gE=";
};
nativeBuildInputs = [ cmake ];
cmakeFlags = [
"-DOpenGL_GL_PREFERENCE=GLVND"
] ++ lib.optional (!withGui) "-DENABLE_GUI=OFF";
buildInputs = [
libusb1
sqlite
gnuplot
libusb1
soapysdr
] ++ lib.optionals stdenv.hostPlatform.isDarwin [
GLUT
] ++ lib.optionals withGui [
fltk
libX11
mesa_glu
wxGTK32
];
postInstall = ''
install -Dm444 -t $out/lib/udev/rules.d ../udev-rules/64-limesuite.rules
install -Dm444 -t $out/share/limesuite bin/Release/lms7suite_mcu/*
'';
meta = with lib; {
description = "Driver and GUI for LMS7002M-based SDR platforms";
homepage = "https://github.com/myriadrf/LimeSuite";
license = licenses.asl20;
maintainers = with maintainers; [ markuskowa ];
platforms = platforms.unix;
badPlatforms = lib.optionals withGui platforms.darwin; # withGui transitively depends on mesa, which is broken on darwin
};
}