mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-10-20 11:11:43 -04: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" ```
34 lines
1.1 KiB
Nix
34 lines
1.1 KiB
Nix
{ lib, stdenv, buildNpmPackage, fetchFromGitHub, cacert }:
|
|
|
|
buildNpmPackage rec {
|
|
pname = "inshellisense";
|
|
version = "0.0.1-rc.16";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "microsoft";
|
|
repo = pname;
|
|
rev = "refs/tags/${version}";
|
|
hash = "sha256-jqLYN251ZvLOjYsSQJmvQ1TupO4jz3Q23aDpKX+Puvs=";
|
|
};
|
|
|
|
npmDepsHash = "sha256-rGUyA0RLnNZ6ocmHPXfBLJ6ZmeeTN9w+TJTtfTQQ24M=";
|
|
|
|
# Needed for dependency `@homebridge/node-pty-prebuilt-multiarch`
|
|
# On Darwin systems the build fails with,
|
|
#
|
|
# npm ERR! ../src/unix/pty.cc:413:13: error: use of undeclared identifier 'openpty'
|
|
# npm ERR! int ret = openpty(&master, &slave, nullptr, NULL, static_cast<winsi ze*>(&winp));
|
|
#
|
|
# when `node-gyp` tries to build the dep. The below allows `npm` to download the prebuilt binary.
|
|
makeCacheWritable = stdenv.hostPlatform.isDarwin;
|
|
nativeBuildInputs = lib.optional stdenv.hostPlatform.isDarwin cacert;
|
|
|
|
meta = with lib; {
|
|
description = "IDE style command line auto complete";
|
|
homepage = "https://github.com/microsoft/inshellisense";
|
|
license = licenses.mit;
|
|
maintainers = [ maintainers.malo ];
|
|
};
|
|
}
|
|
|