typescript: repackage using buildNpmPackage (#239189)

This commit is contained in:
Mario Rodas 2023-06-26 13:36:12 -05:00 committed by GitHub
parent 89a9b36d69
commit 0bc4547952
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 37 additions and 34 deletions

View file

@ -17,7 +17,7 @@
, git
, autoconf
, libtool
, nodePackages
, typescript
, ApplicationServices
, Carbon
, Cocoa
@ -65,7 +65,7 @@ rustPlatform.buildRustPackage rec {
nativeBuildInputs = [
cmake
git
nodePackages.typescript
typescript
makeWrapper
] ++ lib.optionals stdenv.isLinux [
pkg-config

View file

@ -1,4 +1,4 @@
{ stdenv, lib, fetchFromGitHub, glib, nodePackages, gjs }:
{ stdenv, lib, fetchFromGitHub, glib, gjs, typescript }:
stdenv.mkDerivation rec {
pname = "gnome-shell-extension-pop-shell";
@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
hash = "sha256-w6EBHKWJ4L3ZRVmFqZhCqHGumbElQXk9udYSnwjIl6c=";
};
nativeBuildInputs = [ glib nodePackages.typescript gjs ];
nativeBuildInputs = [ glib gjs typescript ];
buildInputs = [ gjs ];

View file

@ -0,0 +1,24 @@
{ lib, buildNpmPackage, fetchFromGitHub }:
buildNpmPackage rec {
pname = "typescript";
version = "5.1.3";
src = fetchFromGitHub {
owner = "microsoft";
repo = "TypeScript";
rev = "v${version}";
hash = "sha256-c+ZI58Zk6TXwJoWUAXeIMToT+e7Ozdn7hxiDpPjeQJg=";
};
npmDepsHash = "sha256-RHiUhhkzkr2Ra3wc1d13gE2WIZL49w7IEFEAZuBDTDI=";
meta = with lib; {
description = "A superset of JavaScript that compiles to clean JavaScript output";
homepage = "https://github.com/microsoft/TypeScript";
changelog = "https://github.com/microsoft/TypeScript/releases/tag/v${version}";
license = licenses.asl20;
maintainers = [ maintainers.marsam ];
mainProgram = "tsc";
};
}

View file

@ -1034,7 +1034,7 @@ self: super: builtins.intersectAttrs super {
# the testsuite fails because of not finding tsc without some help
aeson-typescript = overrideCabal (drv: {
testToolDepends = drv.testToolDepends or [] ++ [ pkgs.nodePackages.typescript ];
testToolDepends = drv.testToolDepends or [] ++ [ pkgs.typescript ];
# the testsuite assumes that tsc is in the PATH if it thinks it's in
# CI, otherwise trying to install it.
#

View file

@ -47,5 +47,6 @@ mapAliases {
readability-cli = pkgs.readability-cli; # Added 2023-06-12
thelounge = pkgs.thelounge; # Added 2023-05-22
triton = pkgs.triton; # Added 2023-05-06
typescript = pkgs.typescript; # Added 2023-06-21
vscode-langservers-extracted = pkgs.vscode-langservers-extracted; # Added 2023-05-27
}

View file

@ -8,7 +8,6 @@
"@squoosh/cli" = "squoosh-cli";
"@webassemblyjs/cli-1.11.1" = "wasm2wast";
coffee-script = "coffee";
typescript = "tsc";
vue-cli = "vue";
"@withgraphite/graphite-cli" = "gt";

View file

@ -364,7 +364,6 @@
, "tsun"
, "ts-node"
, "ttf2eot"
, "typescript"
, "typescript-language-server"
, "uglify-js"
, "undollar"

View file

@ -142185,24 +142185,6 @@ in
bypassCache = true;
reconstructLock = true;
};
typescript = nodeEnv.buildNodePackage {
name = "typescript";
packageName = "typescript";
version = "5.1.3";
src = fetchurl {
url = "https://registry.npmjs.org/typescript/-/typescript-5.1.3.tgz";
sha512 = "XH627E9vkeqhlZFQuL+UsyAXEnibT0kWR2FWONlr4sTjvxyJYnyefgrkyECLzM5NenmKzRAy2rR/OlYLA1HkZw==";
};
buildInputs = globalBuildInputs;
meta = {
description = "TypeScript is a language for application scale JavaScript development";
homepage = "https://www.typescriptlang.org/";
license = "Apache-2.0";
};
production = true;
bypassCache = true;
reconstructLock = true;
};
typescript-language-server = nodeEnv.buildNodePackage {
name = "typescript-language-server";
packageName = "typescript-language-server";

View file

@ -521,7 +521,7 @@ final: prev: {
nativeBuildInputs = [ pkgs.buildPackages.makeWrapper ];
postInstall = ''
wrapProgram "$out/bin/ts-node" \
--prefix NODE_PATH : ${final.typescript}/lib/node_modules
--prefix NODE_PATH : ${pkgs.typescript}/lib/node_modules
'';
};
@ -529,14 +529,14 @@ final: prev: {
nativeBuildInputs = [ pkgs.buildPackages.makeWrapper ];
postInstall = ''
wrapProgram "$out/bin/tsun" \
--prefix NODE_PATH : ${final.typescript}/lib/node_modules
--prefix NODE_PATH : ${pkgs.typescript}/lib/node_modules
'';
};
typescript-language-server = prev.typescript-language-server.override {
nativeBuildInputs = [ pkgs.buildPackages.makeWrapper ];
postInstall = ''
${pkgs.xorg.lndir}/bin/lndir ${final.typescript} $out
${pkgs.xorg.lndir}/bin/lndir ${pkgs.typescript} $out
'';
};

View file

@ -2,7 +2,7 @@
, withGocode ? true, gocode
, withGodef ? true, godef
, withGotools? true, gotools
, withTypescript ? true, nodePackages
, withTypescript ? true, typescript
, abseil-cpp, boost, llvmPackages
, fixDarwinDylibNames, Cocoa
}:
@ -77,7 +77,7 @@ stdenv.mkDerivation {
ln -sf ${gotools}/bin/gopls $TARGET
'' + lib.optionalString withTypescript ''
TARGET=$out/lib/ycmd/third_party/tsserver
ln -sf ${nodePackages.typescript} $TARGET
ln -sf ${typescript} $TARGET
'';
# fixup the argv[0] and replace __file__ with the corresponding path so

View file

@ -16925,7 +16925,7 @@ with pkgs;
tbox = callPackage ../development/libraries/tbox { };
inherit (nodePackages) typescript;
typescript = callPackage ../development/compilers/typescript { };
bupc = callPackage ../development/compilers/bupc { };
@ -32016,9 +32016,7 @@ with pkgs;
img2pdf = with python3Packages; toPythonApplication img2pdf;
imgbrd-grabber = qt5.callPackage ../applications/graphics/imgbrd-grabber {
typescript = nodePackages.typescript;
};
imgbrd-grabber = qt5.callPackage ../applications/graphics/imgbrd-grabber { };
imgcat = callPackage ../applications/graphics/imgcat { };