From c99d4fc4d0bc5343cf7b7e6b94261082e6aefff3 Mon Sep 17 00:00:00 2001 From: Winter Date: Mon, 29 May 2023 11:38:26 -0400 Subject: [PATCH 1/2] thelounge: reorder/cleanup imports --- .../applications/networking/irc/thelounge/default.nix | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pkgs/applications/networking/irc/thelounge/default.nix b/pkgs/applications/networking/irc/thelounge/default.nix index bee360d55e66..2760a73352b5 100644 --- a/pkgs/applications/networking/irc/thelounge/default.nix +++ b/pkgs/applications/networking/irc/thelounge/default.nix @@ -1,4 +1,13 @@ -{ lib, stdenv, fetchFromGitHub, fetchYarnDeps, yarn, fixup_yarn_lock, nodejs, npmHooks, nixosTests }: +{ lib +, stdenv +, fetchFromGitHub +, fetchYarnDeps +, nodejs +, yarn +, fixup_yarn_lock +, npmHooks +, nixosTests +}: stdenv.mkDerivation (finalAttrs: { pname = "thelounge"; From a1cfd90e10d129d093aa5917326718d43d0a3661 Mon Sep 17 00:00:00 2001 From: Winter Date: Mon, 29 May 2023 11:32:51 -0400 Subject: [PATCH 2/2] thelounge: fix sqlite logging Previously, we never actually built the SQLite binding, causing The Lounge to bail when attempting to load SQLite logs [0]. It wasn't caught before because it wasn't thrown fatally, for whatever reason. Perhaps we should fix this in the future with a patch and/or more robust tests, but for now, let's just fix the issue. [0]: https://github.com/NixOS/nixpkgs/pull/233511#issuecomment-1567182450 --- .../networking/irc/thelounge/default.nix | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/networking/irc/thelounge/default.nix b/pkgs/applications/networking/irc/thelounge/default.nix index 2760a73352b5..0ccca903f179 100644 --- a/pkgs/applications/networking/irc/thelounge/default.nix +++ b/pkgs/applications/networking/irc/thelounge/default.nix @@ -5,7 +5,12 @@ , nodejs , yarn , fixup_yarn_lock +, python3 , npmHooks +, darwin +, sqlite +, srcOnly +, buildPackages , nixosTests }: @@ -33,7 +38,8 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-OKLsNGl94EDyLgP2X2tiwihgRQFXGvf5XgXwgX+JEpk="; }; - nativeBuildInputs = [ nodejs yarn fixup_yarn_lock npmHooks.npmInstallHook ]; + nativeBuildInputs = [ nodejs yarn fixup_yarn_lock python3 npmHooks.npmInstallHook ] ++ lib.optional stdenv.isDarwin darwin.cctools; + buildInputs = [ sqlite ]; configurePhase = '' runHook preConfigure @@ -58,8 +64,14 @@ stdenv.mkDerivation (finalAttrs: { # `npm prune` doesn't work and/or hangs for whatever reason. preInstall = '' - rm -rf node_modules yarn install --offline --frozen-lockfile --ignore-platform --ignore-scripts --no-progress --non-interactive --production + patchShebangs node_modules + + # 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} ''; dontNpmPrune = true;