Hi!
I’m trying to build Directus, whiched seemed very simple to package as it only has npm dependencies.
However, there is an impure npm package that tries to download a precompiled binary of libvips
during its installation: sharp-0.31.2
.
I saw in its source it can use a local version if found somewhere.
Also sharp seems packaged in nixpkgs, although it’s an anterior version, so it may be possible to correctly package it.
How is it possible to override a specific npm dependency?
Or how can I put the precompiled binary somewhere before sharp install runs, so it will be “locally found”?
Any help much appreciated!
Files:
package.json
:
{
"name": "directus",
"version": "1.0.0",
"description": "",
"scripts": {},
"keywords": [],
"author": "ppom",
"license": "GPL-3",
"dependencies": {
"@directus/sdk": "^10.3.0",
"directus": "^9.21.2",
"sqlite3": "^5.1.2"
}
}
default.nix
:
{ lib, buildNpmPackage, linkFarm, fetchurl }:
buildNpmPackage {
pname = "directus";
version = "9.21.2";
src = linkFarm "directus-source" [
{ name = "package.json"; path = ./package.json; }
{ name = "package-lock.json"; path = ./package-lock.json; }
];
npmDepsHash = "sha256-4qIbxMxX6AaYWJTfqWrl4geaLBCsED5vOeDsUFAa5Fw=";
npmFlags = [ "-loglevel silent" ];
makeCacheWritable = true;
meta = with lib; {
description = "The Modern Data Stack rabbit — Directus is an instant REST+GraphQL API and intuitive no-code data collaboration app for any SQL database";
homepage = "https://directus.io";
license = licenses.gpl3Only;
maintainers = with maintainers; [ ppom ];
};
}
package-lock.json
was generated from a manual npm i
.