Unverified Commit dcaaa414 authored by Sandro Jäckel's avatar Sandro Jäckel Committed by GitHub
Browse files

thelounge, uptime-kuma: clean up all napi temporary files (#441323)

parents c9132ccc 8a858655
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -8,11 +8,11 @@
  fixup-yarn-lock,
  python3,
  npmHooks,
  cctools,
  sqlite,
  srcOnly,
  buildPackages,
  nixosTests,
  xcbuild,
}:

stdenv.mkDerivation (finalAttrs: {
@@ -47,7 +47,7 @@ stdenv.mkDerivation (finalAttrs: {
    python3.pkgs.distutils
    npmHooks.npmInstallHook
  ]
  ++ lib.optionals stdenv.hostPlatform.isDarwin [ cctools ];
  ++ lib.optionals stdenv.hostPlatform.isDarwin [ xcbuild ];
  buildInputs = [ sqlite ];

  configurePhase = ''
@@ -78,9 +78,10 @@ stdenv.mkDerivation (finalAttrs: {

    # Build the sqlite3 package.
    npm_config_nodedir="${srcOnly nodejs}" npm_config_node_gyp="${buildPackages.nodejs}/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" npm rebuild --verbose --sqlite=${sqlite.dev}
  '';

    # These files seemingly aren't needed, and also might not exist when the Darwin sandbox is disabled?
    rm -rf node_modules/sqlite3/build-tmp-napi-v6/{Release/obj.target,node_sqlite3.target.mk}
  postInstall = ''
    rm -r $out/lib/node_modules/thelounge/node_modules/sqlite3/build/
  '';

  dontNpmPrune = true;
+1 −1
Original line number Diff line number Diff line
@@ -35,7 +35,7 @@ buildNpmPackage rec {
    cp -r dist $out/lib/node_modules/uptime-kuma/

    # remove references to nodejs source
    rm -r $out/lib/node_modules/uptime-kuma/node_modules/@louislam/sqlite3/build-tmp-napi-v6
    rm -r $out/lib/node_modules/uptime-kuma/node_modules/@louislam/sqlite3/build-tmp-napi-v*
  '';

  postFixup = ''