From 7741e4462cf0adad32066b2eac234d2f6680186f Mon Sep 17 00:00:00 2001 From: Okina Matara Date: Sun, 8 Dec 2019 01:00:34 -0600 Subject: [PATCH] tinygo: init at 0.10.0 --- pkgs/development/compilers/tinygo/default.nix | 35 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 5 +++ 2 files changed, 40 insertions(+) create mode 100644 pkgs/development/compilers/tinygo/default.nix diff --git a/pkgs/development/compilers/tinygo/default.nix b/pkgs/development/compilers/tinygo/default.nix new file mode 100644 index 000000000000..015c955000c2 --- /dev/null +++ b/pkgs/development/compilers/tinygo/default.nix @@ -0,0 +1,35 @@ +{ lib, buildGoModule, fetchFromGitHub, llvm, clang-unwrapped, lld, avrgcc +, avrdude, openocd, gcc-arm-embedded, makeWrapper }: + +buildGoModule rec { + pname = "tinygo"; + version = "0.10.0"; + + src = fetchFromGitHub { + owner = "tinygo-org"; + repo = "tinygo"; + rev = "v${version}"; + sha256 = "03di8500dqk25giiajglcdf2gbc0jidsn8qsw2sxmkmnd1np7gyd"; + }; + + modSha256 = "0r3lfi1bj550sf3b7ysz62c2c33f8zfli8208xixj3jadycb6r3z"; + enableParallelBuilding = true; + subPackages = [ "." ]; + buildInputs = [ llvm clang-unwrapped makeWrapper ]; + propagatedBuildInputs = [ lld avrgcc avrdude openocd gcc-arm-embedded ]; + + postInstall = '' + mkdir -p $out/share/tinygo + cp -a lib src targets $out/share/tinygo + wrapProgram $out/bin/tinygo --prefix "TINYGOROOT" : "$out/share/tinygo" + ln -sf $out/bin $out/share/tinygo + ''; + + meta = with lib; { + homepage = "https://tinygo.org/"; + description = "Go compiler for small places"; + license = licenses.bsd3; + maintainers = with maintainers; [ chiiruno ]; + platforms = platforms.all; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 89883bc04730..4940e901827b 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -8808,6 +8808,11 @@ in tinycc = callPackage ../development/compilers/tinycc { }; + tinygo = callPackage ../development/compilers/tinygo { + inherit (llvmPackages_9) llvm clang-unwrapped lld; + avrgcc = pkgsCross.avr.buildPackages.gcc; + }; + tinyscheme = callPackage ../development/interpreters/tinyscheme { stdenv = gccStdenv; };