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" ```
41 lines
1.1 KiB
Nix
41 lines
1.1 KiB
Nix
{ lib, buildGoModule, fetchFromGitHub, fetchpatch, darwin, alsa-lib, stdenv }:
|
|
|
|
buildGoModule rec {
|
|
pname = "sampler";
|
|
version = "1.1.0";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "sqshq";
|
|
repo = pname;
|
|
rev = "v${version}";
|
|
hash = "sha256-H7QllAqPp35wHeJ405YSfPX3S4lH0/hdQ8Ja2OGLVtE=";
|
|
};
|
|
|
|
patches = [
|
|
# fix build with go 1.17
|
|
(fetchpatch {
|
|
url = "https://github.com/sqshq/sampler/commit/97a4a0ebe396a780d62f50f112a99b27044e832b.patch";
|
|
hash = "sha256-c9nP92YHKvdc156OXgYVoyNNa5TkoFeDa78WxOTR9rM=";
|
|
})
|
|
];
|
|
|
|
vendorHash = "sha256-UZLF/oJbWUKwIPyWcT1QX+rIU5SRnav/3GLq2xT+jgk=";
|
|
|
|
doCheck = false;
|
|
|
|
subPackages = [ "." ];
|
|
|
|
buildInputs = lib.optional stdenv.hostPlatform.isLinux alsa-lib
|
|
++ lib.optionals stdenv.hostPlatform.isDarwin [
|
|
darwin.apple_sdk.frameworks.OpenAL
|
|
];
|
|
|
|
meta = with lib; {
|
|
description = "Tool for shell commands execution, visualization and alerting";
|
|
homepage = "https://sampler.dev";
|
|
license = licenses.gpl3;
|
|
maintainers = with maintainers; [ uvnikita ];
|
|
mainProgram = "sampler";
|
|
};
|
|
}
|