workadventuresrc: waname: { stdenv , autoPatchelfHook , fetchFromGitHub , fetchzip , gcc-unwrapped , yarn2nix-moretea , ... }: let node-protoc-precompiled = fetchzip { name = "node-protoc-precompiled"; url = "https://node-precompiled-binaries.grpc.io/grpc-tools/v1.10.0/linux-x64.tar.gz"; sha256 = "0dl1anpw3610q58mxf7r9dcp768krwvpa4053cjxn5r8b5xfbh4l"; }; node-protoc-patched = stdenv.mkDerivation { name = "node-protoc"; buildInputs = [ gcc-unwrapped.lib ]; nativeBuildInputs = [ autoPatchelfHook ]; dontAutoPatchelf = true; dontUnpack = true; # protoc: symbol lookup error: /nix/store/...-node-protoc/bin/protoc: undefined symbol: , version dontStrip = true; installPhase = '' install -D -m755 ${node-protoc-precompiled}/grpc_node_plugin $out/bin/grpc_node_plugin install -D -m755 ${node-protoc-precompiled}/protoc $out/bin/protoc autoPatchelf $out/bin/{grpc_node_plugin,protoc} : ''; }; in yarn2nix-moretea.mkYarnPackage rec { pname = "workadventuremessages-${waname}"; version = "unstable"; name = pname + "-" + version; src = "${workadventuresrc}/messages"; # NOTE: this is optional and generated dynamically if omitted yarnNix = ./yarn.nix; pkgConfig = { grpc-tools = { postInstall = '' install -D -m755 ${node-protoc-patched}/bin/grpc_node_plugin bin/grpc_node_plugin install -D -m755 ${node-protoc-patched}/bin/protoc bin/protoc ''; }; }; dontStrip = true; buildPhase = '' mkdir -p $out HOME=$TMPDIR yarn --offline run proto ''; distPhase = ":"; installPhase = '' cp -r deps/workadventure-messages/generated $out/ cp -r node_modules $out/ ''; }