Unverified Commit 529676f7 authored by Tomodachi94's avatar Tomodachi94 Committed by GitHub
Browse files

node-gyp-build: migrate from nodePackages (#465670)

parents 8bea3195 aee17cd6
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
{
  fetchFromGitHub,
  nodePackages,
  node-gyp-build,
  makeBinaryWrapper,
  nodejs,
  pnpm_10,
@@ -56,7 +56,7 @@ stdenv.mkDerivation (finalAttrs: {
  ++ lib.optionals stdenv.hostPlatform.isDarwin [ cctools ];

  buildInputs = [
    nodePackages.node-gyp-build
    node-gyp-build
  ];

  env.PYTHON = "${python3}/bin/python";
+2 −2
Original line number Diff line number Diff line
@@ -10,7 +10,7 @@
  python3,
  xorg,
  fontconfig,
  nodePackages,
  node-gyp-build,
  ripgrep,
  pkg-config,
  libsecret,
@@ -49,7 +49,7 @@ stdenv.mkDerivation (finalAttrs: {
    (python3.withPackages (ps: with ps; [ packaging ]))
    pkg-config
    nodejs
    nodePackages.node-gyp-build
    node-gyp-build
  ]
  ++ lib.optionals stdenv.hostPlatform.isDarwin [
    xcbuild
+2 −2
Original line number Diff line number Diff line
@@ -4,7 +4,7 @@
  fetchFromGitHub,
  fetchYarnDeps,
  fixup-yarn-lock,
  nodejs,
  node-gyp-build,
  nodejs-slim,
  matrix-sdk-crypto-nodejs,
  nixosTests,
@@ -44,7 +44,7 @@ stdenv.mkDerivation {
    fixup-yarn-lock
    nodejs-slim
    yarn
    nodejs.pkgs.node-gyp-build
    node-gyp-build
  ];

  configurePhase = ''
+49 −0
Original line number Diff line number Diff line
{
  lib,
  stdenv,
  fetchFromGitHub,
  nodejs,
  nix-update-script,

}:
stdenv.mkDerivation (finalAttrs: {
  pname = "node-gyp-build";
  version = "4.8.4";

  src = fetchFromGitHub {
    owner = "prebuild";
    repo = "node-gyp-build";
    tag = "v${finalAttrs.version}";
    hash = "sha256-65EQGGpwL0C8AOhFyf62nVEt4e2pCS0lAv+20kt3Zdk=";
  };

  dontBuild = true;

  buildInputs = [
    nodejs
  ];

  installPhase = ''
    runHook preInstall

    mkdir -p $out/lib/node_modules/node-gyp-build
    mkdir -p $out/bin

    chmod +x ./{bin,build-test,optional}.js
    mv *.js package.json $out/lib/node_modules/node-gyp-build

    ln -s $out/lib/node_modules/node-gyp-build/bin.js $out/bin/node-gyp-build
    ln -s $out/lib/node_modules/node-gyp-build/optional.js $out/bin/node-gyp-build-optional
    ln -s $out/lib/node_modules/node-gyp-build/build-test.js $out/bin/node-gyp-build-test
  '';

  passthru.updateScript = nix-update-script { };

  meta = {
    description = "Build tool and bindings loader for node-gyp that supports prebuilds";
    homepage = "https://github.com/prebuild/node-gyp-build";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ pyrox0 ];
    mainProgram = "node-gyp-build";
  };
})
+1 −0
Original line number Diff line number Diff line
@@ -252,6 +252,7 @@ mapAliases {
  near-cli = throw "'near-cli' has been removed as upstream has deprecated it and archived the source code repo"; # Added 2025-11-10
  neovim = pkgs.neovim-node-client; # added 2024-11-13
  nijs = throw "'nijs' has been removed as it was unmaintained upstream"; # Added 2025-11-14
  inherit (pkgs) node-gyp-build; # Added 2025-11-27
  node-inspector = throw "node-inspector was removed because it was broken"; # added 2023-08-21
  inherit (pkgs) node-gyp; # added 2024-08-13
  inherit (pkgs) node-pre-gyp; # added 2024-08-05
Loading