diff --git a/Installer/os_clang_format_style_file b/Installer/os_clang_format_style_file index 180bf4f..4e5604a 100644 --- a/Installer/os_clang_format_style_file +++ b/Installer/os_clang_format_style_file @@ -1,37 +1,459 @@ -{ - AccessModifierOffset: -4, # 1 tab - AlignAfterOpenBracket: true, - AlignConsecutiveAssignments: true, - AlignConsecutiveDeclarations: true, - AlignTrailingComments: true, - AllowAllParametersOfDeclarationOnNextLine: true, - AllowShortBlocksOnASingleLine: false, - AllowShortIfStatementsOnASingleLine: true, - AllowShortLoopsOnASingleLine: false, - AllowShortCaseLabelsOnASingleLine: true, - AlwaysBreakAfterDefinitionReturnType: false, - AlwaysBreakBeforeMultilineStrings: true, - AlwaysBreakTemplateDeclarations: true, - BinPackArguments: false, - BinPackParameters: false, - BreakBeforeBraces: Allman, - BreakConstructorInitializersBeforeComma: true, - ColumnLimit: 120, - ConstructorInitializerIndentWidth: 0, - Cpp11BracedListStyle: true, - IndentCaseLabels: true, - IndentFunctionDeclarationAfterType: false, - IndentWidth: 4, # 1 tab - MaxEmptyLinesToKeep: 1, - NamespaceIndentation: None, - PointerBindsToType: false, - SpaceBeforeAssignmentOperators: true, - SpaceInEmptyParentheses: false, - SpacesBeforeTrailingComments: 1, - SpacesInAngles: false, - SpacesInCStyleCastParentheses: false, - SpacesInParentheses: false, - SpacesInSquareBrackets: false, - Standard: Cpp11, - TabWidth: 4, -} +--- +IndentWidth: 4 +TabWidth: 4 +--- +Language: Cpp + +# Align parameters on the open bracket, e.g.: +# someLongFunction(argument1, +# argument2); +AlignAfterOpenBracket: Align + +# Align array column and left justify the columns e.g.: +# struct test demo[] = +# { +# {56, 23, "hello"}, +# {-1, 93463, "world"}, +# {7, 5, "!!" } +# }; +AlignArrayOfStructures: Left + +# Align assignments on consecutive lines. This will result in formattings like: +# +# int a = 1; +# int somelongname = 2; +# double c = 3; +# +# int d = 3; +# /* A comment. */ +# double e = 4; +AlignConsecutiveAssignments: Consecutive +AlignConsecutiveBitFields: Consecutive +AlignConsecutiveDeclarations: Consecutive +AlignConsecutiveMacros: Consecutive + +# Align escaped newlines as far left as possible. +# #define A \ +# int aaaa; \ +# int b; \ +# int dddddddddd; +AlignEscapedNewlines: Left + +# Horizontally align operands of binary and ternary expressions. +# Specifically, this aligns operands of a single expression that needs to be +# split over multiple lines, e.g.: +# +# int aaa = bbbbbbbbbbbbbbb + +# ccccccccccccccc; +AlignOperands: Align + +# true: false: +# int a; // My comment a vs. int a; // My comment a +# int b = 2; // comment b int b = 2; // comment about b +AlignTrailingComments: true + +# If the function declaration doesn’t fit on a line, allow putting all +# parameters of a function declaration onto the next line even if +# BinPackParameters is false. +# +# true: +# void myFunction( +# int a, int b, int c, int d, int e); +# +# false: +# void myFunction(int a, +# int b, +# int c, +# int d, +# int e); +AllowAllParametersOfDeclarationOnNextLine: false +AllowShortBlocksOnASingleLine: Never # "while (true) { continue; }" can be put on a single line. + +# If true, short case labels will be contracted to a single line. +# +# true: false: +# switch (a) { vs. switch (a) { +# case 1: x = 1; break; case 1: +# case 2: return; x = 1; +# } break; +# case 2: +# return; +# } +AllowShortCaseLabelsOnASingleLine: true +AllowShortEnumsOnASingleLine: true # enum { A, B } myEnum; + +# Only merge functions defined inside a class. Implies “empty”. +# +# class Foo { +# void f() { foo(); } +# }; +# void f() { +# foo(); +# } +# void f() {} +AllowShortFunctionsOnASingleLine: Inline +AllowShortIfStatementsOnASingleLine: false + +# Only merge empty lambdas. +# +# auto lambda = [](int a) {} +# auto lambda2 = [](int a) { +# return a; +# }; +AllowShortLambdasOnASingleLine: Empty +AllowShortLoopsOnASingleLine: false + +# true: false: +# aaaa = vs. aaaa = "bbbb" +# "bbbb" "cccc"; +# "cccc"; +AlwaysBreakBeforeMultilineStrings: true + +# Force break after template declaration only when the following declaration +# spans multiple lines. +# +# template T foo() { +# } +# template +# T foo(int aaaaaaaaaaaaaaaaaaaaa, +# int bbbbbbbbbbbbbbbbbbbbb) { +# } +AlwaysBreakTemplateDeclarations: MultiLine + +# If false, a function call’s arguments will either be all on the same line or +# will have one line each. +# +# true: +# void f() { +# f(aaaaaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaaaaaa, +# aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa); +# } +# +# false: +# void f() { +# f(aaaaaaaaaaaaaaaaaaaa, +# aaaaaaaaaaaaaaaaaaaa, +# aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa); +# } +BinPackArguments: false +BinPackParameters: false # As BinPackArguments but for function definition parameters + +# Add space after the : only (space may be added before if needed for +# AlignConsecutiveBitFields). +# +# unsigned bf: 2; +BitFieldColonSpacing: After + +# LooooooooooongType loooooooooooooooooooooongVariable = +# someLooooooooooooooooongFunction(); +# +# bool value = aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + +# aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa == +# aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa && +# aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa > +# ccccccccccccccccccccccccccccccccccccccccc; +BreakBeforeBinaryOperators: None + +# Always attach braces to surrounding context, but break before braces on +# function, namespace and class definitions. +BreakBeforeBraces: Linux + +# true: +# template +# concept ... +# +# false: +# template concept ... +BreakBeforeConceptDeclarations: false + +# true: +# veryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLongDescription +# ? firstValue +# : SecondValueVeryVeryVeryVeryLong; +# +# false: +# veryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLongDescription ? +# firstValue : +# SecondValueVeryVeryVeryVeryLong; +BreakBeforeTernaryOperators: true + +# Break constructor initializers before the colon and commas, and align the +# commas with the colon. +# +# Constructor() +# : initializer1() +# , initializer2() +BreakConstructorInitializers: BeforeComma + +# Break inheritance list only after the commas. +# +# class Foo : Base1, +# Base2 +# {}; +BreakInheritanceList: AfterComma + +# true: +# const char* x = "veryVeryVeryVeryVeryVe" +# "ryVeryVeryVeryVeryVery" +# "VeryLongString"; +BreakStringLiterals: true +ColumnLimit: 100 + +# false: +# namespace Foo { +# namespace Bar { +# } +# } +CompactNamespaces: false + +# true: false: +# vector x{1, 2, 3, 4}; vs. vector x{ 1, 2, 3, 4 }; +# vector x{{}, {}, {}, {}}; vector x{ {}, {}, {}, {} }; +# f(MyMap[{composite, key}]); f(MyMap[{ composite, key }]); +# new int[3]{1, 2, 3}; new int[3]{ 1, 2, 3 }; +Cpp11BracedListStyle: true + +# Analyze the formatted file for the most used line ending (\r\n or \n). UseCRLF +# is only used as a fallback if none can be derived. +DeriveLineEnding: true +DerivePointerAlignment: true # As per DeriveLineEnding except for pointers and references + +# Add empty line only when access modifier starts a new logical block. Logical +# block is a group of one or more member fields or functions. +# +# struct foo { +# private: +# int i; +# +# protected: +# int j; +# /* comment */ +# public: +# foo() {} +# +# private: +# protected: +# }; +EmptyLineBeforeAccessModifier: LogicalBlock + +# true: false: +# namespace a { vs. namespace a { +# foo(); foo(); +# bar(); bar(); +# } // namespace a } +FixNamespaceComments: true + +# false: true: +# class C { vs. class C { +# class D { class D { +# void bar(); void bar(); +# protected: protected: +# D(); D(); +# }; }; +# public: public: +# C(); C(); +# }; }; +# void foo() { void foo() { +# return 1; return 1; +# } } +IndentAccessModifiers: false + +# false: true: +# switch (fool) { vs. switch (fool) { +# case 1: { case 1: +# bar(); { +# } break; bar(); +# default: { } +# plop(); break; +# } default: +# } { +# plop(); +# } +# } +IndentCaseBlocks: false + +# false: true: +# switch (fool) { vs. switch (fool) { +# case 1: case 1: +# bar(); bar(); +# break; break; +# default: default: +# plop(); plop(); +# } } +IndentCaseLabels: true + +# extern "C" { +# void foo(); +# } +IndentExternBlock: NoIndent + +# Indents directives before the hash. +# +# #if FOO +# #if BAR +# #include +# #endif +# #endif +IndentPPDirectives: BeforeHash + +# true: false: +# if (foo) { vs. if (foo) { +# bar(); +# bar(); } +# } +KeepEmptyLinesAtTheStartOfBlocks: false + +# The maximum number of consecutive empty lines to keep. +# +# MaxEmptyLinesToKeep: 1 vs. MaxEmptyLinesToKeep: 0 +# int f() { int f() { +# int = 1; int i = 1; +# i = foo(); +# i = foo(); return i; +# } +# return i; +# } +MaxEmptyLinesToKeep: 1 +NamespaceIndentation: None + +# Put all constructor initializers on the current line if they fit. Otherwise, +# put each one on its own line. +# +# Constructor() : a(), b() +# +# Constructor() +# : aaaaaaaaaaaaaaaaaaaa(), +# bbbbbbbbbbbbbbbbbbbb(), +# ddddddddddddd() +PackConstructorInitializers: CurrentLine +PointerAlignment: Right + +# false: +# // veryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLongComment with plenty of information +# /* second veryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLongComment with plenty of information */ +# +# true: +# // veryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLongComment with plenty of +# // information +# /* second veryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLongComment with plenty of +# * information */ +ReflowComments: true + +# false: true: +# +# if (isa(D)) { vs. if (isa(D)) +# handleFunctionDecl(D); handleFunctionDecl(D); +# } else if (isa(D)) { else if (isa(D)) +# handleVarDecl(D); handleVarDecl(D); +# } +# +# if (isa(D)) { vs. if (isa(D)) { +# for (auto *A : D.attrs()) { for (auto *A : D.attrs()) +# if (shouldProcessAttr(A)) { if (shouldProcessAttr(A)) +# handleAttr(A); handleAttr(A); +# } } +# } +# } +# +# if (isa(D)) { vs. if (isa(D)) +# for (auto *A : D.attrs()) { for (auto *A : D.attrs()) +# handleAttr(A); handleAttr(A); +# } +# } +# +# if (auto *D = (T)(D)) { vs. if (auto *D = (T)(D)) { +# if (shouldProcess(D)) { if (shouldProcess(D)) +# handleVarDecl(D); handleVarDecl(D); +# } else { else +# markAsIgnored(D); markAsIgnored(D); +# } } +# } +# +# if (a) { vs. if (a) +# b(); b(); +# } else { else if (c) +# if (c) { d(); +# d(); else +# } else { e(); +# e(); +# } +# } +RemoveBracesLLVM: true + +# Never v.s. Always +# #include #include +# struct Foo { +# int a, b, c; struct Foo { +# }; int a, b, c; +# namespace Ns { }; +# class Bar { +# public: namespace Ns { +# struct Foobar { class Bar { +# int a; public: +# int b; struct Foobar { +# }; int a; +# private: int b; +# int t; }; +# int method1() { +# // ... private: +# } int t; +# enum List { +# ITEM1, int method1() { +# ITEM2 // ... +# }; } +# template +# int method2(T x) { enum List { +# // ... ITEM1, +# } ITEM2 +# int i, j, k; }; +# int method3(int par) { +# // ... template +# } int method2(T x) { +# }; // ... +# class C {}; } +# } +# int i, j, k; +# +# int method3(int par) { +# // ... +# } +# }; +# +# class C {}; +# } +SeparateDefinitionBlocks: Always + +# true: false: +# int a = 5; vs. int a= 5; +# a += 42; a+= 42; +SpaceBeforeAssignmentOperators: true + +# Put a space before opening parentheses only after control statement keywords +# (for/if/while...). +# +# void f() { +# if (true) { +# f(); +# } +# } +SpaceBeforeParens: ControlStatements +SpacesBeforeTrailingComments: 1 + +# static_cast(arg); +# std::function fct; +SpacesInAngles: Never + +Standard: Auto + +# Macros which are ignored in front of a statement, as if they were an +# attribute. So that they are not parsed as identifier, for example for Qts +# emit. +# unsigned char data = 'x'; +# emit signal(data); // This is parsed as variable declaration. +# +# vs. +# +# unsigned char data = 'x'; +# emit signal(data); // Now it's fine again. +StatementAttributeLikeMacros: [emit] +--- diff --git a/Installer/os_nvim_init.vim b/Installer/os_nvim_init.vim index b7a5d19..dab42f2 100644 --- a/Installer/os_nvim_init.vim +++ b/Installer/os_nvim_init.vim @@ -5,30 +5,20 @@ call plug#begin(stdpath('config') . '/plugged') " vim-dispatch allows running async jobs in vim (i.e. builds in the background) Plug 'https://github.com/scrooloose/nerdtree', { 'on': 'NERDTreeToggle' } Plug 'https://github.com/tpope/vim-dispatch' + Plug 'https://github.com/tpope/vim-fugitive' + Plug 'https://github.com/tpope/vim-abolish' " TODO: 2022-06-19 Treesitter is too slow on large C++ files " Plug 'https://github.com/nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'} Plug 'https://github.com/bfrg/vim-cpp-modern' - " Telescope file picker, sorter and previewer - Plug 'https://github.com/nvim-lua/plenary.nvim' - Plug 'https://github.com/nvim-telescope/telescope.nvim' - Plug 'nvim-telescope/telescope-fzf-native.nvim', { 'do': 'cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build' } + " FZF + Plug 'junegunn/fzf' + Plug 'junegunn/fzf.vim' - " nvim-lspconfig sets up sane defaults for LSP servers (i.e. clangd) - " nvim-cmp is a more powerful autocomplete engine - " LuaSnip allow writing snippets into the buffer, we can power the snippets from LSP - " cmp-nvim-lsp preset capability flags to request more powerful autocomplete from LSP server - " cmp_luasnip a LuaSnip addon that provides a completion source to nvim-cmp - " cmp-buffer provides a buffer completion source to nvim-cmp - " cmp-path provides a path completion source to nvim-cmp - Plug 'https://github.com/neovim/nvim-lspconfig' - Plug 'https://github.com/hrsh7th/nvim-cmp' - Plug 'https://github.com/L3MON4D3/LuaSnip' - Plug 'https://github.com/hrsh7th/cmp-nvim-lsp' - Plug 'https://github.com/saadparwaiz1/cmp_luasnip' - Plug 'https://github.com/hrsh7th/cmp-buffer' - Plug 'https://github.com/hrsh7th/cmp-path' + " FZF for LSP + Plug 'gfanto/fzf-lsp.nvim' + Plug 'nvim-lua/plenary.nvim' " odin for syntax highlighting Plug 'https://github.com/Tetralux/odin.vim' @@ -36,35 +26,65 @@ call plug#begin(stdpath('config') . '/plugged') " Lua cache to speed up load times Plug 'https://github.com/lewis6991/impatient.nvim' + + " lsp-zero begin + " LSP Support + Plug 'neovim/nvim-lspconfig' + Plug 'williamboman/mason.nvim' + Plug 'williamboman/mason-lspconfig.nvim' + + " Autocompletion + Plug 'hrsh7th/nvim-cmp' + Plug 'hrsh7th/cmp-buffer' + Plug 'hrsh7th/cmp-path' + Plug 'saadparwaiz1/cmp_luasnip' + Plug 'hrsh7th/cmp-nvim-lsp' + Plug 'hrsh7th/cmp-nvim-lua' + + " Snippets + Plug 'L3MON4D3/LuaSnip' + + " Snippet collection (Optional) + Plug 'rafamadriz/friendly-snippets' + Plug 'VonHeikemen/lsp-zero.nvim' + " lsp-zero end call plug#end() " Lua Setup " ============================================================================== lua <"] = require('telescope.actions').move_selection_next, - [""] = require('telescope.actions').move_selection_previous, - }, - n = { - [""] = require('telescope.actions').move_selection_next, - [""] = require('telescope.actions').move_selection_previous, - }, - }, - }, - pickers = { - find_files = { - find_command = { "fd", "--unrestricted", "--strip-cwd-prefix" } - }, - } - } + + -- LSP Setup + -- =========================================================================== + local lsp = require('lsp-zero') + lsp.preset('recommended') + lsp.setup() + + -- Treesitter + -- =========================================================================== + -- TODO: 2022-06-19 Treesitter is too slow on large C++ files + -- require('nvim-treesitter.configs').setup { + -- ensure_installed = { "c", "cpp" }, -- A list of parser names, or "all" + -- sync_install = false, -- Install parsers synchronously (only applied to `ensure_installed`) + -- ignore_install = { }, -- List of parsers to ignore installing (for "all") + + -- highlight = { + -- enable = false, -- `false` will disable the whole extension + + -- -- NOTE: these are the names of the parsers and not the filetype. (for example if you want to + -- -- disable highlighting for the `tex` filetype, you need to include `latex` in this list as this is + -- -- the name of the parser) + -- -- list of language that will be disabled + -- disable = { }, + + -- -- Setting this to true will run `:h syntax` and tree-sitter at the same time. + -- -- Set this to `true` if you depend on 'syntax' being enabled (like for indentation). + -- -- Using this option may slow down your editor, and you may see some duplicate highlights. + -- -- Instead of true it can also be a list of languages + -- additional_vim_regex_highlighting = false, + -- }, + -- } -- Vim Options -- =========================================================================== @@ -90,6 +110,7 @@ lua < to open the file tree explorer", + " clang format selected lines", + " jump to next compilation error", + " jump to prev compilation error", + " change working directory to current file", + " <\\s> split buffer vertically", + "", + " Abolish (Text Substitution in Normal Mode)", + " --------------------------------------------------", + " %S/facilit{y,ies}/building{,s}/g Convert facility->building, facilities->buildings", + " %S/action/sleep/g Convert action to sleep, (preserve case sensitivity ACTION->SLEEP, action->sleep) ", + "", + " FZF (Normal Mode)", + " --------------------------------------------------", + " <\\h> vim command history", + " <\\f> find files", + " <\\g> search for text (via ripgrep)", + " <\\tt> search for tag (global)", + " <\\tb> search for tag (buffer)", + " <\\cc> search for commit (global)", + " <\\cb> search for commit (buffer)", + " <\\b> search for buffer", + "", + " Autocompletion (nvim-cmp in Normal Mode)", + " --------------------------------------------------", + " Confirms selection.", + " Confirms selection.", + " Navigate to previous item on the list.", + " Navigate to the next item on the list.", + " Navigate to previous item on the list.", + " Navigate to the next item on the list.", + " Scroll up in the item's documentation.", + " Scroll down in the item's documentation.", + " Toggles the completion.", + " Go to the next placeholder in the snippet.", + " Go to the previous placeholder in the snippet.", + " Enables completion when the cursor is inside a word. If the completion menu is visible it will navigate to the next item in the list.", + " When the completion menu is visible navigate to the previous item in the list.", + "", + " LSP Bindings (Normal Mode)", + " --------------------------------------------------", + " Displays hover information about the symbol under the cursor in a floating window. See help vim.lsp.buf.hover().", + " gd Jumps to the definition of the symbol under the cursor. See help vim.lsp.buf.definition().", + " gD Jumps to the declaration of the symbol under the cursor. Some servers don't implement this feature. See help vim.lsp.buf.declaration().", + " gi Lists all the implementations for the symbol under the cursor in the quickfix window. See help vim.lsp.buf.implementation().", + " go Jumps to the definition of the type of the symbol under the cursor. See help vim.lsp.buf.type_definition().", + " gr Lists all the references to the symbol under the cursor in the quickfix window. See help vim.lsp.buf.references().", + " Displays signature information about the symbol under the cursor in a floating window. See help vim.lsp.buf.signature_help(). If a mapping already exists for this key this function is not bound.", + " Renames all references to the symbol under the cursor. See help vim.lsp.buf.rename().", + " Selects a code action available at the current cursor position. See help vim.lsp.buf.code_action().", + " gl Show diagnostics in a floating window. See :help vim.diagnostic.open_float().", + " [d Move to the previous diagnostic in the current buffer. See :help vim.diagnostic.goto_prev().", + " ]d Move to the next diagnostic. See :help vim.diagnostic.goto_next()." + } - -- Use an on_attach function to only map the following keys - -- after the language server attaches to the current buffer - local custom_on_attach = function(client, bufnr) - -- Enable completion triggered by - vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc') + local height = vim.api.nvim_get_option("lines") + local width = vim.api.nvim_get_option("columns") + local ascii_rows = #ascii + local ascii_cols = #ascii[1] + local win = vim.api.nvim_get_current_win() + local buf = vim.api.nvim_create_buf(true, true) - -- See `:help vim.diagnostic.*` for documentation on any of the below functions - local opts = { noremap=true, silent=true } - vim.keymap.set('n', 'e', vim.diagnostic.open_float, opts) - vim.keymap.set('n', '', vim.diagnostic.goto_next, opts) - vim.keymap.set('n', '', vim.diagnostic.goto_prev, opts) + local function reset_start_screen() + vim.cmd("enew") + local buf = vim.api.nvim_get_current_buf() + local win = vim.api.nvim_get_current_win() + vim.api.nvim_buf_set_option(buf, "modifiable", true) + vim.api.nvim_buf_set_option(buf, "buflisted", true) + vim.api.nvim_buf_set_option(buf, "buflisted", true) + end - -- See `:help vim.lsp.*` for documentation on any of the below functions - local bufopts = { noremap=true, silent=true, buffer=bufnr } - vim.keymap.set('n', 'K', vim.lsp.buf.hover, bufopts) - vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, bufopts) - vim.keymap.set('n', 'gs', vim.lsp.buf.signature_help, bufopts) - vim.keymap.set('n', 'ga', vim.lsp.buf.code_action, bufopts) - vim.keymap.set('n', 'gR', vim.lsp.buf.rename, bufopts) + vim.api.nvim_buf_set_lines(buf, 0, -1, false, ascii) + vim.api.nvim_buf_set_option(buf, "modified", false) + vim.api.nvim_buf_set_option(buf, "buflisted", false) + vim.api.nvim_buf_set_option(buf, "bufhidden", "wipe") + vim.api.nvim_buf_set_option(buf, "buftype", "nofile") + vim.api.nvim_buf_set_option(buf, "swapfile", false) + vim.api.nvim_set_current_buf(buf) + + vim.api.nvim_create_autocmd("InsertEnter,WinEnter", { + pattern = "", + callback = reset_start_screen, + }) end - -- Request additional completion capabilities from the LSP server(s) - local lspconfig = require('lspconfig') - - -- Clangd LSP Setup - -- =========================================================================== - lspconfig.clangd.setup { - on_attach = custom_on_attach, - capabilities = custom_capabilities, - single_file_support = false, --- Don't launch LSP if the directory does not have LSP metadata - } - - lspconfig.cmake.setup { - on_attach = custom_on_attach, - capabilities = custom_capabilities, - } - - -- Autocomplete Setup - -- =========================================================================== - local luasnip = require 'luasnip' - local cmp = require 'cmp' - - local has_words_before = function() - local line, col = unpack(vim.api.nvim_win_get_cursor(0)) - return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil - end - - cmp.setup { - snippet = { - expand = function(args) luasnip.lsp_expand(args.body) end, - }, - window = { - completion = cmp.config.window.bordered(), - documentation = cmp.config.window.bordered(), - }, - completion = { autocomplete = false }, - mapping = cmp.mapping.preset.insert({ - [''] = cmp.mapping.scroll_docs(4), - [''] = cmp.mapping.scroll_docs(-4), - [''] = cmp.mapping.scroll_docs(-1), -- Scroll the docs up by 1 line - [''] = cmp.mapping.scroll_docs(1), -- Scroll the docs down by 1 line - [''] = cmp.mapping.confirm { behavior = cmp.ConfirmBehavior.Replace, select = true, }, - [''] = cmp.mapping(function(fallback) -- Move down the autocomplete list - if cmp.visible() then - cmp.select_next_item() - elseif luasnip.expand_or_jumpable() then - luasnip.expand_or_jump() - elseif has_words_before() then - cmp.complete() - else - fallback() - end - end, { 'i', 's' }), - [''] = cmp.mapping(function(fallback) -- Move up the autocomplete list - if cmp.visible() then - cmp.select_prev_item() - elseif luasnip.jumpable(-1) then - luasnip.jump(-1) - else - fallback() - end - end, { 'i', 's' }), - }), - sources = { - { name = 'nvim_lsp' }, - { name = 'luasnip' }, - { name = 'buffer' }, - }, - } - - -- TODO: 2022-06-19 Treesitter is too slow on large C++ files - -- require('nvim-treesitter.configs').setup { - -- ensure_installed = { "c", "cpp" }, -- A list of parser names, or "all" - -- sync_install = false, -- Install parsers synchronously (only applied to `ensure_installed`) - -- ignore_install = { }, -- List of parsers to ignore installing (for "all") - - -- highlight = { - -- enable = false, -- `false` will disable the whole extension - - -- -- NOTE: these are the names of the parsers and not the filetype. (for example if you want to - -- -- disable highlighting for the `tex` filetype, you need to include `latex` in this list as this is - -- -- the name of the parser) - -- -- list of language that will be disabled - -- disable = { }, - - -- -- Setting this to true will run `:h syntax` and tree-sitter at the same time. - -- -- Set this to `true` if you depend on 'syntax' being enabled (like for indentation). - -- -- Using this option may slow down your editor, and you may see some duplicate highlights. - -- -- Instead of true it can also be a list of languages - -- additional_vim_regex_highlighting = false, - -- }, - -- } EOF " Theme @@ -287,20 +282,43 @@ augroup persistent_settings au bufenter * :set formatoptions=q1j augroup end +" FZF +" ============================================================================== +" Empty value to disable preview window altogether +let g:fzf_preview_window = [] + +" Prefix all commands with Fzf for discoverability +let g:fzf_command_prefix = 'Fzf' + +" - down / up / left / right +let g:fzf_layout = { 'down': '40%' } + +" Add "FzfCustomRG" command which reinitializes +function! RipgrepFzf(query, fullscreen) + let command_fmt = 'rg --column --line-number --no-heading --color=always --smart-case -- %s || true' + let initial_command = printf(command_fmt, shellescape(a:query)) + let reload_command = printf(command_fmt, '{q}') + let spec = {'options': ['--phony', '--query', a:query, '--bind', 'change:reload:'.reload_command]} + call fzf#vim#grep(initial_command, 1, fzf#vim#with_preview(spec), a:fullscreen) +endfunction + +command! -nargs=* -bang FzfCustomRG call RipgrepFzf(, 0) + +" Augment the "FzfCustomFiles" command +command! -bang -nargs=? -complete=dir FzfCustomFiles + \ call fzf#vim#files(, {'options': ['--layout=reverse', '--info=inline', '--preview', 'cat {}']}, 0) + " General Key Bindings " ============================================================================== " Telescope Bindings -nnoremap f Telescope find_files -nnoremap g Telescope live_grep -nnoremap ta Telescope tags -nnoremap te Telescope -nnoremap b Telescope buffers -nnoremap h Telescope help_tags - -nnoremap gf Telescope lsp_dynamic_workspace_symbols -nnoremap gd Telescope lsp_definitions -nnoremap gt Telescope lsp_type_definitions -nnoremap gr Telescope lsp_references +nnoremap h FzfHistory +nnoremap f FzfCustomFiles +nnoremap g FzfCustomRG +nnoremap tt FzfTags +nnoremap tb FzfBTags +nnoremap cc FzfCommits +nnoremap cb FzfBCommits +nnoremap b FzfBuffers " Map Ctrl+HJKL to navigate buffer window nmap :wincmd h @@ -328,17 +346,6 @@ nnoremap s :vs nnoremap :cn nnoremap :cp -" FZF -" ============================================================================== -" Empty value to disable preview window altogether -let g:fzf_preview_window = [] - -" Prefix all commands with Fzf for discoverability -let g:fzf_command_prefix = 'Fzf' - -" - down / up / left / right -let g:fzf_layout = { 'down': '40%' } - " Clang Format " ============================================================================== map :py3file ~/clang-format.py diff --git a/Installer/unix_build_template.sh b/Installer/unix_build_template.sh new file mode 100755 index 0000000..d9da95d --- /dev/null +++ b/Installer/unix_build_template.sh @@ -0,0 +1,30 @@ +script_dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) +compiler_list=(gcc clang) + +for compiler in "${compiler_list[@]}" +do + version_list=() + if [[ "${compiler}" == "gcc" ]]; then + version_list+=(12.1.0) + version_list+=(11.3.0) + version_list+=(9.5.0) + cxx_compiler=g++ + c_compiler=gcc + elif [[ "${compiler}" == "clang" ]]; then + version_list+=(14.0.0) + cxx_compiler=clang++ + c_compiler=clang + fi + + for version in "${version_list[@]}" + do + if [[ "${compiler}" == "gcc" ]];then + cmake_flags="-D CMAKE_BUILD_RPATH='/home/doyle/Developer/Tools/gcc-mostlyportable/gcc-mostlyportable-${version}/usr/lib64/'" + fi + + build_dir=${script_dir}/build/${compiler}-${version} + + done + cp --force ${build_dir}/compile_commands.json . +done + diff --git a/Installer/unix_gcc_build.sh b/Installer/unix_gcc_build.sh new file mode 100755 index 0000000..1021925 --- /dev/null +++ b/Installer/unix_gcc_build.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +for gcc_version in "$@" +do + image_name=mostlyportable-gcc-image + container_name=mostlyportable-gcc + + docker build -t ${image_name} --build-arg GCC_VERSION=${gcc_version} . || exit + docker container rm ${container_name} > /dev/null 2>&1 + docker create --name ${container_name} ${image_name} || exit + + mkdir --parent build || exit + docker cp ${container_name}:/usr/local/docker/mostlyportable-gcc/mostly-built/gcc-mostlyportable-${gcc_version} . || exit + + docker container rm ${container_name} || exit +done + +if [[ $EUID == 0 ]]; then + chown --recursive ${USER} gcc-mostlyportable-* +fi diff --git a/Installer/unix_gcc_dockerfile b/Installer/unix_gcc_dockerfile new file mode 100644 index 0000000..0a71a9f --- /dev/null +++ b/Installer/unix_gcc_dockerfile @@ -0,0 +1,43 @@ +FROM ubuntu:16.04 as builder + +RUN set -ex \ + && apt-get update \ + && apt-get --no-install-recommends --yes install \ + apt-transport-https \ + eatmydata \ + ca-certificates + +# Build tools +RUN set -ex \ + && apt-get update \ + && eatmydata apt-get --no-install-recommends --yes install \ + build-essential \ + g++-multilib \ + git \ + libgmp-dev \ + libz-dev \ + m4 \ + schedtool \ + texinfo \ + texlive \ + wget + +WORKDIR /usr/local/docker + +ARG MOSTLY_PORTABLE_GCC_GIT_BRANCH=master +RUN set -ex \ + && git clone https://github.com/Frogging-Family/mostlyportable-gcc \ + && cd mostlyportable-gcc \ + && git checkout $MOSTLY_PORTABLE_GIT_BRANCH + +ARG GCC_VERSION=11.3.0 +ARG BIN_UTILS_VERSION=2.38 +RUN set -ex \ + && cd mostlyportable-gcc \ + && sed --in-place "s/^_use_gcc_git=\".*\"$/_use_gcc_git=\"false\"/" mostlyportable-gcc.cfg \ + && sed --in-place "s/^_gcc_version=\".*\"$/_gcc_version=\"$GCC_VERSION\"/" mostlyportable-gcc.cfg \ + && sed --in-place "s/^_use_binutils_git=\".*\"$/_use_binutils_git=\"false\"/" mostlyportable-gcc.cfg \ + && sed --in-place "s/^_binutils=.*$/_binutils=$BIN_UTILS_VERSION/" mostlyportable-gcc.cfg \ + && sed --in-place "s/^_use_isl_git=\".*\"$/_use_isl_git=\"false\"/" mostlyportable-gcc.cfg \ + && sed --in-place -E "s/^(\s*)(.*)_ldconfmostlyportable;$/\1_ldconfmostlyportable=\"n\"/" mostlyportable-gcc.sh \ + && ./mostlyportable-gcc.sh gcc diff --git a/Installer/win_portable-msvc-readme.md b/Installer/win_portable-msvc-readme.md index a12fc2b..1fdd06d 100644 --- a/Installer/win_portable-msvc-readme.md +++ b/Installer/win_portable-msvc-readme.md @@ -1,6 +1,6 @@ This downloads standalone 64-bit MSVC compiler, linker & other tools, also headers/libraries from Windows SDK into portable folder, without installing Visual Studio. Has bare minimum components - no UWP/Store/WindowsRT stuff, just files & tools for 64-bit native desktop app development. -Run `python.exe portable-msvc.py` and it will download output into `msvc` folder. By default it will download latest available MSVC & Windows SDK - currently v14.31 and v10.0.22000.0. +Run `python.exe portable-msvc.py` and it will download output into `msvc` folder. By default it will download latest available MSVC & Windows SDK - currently v14.32.17.2 and v10.0.22621.0. You can list available versions with `python.exe portable-msvc.py --show-versions` and then pass versions you want with `--msvc-version` and `--sdk-version` arguments. diff --git a/Installer/win_portable-msvc.py b/Installer/win_portable-msvc.py index e2a7c0c..3d7f8c0 100644 --- a/Installer/win_portable-msvc.py +++ b/Installer/win_portable-msvc.py @@ -180,6 +180,7 @@ sdk_packages = [ f"Windows SDK for Windows Store Apps Tools-x86_en-us.msi", # Windows SDK headers f"Windows SDK for Windows Store Apps Headers-x86_en-us.msi", + f"Windows SDK Desktop Headers x86-x86_en-us.msi", # Windows SDK libs f"Windows SDK for Windows Store Apps Libs-x86_en-us.msi", f"Windows SDK Desktop Libs {TARGET}-x86_en-us.msi", @@ -281,8 +282,7 @@ set INCLUDE=%MSVC_ROOT%\\include;%SDK_INCLUDE%\\ucrt;%SDK_INCLUDE%\\shared;%SDK_ set LIB=%MSVC_ROOT%\\lib\\%MSVC_ARCH%;%SDK_LIBS%\\ucrt\\%SDK_ARCH%;%SDK_LIBS%\\um\\%SDK_ARCH% """ -with open(OUTPUT / "setup.bat", "w") as f: - print(SETUP, file=f) +(OUTPUT / "setup.bat").write_text(SETUP) print(f"Total downloaded: {total_download>>20} MB") print("Done!") diff --git a/Installer/win_wcap_2022-08-11_d3b6d0d.exe b/Installer/win_wcap_2022-08-11_d3b6d0d.exe new file mode 100644 index 0000000..fb26e45 Binary files /dev/null and b/Installer/win_wcap_2022-08-11_d3b6d0d.exe differ diff --git a/linux_install.sh b/linux_install.sh index 16d49db..6f5be27 100755 --- a/linux_install.sh +++ b/linux_install.sh @@ -53,6 +53,11 @@ mkdir --parents ${bin_dir} # Tools # ------------------------------------------------------------------------------ +if ! command -v docker &> /dev/null +then + curl -fsSL https://get.docker.com -o get-docker.sh + sudo sh get-docker.sh +fi # CMake # ---------------------------------------------------------------------------- @@ -60,15 +65,18 @@ cmake_sha256=aaced6f745b86ce853661a595bdac6c5314a60f8181b6912a0a4920acfa32708 cmake_exe_sha256=95b80ba2b97b619abce1ed6fd28fe189cacba48403e9c69256f2f94e3405e645 cmake_version=3.23.2 +cmake_download_name=cmake-${cmake_version}-linux-x86_64 +cmake_download_file=${cmake_download_name}.tar.gz +cmake_download_path=${downloads_dir}/${cmake_download_file} + cmake_label=cmake_linux64_${cmake_version} -cmake_download_file=${downloads_dir}/${cmake_label}.tar.gz cmake_dir=${tools_dir}/${cmake_label} cmake_exe=${cmake_dir}/bin/cmake if [[ ! -f "${cmake_exe}" ]]; then - DownloadFile "https://github.com/Kitware/CMake/releases/download/v${cmake_version}/cmake-${cmake_version}-linux-x86_64.tar.gz" "${cmake_download_file}" || exit - FileSHA256Check "${cmake_download_file}" "${cmake_sha256}" || exit - mkdir --parents "${cmake_dir}" && tar xf "${cmake_download_file}" --skip-old-files --directory="${cmake_dir}" || exit + DownloadFile "https://github.com/Kitware/CMake/releases/download/v${cmake_version}/${cmake_download_file}" "${cmake_download_path}" || exit + FileSHA256Check "${cmake_download_path}" "${cmake_sha256}" || exit + mkdir --parents "${cmake_dir}" && tar xf "${cmake_download_path}" --skip-old-files --directory="${cmake_dir}" || exit mv ${cmake_dir}/cmake-${cmake_version}-linux-x86_64/* "${cmake_dir}" || exit rm --recursive ${cmake_dir}/cmake-${cmake_version}-linux-x86_64 || exit fi @@ -84,26 +92,79 @@ fd_sha256=a1e72cf4f4fbd1b061387569678f3ab3555ee1cf025280b3ce6b2eee96cd3210 fd_exe_sha256=057bea03a6f17eb99ea3b11c25a110880b012d2d5110988e80b1ce2ee6536342 fd_version=8.4.0 -fd_label=fd_linux64_${fd_version} -fd_download_label=fd-v${fd_version}-x86_64-unknown-linux-gnu -fd_download_file=${downloads_dir}/${fd_download_label}.tar.gz -fd_dir=${tools_dir}/${fd_label} +fd_download_name=fd-v${fd_version}-x86_64-unknown-linux-gnu +fd_download_file=${fd_download_name}.tar.gz +fd_download_path=${downloads_dir}/${fd_download_file} + +fd_dir=${tools_dir}/fd_linux64_${fd_version} fd_exe=${fd_dir}/fd if [[ ! -f "${fd_exe}" ]]; then - DownloadFile "https://github.com/sharkdp/fd/releases/download/v${fd_version}/${fd_download_label}.tar.gz" "${fd_download_file}" || exit - FileSHA256Check "${fd_download_file}" "${fd_sha256}" || exit - mkdir --parents "${fd_dir}" && tar xf "${fd_download_file}" --skip-old-files --directory="${fd_dir}" || exit - mv ${fd_dir}/${fd_download_label}/* "${fd_dir}" || exit - rm --recursive ${fd_dir}/${fd_download_label} || exit + DownloadFile "https://github.com/sharkdp/fd/releases/download/v${fd_version}/${fd_download_file}" "${fd_download_path}" || exit + FileSHA256Check "${fd_download_path}" "${fd_sha256}" || exit + mkdir --parents "${fd_dir}" && tar xf "${fd_download_path}" --skip-old-files --directory="${fd_dir}" || exit + mv ${fd_dir}/${fd_download_name}/* "${fd_dir}" || exit + rm --recursive ${fd_dir}/${fd_download_name} || exit fi FileSHA256Check "${fd_exe}" "${fd_exe_sha256}" || exit ln --force --symbolic --relative "${fd_exe}" "${bin_dir}" +# GCC +# ------------------------------------------------------------------------------ +gcc_dir=${tools_dir}/gcc-mostlyportable +gcc_version_list=() +gcc_version_list+=(6.5.0) +gcc_version_list+=(7.5.0) +gcc_version_list+=(8.5.0) +gcc_version_list+=(9.5.0) +gcc_version_list+=(10.4.0) +gcc_version_list+=(11.3.0) +gcc_version_list+=(12.1.0) + +mkdir --parents "${gcc_dir}" +cp "${installer_dir}/unix_gcc_build.sh" "${gcc_dir}/build.sh" +cp "${installer_dir}/unix_gcc_dockerfile" "${gcc_dir}/Dockerfile" + +cd "${gcc_dir}" || exit + for gcc_version in ${gcc_version_list[@]}; do + gcc_root_dir=${gcc_dir}/gcc-mostlyportable-${gcc_version} + gcc_bin_dir=${gcc_root_dir}/bin + if [[ ! -f "${gcc_bin_dir}/g++" ]]; then + ./build.sh ${gcc_version} || exit + fi + + # Symbolic link the versioned gcc executables + ln --symbolic --force --relative ${gcc_bin_dir}/g++ ${bin_dir}/g++-${gcc_version} || exit + ln --symbolic --force --relative ${gcc_bin_dir}/gcc ${bin_dir}/gcc-${gcc_version} || exit + + # Create script that setups the environment path for building with a versioned GCC + gcc_script_name=g++-${gcc_version}-vars.sh + gcc_script_path=${gcc_dir}/${gcc_script_name} + + echo "gcc_mostlyportable_dir=\"${gcc_root_dir}\" \\" > ${gcc_script_path} + echo "PATH=\${gcc_mostlyportable_dir}/bin:\${PATH} \\" >> ${gcc_script_path} + echo "LD_LIBRARY_PATH=\${gcc_mostlyportable_dir}/lib:\${LD_LIBRARY_PATH} \\" >> ${gcc_script_path} + echo "LD_LIBRARY_PATH=\${gcc_mostlyportable_dir}/lib64:\${LD_LIBRARY_PATH} \\" >> ${gcc_script_path} + echo "\$@" >> ${gcc_script_path} + + chmod +x ${gcc_script_path} + + # Symbolic link the script to load the GCC environment + ln --symbolic --force --relative ${gcc_script_path} ${bin_dir}/gcc-${gcc_version}-vars.sh || exit + done + + ln --symbolic --force --relative "${gcc_bin_dir}/g++" "${bin_dir}/g++" || exit + ln --symbolic --force --relative "${gcc_bin_dir}/gcc" "${bin_dir}/gcc" || exit +cd "${root_dir}" || exit + # LLVM/Clang # ------------------------------------------------------------------------------ -llvm_version_list=(11.1.0 12.0.1 13.0.1 14.0.0) +llvm_version_list=() +llvm_version_list+=(11.1.0) +llvm_version_list+=(12.0.1) +llvm_version_list+=(13.0.1) +llvm_version_list+=(14.0.0) for llvm_version in ${llvm_version_list[@]}; do llvm_sha256=none @@ -111,37 +172,39 @@ for llvm_version in ${llvm_version_list[@]}; do if [[ "${llvm_version}" == "14.0.0" ]]; then llvm_sha256=61582215dafafb7b576ea30cc136be92c877ba1f1c31ddbbd372d6d65622fef5 llvm_exe_sha256=3557c2deadae7e2bc3bffce4afd93ddab6ef50090971c8ce3bf15c80b27134a0 - llvm_download_label=clang+llvm-${llvm_version}-x86_64-linux-gnu-ubuntu-18.04 + llvm_download_name=clang+llvm-${llvm_version}-x86_64-linux-gnu-ubuntu-18.04 elif [[ "${llvm_version}" == "13.0.1" ]]; then llvm_sha256=84a54c69781ad90615d1b0276a83ff87daaeded99fbc64457c350679df7b4ff0 llvm_exe_sha256=ae47e6cc9f6d95f7a39e4800e511b7bdc3f55464ca79e45cd63cbd8a862a82a1 - llvm_download_label=clang+llvm-${llvm_version}-x86_64-linux-gnu-ubuntu-18.04 + llvm_download_name=clang+llvm-${llvm_version}-x86_64-linux-gnu-ubuntu-18.04 elif [[ "${llvm_version}" == "12.0.1" ]]; then llvm_sha256=6b3cc55d3ef413be79785c4dc02828ab3bd6b887872b143e3091692fc6acefe7 llvm_exe_sha256=329bba976c0cef38863129233a4b0939688eae971c7a606d41dd0e5a53d53455 - llvm_download_label=clang+llvm-${llvm_version}-x86_64-linux-gnu-ubuntu-16.04 + llvm_download_name=clang+llvm-${llvm_version}-x86_64-linux-gnu-ubuntu-16.04 elif [[ "${llvm_version}" == "11.1.0" ]]; then llvm_sha256=c691a558967fb7709fb81e0ed80d1f775f4502810236aa968b4406526b43bee1 llvm_exe_sha256=656bfde194276cee81dc8a7a08858313c5b5bdcfa18ac6cd6116297af2f65148 - llvm_download_label=clang+llvm-${llvm_version}-x86_64-linux-gnu-ubuntu-16.04 + llvm_download_name=clang+llvm-${llvm_version}-x86_64-linux-gnu-ubuntu-16.04 fi - llvm_download_file=${downloads_dir}/${llvm_download_label}.tar.xz - llvm_label=llvm_linux64_${llvm_version} - llvm_dir=${tools_dir}/${llvm_label} + llvm_download_file=${llvm_download_name}.tar.xz + llvm_download_path=${downloads_dir}/${llvm_download_name}.tar.xz + + llvm_dir=${tools_dir}/llvm_linux64_${llvm_version} llvm_exe=${llvm_dir}/bin/clang + if [[ ! -f "${llvm_exe}" ]]; then - DownloadFile "https://github.com/llvm/llvm-project/releases/download/llvmorg-${llvm_version}/${llvm_download_label}.tar.xz" "${llvm_download_file}" || exit - FileSHA256Check "${llvm_download_file}" "${llvm_sha256}" || exit - mkdir --parents "${llvm_dir}" && tar xf "${llvm_download_file}" --skip-old-files --directory="${llvm_dir}" || exit + DownloadFile "https://github.com/llvm/llvm-project/releases/download/llvmorg-${llvm_version}/${llvm_download_file}" "${llvm_download_path}" || exit + FileSHA256Check "${llvm_download_path}" "${llvm_sha256}" || exit + mkdir --parents "${llvm_dir}" && tar xf "${llvm_download_path}" --skip-old-files --directory="${llvm_dir}" || exit if [[ "${llvm_version}" == "12.0.1" ]]; then # NOTE: There was a distribution bug in v12.0.1 where the folder was misnamed mv ${llvm_dir}/clang+llvm-${llvm_version}-x86_64-linux-gnu-ubuntu-/* ${llvm_dir} || exit - rm --recursive ${llvm_dir}/clang+llvm-${llvm_version}-x86_64-linux-gnu-ubuntu || exit + rm --recursive ${llvm_dir}/clang+llvm-${llvm_version}-x86_64-linux-gnu-ubuntu- || exit else - mv ${llvm_dir}/${llvm_download_label}/* ${llvm_dir} || exit - rm --recursive ${llvm_dir}/${llvm_download_label} || exit + mv ${llvm_dir}/${llvm_download_name}/* ${llvm_dir} || exit + rm --recursive ${llvm_dir}/${llvm_download_name} || exit fi fi FileSHA256Check "${llvm_exe}" "${llvm_exe_sha256}" || exit @@ -150,6 +213,24 @@ done cd "${llvm_dir}/bin" && find . -type f,l -exec ln --force --symbolic --relative "{}" "${bin_dir}/" ';' && cd "${root_dir}" +# gf +# ------------------------------------------------------------------------------ +gf_dir=${tools_dir}/gf + +if [[ ! -d "${gf_dir}" ]]; then + git clone https://github.com/nakst/gf "${tools_dir}/gf" || exit +fi + +cd "${tools_dir}/gf" || exit +git checkout master + +# Use our custom G++ because I typically run Ubuntu 18.04 which uses G++7 +# which is too old to compile GF. +#PATH=${gcc_bin_dir}:${PATH} ./build.sh || exit +#ln --force --symbolic --relative "gf2" "${bin_dir}" + +cd "${root_dir}" + # Vim Configuration # ------------------------------------------------------------------------------ cp --force ${installer_dir}/os_vimrc ~/.vimrc || exit @@ -166,13 +247,39 @@ vim_plug=${vim_plug_dir}/plug.vim mkdir --parents ${vim_plug_dir} DownloadFile "https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim" "${vim_plug}" || exit +# nodejs +# ---------------------------------------------------------------------------- +nodejs_sha256=f0867d7a17a4d0df7dbb7df9ac3f9126c2b58f75450647146749ef296b31b49b +nodejs_exe_sha256=8fdc420e870ef9aa87dc8c1b7764fccb8229b6896f112b699afeeefeb0021714 +nodejs_version=16.17.0 + +nodejs_download_name=node-v${nodejs_version}-linux-x64 +nodejs_download_file=${nodejs_download_name}.tar.xz +nodejs_download_path=${downloads_dir}/${nodejs_download_file} + +nodejs_dir=${tools_dir}/nodejs_linux64_${nodejs_version} +nodejs_exe=${nodejs_dir}/bin/node + +if [[ ! -f "${nodejs_exe}" ]]; then + DownloadFile "https://nodejs.org/dist/v${nodejs_version}/${nodejs_download_file}" ${nodejs_download_path} || exit + FileSHA256Check ${nodejs_download_path} ${nodejs_sha256} || exit + + mkdir --parents "${nodejs_dir}" && tar xf "${nodejs_download_path}" --skip-old-files --directory="${nodejs_dir}" || exit + mv ${nodejs_dir}/${nodejs_download_name}/* "${nodejs_dir}" || exit + rm --recursive ${nodejs_dir}/${nodejs_download_name} +fi + +FileSHA256Check ${nodejs_exe} ${nodejs_exe_sha256} || exit +ln --force --symbolic --relative "${nodejs_exe}" "${bin_dir}/node" || exit +ln --force --symbolic --relative "${nodejs_dir}/bin/npm" "${bin_dir}/npm" || exit + # Nvim # ------------------------------------------------------------------------------ nvim_sha256=33b5d020c730b6d1b5185b1306ead83b6b8f8fab0239e0580c72b5224a9658e1 nvim_version=0.7.2 nvim_label=nvim_linux64_${nvim_version} -nvim_exe=${tools_dir}/${nvim_label}.appimage +nvim_exe=${tools_dir}/nvim_linux64_${nvim_version}.AppImage DownloadFile "https://github.com/neovim/neovim/releases/download/v${nvim_version}/nvim.appimage" "${nvim_exe}" || exit FileSHA256Check "${nvim_exe}" "${nvim_sha256}" || exit @@ -187,16 +294,18 @@ neovide_sha256=684cbcaeb2e67f1d95822ef80e03e1475395d537f2032f47b8202fe48c428b08 neovide_exe_sha256=e4fbc8b56af2e25127938ae2974921e25b4df5722086d7e8c3e517e8ee86e2df neovide_version=0.9.0 -neovide_label=neovide_linux64_${neovide_version} -neovide_download_file=${downloads_dir}/${neovide_label}.tar.gz +neovide_download_name=neovide +neovide_download_file=${neovide_download_name}.tar.gz +neovide_download_path=${downloads_dir}/${neovide_download_name}.tar.gz + neovide_dir=${tools_dir} -neovide_exe=${neovide_dir}/${neovide_label} +neovide_exe=${neovide_dir}/neovide_linux64_${neovide_version} if [[ ! -f "${neovide_exe}" ]]; then - DownloadFile "https://github.com/neovide/neovide/releases/download/${neovide_version}/neovide.tar.gz" ${neovide_download_file} || exit - FileSHA256Check ${neovide_download_file} ${neovide_sha256} || exit + DownloadFile "https://github.com/neovide/neovide/releases/download/${neovide_version}/${neovide_download_file}" ${neovide_download_path} || exit + FileSHA256Check ${neovide_download_path} ${neovide_sha256} || exit - mkdir --parents "${cmake_dir}" && tar xf ${neovide_download_file} --skip-old-files --directory=${neovide_dir}/neovide-tmp || exit + mkdir --parents ${neovide_dir}/neovide-tmp && tar xf ${neovide_download_path} --skip-old-files --directory=${neovide_dir}/neovide-tmp || exit mv ${neovide_dir}/neovide-tmp/target/release/neovide "${neovide_exe}" || exit rm -rf ${neovide_dir}/neovide-tmp fi @@ -210,16 +319,17 @@ python_sha256=460f87a389be28c953c24c6f942f172f9ce7f331367b4daf89cb450baedd51d7 python_exe_sha256=1400cb8f2cf2f606d1c87c1edb69ea1b3479b4c2bfb5c438a4828903a1d6f9f8 python_version=3.10.5 -python_label=python_linux64_${python_version} -python_download_label=cpython-${python_version}+20220630-x86_64-unknown-linux-gnu-install_only -python_download_file=${downloads_dir}/${python_download_label}.tar.gz -python_dir=${tools_dir}/${python_label} +python_download_name=cpython-${python_version}+20220630-x86_64-unknown-linux-gnu-install_only +python_download_file=${python_download_name}.tar.gz +python_download_path=${downloads_dir}/${python_download_file} + +python_dir=${tools_dir}/python_linux64_${python_version} python_exe=${python_dir}/bin/python3 if [[ ! -f "${python_exe}" ]]; then - DownloadFile "https://github.com/indygreg/python-build-standalone/releases/download/20220630/${python_download_label}.tar.gz" "${python_download_file}" || exit - FileSHA256Check "${python_download_file}" "${python_sha256}" || exit - mkdir --parents "${python_dir}" && tar xf "${python_download_file}" --skip-old-files --directory="${python_dir}" || exit + DownloadFile "https://github.com/indygreg/python-build-standalone/releases/download/20220630/${python_download_file}" "${python_download_path}" || exit + FileSHA256Check "${python_download_path}" "${python_sha256}" || exit + mkdir --parents "${python_dir}" && tar xf "${python_download_path}" --skip-old-files --directory="${python_dir}" || exit mv --force ${python_dir}/python/* "${python_dir}" || exit rm --recursive ${python_dir}/python || exit fi @@ -238,18 +348,19 @@ ripgrep_sha256=ee4e0751ab108b6da4f47c52da187d5177dc371f0f512a7caaec5434e711c091 ripgrep_exe_sha256=4ef156371199b3ddac1bf584e0e52b1828279af82e4ea864b4d9c816adb5db40 ripgrep_version=13.0.0 -ripgrep_label=ripgrep_linux64_${ripgrep_version} -ripgrep_download_label=ripgrep-${ripgrep_version}-x86_64-unknown-linux-musl -ripgrep_download_file=${downloads_dir}/${ripgrep_download_label}.tar.gz -ripgrep_dir=${tools_dir}/${ripgrep_label} +ripgrep_download_name=ripgrep-${ripgrep_version}-x86_64-unknown-linux-musl +ripgrep_download_file=${ripgrep_download_name}.tar.gz +ripgrep_download_path=${downloads_dir}/${ripgrep_download_file} + +ripgrep_dir=${tools_dir}/ripgrep_linux64_${ripgrep_version} ripgrep_exe=${ripgrep_dir}/rg if [[ ! -f "${ripgrep_exe}" ]]; then - DownloadFile "https://github.com/BurntSushi/ripgrep/releases/download/${ripgrep_version}/${ripgrep_download_label}.tar.gz" "${ripgrep_download_file}" || exit - FileSHA256Check "${ripgrep_download_file}" "${ripgrep_sha256}" || exit - mkdir --parents "${ripgrep_dir}" && tar xf "${ripgrep_download_file}" --skip-old-files --directory="${ripgrep_dir}" || exit - mv ${ripgrep_dir}/${ripgrep_download_label}/* "${ripgrep_dir}" || exit - rm --recursive ${ripgrep_dir}/${ripgrep_download_label} || exit + DownloadFile "https://github.com/BurntSushi/ripgrep/releases/download/${ripgrep_version}/${ripgrep_download_file}" "${ripgrep_download_path}" || exit + FileSHA256Check "${ripgrep_download_path}" "${ripgrep_sha256}" || exit + mkdir --parents "${ripgrep_dir}" && tar xf "${ripgrep_download_path}" --skip-old-files --directory="${ripgrep_dir}" || exit + mv ${ripgrep_dir}/${ripgrep_download_name}/* "${ripgrep_dir}" || exit + rm --recursive ${ripgrep_dir}/${ripgrep_download_name} || exit fi FileSHA256Check "${ripgrep_exe}" "${ripgrep_exe_sha256}" || exit @@ -260,11 +371,11 @@ ln --force --symbolic --relative "${ripgrep_exe}" "${bin_dir}" wezterm_sha256=4de3cd65b7d7ae0c72a691597bd3def57c65f07fe4a7c98b447b8a9dc4d0adf0 wezterm_version=20220624-141144-bd1b7c5d -wezterm_label=wezterm_linux64_${wezterm_version} -wezterm_download_label=WezTerm-${wezterm_version}-Ubuntu18.04 -wezterm_exe=${tools_dir}/${wezterm_label}.AppImage +wezterm_download_name=WezTerm-${wezterm_version}-Ubuntu18.04 +wezterm_download_file=${wezterm_download_name}.AppImage +wezterm_exe=${tools_dir}/wezterm_linux64_${wezterm_version}.AppImage -DownloadFile "https://github.com/wez/wezterm/releases/download/${wezterm_version}/${wezterm_download_label}.AppImage" "${wezterm_exe}" || exit +DownloadFile "https://github.com/wez/wezterm/releases/download/${wezterm_version}/${wezterm_download_file}" ${wezterm_exe} || exit FileSHA256Check "${wezterm_exe}" "${wezterm_sha256}" || exit chmod +x "${wezterm_exe}" @@ -279,7 +390,7 @@ chmod +x ${bin_dir}/ctags_cpp.sh # Linux Terminal # ------------------------------------------------------------------------------ echo \#!/usr/bin/env bash> ${tools_dir}/linux_terminal.sh -echo PATH=${tools_dir}/Binaries>> ${tools_dir}/linux_terminal.sh +echo PATH=${tools_dir}/Binaries:\$\{PATH\}>> ${tools_dir}/linux_terminal.sh echo PATH=\$\{PATH\}:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin>> ${tools_dir}/linux_terminal.sh echo [[ -d /usr/lib/wsl/lib ]] \&\& PATH=\$\{PATH\}:/usr/lib/wsl/lib>> ${tools_dir}/linux_terminal.sh echo [[ -d /snap/bin ]] \&\& PATH=\$\{PATH\}:/snap/bin>> ${tools_dir}/linux_terminal.sh diff --git a/win_helpers.bat b/win_helpers.bat index fa9f171..74728b0 100644 --- a/win_helpers.bat +++ b/win_helpers.bat @@ -1,6 +1,6 @@ @echo off setlocal EnableDelayedExpansion -REM Win Helpers - Version 3 +REM Win Helpers - Version 11 call %* goto exit @@ -40,6 +40,7 @@ exit /B 0 :Unzip REM call win_helpers.bat :Unzip +REM Overwrite mode: "-aos" Skip extracting of existing files REM ------------------------------------------------------------------------------------------------ set zip7_exe=%~1 set zip_file=%~2 @@ -55,13 +56,9 @@ if not exist "!zip_file!" ( exit /B 1 ) -if exist !dest! ( - echo - [Unzip/Cached] !zip_file! to !dest! -) else ( - echo - [Unzip] !zip_file! to !dest! - call !zip7_dir!\7z.exe x -y -spe -o!dest! !zip_file! -) -exit /B 0 +echo - [Unzip] !zip_file! to !dest! +call !zip7_dir!\7z.exe x -y -aos -spe -o!dest! !zip_file! +exit /B %ERRORLEVEL% :FileHashCheck REM call win_helpers.bat :FileHashCheck [sha256|md5|...] @@ -76,7 +73,7 @@ if not exist "!file!" ( ) REM Calculate hash -for /F "tokens=2 delims= " %%c in ('powershell -NoLogo -NoProfile -NonInteractive Get-FileHash -algorithm !algorithm! \"!file!\" ') do ( set "actual=%%c" ) +for /F %%c in ('powershell -NoLogo -NoProfile -NonInteractive "Get-FileHash -algorithm !algorithm! \"!file!\" | Select-Object -ExpandProperty Hash "') do ( set "actual=%%c" ) REM Verify Hash if /I "!expected!" neq "!actual!" ( @@ -90,23 +87,23 @@ if /I "!expected!" neq "!actual!" ( echo - [FileHashCheck] !algorithm! OK [file=!file! hash=!expected!] exit /B 0 -:Move -REM call win_helpers.bat :Move +:MoveDir +REM call win_helpers.bat :MoveDir REM ------------------------------------------------------------------------------------------------ set src=%~1 set dest=%~2 if not exist "!src!" ( - echo - [Move] File/path does not exist [file=%src%] + echo - [MoveDir] Directory does not exist [dir=%src%] exit /B 1 ) -echo - [Move] Move "!src!" to "!dest!" -robocopy "!src!" "!dest!" /E /MOVE /NP /NJS /NJS /NS /NC /NFL /NDL +echo - [MoveDir] "!src!" to "!dest!" +robocopy "!src!" "!dest!" /E /MOVE /MT /NP /NJS /NS /NC /NFL /NDL exit /B 0 :MakeBatchShortcut -REM call win_helpers.bat :MakeBatchShortcut +REM call win_helpers.bat :MakeBatchShortcut REM ------------------------------------------------------------------------------------------------ REM NOTE we make a batch file instead of a symlink because symlinks require REM admin privileges in windows ... @@ -115,13 +112,13 @@ set executable=%~2 set dest_dir=%~3 if not exist "!executable!" ( - echo - [MakeBatchShortcut] Executable for shortcut does not exist [executable=%executable%] - exit /B %ERRORLEVEL% + echo - [MakeBatchShortcut] Executable for shortcut does not exist [exe=%executable%] + exit /B 1 ) if not exist "!dest_dir!" ( echo - [MakeBatchShortcut] Shortcut destination directory does not exist [dir=%dest_dir%] - exit /B %ERRORLEVEL% + exit /B 1 ) echo - [MakeBatchShortcut] Create [name=!name!, exe=!executable!, dest=!dest_dir!] @@ -129,5 +126,79 @@ echo @echo off> "!dest_dir!\!name!.bat" echo !executable! %%*>> "!dest_dir!\!name!.bat" exit /B 0 +:MakeRelativeBatchShortcut +REM call win_helpers.bat :MakeRelativeBatchShortcut +REM ------------------------------------------------------------------------------------------------ +REM NOTE we make a batch file instead of a symlink because symlinks require +REM admin privileges in windows ... +set name=%~1 +set executable=%~2 +set dest_dir=%~3 + +if not exist "!dest_dir!\!executable!" ( + echo - [MakeRelativeBatchShortcut] Executable for shortcut does not exist [exe=!dest_dir!\%executable%] + exit /B 1 +) + +if not exist "!dest_dir!" ( + echo - [MakeRelativeBatchShortcut] Shortcut destination directory does not exist [dir=%dest_dir%] + exit /B 1 +) + +echo - [MakeRelativeBatchShortcut] Create [name=!name!, exe=!dest_dir!\!executable!, dest=!dest_dir!] +echo @echo off> "!dest_dir!\!name!.bat" +echo %%~dp0!executable! %%*>> "!dest_dir!\!name!.bat" +exit /B 0 + +:MakeFileHardLink +REM call win_helpers.bat :MakeFileHardLink dest src +REM ------------------------------------------------------------------------------------------------ +set dest=%~1 +set src=%~2 +if not exist "!src!" ( + echo - [MakeFileHardLink] Source file does not exist [src=!src!] + exit /B 1 +) + +if exist "%dest%" ( + del "!dest!" + if exist "!dest!" ( + echo - [MakeFileHardLink] Failed to delete destination file [dest=!dest!] + exit /B 1 + ) +) + +mklink /H "!dest!" "!src!" +if not exist "!dest!" ( + echo - [MakeFileHardLink] Failed to make hard link at dest [src=!src!, dest=!dest!] + exit /B 1 +) +exit /B 0 + +:MakeDirHardLink +REM call win_helpers.bat :MakeDirHardLink dest src +REM ------------------------------------------------------------------------------------------------ +set dest=%~1 +set src=%~2 +if not exist "!src!" ( + echo - [MakeDirHardLink] Source file does not exist [src=!src!] + exit /B 1 +) + +if exist "%dest%" ( + rmdir /S /Q "!dest!" + if exist "!dest!" ( + echo - [MakeDirHardLink] Failed to delete destination dir [dest=!dest!] + exit /B 1 + ) +) + +mklink /J "!dest!" "!src!" +if not exist "!dest!" ( + echo - [MakeDirHardLink] Failed to make hard link at dest [src=!src!, dest=!dest!] + exit /B 1 +) +exit /B 0 + :exit exit /B diff --git a/win_install.bat b/win_install.bat index d3093de..ec1f66f 100644 --- a/win_install.bat +++ b/win_install.bat @@ -1,12 +1,11 @@ @echo off setlocal EnableDelayedExpansion -REM ---------------------------------------------------------------------------- REM Setup REM ---------------------------------------------------------------------------- set root_dir=%~dp0 -set home_dir=!root_dir!Home +set home_dir=%userprofile% set installer_dir=!root_dir!Installer set tools_dir=!root_dir!Tools set downloads_dir=!root_dir!Downloads @@ -20,14 +19,19 @@ if not exist !bin_dir! mkdir !bin_dir! set tmp_terminal_script=!tools_dir!\win_terminal.bat.tmp set terminal_script=!tools_dir!\win_terminal.bat echo @echo off> "!tmp_terminal_script!" -echo set HOME=!home_dir!>> "!tmp_terminal_script!" -echo set HOMEPATH=!home_dir!>> "!tmp_terminal_script!" -echo set USERPROFILE=!home_dir!>> "!tmp_terminal_script!" -echo set APPDATA=!home_dir!\AppData>> "!tmp_terminal_script!" -echo set LOCALAPPDATA=!home_dir!\AppData\Local>> "!tmp_terminal_script!" -echo set PATH=!bin_dir!;%%PATH%%>> "!tmp_terminal_script!" +echo setlocal EnableDelayedExpansion>> "!tmp_terminal_script!" + +echo.>> "!tmp_terminal_script!" +echo set working_dir=>> "!tmp_terminal_script!" +echo if "%%~1" neq "" (>> "!tmp_terminal_script!" +echo set working_dir=start --cwd "%%~1">> "!tmp_terminal_script!" +echo set working_dir=^^!working_dir:\=/^^!>> "!tmp_terminal_script!" +echo )>> "!tmp_terminal_script!" +echo.>> "!tmp_terminal_script!" + +echo set PATH=%%~dp0Binaries;%%PATH%%>> "!tmp_terminal_script!" +echo.>> "!tmp_terminal_script!" -REM ---------------------------------------------------------------------------- REM Setup tools for setting up the development environment REM ---------------------------------------------------------------------------- REM We are ultra pedantic and we check the hashes of the distribution but also @@ -38,7 +42,6 @@ REM REM Unforunately, since this is not standard practice to provide by REM distributions we have to calculate them manually. -REM ---------------------------------------------------------------------------- REM Bootstrap 7zip REM ---------------------------------------------------------------------------- REM We get an old version of 7z that is available as a .zip file which we can @@ -47,19 +50,22 @@ set zip7_bootstrap_sha256=2a3afe19c180f8373fa02ff00254d5394fec0349f5804e0ad2f606 set zip7_bootstrap_exe_sha256=c136b1467d669a725478a6110ebaaab3cb88a3d389dfa688e06173c066b76fcf set zip7_bootstrap_version=920 -set zip7_bootstrap_label=7zip_bootstrap_win32_!zip7_bootstrap_version! -set zip7_bootstrap_zip=!downloads_dir!\!zip7_bootstrap_label!.zip -set zip7_bootstrap_dir=!tools_dir!\!zip7_bootstrap_label! +set zip7_bootstrap_download_name=7za!zip7_bootstrap_version! +set zip7_bootstrap_download_file=!zip7_bootstrap_download_name!.zip +set zip7_bootstrap_download_path=!downloads_dir!\!zip7_bootstrap_download_file! +set zip7_bootstrap_download_url="https://www.7-zip.org/a/!zip7_bootstrap_download_file!" + +set zip7_bootstrap_dir=!tools_dir!\7zip_bootstrap_win32_!zip7_bootstrap_version! set zip7_bootstrap_exe=!zip7_bootstrap_dir!\7za.exe if not exist "!zip7_bootstrap_exe!" ( - call win_helpers.bat :DownloadFile "https://www.7-zip.org/a/7za!zip7_bootstrap_version!.zip" "!zip7_bootstrap_zip!" || exit /B %ERRORLEVEL% - call win_helpers.bat :FileHashCheck sha256 "!zip7_bootstrap_zip!" "!zip7_bootstrap_sha256!" || exit /B %ERRORLEVEL% + call win_helpers.bat :DownloadFile "!zip7_bootstrap_download_url!" "!zip7_bootstrap_download_path!" || exit /B %ERRORLEVEL% + call win_helpers.bat :FileHashCheck sha256 "!zip7_bootstrap_download_path!" "!zip7_bootstrap_sha256!" || exit /B %ERRORLEVEL% ) -if not exist "!zip7_bootstrap_dir!" powershell "Expand-Archive !zip7_bootstrap_zip! -DestinationPath !zip7_bootstrap_dir!" || exit /B %ERRORLEVEL% + +if not exist "!zip7_bootstrap_dir!" powershell "Expand-Archive !zip7_bootstrap_download_path! -DestinationPath !zip7_bootstrap_dir!" || exit /B %ERRORLEVEL% call win_helpers.bat :FileHashCheck sha256 "!zip7_bootstrap_exe!" "!zip7_bootstrap_exe_sha256!" || exit /B %ERRORLEVEL% -REM ---------------------------------------------------------------------------- REM 7zip REM ---------------------------------------------------------------------------- REM Use our bootstrap 7z from above to download the latest 7zip version @@ -68,171 +74,346 @@ REM version however can. set zip7_sha256=0b461f0a0eccfc4f39733a80d70fd1210fdd69f600fb6b657e03940a734e5fc1 set zip7_exe_sha256=ed24ed04b5d4a20b3f50fc088a455195c756d7b5315d1965e8c569472b43d939 set zip7_version=2107 +set zip7_name=7zip_win64 -set zip7_label=7zip_win64_!zip7_version! -set zip7_zip=!downloads_dir!\!zip7_label!.exe -set zip7_dir=!tools_dir!\!zip7_label! +set zip7_download_name=7z!zip7_version!-x64 +set zip7_download_file=!zip7_download_name!.exe +set zip7_download_path=!downloads_dir!\!zip7_download_file! +set zip7_download_url="https://www.7-zip.org/a/!zip7_download_file!" + +set zip7_dir_name=!zip7_name!_!zip7_version! +set zip7_dir=!tools_dir!\!zip7_dir_name! set zip7_exe=!zip7_dir!\7z.exe if not exist "!zip7_exe!" ( - call win_helpers.bat :DownloadFile "https://www.7-zip.org/a/7z!zip7_version!-x64.exe" "!zip7_zip!" || exit /B %ERRORLEVEL% - call win_helpers.bat :FileHashCheck sha256 "!zip7_zip!" "!zip7_sha256!" || exit /B %ERRORLEVEL% - "!zip7_bootstrap_exe!" x -y -o"!zip7_dir!" !zip7_zip! || exit /B %ERRORLEVEL% + call win_helpers.bat :DownloadFile "!zip7_download_url!" "!zip7_download_path!" || exit /B %ERRORLEVEL% + call win_helpers.bat :FileHashCheck sha256 "!zip7_download_path!" "!zip7_sha256!" || exit /B %ERRORLEVEL% + "!zip7_bootstrap_exe!" x -y -o"!zip7_dir!" !zip7_download_path! || exit /B %ERRORLEVEL% ) call win_helpers.bat :FileHashCheck sha256 "!zip7_exe!" "!zip7_exe_sha256!" || exit /B %ERRORLEVEL% +call win_helpers.bat :MakeDirHardLink "!tools_dir!\!zip7_name!" "!zip7_dir!" || exit /B %ERRORLEVEL% REM Terminal -echo set PATH=!zip7_dir!;%%PATH%%>> "!tmp_terminal_script!" +echo set PATH=%%~dp0!zip7_dir_name!;%%PATH%%>> "!tmp_terminal_script!" -REM ---------------------------------------------------------------------------- REM GPG Signature Verification REM ---------------------------------------------------------------------------- -set gpg_w32_sha256=1a18adbb24868e14a40ccbd60003108840e238c0893e7bb6908805ae067eb0e8 -set gpg_w32_exe_sha256=ac181fb744df2950880458f8e18eb005de38e5c9858d13f0f772b5ae18c6b157 -set gpg_w32_version=2.3.6 -set gpg_w32_date=20220425 +set gpg_sha256=1a18adbb24868e14a40ccbd60003108840e238c0893e7bb6908805ae067eb0e8 +set gpg_exe_sha256=ac181fb744df2950880458f8e18eb005de38e5c9858d13f0f772b5ae18c6b157 +set gpg_version=2.3.6 +set gpg_date=20220425 +set gpg_name=gpg_win32 -set gpg_w32_label=gpg_win32_!gpg_w32_version! -set gpg_w32_zip=!downloads_dir!\!gpg_w32_label!.exe -set gpg_w32_dir=!tools_dir!\!gpg_w32_label! -set gpg_w32_bin_dir=!gpg_w32_dir!\bin -set gpg_w32_exe=!gpg_w32_bin_dir!\gpg.exe +set gpg_download_name=gnupg-w32-!gpg_version!_!gpg_date! +set gpg_download_file=!gpg_download_name!.exe +set gpg_download_path=!downloads_dir!\!gpg_download_file! +set gpg_download_url="https://gnupg.org/ftp/gcrypt/binary/!gpg_download_file!" -if not exist "!gpg_w32_exe!" ( - call win_helpers.bat :DownloadFile "https://gnupg.org/ftp/gcrypt/binary/gnupg-w32-!gpg_w32_version!_!gpg_w32_date!.exe" "!gpg_w32_zip!" || exit /B %ERRORLEVEL% - call win_helpers.bat :FileHashCheck sha256 "!gpg_w32_zip!" "!gpg_w32_sha256!" || exit /B %ERRORLEVEL% - call win_helpers.bat :Unzip "!zip7_exe!" "!gpg_w32_zip!" "!gpg_w32_dir!" || exit /B %ERRORLEVEL% +set gpg_dir_name=!gpg_name!_!gpg_version! +set gpg_dir=!tools_dir!\!gpg_dir_name! +set gpg_bin_dir=!gpg_dir!\bin +set gpg_exe=!gpg_bin_dir!\gpg.exe + +if not exist "!gpg_exe!" ( + call win_helpers.bat :DownloadFile "!gpg_download_url!" "!gpg_download_path!" || exit /B %ERRORLEVEL% + call win_helpers.bat :FileHashCheck sha256 "!gpg_download_path!" "!gpg_sha256!" || exit /B %ERRORLEVEL% + call win_helpers.bat :Unzip "!zip7_exe!" "!gpg_download_path!" "!gpg_dir!" || exit /B %ERRORLEVEL% ) -call win_helpers.bat :FileHashCheck sha256 "!gpg_w32_exe!" "!gpg_w32_exe_sha256!" || exit /B %ERRORLEVEL% -set PATH="!gpg_w32_bin_dir!";!PATH! +call win_helpers.bat :FileHashCheck sha256 "!gpg_exe!" "!gpg_exe_sha256!" || exit /B %ERRORLEVEL% +set PATH="!gpg_bin_dir!";!PATH! REM Terminal -echo set PATH=!gpg_w32_bin_dir!;%%PATH%%>> "!tmp_terminal_script!" +call win_helpers.bat :MakeDirHardLink "!tools_dir!\!gpg_name!" "!gpg_dir!" || exit /B %ERRORLEVEL% +echo set PATH=%%~dp0!gpg_dir_name!\bin;%%PATH%%>> "!tmp_terminal_script!" -REM ---------------------------------------------------------------------------- REM Application Setup REM ---------------------------------------------------------------------------- REM Download & verify the tools we want for development -REM ---------------------------------------------------------------------------- REM Wezterm REM ---------------------------------------------------------------------------- set wezterm_sha256=c634e98fa9715766bbb00cbc3c8a23d1d558c8cd5716ad2efca45ed4e0ef82f9 set wezterm_exe_sha256=b9b5bae20d0679127ca0c4da276dff3b7b32310bfbfaede26a9b8ecb55e295ce set wezterm_version=20220408-101518-b908e2dd +set wezterm_name=wezterm_win64 -set wezterm_label=wezterm_win64_!wezterm_version! -set wezterm_zip=!downloads_dir!\!wezterm_label!.zip -set wezterm_dir=!tools_dir!\!wezterm_label! +set wezterm_download_name=WezTerm-windows-!wezterm_version! +set wezterm_download_file=!wezterm_download_name!.zip +set wezterm_download_path=!downloads_dir!\!wezterm_download_file! +set wezterm_download_url="https://github.com/wez/wezterm/releases/download/!wezterm_version!/!wezterm_download_file!" + +set wezterm_dir_name=!wezterm_name!_!wezterm_version! +set wezterm_dir=!tools_dir!\!wezterm_dir_name! set wezterm_exe=!wezterm_dir!\wezterm-gui.exe if not exist "!wezterm_exe!" ( - call win_helpers.bat :DownloadFile https://github.com/wez/wezterm/releases/download/!wezterm_version!/WezTerm-windows-!wezterm_version!.zip "!wezterm_zip!" || exit /B %ERRORLEVEL% - call win_helpers.bat :FileHashCheck sha256 "!wezterm_zip!" "!wezterm_sha256!" || exit /B %ERRORLEVEL% - call win_helpers.bat :Unzip "!zip7_exe!" "!wezterm_zip!" "!wezterm_dir!" || exit /B %ERRORLEVEL% - call win_helpers.bat :Move "!wezterm_dir!\wezterm-windows-!wezterm_version!" "!wezterm_dir!" || exit /B %ERRORLEVEL% + call win_helpers.bat :DownloadFile "!wezterm_download_url!" "!wezterm_download_path!" || exit /B %ERRORLEVEL% + call win_helpers.bat :FileHashCheck sha256 "!wezterm_download_path!" "!wezterm_sha256!" || exit /B %ERRORLEVEL% + call win_helpers.bat :Unzip "!zip7_exe!" "!wezterm_download_path!" "!wezterm_dir!" || exit /B %ERRORLEVEL% + call win_helpers.bat :MoveDir "!wezterm_dir!\!wezterm_download_Name!" "!wezterm_dir!" || exit /B %ERRORLEVEL% ) call win_helpers.bat :FileHashCheck sha256 "!wezterm_exe!" "!wezterm_exe_sha256!" || exit /B %ERRORLEVEL% call win_helpers.bat :OverwriteCopy "!installer_dir!\os_wezterm.lua" "!wezterm_dir!\wezterm.lua" || exit /B %ERRORLEVEL% +call win_helpers.bat :MakeDirHardLink "!tools_dir!\!wezterm_name!" "!wezterm_dir!" || exit /B %ERRORLEVEL% -REM ---------------------------------------------------------------------------- REM Jetbrains Mono Font REM ---------------------------------------------------------------------------- set jetbrains_mono_sha256=4e315b4ef176ce7ffc971b14997bdc8f646e3d1e5b913d1ecba3a3b10b4a1a9f set jetbrains_mono_file_sha256=50e1dcb40298fcfcc21a1ef3cbee9fe9e82709c48ad30ce617472c06a3bd9436 set jetbrains_mono_version=2.242 +set jetbrains_mono_name=jetbrains_mono -set jetbrains_mono_label=jetbrains_mono_!jetbrains_mono_version! -set jetbrains_mono_zip=!downloads_dir!\!jetbrains_mono_label!.zip -set jetbrains_mono_dir=!tools_dir!\!jetbrains_mono_label! +set jetbrains_mono_download_name=JetBrainsMono-!jetbrains_mono_version! +set jetbrains_mono_download_file=!jetbrains_mono_download_name!.zip +set jetbrains_mono_download_path=!downloads_dir!\!jetbrains_mono_download_file! +set jetbrains_mono_download_url="https://download.jetbrains.com/fonts/!jetbrains_mono_download_file!" + +set jetbrains_mono_dir=!tools_dir!\!jetbrains_mono_name!_!jetbrains_mono_version! set jetbrains_mono_file=!jetbrains_mono_dir!\fonts\ttf\JetBrainsMono-Regular.ttf if not exist "!jetbrains_mono_file!" ( - call win_helpers.bat :DownloadFile https://download.jetbrains.com/fonts/JetBrainsMono-!jetbrains_mono_version!.zip "!jetbrains_mono_zip!" || exit /B %ERRORLEVEL% - call win_helpers.bat :FileHashCheck sha256 "!jetbrains_mono_zip!" "!jetbrains_mono_sha256!" || exit /B %ERRORLEVEL% - call win_helpers.bat :Unzip "!zip7_exe!" "!jetbrains_mono_zip!" "!jetbrains_mono_dir!" || exit /B %ERRORLEVEL% + call win_helpers.bat :DownloadFile "!jetbrains_mono_download_url!" "!jetbrains_mono_download_path!" || exit /B %ERRORLEVEL% + call win_helpers.bat :FileHashCheck sha256 "!jetbrains_mono_download_path!" "!jetbrains_mono_sha256!" || exit /B %ERRORLEVEL% + call win_helpers.bat :Unzip "!zip7_exe!" "!jetbrains_mono_download_path!" "!jetbrains_mono_dir!" || exit /B %ERRORLEVEL% ) call win_helpers.bat :FileHashCheck sha256 "!jetbrains_mono_file!" "!jetbrains_mono_file_sha256!" || exit /B %ERRORLEVEL% -REM ---------------------------------------------------------------------------- REM Programming REM ---------------------------------------------------------------------------- -REM ---------------------------------------------------------------------------- REM CMake REM ---------------------------------------------------------------------------- -set cmake_sha256=9b509cc4eb7191dc128cfa3f2170036f9cbc7d9d5f93ff7fafc5b2d77b3b40dc -set cmake_exe_sha256=326ae6ce4bd46c27f6ce46c95b48efc19848fd9fc24d71d2e8a226dadfef810c -set cmake_version=3.23.1 +set cmake_version_list=3.23.1 !cmake_version_list! +set cmake_version_list=3.22.2 !cmake_version_list! +set cmake_version_list=3.10.3 !cmake_version_list! +set cmake_version_list=!cmake_version_list! -set cmake_label=cmake_win64_!cmake_version! -set cmake_zip=!downloads_dir!\!cmake_label!.zip -set cmake_dir=!tools_dir!\!cmake_label! -set cmake_bin_dir=!cmake_dir!\bin -set cmake_exe=!cmake_dir!\bin\cmake.exe +for %%a in (%cmake_version_list%) do ( + set cmake_version=%%a + set cmake_download_name=cmake-!cmake_version!-windows-x86_64 -if not exist "!cmake_exe!" ( - call win_helpers.bat :DownloadFile "https://github.com/Kitware/CMake/releases/download/v!cmake_version!/cmake-!cmake_version!-windows-x86_64.zip" "!cmake_zip!" || exit /B %ERRORLEVEL% - call win_helpers.bat :FileHashCheck sha256 "!cmake_zip!" "!cmake_sha256!" || exit /B %ERRORLEVEL% - call win_helpers.bat :Unzip "!zip7_exe!" "!cmake_zip!" "!cmake_dir!" || exit /B %ERRORLEVEL% - call win_helpers.bat :Move "!cmake_dir!/cmake-!cmake_version!-windows-x86_64" "!cmake_dir!" || exit /B %ERRORLEVEL% + if "!cmake_version!"=="3.23.1" ( + set cmake_sha256=9b509cc4eb7191dc128cfa3f2170036f9cbc7d9d5f93ff7fafc5b2d77b3b40dc + set cmake_exe_sha256=326ae6ce4bd46c27f6ce46c95b48efc19848fd9fc24d71d2e8a226dadfef810c + ) else if "!cmake_version!"=="3.22.2" ( + set cmake_sha256=192D62EAECB0600E743F01058DFBD5B6BED91504FE8F56416FEBF54C38CE096E + set cmake_exe_sha256=CF1AF65D22BD01BF1CF2DB7ECEFEB730AB147549755FAA4357E5427E3175F638 + ) else if "!cmake_version!"=="3.10.3" ( + set cmake_sha256=3BD57D1CFCF720A4CC72DB77BDA4C76A7B700FB0341821AD868963AD28856CD0 + set cmake_exe_sha256=F2E3B486D87D2A6BC19B3A62C740028F3F8945875196AC7D3D0E69649E98730A + set cmake_download_name=cmake-!cmake_version!-win64-x64 + ) + + set cmake_download_file=!cmake_download_name!.zip + set cmake_download_path=!downloads_dir!\!cmake_download_file! + set cmake_download_url="https://github.com/Kitware/CMake/releases/download/v!cmake_version!/!cmake_download_file!" + + set cmake_name=cmake_win64 + + set cmake_dir_name=!cmake_name!_!cmake_version! + set cmake_dir=!tools_dir!\!cmake_dir_name! + set cmake_bin_dir=!cmake_dir!\bin + set cmake_exe=!cmake_bin_dir!\cmake.exe + + if not exist "!cmake_exe!" ( + call win_helpers.bat :DownloadFile "!cmake_download_url!" "!cmake_download_path!" || exit /B %ERRORLEVEL% + call win_helpers.bat :FileHashCheck sha256 "!cmake_download_path!" "!cmake_sha256!" || exit /B %ERRORLEVEL% + call win_helpers.bat :Unzip "!zip7_exe!" "!cmake_download_path!" "!cmake_dir!" || exit /B %ERRORLEVEL% + call win_helpers.bat :MoveDir "!cmake_dir!/!cmake_download_name!" "!cmake_dir!" || exit /B %ERRORLEVEL% + ) + + call win_helpers.bat :FileHashCheck sha256 "!cmake_exe!" "!cmake_exe_sha256!" || exit /B %ERRORLEVEL% + call win_helpers.bat :MakeFileHardLink "!bin_dir!\cmake-!cmake_version!.exe" "!cmake_exe!" || exit /B %ERRORLEVEL% ) -call win_helpers.bat :FileHashCheck sha256 "!cmake_exe!" "!cmake_exe_sha256!" || exit /B %ERRORLEVEL% -echo set PATH=!cmake_bin_dir!;%%PATH%%>> "!tmp_terminal_script!" +call win_helpers.bat :MakeDirHardLink "!tools_dir!/!cmake_name!" "!cmake_dir!" || exit /B %ERRORLEVEL% +echo set PATH=%%~dp0cmake_win64\bin;%%PATH%%>> "!tmp_terminal_script!" -REM ---------------------------------------------------------------------------- REM ctags REM ---------------------------------------------------------------------------- set ctags_sha256=B82648E9A3B2C8E50E0283A47B4F013F1B52E0F0E56DBB4F1C805D17578C4DF2 set ctags_exe_sha256=7465E2D34EAF5F901AC45D7E9ED4AC8E7D3A532964D0D77A94F2D0EE3AE145AA set ctags_version=p5.9.20220612.0 +set ctags_name=ctags_win64 -set ctags_label=ctags_win64_!ctags_version! -set ctags_zip=!downloads_dir!\!ctags_label!.zip -set ctags_dir=!tools_dir!\!ctags_label! +set ctags_download_name=ctags-!ctags_version!-x64 +set ctags_download_file=!ctags_download_name!.zip +set ctags_download_path=!downloads_dir!\!ctags_download_file! +set ctags_download_url="https://github.com/universal-ctags/ctags-win32/releases/download/!ctags_version!/!ctags_download_file!" + +set ctags_dir_name=!ctags_name!_!ctags_version! +set ctags_dir=!tools_dir!\!ctags_dir_name! set ctags_exe=!ctags_dir!\ctags.exe if not exist "!ctags_exe!" ( - call win_helpers.bat :DownloadFile "https://github.com/universal-ctags/ctags-win32/releases/download/!ctags_version!/ctags-!ctags_version!-x64.zip" "!ctags_zip!" || exit /B %ERRORLEVEL% - call win_helpers.bat :FileHashCheck sha256 "!ctags_zip!" "!ctags_sha256!" || exit /B %ERRORLEVEL% - call win_helpers.bat :Unzip "!zip7_exe!" "!ctags_zip!" "!ctags_dir!" || exit /B %ERRORLEVEL% - call win_helpers.bat :Move "!ctags_dir!/ctags-!ctags_version!-windows-x86_64" "!ctags_dir!" || exit /B %ERRORLEVEL% + call win_helpers.bat :DownloadFile "!ctags_download_url!" "!ctags_download_path!" || exit /B %ERRORLEVEL% + call win_helpers.bat :FileHashCheck sha256 "!ctags_download_path!" "!ctags_sha256!" || exit /B %ERRORLEVEL% + call win_helpers.bat :Unzip "!zip7_exe!" "!ctags_download_path!" "!ctags_dir!" || exit /B %ERRORLEVEL% ) call win_helpers.bat :FileHashCheck sha256 "!ctags_exe!" "!ctags_exe_sha256!" || exit /B %ERRORLEVEL% -call win_helpers.bat :MakeBatchShortcut "ctags" "!ctags_exe!" "!bin_dir!" || exit /B %ERRORLEVEL% +call win_helpers.bat :MakeFileHardLink "!bin_dir!\ctags.exe" "!ctags_exe!" || exit /B %ERRORLEVEL% +call win_helpers.bat :MakeDirHardLink "!tools_dir!\!ctags_name!" "!ctags_dir!" || exit /B %ERRORLEVEL% +REM doxygen REM ---------------------------------------------------------------------------- +set doxygen_md5=266a2b66914d0d1d96cc97e9f740b74c +set doxygen_exe_sha256=3CB4D89F2B3DB7EEC2B6797DC6B49CDFE9ADDA954575898895260F66F312D730 +set doxygen_version=1.9.4 +set doxygen_name=doxygen_win64 + +set doxygen_download_name=doxygen-!doxygen_version!.windows.x64.bin +set doxygen_download_file=!doxygen_download_name!.zip +set doxygen_download_path=!downloads_dir!\!doxygen_download_file! +set doxygen_download_url="https://downloads.sourceforge.net/project/doxygen/rel-!doxygen_version!/!doxygen_download_file!" + +set doxygen_dir_name=!doxygen_name!_!doxygen_version! +set doxygen_dir=!tools_dir!\!doxygen_dir_name! +set doxygen_exe=!doxygen_dir!\doxygen.exe + +if not exist "!doxygen_exe!" ( + call win_helpers.bat :DownloadFile "!doxygen_download_url!" "!doxygen_download_path!" || exit /B %ERRORLEVEL% + call win_helpers.bat :FileHashCheck md5 "!doxygen_download_path!" "!doxygen_md5!" || exit /B %ERRORLEVEL% + call win_helpers.bat :Unzip "!zip7_exe!" "!doxygen_download_path!" "!doxygen_dir!" || exit /B %ERRORLEVEL% +) +call win_helpers.bat :FileHashCheck sha256 "!doxygen_exe!" "!doxygen_exe_sha256!" || exit /B %ERRORLEVEL% +call win_helpers.bat :MakeFileHardLink "!bin_dir!\doxygen.exe" "!doxygen_exe!" || exit /B %ERRORLEVEL% +call win_helpers.bat :MakeDirHardLink "!tools_dir!\!doxygen_name!" "!doxygen_dir!" || exit /B %ERRORLEVEL% + REM Git REM ---------------------------------------------------------------------------- -set git_sha256=bc030848e282d49e562ae2392a72501cf539322ad06ffe4cea8cf766f148dfe8 -set git_exe_sha256=ae463cad04c2b15fc91de68ab096933ec08c44752e205aebd7d64c3a482df62d -set git_version=2.33.0 +set git_sha256=cdcdb268aaed1dd2ac33d1dfdaf105369e3d7bd8d84d641d26d30b34e706b843 +set git_exe_sha256=6C4DBB77D05CA5C482CE3782255F56BB904445809F1DF3B655E2505EAC7FA0B2 +set git_version=2.38.1 +set git_name_=portable_git_win64 + +set git_download_name=PortableGit-!git_version!-64-bit.7z +set git_download_file=!git_download_name!.exe +set git_download_path=!downloads_dir!\!git_download_file! +set git_download_url="https://github.com/git-for-windows/git/releases/download/v!git_version!.windows.1/!git_download_file!" -set git_label=PortableGit_win64_!git_version! -set git_zip=!downloads_dir!\!git_label!.7z.exe REM Do *NOT* use an environment variable named git_dir as this will conflict REM with git reading it as the directory to base off all git operations. -set git_install_dir=!tools_dir!\!git_label! +set git_install_dir_name=!git_name_!_!git_version! +set git_install_dir=!tools_dir!\!git_install_dir_name! set git_exe=!git_install_dir!\cmd\git.exe if not exist "!git_exe!" ( - call win_helpers.bat :DownloadFile "https://github.com/git-for-windows/git/releases/download/v!git_version!.windows.2/PortableGit-!git_version!.2-64-bit.7z.exe" "!git_zip!" || exit /B %ERRORLEVEL% - call win_helpers.bat :FileHashCheck sha256 "!git_zip!" "!git_sha256!" || exit /B %ERRORLEVEL% - call win_helpers.bat :Unzip "!zip7_exe!" "!git_zip!" "!git_install_dir!" || exit /B %ERRORLEVEL% + call win_helpers.bat :DownloadFile "!git_download_url!" "!git_download_path!" || exit /B %ERRORLEVEL% + call win_helpers.bat :FileHashCheck sha256 "!git_download_path!" "!git_sha256!" || exit /B %ERRORLEVEL% + call win_helpers.bat :Unzip "!zip7_exe!" "!git_download_path!" "!git_install_dir!" || exit /B %ERRORLEVEL% ) call win_helpers.bat :FileHashCheck sha256 "!git_exe!" "!git_exe_sha256!" || exit /B %ERRORLEVEL% +call win_helpers.bat :MakeDirHardLink "!tools_dir!\!git_name_!" "!git_install_dir!" || exit /B %ERRORLEVEL% REM Terminal -echo set PATH=!git_install_dir!\cmd;%%PATH%%>> "!tmp_terminal_script!" -echo set PATH=!git_install_dir!\mingw64\bin;%%PATH%%>> "!tmp_terminal_script!" -echo set PATH=!git_install_dir!\usr\bin;%%PATH%%>> "!tmp_terminal_script!" +echo set PATH=%%~dp0!git_name_!\cmd;%%PATH%%>> "!tmp_terminal_script!" +echo set PATH=%%~dp0!git_name_!\mingw64\bin;%%PATH%%>> "!tmp_terminal_script!" +echo set PATH=%%~dp0!git_name_!\usr\bin;%%PATH%%>> "!tmp_terminal_script!" +REM GCC/MinGW for 32/64bit ARM REM ---------------------------------------------------------------------------- +set gcc_mingw_arm_version_list=12.2.0 !gcc_mingw_arm_version_list! +set gcc_mingw_arm_version_list=11.3.0 !gcc_mingw_arm_version_list! +set gcc_mingw_arm_version_list=10.3.0 !gcc_mingw_arm_version_list! + +set gcc_mingw_arm_arch_list=aarch64-none-elf !gcc_mingw_arm_arch_list! +set gcc_mingw_arm_arch_list=arm-none-eabi !gcc_mingw_arm_arch_list! + +for %%a in (%gcc_mingw_arm_version_list%) do ( + for %%b in (%gcc_mingw_arm_arch_list%) do ( + set gcc_mingw_arm_version=%%a + set gcc_mingw_arm_arch=%%b + set gcc_mingw_arm_exe_sha256=none + + if "!gcc_mingw_arm_arch!"=="aarch64-none-elf" ( + if "!gcc_mingw_arm_version!"=="12.2.0" set gcc_mingw_arm_exe_sha256=A26BAFFA86BC3401790D682F13F9B321EA56153EAE7DD4F332BDE40A6B76FCB3 + if "!gcc_mingw_arm_version!"=="11.3.0" set gcc_mingw_arm_exe_sha256=47EAEF0E603C9FCAE18F2EFADA305888503E878053119EDE3A9E0B8B8BEAC2EE + if "!gcc_mingw_arm_version!"=="10.3.0" set gcc_mingw_arm_exe_sha256=F2B2D3C6DAB0F84A151835540F25E6D6F9442D00BF546BC4C709FAD4B6FDDA06 + ) else ( + if "!gcc_mingw_arm_version!"=="12.2.0" set gcc_mingw_arm_exe_sha256=FA48985C43CF82B426C461381E4C50D0AC3E9425F7E97BF116E1BAB4B3A2A388 + if "!gcc_mingw_arm_version!"=="11.3.0" set gcc_mingw_arm_exe_sha256=A36F2EA6846BADF7C91631F118E88967F25D6E479A9BEEA158445CE75403A655 + if "!gcc_mingw_arm_version!"=="10.3.0" set gcc_mingw_arm_exe_sha256=C3DC49B561D177B3586992DFEA86067EB8799E1586A7F26CEA5B0EA97926632E + ) + + set gcc_mingw_arm_download_name=gcc-v!gcc_mingw_arm_version!-!gcc_mingw_arm_arch! + set gcc_mingw_arm_download_file=!gcc_mingw_arm_download_name!.7z + set gcc_mingw_arm_download_path=!downloads_dir!\!gcc_mingw_arm_download_file! + set gcc_mingw_arm_download_url="https://github.com/mmozeiko/build-gcc-arm/releases/download/gcc-v!gcc_mingw_arm_version!/!gcc_mingw_arm_download_file!" + + set gcc_mingw_arm_dir_name=gcc_mingw_arm_win64_!gcc_mingw_arm_version!_!gcc_mingw_arm_arch! + set gcc_mingw_arm_dir=!tools_dir!\!gcc_mingw_arm_dir_name! + set gcc_mingw_arm_bin_dir=!gcc_mingw_arm_dir!\bin + set gcc_mingw_arm_exe=!gcc_mingw_arm_bin_dir!\!gcc_mingw_arm_arch!-g++.exe + + if not exist "!gcc_mingw_arm_exe!" ( + call win_helpers.bat :DownloadFile "!gcc_mingw_arm_download_url!" "!gcc_mingw_arm_download_path!" || exit /B %ERRORLEVEL% + call win_helpers.bat :Unzip "!zip7_exe!" "!gcc_mingw_arm_download_path!" "!gcc_mingw_arm_dir!" || exit /B %ERRORLEVEL% + call win_helpers.bat :MoveDir "!gcc_mingw_arm_dir!\gcc-v!gcc_mingw_arm_version!-!gcc_mingw_arm_arch!" !gcc_mingw_arm_dir! || exit /B %ERRORLEVEL% + ) + + call win_helpers.bat :FileHashCheck sha256 "!gcc_mingw_arm_exe!" "!gcc_mingw_arm_exe_sha256!" || exit /B %ERRORLEVEL% + call win_helpers.bat :MakeFileHardLink "!bin_dir!\!gcc_mingw_arm_arch!-gcc-!gcc_mingw_arm_version!.exe" "!gcc_mingw_arm_dir!\bin\!gcc_mingw_arm_arch!-gcc.exe" || exit /B %ERRORLEVEL% + call win_helpers.bat :MakeFileHardLink "!bin_dir!\!gcc_mingw_arm_arch!-g++-!gcc_mingw_arm_version!.exe" "!gcc_mingw_arm_dir!\bin\!gcc_mingw_arm_arch!-g++.exe" || exit /B %ERRORLEVEL% + ) +) + +REM GCC+MinGW +REM ---------------------------------------------------------------------------- +set gcc_version_list=12.2.0 !gcc_version_list! +set gcc_version_list=11.3.0 !gcc_version_list! +set gcc_version_list=10.3.0 !gcc_version_list! + +for %%a in (%gcc_version_list%) do ( + set gcc_version=%%a + set gcc_mingw_version=none + set gcc_exe_sha256=none + + if "!gcc_version!"=="12.2.0" ( + set gcc_mingw_version=10.0.0 + set gcc_exe_sha256=886B0F25256DDBD0F4AD09E6E3B81279F9A8B6A1B5C32C714C9C201D802CAA39 + ) + + if "!gcc_version!"=="11.3.0" ( + set gcc_mingw_version=10.0.0 + set gcc_exe_sha256=E92ECFA0171F2AB0C3CA39F2121AB5E887B3A378399A4BE7E056820F5841C7A5 + ) + + if "!gcc_version!"=="10.3.0" ( + set gcc_mingw_version=8.0.0 + set gcc_exe_sha256=5C93B6DA129EA01EE5FC87D5C7DB948FC3BC62BAE261DED9A883F1FA543571D2 + ) + + set gcc_download_name=gcc-v!gcc_version!-mingw-v!gcc_mingw_version!-x86_64 + set gcc_download_file=!gcc_download_name!.7z + set gcc_download_path=!downloads_dir!\!gcc_download_file! + set gcc_download_url="https://github.com/mmozeiko/build-gcc/releases/download/gcc-v!gcc_version!-mingw-v!gcc_mingw_version!/!gcc_download_file!" + + set gcc_dir_name=gcc_!gcc_version!_mingw_!gcc_mingw_version!_win64 + set gcc_dir=!tools_dir!\!gcc_dir_name! + set gcc_bin_dir=!gcc_dir!\bin + set gcc_exe=!gcc_bin_dir!\g++.exe + + if not exist "!gcc_exe!" ( + call win_helpers.bat :DownloadFile "!gcc_download_url!" "!gcc_download_path!" || exit /B %ERRORLEVEL% + call win_helpers.bat :Unzip "!zip7_exe!" "!gcc_download_path!" "!gcc_dir!" || exit /B %ERRORLEVEL% + call win_helpers.bat :MoveDir "!gcc_dir!\gcc-v!gcc_version!-mingw-v!gcc_mingw_version!-x86_64" !gcc_dir! || exit /B %ERRORLEVEL% + ) + + call win_helpers.bat :FileHashCheck sha256 "!gcc_exe!" "!gcc_exe_sha256!" || exit /B %ERRORLEVEL% + call win_helpers.bat :MakeFileHardLink "!bin_dir!\gcc-!gcc_version!.exe" "!gcc_bin_dir!\gcc.exe" || exit /B %ERRORLEVEL% + call win_helpers.bat :MakeFileHardLink "!bin_dir!\g++-!gcc_version!.exe" "!gcc_bin_dir!\g++.exe" || exit /B %ERRORLEVEL% +) + +call win_helpers.bat :MakeFileHardLink "!bin_dir!\gcc.exe" "!gcc_bin_dir!\gcc.exe" || exit /B %ERRORLEVEL% +call win_helpers.bat :MakeFileHardLink "!bin_dir!\g++.exe" "!gcc_bin_dir!\g++.exe" || exit /B %ERRORLEVEL% + +REM Terminal +echo set PATH=%%~dp0!gcc_dir_name!\bin;%%PATH%%>> "!tmp_terminal_script!" + REM LLVM/Clang REM ---------------------------------------------------------------------------- REM NOTE: This list must be in descending order, latest version at the top. This @@ -252,217 +433,225 @@ for %%a in (%llvm_version_list%) do ( if "!llvm_version!"=="12.0.1" set llvm_exe_sha256=9f0748de7f946c210a030452de226986bab46a0121d7236ea0e7b5079cb6dfef if "!llvm_version!"=="11.1.0" set llvm_exe_sha256=F72591F8A02E4B7573AA2FCD2999A3EA76FE729E2468E5414853617268798DFD - set llvm_label=llvm_win64_!llvm_version! - set llvm_zip=!downloads_dir!\!llvm_label!.exe - set llvm_dir=!tools_dir!\!llvm_label! + set llvm_download_name=LLVM-!llvm_version!-win64 + set llvm_download_file=!llvm_download_name!.exe + set llvm_download_path=!downloads_dir!\!llvm_download_file! + set llvm_download_url="https://github.com/llvm/llvm-project/releases/download/llvmorg-!llvm_version!/!llvm_download_file!" + + set llvm_dir_name=llvm_win64_!llvm_version! + set llvm_dir=!tools_dir!\!llvm_dir_name! set llvm_bin_dir=!llvm_dir!\bin set llvm_exe=!llvm_bin_dir!\clang.exe + set llvm_gpg_key_download_url="https://github.com/llvm/llvm-project/releases/download/llvmorg-9.0.1/tstellar-gpg-key.asc" set llvm_gpg_key=!downloads_dir!\llvm_tstellar_gpg_key.asc - set llvm_gpg_sig=!llvm_zip!.sig + set llvm_gpg_sig=!llvm_download_path!.sig if not exist "!llvm_exe!" ( - call win_helpers.bat :DownloadFile "https://github.com/llvm/llvm-project/releases/download/llvmorg-9.0.1/tstellar-gpg-key.asc" "!llvm_gpg_key!" || exit /B %ERRORLEVEL% - call win_helpers.bat :DownloadFile "https://github.com/llvm/llvm-project/releases/download/llvmorg-!llvm_version!/LLVM-!llvm_version!-win64.exe" "!llvm_zip!" || exit /B %ERRORLEVEL% + call win_helpers.bat :DownloadFile "!llvm_gpg_key_download_url!" "!llvm_gpg_key!" || exit /B %ERRORLEVEL% + call win_helpers.bat :DownloadFile "!llvm_download_url!" "!llvm_download_path!" || exit /B %ERRORLEVEL% REM Version 14.0.5 doesn't ship with signatures? REM call win_helpers.bat :DownloadFile "https://github.com/llvm/llvm-project/releases/download/llvmorg-!llvm_version!/LLVM-!llvm_version!-win64.exe.sig" "!llvm_gpg_sig!" || exit /B %ERRORLEVEL% REM gpg --import "!llvm_gpg_key!" || exit /B %ERRORLEVEL% - REM gpg --verify "!llvm_gpg_sig!" "!llvm_zip!" || exit /B %ERRORLEVEL% + REM gpg --verify "!llvm_gpg_sig!" "!llvm_download_path!" || exit /B %ERRORLEVEL% - call win_helpers.bat :Unzip "!zip7_exe!" "!llvm_zip!" "!llvm_dir!" || exit /B %ERRORLEVEL% + call win_helpers.bat :Unzip "!zip7_exe!" "!llvm_download_path!" "!llvm_dir!" || exit /B %ERRORLEVEL% ) call win_helpers.bat :FileHashCheck sha256 "!llvm_exe!" "!llvm_exe_sha256!" || exit /B %ERRORLEVEL% - call win_helpers.bat :MakeBatchShortcut "clang-!llvm_version!" "!llvm_bin_dir!\clang.exe" "!bin_dir!" || exit /B %ERRORLEVEL% - call win_helpers.bat :MakeBatchShortcut "clang++-!llvm_version!" "!llvm_bin_dir!\clang++.exe" "!bin_dir!" || exit /B %ERRORLEVEL% - call win_helpers.bat :MakeBatchShortcut "clang-cl-!llvm_version!" "!llvm_bin_dir!\clang-cl.exe" "!bin_dir!" || exit /B %ERRORLEVEL% + call win_helpers.bat :MakeFileHardLink "!bin_dir!\clang-!llvm_version!.exe" "!llvm_bin_dir!\clang.exe" || exit /B %ERRORLEVEL% + call win_helpers.bat :MakeFileHardLink "!bin_dir!\clang++-!llvm_version!.exe" "!llvm_bin_dir!\clang++.exe" || exit /B %ERRORLEVEL% + call win_helpers.bat :MakeFileHardLink "!bin_dir!\clang-cl-!llvm_version!.exe" "!llvm_bin_dir!\clang-cl.exe" || exit /B %ERRORLEVEL% ) +call win_helpers.bat :MakeFileHardLink "!bin_dir!\clang.exe" "!llvm_bin_dir!\clang.exe" || exit /B %ERRORLEVEL% +call win_helpers.bat :MakeFileHardLink "!bin_dir!\clang++.exe" "!llvm_bin_dir!\clang++.exe" || exit /B %ERRORLEVEL% +call win_helpers.bat :MakeFileHardLink "!bin_dir!\clang-cl.exe" "!llvm_bin_dir!\clang-cl.exe" || exit /B %ERRORLEVEL% + REM Clang Format set clang_format=!home_dir!\clang-format.py call win_helpers.bat :OverwriteCopy "!llvm_dir!\share\clang\clang-format.py" "!clang_format!" || exit /B %ERRORLEVEL% REM Terminal -echo set PATH=!llvm_bin_dir!;%%PATH%%>> "!tmp_terminal_script!" +echo set PATH=%%~dp0!llvm_dir_name!\bin;%%PATH%%>> "!tmp_terminal_script!" -REM ------------------------------------------------------------------------ -REM MinGW64 -REM ------------------------------------------------------------------------ -set mingw_sha256=853970527b5de4a55ec8ca4d3fd732c00ae1c69974cc930c82604396d43e79f8 -set mingw_exe_sha256=c5f0953f7a71ddcdf0852e1e44a43cef9b8fe121beba4d4202bfe6d405de47c0 -set mingw_version=8.1.0 - -set mingw_label=mingw64-posix-seg-rt_v6-rev0_win64_!mingw_version! -set mingw_zip=!downloads_dir!\!mingw_label!.7z -set mingw_dir=!tools_dir!\!mingw_label! -set mingw_bin_dir=!mingw_dir!\bin -set mingw_exe=!mingw_bin_dir!\gcc.exe - -if not exist "!mingw_exe!" ( - call win_helpers.bat :DownloadFile \"https://sourceforge.net/projects/mingw-w64/files/Toolchains targetting Win64/Personal Builds/mingw-builds/!mingw_version!/threads-posix/seh/x86_64-!mingw_version!-release-posix-seh-rt_v6-rev0.7z\" !mingw_zip! || exit /B %ERRORLEVEL% - call win_helpers.bat :FileHashCheck sha256 !mingw_zip! !mingw_sha256! || exit /B %ERRORLEVEL% - call win_helpers.bat :Unzip "!zip7_exe!" !mingw_zip! !mingw_dir! || exit /B %ERRORLEVEL% - call win_helpers.bat :Move !mingw_dir!\mingw64 !mingw_dir! || exit /B %ERRORLEVEL% -) - -call win_helpers.bat :FileHashCheck sha256 "!mingw_exe!" "!mingw_exe_sha256!" || exit /B %ERRORLEVEL% - -REM Terminal -echo set PATH=!mingw_bin_dir!;%%PATH%%>> "!tmp_terminal_script!" - -REM ---------------------------------------------------------------------------- REM ninja REM ---------------------------------------------------------------------------- -set ninja_sha256=bbde850d247d2737c5764c927d1071cbb1f1957dcabda4a130fa8547c12c695f -set ninja_exe_sha256=6a71c03f88897419f19548a8eadd941ed94144bb671be289822080f991c1ab79 -set ninja_version=1.10.2 +set ninja_sha256=524B344A1A9A55005EAF868D991E090AB8CE07FA109F1820D40E74642E289ABC +set ninja_exe_sha256=23E7D60C17B3FCD42D9C00D49ECA3C3771B04D7CCB13E49836B06B34E20211C7 +set ninja_version=1.11.1 +set ninja_name=ninja_win64 -set ninja_label=ninja_win64_!ninja_version! -set ninja_zip=!downloads_dir!\!ninja_label!.zip -set ninja_dir=!tools_dir!\!ninja_label! +set ninja_download_name=ninja-win +set ninja_download_file=!ninja_download_name!.zip +set ninja_download_path=!downloads_dir!\!ninja_download_file! +set ninja_download_url="https://github.com/ninja-build/ninja/releases/download/v!ninja_version!/!ninja_download_file!" + +set ninja_dir_name=!ninja_name!_!ninja_version! +set ninja_dir=!tools_dir!\!ninja_dir_name! set ninja_exe=!ninja_dir!\ninja.exe if not exist "!ninja_exe!" ( - call win_helpers.bat :DownloadFile "https://github.com/ninja-build/ninja/releases/download/v!ninja_version!/ninja-win.zip" "!ninja_zip!" || exit /B %ERRORLEVEL% - call win_helpers.bat :FileHashCheck sha256 "!ninja_zip!" "!ninja_sha256!" || exit /B %ERRORLEVEL% - call win_helpers.bat :Unzip "!zip7_exe!" "!ninja_zip!" "!ninja_dir!" || exit /B %ERRORLEVEL% + call win_helpers.bat :DownloadFile "!ninja_download_url!" "!ninja_download_path!" || exit /B %ERRORLEVEL% + call win_helpers.bat :FileHashCheck sha256 "!ninja_download_path!" "!ninja_sha256!" || exit /B %ERRORLEVEL% + call win_helpers.bat :Unzip "!zip7_exe!" "!ninja_download_path!" "!ninja_dir!" || exit /B %ERRORLEVEL% ) call win_helpers.bat :FileHashCheck sha256 "!ninja_exe!" "!ninja_exe_sha256!" || exit /B %ERRORLEVEL% -call win_helpers.bat :MakeBatchShortcut "ninja" "!ninja_exe!" "!bin_dir!" || exit /B %ERRORLEVEL% +call win_helpers.bat :MakeFileHardLink "!bin_dir!\ninja.exe" "!ninja_exe!" || exit /B %ERRORLEVEL% -REM ---------------------------------------------------------------------------- REM nodejs REM ---------------------------------------------------------------------------- set nodejs_sha256=f7b0e8b0bfcfad7d62eba16fa4db9f085983c12c661bd4c66d8e3bd783befa65 set nodejs_exe_sha256=7f33cbe04cb2940427e6dd97867c1fcf3ddd60911d2ae0260da3cab9f6ea6365 set nodejs_version=16.7.0 +set nodejs_name=nodejs_win64 -set nodejs_label=nodejs_win64_!nodejs_version! -set nodejs_zip=!downloads_dir!\!nodejs_label!.7z -set nodejs_dir=!tools_dir!\!nodejs_label! +set nodejs_download_name=node-v!nodejs_version!-win-x64 +set nodejs_download_file=!nodejs_download_name!.7z +set nodejs_download_path=!downloads_dir!\!nodejs_download_file! +set nodejs_download_url="https://nodejs.org/dist/v!nodejs_version!/!nodejs_download_file!" + +set nodejs_dir_name=!nodejs_name!_!nodejs_version! +set nodejs_dir=!tools_dir!\!nodejs_dir_name! set nodejs_exe=!nodejs_dir!\node.exe if not exist "!nodejs_exe!" ( - call win_helpers.bat :DownloadFile "https://nodejs.org/dist/v!nodejs_version!/node-v!nodejs_version!-win-x64.7z" "!nodejs_zip!" || exit /B %ERRORLEVEL% - call win_helpers.bat :FileHashCheck sha256 "!nodejs_zip!" "!nodejs_sha256!" || exit /B %ERRORLEVEL% - call win_helpers.bat :Unzip "!zip7_exe!" "!nodejs_zip!" "!nodejs_dir!" || exit /B %ERRORLEVEL% - call win_helpers.bat :Move "!nodejs_dir!\node-v!nodejs_version!-win-x64" "!nodejs_dir!" || exit /B %ERRORLEVEL% + call win_helpers.bat :DownloadFile "!nodejs_download_url!" "!nodejs_download_path!" || exit /B %ERRORLEVEL% + call win_helpers.bat :FileHashCheck sha256 "!nodejs_download_path!" "!nodejs_sha256!" || exit /B %ERRORLEVEL% + call win_helpers.bat :Unzip "!zip7_exe!" "!nodejs_download_path!" "!nodejs_dir!" || exit /B %ERRORLEVEL% + call win_helpers.bat :MoveDir "!nodejs_dir!\!nodejs_download_name!" "!nodejs_dir!" || exit /B %ERRORLEVEL% ) call win_helpers.bat :FileHashCheck sha256 "!nodejs_exe!" "!nodejs_exe_sha256!" || exit /B %ERRORLEVEL% +call win_helpers.bat :MakeDirHardLink "!tools_dir!\!nodejs_name!" "!nodejs_dir!" || exit /B %ERROR_LEVEL% REM Terminal -echo set PATH=!nodejs_dir!;%%PATH%%>> "!tmp_terminal_script!" +echo set PATH=%%~dp0!nodejs_dir_name!;%%PATH%%>> "!tmp_terminal_script!" -REM ---------------------------------------------------------------------------- REM Python REM ---------------------------------------------------------------------------- -set python_sha256=93cc3db75dffb4d56b9f64af43294f130f2c222a66de7a1325d0ce8f1ed62e26 -set python_exe_sha256=9042daa88b2d3879a51bfabc2d90d4a56da05ebf184b6492a22a46fdc1c936a4 -set python_version=3.9.0.2dot -set python_version_nodot=3902 -set python_version_dot=3.9.0 +REM We use the shared installation of python since pynvim/greenlet does not work +REM with a static python distribution. +set python_sha256=39EE2B12AAB9E07E2B3CE698331160C55C75CD4AFFEE028F6AE78020711D503C +set python_exe_sha256=8677FBA3EFC27F51EA84C528B24E5824B580CE59CD5714C47073FF2459637687 +set python_date=20220630 +set python_version=3.9.13 +set python_version_and_date=!python_version!+!python_date! +set python_name=cpython3_win64 -set python_label=Winpython64_win64_!python_version_nodot! -set python_zip=!downloads_dir!\!python_label!.zip -set python_dir=!tools_dir!\!python_label! -set python_bin_dir=!python_dir!\python-!python_version_dot!.amd64\ -set python_exe=!python_bin_dir!\python.exe +set python_download_name=cpython-!python_version_and_date!-x86_64-pc-windows-msvc-shared-install_only +set python_download_file=!python_download_name!.tar.gz +set python_download_path=!downloads_dir!\!python_download_file! +set python_download_url="https://github.com/indygreg/python-build-standalone/releases/download/!python_date!/!python_download_file!" + +set python_dir_name=!python_name!_!python_version_and_date! +set python_dir=!tools_dir!\!python_dir_name! +set python_exe=!python_dir!\python.exe if not exist "!python_exe!" ( - call win_helpers.bat :DownloadFile "https://github.com/winpython/winpython/releases/download/3.0.20201028/Winpython64-!python_version!.exe" "!python_zip!" || exit /B %ERRORLEVEL% - call win_helpers.bat :FileHashCheck sha256 "!python_zip!" "!python_sha256!" || exit /B %ERRORLEVEL% - call win_helpers.bat :Unzip "!zip7_exe!" "!python_zip!" "!python_dir!" || exit /B %ERRORLEVEL% - call win_helpers.bat :Move "!python_dir!\WPy64-!python_version_nodot!" "!python_dir!" || exit /B %ERRORLEVEL% + call win_helpers.bat :DownloadFile "!python_download_url!" "!python_download_path!" || exit /B %ERRORLEVEL% + call win_helpers.bat :FileHashCheck sha256 "!python_download_path!" "!python_sha256!" || exit /B %ERRORLEVEL% + call win_helpers.bat :Unzip "!zip7_exe!" "!python_download_path!" "!downloads_dir!" || exit /B %ERRORLEVEL% + call win_helpers.bat :Unzip "!zip7_exe!" "!downloads_dir!\!python_download_name!.tar" "!python_dir!" || exit /B %ERRORLEVEL% + call win_helpers.bat :MoveDir "!python_dir!\python" "!python_dir!" || exit /B %ERRORLEVEL% ) call win_helpers.bat :FileHashCheck sha256 "!python_exe!" "!python_exe_sha256!" || exit /B %ERRORLEVEL% - -set python_bin_dir=!python_dir!\python-!python_version_dot!.amd64 -set python_scripts_bin_dir=!python_bin_dir!\Scripts +call win_helpers.bat :MakeDirHardLink "!tools_dir!\!python_name!" "!python_dir!" || exit /B %ERROR_LEVEL% REM Terminal -echo set PATH=!python_bin_dir!;%%PATH%%>> "!tmp_terminal_script!" -echo set PATH=!python_scripts_bin_dir!;%%PATH%%>> "!tmp_terminal_script!" -echo set PYTHONHOME=!python_bin_dir!>> "!tmp_terminal_script!" +echo set PYTHONHOME=%%~dp0!python_name!>> "!tmp_terminal_script!" +echo set PATH=%%~dp0!python_name!;%%PATH%%>> "!tmp_terminal_script!" +echo set PATH=%%~dp0!python_name!\Scripts;%%PATH%%>> "!tmp_terminal_script!" -REM ---------------------------------------------------------------------------- REM RenderDoc REM ---------------------------------------------------------------------------- set renderdoc_sha256=ed1c1228b8fc30e53d3560dbae9d7bf47b85e0e15e30e6f3e4f36173a74f77bc set renderdoc_exe_sha256=3b4874f1677f08e4c329696eaa8281b7ee86b16ad5679932a72085a3e7abc658 set renderdoc_version=1.19 +set renderdoc_name=renderdoc_win64 -set renderdoc_label=renderdoc_win64_!renderdoc_version! -set renderdoc_zip=!downloads_dir!\!renderdoc_label!.zip -set renderdoc_dir=!tools_dir!\!renderdoc_label! +set renderdoc_download_name=RenderDoc_!renderdoc_version!_64 +set renderdoc_download_file=!renderdoc_download_name!.zip +set renderdoc_download_path=!downloads_dir!\!renderdoc_download_file! +set renderdoc_download_url="https://renderdoc.org/stable/!renderdoc_version!/!renderdoc_download_file!" + +set renderdoc_dir=!tools_dir!\!renderdoc_name!_!renderdoc_version! set renderdoc_exe=!renderdoc_dir!\qrenderdoc.exe if not exist "!renderdoc_exe!" ( - call win_helpers.bat :DownloadFile "https://renderdoc.org/stable/!renderdoc_version!/RenderDoc_!renderdoc_version!_64.zip" "!renderdoc_zip!" || exit /B %ERRORLEVEL% - call win_helpers.bat :FileHashCheck sha256 "!renderdoc_zip!" "!renderdoc_sha256!" || exit /B %ERRORLEVEL% - call win_helpers.bat :Unzip "!zip7_exe!" "!renderdoc_zip!" "!renderdoc_dir!" || exit /B %ERRORLEVEL% - call win_helpers.bat :Move "!renderdoc_dir!\RenderDoc_!renderdoc_version!_64" "!renderdoc_dir!" || exit /B %ERRORLEVEL% + call win_helpers.bat :DownloadFile "!renderdoc_download_url!" "!renderdoc_download_path!" || exit /B %ERRORLEVEL% + call win_helpers.bat :FileHashCheck sha256 "!renderdoc_download_path!" "!renderdoc_sha256!" || exit /B %ERRORLEVEL% + call win_helpers.bat :Unzip "!zip7_exe!" "!renderdoc_download_path!" "!renderdoc_dir!" || exit /B %ERRORLEVEL% + call win_helpers.bat :MoveDir "!renderdoc_dir!\!renderdoc_download_name!" "!renderdoc_dir!" || exit /B %ERRORLEVEL% ) call win_helpers.bat :FileHashCheck sha256 "!renderdoc_exe!" "!renderdoc_exe_sha256!" || exit /B %ERRORLEVEL% +call win_helpers.bat :MakeDirHardLink "!tools_dir!\!renderdoc_name!" "!renderdoc_dir!" || exit /B %ERROR_LEVEL% -REM ---------------------------------------------------------------------------- REM Zeal REM ---------------------------------------------------------------------------- set zeal_sha256=08e9992f620ba0a5ea348471d8ac9c85059e95eedd950118928be639746e3f94 set zeal_exe_sha256=d1e687a33e117b6319210f40e2401b4a68ffeb0f33ef82f5fb6a31ce4514a423 set zeal_version=0.6.1 +set zeal_name=zeal_win64 -set zeal_label=zeal_win64_!zeal_version! -set zeal_zip=!downloads_dir!\!zeal_label!.7z -set zeal_dir=!tools_dir!\!zeal_label! +set zeal_download_name=zeal-portable-!zeal_version!-windows-x64 +set zeal_download_file=!zeal_download_name!.7z +set zeal_download_path=!downloads_dir!\!zeal_download_file! +set zeal_download_url="https://github.com/zealdocs/zeal/releases/download/v!zeal_version!/!zeal_download_file!" + +set zeal_dir=!tools_dir!\!zeal_name!_!zeal_version! set zeal_exe=!zeal_dir!\zeal.exe if not exist "!zeal_exe!" ( - call win_helpers.bat :DownloadFile "https://github.com/zealdocs/zeal/releases/download/v!zeal_version!/zeal-portable-!zeal_version!-windows-x64.7z" "!zeal_zip!" || exit /B %ERRORLEVEL% - call win_helpers.bat :FileHashCheck sha256 "!zeal_zip!" "!zeal_sha256!" || exit /B %ERRORLEVEL% - call win_helpers.bat :Unzip "!zip7_exe!" "!zeal_zip!" "!zeal_dir!" || exit /B %ERRORLEVEL% - call win_helpers.bat :Move "!zeal_dir!\zeal-portable-!zeal_version!-windows-x64" "!zeal_dir!" || exit /B %ERRORLEVEL% + call win_helpers.bat :DownloadFile "!zeal_download_url!" "!zeal_download_path!" || exit /B %ERRORLEVEL% + call win_helpers.bat :FileHashCheck sha256 "!zeal_download_path!" "!zeal_sha256!" || exit /B %ERRORLEVEL% + call win_helpers.bat :Unzip "!zip7_exe!" "!zeal_download_path!" "!zeal_dir!" || exit /B %ERRORLEVEL% + call win_helpers.bat :MoveDir "!zeal_dir!\!zeal_download_name!" "!zeal_dir!" || exit /B %ERRORLEVEL% ) call win_helpers.bat :FileHashCheck sha256 "!zeal_exe!" "!zeal_exe_sha256!" || exit /B %ERRORLEVEL% +call win_helpers.bat :MakeDirHardLink "!tools_dir!\!zeal_name!" "!zeal_dir!" || exit /B %ERROR_LEVEL% -REM ---------------------------------------------------------------------------- REM Zig REM ---------------------------------------------------------------------------- set zig_sha256=443da53387d6ae8ba6bac4b3b90e9fef4ecbe545e1c5fa3a89485c36f5c0e3a2 set zig_exe_sha256=63c2f819cfdb1a35cb954791fc0aa48910a42065a5e1c6ff89ee16775c75a112 set zig_version=0.9.1 -set zig_label=zig_win64_!zig_version! -set zig_zip=!downloads_dir!\!zig_label!.zip -set zig_dir=!tools_dir!\!zig_label! +set zig_download_name=zig-windows-x86_64-!zig_version! +set zig_download_file=!zig_download_name!.zip +set zig_download_path=!downloads_dir!\!zig_download_file! +set zig_download_url="https://ziglang.org/download/!zig_version!/!zig_download_file!" + +set zig_dir_name=zig_win64_!zig_version! +set zig_dir=!tools_dir!\!zig_dir_name! set zig_exe=!zig_dir!\zig.exe if not exist "!zig_exe!" ( - call win_helpers.bat :DownloadFile "https://ziglang.org/download/!zig_version!/zig-windows-x86_64-!zig_version!.zip" "!zig_zip!" || exit /B %ERRORLEVEL% - call win_helpers.bat :FileHashCheck sha256 "!zig_zip!" "!zig_sha256!" || exit /B %ERRORLEVEL% - call win_helpers.bat :Unzip "!zip7_exe!" "!zig_zip!" "!zig_dir!" || exit /B %ERRORLEVEL% - call win_helpers.bat :Move "!zig_dir!\zig-windows-x86_64-!zig_version!" "!zig_dir!" || exit /B %ERRORLEVEL% + call win_helpers.bat :DownloadFile "!zig_download_url!" "!zig_download_path!" || exit /B %ERRORLEVEL% + call win_helpers.bat :FileHashCheck sha256 "!zig_download_path!" "!zig_sha256!" || exit /B %ERRORLEVEL% + call win_helpers.bat :Unzip "!zip7_exe!" "!zig_download_path!" "!zig_dir!" || exit /B %ERRORLEVEL% + call win_helpers.bat :MoveDir "!zig_dir!\!zig_download_name!" "!zig_dir!" || exit /B %ERRORLEVEL% ) call win_helpers.bat :FileHashCheck sha256 "!zig_exe!" "!zig_exe_sha256!" || exit /B %ERRORLEVEL% -call win_helpers.bat :MakeBatchShortcut "zig" "!zig_exe!" "!bin_dir!" || exit /B %ERRORLEVEL% -call win_helpers.bat :MakeBatchShortcut "zig-!zig_version!" "!zig_exe!" "!bin_dir!" || exit /B %ERRORLEVEL% +call win_helpers.bat :MakeFileHardLink "!bin_dir!\zig-!zig_version!.exe" "!zig_exe!" "!bin_dir!" || exit /B %ERRORLEVEL% +call win_helpers.bat :MakeFileHardLink "!bin_dir!\zig.exe" "!zig_exe!" "!bin_dir!" || exit /B %ERRORLEVEL% -REM ---------------------------------------------------------------------------- REM MSVC REM ---------------------------------------------------------------------------- REM This depends on python, so it must be installed after it. -set msvc_version=14.32 -set msvc_sdk_version=20348 -set msvc_dir=!tools_dir!\msvc_win64_!msvc_version!_win10_sdk_!msvc_sdk_version! +set msvc_version=14.33 +set msvc_sdk_version=22621 +set msvc_dir_name=msvc_win64_!msvc_version!_win10_sdk_!msvc_sdk_version! +set msvc_dir=!tools_dir!\!msvc_dir_name! if not exist "!msvc_dir!" ( call "!python_exe!" !installer_dir!\win_portable-msvc.py --accept-license --msvc-version !msvc_version! --sdk-version !msvc_sdk_version! || exit /B %ERRORLEVEL% - call win_helpers.bat :Move "msvc" "!msvc_dir!" || exit /B %ERRORLEVEL% + call win_helpers.bat :MoveDir "msvc" "!msvc_dir!" || exit /B %ERRORLEVEL% ) REM Put the compiler into the path temporarily for compiling some programs on @@ -470,28 +659,45 @@ REM demand in this script. call !msvc_dir!\setup.bat REM Terminal -echo call "!msvc_dir!\setup.bat">> "!tmp_terminal_script!" +echo.>> "!tmp_terminal_script!" +echo call "%%~dp0!msvc_dir_name!\setup.bat">> "!tmp_terminal_script!" +echo.>> "!tmp_terminal_script!" -REM ---------------------------------------------------------------------------- REM Symget REM ---------------------------------------------------------------------------- -REM set symget_dir=!tools_dir!\symget -REM if not exist "!symget_dir!" ( -REM call !git_exe! clone https://github.com/mmozeiko/symget.git !symget_dir! || exit /B %ERRORLEVEL% -REM ) -REM -REM call !git_exe! -C !symget_dir! pull origin main || exit /B %ERRORLEVEL% -REM call !git_exe! -C !symget_dir! checkout 79b026f || exit /B %ERRORLEVEL% +set symget_git_hash=79b026f +set symget_dir=!tools_dir!\symget +set symget_exe=!symget_dir!\symget.exe +if not exist "!symget_dir!" ( + call "!git_exe!" clone "https://github.com/mmozeiko/symget.git" "!symget_dir!" || exit /B %ERRORLEVEL% +) + +REM Extract current git hash of the repository. Remove the last character as +REM rev-parse has a trailing whitespace. +for /F "tokens=1 USEBACKQ" %%F IN (`"!git_exe!" -C !symget_dir! rev-parse --short HEAD`) do ( SET symget_curr_git_hash=%%F ) +set symget_curr_git_hash=!symget_curr_git_hash:~0,-1! + +if !symget_curr_git_hash! neq !symget_git_hash! ( + call "!git_exe!" -C "!symget_dir!" pull origin main || exit /B %ERRORLEVEL% + call "!git_exe!" -C "!symget_dir!" checkout "!symget_git_hash!" || exit /B %ERRORLEVEL% + if exist "!symget_exe!" del /F "!symget_exe!" +) + +if not exist "!symget_exe!" ( + pushd !symget_dir! + call build.cmd + popd +) -REM ---------------------------------------------------------------------------- REM Odin REM ---------------------------------------------------------------------------- -set odin_git_hash=a4cb6f96 -set odin_dir=!tools_dir!\odin_win64 +set odin_git_hash=7fe36de0 +set odin_dir_name=odin_win64 +set odin_dir=!tools_dir!\!odin_dir_name! set odin_exe=!odin_dir!\odin.exe if not exist "!odin_dir!" ( - call !git_exe! clone https://github.com/odin-lang/odin.git !odin_dir! || exit /B %ERRORLEVEL% + call "!git_exe!" clone "https://github.com/odin-lang/odin.git" "!odin_dir!" || exit /B %ERRORLEVEL% ) REM Extract current git hash of the repository. Remove the last character as @@ -499,168 +705,266 @@ REM rev-parse has a trailing whitespace. for /F "tokens=1 USEBACKQ" %%F IN (`"!git_exe!" -C !odin_dir! rev-parse --short HEAD`) do ( SET odin_curr_git_hash=%%F ) set odin_curr_git_hash=!odin_curr_git_hash:~0,-1! -if !odin_curr_git_hash! neq !odin_git_hash! ( - call !git_exe! -C !odin_dir! pull origin master || exit /B %ERRORLEVEL% - call !git_exe! -C !odin_dir! checkout !odin_git_hash! || exit /B %ERRORLEVEL% +if "!odin_curr_git_hash!" neq "!odin_git_hash!" ( + echo - [Git] Required hash changed, rebuilding [curr="!odin_curr_git_hash!", req="!odin_git_hash!"] + call "!git_exe!" -C "!odin_dir!" pull origin master || exit /B %ERRORLEVEL% + call "!git_exe!" -C "!odin_dir!" checkout "!odin_git_hash!" || exit /B %ERRORLEVEL% + if exist "!odin_exe!" del /F "!odin_exe!" ) if not exist "!odin_exe!" ( - pushd !odin_dir! + pushd "!odin_dir!" call build.bat popd ) -call win_helpers.bat :MakeBatchShortcut "odin" "!odin_exe!" "!bin_dir!" || exit /B %ERRORLEVEL% +call win_helpers.bat :MakeRelativeBatchShortcut "odin" "..\!odin_dir_name!\odin.exe" "!bin_dir!" || exit /B %ERRORLEVEL% -REM ---------------------------------------------------------------------------- REM QoL/Tools REM ---------------------------------------------------------------------------- -REM ---------------------------------------------------------------------------- +echo.>> "!tmp_terminal_script!" + REM clink - Bash style tab completion in terminal REM ---------------------------------------------------------------------------- -set clink_sha256=00A516A9D072E46ADF381156703E54CDF086A1F078D006971E6D96DFA0186881 -set clink_exe_sha256=7448FD3BE1CB698A154AAA9F2EB27146B81EE266F27BFE993B342C22C25E520A -set clink_version=1.3.35 -set clink_git_hash=5e327d +set clink_sha256=6FD44B1D085ABC8319108986C0E19B119D54BC84A753397D567A5F62950F0ACC +set clink_exe_sha256=138F680A25C993ACE201B844DEAC7F42D8D3EC9F02042D3DE7E9B6426C8A6D42 +set clink_version=1.3.37 +set clink_git_hash=b85068 -set clink_label=clink_win64_!clink_version! -set clink_zip=!downloads_dir!\!clink_label!.zip -set clink_dir=!tools_dir!\!clink_label! +set clink_download_name=clink.!clink_version!.!clink_git_hash! +set clink_download_file=!clink_download_name!.zip +set clink_download_path=!downloads_dir!\!clink_download_file! +set clink_download_url="https://github.com/chrisant996/clink/releases/download/v!clink_version!/!clink_download_file!" + +set clink_dir_name=clink_win64_!clink_version! +set clink_dir=!tools_dir!\!clink_dir_name! set clink_exe=!clink_dir!\clink_x64.exe -set clink_bat=!clink_dir!\clink.bat if not exist "!clink_exe!" ( - call win_helpers.bat :DownloadFile "https://github.com/chrisant996/clink/releases/download/v!clink_version!/clink.!clink_version!.!clink_git_hash!.zip" "!clink_zip!" || exit /B %ERRORLEVEL% - call win_helpers.bat :FileHashCheck sha256 "!clink_zip!" "!clink_sha256!" || exit /B %ERRORLEVEL% - call win_helpers.bat :Unzip "!zip7_exe!" "!clink_zip!" "!clink_dir!" || exit /B %ERRORLEVEL% + call win_helpers.bat :DownloadFile "!clink_download_url!" "!clink_download_path!" || exit /B %ERRORLEVEL% + call win_helpers.bat :FileHashCheck sha256 "!clink_download_path!" "!clink_sha256!" || exit /B %ERRORLEVEL% + call win_helpers.bat :Unzip "!zip7_exe!" "!clink_download_path!" "!clink_dir!" || exit /B %ERRORLEVEL% call win_helpers.bat :OverwriteCopy "!clink_dir!\_default_inputrc" "!clink_dir!\default_inputrc" || exit /B %ERRORLEVEL% call win_helpers.bat :OverwriteCopy "!clink_dir!\_default_settings" "!clink_dir!\default_settings" || exit /B %ERRORLEVEL% ) call win_helpers.bat :FileHashCheck sha256 "!clink_exe!" "!clink_exe_sha256!" || exit /B %ERRORLEVEL% -call win_helpers.bat :MakeBatchShortcut "clink" "!clink_bat!" "!bin_dir!" || exit /B %ERRORLEVEL% +call win_helpers.bat :MakeRelativeBatchShortcut "clink" "..\!clink_dir_name!\clink.bat" "!bin_dir!" || exit /B %ERRORLEVEL% REM Clink Completion Addon -set clink_completions_dir=!tools_dir!\clink-completions +set clink_completions_git_hash=fa18736 +set clink_completions_dir_name=clink-completions +set clink_completions_dir=!tools_dir!\!clink_completions_dir_name! if not exist "!clink_completions_dir!" ( call !git_exe! clone https://github.com/vladimir-kotikov/clink-completions !clink_completions_dir! || exit /B %ERRORLEVEL% ) -call !git_exe! -C !clink_completions_dir! pull origin master || exit /B %ERRORLEVEL% -call !git_exe! -C !clink_completions_dir! checkout 9ab9342 || exit /B %ERRORLEVEL% + +REM Extract current git hash of the repository. Remove the last character as +REM rev-parse has a trailing whitespace. +for /F "tokens=1 USEBACKQ" %%F IN (`"!git_exe!" -C !clink_completions_dir! rev-parse --short HEAD`) do ( SET clink_completions_curr_git_hash=%%F ) +set clink_completions_curr_git_hash=!clink_completions_curr_git_hash:~0,-1! + +if "!clink_completions_curr_git_hash!" neq "!clink_completions_git_hash!" ( + echo - [Git] Required hash changed, rebuilding [curr="!clink_completions_curr_git_hash!", req="!clink_completions_git_hash!"] + call "!git_exe!" -C "!clink_completions_dir!" pull origin master || exit /B %ERRORLEVEL% + call "!git_exe!" -C "!clink_completions_dir!" checkout "!clink_completions_git_hash!" || exit /B %ERRORLEVEL% +) + REM Terminal Script -echo set CLINK_PATH=!clink_completions_dir!>> "!tmp_terminal_script! +echo set CLINK_PATH=%%~dp0!clink_completions_dir_name!>> "!tmp_terminal_script! -REM ---------------------------------------------------------------------------- REM Dependencies (Walker) - For DLL dependency management REM ---------------------------------------------------------------------------- set dependencies_sha256=7d22dc00f1c09fd4415d48ad74d1cf801893e83b9a39944b0fce6dea7ceaea99 set dependencies_exe_sha256=1737e5406128c3560bbb2bced3ac62d77998e592444f94b10cc0aa0bb1e617e6 set dependencies_version=1.11.1 +set dependencies_name=dependencies_win64 -set dependencies_label=dependencies_win64_!dependencies_version! -set dependencies_zip=!downloads_dir!\!dependencies_label!.zip -set dependencies_dir=!tools_dir!\!dependencies_label! +set dependencies_download_name=Dependencies_x64_Release +set dependencies_download_file=!dependencies_download_name!.zip +set dependencies_download_path=!downloads_dir!\!dependencies_download_file! +set dependencies_download_url="https://github.com/lucasg/Dependencies/releases/download/v!dependencies_version!/!dependencies_download_file!" + +set dependencies_dir=!tools_dir!\!dependencies_name!_!dependencies_version! set dependencies_exe=!dependencies_dir!\DependenciesGui.exe if not exist "!dependencies_exe!" ( - call win_helpers.bat :DownloadFile "https://github.com/lucasg/Dependencies/releases/download/v!dependencies_version!/Dependencies_x64_Release.zip" "!dependencies_zip!" || exit /B %ERRORLEVEL% - call win_helpers.bat :FileHashCheck sha256 "!dependencies_zip!" "!dependencies_sha256!" || exit /B %ERRORLEVEL% - call win_helpers.bat :Unzip "!zip7_exe!" "!dependencies_zip!" "!dependencies_dir!" || exit /B %ERRORLEVEL% + call win_helpers.bat :DownloadFile "!dependencies_download_url!" "!dependencies_download_path!" || exit /B %ERRORLEVEL% + call win_helpers.bat :FileHashCheck sha256 "!dependencies_download_path!" "!dependencies_sha256!" || exit /B %ERRORLEVEL% + call win_helpers.bat :Unzip "!zip7_exe!" "!dependencies_download_path!" "!dependencies_dir!" || exit /B %ERRORLEVEL% ) call win_helpers.bat :FileHashCheck sha256 "!dependencies_exe!" "!dependencies_exe_sha256!" || exit /B %ERRORLEVEL% +call win_helpers.bat :MakeDirHardLink "!tools_dir!\!dependencies_name!" "!dependencies_dir!" || exit /B %ERROR_LEVEL% -REM ---------------------------------------------------------------------------- REM everything (void tools search program) REM ---------------------------------------------------------------------------- -set everything_sha256=656ff3946222048a5558160023da6fd8abc6fa9569f7ac1dff058410a3db6f28 -set everything_exe_sha256=8f853443c0b0e8c144315a27d1e8bf1595bd09cb364393226accfe105c0a2c85 -set everything_version=1.4.1.1015 +set everything_sha256=844B6B8DBF202F6C91176589C4379EA51B39F8A85440F6EB97B8F56E59846759 +set everything_exe_sha256=9be6f6bd6a1d1fd528f63915d5373287b0c2abc38e588c19ae13225dde75dfa9 +set everything_version=1.5.0.1329a +set everything_name=everything_win64 -set everything_label=everything_win64_!everything_version! -set everything_zip=!downloads_dir!\!everything_label!.zip -set everything_dir=!tools_dir!\!everything_label! -set everything_exe=!everything_dir!\everything.exe +set everything_download_name=Everything-!everything_version!.x64 +set everything_download_file=!everything_download_name!.zip +set everything_download_path=!downloads_dir!\!everything_download_file! +set everything_download_url="https://www.voidtools.com/!everything_download_file!" + +set everything_dir_name=!everything_name!_!everything_version! +set everything_dir=!tools_dir!\!everything_dir_name! +set everything_exe=!everything_dir!\Everything64.exe if not exist "!everything_exe!" ( - call win_helpers.bat :DownloadFile "https://www.voidtools.com/Everything-!everything_version!.x64.zip" "!everything_zip!" || exit /B %ERRORLEVEL% - call win_helpers.bat :FileHashCheck sha256 "!everything_zip!" "!everything_sha256!" || exit /B %ERRORLEVEL% - call win_helpers.bat :Unzip "!zip7_exe!" "!everything_zip!" "!everything_dir!" || exit /B %ERRORLEVEL% + call win_helpers.bat :DownloadFile "!everything_download_url!" "!everything_download_path!" || exit /B %ERRORLEVEL% + call win_helpers.bat :FileHashCheck sha256 "!everything_download_path!" "!everything_sha256!" || exit /B %ERRORLEVEL% + call win_helpers.bat :Unzip "!zip7_exe!" "!everything_download_path!" "!everything_dir!" || exit /B %ERRORLEVEL% + + if exist "!tools_dir!/everything_win64" ( + rmdir "!tools_dir!/everything_win64" + mklink /J "!tools_dir!/everything_win64" "!everything_dir!" + ) ) call win_helpers.bat :FileHashCheck sha256 "!everything_exe!" "!everything_exe_sha256!" || exit /B %ERRORLEVEL% +call win_helpers.bat :MakeDirHardLink "!tools_dir!\!everything_name!" "!everything_dir!" || exit /B %ERROR_LEVEL% -REM ---------------------------------------------------------------------------- REM fzf REM ---------------------------------------------------------------------------- set fzf_sha256=AB0ED3255564DF1A6643FF492EBC728C25F3DF9EAA5C11AC7A28CF661667412F set fzf_exe_sha256=C41293D9E632C5A3604AD863389C0BEC7AC2AD1E3C1F51B60EA2271A63BBB3D2 set fzf_version=0.30.0 -set fzf_label=fzf_win64_!fzf_version! -set fzf_zip=!downloads_dir!\!fzf_label!.zip +set fzf_download_name=fzf-!fzf_version!-windows_amd64 +set fzf_download_file=!fzf_download_name!.zip +set fzf_download_path=!downloads_dir!\!fzf_download_file! +set fzf_download_url="https://github.com/junegunn/fzf/releases/download/!fzf_version!/!fzf_download_file!" + set fzf_dir=!tools_dir! set fzf_exe=!fzf_dir!\fzf_win64_!fzf_version!.exe if not exist "!fzf_exe!" ( - call win_helpers.bat :DownloadFile "https://github.com/junegunn/fzf/releases/download/!fzf_version!/fzf-!fzf_version!-windows_amd64.zip" "!fzf_zip!" || exit /B %ERRORLEVEL% - call win_helpers.bat :FileHashCheck sha256 "!fzf_zip!" "!fzf_sha256!" || exit /B %ERRORLEVEL% - call win_helpers.bat :Unzip "!zip7_exe!" "!fzf_zip!" "!fzf_dir!" || exit /B %ERRORLEVEL% + call win_helpers.bat :DownloadFile "!fzf_download_url!" "!fzf_download_path!" || exit /B %ERRORLEVEL% + call win_helpers.bat :FileHashCheck sha256 "!fzf_download_path!" "!fzf_sha256!" || exit /B %ERRORLEVEL% + call win_helpers.bat :Unzip "!zip7_exe!" "!fzf_download_path!" "!fzf_dir!" || exit /B %ERRORLEVEL% move /Y "!fzf_dir!\fzf.exe" "!fzf_exe!" 1>NUL || exit /B %ERRORLEVEL% ) call win_helpers.bat :FileHashCheck sha256 "!fzf_exe!" "!fzf_exe_sha256!" || exit /B %ERRORLEVEL% -call win_helpers.bat :MakeBatchShortcut "fzf" "!fzf_exe!" "!bin_dir!" || exit /B %ERRORLEVEL% +call win_helpers.bat :MakeFileHardLink "!bin_dir!\fzf.exe" "!fzf_exe!" || exit /B %ERRORLEVEL% REM Terminal REM Use FD for FZF to make it ultra fast echo set FZF_DEFAULT_OPTS=--multi --layout=reverse>> "!tmp_terminal_script!" -echo set FZF_DEFAULT_COMMAND=fd --unrestricted>> "!tmp_terminal_script!" +echo set FZF_DEFAULT_COMMAND=fd --type f --strip-cwd-prefix --hidden --follow --exclude .git --exclude .cache --exclude .vs>> "!tmp_terminal_script!" +REM jpegview REM ---------------------------------------------------------------------------- +set jpegview_sha256=82BA6F84A7D7C88C655253ACB41FFED9E8667CF1F3AC9573836952C08C4DC82C +set jpegview_exe_sha256=1FFE58601AB160C57D01823FAC8BFEB36C1BFD782E6F60ADFA57EED6240B09B3 +set jpegview_version=1.0.40 +set jpegview_name=jpegview_win64 + +set jpegview_download_name=JPEGView_!jpegview_version! +set jpegview_download_file=!jpegview_download_name!.7z +set jpegview_download_path=!downloads_dir!\!jpegview_download_file! +set jpegview_download_url="https://github.com/sylikc/jpegview/releases/download/v!jpegview_version!/!jpegview_download_file!" + +set jpegview_dir_name=!jpegview_name!_!jpegview_version! +set jpegview_dir=!tools_dir!\!jpegview_dir_name! +set jpegview_exe=!jpegview_dir!\JPEGView.exe + +if not exist "!jpegview_exe!" ( + call win_helpers.bat :DownloadFile "!jpegview_download_url!" "!jpegview_download_path!" || exit /B %ERRORLEVEL% + call win_helpers.bat :FileHashCheck sha256 "!jpegview_download_path!" "!jpegview_sha256!" || exit /B %ERRORLEVEL% + call win_helpers.bat :Unzip "!zip7_exe!" "!jpegview_download_path!" "!jpegview_dir!" || exit /B %ERRORLEVEL% + call win_helpers.bat :MoveDir "!jpegview_dir!\JPEGView64" "!jpegview_dir!" || exit /B %ERRORLEVEL% + rmdir /s /q "!jpegview_dir!\JPEGView32" || exit /B %ERRORLEVEL% + del "!jpegview_dir!\HowToInstall.txt" "!jpegview_dir!\HowToInstall_ru.txt" || exit /B %ERRORLEVEL% +) + +call win_helpers.bat :FileHashCheck sha256 "!jpegview_exe!" "!jpegview_exe_sha256!" || exit /B %ERRORLEVEL% +call win_helpers.bat :MakeDirHardLink "!tools_dir!\!jpegview_name!" "!jpegview_dir!" || exit /B %ERROR_LEVEL% + +REM mpc_qt +REM ---------------------------------------------------------------------------- +set mpc_qt_sha256=2230c4f4de1a429ccc67e5c590efc0a86fbaffeb33a4dc5f391aa45e660b80c2 +set mpc_qt_exe_sha256=d7ee46b0d4a61a26f8acd5d5fd4da2d252d6bc80c5cab6a55db06e853f2acefb +set mpc_qt_version=22.02 +set mpc_qt_version_no_dot=2202 +set mpc_qt_name=mpc-qt_win64 + +set mpc_qt_download_name=mpc-qt-win-x64-!mpc_qt_version_no_dot! +set mpc_qt_download_file=!mpc_qt_download_name!.zip +set mpc_qt_download_path=!downloads_dir!\!mpc_qt_download_file! +set mpc_qt_download_url="https://github.com/mpc-qt/mpc-qt/releases/download/v!mpc_qt_version!/!mpc_qt_download_file!" + +set mpc_qt_dir_name=!mpc_qt_name!_!mpc_qt_version! +set mpc_qt_dir=!tools_dir!\!mpc_qt_dir_name! +set mpc_qt_exe=!mpc_qt_dir!\mpc-qt.exe + +if not exist "!mpc_qt_exe!" ( + call win_helpers.bat :DownloadFile "!mpc_qt_download_url!" "!mpc_qt_download_path!" || exit /B %ERRORLEVEL% + call win_helpers.bat :FileHashCheck sha256 "!mpc_qt_download_path!" "!mpc_qt_sha256!" || exit /B %ERRORLEVEL% + call win_helpers.bat :Unzip "!zip7_exe!" "!mpc_qt_download_path!" "!mpc_qt_dir!" || exit /B %ERRORLEVEL% +) + +call win_helpers.bat :FileHashCheck sha256 "!mpc_qt_exe!" "!mpc_qt_exe_sha256!" || exit /B %ERRORLEVEL% +call win_helpers.bat :MakeDirHardLink "!tools_dir!\!mpc_qt_name!" "!mpc_qt_dir!" || exit /B %ERROR_LEVEL% + REM NVIM REM ---------------------------------------------------------------------------- set nvim_sha256=a72a90e2897ea296b777c325a37c981a0b51e2fe0c8b8735e3366b65e958cddc set nvim_exe_sha256=E2B9B9C38EE169475EEAE4501278A36A93C7A4F08F6E5379CA65A166041B8DA8 set nvim_version=0.7.0 +set nvim_name=nvim_win64 -set nvim_label=nvim_win64_!nvim_version! -set nvim_zip=!downloads_dir!\!nvim_label!.zip -set nvim_dir=!tools_dir!\!nvim_label! -set nvim_exe=!nvim_dir!\bin\nvim.exe +set nvim_download_name=nvim-win64 +set nvim_download_file=!nvim_download_name!.zip +set nvim_download_path=!downloads_dir!\!nvim_download_file! +set nvim_download_url="https://github.com/neovim/neovim/releases/download/v!nvim_version!/!nvim_download_file!" + +set nvim_dir_name=!nvim_name!_!nvim_version! +set nvim_dir=!tools_dir!\!nvim_dir_name! +set nvim_bin_dir=!nvim_dir!\bin +set nvim_exe=!nvim_bin_dir!\nvim.exe if not exist "!nvim_exe!" ( - call win_helpers.bat :DownloadFile "https://github.com/neovim/neovim/releases/download/v!nvim_version!/nvim-win64.zip" "!nvim_zip!" || exit /B %ERRORLEVEL% - call win_helpers.bat :FileHashCheck sha256 "!nvim_zip!" "!nvim_sha256!" || exit /B %ERRORLEVEL% - call win_helpers.bat :Unzip "!zip7_exe!" "!nvim_zip!" "!nvim_dir!" || exit /B %ERRORLEVEL% - call win_helpers.bat :Move "!nvim_dir!\nvim-win64" "!nvim_dir!" || exit /B %ERRORLEVEL% + call win_helpers.bat :DownloadFile "!nvim_download_url!" "!nvim_download_path!" || exit /B %ERRORLEVEL% + call win_helpers.bat :FileHashCheck sha256 "!nvim_download_path!" "!nvim_sha256!" || exit /B %ERRORLEVEL% + call win_helpers.bat :Unzip "!zip7_exe!" "!nvim_download_path!" "!nvim_dir!" || exit /B %ERRORLEVEL% + call win_helpers.bat :MoveDir "!nvim_dir!\!nvim_download_name!" "!nvim_dir!" || exit /B %ERRORLEVEL% ) call win_helpers.bat :FileHashCheck sha256 "!nvim_exe!" "!nvim_exe_sha256!" || exit /B %ERRORLEVEL% -call win_helpers.bat :MakeBatchShortcut "nvim" "!nvim_exe!" "!bin_dir!" || exit /B %ERRORLEVEL% -call win_helpers.bat :MakeBatchShortcut "nvim-qt" "!nvim_dir!\bin\nvim-qt.exe" "!bin_dir!" || exit /B %ERRORLEVEL% +call win_helpers.bat :MakeFileHardLink "!bin_dir!\nvim.exe" "!nvim_bin_dir!\nvim.exe" || exit /B %ERRORLEVEL% +call win_helpers.bat :MakeFileHardLink "!bin_dir!\nvim-qt.exe" "!nvim_bin_dir!\nvim-qt.exe" || exit /B %ERRORLEVEL% + +REM Terminal +echo set PATH=%%~dp0!nvim_dir_name!\bin;%%PATH%%>> "!tmp_terminal_script!" -REM ---------------------------------------------------------------------------- REM Neovide REM ---------------------------------------------------------------------------- -set neovide_sha256=D1DE20E0FCBF68CB4D85CD6F15691DFB77848DAFB97519F8E67E3036A2A7927D -set neovide_exe_sha256=C0F6ED7ED8BAC4EE910267FA785DA698A581004EA45838BE401E3FBA18DD3234 -set neovide_version=0.9.0 +set neovide_sha256=944E75545F8FAE08AE42FDB0D2073F699C7ED209EC02B2BEDF062377C0929456 +set neovide_exe_sha256=2808A6719241407AA956044DF553D6008C6D8DB3BB00D24B50893F03978E07CF +set neovide_version=0.10.1 -set neovide_label=neovide_win64_!neovide_version! -set neovide_zip=!downloads_dir!\!neovide_label!.zip -set neovide_dir=!tools_dir!\!neovide_label! -set neovide_exe=!neovide_dir!\neovide.exe +set neovide_download_name=neovide-windows +set neovide_download_file=!neovide_download_name!.zip +set neovide_download_path=!downloads_dir!\!neovide_download_file! +set neovide_download_url="https://github.com/neovide/neovide/releases/download/!neovide_version!/!neovide_download_file!" + +set neovide_dir=!tools_dir! +set neovide_exe=!neovide_dir!\neovide_win64_!neovide_version!.exe if not exist "!neovide_exe!" ( - call win_helpers.bat :DownloadFile "https://github.com/neovide/neovide/releases/download/!neovide_version!/neovide-windows.zip" "!neovide_zip!" || exit /B %ERRORLEVEL% - call win_helpers.bat :FileHashCheck sha256 "!neovide_zip!" "!neovide_sha256!" || exit /B %ERRORLEVEL% - call win_helpers.bat :Unzip "!zip7_exe!" "!neovide_zip!" "!neovide_dir!" || exit /B %ERRORLEVEL% + call win_helpers.bat :DownloadFile "!neovide_download_url!" "!neovide_download_path!" || exit /B %ERRORLEVEL% + call win_helpers.bat :FileHashCheck sha256 "!neovide_download_path!" "!neovide_sha256!" || exit /B %ERRORLEVEL% + call win_helpers.bat :Unzip "!zip7_exe!" "!neovide_download_path!" "!neovide_dir!" || exit /B %ERRORLEVEL% + move /Y "!neovide_dir!\neovide.exe" "!neovide_exe!" || exit /B %ERRORLEVEL% ) call win_helpers.bat :FileHashCheck sha256 "!neovide_exe!" "!neovide_exe_sha256!" || exit /B %ERRORLEVEL% -call win_helpers.bat :MakeBatchShortcut "neovide" "!neovide_exe!" "!bin_dir!" || exit /B %ERRORLEVEL% +call win_helpers.bat :MakeFileHardLink "!bin_dir!\neovide.exe" "!neovide_exe!" || exit /B %ERRORLEVEL% REM Vim Configuration REM ---------------------------------------------------------------------------- @@ -676,51 +980,59 @@ if not exist "!vim_plug_dir!" mkdir "!vim_plug_dir!" call win_helpers.bat :DownloadFile "https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim" "!vim_plug!" || exit /B %ERRORLEVEL% REM Install Python NVIM module, for :py3 support -set PYTHONHOME=!python_bin_dir! -!python_bin_dir!\Scripts\pip.exe install pynvim cmake-language-server +set PYTHONHOME=!python_dir! +!python_dir!\python.exe -m pip install pynvim cmake-language-server -REM ---------------------------------------------------------------------------- REM ImHex REM ---------------------------------------------------------------------------- -set imhex_sha256=080f537d3ea58c002cc2112adbec1352144710b43764de9a1dc04f129d3a3343 -set imhex_exe_sha256=6a4b0e70bf7c78af074af0de2346164d9f5aec28ea224f9ee903412e1c774d95 -set imhex_version=1.17.0 +set imhex_sha256=996FF7A1F26B40CED225A9D3CC7D9B695EA389895BC2BBBA7734C39FC5044E2A +set imhex_exe_sha256=843166E3192D1443938B32CC4695E47B153FD94787875816A76C95D2F6F15A4B +set imhex_version=1.25.0 +set imhex_name=imhex_win64 -set imhex_label=imhex_win64_!imhex_version! -set imhex_zip=!downloads_dir!\!imhex_label!.zip -set imhex_dir=!tools_dir!\!imhex_label! +set imhex_download_name=imhex-!imhex_version!-Windows-Portable +set imhex_download_file=!imhex_download_name!.zip +set imhex_download_path=!downloads_dir!\!imhex_download_file! +set imhex_download_url="https://github.com/WerWolv/ImHex/releases/download/v!imhex_version!/!imhex_download_file!" + +set imhex_dir=!tools_dir!\!imhex_name!_!imhex_version! set imhex_exe=!imhex_dir!\imhex.exe if not exist "!imhex_exe!" ( - call win_helpers.bat :DownloadFile "https://github.com/WerWolv/ImHex/releases/download/v!imhex_version!/Windows.Portable.ZIP.zip" "!imhex_zip!" || exit /B %ERRORLEVEL% - call win_helpers.bat :FileHashCheck sha256 "!imhex_zip!" "!imhex_sha256!" || exit /B %ERRORLEVEL% - call win_helpers.bat :Unzip "!zip7_exe!" "!imhex_zip!" "!imhex_dir!" || exit /B %ERRORLEVEL% + call win_helpers.bat :DownloadFile "!imhex_download_url!" "!imhex_download_path!" || exit /B %ERRORLEVEL% + call win_helpers.bat :FileHashCheck sha256 "!imhex_download_path!" "!imhex_sha256!" || exit /B %ERRORLEVEL% + call win_helpers.bat :Unzip "!zip7_exe!" "!imhex_download_path!" "!imhex_dir!" || exit /B %ERRORLEVEL% ) call win_helpers.bat :FileHashCheck sha256 "!imhex_exe!" "!imhex_exe_sha256!" || exit /B %ERRORLEVEL% +call win_helpers.bat :MakeDirHardLink "!tools_dir!\!imhex_name!" "!imhex_dir!" || exit /B %ERRORLEVEL% -REM ---------------------------------------------------------------------------- REM Keypirinha REM ---------------------------------------------------------------------------- set keypirinha_sha256=d109a16e6a5cf311abf6d06bbe5b1be3b9ba323b79c32a168628189e10f102a5 set keypirinha_exe_sha256=2d3adb36a04e9fdf94636c9ac5d4c2b754accbfaecd81f4ee7189c3c0edc8af1 set keypirinha_version=2.26 +set keypirinha_name=keypirinha_win64 -set keypirinha_label=keypirinha_win64_!keypirinha_version! -set keypirinha_zip=!downloads_dir!\!keypirinha_label!.7z -set keypirinha_dir=!tools_dir!\!keypirinha_label! +set keypirinha_download_name=keypirinha-!keypirinha_version!-x64-portable +set keypirinha_download_file=!keypirinha_download_name!.7z +set keypirinha_download_path=!downloads_dir!\!keypirinha_download_file! +set keypirinha_download_url="https://github.com/Keypirinha/Keypirinha/releases/download/v!keypirinha_version!/!keypirinha_download_file!" + +set keypirinha_dir_name=!keypirinha_name!_!keypirinha_version! +set keypirinha_dir=!tools_dir!\!keypirinha_dir_name! set keypirinha_exe=!keypirinha_dir!\keypirinha.exe if not exist "!keypirinha_exe!" ( - call win_helpers.bat :DownloadFile "https://github.com/Keypirinha/Keypirinha/releases/download/v!keypirinha_version!/keypirinha-!keypirinha_version!-x64-portable.7z" "!keypirinha_zip!" || exit /B %ERRORLEVEL% - call win_helpers.bat :FileHashCheck sha256 "!keypirinha_zip!" "!keypirinha_sha256!" || exit /B %ERRORLEVEL% - call win_helpers.bat :Unzip "!zip7_exe!" "!keypirinha_zip!" "!keypirinha_dir!" || exit /B %ERRORLEVEL% - call win_helpers.bat :Move "!keypirinha_dir!\keypirinha" "!keypirinha_dir!" || exit /B %ERRORLEVEL% + call win_helpers.bat :DownloadFile "!keypirinha_download_url!" "!keypirinha_download_path!" || exit /B %ERRORLEVEL% + call win_helpers.bat :FileHashCheck sha256 "!keypirinha_download_path!" "!keypirinha_sha256!" || exit /B %ERRORLEVEL% + call win_helpers.bat :Unzip "!zip7_exe!" "!keypirinha_download_path!" "!keypirinha_dir!" || exit /B %ERRORLEVEL% + call win_helpers.bat :MoveDir "!keypirinha_dir!\keypirinha" "!keypirinha_dir!" || exit /B %ERRORLEVEL% ) call win_helpers.bat :FileHashCheck sha256 "!keypirinha_exe!" "!keypirinha_exe_sha256!" || exit /B %ERRORLEVEL% +call win_helpers.bat :MakeDirHardLink "!tools_dir!\!keypirinha_name!" "!keypirinha_dir!" || exit /B %ERRORLEVEL% -REM ---------------------------------------------------------------------------- REM Misc Tools REM ---------------------------------------------------------------------------- REM ctags: C/C++ code annotation generator @@ -731,27 +1043,30 @@ call win_helpers.bat :OverwriteCopy "!installer_dir!\win_scanmapset.exe" call win_helpers.bat :OverwriteCopy "!installer_dir!\win_uncap.exe" "!bin_dir!\uncap.exe" || exit /B %ERRORLEVEL% call win_helpers.bat :OverwriteCopy "!installer_dir!\os_clang_format_style_file" "!home_dir!\_clang-format" || exit /B %ERRORLEVEL% -REM ------------------------------------------------------------------------ REM MobaXTerm REM ------------------------------------------------------------------------ -set mobaxterm_sha256=91f80537f12c2ad34a5eba99a285c149781c6d35a144a965ce3aea8a9bc6868c -set mobaxterm_exe_sha256=1053c81b44018d6e6519a9c80d7413f7bb36e9f6e43b3da619b2229aa362a522 -set mobaxterm_version=21.2 +set mobaxterm_sha256=C8DE508D6731F31A73F061E58942691466D1D24CFA941E642E16E0930BE2FAD9 +set mobaxterm_exe_sha256=e47cb54645a368411c5d6b6cbfa7e25980a2a674d7d0c082f5137b6e77a2f362 +set mobaxterm_version=22.3 +set mobaxterm_name=mobaxterm_win64 -set mobaxterm_label=mobaxterm_win64_!mobaxterm_version! -set mobaxterm_zip=!downloads_dir!\!mobaxterm_label!.zip -set mobaxterm_dir=!tools_dir!\!mobaxterm_label! -set mobaxterm_exe=!mobaxterm_dir!\MobaXterm_Personal_21.2.exe +set mobaxterm_download_name=MobaXterm_Portable_v!mobaxterm_version! +set mobaxterm_download_file=!mobaxterm_download_name!.zip +set mobaxterm_download_path=!downloads_dir!\!mobaxterm_download_file! +set mobaxterm_download_url="https://download.mobatek.net/2232022120824733/!mobaxterm_download_file!" + +set mobaxterm_dir=!tools_dir!\!mobaxterm_name!_!mobaxterm_version! +set mobaxterm_exe=!mobaxterm_dir!\MobaXterm_Personal_!mobaxterm_version!.exe if not exist "!mobaxterm_exe!" ( - call win_helpers.bat :DownloadFile "https://download.mobatek.net/2122021051924233/MobaXterm_Portable_v!mobaxterm_version!.zip" !mobaxterm_zip! || exit /B %ERRORLEVEL% - call win_helpers.bat :FileHashCheck sha256 !mobaxterm_zip! !mobaxterm_sha256! || exit /B %ERRORLEVEL% - call win_helpers.bat :Unzip "!zip7_exe!" !mobaxterm_zip! !mobaxterm_dir! || exit /B %ERRORLEVEL% + call win_helpers.bat :DownloadFile "!mobaxterm_download_url!" !mobaxterm_download_path! || exit /B %ERRORLEVEL% + call win_helpers.bat :FileHashCheck sha256 !mobaxterm_download_path! !mobaxterm_sha256! || exit /B %ERRORLEVEL% + call win_helpers.bat :Unzip "!zip7_exe!" !mobaxterm_download_path! !mobaxterm_dir! || exit /B %ERRORLEVEL% ) call win_helpers.bat :FileHashCheck sha256 "!mobaxterm_exe!" "!mobaxterm_exe_sha256!" || exit /B %ERRORLEVEL% +call win_helpers.bat :MakeDirHardLink "!tools_dir!\!mobaxterm_name!" "!mobaxterm_dir!" || exit /B %ERRORLEVEL% -REM ---------------------------------------------------------------------------- REM O&O ShutUp10 (Privacy Tool for Windows) REM ---------------------------------------------------------------------------- REM We don't do SHA256 here since we don't get a versioned URL, this can @@ -764,154 +1079,224 @@ if not exist "!oo_shutup_10_file!" ( call win_helpers.bat :DownloadFile "https://dl5.oo-software.com/files/ooshutup10/OOSU10.exe" "!oo_shutup_10_file!" || exit /B %ERRORLEVEL% ) +REM SystemInformer REM ---------------------------------------------------------------------------- -REM ProcessHacker -REM ---------------------------------------------------------------------------- -set process_hacker_sha256=c662b756324c9727760b4e921459d31a30f99cf8d3f24b64f4fcb3b29a26beb4 -set process_hacker_exe_sha256=22b1b8f080a41a07f23eae8ab0ad2e5f88d3c5af5d8c1cd1bb4f6856482e945c -set process_hacker_version=3.0.4861 +set system_informer_sha256=48C869FF4CCEA0EA0D4E9A23E5BFBBA640B5F092BD69E779F320262BCCE0A491 +set system_informer_exe_sha256=77630EDBE08B29D1D0A709A3AFB54C1C7E198EAEE1013B8057EFEDC1D14F158D +set system_informer_version=3.0.5553 +set system_informer_name=system_informer_win64 -set process_hacker_label=process_hacker_win64_!process_hacker_version! -set process_hacker_zip=!downloads_dir!\!process_hacker_label! -set process_hacker_dir=!tools_dir!\!process_hacker_label! -set process_hacker_exe=!process_hacker_dir!\64bit\ProcessHacker.exe +set system_informer_download_name=systeminformer-!system_informer_version!-bin +set system_informer_download_file=!system_informer_download_name!.zip +set system_informer_download_path=!downloads_dir!\!system_informer_download_file! +set system_informer_download_url="https://github.com/winsiderss/si-builds/releases/download/!system_informer_version!/!system_informer_download_file!" -if not exist "!process_hacker_exe!" ( - call win_helpers.bat :DownloadFile "https://github.com/ProcessHackerRepoTool/nightly-builds-mirror/releases/download/v!process_hacker_version!/processhacker-!process_hacker_version!-bin.zip" "!process_hacker_zip!" || exit /B %ERRORLEVEL% - call win_helpers.bat :FileHashCheck sha256 "!process_hacker_zip!" "!process_hacker_sha256!" || exit /B %ERRORLEVEL% - call win_helpers.bat :Unzip "!zip7_exe!" "!process_hacker_zip!" "!process_hacker_dir!" || exit /B %ERRORLEVEL% +set system_informer_dir=!tools_dir!\!system_informer_name!_!system_informer_version! +set system_informer_exe=!system_informer_dir!\64bit\SystemInformer.exe + +if not exist "!system_informer_exe!" ( + call win_helpers.bat :DownloadFile "!system_informer_download_url!" "!system_informer_download_path!" || exit /B %ERRORLEVEL% + call win_helpers.bat :FileHashCheck sha256 "!system_informer_download_path!" "!system_informer_sha256!" || exit /B %ERRORLEVEL% + call win_helpers.bat :Unzip "!zip7_exe!" "!system_informer_download_path!" "!system_informer_dir!" || exit /B %ERRORLEVEL% ) -call win_helpers.bat :FileHashCheck sha256 "!process_hacker_exe!" "!process_hacker_exe_sha256!" || exit /B %ERRORLEVEL% +call win_helpers.bat :FileHashCheck sha256 "!system_informer_exe!" "!system_informer_exe_sha256!" || exit /B %ERRORLEVEL% +call win_helpers.bat :MakeDirHardLink "!tools_dir!\!system_informer_name!" "!system_informer_dir!" || exit /B %ERRORLEVEL% -REM ---------------------------------------------------------------------------- REM ripgrep REM ---------------------------------------------------------------------------- set rg_sha256=a47ace6f654c5ffa236792fc3ee3fefd9c7e88e026928b44da801acb72124aa8 set rg_exe_sha256=ab5595a4f7a6b918cece0e7e22ebc883ead6163948571419a1dd5cd3c7f37972 set rg_version=13.0.0 +set rg_name=ripgrep_win64 -set rg_label=ripgrep_win64_!rg_version! -set rg_zip=!downloads_dir!\!rg_label!.zip -set rg_dir=!tools_dir!\!rg_label! +set rg_download_name=ripgrep-!rg_version!-x86_64-pc-windows-msvc +set rg_download_file=!rg_download_name!.zip +set rg_download_path=!downloads_dir!\!rg_download_file! +set rg_download_url="https://github.com/BurntSushi/ripgrep/releases/download/!rg_version!/!rg_download_file!" + +set rg_dir_name=!rg_name!_!rg_version! +set rg_dir=!tools_dir!\!rg_dir_name! set rg_exe=!rg_dir!\rg.exe if not exist "!rg_exe!" ( - call win_helpers.bat :DownloadFile "https://github.com/BurntSushi/ripgrep/releases/download/!rg_version!/ripgrep-!rg_version!-x86_64-pc-windows-msvc.zip" "!rg_zip!" || exit /B %ERRORLEVEL% - call win_helpers.bat :FileHashCheck sha256 "!rg_zip!" "!rg_sha256!" || exit /B %ERRORLEVEL% - call win_helpers.bat :Unzip "!zip7_exe!" "!rg_zip!" "!rg_dir!" || exit /B %ERRORLEVEL% - call win_helpers.bat :Move "!rg_dir!\ripgrep-!rg_version!-x86_64-pc-windows-msvc" "!rg_dir!" || exit /B %ERRORLEVEL% + call win_helpers.bat :DownloadFile "!rg_download_url!" "!rg_download_path!" || exit /B %ERRORLEVEL% + call win_helpers.bat :FileHashCheck sha256 "!rg_download_path!" "!rg_sha256!" || exit /B %ERRORLEVEL% + call win_helpers.bat :Unzip "!zip7_exe!" "!rg_download_path!" "!rg_dir!" || exit /B %ERRORLEVEL% + call win_helpers.bat :MoveDir "!rg_dir!\!rg_download_name!" "!rg_dir!" || exit /B %ERRORLEVEL% ) call win_helpers.bat :FileHashCheck sha256 "!rg_exe!" "!rg_exe_sha256!" || exit /B %ERRORLEVEL% +call win_helpers.bat :MakeFileHardLink "!bin_dir!\rg.exe" "!rg_exe!" || exit /B %ERRORLEVEL% -REM Terminal -echo set PATH=!rg_dir!;%%PATH%%>> "!tmp_terminal_script!" - +REM sioyek (PDF Viewer) REM ---------------------------------------------------------------------------- +set sioyek_sha256=B9C1C02DDA4932E488DB6AA08417854FBA436B492C7261C6CF04AE2AF0329F66 +set sioyek_exe_sha256=A30306931FC5E97DAF72CF9A82C2DA1D994392CDBD5DF5C7F0D56C26FFC3A33E +set sioyek_version=1.5.0 +set sioyek_name=sioyek_win64 + +set sioyek_download_name=sioyek-release-windows-portable +set sioyek_download_file=!sioyek_download_name!.zip +set sioyek_download_path=!downloads_dir!\!sioyek_download_file! +set sioyek_download_url="https://github.com/ahrm/sioyek/releases/download/v1.5.0/sioyek-release-windows-portable.zip" + +set sioyek_dir_name=!sioyek_name!_!sioyek_version! +set sioyek_dir=!tools_dir!\!sioyek_dir_name! +set sioyek_exe=!sioyek_dir!\sioyek.exe + +if not exist "!sioyek_exe!" ( + call win_helpers.bat :DownloadFile "!sioyek_download_url!" "!sioyek_download_path!" || exit /B %ERRORLEVEL% + call win_helpers.bat :FileHashCheck sha256 "!sioyek_download_path!" "!sioyek_sha256!" || exit /B %ERRORLEVEL% + call win_helpers.bat :Unzip "!zip7_exe!" "!sioyek_download_path!" "!sioyek_dir!" || exit /B %ERRORLEVEL% + call win_helpers.bat :MoveDir "!sioyek_dir!\sioyek-release-windows" "!sioyek_dir!" || exit /B %ERRORLEVEL% +) + +call win_helpers.bat :FileHashCheck sha256 "!sioyek_exe!" "!sioyek_exe_sha256!" || exit /B %ERRORLEVEL% +call win_helpers.bat :MakeDirHardLink "!tools_dir!\!sioyek_name!" "!sioyek_dir!" || exit /B %ERRORLEVEL% + REM fd REM ---------------------------------------------------------------------------- -set fd_sha256=F21BC26C1AB6BDBE4FE43F87A20C792D4ABE629AE97C6F42B25AC8A042F5521F -set fd_exe_sha256=764F31AC5B477707B51DAEC32458E4D66059BA0D17F03032B7CD0C0534703354 -set fd_version=8.4.0 +set fd_sha256=2E9FE19B0C3B1EC67F9B834FA763B3A614EC9D0ADDAACBCA4614E862FB3EE4FB +set fd_exe_sha256=b90ab51a05f933c22f3b87b3135cc5888dadb1527f7e18c83f7bb8978c4afeb6 +set fd_version=8.5.3 +set fd_name=fd_win64 -set fd_label=fd_win64_!fd_version! -set fd_zip=!downloads_dir!\!fd_label!.zip -set fd_dir=!tools_dir!\!fd_label! +set fd_download_name=fd-v!fd_version!-x86_64-pc-windows-msvc +set fd_download_file=!fd_download_name!.zip +set fd_download_path=!downloads_dir!\!fd_download_file! +set fd_download_url="https://github.com/sharkdp/fd/releases/download/v!fd_version!/!fd_download_file!" + +set fd_dir_name=!fd_name!_!fd_version! +set fd_dir=!tools_dir!\!fd_dir_name! set fd_exe=!fd_dir!\fd.exe if not exist "!fd_exe!" ( - call win_helpers.bat :DownloadFile "https://github.com/sharkdp/fd/releases/download/v!fd_version!/fd-v!fd_version!-x86_64-pc-windows-msvc.zip" "!fd_zip!" || exit /B %ERRORLEVEL% - call win_helpers.bat :FileHashCheck sha256 "!fd_zip!" "!fd_sha256!" || exit /B %ERRORLEVEL% - call win_helpers.bat :Unzip "!zip7_exe!" "!fd_zip!" "!fd_dir!" || exit /B %ERRORLEVEL% - call win_helpers.bat :Move "!fd_dir!\fd-v!fd_version!-x86_64-pc-windows-msvc" "!fd_dir!" || exit /B %ERRORLEVEL% + call win_helpers.bat :DownloadFile "!fd_download_url!" "!fd_download_path!" || exit /B %ERRORLEVEL% + call win_helpers.bat :FileHashCheck sha256 "!fd_download_path!" "!fd_sha256!" || exit /B %ERRORLEVEL% + call win_helpers.bat :Unzip "!zip7_exe!" "!fd_download_path!" "!fd_dir!" || exit /B %ERRORLEVEL% + call win_helpers.bat :MoveDir "!fd_dir!\fd-v!fd_version!-x86_64-pc-windows-msvc" "!fd_dir!" || exit /B %ERRORLEVEL% ) call win_helpers.bat :FileHashCheck sha256 "!fd_exe!" "!fd_exe_sha256!" || exit /B %ERRORLEVEL% +call win_helpers.bat :MakeFileHardLink "!bin_dir!\fd.exe" "!fd_exe!" || exit /B %ERRORLEVEL% -REM Terminal -echo set PATH=!fd_dir!;%%PATH%%>> "!tmp_terminal_script!" - +REM wiztree REM ---------------------------------------------------------------------------- +set wiztree_sha256=1625BAA8854B4F5BCEBEDE832AECFBBA079C0CAC623F1AACD56A7BF5011FFA51 +set wiztree_exe_sha256=3c33e9167b303dfca7ada6405b5ec0859b1bcc317dc4922664b59736b264cd26 +set wiztree_version=4_11 +set wiztree_name=wiztree_win64 + +set wiztree_download_name=wiztree_!wiztree_version!_portable +set wiztree_download_file=!wiztree_download_name!.zip +set wiztree_download_path=!downloads_dir!\!wiztree_download_file! +set wiztree_download_url="https://www.diskanalyzer.com/files/!wiztree_download_file!" + +set wiztree_dir=!tools_dir!\!wiztree_name!_!wiztree_version! +set wiztree_exe=!wiztree_dir!\wiztree64.exe + +if not exist "!wiztree_exe!" ( + call win_helpers.bat :DownloadFile "!wiztree_download_url!" "!wiztree_download_path!" || exit /B %ERRORLEVEL% + call win_helpers.bat :FileHashCheck sha256 "!wiztree_download_path!" "!wiztree_sha256!" || exit /B %ERRORLEVEL% + call win_helpers.bat :Unzip "!zip7_exe!" "!wiztree_download_path!" "!wiztree_dir!" || exit /B %ERRORLEVEL% +) + +call win_helpers.bat :FileHashCheck sha256 "!wiztree_exe!" "!wiztree_exe_sha256!" || exit /B %ERRORLEVEL% +call win_helpers.bat :MakeDirHardLink "!tools_dir!\!wiztree_name!" "!wiztree_dir!" || exit /B %ERRORLEVEL% + REM Ethereum REM ---------------------------------------------------------------------------- -REM ---------------------------------------------------------------------------- REM geth REM ---------------------------------------------------------------------------- set geth_md5=753cab189bd175d9fc6fea965ff7161b set geth_exe_sha256=7374e1c761f27a24a1d66299935b03b46ac354b6dc5f48505178d014a56f12df set geth_version=1.10.17-25c9b49f -set geth_label=geth_win64_!geth_version! -set geth_zip=!downloads_dir!\!geth_label!.zip -set geth_dir=!tools_dir!\!geth_label! +set geth_download_name=geth-windows-amd64-!geth_version! +set geth_download_file=!geth_download_name!.zip +set geth_download_path=!downloads_dir!\!geth_download_file! +set geth_download_url="https://gethstore.blob.core.windows.net/builds/!geth_download_file!" + +set geth_dir_name=geth_win64_!geth_version! +set geth_dir=!tools_dir!\!geth_dir_name! set geth_exe=!geth_dir!\geth.exe +set geth_gpg_key_download_name=geth-windows-amd64-!geth_version!.zip +set geth_gpg_key_download_file=!geth_gpg_key_download_name!.asc +set geth_gpg_key_download_path=!downloads_dir!\!geth_gpg_key_download_file! +set geth_gpg_key_download_url="https://gethstore.blob.core.windows.net/builds/!geth_gpg_key_download_file!" + set geth_gpg_key=!installer_dir!\win_geth_windows_builder_gpg_key.asc -set geth_gpg_sig=!geth_zip!.asc if not exist "!geth_exe!" ( - call win_helpers.bat :DownloadFile "https://gethstore.blob.core.windows.net/builds/geth-windows-amd64-!geth_version!.zip" "!geth_zip!" || exit /B %ERRORLEVEL% - call win_helpers.bat :DownloadFile "https://gethstore.blob.core.windows.net/builds/geth-windows-amd64-!geth_version!.zip.asc" "!geth_gpg_sig!" || exit /B %ERRORLEVEL% - call win_helpers.bat :FileHashCheck md5 "!geth_zip!" "!geth_md5!" || exit /B %ERRORLEVEL% + call win_helpers.bat :DownloadFile "!geth_download_url!" "!geth_download_path!" || exit /B %ERRORLEVEL% + call win_helpers.bat :DownloadFile "!geth_gpg_key_download_url!" "!geth_gpg_key_download_path!" || exit /B %ERRORLEVEL% + call win_helpers.bat :FileHashCheck md5 "!geth_download_path!" "!geth_md5!" || exit /B %ERRORLEVEL% gpg --import "!geth_gpg_key!" || exit /B %ERRORLEVEL% - gpg --verify "!geth_gpg_sig!" "!geth_zip!" || exit /B %ERRORLEVEL% - call win_helpers.bat :Unzip "!zip7_exe!" "!geth_zip!" "!geth_dir!" || exit /B %ERRORLEVEL% - call win_helpers.bat :Move "!geth_dir!\geth-windows-amd64-!geth_version!" "!geth_dir!" + gpg --verify "!geth_gpg_key_download_path!" "!geth_download_path!" || exit /B %ERRORLEVEL% + call win_helpers.bat :Unzip "!zip7_exe!" "!geth_download_path!" "!geth_dir!" || exit /B %ERRORLEVEL% + call win_helpers.bat :MoveDir "!geth_dir!\!geth_download_name!" "!geth_dir!" ) call win_helpers.bat :FileHashCheck sha256 "!geth_exe!" "!geth_exe_sha256!" || exit /B %ERRORLEVEL% -call win_helpers.bat :MakeBatchShortcut "geth" "!geth_exe!" "!bin_dir!" || exit /B %ERRORLEVEL% +call win_helpers.bat :MakeFileHardLink "!bin_dir!\geth.exe" "!geth_exe!" || exit /B %ERRORLEVEL% -REM ---------------------------------------------------------------------------- REM remix_ide REM ---------------------------------------------------------------------------- set remix_ide_sha256=E3736B66ECF30384B88FD4D626F788412C0117E18C4D26F2289469CD0E33752A set remix_ide_exe_sha256=BEE0A36255D16A9888BA421D95CFC3B672265790E70AE56924E27022E8A2BA0D set remix_ide_version=1.3.3 -set remix_ide_label=remix_ide_win64_!remix_ide_version! -set remix_ide_zip=!downloads_dir!\!remix_ide_label!.zip -set remix_ide_dir=!tools_dir!\!remix_ide_label! +set remix_ide_download_name=Remix-IDE-!remix_ide_version!-win +set remix_ide_download_file=!remix_ide_download_name!.zip +set remix_ide_download_path=!downloads_dir!\!remix_ide_download_file! +set remix_ide_download_url="https://github.com/ethereum/remix-desktop/releases/download/v!remix_ide_version!/!remix_ide_download_file!" + +set remix_ide_dir=!tools_dir!\remix_ide_win64_!remix_ide_version! set remix_ide_exe=!remix_ide_dir!\Remix IDE.exe if not exist "!remix_ide_exe!" ( - call win_helpers.bat :DownloadFile "https://github.com/ethereum/remix-desktop/releases/download/v!remix_ide_version!/Remix-IDE-!remix_ide_version!-win.zip" "!remix_ide_zip!" || exit /B %ERRORLEVEL% - call win_helpers.bat :FileHashCheck sha256 "!remix_ide_zip!" "!remix_ide_sha256!" || exit /B %ERRORLEVEL% - call win_helpers.bat :Unzip "!zip7_exe!" "!remix_ide_zip!" "!remix_ide_dir!" || exit /B %ERRORLEVEL% + call win_helpers.bat :DownloadFile "!remix_ide_download_url!" "!remix_ide_download_path!" || exit /B %ERRORLEVEL% + call win_helpers.bat :FileHashCheck sha256 "!remix_ide_download_path!" "!remix_ide_sha256!" || exit /B %ERRORLEVEL% + call win_helpers.bat :Unzip "!zip7_exe!" "!remix_ide_download_path!" "!remix_ide_dir!" || exit /B %ERRORLEVEL% ) call win_helpers.bat :FileHashCheck sha256 "!remix_ide_exe!" "!remix_ide_exe_sha256!" || exit /B %ERRORLEVEL% -REM ---------------------------------------------------------------------------- REM solidity REM ---------------------------------------------------------------------------- set solidity_exe_sha256=70A5A7EAA9135D13BD036CA55735F489559368AF819C5810CFAF0315DF56AB53 set solidity_version=0.8.14 -set solidity_label=solidity_win64_!solidity_version! +set solidity_download_name=solc-windows +set solidity_download_file=!solidity_download_name!.exe +set solidity_download_path=!downloads_dir!\!solidity_download_file! +set solidity_download_url="https://github.com/ethereum/solidity/releases/download/v!solidity_version!/!solidity_download_file!" + set solidity_dir=!tools_dir! -set solidity_exe=!solidity_dir!\!solidity_label!.exe +set solidity_exe=!solidity_dir!\solidity_win64_!solidity_version!.exe if not exist "!solidity_exe!" ( if not exist "!solidity_dir!" mkdir "!solidity_dir!" - call win_helpers.bat :DownloadFile "https://github.com/ethereum/solidity/releases/download/v!solidity_version!/solc-windows.exe" "!solidity_exe!" || exit /B %ERRORLEVEL% + call win_helpers.bat :DownloadFile "!solidity_download_url!" "!solidity_exe!" || exit /B %ERRORLEVEL% ) call win_helpers.bat :FileHashCheck sha256 "!solidity_exe!" "!solidity_exe_sha256!" || exit /B %ERRORLEVEL% -call win_helpers.bat :MakeBatchShortcut "solc" "!solidity_exe!" "!bin_dir!" || exit /B %ERRORLEVEL% -call win_helpers.bat :MakeBatchShortcut "solc-!solidity_version!" "!solidity_exe!" "!bin_dir!" || exit /B %ERRORLEVEL% +call win_helpers.bat :MakeFileHardLink "!bin_dir!\solc" "!solidity_exe!" || exit /B %ERRORLEVEL% +call win_helpers.bat :MakeFileHardLink "!bin_dir!\solc-!solidity_version!" "!solidity_exe!" || exit /B %ERRORLEVEL% + -REM ---------------------------------------------------------------------------- REM Finish Terminal Script REM ---------------------------------------------------------------------------- -echo if exist "!tools_dir!\win_terminal_user_config.bat" call "!tools_dir!\win_terminal_user_config.bat">> "!tmp_terminal_script!" -echo start "" /MAX "!wezterm_exe!">> "!tmp_terminal_script!" -echo exit>> "!tmp_terminal_script!" +echo.>> "!tmp_terminal_script!" +echo if exist "%%~dp0win_terminal_user_config.bat" call "%%~dp0win_terminal_user_config.bat">> "!tmp_terminal_script!" +echo start "" /MAX "%%~dp0!wezterm_name!\wezterm-gui.exe" ^^!working_dir^^!>> "!tmp_terminal_script!" +echo.>> "!tmp_terminal_script!" + move /Y !tmp_terminal_script! !terminal_script! -REM ---------------------------------------------------------------------------- REM Odin & Portable MSVC Work-around REM ---------------------------------------------------------------------------- REM Odin uses J. Blow's Microsoft craziness SDK locator which relies on the @@ -933,22 +1318,19 @@ echo.>>!odin_uninstall_workaround_script! echo [HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows Kits\Installed Roots]>>!odin_uninstall_workaround_script! echo "KitsRoot10"=->>!odin_uninstall_workaround_script! -REM ---------------------------------------------------------------------------- REM Background Application Scripts REM ---------------------------------------------------------------------------- set bg_app_script=!tools_dir!\win_start_background_apps.bat echo @echo off> "!bg_app_script!" -echo start "" "!everything_dir!\everything.exe">> "!bg_app_script!" -echo start "" "!keypirinha_dir!\keypirinha.exe">> "!bg_app_script!" +echo start "" "%%~dp0!everything_name!\everything64.exe">> "!bg_app_script!" +echo start "" "%%~dp0!keypirinha_name!\keypirinha.exe">> "!bg_app_script!" -REM ---------------------------------------------------------------------------- REM CTags Helper Script REM ---------------------------------------------------------------------------- set ctags_file=!bin_dir!\ctags_cpp.bat echo @echo off> "!ctags_file!" echo ctags --c++-kinds=+p --fields=+iaS --extras=+q %%*>> !ctags_file! -REM ---------------------------------------------------------------------------- REM Finish REM ---------------------------------------------------------------------------- echo - Setup complete. Launch !tools_dir!\win_terminal.bat [or restart Wezterm instance if you're updating an existing installation]