From aaf2ecd801c3fed8a0e69bf1416710fde164ec1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=83=81=E3=83=AB=E3=83=8E?= Date: Mon, 29 Jul 2019 13:36:27 -0500 Subject: [PATCH] vlang: init at 0.1.16 (#63738) --- pkgs/development/compilers/vlang/default.nix | 51 ++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 53 insertions(+) create mode 100644 pkgs/development/compilers/vlang/default.nix diff --git a/pkgs/development/compilers/vlang/default.nix b/pkgs/development/compilers/vlang/default.nix new file mode 100644 index 00000000000..cbccca34b41 --- /dev/null +++ b/pkgs/development/compilers/vlang/default.nix @@ -0,0 +1,51 @@ +{ stdenv, fetchFromGitHub, glfw, freetype, curl }: + +stdenv.mkDerivation rec { + pname = "vlang"; + version = "0.1.16"; + + src = fetchFromGitHub { + owner = "vlang"; + repo = "v"; + rev = "${version}"; + sha256 = "08zgwy9ac3wa5ixy8rdw6izpn1n1c3ydb9rl8z8graw0bgv719ma"; + }; + + # V compiler source translated to C for bootstrap. + vc = fetchFromGitHub { + owner = "vlang"; + repo = "vc"; + rev = "${version}"; + sha256 = "0k6c7v3r3cirypsqbaq10qlgg41v19rsnc1ygam4il2p8rsmfwz3"; + }; + + enableParallelBuilding = true; + buildInputs = [ glfw freetype curl ]; + + buildPhase = '' + runHook preBuild + cc -std=gnu11 -w -o v $vc/v.c -lm + ./v -prod -o v compiler + # -fPIC -pie required for examples/hot_code_reloading + make CFLAGS+="-fPIC -pie" thirdparty + runHook postBuild + ''; + + installPhase = '' + runHook preInstall + mkdir -p $out/{bin,lib/vlang,share/vlang} + cp -r examples $out/share/vlang + cp -r {vlib,thirdparty} $out/lib/vlang + cp v $out/lib/vlang + ln -s $out/lib/vlang/v $out/bin/v + runHook postInstall + ''; + + meta = with stdenv.lib; { + homepage = "https://vlang.io/"; + description = "Simple, fast, safe, compiled language for developing maintainable software"; + license = licenses.mit; + maintainers = with maintainers; [ chiiruno ]; + platforms = platforms.all; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index ec327f8cedd..110cc27e846 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -8264,6 +8264,8 @@ in urweb = callPackage ../development/compilers/urweb { }; + vlang = callPackage ../development/compilers/vlang { }; + inherit (callPackage ../development/compilers/vala { }) vala_0_36 vala_0_38