mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-26 08:53:21 +00: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" ```
73 lines
1.4 KiB
Nix
73 lines
1.4 KiB
Nix
{
|
|
lib,
|
|
stdenv,
|
|
fetchFromGitHub,
|
|
installShellFiles,
|
|
cmake,
|
|
libxslt,
|
|
docbook_xsl_ns,
|
|
wrapQtAppsHook,
|
|
libusb1,
|
|
qtlocation,
|
|
qtserialport,
|
|
qttools,
|
|
qtbase,
|
|
yaml-cpp,
|
|
}:
|
|
|
|
let
|
|
inherit (stdenv.hostPlatform) isLinux;
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
|
pname = "qdmr";
|
|
version = "0.12.0";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "hmatuschek";
|
|
repo = "qdmr";
|
|
rev = "v${version}";
|
|
hash = "sha256-8NV0+M9eMcvkP3UERDkaimbapTKxB4rYRLbHZjzG4Ws=";
|
|
};
|
|
|
|
nativeBuildInputs = [
|
|
cmake
|
|
libxslt
|
|
wrapQtAppsHook
|
|
installShellFiles
|
|
];
|
|
|
|
buildInputs = [
|
|
libusb1
|
|
qtlocation
|
|
qtserialport
|
|
qttools
|
|
qtbase
|
|
yaml-cpp
|
|
];
|
|
|
|
postPatch = lib.optionalString isLinux ''
|
|
substituteInPlace doc/docbook_man.debian.xsl \
|
|
--replace /usr/share/xml/docbook/stylesheet/docbook-xsl/manpages/docbook\.xsl ${docbook_xsl_ns}/xml/xsl/docbook/manpages/docbook.xsl
|
|
'';
|
|
|
|
cmakeFlags = [
|
|
"-DBUILD_MAN=ON"
|
|
"-DINSTALL_UDEV_RULES=OFF"
|
|
];
|
|
|
|
postInstall = ''
|
|
installManPage doc/dmrconf.1 doc/qdmr.1
|
|
mkdir -p "$out/etc/udev/rules.d"
|
|
cp ${src}/dist/99-qdmr.rules $out/etc/udev/rules.d/
|
|
'';
|
|
|
|
meta = {
|
|
description = "GUI application and command line tool for programming DMR radios";
|
|
homepage = "https://dm3mat.darc.de/qdmr/";
|
|
license = lib.licenses.gpl3Plus;
|
|
maintainers = with lib.maintainers; [ _0x4A6F ];
|
|
platforms = lib.platforms.linux;
|
|
};
|
|
}
|