nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchzip,
5 python3Packages,
6 makeWrapper,
7}:
8
9with python3Packages;
10
11stdenv.mkDerivation (finalAttrs: {
12 pname = "google-app-engine-go-sdk";
13 version = "1.9.61";
14 src =
15 if stdenv.hostPlatform.system == "x86_64-linux" then
16 fetchzip {
17 url = "https://storage.googleapis.com/appengine-sdks/featured/go_appengine_sdk_linux_amd64-${finalAttrs.version}.zip";
18 sha256 = "1i2j9ympl1218akwsmm7yb31v0gibgpzlb657bcravi1irfv1hhs";
19 }
20 else
21 fetchzip {
22 url = "https://storage.googleapis.com/appengine-sdks/featured/go_appengine_sdk_darwin_amd64-${finalAttrs.version}.zip";
23 sha256 = "0s8sqyc72lnc7dxd4cl559gyfx83x71jjpsld3i3nbp3mwwamczp";
24 };
25
26 nativeBuildInputs = [ makeWrapper ];
27 buildInputs = [ python ];
28
29 installPhase = ''
30 mkdir -p $out/bin $out/share/
31 cp -r "$src" "$out/share/go_appengine"
32
33 # create wrappers with correct env
34 for i in goapp go-app-stager *.py; do
35 makeWrapper "$out/share/go_appengine/$i" "$out/bin/$i" \
36 --prefix PATH : "${python}/bin" \
37 --prefix PYTHONPATH : "$(toPythonPath ${cffi}):$(toPythonPath ${cryptography}):$(toPythonPath ${pyopenssl})"
38 done
39 '';
40
41 meta = {
42 description = "Google App Engine SDK for Go";
43 version = finalAttrs.version;
44 homepage = "https://cloud.google.com/appengine/docs/go/";
45 sourceProvenance = with lib.sourceTypes; [
46 fromSource
47 binaryNativeCode # includes golang toolchain binaries
48 ];
49 license = lib.licenses.asl20;
50 platforms = [
51 "x86_64-linux"
52 "x86_64-darwin"
53 ];
54 maintainers = with lib.maintainers; [ lufia ];
55 };
56})