Skip to content

Commit

Permalink
thelounge: fix sqlite logging
Browse files Browse the repository at this point in the history
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]: #233511 (comment)

(cherry picked from commit a1cfd90)
  • Loading branch information
winterqt authored and github-actions[bot] committed Jun 3, 2023
1 parent 3c4e693 commit 18a7da2
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions pkgs/applications/networking/irc/thelounge/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@
, nodejs
, yarn
, fixup_yarn_lock
, python3
, npmHooks
, darwin
, sqlite
, srcOnly
, buildPackages
, nixosTests
}:

Expand Down Expand Up @@ -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
Expand All @@ -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;
Expand Down

0 comments on commit 18a7da2

Please sign in to comment.