Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 3a887ed60d29
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 0910bb304368
Choose a head ref
  • 1 commit
  • 1 file changed
  • 1 contributor

Commits on Oct 3, 2019

  1. vlang: 0.1.18 -> 0.1.21 (#70297)

    Madouura authored and veprbl committed Oct 3, 2019
    Copy the full SHA
    0910bb3 View commit details
Showing with 18 additions and 13 deletions.
  1. +18 −13 pkgs/development/compilers/vlang/default.nix
31 changes: 18 additions & 13 deletions pkgs/development/compilers/vlang/default.nix
Original file line number Diff line number Diff line change
@@ -1,42 +1,47 @@
{ stdenv, fetchFromGitHub, glfw, freetype, openssl }:
{ stdenv, fetchFromGitHub, glfw, freetype, openssl, upx ? null }:

assert stdenv.hostPlatform.isUnix -> upx != null;

stdenv.mkDerivation rec {
pname = "vlang";
version = "0.1.18";
version = "0.1.21";

src = fetchFromGitHub {
owner = "vlang";
repo = "v";
rev = version;
sha256 = "0js92v2r1h4vaaha3z1spgi7qynlmr9vls41gxp284w4yhnjzv15";
sha256 = "0npd7a7nhd6r9mr99naib9scqk30209hz18nxif27284ckjbl4fk";
};

# V compiler source translated to C for bootstrap.
# Use matching v.c release commit for now, 0.1.21 release is not available.
vc = fetchFromGitHub {
owner = "vlang";
repo = "vc";
rev = version;
sha256 = "0qx1drs1hr94w7vaaq5w8mkq7j1d3biffnmxkyz63yv8573k03bj";
rev = "950a90b6acaebad1c6ddec5486fc54307e38a9cd";
sha256 = "1dh5l2m207rip1xj677hvbp067inw28n70ddz5wxzfpmaim63c0l";
};

enableParallelBuilding = true;
buildInputs = [ glfw freetype openssl ];
buildInputs = [ glfw freetype openssl ]
++ stdenv.lib.optional stdenv.hostPlatform.isUnix upx;

buildPhase = ''
runHook preBuild
cc -std=gnu11 $CFLAGS -w -o v $vc/v.c -lm $LDFLAGS
./v -prod -o v compiler
make thirdparty
./v -prod -cflags `$CFLAGS` -o v compiler
# Exclude thirdparty/vschannel as it is windows-specific.
find thirdparty -path thirdparty/vschannel -prune -o -type f -name "*.c" -execdir cc -std=gnu11 $CFLAGS -w -c {} ';'
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
mkdir -p $out/{bin,lib,share}
cp -r examples $out/share
cp -r {vlib,thirdparty} $out/lib
cp v $out/lib
ln -s $out/lib/v $out/bin/v
runHook postInstall
'';