go: fix build on 18.03
This commit is contained in:
parent
eb684c7618
commit
c89016b006
|
@ -1,25 +1,26 @@
|
|||
{ stdenv, makeWrapper, callPackage, lib, buildEnv, fetchgit, nodePackages, nodejs }:
|
||||
{ stdenv, makeWrapper, lib, buildEnv, fetchgit, nodejs-8_x, pkgs }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
np = (callPackage <nixpkgs/pkgs/top-level/node-packages.nix>) {
|
||||
generated = ./packages.nix;
|
||||
self = np;
|
||||
nodeEnv = import <nixpkgs/pkgs/development/node-packages/node-env.nix> {
|
||||
inherit (pkgs) stdenv python2 utillinux runCommand writeTextFile;
|
||||
nodejs = nodejs-8_x;
|
||||
libtool = if pkgs.stdenv.isDarwin then pkgs.darwin.cctools else null;
|
||||
};
|
||||
|
||||
node_env = buildEnv {
|
||||
name = "node_env";
|
||||
paths = [
|
||||
np.redis
|
||||
np."formidable"
|
||||
];
|
||||
pathsToLink = [ "/lib" ];
|
||||
ignoreCollisions = true;
|
||||
node_env = pkgs.buildEnv {
|
||||
name = "go-node_env";
|
||||
paths = attrValues (import ./node-packages.nix {
|
||||
inherit (pkgs) fetchurl fetchgit;
|
||||
inherit nodeEnv;
|
||||
});
|
||||
};
|
||||
|
||||
in np.buildNodePackage {
|
||||
in stdenv.mkDerivation {
|
||||
packageName = "go";
|
||||
name = "go-shortener";
|
||||
version = "0.0.0";
|
||||
|
||||
src = fetchgit {
|
||||
url = "http://cgit.lassul.us/go/";
|
||||
|
@ -32,10 +33,8 @@ in np.buildNodePackage {
|
|||
"installPhase"
|
||||
];
|
||||
|
||||
deps = (filter (v: nixType v == "derivation") (attrValues np));
|
||||
|
||||
buildInputs = [
|
||||
nodejs
|
||||
nodejs-8_x
|
||||
makeWrapper
|
||||
];
|
||||
|
||||
|
@ -44,14 +43,14 @@ in np.buildNodePackage {
|
|||
|
||||
cp index.js $out/
|
||||
cat > $out/go << EOF
|
||||
${nodejs}/bin/node $out/index.js
|
||||
${nodejs-8_x}/bin/node $out/index.js
|
||||
EOF
|
||||
chmod +x $out/go
|
||||
|
||||
wrapProgram $out/go \
|
||||
--prefix NODE_PATH : ${node_env}/lib/node_modules
|
||||
|
||||
ln -s $out/go /$out/bin/go
|
||||
ln -s $out/go /$out/bin/go
|
||||
'';
|
||||
|
||||
}
|
||||
|
|
76
krebs/5pkgs/simple/go-shortener/node-packages.nix
Normal file
76
krebs/5pkgs/simple/go-shortener/node-packages.nix
Normal file
|
@ -0,0 +1,76 @@
|
|||
# This file has been generated by node2nix 1.5.3. Do not edit!
|
||||
|
||||
{nodeEnv, fetchurl, fetchgit, globalBuildInputs ? []}:
|
||||
|
||||
let
|
||||
sources = {
|
||||
"double-ended-queue-2.1.0-0" = {
|
||||
name = "double-ended-queue";
|
||||
packageName = "double-ended-queue";
|
||||
version = "2.1.0-0";
|
||||
src = fetchurl {
|
||||
url = "https://registry.npmjs.org/double-ended-queue/-/double-ended-queue-2.1.0-0.tgz";
|
||||
sha1 = "103d3527fd31528f40188130c841efdd78264e5c";
|
||||
};
|
||||
};
|
||||
"redis-commands-1.3.5" = {
|
||||
name = "redis-commands";
|
||||
packageName = "redis-commands";
|
||||
version = "1.3.5";
|
||||
src = fetchurl {
|
||||
url = "https://registry.npmjs.org/redis-commands/-/redis-commands-1.3.5.tgz";
|
||||
sha512 = "2q8pai3gf0dczb03jjig3mpaz4j2kvw8icpgf8hp4fryr3d6c0mjkvxxdmlyhainybx4zhgqsw9ghc9p986alzdzd2n2p4cxvr8b0by";
|
||||
};
|
||||
};
|
||||
"redis-parser-2.6.0" = {
|
||||
name = "redis-parser";
|
||||
packageName = "redis-parser";
|
||||
version = "2.6.0";
|
||||
src = fetchurl {
|
||||
url = "https://registry.npmjs.org/redis-parser/-/redis-parser-2.6.0.tgz";
|
||||
sha1 = "52ed09dacac108f1a631c07e9b69941e7a19504b";
|
||||
};
|
||||
};
|
||||
};
|
||||
in
|
||||
{
|
||||
formidable = nodeEnv.buildNodePackage {
|
||||
name = "formidable";
|
||||
packageName = "formidable";
|
||||
version = "1.2.1";
|
||||
src = fetchurl {
|
||||
url = "https://registry.npmjs.org/formidable/-/formidable-1.2.1.tgz";
|
||||
sha512 = "1x0n2rfaiasdjbw1mm7s29z84f68c7iji7lb1gkxvpknvv6q7bwns7z55ijcf4vkh4kvis12rbgaaih49jf9lj53s30mllb1d35bkqn";
|
||||
};
|
||||
buildInputs = globalBuildInputs;
|
||||
meta = {
|
||||
description = "A node.js module for parsing form data, especially file uploads.";
|
||||
homepage = https://github.com/felixge/node-formidable;
|
||||
license = "MIT";
|
||||
};
|
||||
production = true;
|
||||
bypassCache = true;
|
||||
};
|
||||
redis = nodeEnv.buildNodePackage {
|
||||
name = "redis";
|
||||
packageName = "redis";
|
||||
version = "2.8.0";
|
||||
src = fetchurl {
|
||||
url = "https://registry.npmjs.org/redis/-/redis-2.8.0.tgz";
|
||||
sha512 = "3a3044ax6qdvss83xgjfx10h5q91ls0mwgs3wpsnxcdsiipq3cnmqzsh6glyq0r7vsmpw49jp84c2jnfrhi2bgycrkd9hhhf6ia8lrk";
|
||||
};
|
||||
dependencies = [
|
||||
sources."double-ended-queue-2.1.0-0"
|
||||
sources."redis-commands-1.3.5"
|
||||
sources."redis-parser-2.6.0"
|
||||
];
|
||||
buildInputs = globalBuildInputs;
|
||||
meta = {
|
||||
description = "Redis client library";
|
||||
homepage = https://github.com/NodeRedis/node_redis;
|
||||
license = "MIT";
|
||||
};
|
||||
production = true;
|
||||
bypassCache = true;
|
||||
};
|
||||
}
|
|
@ -1,44 +0,0 @@
|
|||
{ self, fetchurl, fetchgit ? null, lib }:
|
||||
|
||||
{
|
||||
by-spec."formidable"."*" =
|
||||
self.by-version."formidable"."1.0.17";
|
||||
by-version."formidable"."1.0.17" = self.buildNodePackage {
|
||||
name = "formidable-1.0.17";
|
||||
version = "1.0.17";
|
||||
bin = false;
|
||||
src = fetchurl {
|
||||
url = "http://registry.npmjs.org/formidable/-/formidable-1.0.17.tgz";
|
||||
name = "formidable-1.0.17.tgz";
|
||||
sha1 = "ef5491490f9433b705faa77249c99029ae348559";
|
||||
};
|
||||
deps = {
|
||||
};
|
||||
optionalDependencies = {
|
||||
};
|
||||
peerDependencies = [];
|
||||
os = [ ];
|
||||
cpu = [ ];
|
||||
};
|
||||
"formidable" = self.by-version."formidable"."1.0.17";
|
||||
by-spec."redis"."*" =
|
||||
self.by-version."redis"."2.1.0";
|
||||
by-version."redis"."2.1.0" = self.buildNodePackage {
|
||||
name = "redis-2.1.0";
|
||||
version = "2.1.0";
|
||||
bin = false;
|
||||
src = fetchurl {
|
||||
url = "http://registry.npmjs.org/redis/-/redis-2.1.0.tgz";
|
||||
name = "redis-2.1.0.tgz";
|
||||
sha1 = "38acb208f90750250f9451219b73ff08ae907f94";
|
||||
};
|
||||
deps = {
|
||||
};
|
||||
optionalDependencies = {
|
||||
};
|
||||
peerDependencies = [];
|
||||
os = [ ];
|
||||
cpu = [ ];
|
||||
};
|
||||
"redis" = self.by-version."redis"."2.1.0";
|
||||
}
|
4
krebs/5pkgs/simple/go-shortener/pkgs.json
Normal file
4
krebs/5pkgs/simple/go-shortener/pkgs.json
Normal file
|
@ -0,0 +1,4 @@
|
|||
[
|
||||
"formidable",
|
||||
"redis"
|
||||
]
|
2
krebs/5pkgs/simple/go-shortener/update.sh
Executable file
2
krebs/5pkgs/simple/go-shortener/update.sh
Executable file
|
@ -0,0 +1,2 @@
|
|||
node2nix -8 -i pkgs.json -c combine.nix
|
||||
rm node-env.nix combine.nix
|
Loading…
Reference in a new issue