2021-08-12 10:55:21 +01:00
|
|
|
{ lib, stdenv, fetchFromGitHub, glfw, freetype, openssl, makeWrapper, upx }:
|
2019-07-29 19:36:27 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "vlang";
|
2021-12-21 20:43:10 +00:00
|
|
|
version = "weekly.2021.51";
|
2019-07-29 19:36:27 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "vlang";
|
|
|
|
repo = "v";
|
2019-09-09 00:38:31 +01:00
|
|
|
rev = version;
|
2021-12-21 20:43:10 +00:00
|
|
|
sha256 = "1jvq3fxckl2jidiigkvclacjxbg5k38268mck7bl1ky1yspgfrnq";
|
2019-07-29 19:36:27 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
vc = fetchFromGitHub {
|
|
|
|
owner = "vlang";
|
|
|
|
repo = "vc";
|
2021-12-21 20:43:10 +00:00
|
|
|
rev = "c8ed2cd82b247e94c33217dba35c420cfc02fef3";
|
|
|
|
sha256 = "1acgx1qp480jmsv1xvqy1zf7iyy90mvg9x1m1b0zrwx09wz4y1cq";
|
2019-07-29 19:36:27 +01:00
|
|
|
};
|
|
|
|
|
2019-10-07 05:02:34 +01:00
|
|
|
propagatedBuildInputs = [ glfw freetype openssl ]
|
2021-01-22 11:25:31 +00:00
|
|
|
++ lib.optional stdenv.hostPlatform.isUnix upx;
|
2019-07-29 19:36:27 +01:00
|
|
|
|
2021-08-12 10:55:21 +01:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
|
|
|
|
makeFlags = [
|
|
|
|
"local=1"
|
|
|
|
"VC=${vc}"
|
|
|
|
# vlang seems to want to write to $HOME/.vmodules , so lets give
|
|
|
|
# it a writable HOME
|
|
|
|
"HOME=$TMPDIR"
|
|
|
|
];
|
2019-07-29 19:36:27 +01:00
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
2019-10-03 21:47:40 +01:00
|
|
|
mkdir -p $out/{bin,lib,share}
|
|
|
|
cp -r examples $out/share
|
2021-06-26 14:02:25 +01:00
|
|
|
cp -r {cmd,vlib,thirdparty} $out/lib
|
|
|
|
mv v $out/lib
|
2019-10-03 21:47:40 +01:00
|
|
|
ln -s $out/lib/v $out/bin/v
|
2021-08-12 10:55:21 +01:00
|
|
|
wrapProgram $out/bin/v --prefix PATH : ${lib.makeBinPath [ stdenv.cc ]}
|
2019-07-29 19:36:27 +01:00
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
2021-01-22 11:25:31 +00:00
|
|
|
meta = with lib; {
|
2019-07-29 19:36:27 +01:00
|
|
|
homepage = "https://vlang.io/";
|
|
|
|
description = "Simple, fast, safe, compiled language for developing maintainable software";
|
|
|
|
license = licenses.mit;
|
2022-04-18 00:13:36 +01:00
|
|
|
maintainers = with maintainers; [ Madouura ];
|
2019-07-29 19:36:27 +01:00
|
|
|
platforms = platforms.all;
|
|
|
|
};
|
|
|
|
}
|