Skip to content

Commit

Permalink
nodePackages: fix builds on x86_64-darwin
Browse files Browse the repository at this point in the history
Follow-up to #193337 to fix several x86_64-darwin build failures due to
missing xcrun/xcodebuild
  • Loading branch information
lilyinstarlight authored and Yt committed Sep 30, 2022
1 parent b881869 commit dc642a9
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 5 deletions.
3 changes: 3 additions & 0 deletions pkgs/applications/video/epgstation/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ let
# Workaround for https://github.com/svanderburg/node2nix/issues/275
sed -i -e "s|#!/usr/bin/env node|#! ${nodejs}/bin/node|" node_modules/node-gyp-build/bin.js
# Optional typeorm dependency that does not build on aarch64-linux
rm -r node_modules/oracledb
find . -name package-lock.json -delete
'';

Expand Down
32 changes: 27 additions & 5 deletions pkgs/development/node-packages/overrides.nix
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,17 @@ final: prev: {

bitwarden-cli = prev."@bitwarden/cli".override {
name = "bitwarden-cli";
nativeBuildInputs = [ pkgs.pkg-config ];
buildInputs = with pkgs; [ pixman cairo pango ];
nativeBuildInputs = with pkgs; [
pkg-config
] ++ lib.optionals stdenv.isDarwin [
xcbuild
darwin.apple_sdk.frameworks.CoreText
];
buildInputs = with pkgs; [
pixman
cairo
pango
];
};

bower2nix = prev.bower2nix.override {
Expand Down Expand Up @@ -138,13 +147,14 @@ final: prev: {
# ../../applications/video/epgstation
epgstation = prev."epgstation-../../applications/video/epgstation".override (oldAttrs: {
buildInputs = [ pkgs.postgresql ];
nativeBuildInputs = [ final.node-pre-gyp final.node-gyp-build pkgs.which ];
nativeBuildInputs = [ final.node-pre-gyp final.node-gyp-build pkgs.which ] ++ lib.optionals stdenv.isDarwin [ pkgs.xcbuild ];
meta = oldAttrs.meta // { platforms = lib.platforms.none; };
});

# NOTE: this is a stub package to fetch npm dependencies for
# ../../applications/video/epgstation/client
epgstation-client = prev."epgstation-client-../../applications/video/epgstation/client".override (oldAttrs: {
nativeBuildInputs = lib.optionals stdenv.isDarwin [ pkgs.xcbuild ];
meta = oldAttrs.meta // { platforms = lib.platforms.none; };
});

Expand Down Expand Up @@ -212,7 +222,11 @@ final: prev: {
});

joplin = prev.joplin.override {
nativeBuildInputs = [ pkgs.pkg-config ];
nativeBuildInputs = with pkgs; [
pkg-config
] ++ lib.optionals stdenv.isDarwin [
xcbuild
];
buildInputs = with pkgs; [
# required by sharp
# https://sharp.pixelplumbing.com/install
Expand Down Expand Up @@ -278,6 +292,10 @@ final: prev: {
'';
};

mastodon-bot = prev.mastodon-bot.override {
nativeBuildInputs = lib.optionals stdenv.isDarwin [ pkgs.xcbuild ];
};

mermaid-cli = prev."@mermaid-js/mermaid-cli".override (
if stdenv.isDarwin
then {}
Expand Down Expand Up @@ -495,7 +513,11 @@ final: prev: {
};

thelounge-plugin-giphy = prev.thelounge-plugin-giphy.override {
nativeBuildInputs = [ final.node-pre-gyp ];
nativeBuildInputs = [
final.node-pre-gyp
] ++ lib.optionals stdenv.isDarwin [
pkgs.xcbuild
];
};

thelounge-theme-flat-blue = prev.thelounge-theme-flat-blue.override {
Expand Down

0 comments on commit dc642a9

Please sign in to comment.