mongosh: 1.6.2 -> 1.8.0, use buildNpmPackage
This commit is contained in:
parent
f6f9829f50
commit
2c02d0ba11
@ -1,17 +0,0 @@
|
||||
# This file has been generated by node2nix 1.11.1. Do not edit!
|
||||
|
||||
{pkgs ? import <nixpkgs> {
|
||||
inherit system;
|
||||
}, system ? builtins.currentSystem, nodejs ? pkgs."nodejs-16_x"}:
|
||||
|
||||
let
|
||||
nodeEnv = import ../../node-packages/node-env.nix {
|
||||
inherit (pkgs) stdenv lib python2 runCommand writeTextFile writeShellScript;
|
||||
inherit pkgs nodejs;
|
||||
libtool = if pkgs.stdenv.isDarwin then pkgs.darwin.cctools else null;
|
||||
};
|
||||
in
|
||||
import ./packages.nix {
|
||||
inherit (pkgs) fetchurl nix-gitignore stdenv lib fetchgit;
|
||||
inherit nodeEnv;
|
||||
}
|
@ -1,14 +1,37 @@
|
||||
{ pkgs, stdenv, lib, testers, mongosh }:
|
||||
{ lib
|
||||
, buildNpmPackage
|
||||
, fetchurl
|
||||
, testers
|
||||
, mongosh
|
||||
}:
|
||||
|
||||
let
|
||||
nodePackages = import ./composition.nix {
|
||||
inherit pkgs;
|
||||
inherit (stdenv.hostPlatform) system;
|
||||
};
|
||||
source = builtins.fromJSON (builtins.readFile ./source.json);
|
||||
in
|
||||
nodePackages.mongosh.override {
|
||||
passthru.tests.version = testers.testVersion {
|
||||
package = mongosh;
|
||||
buildNpmPackage {
|
||||
pname = "mongosh";
|
||||
inherit (source) version;
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://registry.npmjs.org/mongosh/-/${source.filename}";
|
||||
hash = source.integrity;
|
||||
};
|
||||
|
||||
postPatch = ''
|
||||
ln -s ${./package-lock.json} package-lock.json
|
||||
'';
|
||||
|
||||
npmDepsHash = source.deps;
|
||||
|
||||
makeCacheWritable = true;
|
||||
dontNpmBuild = true;
|
||||
npmFlags = [ "--omit=optional" ];
|
||||
|
||||
passthru = {
|
||||
tests.version = testers.testVersion {
|
||||
package = mongosh;
|
||||
};
|
||||
updateScript = ./update.sh;
|
||||
};
|
||||
|
||||
meta = with lib; {
|
||||
|
@ -1,13 +0,0 @@
|
||||
#!/usr/bin/env nix-shell
|
||||
#! nix-shell -i bash -p node2nix
|
||||
|
||||
cd "$(dirname "$0")"
|
||||
|
||||
node2nix \
|
||||
--no-copy-node-env \
|
||||
--node-env ../../node-packages/node-env.nix \
|
||||
--input packages.json \
|
||||
--output packages.nix \
|
||||
--composition composition.nix \
|
||||
--strip-optional-dependencies \
|
||||
--nodejs-16
|
3824
pkgs/development/tools/mongosh/package-lock.json
generated
Normal file
3824
pkgs/development/tools/mongosh/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,3 +0,0 @@
|
||||
[
|
||||
"mongosh"
|
||||
]
|
File diff suppressed because it is too large
Load Diff
6
pkgs/development/tools/mongosh/source.json
Normal file
6
pkgs/development/tools/mongosh/source.json
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"version": "1.8.0",
|
||||
"integrity": "sha512-9pHLqfYMWwP1L2t83TK5k6ho1faz+jFD9zXxnTtgnyu0c/uC39nx+tJT9AsxNZpY+GlhshDu1YcJm45f8l3gIw==",
|
||||
"filename": "mongosh-1.8.0.tgz",
|
||||
"deps": "sha256-8v4E9wNv3+JCGm7mUEA+z+g/4X37ACwVsn+9Cv7N+4o="
|
||||
}
|
25
pkgs/development/tools/mongosh/update.sh
Executable file
25
pkgs/development/tools/mongosh/update.sh
Executable file
@ -0,0 +1,25 @@
|
||||
#!/usr/bin/env nix-shell
|
||||
#! nix-shell -i bash -p nodejs libarchive prefetch-npm-deps moreutils
|
||||
# shellcheck shell=bash
|
||||
|
||||
set -exuo pipefail
|
||||
|
||||
cd -- "$(dirname -- "${BASH_SOURCE[0]}")"
|
||||
|
||||
TMPDIR="$(mktemp -d)"
|
||||
trap 'rm -r -- "$TMPDIR"' EXIT
|
||||
|
||||
pushd -- "$TMPDIR"
|
||||
npm pack mongosh --json | jq '.[0] | { version, integrity, filename }' > source.json
|
||||
bsdtar -x -f "$(jq -r .filename source.json)"
|
||||
|
||||
pushd package
|
||||
npm install --omit=optional --package-lock-only
|
||||
popd
|
||||
|
||||
DEPS="$(prefetch-npm-deps package/package-lock.json)"
|
||||
jq ".deps = \"$DEPS\"" source.json | sponge source.json
|
||||
|
||||
popd
|
||||
|
||||
cp -t . -- "$TMPDIR/source.json" "$TMPDIR/package/package-lock.json"
|
Loading…
Reference in New Issue
Block a user