Skip to content

Commit

Permalink
fix: automatically add gcc-unwrapped when installing sharp (#1052)
Browse files Browse the repository at this point in the history
* fix: automatically add gcc-unwrapped when installing sharp

* docs: add nixLibs ex to top-level config docs
  • Loading branch information
iloveitaly authored Feb 9, 2024
1 parent f1a1f46 commit 5445005
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/pages/docs/guides/configuring-builds.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ You can easily install additional Nix or Apt packages so that they are available
```toml
[phases.setup]
nixPkgs = ["...", "ffmpeg"] # Install the ffmpeg package from Nix
nixLibs = ["...", "gcc-unwrapped"] # Install the gcc-unwrapped package from Nix and add it to the LD_LIBRARY_PATH
aptPkgs = ["...", "wget"] # Install the wget package with apt-get
```

Expand Down
4 changes: 4 additions & 0 deletions src/providers/node/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@ impl Provider for NodeProvider {
setup.add_nix_pkgs(&[Pkg::new("openssl")]);
}

if NodeProvider::uses_node_dependency(app, "sharp") {
setup.add_pkgs_libs(vec!["gcc-unwrapped".to_string()]);
}

if NodeProvider::uses_node_dependency(app, "puppeteer") {
// https://gist.github.com/winuxue/cfef08e2f5fe9dfc16a1d67a4ad38a01
setup.add_apt_pkgs(vec![
Expand Down

0 comments on commit 5445005

Please sign in to comment.