mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-17 15:22:59 +01:00
vlang: 2022.19 -> 2022.20
This commit is contained in:
parent
0623ef8417
commit
a44de15349
2 changed files with 20 additions and 147 deletions
|
@ -2,21 +2,21 @@
|
|||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "vlang";
|
||||
version = "weekly.2022.19";
|
||||
version = "weekly.2022.20";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "vlang";
|
||||
repo = "v";
|
||||
rev = version;
|
||||
sha256 = "1bl91j3ip3i84jq3wg03sflllxv38sv4dc072r302rl2g9f4dbg6";
|
||||
sha256 = "1isbyfs98bdbm2qjf7q4bqbpsmdiqlavn3gznwr12bkvhnsf4j3x";
|
||||
};
|
||||
|
||||
# Required for bootstrap.
|
||||
vc = fetchFromGitHub {
|
||||
owner = "vlang";
|
||||
repo = "vc";
|
||||
rev = "a298ad7069f6333ef8ab59a616654fc74e04c847";
|
||||
sha256 = "168cgq6451hcgsxzyd8vq11g01642bs5kkwxqh6rz3rnc86ajic0";
|
||||
rev = "167f262866090493650f58832d62d910999dd5a4";
|
||||
sha256 = "1xax8355qkrccjcmx24gcab88xnrqj15mhqy0bgp3v2rb1hw1n3a";
|
||||
};
|
||||
|
||||
# Required for vdoc.
|
||||
|
@ -27,11 +27,6 @@ stdenv.mkDerivation rec {
|
|||
sha256 = "0cawzizr3rjz81blpvxvxrcvcdai1adj66885ss390444qq1fnv7";
|
||||
};
|
||||
|
||||
# vcreate_test.v requires git, so we must disable it.
|
||||
patches = [
|
||||
./disable_vcreate_test.patch
|
||||
];
|
||||
|
||||
propagatedBuildInputs = [ glfw freetype openssl ]
|
||||
++ lib.optional stdenv.hostPlatform.isUnix upx;
|
||||
|
||||
|
@ -42,9 +37,16 @@ stdenv.mkDerivation rec {
|
|||
"VC=${vc}"
|
||||
];
|
||||
|
||||
prePatch = ''
|
||||
preBuild = ''
|
||||
export HOME=$(mktemp -d)
|
||||
cp cmd/tools/vcreate_test.v $HOME/vcreate_test.v
|
||||
'';
|
||||
|
||||
# vcreate_test.v requires git, so we must remove it when building the tools.
|
||||
# vtest.v fails on Darwin, so let's just disable it for now.
|
||||
preInstall = ''
|
||||
mv cmd/tools/vcreate_test.v $HOME/vcreate_test.v
|
||||
'' + lib.optionalString stdenv.isDarwin ''
|
||||
mv cmd/tools/vtest.v $HOME/vtest.v
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
|
@ -64,12 +66,16 @@ stdenv.mkDerivation rec {
|
|||
$out/lib/v -v $out/lib/cmd/tools/vast
|
||||
$out/lib/v -v $out/lib/cmd/tools/vvet
|
||||
|
||||
# Return the pre-patch vcreate_test.v now that we no longer need the alteration.
|
||||
cp $HOME/vcreate_test.v $out/lib/cmd/tools/vcreate_test.v
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
# Return vcreate_test.v and vtest.v, so the user can use it.
|
||||
postInstall = ''
|
||||
cp $HOME/vcreate_test.v $out/lib/cmd/tools/vcreate_test.v
|
||||
'' + lib.optionalString stdenv.isDarwin ''
|
||||
cp $HOME/vtest.v $out/lib/cmd/tools/vtest.v
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
homepage = "https://vlang.io/";
|
||||
description = "Simple, fast, safe, compiled language for developing maintainable software";
|
||||
|
|
|
@ -1,133 +0,0 @@
|
|||
diff --git a/cmd/tools/vcreate_test.v b/cmd/tools/vcreate_test.v
|
||||
index 3d07f4773..de8a202df 100644
|
||||
--- a/cmd/tools/vcreate_test.v
|
||||
+++ b/cmd/tools/vcreate_test.v
|
||||
@@ -2,127 +2,6 @@ import os
|
||||
|
||||
const test_path = 'vcreate_test'
|
||||
|
||||
-fn init_and_check() ? {
|
||||
- os.execute_or_exit('${os.quoted_path(@VEXE)} init')
|
||||
-
|
||||
- assert os.read_file('vcreate_test.v') ? == [
|
||||
- 'module main\n',
|
||||
- 'fn main() {',
|
||||
- " println('Hello World!')",
|
||||
- '}',
|
||||
- '',
|
||||
- ].join_lines()
|
||||
-
|
||||
- assert os.read_file('v.mod') ? == [
|
||||
- 'Module {',
|
||||
- " name: 'vcreate_test'",
|
||||
- " description: ''",
|
||||
- " version: ''",
|
||||
- " license: ''",
|
||||
- ' dependencies: []',
|
||||
- '}',
|
||||
- '',
|
||||
- ].join_lines()
|
||||
-
|
||||
- assert os.read_file('.gitignore') ? == [
|
||||
- '# Binaries for programs and plugins',
|
||||
- 'main',
|
||||
- 'vcreate_test',
|
||||
- '*.exe',
|
||||
- '*.exe~',
|
||||
- '*.so',
|
||||
- '*.dylib',
|
||||
- '*.dll',
|
||||
- 'vls.log',
|
||||
- '',
|
||||
- ].join_lines()
|
||||
-
|
||||
- assert os.read_file('.gitattributes') ? == [
|
||||
- '*.v linguist-language=V text=auto eol=lf',
|
||||
- '*.vv linguist-language=V text=auto eol=lf',
|
||||
- '*.vsh linguist-language=V text=auto eol=lf',
|
||||
- '**/v.mod linguist-language=V text=auto eol=lf',
|
||||
- '',
|
||||
- ].join_lines()
|
||||
-
|
||||
- assert os.read_file('.editorconfig') ? == [
|
||||
- '[*]',
|
||||
- 'charset = utf-8',
|
||||
- 'end_of_line = lf',
|
||||
- 'insert_final_newline = true',
|
||||
- 'trim_trailing_whitespace = true',
|
||||
- '',
|
||||
- '[*.v]',
|
||||
- 'indent_style = tab',
|
||||
- 'indent_size = 4',
|
||||
- '',
|
||||
- ].join_lines()
|
||||
-}
|
||||
-
|
||||
fn test_v_init() ? {
|
||||
- dir := os.join_path(os.temp_dir(), test_path)
|
||||
- os.rmdir_all(dir) or {}
|
||||
- os.mkdir(dir) or {}
|
||||
- defer {
|
||||
- os.rmdir_all(dir) or {}
|
||||
- }
|
||||
- os.chdir(dir) ?
|
||||
-
|
||||
- init_and_check() ?
|
||||
-}
|
||||
-
|
||||
-fn test_v_init_in_git_dir() ? {
|
||||
- dir := os.join_path(os.temp_dir(), test_path)
|
||||
- os.rmdir_all(dir) or {}
|
||||
- os.mkdir(dir) or {}
|
||||
- defer {
|
||||
- os.rmdir_all(dir) or {}
|
||||
- }
|
||||
- os.chdir(dir) ?
|
||||
- os.execute_or_exit('git init .')
|
||||
- init_and_check() ?
|
||||
-}
|
||||
-
|
||||
-fn test_v_init_no_overwrite_gitignore() ? {
|
||||
- dir := os.join_path(os.temp_dir(), test_path)
|
||||
- os.rmdir_all(dir) or {}
|
||||
- os.mkdir(dir) or {}
|
||||
- os.write_file('$dir/.gitignore', 'blah') ?
|
||||
- defer {
|
||||
- os.rmdir_all(dir) or {}
|
||||
- }
|
||||
- os.chdir(dir) ?
|
||||
-
|
||||
- os.execute_or_exit('${os.quoted_path(@VEXE)} init')
|
||||
-
|
||||
- assert os.read_file('.gitignore') ? == 'blah'
|
||||
-}
|
||||
-
|
||||
-fn test_v_init_no_overwrite_gitattributes_and_editorconfig() ? {
|
||||
- git_attributes_content := '*.v linguist-language=V text=auto eol=lf'
|
||||
- editor_config_content := '[*]
|
||||
-charset = utf-8
|
||||
-end_of_line = lf
|
||||
-insert_final_newline = true
|
||||
-trim_trailing_whitespace = true
|
||||
-
|
||||
-[*.v]
|
||||
-indent_style = tab
|
||||
-indent_size = 4
|
||||
-'
|
||||
-
|
||||
- dir := os.join_path(os.temp_dir(), test_path)
|
||||
- os.rmdir_all(dir) or {}
|
||||
- os.mkdir(dir) or {}
|
||||
- os.write_file('$dir/.gitattributes', git_attributes_content) ?
|
||||
- os.write_file('$dir/.editorconfig', editor_config_content) ?
|
||||
- defer {
|
||||
- os.rmdir_all(dir) or {}
|
||||
- }
|
||||
- os.chdir(dir) ?
|
||||
-
|
||||
- os.execute_or_exit('${os.quoted_path(@VEXE)} init')
|
||||
-
|
||||
- assert os.read_file('.gitattributes') ? == git_attributes_content
|
||||
- assert os.read_file('.editorconfig') ? == editor_config_content
|
||||
+ println('vcreate_test disabled')
|
||||
}
|
Loading…
Reference in a new issue