google-clasp: init at 2.2.1 (#43376)
* google-clasp: init at version 2.2.1 Useful for developing Google's Apps Scripts. Signed-off-by: Michal Minář <mic.liamg@gmail.com> * fixed license Signed-off-by: Michal Minář <mic.liamg@gmail.com>
This commit is contained in:
parent
8b6b9533ef
commit
f0c12c4795
6
pkgs/development/misc/google-clasp/README.md
Normal file
6
pkgs/development/misc/google-clasp/README.md
Normal file
|
@ -0,0 +1,6 @@
|
|||
## How to update
|
||||
|
||||
1. bump version of `@google/clasp` in [node-packages.json](./node-packages.json)
|
||||
2. run [generate.sh](./generate.sh)
|
||||
3. set the same version in [default.nix](./default.nix)
|
||||
4. build and test it
|
19
pkgs/development/misc/google-clasp/default.nix
Normal file
19
pkgs/development/misc/google-clasp/default.nix
Normal file
|
@ -0,0 +1,19 @@
|
|||
{ stdenv, pkgs }:
|
||||
let
|
||||
version = "2.2.1";
|
||||
in
|
||||
(import ./google-clasp.nix {
|
||||
inherit pkgs;
|
||||
inherit (stdenv.hostPlatform) system;
|
||||
})."@google/clasp-${version}".override rec {
|
||||
preRebuild = ''
|
||||
patch -p1 <<<"${builtins.readFile ./dotf.patch}"
|
||||
'';
|
||||
meta = {
|
||||
description = "Command Line tool for Google Apps Script Projects";
|
||||
homepage = https://developers.google.com/apps-script/guides/clasp;
|
||||
license = stdenv.lib.licenses.asl20;
|
||||
maintainers = [ stdenv.lib.maintainers.michojel ];
|
||||
priority = 100;
|
||||
};
|
||||
}
|
13
pkgs/development/misc/google-clasp/dotf.patch
Normal file
13
pkgs/development/misc/google-clasp/dotf.patch
Normal file
|
@ -0,0 +1,13 @@
|
|||
Index: nodejs/tmp/xcindf87mmqyp0x5blima5q2m9fw3dx3-node__at_google_slash_clasp-2.2.1/lib/node_modules/@google/clasp/src/dotfile.js
|
||||
===================================================================
|
||||
--- clasp.orig/src/dotfile.js
|
||||
+++ clasp/src/dotfile.js
|
||||
@@ -94,7 +94,7 @@ exports.DOTFILE = {
|
||||
return dotf(projectPath ? path_1.default.dirname(projectPath) : exports.DOT.PROJECT.DIR, exports.DOT.PROJECT.NAME);
|
||||
},
|
||||
// Stores {ClaspCredentials}
|
||||
- RC: dotf(exports.DOT.RC.DIR, exports.DOT.RC.NAME),
|
||||
+ RC: dotf.default(exports.DOT.RC.DIR, exports.DOT.RC.NAME),
|
||||
// Stores {ClaspCredentials}
|
||||
RC_LOCAL: function () {
|
||||
var localPath = find_up_1.default.sync(exports.DOT.PROJECT.PATH);
|
9
pkgs/development/misc/google-clasp/generate.sh
Executable file
9
pkgs/development/misc/google-clasp/generate.sh
Executable file
|
@ -0,0 +1,9 @@
|
|||
#!/usr/bin/env nix-shell
|
||||
#! nix-shell -i bash -p nodePackages.node2nix
|
||||
|
||||
set -eu -o pipefail
|
||||
|
||||
exec node2nix --nodejs-10 \
|
||||
-i node-packages.json -o node-packages.nix \
|
||||
-c google-clasp.nix \
|
||||
--no-copy-node-env -e ../../../development/node-packages/node-env.nix
|
17
pkgs/development/misc/google-clasp/google-clasp.nix
Normal file
17
pkgs/development/misc/google-clasp/google-clasp.nix
Normal file
|
@ -0,0 +1,17 @@
|
|||
# This file has been generated by node2nix 1.6.0. Do not edit!
|
||||
|
||||
{pkgs ? import <nixpkgs> {
|
||||
inherit system;
|
||||
}, system ? builtins.currentSystem, nodejs ? pkgs."nodejs-10_x"}:
|
||||
|
||||
let
|
||||
nodeEnv = import ../../node-packages/node-env.nix {
|
||||
inherit (pkgs) stdenv python2 utillinux runCommand writeTextFile;
|
||||
inherit nodejs;
|
||||
libtool = if pkgs.stdenv.isDarwin then pkgs.darwin.cctools else null;
|
||||
};
|
||||
in
|
||||
import ./node-packages.nix {
|
||||
inherit (pkgs) fetchurl fetchgit;
|
||||
inherit nodeEnv;
|
||||
}
|
3
pkgs/development/misc/google-clasp/node-packages.json
Normal file
3
pkgs/development/misc/google-clasp/node-packages.json
Normal file
|
@ -0,0 +1,3 @@
|
|||
[
|
||||
{"@google/clasp": "2.2.1"}
|
||||
]
|
2101
pkgs/development/misc/google-clasp/node-packages.nix
generated
Normal file
2101
pkgs/development/misc/google-clasp/node-packages.nix
generated
Normal file
File diff suppressed because it is too large
Load diff
|
@ -3477,6 +3477,8 @@ in
|
|||
|
||||
google-fonts = callPackage ../data/fonts/google-fonts { };
|
||||
|
||||
google-clasp = callPackage ../development/misc/google-clasp { };
|
||||
|
||||
google-compute-engine = python2.pkgs.google-compute-engine;
|
||||
|
||||
google-compute-engine-oslogin = callPackage ../tools/virtualization/google-compute-engine-oslogin { };
|
||||
|
|
Loading…
Reference in a new issue