Compare commits

..

68 Commits

Author SHA1 Message Date
doylet 2b005087bc Add hashes for new deps on linux 2026-04-22 11:04:08 +10:00
doylet cc8e47ea5d Add opencode vim plugin 2026-04-22 11:00:43 +10:00
doylet 46420f641e Update nvim and neovide 2026-04-21 13:45:00 +10:00
doylet 33d89b9d15 Fix guifont issues 2026-03-11 21:22:14 +11:00
doylet ba7f1b0c00 update nvim 2026-03-11 14:03:18 +11:00
doylet 4d99747372 Use relative symlinks 2026-02-21 17:04:38 +11:00
doylet 84f0d9e43d Augment .bashrc 2026-02-15 13:54:06 +11:00
doylet 057cd602f2 Fix bash source unescaped and bad nodejs checksum 2026-02-15 13:49:37 +11:00
doylet 0323f72b9d Simplify 2026-02-15 13:05:49 +11:00
doylet 10fd023f56 Simplify 2026-02-15 12:43:52 +11:00
doylet ce6330707c Update nodejs to 24.12.0 2026-02-15 12:18:04 +11:00
doylet 73f6d4ae58 Linux fixes 2026-02-14 17:53:35 +11:00
doylet 3ac339633a More cleanup 2026-02-14 16:47:49 +11:00
doylet 8934927e9d Cleanup 2026-02-14 12:09:19 +11:00
doylet c35d7b01f7 Updates 2026-02-13 23:15:07 +11:00
doylet 989755a978 Update code companion 2025-11-10 20:50:32 +11:00
doylet 8f0dbb31f2 Add spell check 2025-09-29 16:01:32 +10:00
doylet 540c90f669 Fix typo on easy align bindings 2025-08-13 22:25:58 +10:00
doylet 1021617068 Add tree-sitter for windows to use codecompanion, requires YAML sitter 2025-08-13 22:15:23 +10:00
doylet c4e98d0f18 Change llm port 2025-08-13 22:04:29 +10:00
doylet 778ed542a6 Remove wezterm EGL, was configuration error 2025-08-13 20:29:50 +10:00
doylet cb4c40af43 Tweak llamafile port 2025-08-13 20:28:53 +10:00
doylet 579ef3c118 Add LLM to dev setup 2025-08-13 20:28:53 +10:00
doylet 0b27a36349 Update windows binaries and prefer EGL for wezterm to fix incompat w/ fw16 2025-07-18 22:42:37 +10:00
doylet f491f44e16 Start cleaning up lsp-zero 2025-07-18 18:14:00 +10:00
doylet fee8ac3d5c Update apps for linux 2025-07-18 13:59:58 +10:00
doylet e5980efc3f Add python 3.11.12 to env 2025-05-15 11:13:46 +10:00
doylet 540cc47183 Update dev script 2025-04-04 14:39:55 +11:00
doylet 3383a29a0f Switch to dev.sh and add node 20.18.2 2025-04-04 14:07:27 +11:00
doylet 92b6606a0e Add clang 19.1.7 on linux 2025-04-02 13:52:54 +11:00
doylet 90d3a5b81e Update CLINK to 1.7.10 2025-02-26 20:13:52 +11:00
doylet 01f7cb0a24 Update linux install 2025-02-21 11:36:24 +11:00
doylet 9e4f107303 Tweak leap.nvim hotkeys 2025-02-21 10:50:49 +11:00
doylet 36d6a5cccb update nvim to use raddebugger and update nodejs 2025-01-28 20:36:42 +11:00
doylet da890c911c Remove Odin portable MSVC workaround 2024-12-03 14:17:42 +11:00
doylet 2d867179cd Remove portable MSVC script, we use portablebuildtools, fix python unclosed quote 2024-12-03 14:16:49 +11:00
doylet c87d2f62fc Fix python bin dir not set, improve dev script 2024-12-03 14:14:23 +11:00
doylet 00b3288823 Update mold to 2.34.1 2024-10-31 13:41:42 +11:00
doylet 2364e61b67 Update windows scripts 2024-10-28 14:48:51 +11:00
doylet 2aca88b278 Merge scripts into a single one, update neovim 2024-10-23 21:44:31 +11:00
doylet 954f91a4ef Remove pattern for nvim init 2024-07-04 22:11:28 +10:00
doylet 213e416461 Update scripts 2024-07-04 22:08:49 +10:00
doylet 321c522987 Add mold linker 2024-05-29 20:46:59 +10:00
doylet fc854d991b Add ccache 4.9.1 to linux 2024-05-21 21:28:46 +10:00
doylet a16255964d Update go to 1.22.3 on linux 2024-05-15 19:21:34 +10:00
doylet 74e97d8208 Update go to 1.22.3 for windows 2024-05-15 19:18:55 +10:00
doylet c9eb79df59 Update GCC scripts 2024-04-30 15:54:40 +10:00
doylet 6cffa10d2b Adjust some windows scripts 2024-04-18 21:08:51 +10:00
doylet eb05da5c65 Add vimeasyalign, fixup some Linux scripts 2024-04-18 11:22:14 +10:00
doylet 0b40b06661 Add more flexible node env script 2024-04-11 14:36:44 +10:00
doylet 94fdcda5ef Fix build.bat execution in nvim, echo executed msys command 2024-04-09 21:27:37 +10:00
doylet 5c8954036d Simplify MSYS2 scripts 2024-04-09 21:17:10 +10:00
doylet 90e20b2168 Update how we handle mingw and building 2024-04-09 16:08:17 +10:00
doylet 5b7d78eaff Add msys2 shell scripts 2024-04-09 14:51:42 +10:00
doylet 9f89c0d3df Add cmake scripts 2024-04-08 09:35:15 +10:00
doylet e3395da405 Update cmake to 3.29.1, add cmake scripts 2024-04-04 16:06:35 +11:00
doylet f0c32fc669 Tweak some keybindings for nvim 2024-04-04 12:21:25 +11:00
doylet fd79ee377b Only allow buffer format in nvim when in visual selection mode 2024-03-29 20:58:10 +11:00
doylet 56a103defa Add nvim plugin for handling big files 2024-03-26 10:52:37 +11:00
doylet b2bf4a8217 Add better LSP FZF integration and harpoon 2024-03-24 17:55:46 +11:00
doylet 868e566a5e Fix LSP in nvim 2024-03-24 16:55:22 +11:00
doylet d1baddbbfd Update msvc script to fold in mmozeiko's latest changes 2024-03-14 15:37:38 +11:00
doylet 33048592a6 Add virus total lookup script 2024-02-25 18:39:34 +11:00
doylet b6c688292a Simplify cleanup step of installation 2024-02-21 17:36:41 +11:00
doylet 2f7e7e7a96 Update msvc script to cache downloads, add script for latest sdk 2024-02-21 14:00:54 +11:00
doylet dcbbfc5e85 Make node environment scripts simpler 2024-02-20 12:14:58 +11:00
doylet 54aac5b10c Add NodeJS 12.22.12, update scripts to provide environment 2024-02-07 11:19:29 +11:00
doylet f0d4ceac69 Remove NodeJS symlinks, they require the path to be set so use scripts 2024-02-05 13:43:02 +11:00
25 changed files with 1117 additions and 2053 deletions
+1
View File
@@ -1,3 +1,4 @@
.stfolder
Downloads
__pycache__
Win
+512
View File
@@ -0,0 +1,512 @@
-- ============================================================================
-- Modern Neovim Configuration (lazy.nvim)
-- ============================================================================
-- Bootstrap lazy.nvim
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable",
lazypath,
})
end
vim.opt.rtp:prepend(lazypath)
-- ============================================================================
-- Plugin Specifications
-- ============================================================================
require("lazy").setup({
-- File tree
{
'scrooloose/nerdtree',
cmd = 'NERDTreeToggle',
},
-- Build/async tools
'tpope/vim-dispatch',
-- Git integration
'tpope/vim-fugitive',
-- Text manipulation
'tpope/vim-abolish',
-- Large file handling
{
'LunarVim/bigfile.nvim',
config = function()
require('bigfile').setup()
end,
},
-- FZF
{ 'junegunn/fzf' },
{
'ibhagwan/fzf-lua',
branch = 'main',
config = function()
require('fzf-lua').setup({
winopts = {
height = 0.95,
width = 0.95
}
})
end,
},
'nvim-tree/nvim-web-devicons',
-- Alignment
{
'junegunn/vim-easy-align',
init = function()
vim.g.easy_align_delimiters = {
['>'] = { pattern = '>>\\|=>\\|>' },
['/'] = {
pattern = '//\\+\\|/\\*\\|\\*/',
delimiter_align = 'l',
ignore_groups = {'!Comment'}
},
[']'] = {
pattern = '[[\\]]',
left_margin = 0,
right_margin = 0,
stick_to_left = 0
},
[')'] = {
pattern = '[)]',
left_margin = 0,
right_margin = 0,
stick_to_left = 0
},
['('] = {
pattern = '[(]',
left_margin = 0,
right_margin = 0,
stick_to_left = 0
},
}
end,
},
-- File picker
{
'dmtrKovalenko/fff.nvim',
build = function()
-- this will download prebuild binary or try to use existing rustup toolchain to build from source
-- (if you are using lazy you can use gb for rebuilding a plugin if needed)
require("fff.download").download_or_build_binary()
end,
-- No need to lazy-load with lazy.nvim.
-- This plugin initializes itself lazily.
lazy = false,
keys = {
{
"<leader>f",
function() require('fff').find_files() end,
desc = 'FFFind files',
},
{
"<leader>r",
function() require('fff').live_grep() end,
desc = 'LiFFFe grep',
},
{
"<leader>R",
function() require('fff').live_grep({ query = vim.fn.expand("<cword>") }) end,
desc = 'Search current word',
},
}
},
-- C++ syntax highlighting
{
'bfrg/vim-cpp-modern',
init = function()
vim.g.cpp_function_highlight = 1
vim.g.cpp_attributes_highlight = 1
vim.g.cpp_member_highlight = 0
vim.g.cpp_simple_highlight = 1
end,
},
-- Motion
{
url = 'https://codeberg.org/andyg/leap.nvim',
lazy = false,
config = function()
vim.keymap.set({'n', 'x', 'o'}, '<tab>', '<Plug>(leap)')
vim.keymap.set({'n', 'x', 'o'}, '<S-tab>', '<Plug>(leap-from-window)')
-- Highly recommended: define a preview filter to reduce visual noise
-- and the blinking effect after the first keypress
-- (see `:h leap.opts.preview`).
-- For example, skip preview if the first character of the match is
-- whitespace or is in the middle of an alphabetic word:
require('leap').opts.preview = function(ch0, ch1, ch2)
return not (
ch1:match('%s')
or (ch0:match('%a') and ch1:match('%a') and ch2:match('%a'))
)
end
-- Define equivalence classes for brackets and quotes, in addition to
-- the default whitespace group:
require('leap').opts.equivalence_classes = { ' \t\r\n', '([{', ')]}', '\'"`' }
-- Use the traversal keys to repeat the previous motion without
-- explicitly invoking Leap:
require('leap.user').set_repeat_keys('<enter>', '<backspace>')
-- Automatic paste after remote yank operations:
vim.api.nvim_create_autocmd('User', {
pattern = 'RemoteOperationDone',
group = vim.api.nvim_create_augroup('LeapRemote', {}),
callback = function(event)
if vim.v.operator == 'y' and event.data.register == '"' then
vim.cmd('normal! p')
end
end,
})
end
},
-- Theme
{
'sainnhe/gruvbox-material',
priority = 1000,
init = function()
vim.g.gruvbox_material_background = 'hard'
vim.g.gruvbox_material_foreground = 'mix'
vim.g.gruvbox_material_disable_italic_comment = 1
vim.g.gruvbox_material_enable_italic = 0
vim.g.gruvbox_material_enable_bold = 0
vim.g.gruvbox_material_diagnostic_virtual_text = 'colored'
vim.g.gruvbox_material_better_performance = 1
end,
config = function()
vim.cmd('colorscheme gruvbox-material')
end,
},
-- Odin syntax
'Tetralux/odin.vim',
-- Treesitter
{
'nvim-treesitter/nvim-treesitter',
build = ':TSUpdate',
},
-- LSP
{
'williamboman/mason.nvim',
config = function()
require('mason').setup({})
end,
},
{
'williamboman/mason-lspconfig.nvim',
config = function()
require('mason-lspconfig').setup({
ensure_installed = { "clangd" },
automatic_enable = true,
})
end,
},
'neovim/nvim-lspconfig',
-- Completion
{
'hrsh7th/nvim-cmp',
dependencies = {
'hrsh7th/cmp-nvim-lsp',
'hrsh7th/cmp-buffer',
'hrsh7th/cmp-path',
'L3MON4D3/LuaSnip',
},
config = function()
local cmp = require('cmp')
cmp.setup({
sources = {
{ name = 'nvim_lsp' },
{ name = 'buffer' },
{ name = 'path' },
},
mapping = cmp.mapping.preset.insert({
['<CR>'] = cmp.mapping.confirm({ select = false }),
['<Tab>'] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Insert }),
['<S-Tab>'] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Insert }),
}),
snippet = {
expand = function(args)
require('luasnip').lsp_expand(args.body)
end,
},
})
end,
},
'hrsh7th/cmp-nvim-lsp',
'hrsh7th/cmp-buffer',
'hrsh7th/cmp-path',
'L3MON4D3/LuaSnip',
-- Utilities
'nvim-lua/plenary.nvim',
-- Opencode
{
"sudo-tee/opencode.nvim",
config = function()
require("opencode").setup({})
end,
dependencies = {
"nvim-lua/plenary.nvim",
{
"MeanderingProgrammer/render-markdown.nvim",
opts = {
anti_conceal = { enabled = false },
file_types = { 'markdown', 'opencode_output' },
},
ft = { 'markdown', 'Avante', 'copilot-chat', 'opencode_output' },
},
-- Optional, for file mentions and commands completion, pick only one
-- 'saghen/blink.cmp',
'hrsh7th/nvim-cmp',
-- Optional, for file mentions picker, pick only one
-- 'folke/snacks.nvim',
-- 'nvim-telescope/telescope.nvim',
-- 'ibhagwan/fzf-lua',
-- 'nvim_mini/mini.nvim',
},
},
}, {
install = {
colorscheme = { "gruvbox-material" },
},
checker = {
enabled = false,
},
})
-- ============================================================================
-- Options
-- ============================================================================
vim.opt.autowrite = true
vim.opt.colorcolumn = { 80, 100 }
vim.opt.completeopt = { 'menu', 'menuone', 'noselect' }
vim.opt.cpoptions:append('$')
vim.opt.cursorline = true
vim.opt.expandtab = true
vim.opt.guifont = 'JetBrains_Mono,Consolas:h9'
vim.opt.hlsearch = false
vim.opt.ignorecase = true
vim.opt.linebreak = true
vim.opt.list = true
vim.opt.listchars:append('tab:>-,trail:■,extends:»,precedes:«')
vim.opt.number = true
vim.opt.relativenumber = true
vim.opt.shiftwidth = 4
vim.opt.splitright = true
vim.opt.swapfile = false
vim.opt.textwidth = 80
vim.opt.visualbell = true
vim.opt.wrap = false
vim.opt.signcolumn = 'no'
-- Setup undo and backup directories
vim.opt.undofile = true
vim.opt.undodir = vim.fn.stdpath('config') .. '/undo'
vim.opt.backupdir = vim.fn.stdpath('config') .. '/backup'
-- Status line
vim.opt.statusline = '%<%F%h%m%r [%{&ff}] (%{strftime("%H:%M %d/%m/%Y",getftime(expand("%:p")))})%=%l,%c%V %P'
-- Wild ignore
vim.opt.wildignore:append('*.class,*.o,*\\tmp\\*,*.swp,*.zip,*.exe,*.obj,*.vcxproj,*.pdb,*.idb')
-- Mouse support
vim.opt.mouse = 'a'
-- Spelling
vim.opt.spell = true
-- ============================================================================
-- LSP Configuration
-- ============================================================================
local opts = { noremap = true, silent = true }
vim.keymap.set("n", "<F2>", vim.lsp.buf.rename, opts)
vim.keymap.set("n", "<F4>", vim.lsp.buf.code_action, opts)
vim.keymap.set('n', 'gd', vim.lsp.buf.definition, opts)
vim.keymap.set('n', 'gr', vim.lsp.buf.references, opts)
-- Diagnostic configuration
vim.diagnostic.config({
signs = false,
virtual_text = true,
})
-- Spelling highlight
vim.api.nvim_create_autocmd("LspAttach", {
callback = function()
vim.cmd("highlight SpellBad gui=underline guifg=#d3869b")
end,
})
-- ============================================================================
-- Vim Dispatch Configuration
-- ============================================================================
if vim.fn.has('win64') == 1 or vim.fn.has('win32') == 1 or vim.fn.has('win16') == 1 then
if os.getenv('SHELL') ~= nil then
vim.o.shellcmdflag = '-c'
vim.o.makeprg = "./build.sh"
else
vim.o.makeprg = "build.bat"
end
else
vim.o.makeprg = "./build.sh"
end
-- ============================================================================
-- Autocommands
-- ============================================================================
-- Automatically scroll to bottom of quickfix window when opened
vim.api.nvim_create_autocmd("FileType", {
pattern = "qf",
callback = function()
vim.cmd('normal! G')
end,
})
-- Per-Project Bindings - load project file on buffer enter
vim.api.nvim_create_autocmd("BufEnter", {
callback = function()
local project_file = vim.fn.getcwd() .. '/project_nvim.lua'
if vim.fn.filereadable(project_file) == 1 then
vim.cmd('luafile ' .. vim.fn.fnameescape(project_file))
end
end,
})
-- Formatting options
vim.api.nvim_create_augroup("persistent_settings", { clear = true })
vim.api.nvim_create_autocmd("BufEnter", {
group = "persistent_settings",
pattern = "*",
command = "set formatoptions=q1j",
})
-- ============================================================================
-- Functions
-- ============================================================================
local function raddbg_open_file()
local filepath = vim.fn.expand("%:p"):gsub('\\', '/')
vim.fn.system("dev raddbg --ipc open " .. filepath)
vim.fn.system("dev raddbg --ipc goto_line " .. vim.fn.line("."))
vim.fn.system("powershell -Command Add-Type -AssemblyName Microsoft.VisualBasic; [Microsoft.VisualBasic.Interaction]::AppActivate('The RAD Debugger')")
end
local function raddbg_start_debugging()
vim.fn.system("dev raddbg --ipc run")
end
local function raddbg_stop_debugging()
vim.fn.system("dev raddbg --ipc kill_all")
end
local function raddbg_run_to_cursor()
local filepath = vim.fn.expand("%:p"):gsub('\\', '/')
vim.fn.system("dev raddbg --ipc open " .. filepath)
vim.fn.system("dev raddbg --ipc goto_line " .. vim.fn.line("."))
vim.fn.system("dev raddbg --ipc run_to_cursor " .. filepath .. ":" .. vim.fn.line("."))
vim.fn.system("powershell -Command Add-Type -AssemblyName Microsoft.VisualBasic; [Microsoft.VisualBasic.Interaction]::AppActivate('The RAD Debugger')")
end
local function raddbg_add_breakpoint()
local filepath = vim.fn.expand("%:p"):gsub('\\', '/')
vim.fn.system("dev raddbg --ipc open " .. filepath)
vim.fn.system("dev raddbg --ipc goto_line " .. vim.fn.line("."))
vim.fn.system("dev raddbg --ipc toggle_breakpoint " .. filepath .. ":" .. vim.fn.line("."))
vim.fn.system("powershell -Command Add-Type -AssemblyName Microsoft.VisualBasic; [Microsoft.VisualBasic.Interaction]::AppActivate('The RAD Debugger')")
end
-- ============================================================================
-- Keymaps
-- ============================================================================
local function adjust_fontsize(amount)
-- Get current font and size
local current_font = vim.opt.guifont:get()[1] or "Consolas"
local current_size = tonumber(current_font:match(":h(%d+)")) or 12
-- Extract font name (everything before :h)
local font_name = current_font:match("^(.+):h%d+") or current_font
-- Calculate new size
local new_size = math.max(6, current_size + amount) -- Minimum size of 6
-- Apply new font setting
if vim.g.neovide then
vim.opt.guifont = font_name .. ":h" .. new_size
else
vim.cmd("GuiFont! " .. font_name .. ":h" .. new_size)
end
end
-- Numpad mappings
vim.keymap.set('n', '<C-=>', function() adjust_fontsize(1) end)
vim.keymap.set('n', '<C-->', function() adjust_fontsize(-1) end)
-- FZF Bindings
vim.keymap.set('n', '<leader>h', '<cmd>FzfLua oldfiles<cr>')
vim.keymap.set('n', '<leader>t', '<cmd>FzfLua lsp_live_workspace_symbols<cr>')
vim.keymap.set('n', '<leader>T', '<cmd>FzfLua lsp_finder<cr>')
vim.keymap.set('n', '<leader>b', '<cmd>FzfLua buffers<cr>')
vim.keymap.set('n', '<leader><leader>', '<cmd>FzfLua<cr>')
-- Window navigation
vim.keymap.set('n', '<C-h>', '<C-w>h', { silent = true })
vim.keymap.set('n', '<C-j>', '<C-w>j', { silent = true })
vim.keymap.set('n', '<C-k>', '<C-w>k', { silent = true })
vim.keymap.set('n', '<C-l>', '<C-w>l', { silent = true })
-- Move by wrapped lines
vim.keymap.set('n', 'j', 'gj')
vim.keymap.set('n', 'k', 'gk')
vim.keymap.set('n', 'gj', 'j')
vim.keymap.set('n', 'gk', 'k')
-- NERDTree
vim.keymap.set('n', '<C-n>', ':NERDTreeToggle<CR>')
-- Change to current buffer's directory
vim.keymap.set('n', 'cd', function()
vim.cmd('cd ' .. vim.fn.expand('%:p:h'))
end)
-- Buffer splitting
vim.keymap.set('n', '<leader>s', ':vs<CR>')
-- Quickfix navigation
vim.keymap.set('n', '<A-j>', ':cn<CR>')
vim.keymap.set('n', '<A-k>', ':cp<CR>')
-- Terminal escape
vim.keymap.set('t', '<Esc>', '<C-\\><C-n>')
-- Make (Vim Dispatch)
vim.keymap.set('n', '<C-b>', ':Make<CR>', { noremap = true })
-- Easy-Align
vim.keymap.set('x', '<leader>a', '<Plug>(LiveEasyAlign)')
-- RAD Debugger
vim.keymap.set('n', '<F6>', function() raddbg_open_file() end, { silent = true })
vim.keymap.set('n', '<F5>', function() raddbg_start_debugging() end, { silent = true })
vim.keymap.set('n', '<S-F5>', function() raddbg_stop_debugging() end, { silent = true })
vim.keymap.set('n', '<F9>', function() raddbg_add_breakpoint() end, { silent = true })
vim.keymap.set('n', '<C-F10>', function() raddbg_run_to_cursor() end, { silent = true })
-323
View File
@@ -1,323 +0,0 @@
" Plugins ==========================================================================================
call plug#begin(stdpath('config') . '/plugged')
" nerdtree provides a file tree explorer
" 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'
" FZF
Plug 'junegunn/fzf'
Plug 'junegunn/fzf.vim'
" FZF for LSP
Plug 'gfanto/fzf-lsp.nvim'
Plug 'nvim-lua/plenary.nvim'
" odin for syntax highlighting
Plug 'https://github.com/Tetralux/odin.vim'
Plug 'https://github.com/sainnhe/gruvbox-material'
" Lua cache to speed up load times
Plug 'https://github.com/lewis6991/impatient.nvim'
Plug 'https://github.com/ggandor/leap.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 <<EOF
require('impatient')
local leap = require('leap')
vim.keymap.set({'n', 'x', 'o'}, '<tab>', '<Plug>(leap-forward-to)')
vim.keymap.set({'n', 'x', 'o'}, '<S-tab>', '<Plug>(leap-backward-to)')
-- LSP Setup =====================================================================================
local lsp = require('lsp-zero')
local devenver_root = vim.fn.getenv('devenver_root')
lsp.preset('recommended')
lsp.configure('clangd', {
cmd = {
"clangd",
"-j",
"1",
"--background-index",
"--background-index-priority=background",
"--pch-storage=memory",
"--clang-tidy",
"--header-insertion=iwyu",
"--header-insertion-decorators",
}
})
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 ===================================================================================
vim.opt.autowrite=true -- Automatically save before cmds like :next and :prev
vim.opt.colorcolumn={80, 100} -- Set a 80 and 100 char column ruler
vim.opt.completeopt={'menu', 'menuone', 'noselect'}
vim.opt.cpoptions:append('$') -- $ as end marker for the change operator
vim.opt.cursorline=true -- Highlight current line
vim.opt.expandtab=true -- Replace tabs with spaces
vim.opt.guifont='JetBrains_Mono:h9','Consolas:h9','InputMonoCondensed:h9'
vim.opt.hlsearch=false -- Highlight just the first match on search
vim.opt.ignorecase=true -- Search is not case sensitive
vim.opt.linebreak=true -- On wrapped lines, break on the wrapping word intelligently
vim.opt.list=true -- Show the 'listchar' characters on trailing spaces, tabs e.t.c
vim.opt.listchars:append('tab:>-,trail:■,extends:»,precedes:«')
vim.opt.number=true -- Show line numbers
vim.opt.relativenumber=true -- Show relative line numbers
vim.opt.shiftwidth=4 -- Number of spaces for each autoindent step
vim.opt.splitright=true -- Open new splits to the right of the current one
vim.opt.swapfile=false -- Disable swapfile (stores the things changed in a file)
vim.opt.textwidth=80 -- On format, format to 80 char long lines
vim.opt.visualbell=true -- Flash the screen on error
vim.opt.wrap=false -- Don't wrap lines of text automatically
vim.opt.signcolumn = 'no'
vim.diagnostic.config({
-- Turn off the diagnostics signs on the line number. In LSP mode, editing
-- a C++ buffer constantly toggles the sign column on and off as you change
-- modes which is very visually distracting.
signs = false,
})
-- Adjust the quick fix window that pops-up on build to size the buffer with
-- the size of the output and at most 10 lines.
function AdjustQuickfixHeight()
local num_lines = vim.fn.line('$')
local max_height = 10
local height = math.min(num_lines, max_height)
vim.cmd(height .. 'wincmd _')
end
vim.cmd[[
autocmd BufWinEnter quickfix lua AdjustQuickfixHeight()
]]
EOF
" Theme ============================================================================================
let g:gruvbox_material_background='hard'
let g:gruvbox_material_foreground='mix'
let g:gruvbox_material_disable_italic_comment=1
let g:gruvbox_material_enable_italic=0
let g:gruvbox_material_enable_bold=0
let g:gruvbox_material_diagnostic_virtual_text='colored'
let g:gruvbox_material_better_performance=1
colorscheme gruvbox-material
" Vim-cpp-modern customisation
" Disable function highlighting (affects both C and C++ files)
let g:cpp_function_highlight = 1
" Enable highlighting of C++11 attributes
let g:cpp_attributes_highlight = 1
" Highlight struct/class member variables (affects both C and C++ files)
let g:cpp_member_highlight = 0
" Put all standard C and C++ keywords under Vim's highlight group 'Statement'
" (affects both C and C++ files)
let g:cpp_simple_highlight = 1
" Options ==========================================================================================
" Show EOL type and last modified timestamp, right after the filename
set statusline=%<%F%h%m%r\ [%{&ff}]\ (%{strftime(\"%H:%M\ %d/%m/%Y\",getftime(expand(\"%:p\")))})%=%l,%c%V\ %P
" File patterns to ignore in command line auto complete
set wildignore+=*.class,*.o,*\\tmp\\*,*.swp,*.zip,*.exe,*.obj,*.vcxproj,*.pdb,*.idb
" Setup undo file
set undofile
let &undodir=stdpath('config') . '/undo'
" Setup backup directory
let &backupdir=stdpath('config') . '/backup'
" Enable mouse support
if has('mouse')
set mouse=a
endif
" Functions ========================================================================================
" Increase font size using (Ctrl+Up Arrow) or (Ctrl+Down Arrow) if we are using
" gvim Otherwise font size is determined in terminal
nnoremap <C-Up> :silent! let &guifont = substitute(
\ &guifont,
\ ':h\zs\d\+',
\ '\=eval(submatch(0)+1)',
\ 'g')<CR>
nnoremap <C-Down> :silent! let &guifont = substitute(
\ &guifont,
\ ':h\zs\d\+',
\ '\=eval(submatch(0)-1)',
\ 'g')<CR>
" Formatting options (see :h fo-table)
augroup persistent_settings
au!
au bufenter * :set formatoptions=q1j
augroup end
function! RemedyBGOpenFile()
execute("!remedybg open-file " . expand("%:p") . " " . line("."))
execute("!powershell -Command Add-Type -AssemblyName Microsoft.VisualBasic; [Microsoft.VisualBasic.Interaction]::AppActivate(' - RemedyBG')")
endfunction
command RemedyBGOpenFile call RemedyBGOpenFile()
function! RemedyBGStartDebugging()
execute("!remedybg start-debugging " . expand("%:p") . " " . line("."))
endfunction
command RemedyBGStartDebugging call RemedyBGStartDebugging()
function! RemedyBGStopDebugging()
execute("!remedybg stop-debugging " . expand("%:p") . " " . line("."))
endfunction
command RemedyBGStopDebugging call RemedyBGStopDebugging()
function! RemedyBGRunToCursor()
execute("!remedybg open-file " . expand("%:p") . " " . line("."))
execute("!remedybg run-to-cursor " . expand("%:p") . " " . line("."))
execute("!powershell -Command Add-Type -AssemblyName Microsoft.VisualBasic; [Microsoft.VisualBasic.Interaction]::AppActivate(' - RemedyBG')")
endfunction
command RemedyBGRunToCursor call RemedyBGRunToCursor()
function! RemedyBGAddBreakpointAtFile()
execute("!remedybg open-file " . expand("%:p") . " " . line("."))
execute("!remedybg add-breakpoint-at-file " . expand("%:p") . " " . line("."))
execute("!powershell -Command Add-Type -AssemblyName Microsoft.VisualBasic; [Microsoft.VisualBasic.Interaction]::AppActivate(' - RemedyBG')")
endfunction
command RemedyBGAddBreakpointAtFile call RemedyBGAddBreakpointAtFile()
nnoremap <silent> <F6> <cmd>RemedyBGOpenFile<cr><cr>
nnoremap <silent> <F5> <cmd>RemedyBGStartDebugging<cr><cr>
nnoremap <silent> <S-F5> <cmd>RemedyBGStopDebugging<cr><cr>
nnoremap <silent> <F9> <cmd>RemedyBGAddBreakpointAtFile<cr><cr>
nnoremap <silent> <C-F10> <cmd>RemedyBGRunToCursor<cr><cr>
" 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%' }
command! -nargs=* -bang FzfCustomRG call RipgrepFzf(<q-args>, <bang>0)
" Augment the "FzfCustomFiles" command
command! -bang -nargs=? -complete=dir FzfCustomFiles
\ call fzf#vim#files(<q-args>, {'options': ['--layout=reverse', '--info=inline', '--preview', 'cat {}']}, <bang>0)
" General Key Bindings =============================================================================
" FZF Bindings
nnoremap <leader>h <cmd>FzfHistory<cr>
nnoremap <leader>f <cmd>FzfCustomFiles<cr>
nnoremap <leader>g <cmd>FzfRg<cr>
nnoremap <leader>t :FzfWorkspaceSymbols<space>
nnoremap <leader>cc <cmd>FzfCommits<cr>
nnoremap <leader>cb <cmd>FzfBCommits<cr>
nnoremap <leader>b <cmd>FzfBuffers<cr>
function! PadAndTruncateLineFunction()
let line = getline('.')
let line_length = strlen(line)
let padding = 100 - line_length
let padding = max([padding, 0])
let existing_space = line_length == 100 || match(line, ' $') != -1
" Construct the new line with padding and a space before the padding
let new_line = line . (existing_space ? '' : ' ') . repeat('=', padding - 1)
call setline(line('.'), new_line)
endfunction
command! PadAndTruncateLine :call PadAndTruncateLineFunction()<CR>
nnoremap <silent> <F3> :PadAndTruncateLine<cr>
" Map Ctrl+HJKL to navigate buffer window
nmap <silent> <C-h> :wincmd h<CR>
nmap <silent> <C-j> :wincmd j<CR>
nmap <silent> <C-k> :wincmd k<CR>
nmap <silent> <C-l> :wincmd l<CR>
" Move by wrapped lines instead of line numbers
nnoremap j gj
nnoremap k gk
nnoremap gj j
nnoremap gk k
" Map NERDTree to Ctrl-N
map <C-n> :NERDTreeToggle<CR>
" Change to current buffer's directory
nmap cd :cd <C-R>=expand("%:p:h")<CR><CR>
" Buffer Splitting
nnoremap <leader>s :vs<CR>
" Go to next error
" Go to previous error
nnoremap <A-j> :cn<CR>
nnoremap <A-k> :cp<CR>
" Vim Dispatch =====================================================================================
let s:running_windows = has("win16") || has("win32") || has("win64")
if s:running_windows
set makeprg=build.bat
else
" Set vim terminal to enter normal mode using escape like normal vim behaviour
tnoremap <Esc> <C-\><C-n>
set makeprg=./build.sh
endif
nnoremap <C-b> :Make<cr>
Regular → Executable
View File
+77
View File
@@ -0,0 +1,77 @@
#!/bin/bash
# Setup ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
script_path=$0
script_dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
root_dir="${devenver_root}"
# Arguments ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
clang_dir="$root_dir/LLVM"
cmake_dir="$root_dir/CMake"
node_dir="$root_dir/NodeJS"
python_dir="$root_dir/Python"
virustotal_url="https://www.virustotal.com/gui/file"
# Argument parsing :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
option="$1"
shift
if [ "$option" = "clang" ]; then exe_dir="$clang_dir/$1/bin" && PATH="$exe_dir:$PATH" && cmd_line="$2" && shift && shift; fi
if [ "$option" = "cmake" ]; then exe_dir="$cmake_dir/$1" && PATH="$exe_dir:$PATH" && cmd_line="$2" && shift && shift; fi
if [ "$option" = "node" ]; then exe_dir="$node_dir/$1/bin" && PATH="$exe_dir:$PATH" && cmd_line="$2" && shift && shift; fi
if [ "$option" = "python" ]; then
python_root=$python_dir/$1/install
# Shit like building UWSGI in Python via PIP with wheel doesn't seem to use
# LD_LIBRARY_PATH but LDFLAGS works. Dependency hell
cmd_prefix="LDFLAGS=${python_root}/lib LD_LIBRARY_PATH=$python_root/lib:$LD_LIBRARY_PATH PYTHONHOME=$python_root"
exe_dir="$python_root/bin"
PATH="$exe_dir:$PATH"
cmd_line="$2"&& shift && shift;
fi
if [ "$option" = "virustotal" ]; then virustotal_hash=$(sha256sum "$1" | awk '{print $1}') && cmd_line="xdg-open $virustotal_url/$virustotal_hash &" && shift; fi
if [ -z "$cmd_line" ]; then option="help"; fi
if [ "$option" = "help" ]; then
clang_versions=$(ls -1 "$clang_dir" 2>/dev/null | tr '\n' ' ')
cmake_versions=$(ls -1 "$cmake_dir" 2>/dev/null | tr '\n' ' ')
node_versions=$(ls -1 "$node_dir" 2>/dev/null | tr '\n' ' ')
python_versions=$(ls -1 "$python_dir" 2>/dev/null | tr '\n' ' ')
cat << EOF
USAGE: dev [option] [args...]
NOTES:
Commands augment the system PATH with the tool's path for the current shell session.
You can chain the commands to augment the PATH, e.g:
dev.sh python 3.12.9+20250317 dev.sh node 20.18.2 yarn build-everything
OPTIONS:
cmake [version] [cmd...] CMake build system: 'PATH=$cmake_dir/[version]:\$PATH [cmd...]'
Versions: $cmake_versions
clang [version] [cmd..] CLANG compiler: 'PATH=$clang_dir/[version]:\$PATH [cmd...]'
Example: 'dev clang 18.1.4 clang++.exe --help'
Versions: $clang_versions
node [version] [cmd...] Node JS: 'PATH=$node_dir/[version]:\$PATH [cmd...]'
Versions: $node_versions
python [version] [cmd...] Python: 'PATH=$python_dir/[version]/install/bin:\$PATH [cmd...]'
Versions: $python_versions
virustotal [file] Lookup file SHA256 hash on VirusTotal: '$virustotal_url/[file]'
EOF
exit 0
fi
# Extract user arguments ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
user_args=""
while [ $# -gt 0 ]; do user_args="$user_args $1"; shift; done
# Trim trailing space ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
while [ "${user_args: -1}" = " " ]; do user_args="${user_args% }"; done
while [ "${cmd_line: -1}" = " " ]; do cmd_line="${cmd_line% }"; done
# Eval ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
echo "DEV: Running '$script_path' with '$cmd_prefix $cmd_line$user_args'"
eval "$cmd_prefix $cmd_line$user_args"
Regular → Executable
+19 -6
View File
@@ -1,20 +1,33 @@
#!/bin/bash
# Run script and build GCC versions
# ./unix_gcc_build.sh 13.2.0 12.3.0 11.4.0 10.4.0 9.5.0 8.5.0 7.5.0 6.5.0
# Extract and install the build using
# tar --use-compress-program=zstd -xf gcc-mostlyportable-13.2.0.tar.zst -C ~/Dev/Linux/GCC
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
tar_file=gcc-mostlyportable-${gcc_version}.tar
archive_file=${tar_file}.zst
if [ ! -e "${archive_file}" ]; then
docker build -t ${image_name} --build-arg GCC_VERSION=${gcc_version} -f unix_gcc_dockerfile . || 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
mv --force gcc-mostlyportable-${gcc_version} ${gcc_version} || exit
tar cf ${tar_file} -p ${gcc_version} || exit
zstd --rm ${tar_file} || exit
rm -rf ./${gcc_version} || exit
fi
done
if [[ $EUID == 0 ]]; then
chown --recursive ${USER} gcc-mostlyportable-*
fi
# if [[ $EUID == 0 ]]; then
# chown --recursive ${USER} gcc-mostlyportable-*
# fi
+4 -2
View File
@@ -17,6 +17,8 @@ RUN set -ex \
libgmp-dev \
libz-dev \
m4 \
file \
bison \
schedtool \
texinfo \
texlive \
@@ -30,8 +32,8 @@ RUN set -ex \
&& cd mostlyportable-gcc \
&& git checkout $MOSTLY_PORTABLE_GIT_BRANCH
ARG GCC_VERSION=11.3.0
ARG BIN_UTILS_VERSION=2.38
ARG GCC_VERSION=13.2.0
ARG BIN_UTILS_VERSION=2.41
RUN set -ex \
&& cd mostlyportable-gcc \
&& sed --in-place "s/^_use_gcc_git=\".*\"$/_use_gcc_git=\"false\"/" mostlyportable-gcc.cfg \
+119
View File
@@ -0,0 +1,119 @@
@echo off
:: Setup :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
setlocal enabledelayedexpansion
set script_path=%~dpnx0
set script_dir_backslash=%~dp0
set script_dir=%script_dir_backslash:~0,-1%
set root_dir=%devenver_root%
:: Arguments :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
set clang_dir=%root_dir%\LLVM
set cmake_dir=%root_dir%\CMake
set msvc_dir=%root_dir%\msvc
set msvc_vc_dir=%msvc_dir%\msvc_host_x64_target_x64
set msvc_sdk_dir=%msvc_dir%\sdk_host_x64_target_x64
set node_dir=%root_dir%\NodeJS
set raddbg_dir=%root_dir%\raddbg\trunk
set raddbg_args=--user:%raddbg_dir%\..\doylet.raddbg_user
set raddbg_exe=raddbg.exe
set radlink_dir=%root_dir%\raddbg\trunk
set radlink_exe=radlink.exe
set rad_update_dir=%radlink_dir%\..
set rad_update_exe=update_trunk.bat
set remedybg_dir=%root_dir%\RemedyBG
set remedybg_exe=remedybg.exe
set virustotal_url=https://www.virustotal.com/gui/file
set rust_dir=%userprofile%\.rustup\toolchains\stable-x86_64-pc-windows-msvc\bin
:: Argument parsing ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Remove the first argument which is the command (e.g. raddbg or radlink)
set option=%1
shift
if "%option%"=="clang" set "exe_dir=%clang_dir%\%1\bin" && set path=%exe_dir%;%path% && set cmd_line=!exe_dir!\%2 && shift && shift
if "%option%"=="cmake" set "exe_dir=%cmake_dir%\%1" && set path=%exe_dir%;%path% && set cmd_line=!exe_dir!\%2 && shift && shift
if "%option%"=="node" set "exe_dir=%node_dir%\%1" && set path=%exe_dir%;%path% && set cmd_line=!exe_dir!\%2 && shift && shift
if "%option%"=="msvc" endlocal && call %msvc_vc_dir%\%1\devcmd.bat && call %msvc_sdk_dir%\%2\devcmd.bat && goto :eof
if "%option%"=="rad_update" set "exe_dir=%rad_update_dir%" && set path=%rad_update_dir%;%path% && set cmd_line=!exe_dir!\update_trunk.bat
if "%option%"=="raddbg" set "exe_dir=%raddbg_dir%" && set path=%exe_dir%;%path% && set cmd_line=start /B !exe_dir!\%raddbg_exe% %raddbg_args%
if "%option%"=="raddbg_env" endlocal && set path=%raddbg_dir%;%path% && goto :eof
if "%option%"=="radlink" set "exe_dir=%radlink_dir%" && set path=%exe_dir%;%path% && set cmd_line=!exe_dir!\%radlink_exe%
if "%option%"=="radlink_env" endlocal && set path=%radlink_dir%;%path% && goto :eof
if "%option%"=="rust_env" endlocal && set path=%rsut_dir%;%path% && goto :eof
if "%option%"=="remedybg" set "exe_dir=%remedybg_dir%\%1" && set path=%exe_dir%;%path% && set cmd_line=start /B !exe_dir!\%remedybg_exe% && shift
if "%option%"=="virustotal" for /f "delims=" %%a in ('powershell -Command "(Get-FileHash \"%1\" -Algorithm SHA256).Hash"') do set virustotal_hash=%%a && shift
if "%option%"=="virustotal" set cmd_line=start /B %virustotal_url%/%virustotal_hash%
if "%cmd_line%"=="" set option=help
if "%option%"=="help" (
for /f "delims=" %%a in ('dir /B %clang_dir%') do set "clang_versions=%%a !clang_versions!"
for /f "delims=" %%a in ('dir /B %cmake_dir%') do set "cmake_versions=%%a !cmake_versions!"
for /f "delims=" %%a in ('dir /B %remedybg_dir%') do set "remedybg_versions=%%a !remedybg_versions!"
for /f "delims=" %%a in ('dir /B %node_dir%') do set "node_versions=%%a !node_versions!"
for /f "delims=" %%a in ('dir /B %msvc_vc_dir%') do set "msvc_vc_versions=%%a !msvc_vc_versions!"
for /f "delims=" %%a in ('dir /B %msvc_sdk_dir%') do set "msvc_sdk_versions=%%a !msvc_sdk_versions!"
echo USAGE: dev [option] [args...]
echo.
echo NOTES:
echo Commands augment the system path with the path to the tool for the current shell session.
echo.
echo OPTIONS:
echo cmake [version] [exe] CMake build system: 'set PATH=%cmake_dir%\[version]\[exe];%%PATH%% %cmake_args%'
echo Versions: !cmake_versions!
echo.
echo clang [version] [exe] CLANG compiler: 'set PATH=%clang_dir%\[version]\[exe];%%PATH%% %clang_args%'
echo Example: 'dev clang 18.1.4 clang++.exe --help'
echo Versions: !clang_versions!
echo.
echo msvc [vc_version] [sdk_version] MSVC build tools: '%msvc_vc_dir%\[vc_version]'
echo '%msvc_sdk_dir%\[sdk_version]'
echo VC Versions: !msvc_vc_versions!
echo SDK Versions: !msvc_sdk_versions!
echo.
echo node [version] [exe] Node JS: '%node_dir%\[version]\[exe]'
echo Versions: !node_versions!
echo.
echo raddbg RAD debugger: '%raddbg_dir%\%raddbg_exe% %raddbg_args%'
echo raddbg_env Add RAD debugger to PATH env: 'set PATH=%raddbg_dir%;%%PATH%%'
echo radlink RAD linker: '%radlink_dir%\%radlink_exe%'
echo radlink_env Add RAD linker to PATH env: 'set PATH=%radlink_dir%;%%PATH%%'
echo rad_update Update the RAD linker and debugger: '%rad_update_dir%\%rad_update_exe%'
echo.
echo remedybg [version] C/C++ debugger: '%remedybg_dir%\%remedybg_exe%'
echo Versions: !remedybg_versions!
echo.
if exist "!rust_dir!\cargo.exe" (
echo rust_env Add Rust to PATH env: 'set PATH=!rust_dir!;%%PATH%%'
echo.
)
echo virustotal [file] Lookup file SHA256 hash on VirusTotal: '%virustotal_url%/[file]'
goto :eof
)
:: Extract user arguments ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:extract_args
if "%~1" neq "" (
set user_args=%user_args% %1
shift
goto :extract_args
)
:trim_user_args_trailing_space
if "!user_args:~-1!"==" " (
set user_args=!user_args:~0,-1!
goto trim_user_args_trailing_space
)
:trim_cmd_line_trailing_space
if "!cmd_line:~-1!"==" " (
set cmd_line=!cmd_line:~0,-1!
goto trim_cmd_line_trailing_space
)
:: Eval ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
echo DEV: Running "%script_path%" with "%cmd_line%%user_args%"
call %cmd_line%%user_args%
goto :eof
@@ -1,14 +0,0 @@
@echo off
start /B https://brave.com
start /B https://desktop.telegram.org
start /B https://ledger.com/ledger-live
start /B https://getsession.org/windows
start /B https://github.com/kapitainsky/RcloneBrowser/releases
start /B https://mozilla.org/en-US/firefox/new
start /B https://obsidian.md/download
start /B https://protonvpn.com/download
start /B https://signal.org/download
start /B https://safing.io
start /B https://spotify.com/us/download
start /B https://discord.com/download
start /B https://www.gpsoft.com.au/dscripts/download.asp
-13
View File
@@ -1,13 +0,0 @@
#!/bin/bash
script_dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
desired_dir=${script_dir}/../NodeJS/12.22.12/bin
desired_exe=${desired_dir}/node
PATH=${desired_dir}:${PATH}
curr_script=$(realpath "${BASH_SOURCE[0]}")
echo [DEVENVER] Executing script \"${curr_script}\" with \"${desired_exe}\"
${desired_exe} $@
-13
View File
@@ -1,13 +0,0 @@
#!/bin/bash
script_dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
desired_dir=${script_dir}/../NodeJS/16.19.0/bin
desired_exe=${desired_dir}/node
PATH=${desired_dir}:${PATH}
curr_script=$(realpath "${BASH_SOURCE[0]}")
echo [DEVENVER] Executing script \"${curr_script}\" with \"${desired_exe}\"
${desired_exe} $@
-13
View File
@@ -1,13 +0,0 @@
#!/bin/bash
script_dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
desired_dir=${script_dir}/../NodeJS/18.15.0/bin
desired_exe=${desired_dir}/node
PATH=${desired_dir}:${PATH}
curr_script=$(realpath "${BASH_SOURCE[0]}")
echo [DEVENVER] Executing script \"${curr_script}\" with \"${desired_exe}\"
${desired_exe} $@
-13
View File
@@ -1,13 +0,0 @@
#!/bin/bash
script_dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
desired_dir=${script_dir}/../NodeJS/12.22.12/bin
desired_exe=${desired_dir}/npm
PATH=${desired_dir}:${PATH}
curr_script=$(realpath "${BASH_SOURCE[0]}")
echo [DEVENVER] Executing script \"${curr_script}\" with \"${desired_exe}\"
${desired_exe} $@
-13
View File
@@ -1,13 +0,0 @@
#!/bin/bash
script_dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
desired_dir=${script_dir}/../NodeJS/16.19.0/bin
desired_exe=${desired_dir}/npm
PATH=${desired_dir}:${PATH}
curr_script=$(realpath "${BASH_SOURCE[0]}")
echo [DEVENVER] Executing script \"${curr_script}\" with \"${desired_exe}\"
${desired_exe} $@
-13
View File
@@ -1,13 +0,0 @@
#!/bin/bash
script_dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
desired_dir=${script_dir}/../NodeJS/18.15.0/bin
desired_exe=${desired_dir}/npm
PATH=${desired_dir}:${PATH}
curr_script=$(realpath "${BASH_SOURCE[0]}")
echo [DEVENVER] Executing script \"${curr_script}\" with \"${desired_exe}\"
${desired_exe} $@
-3
View File
@@ -1,3 +0,0 @@
@echo off
call %devenver_root%\msvc\msvc-14.34.bat
call %devenver_root%\msvc\win-sdk-22621.bat
-2
View File
@@ -1,2 +0,0 @@
@echo off
call "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat" x64
-12
View File
@@ -1,12 +0,0 @@
@echo off
setlocal
set desired_path=%devenver_root%\RemedyBG\0_3_9_6
set desired_exe=remedybg.exe
set path=%desired_path%;%path%
set exe_to_use=""
for /f "delims=" %%a in ('where "$desired_path:%desired_exe%"') do ( set "exe_to_use=%%a")
echo [DEVENVER] Executing script "%~dpnx0" with "%exe_to_use%"
start /B %desired_exe% %*
endlocal
-12
View File
@@ -1,12 +0,0 @@
@echo off
setlocal
set desired_path=%devenver_root%\NodeJS\16.19.0
set desired_exe=yarn
set path=%desired_path%;%path%
set exe_to_use=""
for /f "delims=" %%a in ('where "$desired_path:%desired_exe%"') do ( set "exe_to_use=%%a")
echo [DEVENVER] Executing script "%~dpnx0" with "%exe_to_use%"
call %desired_exe% %*
endlocal
+224 -152
View File
@@ -3,7 +3,7 @@ def get_manifest(is_windows):
# --------------------------------------------------------------------------
version = "20221119-145034-49b9839f"
version = "20240203-110809-5046fc22"
download_url = ""
exe_name = ""
download_checksum = ""
@@ -13,12 +13,12 @@ def get_manifest(is_windows):
if is_windows:
exe_path = f"wezterm-gui.exe"
download_url = f"https://github.com/wez/wezterm/releases/download/{version}/WezTerm-windows-{version}.zip"
download_checksum = "7041d2c02d226c0c051cc9f6373d51ac9a2de00025e18582077c76e8ad68abe1"
checksum = "e3faa247d69a8a966302a2ab4e655b08b79548707db79a7b724cf18cccf5ae35"
download_checksum = "57e5d03b585303d81e8b8e96d1230362852eb39aca92b3b29c7a42cfb82f9ac4"
checksum = "9491ca934f32d008329ae084e88305975b16a89f830af7df5750a6186b59f4ce"
else:
exe_path = f"WezTerm-{version}-Ubuntu18.04.AppImage"
exe_path = f"WezTerm-{version}-Ubuntu20.04.AppImage"
download_url = f"https://github.com/wez/wezterm/releases/download/{version}/{exe_path}"
download_checksum = "1611b4d5ba2598587874b3ff51dc0849e7ece7f2e0a0d376e13fbd00f9ae2807"
download_checksum = "34010a07076d2272c4d4f94b5e0dae608a679599e8d729446323f88f956c60f0"
checksum = download_checksum
result.append({
@@ -79,6 +79,36 @@ def get_manifest(is_windows):
checksum = ""
symlink = []
version = "4.2.4"
if is_windows:
exe_path = f"bin/cmake.exe"
download_url = f"https://github.com/Kitware/CMake/releases/download/v{version}/cmake-{version}-windows-x86_64.zip"
download_checksum = "d0fe635f3ddc748485ab1a144a28553cae31ae598a3c22a1de3c31db31251287"
checksum = "89e096daabce5459bcb0fbebd77b19f6a73f6c499725cf3590e06ec25d71e86f"
symlink = [f"cmake-{version}.exe"]
else:
exe_path = f"bin/cmake"
download_url = f"https://github.com/Kitware/CMake/releases/download/v{version}/cmake-{version}-linux-x86_64.tar.gz"
download_checksum = "2fc22f96b1e79487d258eaaf565aacb808d1ec99ec64168ebd795dff9dcaeb1d"
checksum = "945225d98d1d3e5aa731a9321cb7a1b90ca992e737406373bf976cfba80cd8df"
symlink = [f"cmake-{version}"]
result[-1]['manifests'].append({
"download_checksum": download_checksum,
"download_url": download_url,
"version": version,
"executables": [
{
"path": exe_path,
"symlink": symlink,
"add_to_devenv_path": True,
"checksum": checksum,
}
],
"add_to_devenv_script": [],
})
version = "3.26.4"
if is_windows:
exe_path = f"bin/cmake.exe"
@@ -101,7 +131,7 @@ def get_manifest(is_windows):
{
"path": exe_path,
"symlink": symlink,
"add_to_devenv_path": True,
"add_to_devenv_path": False,
"checksum": checksum,
}
],
@@ -241,12 +271,12 @@ def get_manifest(is_windows):
if is_windows:
label = "Git"
version = "2.39.1"
version = "2.50.1"
result.append({
"label": f"{label}",
"manifests": [
{
"download_checksum": "b898306a44084b5fa13b9a52e06408d97234389d07ae41d9409bdf58cad3d227",
"download_checksum": "c45a7dfa2bde34059f6dbd85f49a95d73d5aea29305f51b79595e56e4f323a3d",
"download_url": f"https://github.com/git-for-windows/git/releases/download/v{version}.windows.1/PortableGit-{version}-64-bit.7z.exe",
"version": version,
"unzip_method": '7zip',
@@ -255,7 +285,7 @@ def get_manifest(is_windows):
"path": "cmd/git.exe",
"symlink": [],
"add_to_devenv_path": True,
"checksum": "2fc6d5be237efb6b429d8f40975f1a1cfe3bcac863d9335e24096c8b0ec38105",
"checksum": "c954fcc8e65a38450895ca65d308ecaee63f044d16494b5385faa5e036a3facb",
}
],
"add_to_devenv_script": [
@@ -515,6 +545,53 @@ def get_manifest(is_windows):
executables = []
unzip_method = "default"
version = "19.1.7"
if is_windows:
download_url = f"https://github.com/llvm/llvm-project/releases/download/llvmorg-{version}/LLVM-{version}-win64.exe"
download_checksum = "f19ae5bc4823ac69ec01dc2ded503ec80a04ad2208dda1595d1f0413c148ef90"
unzip_method = '7zip'
executables = [
{
"path": f"bin/clang++.exe",
"checksum": "56ef1abd0df11a3b1b77822193e927c6345078c24511567ae10b3afd803d03a3",
"symlink": [f"clang++-{version}.exe"],
"add_to_devenv_path": True,
},
{
"path": f"bin/clang.exe",
"checksum": "56ef1abd0df11a3b1b77822193e927c6345078c24511567ae10b3afd803d03a3",
"symlink": [f"clang-{version}.exe"],
"add_to_devenv_path": True,
}
]
else:
download_url = f"https://github.com/llvm/llvm-project/releases/download/llvmorg-{version}/LLVM-{version}-Linux-X64.tar.xz"
download_checksum = "4a5ec53951a584ed36f80240f6fbf8fdd46b4cf6c7ee87cc2d5018dc37caf679"
executables = [
{
"path": f"bin/clang++",
"checksum": "c57e2928bc629e58da157867bb9af550edfc1195e7b003edfcfecd57faf2b71b",
"symlink": [f"clang++-{version}"],
"add_to_devenv_path": True,
},
{
"path": f"bin/clang",
"checksum": "c57e2928bc629e58da157867bb9af550edfc1195e7b003edfcfecd57faf2b71b",
"symlink": [f"clang-{version}"],
"add_to_devenv_path": True,
}
]
result[-1]['manifests'].append({
"download_checksum": download_checksum,
"download_url": download_url,
"version": version,
"unzip_method": unzip_method,
"executables": executables,
"add_to_devenv_script": [],
})
if is_windows:
version = "15.0.7"
download_url = f"https://github.com/llvm/llvm-project/releases/download/llvmorg-{version}/LLVM-{version}-win64.exe"
@@ -525,13 +602,13 @@ def get_manifest(is_windows):
"path": f"bin/clang++.exe",
"checksum": "1f523e33de4ce9d591b4eb9bad102f086e8480488148f8db0d5c87056798ce3e",
"symlink": [f"clang++-{version}.exe"],
"add_to_devenv_path": True,
"add_to_devenv_path": False,
},
{
"path": f"bin/clang.exe",
"checksum": "1f523e33de4ce9d591b4eb9bad102f086e8480488148f8db0d5c87056798ce3e",
"symlink": [f"clang-{version}.exe"],
"add_to_devenv_path": True,
"add_to_devenv_path": False,
}
]
else:
@@ -543,13 +620,13 @@ def get_manifest(is_windows):
"path": f"bin/clang++",
"checksum": "388be41dc565a891ced9e78da2e89a249ca9b9a26f71a3c912e8ba89585be89c",
"symlink": [f"clang++-{version}"],
"add_to_devenv_path": True,
"add_to_devenv_path": False,
},
{
"path": f"bin/clang",
"checksum": "388be41dc565a891ced9e78da2e89a249ca9b9a26f71a3c912e8ba89585be89c",
"symlink": [f"clang-{version}"],
"add_to_devenv_path": True,
"add_to_devenv_path": False,
}
]
@@ -745,7 +822,7 @@ def get_manifest(is_windows):
# --------------------------------------------------------------------------
version = "1.11.1"
version = "1.31.1"
download_url = ""
download_checksum = ""
exe_path = ""
@@ -786,7 +863,7 @@ def get_manifest(is_windows):
# --------------------------------------------------------------------------
label = "NodeJS"
version = "16.19.0"
version = "24.12.0"
download_url = ""
download_checksum = ""
exe_path = ""
@@ -796,16 +873,14 @@ def get_manifest(is_windows):
if is_windows:
download_url = f"https://nodejs.org/dist/v{version}/node-v{version}-win-x64.7z"
download_checksum = "e07399a4a441091ca0a5506faf7a9236ea1675220146daeea3bee828c2cbda3f"
checksum = "e4e7f389fbec9300275defc749246c62bdbe4f66406eb01e7c9a4101e07352da"
download_checksum = "8d41356abf5cb62404f311f131b7937f45aaeda5c15d060dc281c2ece817cdce"
checksum = "2ffe3acc0458fdde999f50d11809bbe7c9b7ef204dcf17094e325d26ace101d8"
exe_path = "node.exe"
symlink = [f"node-{version}.exe"]
else:
download_url = f"https://nodejs.org/dist/v{version}/node-v{version}-linux-x64.tar.xz"
download_checksum = "c88b52497ab38a3ddf526e5b46a41270320409109c3f74171b241132984fd08f"
checksum = "45afcfc9a45df626e8aa2b883753d1cf7f222ad9243f3003d1aa372696120df6"
download_checksum = "bdebee276e58d0ef5448f3d5ac12c67daa963dd5e0a9bb621a53d1cefbc852fd"
checksum = "16143bdaa79716e871d3d9b2f50ce680bca293eba7f0c3fc1d004ed2258fc839"
exe_path = "bin/node"
symlink = [f"node-{version}"]
result.append({
"label": "NodeJS",
@@ -828,76 +903,11 @@ def get_manifest(is_windows):
],
})
version = "18.15.0"
if is_windows:
download_url = f"https://nodejs.org/dist/v{version}/node-v{version}-win-x64.7z"
download_checksum = "cad3cc0910dc216e8b6dcfc3c5b3be0a619c2d4a4b29f2e674820b70e4f374dd"
checksum = "17fd75d8a41bf9b4c475143e19ff2808afa7a92f7502ede731537d9da674d5e8"
symlink = [f"node-{version}.exe"]
add_to_devenv_script = [
f"set PATH=%~dp0{label}\\{version}\\node_modules\\corepack\\shims;%PATH%",
]
else:
download_url = f"https://nodejs.org/dist/v{version}/node-v{version}-linux-x64.tar.xz"
download_checksum = "c8c5fa53ce0c0f248e45983e86368e0b1daf84b77e88b310f769c3cfc12682ef"
checksum = "a2a40807f57c1c215ddb996e71e4f30b93e375cab2bfb725287b8a1f51fd1e7a"
symlink = [f"node-{version}"]
result.append({
"label": "NodeJS",
"manifests": [
{
"download_checksum": download_checksum,
"download_url": download_url,
"version": version,
"unzip_method": 'default',
"executables": [
{
"path": exe_path,
"symlink": symlink,
"add_to_devenv_path": True,
"checksum": checksum,
}
],
"add_to_devenv_script": add_to_devenv_script,
}
],
})
if not is_windows:
version = "12.22.12"
download_url = f"https://nodejs.org/dist/v{version}/node-v{version}-linux-x64.tar.xz"
download_checksum = "e6d052364bfa2c17da92cf31794100cfd709ba147415ddaeed2222eec9ca1469"
checksum = "5a3c51dbee8fdd7201fe7b531f03262754b9b9fb1008f4c824e8d649c4e9c96b"
symlink = [f"node-{version}"]
result.append({
"label": "NodeJS",
"manifests": [
{
"download_checksum": download_checksum,
"download_url": download_url,
"version": version,
"unzip_method": 'default',
"executables": [
{
"path": exe_path,
"symlink": symlink,
"add_to_devenv_path": True,
"checksum": checksum,
}
],
"add_to_devenv_script": add_to_devenv_script,
}
],
})
# --------------------------------------------------------------------------
label = "Python"
date = "20230116"
version = f"3.10.9+{date}"
date = "20250409"
version = f"3.11.12+{date}"
download_url = ""
download_checksum = ""
exe_path = ""
@@ -905,18 +915,18 @@ def get_manifest(is_windows):
add_to_devenv_script = []
if is_windows:
download_url = f"https://github.com/indygreg/python-build-standalone/releases/download/{date}/cpython-{version}-x86_64-pc-windows-msvc-shared-pgo-full.tar.zst"
download_checksum = "4cfa6299a78a3959102c461d126e4869616f0a49c60b44220c000fc9aecddd78"
checksum = "6dafb845aba67aba898f5aa8adf6c48061e7ffea1d2ed7d290a1e4386e78f2f0"
download_url = f"https://github.com/indygreg/python-build-standalone/releases/download/{date}/cpython-{version}-x86_64-pc-windows-msvc-pgo-full.tar.zst"
download_checksum = "2d143dc2c9d5a3bcc9d1e9d4cbae8da1221c94fcc5ac8b73d44c48b878d0d24b"
checksum = "5c1a45180ac4de79f8288afacc6f5021e84659a598f810c07d1e1f62d8d32ab1"
exe_path = "install/python.exe"
add_to_devenv_script = [
f"set PYTHONHOME=%~dp0{label}\\{version}\\install",
f"set PATH=%~dp0{label}\\{version}\\install\\Script;%PATH%",
f"set PATH=%~dp0{label}\\{version}\\install\\Scripts;%PATH%",
]
else:
download_url = f"https://github.com/indygreg/python-build-standalone/releases/download/{date}/cpython-{version}-x86_64_v2-unknown-linux-gnu-pgo+lto-full.tar.zst"
download_checksum = "49f4a8c02efff2debbb258973b1f6efbd568e4be2e5dca07c7dcd754a7bff9cf"
checksum = "ee96234460ff4c5163dc0681dbfaf8cf5f4e65972fde796da7b0ee0d5ce077d5"
download_checksum = "68a3c1c39e9c69c2c89104eef725024cbf5f46acf955eeb28045c7c80814b124"
checksum = "3d1e6c5de538edcea5237cc2b239306dd8767fda942059888c554dc2baf58efb"
exe_path = "install/bin/python3"
# TODO: Get ZST somehow on linux
@@ -984,13 +994,13 @@ def get_manifest(is_windows):
# --------------------------------------------------------------------------
if is_windows:
version = "0.7.0"
version = "0.7.2"
result.append({
"label": "Zeal",
"manifests": [
{
"download_url": f"https://github.com/zealdocs/zeal/releases/download/v{version}/zeal-{version}-portable-windows-x64.7z",
"download_checksum": "e99a11a5692f8ca93da55589b23d20bf40edc9a3f9d78f7d58e0c55f8bd0acac",
"download_checksum": "15d2d1417678a8a035cac58385d540949f8ffc63bceb3379d471a02509e10c32",
"version": version,
"unzip_method": 'default',
"executables": [
@@ -998,7 +1008,7 @@ def get_manifest(is_windows):
"path": "zeal.exe",
"symlink": [],
"add_to_devenv_path": False,
"checksum": "579188849d64d2f7703f46102573cda13bd50d80ab6c8c88177c1b6d324f14b8",
"checksum": "6b266a38290aa5a2fa4f1dce6af874fb46208263c1216d425a7c48eef20e6e70",
}
],
"add_to_devenv_script": [],
@@ -1008,7 +1018,7 @@ def get_manifest(is_windows):
# --------------------------------------------------------------------------
version = "0.10.1"
version = "0.14.1"
download_url = ""
download_checksum = ""
exe_path = ""
@@ -1016,15 +1026,15 @@ def get_manifest(is_windows):
symlink = []
if is_windows:
download_url = f"https://ziglang.org/download/{version}/zig-windows-x86_64-{version}.zip"
download_checksum = "5768004e5e274c7969c3892e891596e51c5df2b422d798865471e05049988125"
checksum = "607c9928a24f9d2e08df1ee240ebfd15ab1eb3c14b85e02f7dad6f8c8b53fea8"
download_url = f"https://ziglang.org/download/{version}/zig-x86_64-windows-{version}.zip"
download_checksum = "554f5378228923ffd558eac35e21af020c73789d87afeabf4bfd16f2e6feed2c"
checksum = "1ddf230367e07738c4a769eae66c1db7469e37bd520e81c86356453d0db2b9fd"
exe_path = "zig.exe"
symlink = [f"zig-{version}.exe"]
else:
download_url = f"https://ziglang.org/download/{version}/zig-linux-x86_64-{version}.tar.xz"
download_checksum = "6699f0e7293081b42428f32c9d9c983854094bd15fee5489f12c4cf4518cc380"
checksum = "b298cd869e11709b9c7a1313315b5ea2a9d8a0718f555c6990ee209d7c533442"
download_url = f"https://ziglang.org/download/{version}/zig-x86_64-linux-{version}.tar.xz"
download_checksum = "24aeeec8af16c381934a6cd7d95c807a8cb2cf7df9fa40d359aa884195c4716c"
checksum = "9df4f1d2eaa7c6ee7649d0e13853ad40deed5d94e643e9ff2a2bab52ffd9feee"
exe_path = "zig"
symlink = [f"zig-{version}"]
@@ -1052,14 +1062,14 @@ def get_manifest(is_windows):
# --------------------------------------------------------------------------
if is_windows:
version = "1.4.13"
git_hash = "0066c6"
version = "1.7.21"
git_hash = "9f5af8"
result.append({
"label": "Clink",
"manifests": [
{
"download_url": f"https://github.com/chrisant996/clink/releases/download/v{version}/clink.{version}.{git_hash}.zip",
"download_checksum": "800f7657d73a00dad40d46c9317bd418172ee40cc8b3958e32fba1f0b596e829",
"download_checksum": "66af7379f77fa443374d105e7525f6f27eee48c8f53266e81227afc0f26e60d9",
"version": version,
"unzip_method": 'default',
"executables": [
@@ -1067,7 +1077,7 @@ def get_manifest(is_windows):
"path": "clink_x64.exe",
"symlink": [],
"add_to_devenv_path": False,
"checksum": "331266334f59f2c978ff8e13bbcadb218051e790b61d9cc69e85617276c51298",
"checksum": "63b78394d4e6aa8c4c44a23dcb8f94fdff308581cab245bec91379ff2d8e0490",
}
],
"add_to_devenv_script": [],
@@ -1102,7 +1112,7 @@ def get_manifest(is_windows):
# --------------------------------------------------------------------------
version = "0.45.0"
version = "0.64.0"
download_url = ""
download_checksum = ""
exe_path = ""
@@ -1110,15 +1120,15 @@ def get_manifest(is_windows):
symlink = []
if is_windows:
download_url = f"https://github.com/junegunn/fzf/releases/download/{version}/fzf-{version}-windows_amd64.zip"
download_checksum = "eaac5e0c8ee52c984b92fd5a5ef6e96d4ad33c194ea84aeac17df1d72ea207f8"
checksum = "5e1a05b84eef7189aa085b8d9e00545246d7d2eeff9f841806984c7a2a7e74aa"
download_url = f"https://github.com/junegunn/fzf/releases/download/v{version}/fzf-{version}-windows_amd64.zip"
download_checksum = "b94fea89d118ffb7f91eb48db05fb4deea689aab7f8ef52c9c10fdc4489adbed"
checksum = "1644ee2bc7981b2e83d77cc13ff0838c848ba46277cf508ead4c7d72d3cf8107"
exe_path = "fzf.exe"
symlink = [f"fzf.exe"]
else:
download_url = f"https://github.com/junegunn/fzf/releases/download/{version}/fzf-{version}-linux_amd64.tar.gz"
download_checksum = "0f1f0b7f71680f6c88e8ddf18ece8e14c54ea6793ec17d4d51e58d15c0bab03c"
checksum = "8a3a3fa6a5dd441604d0eff28364d607c0bc666ab92036f63dbd7344f8bcdc54"
download_url = f"https://github.com/junegunn/fzf/releases/download/v{version}/fzf-{version}-linux_amd64.tar.gz"
download_checksum = "e61bdbb4356ee243d2247c2e0bf990b23eb8b8346557d0f496898c61bc835880"
checksum = "188dd25460aae4d7e02bd0653b270963a3886dfc531710f70251db21710bac08"
exe_path = "fzf"
symlink = [f"fzf"]
@@ -1145,7 +1155,7 @@ def get_manifest(is_windows):
# --------------------------------------------------------------------------
version = "0.9.5"
version = "0.12.1"
download_url = ""
download_checksum = ""
exe_path = ""
@@ -1154,13 +1164,13 @@ def get_manifest(is_windows):
if is_windows:
download_url = f"https://github.com/neovim/neovim/releases/download/v{version}/nvim-win64.zip"
download_checksum = "de6dc1f0edb45f5f225ee24ce80a4fcbc3a337932037e98ae143975fca2556bf"
checksum = "d60036b942091c668dc2d7f2e3ecc7f76d534457c37adce102bd3c01c273c2ff"
download_checksum = "75fedc530b3772ca9f177edc7db92560bb9d2d6700ac6d5b2c53eaf5a9317ae3"
checksum = "10ea3c95e5638e88c232fde281043cbd3482f6b4a9fe100d31e6d42f614b4bc1"
exe_path = "bin/nvim.exe"
else:
exe_path = "nvim.appimage"
download_url = f"https://github.com/neovim/neovim/releases/download/v{version}/nvim.appimage"
download_checksum = "0c82e5702af7a11fbb916a11b4a82e98928abf8266c74b2030ea740340437bf9"
exe_path = "nvim-linux-x86_64.appimage"
download_url = f"https://github.com/neovim/neovim/releases/download/v{version}/{exe_path}"
download_checksum = "022e6e7eb79939813fa895ad39aa7dcaa10bb9c20ed234d5752fe12845df27db"
checksum = download_checksum
symlink = ["nvim", "vim"] # Usually use VM with no desktop-environment
@@ -1187,7 +1197,7 @@ def get_manifest(is_windows):
# --------------------------------------------------------------------------
version = "0.12.1"
version = "0.16.2"
download_url = ""
download_checksum = ""
exe_path = ""
@@ -1195,12 +1205,12 @@ def get_manifest(is_windows):
if is_windows:
download_url = f"https://github.com/neovide/neovide/releases/download/{version}/neovide.exe.zip"
download_checksum = "9d434a3094a25c27f38b8d846c4645cab8211b427db99a1268307d0a0c2a5154"
checksum = "a403efd394f60ce8c1250b0d741f75f47c04bc5d87bd1b6206af3a0ef709893d"
download_checksum = "d1e071d8bf676a500988820b852843e811fc8355396ce72e8f4c7ed2c744e2e2"
checksum = "b6b20dfc2d4fd7eb584fee46c7f6d4fd64c1ffaa2fcbf668f51e2d1a35d06f6a"
exe_path = "neovide.exe"
else:
download_url = f"https://github.com/neovide/neovide/releases/download/{version}/neovide.AppImage"
download_checksum = "49df6aafafb0ec5bd5fdfcaee2d1fc9036fe8237bf2bb68102aaf1a0b43d6096"
download_checksum = "ef617c743d7425267ac3ae2f1761ac8fc801683bd3e013758eb68247a53c6812"
checksum = download_checksum
exe_path = "neovide.AppImage"
@@ -1227,21 +1237,21 @@ def get_manifest(is_windows):
# --------------------------------------------------------------------------
version = "1.26.2"
version = "1.37.4"
download_url = ""
download_checksum = ""
exe_path = ""
checksum = ""
if is_windows:
download_url = f"https://github.com/WerWolv/ImHex/releases/download/v{version}/imhex-{version}-Windows-Portable.zip"
download_checksum = "4f58097c3ccee88d8dff0d48da0f239af8a9d444903cc19a3369f63caa8d77e6"
checksum = "ddd448c0d8fe71295bbcc5b52c9e9f4b06956a79572b7d634436a49728f5f341"
download_url = f"https://github.com/WerWolv/ImHex/releases/download/v{version}/imhex-{version}-Windows-Portable-x86_64.zip"
download_checksum = "6e9ba9b8671e5b12cb083b65688eca38b5d0ddc03b7970c2da12419cd3194800"
checksum = "d78481860d1e63c02a46066d3d6fa4efd799291667098842c2e5e3e25a2ff789"
exe_path = "imhex.exe"
else:
exe_path = f"imhex-{version}.AppImage"
exe_path = f"imhex-{version}-x86_64.AppImage"
download_url = f"https://github.com/WerWolv/ImHex/releases/download/v{version}/{exe_path}"
download_checksum = "229d7f2f36dca0d4aa2eeb4f637114ffa94db7d67db74b34ed7eda34d72e4bed"
download_checksum = "3e4ae8003555e190e97c08a2142e3f10003697746b20df199da7c24c0fbd34bf"
checksum = download_checksum
result.append({
@@ -1267,7 +1277,7 @@ def get_manifest(is_windows):
# --------------------------------------------------------------------------
version = "14.0.3"
version = "14.1.1"
download_url = ""
download_checksum = ""
exe_path = ""
@@ -1275,13 +1285,13 @@ def get_manifest(is_windows):
if is_windows:
download_url = f"https://github.com/BurntSushi/ripgrep/releases/download/{version}/ripgrep-{version}-x86_64-pc-windows-msvc.zip"
download_checksum = "b6df202a06cab342cf28302f319ddd5788da10672781c38dd49ebe566b423e3f"
checksum = "640535f9ff2d2db4293b9b938f70896a6923f4b5e13b7b4cb975d22a857da246"
download_checksum = "d0f534024c42afd6cb4d38907c25cd2b249b79bbe6cc1dbee8e3e37c2b6e25a1"
checksum = "f162b54de2adfc72d78adb1dbada2dedda111ae0a5e2f6e9500f4f909664c5d2"
exe_path = "rg.exe"
else:
download_url = f"https://github.com/BurntSushi/ripgrep/releases/download/{version}/ripgrep-{version}-x86_64-unknown-linux-musl.tar.gz"
download_checksum = "62cd0efc4d6f1817b9c852859987b4720cd52e0de008418266e8503028dc0c7a"
checksum = "5877446773eb2a787ad8dc0c25d283fcb63f4ecc205d5a60992ae080c0120df2"
download_checksum = "4cf9f2741e6c465ffdb7c26f38056a59e2a2544b51f7cc128ef28337eeae4d8e"
checksum = "f401154e2393f9002ac77e419f9ee5521c18f4f8cd3e32293972f493ba06fce7"
exe_path = "rg"
result.append({
@@ -1307,7 +1317,7 @@ def get_manifest(is_windows):
# -------------------------------------------------------------------------
version = "9.0.0"
version = "10.2.0"
download_url = ""
download_checksum = ""
exe_path = ""
@@ -1335,8 +1345,8 @@ def get_manifest(is_windows):
if is_windows:
download_url = f"https://github.com/sharkdp/fd/releases/download/v{version}/fd-v{version}-x86_64-pc-windows-msvc.zip"
download_checksum = "8c5ff3fb24ef02f78d3e8e7ddf116456aceeeb3832f20bba56f21d8b373e5e1b"
checksum = "e3ee4b7be6991fee4641b04074643519f98a0a6c8c1814898d0f6d2acf4fa59b"
download_checksum = "92ac9e6b0a0c6ecdab638ffe210dc786403fff4c66373604cf70df27be45e4fe"
checksum = "c089c9ee1e412a111d65c917a95c757b4e192041f316a52535bfaa3e9e03429f"
exe_path = "fd.exe"
add_to_devenv_script = [
"set FZF_DEFAULT_OPTS=--multi --layout=reverse",
@@ -1344,8 +1354,8 @@ def get_manifest(is_windows):
]
else:
download_url = f"https://github.com/sharkdp/fd/releases/download/v{version}/fd-v{version}-x86_64-unknown-linux-musl.tar.gz"
download_checksum = "069e2d58127ddd944c03a2684ad79f72e3f9bd3e0d2642c36adc5b367c134592"
checksum = "2b78bcac90f6a98bd00855446e1e420954470007607e0640dbb423529649a3a7"
download_checksum = "d9bfa25ec28624545c222992e1b00673b7c9ca5eb15393c40369f10b28f9c932"
checksum = "ebcfc522da2a3086435d4e932770ea7eab53609d0377ea1f387e82fae3d447ce"
exe_path = "fd"
add_to_devenv_script = [
"FZF_DEFAULT_OPTS=\"--multi --layout=reverse\"",
@@ -1406,18 +1416,18 @@ def get_manifest(is_windows):
# --------------------------------------------------------------------------
version = "3.52.0"
version = "3.64.0"
symlink = []
if is_windows:
exe_path = "losslesscut.exe"
download_url = f"https://github.com/mifi/lossless-cut/releases/download/v{version}/LosslessCut-win-x64.7z"
download_checksum = "fa554d5f63f7287d6b4b6bf19ac5916c99cabfe9ac22248e7a3c39898c5b56ff"
checksum = "3cae40fa13523e9dfe760521d167174ddfc21105eb20466e905eb39b74e8ed70"
download_checksum = "158ae74e26790134fe634f3371e2081db54cfffe41836a33204c82e54c66227a"
checksum = "29f50f30b1a29d7cb861aa5eacde82d6a305931625b4f048d84c94a5d64e585f"
else:
exe_path = f"LosslessCut-linux-x86_64.AppImage"
download_url = f"https://github.com/mifi/lossless-cut/releases/download/v{version}/{exe_path}"
download_checksum = "28daafe9fcd07473f460c0a903164efe93d4e5ce7e682b6f318a5550c34bdb99"
download_checksum = "2bdd1c26e24570890fb8042eb0970e0646793d0f13db9abb205221b662be8f37"
checksum = download_checksum
result.append({
@@ -1443,7 +1453,7 @@ def get_manifest(is_windows):
# --------------------------------------------------------------------------
version = "1.20.1"
version = "1.22.3"
download_url = ""
download_checksum = ""
exe_path = ""
@@ -1452,14 +1462,14 @@ def get_manifest(is_windows):
if is_windows:
exe_path = "bin/go.exe"
download_url = f"https://go.dev/dl/go{version}.windows-amd64.zip"
download_checksum = "3b493969196a6de8d9762d09f5bc5ae7a3e5814b0cfbf9cc26838c2bc1314f9c"
checksum = "89fc8e2c47f2a2a9138e60159781ce377167cf61e30d8136fbad0d77ac9303ed"
download_checksum = "cab2af6951a6e2115824263f6df13ff069c47270f5788714fa1d776f7f60cb39"
checksum = "37f24030ec1215a3a8210037f33fda633d28f1cba6f72610d25b6db7cbc7d05c"
symlink = [f"go-{version}.exe"]
else:
exe_path = f"bin/go"
download_url = f"https://go.dev/dl/go{version}.linux-amd64.tar.gz"
download_checksum = "000a5b1fca4f75895f78befeb2eecf10bfff3c428597f3f1e69133b63b911b02"
checksum = "dfaaf2d9212757e0c305c9554f616cac6744de646ef6ef20f5eaf9d9634771c3"
download_checksum = "8920ea521bad8f6b7bc377b4824982e011c19af27df88a815e3586ea895f1b36"
checksum = "030fd1182c711b6a592eb7e1f1788d2808ff47e7b62d31b8f0ae25ed985d4e4c"
symlink = [f"go-{version}"]
result.append({
@@ -1486,10 +1496,10 @@ def get_manifest(is_windows):
# --------------------------------------------------------------------------
if is_windows:
version = "1.7"
version = "1.8.1"
exe_path = "jq-windows-amd64.exe"
download_url = f"https://github.com/jqlang/jq/releases/download/jq-{version}/jq-windows-amd64.exe"
download_checksum = "2e9cc54d0a5d098e2007decec1dbb3c555ca2f5aabded7aec907fe0ffe401aab"
download_checksum = "23cb60a1354eed6bcc8d9b9735e8c7b388cd1fdcb75726b93bc299ef22dd9334"
checksum = download_checksum
symlink = [f"jq.exe", f"jq-{version}.exe"]
@@ -1514,4 +1524,66 @@ def get_manifest(is_windows):
],
})
# --------------------------------------------------------------------------
if not is_windows:
version = "2.40.2"
exe_path = "bin/mold"
download_url = f"https://github.com/rui314/mold/releases/download/v{version}/mold-{version}-x86_64-linux.tar.gz"
download_checksum = "9f2c16bae380813f4aed34d2ab0534f5e1b82df154923de33e2edf8e5648f9d8"
checksum = "0d6e0a2459051c7af26be7a93dbecda88a04a14c8db16169c4e4603dcfcbe013"
symlink = []
result.append({
"label": "Mold",
"manifests": [
{
"download_url": download_url,
"download_checksum": download_checksum,
"version": version,
"unzip_method": 'default',
"executables": [
{
"path": exe_path,
"symlink": symlink,
"add_to_devenv_path": True,
"checksum": checksum,
}
],
"add_to_devenv_script": [],
}
],
})
# --------------------------------------------------------------------------
if not is_windows:
version = "4.11.3"
exe_path = "ccache"
download_url = f"https://github.com/ccache/ccache/releases/download/v{version}/ccache-{version}-linux-x86_64.tar.xz"
download_checksum = "7766991b91b3a5a177ab33fa043fe09e72c68586d5a86d20a563a05b74f119c0"
checksum = "850c37237f086aa4f2d282b7e3bece2b6c5c306f709c13ea7407ba6bfd06b45d"
symlink = []
result.append({
"label": "CCache",
"manifests": [
{
"download_url": download_url,
"download_checksum": download_checksum,
"version": version,
"unzip_method": 'default',
"executables": [
{
"path": exe_path,
"symlink": symlink,
"add_to_devenv_path": True,
"checksum": checksum,
}
],
"add_to_devenv_script": [],
}
],
})
return result
-336
View File
@@ -1,336 +0,0 @@
def get_manifest(is_windows):
result = []
# --------------------------------------------------------------------------
if is_windows:
version = "1.4.1.1024"
result.append({
"label": "Everything",
"manifests": [
{
"download_url": f"https://www.voidtools.com/Everything-{version}.x64.zip",
"download_checksum": "4be0851752e195c9c7f707b1e0905cd01caf6208f4e2bfa2a66e43c0837be8f5",
"version": version,
"unzip_method": 'default',
"executables": [
{
"path": "Everything.exe",
"symlink": [],
"add_to_devenv_path": False,
"checksum": "35cefe4bc4a98ad73dda4444c700aac9f749efde8f9de6a643a57a5b605bd4e7",
}
],
"add_to_devenv_script": [],
}
],
})
# --------------------------------------------------------------------------
if is_windows:
version = "22.3"
result.append({
"label": "MobaXTerm",
"manifests": [
{
"download_url": f"https://download.mobatek.net/2232022120824733/MobaXterm_Portable_v{version}.zip",
"download_checksum": "c8de508d6731f31a73f061e58942691466d1d24cfa941e642e16e0930be2fad9",
"version": version,
"unzip_method": 'default',
"executables": [
{
"path": f"MobaXterm_Personal_{version}.exe",
"symlink": [],
"add_to_devenv_path": False,
"checksum": "e47cb54645a368411c5d6b6cbfa7e25980a2a674d7d0c082f5137b6e77a2f362",
}
],
"add_to_devenv_script": [],
}
],
})
# --------------------------------------------------------------------------
if is_windows:
version = "3.0.7039"
result.append({
"label": "SystemInformer",
"manifests": [
{
"download_url": f"https://github.com/winsiderss/si-builds/releases/download/{version}/systeminformer-{version}-bin.zip",
"download_checksum": "4557e58f698048e882515faac89c9c7f654247dbf4bd656ceed5c3f97afef77d",
"version": "3.0.5847",
"unzip_method": 'default',
"executables": [
{
"path": "amd64/SystemInformer.exe",
"symlink": [],
"add_to_devenv_path": False,
"checksum": "8a6e9dfd145e5cb8d03ec3db1b7b0163325be33e5c8fdd4126e9f8df2af2a39c",
}
],
"add_to_devenv_script": [],
}
],
})
# --------------------------------------------------------------------------
version = "2.0.0"
download_url = ""
download_checksum = ""
exe_path = ""
checksum = ""
if is_windows:
download_url = f"https://github.com/ahrm/sioyek/releases/download/v{version}/sioyek-release-windows-portable.zip"
download_checksum = "1f4fedbb38c0dc46bbba4bb95d0d6fab39fcf3525092ac26d92c891684d2bf8d"
checksum = "6c660f0f7265fabe6d943d15d9b5c7e85f2dbcf7fecb7d2cd0639e7086b1c034"
exe_path = "sioyek.exe"
else:
download_url = f"https://github.com/ahrm/sioyek/releases/download/v{version}/sioyek-release-linux-portable.zip"
download_checksum = "3f90659c1f29705de680b3607ae247582eab8860015c208d364a0f3fc15d3222"
checksum = "7abc12e8fe71b0285e067866bcea2ea0e025e37291f6bce450675a567172e44f"
exe_path = "Sioyek-x86_64.AppImage"
result.append({
"label": "Sioyek",
"manifests": [
{
"download_url": download_url,
"download_checksum": download_checksum,
"version": version,
"unzip_method": 'default',
"executables": [
{
"path": exe_path,
"symlink": [],
"add_to_devenv_path": False,
"checksum": checksum,
}
],
"add_to_devenv_script": [],
}
],
})
# --------------------------------------------------------------------------
if is_windows:
version = "4_15"
result.append({
"label": "WizTree",
"manifests": [
{
"download_url": f"https://www.diskanalyzer.com/files/wiztree_{version}_portable.zip",
"download_checksum": "dfa135cf5f87317ebe6112b7c8453f9eed5d93b78e9040a0ec882cbd6b200a95",
"version": version,
"unzip_method": 'default',
"executables": [
{
"path": "WizTree64.exe",
"symlink": [],
"add_to_devenv_path": False,
"checksum": "141d7b51dbef71205f808e87b5e2d85a75eac69d060f678db628be2a0984a929",
}
],
"add_to_devenv_script": [],
}
],
})
# --------------------------------------------------------------------------
if is_windows:
version = "1.64.0"
result.append({
"label": "RClone",
"manifests": [
{
"download_url": f"https://github.com/rclone/rclone/releases/download/v{version}/rclone-v{version}-windows-amd64.zip",
"download_checksum": "b1251cfdcbc44356e001057524c3e2f7be56d94546273d10143bfa1148c155ab",
"version": version,
"unzip_method": 'default',
"executables": [
{
"path": "rclone.exe",
"symlink": [],
"add_to_devenv_path": False,
"checksum": "64e0322e3bec6fb9fa730b7a14106e1e59fa186096f9a8d433a5324eb6853e01",
}
],
"add_to_devenv_script": [],
}
],
})
# --------------------------------------------------------------------------
if is_windows:
version = "1.5.3"
result.append({
"label": "Eyes-Thanks",
"manifests": [
{
"download_url": f"https://github.com/yalov/eyes-thanks/releases/download/{version}/EyesThanks_v{version}.zip",
"download_checksum": "6ab2b20730f56aa54263eb942be8849f52f9cba26438aee3c1b01103069411cc",
"version": version,
"unzip_method": 'default',
"executables": [
{
"path": "Eyes' Thanks.exe",
"symlink": [],
"add_to_devenv_path": False,
"checksum": "48d232bd4a302b11378791eee844b42a2e30fe3553acf17a3b9e8ee0fcf27766",
}
],
"add_to_devenv_script": [],
}
],
})
# --------------------------------------------------------------------------
if is_windows:
version = "15.0.0"
result.append({
"label": "ShareX",
"manifests": [
{
"download_url": f"https://github.com/ShareX/ShareX/releases/download/v{version}/ShareX-{version}-portable.zip",
"download_checksum": "c3bc97e9fb8d107e92cb494b50f842fccafbc9fd810588a1b635aee4dbe90bc1",
"version": version,
"unzip_method": 'default',
"executables": [
{
"path": "ShareX.exe",
"symlink": [],
"add_to_devenv_path": False,
"checksum": "0b679c46c2940edc09cff8ae0b0f4578aeda0346b9c402276b166aee4ec864be",
}
],
"add_to_devenv_script": [],
}
],
})
# --------------------------------------------------------------------------
version = "0.12"
download_url = ""
download_checksum = ""
exe_path = ""
checksum = ""
if is_windows:
download_url = f"https://bitbucket.org/heldercorreia/speedcrunch/downloads/SpeedCrunch-{version}-win32.zip"
download_checksum = "024362bccd7908b508192cd90c2f6a716b5aa4fa5c7ff2aea9a1bf49d6580175"
checksum = "c80409586d6b36d315ce9462fd9020a12b07633a569d94a8ee057bcd18ee5647"
exe_path = "speedcrunch.exe"
else:
download_url = f"https://bitbucket.org/heldercorreia/speedcrunch/downloads/SpeedCrunch-{version}-linux64.tar.bz2"
download_checksum = "9347bef2068053ad15c5914ee147bf11a1ccb1d30cb18d63d0178380c327e8fc"
checksum = "06c7e7f68027f133dc7874f663873244b695c8a7d2aec9cde0e40b7a5b9a4db1"
exe_path = "speedcrunch"
result.append({
"label": "SpeedCrunch",
"manifests": [
{
"download_url": download_url,
"download_checksum": download_checksum,
"version": version,
"unzip_method": 'default',
"executables": [
{
"path": exe_path,
"symlink": [],
"add_to_devenv_path": False,
"checksum": checksum,
}
],
"add_to_devenv_script": [],
}
],
})
# --------------------------------------------------------------------------
version = "2.7.6"
download_url = ""
download_checksum = ""
exe_path = ""
checksum = ""
if is_windows:
download_url = f"https://github.com/keepassxreboot/keepassxc/releases/download/{version}/KeePassXC-{version}-Win64.zip"
download_checksum = "42aed8fee2b5fbc7ecae4494c274aece35f3de57c4370c1cd0eb365e501fb4c6"
checksum = "915f6879ca20fc7ffd196402e301676c3bd04419ee90486cbd56662dbb7d0b77"
exe_path = "KeePassXC.exe"
else:
exe_path = f"KeePassXC-{version}-x86_64.AppImage"
download_url = f"https://github.com/keepassxreboot/keepassxc/releases/download/{version}/{exe_path}"
download_checksum = "f32f7e7ab4bca789b24bd6a420c1d87dff40982646abef58fca481a7c56ace48"
checksum = download_checksum
result.append({
"label": "KeePassXC",
"manifests": [
{
"download_url": download_url,
"download_checksum": download_checksum,
"version": version,
"unzip_method": 'default',
"executables": [
{
"path": exe_path,
"symlink": [],
"add_to_devenv_path": False,
"checksum": checksum,
}
],
"add_to_devenv_script": [],
}
],
})
# --------------------------------------------------------------------------
version = "3.56.0"
symlink = []
if is_windows:
exe_path = "LosslessCut.exe"
download_url = f"https://github.com/mifi/lossless-cut/releases/download/v{version}/LosslessCut-win-x64.7z"
download_checksum = "4dbbad634a09d16fd2cb53461ca8b7b5e8506fdaf03f811233646493b3fe04c0"
checksum = "14452473962369dd3443976dab7dc15a6fbbb60a6c758e8b95337ed161648a5a"
else:
exe_path = f"LosslessCut-linux-x86_64.AppImage"
download_url = f"https://github.com/mifi/lossless-cut/releases/download/v{version}/{exe_path}"
download_checksum = ""
checksum = download_checksum
result.append({
"label": "LosslessCut",
"manifests": [
{
"download_url": download_url,
"download_checksum": download_checksum,
"version": version,
"unzip_method": 'default',
"executables": [
{
"path": exe_path,
"symlink": symlink,
"add_to_devenv_path": False,
"checksum": checksum,
}
],
"add_to_devenv_script": [],
}
],
})
return result
+12 -26
View File
@@ -1,7 +1,6 @@
#!/usr/bin/env python3
# DEVenver
# ------------------------------------------------------------------------------
# A simple python script to download portable applications and install them by
# unzipping them to a structured directory tree.
@@ -22,11 +21,8 @@ from string import Template
from enum import Enum
# Internal
# ------------------------------------------------------------------------------
DOWNLOAD_CHUNK_SIZE = 1 * 1024 * 1024 # 1 megabyte
# ------------------------------------------------------------------------------
# These variables are set once they are downloaded dynamically and installed
# from the internal app listing!
zstd_exe = ""
@@ -34,7 +30,6 @@ zip7_exe = ""
zip7_bootstrap_exe = ""
# Functions
# ------------------------------------------------------------------------------
def print_header(title):
line = f'> ' + title + ' ';
print(line.ljust(100, '-'))
@@ -143,9 +138,6 @@ def get_exe_install_path(install_dir, label, version_label, exe_rel_path):
result = pathlib.Path(install_dir, exe_rel_path)
return result
def get_exe_symlink_dir(install_dir):
result = pathlib.Path(install_dir, "Symlinks")
return result
def download_and_install_archive(download_url,
download_checksum,
@@ -382,7 +374,7 @@ def download_and_install_archive(download_url,
# Do the symlinks
# --------------------------------------------------------------------------
symlink_dir = get_exe_symlink_dir(install_dir)
symlink_dir = install_dir
paths_to_add_to_devenv_script = set()
for exe_dict in exe_list:
exe_rel_path = exe_dict['path']
@@ -406,6 +398,9 @@ def download_and_install_archive(download_url,
for symlink_entry in exe_dict["symlink"]:
symlink_dest = symlink_dir / symlink_entry
symlink_src = exe_path
symlink_rel_src = pathlib.Path(symlink_src).relative_to(install_dir)
symlink_rel_dest = pathlib.Path(symlink_dest).relative_to(install_dir)
skip_link = False;
if os.path.exists(symlink_dest):
# Windows uses hardlinks because symlinks require you to enable "developer" mode
@@ -422,11 +417,13 @@ def download_and_install_archive(download_url,
else:
os.unlink(symlink_dest)
import contextlib
if not skip_link:
if use_hardlink:
os.link(src=symlink_src, dst=symlink_dest)
else:
os.symlink(src=symlink_src, dst=symlink_dest)
with contextlib.chdir(install_dir):
os.symlink(src=symlink_rel_src, dst=symlink_dest)
# Collect paths to add to the devenv script
# ----------------------------------------------------------------------
@@ -516,7 +513,7 @@ internal_app_list = []
devenv_script_buffer = ""
def install_app_list(app_list, download_dir, install_dir, is_windows):
title = "Internal Apps" if app_list is internal_app_list else "User Apps"
title = "Internal Apps"
print_header(title)
result = {}
@@ -775,7 +772,6 @@ def run(user_app_list,
# Create the paths requested by the user
os.makedirs(download_dir, exist_ok=True)
os.makedirs(install_dir, exist_ok=True)
os.makedirs(pathlib.Path(install_dir, "Symlinks"), exist_ok=True)
for path in [download_dir, install_dir]:
if not os.path.isdir(path):
@@ -808,32 +804,22 @@ def run(user_app_list,
devenv_script_buffer += "set devenver_root=%devenver_root_backslash:~0,-1%\n"
devenv_script_buffer += "set devenver_root_backslash=\n"
devenv_script_buffer += "set path=%~dp0Symlinks;%PATH%\n"
devenv_script_buffer += "set path=%~dp0Scripts;%PATH%\n"
devenv_script_buffer += "set path=%~dp0;%PATH%\n"
else:
devenv_script_buffer += f"export devenver_root=\"$( cd -- $( dirname -- \"${{BASH_SOURCE[0]}}\" ) &> /dev/null && pwd )\"\n"
devenv_script_buffer += f"PATH=\"$( cd -- $( dirname -- \"${{BASH_SOURCE[0]}}\" ) &> /dev/null && pwd )/Scripts\":$PATH\n"
devenv_script_buffer += f"PATH=\"$( cd -- $( dirname -- \"${{BASH_SOURCE[0]}}\" ) &> /dev/null && pwd )/Symlinks\":$PATH\n"
devenv_script_buffer += f'PATH="$( cd -- $( dirname -- "${{BASH_SOURCE[0]}}" ) &> /dev/null && pwd )":$PATH\n'
devenv_script_buffer += f"PATH=$(echo $PATH | awk -v RS=: -v ORS=: '/^\/mnt\/c/ {{next}} {{print}}')\n"
devenv_script_buffer += f"source $devenver_root/unix_fzf-completion.bash\n"
devenv_script_buffer += f"source $devenver_root/unix_fzf-key-bindings.bash\n"
if devenv_script_name:
devenv_script_name = f"{devenv_script_name}.bat" if is_windows else f"{devenv_script_name}.sh"
devenv_script_path = pathlib.Path(install_dir, devenv_script_name)
lprint(f"Writing script to augment the environment with installed applications: {devenv_script_path}")
devenv_script_path.write_text(devenv_script_buffer)
if not is_windows:
subprocess.run(args=["chmod", "+x", devenv_script_path])
# Merge the install dictionaries, this dictionary contains
# (app label) -> [array of installed versions]
result = internal_apps
for key, value in user_apps.items():
if key not in result:
result.update({key: value})
else:
result[key] += value
result = {**internal_apps, **user_apps}
return result
+33 -188
View File
@@ -8,9 +8,7 @@ import shutil
import tempfile
import argparse
import urllib.request
import app_manifest_dev
import app_manifest_user
def git_clone(install_dir, git_exe, url, commit_hash):
devenver.lprint(f"Git clone {url} to {install_dir}", level=0)
@@ -46,16 +44,6 @@ arg_parser.add_argument('--install-dir',
default="",
type=pathlib.Path)
arg_parser.add_argument('--with-dev-apps',
help=f'Download and install apps from the developer manifest',
const=True,
action="store_const")
arg_parser.add_argument('--with-user-apps',
help=f'Download and install apps from the user manifest',
const=True,
action="store_const")
arg_parser.add_argument('operating_system',
choices=['win', 'linux'],
help=f'Download and install apps for the specified operating system')
@@ -75,10 +63,6 @@ if install_dir == pathlib.Path(""):
install_dir = devenver.script_dir / 'Linux'
# Install development apps
# ------------------------------------------------------------------------------
if args.with_dev_apps:
# Run DEVenver, installing the portable apps
# --------------------------------------------------------------------------
dev_env_script_name = "dev_env"
app_list = app_manifest_dev.get_manifest(is_windows=is_windows)
installed_dev_apps = devenver.run(user_app_list=app_list,
@@ -86,93 +70,14 @@ if args.with_dev_apps:
install_dir=install_dir,
devenv_script_name=dev_env_script_name,
is_windows=is_windows)
install_script_path = pathlib.Path(devenver.script_dir, "install.py")
if is_windows:
# Install MSVC
# --------------------------------------------------------------------------
devenver.print_header("Install MSVC & Windows 10 SDK")
msvc_script = devenver.script_dir / "win_portable_msvc.py"
msvc_version = "14.34"
win10_sdk_version = "22621"
msvc_install_dir = install_dir / "msvc"
# Basic heuristic to see if we"ve already installed the MSVC/SDK version
msvc_installed = False
win10_sdk_installed = False
msvc_find_test_dir = msvc_install_dir / "VC/Tools/MSVC"
win10_sdk_find_test_dir = msvc_install_dir / "Windows Kits/10"
if os.path.exists(msvc_find_test_dir):
for file_name in os.listdir(msvc_find_test_dir):
msvc_installed = file_name.startswith(msvc_version)
if msvc_installed == True:
devenver.lprint(f"MSVC {msvc_version} install detected (skip download) in {msvc_find_test_dir}\\{file_name}")
break
if not msvc_installed:
devenver.lprint(f"MSVC {msvc_version} install not detected (need to download) in {msvc_find_test_dir}")
if os.path.exists(win10_sdk_find_test_dir):
for file_name in os.listdir(win10_sdk_find_test_dir / "bin"):
# Check if directory contains version substring, 22621, e.g. "10.0.22621.0"
win10_sdk_installed = file_name.count(win10_sdk_version) > 0
if win10_sdk_installed == True:
install_locations = f"{win10_sdk_find_test_dir}\\*\\{file_name}"
devenver.lprint(f"Windows 10 SDK {win10_sdk_version} install detected (skip download) in {install_locations}")
break
if not win10_sdk_installed:
devenver.lprint(f"Windows 10 SDK {win10_sdk_version} not detected (need to download) in {win10_sdk_find_test_dir}")
# Install MSVC
if msvc_installed == False or win10_sdk_installed == False:
with tempfile.TemporaryDirectory() as temp_dir:
# Invoke the MSVC script to download MSVC to disk
command = f"\"{sys.executable}\" \"{msvc_script}\" --accept-license"
line = "Invoking MSVC script to install"
if msvc_installed:
command += " --no-msvc"
else:
command += f" --msvc-version {msvc_version}"
line += f" MSVC {msvc_version}"
if win10_sdk_installed:
command += " --no-sdk"
else:
command += f" --sdk-version {win10_sdk_version}"
line += f" Windows 10 SDK {win10_sdk_version}"
devenver.lprint(line)
devenver.lprint(f"Command: {command}")
run_result = subprocess.run(command, cwd=temp_dir, check=True)
# Merge the download MSVC installation to our unified install dir
temp_msvc_dir = pathlib.Path(temp_dir, "msvc")
for src_dir, dirs, files in os.walk(temp_msvc_dir):
msvc_working_dir = src_dir.replace(str(temp_msvc_dir), str(msvc_install_dir), 1)
if not os.path.exists(msvc_working_dir):
os.makedirs(msvc_working_dir)
for file_ in files:
src = os.path.join(src_dir, file_)
dest = os.path.join(msvc_working_dir, file_)
if os.path.exists(dest):
if os.path.samefile(src, dest):
continue
os.remove(dest)
shutil.move(src, msvc_working_dir)
devenver.lprint(f"MSVC {msvc_version} Windows 10 SDK {win10_sdk_version} installed: {msvc_install_dir}")
# Install apps dependent on Git
# --------------------------------------------------------------------------
devenver.print_header("Install apps that rely on Git")
git_exe = installed_dev_apps["Git"][0]['exe_path']
# Clink
# --------------------------------------------------------------------------
clink_install_dir = installed_dev_apps["Clink"][0]['install_dir']
clink_base_dir = clink_install_dir.parent
@@ -192,24 +97,7 @@ if args.with_dev_apps:
url="https://github.com/vladimir-kotikov/clink-completions",
commit_hash=clink_completions_git_hash)
# Odin
# --------------------------------------------------------------------------
# odin_git_hash = "9ae1bfb6"
# odin_install_dir = install_dir / "Odin"
# git_clone(install_dir=odin_install_dir,
# git_exe=git_exe,
# url="https://github.com/odin-lang/odin.git",
# commit_hash=odin_git_hash)
# TODO: We can't do this yet because the odin build requires a registry hack so
# that it knows where to find MSVC.
# Build Odin
# subprocess.run(f"{git_exe} checkout {odin_git_hash}",
# cwd=odin_install_dir)
# Install clink configuration
# --------------------------------------------------------------------------
clink_profile_dir = clink_base_dir / "profile"
clink_settings_path = clink_profile_dir / "clink_settings"
devenver.lprint(f"Installing clink_settings to: {clink_settings_path}")
@@ -254,7 +142,6 @@ fzf.default_bindings = True
""")
# Install wezterm configuration
# --------------------------------------------------------------------------
wezterm_config_dest_path = installed_dev_apps["WezTerm"][0]["install_dir"] / "wezterm.lua"
devenver.lprint(f"Installing WezTerm config to {wezterm_config_dest_path}")
@@ -292,7 +179,6 @@ return {{
""")
# Wezterm super terminal
# --------------------------------------------------------------------------
wezterm_terminal_script_path = install_dir / "dev_terminal.bat"
devenver.lprint(f"Installing WezTerm terminal script to {wezterm_terminal_script_path}")
@@ -307,72 +193,14 @@ if "%~1" neq "" (
start "" /MAX "%~dp0{installed_dev_apps["WezTerm"][0]["exe_path"].relative_to(install_dir)}" !working_dir!
""")
# Create Odin work-around scripts
# --------------------------------------------------------------------------
# Odin uses J. Blow's Microsoft craziness SDK locator which relies on the
# registry. Here we inject the registry entry that the SDK locator checks for
# finding our portable MSVC installation.
win10_sdk_find_test_dir_reg_path = str(win10_sdk_find_test_dir).replace("\\", "\\\\")
odin_msvc_install_script_path = install_dir / "odin_msvc_install_workaround.reg"
odin_msvc_uninstall_script_path = install_dir / "odin_msvc_uninstall_workaround.reg"
devenver.lprint(f"Installing Odin MSVC workaround scripts", level=0)
devenver.lprint(f" - {odin_msvc_install_script_path}", level=1)
devenver.lprint(f" - {odin_msvc_uninstall_script_path}", level=1)
odin_msvc_install_script_path.write_text(f"""Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows Kits\Installed Roots]
"KitsRoot10"="{win10_sdk_find_test_dir_reg_path}"
""")
odin_msvc_uninstall_script_path.write_text(f"""Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows Kits\Installed Roots]
"KitsRoot10"=-
""")
# Python
# --------------------------------------------------------------------------
# TODO: If I'm using the terminal that this script generates it will lock the
# executable and Python cannot open the file for verifying the SHA256.
python_exe_path = pathlib.Path(installed_dev_apps["Python"][0]['exe_path'])
# PyNvim
devenver.lprint(f"Installing PyNVIM")
subprocess.run(f"{python_exe_path} -m pip install pynvim")
# Add update script
python_rel_exe_path = pathlib.Path(python_exe_path).relative_to(install_dir)
python_install_dir = pathlib.Path(python_exe_path).parent.relative_to(install_dir)
(install_dir / "dev_env_update.bat").write_text(f"""@echo off
setlocal EnableDelayedExpansion
set PYTHONHOME=%~dp0{python_install_dir}
%~dp0{python_rel_exe_path} {install_script_path} --with-dev-apps win
pause
""")
(install_dir / "user_env_update.bat").write_text(f"""@echo off
setlocal EnableDelayedExpansion
set PYTHONHOME=%~dp0{python_install_dir}
%~dp0{python_rel_exe_path} {install_script_path} --with-user-apps win
pause
""")
else:
dev_env_script_path = (install_dir / "dev_env_update.sh")
user_env_script_path = (install_dir / "user_env_update.sh")
dev_env_script_path.write_text(f"{sys.executable} {install_script_path} --with-dev-apps linux\n")
user_env_script_path.write_text(f"{sys.executable} {install_script_path} --with-user-apps linux\n")
subprocess.run(args=["chmod", "+x", dev_env_script_path])
subprocess.run(args=["chmod", "+x", user_env_script_path])
# Use LLVM script to fix up bloated installation
# --------------------------------------------------------------------------
# See: https://github.com/zufuliu/llvm-utils/blob/main/llvm/llvm-link.bat
internal_dir = pathlib.Path(os.path.dirname(os.path.abspath(__file__))) / "Internal"
if is_windows:
@@ -389,13 +217,18 @@ pause
os.remove(llvm_script_dest_path)
# Install fzf scripts
# --------------------------------------------------------------------------
if not is_windows:
shutil.copy(internal_dir / "unix_fzf-completion.bash", install_dir)
shutil.copy(internal_dir / "unix_fzf-key-bindings.bash", install_dir)
# Install dev scripts
if is_windows:
shutil.copy(internal_dir / "win_dev.bat", install_dir / "dev.bat")
else:
shutil.copy(internal_dir / "unix_dev.sh", install_dir / "dev.sh")
subprocess.run(args=["chmod", "+x", install_dir / "dev.sh"])
# Install left-overs
# --------------------------------------------------------------------------
devenver.print_header("Install configuration files")
# ClangFormat
@@ -412,8 +245,11 @@ pause
else:
nvim_init_dir = pathlib.Path(os.path.expanduser("~")) / ".config" / "nvim"
nvim_config_dest_path = nvim_init_dir / "init.vim"
nvim_config_src_path = internal_dir / "os_nvim_init.vim"
nvim_config_dest_path = nvim_init_dir / "init.lua"
nvim_config_src_path = internal_dir / "os_nvim_init.lua"
if os.path.exists(nvim_init_dir / "init.vim"):
pathlib.Path(nvim_init_dir / "init.vim").unlink()
devenver.lprint(f"Installing NVIM config to {nvim_config_dest_path}")
nvim_init_dir.mkdir(parents=True, exist_ok=True)
@@ -425,15 +261,24 @@ pause
nvim_plug_vim_dir.mkdir(parents=True, exist_ok=True)
if not os.path.exists(nvim_plug_vim_path):
devenver.lprint(f"Installing NVIM plugin manager to {nvim_plug_vim_path}")
urllib.request.urlretrieve("https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim",
nvim_plug_vim_path)
urllib.request.urlretrieve("https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim", nvim_plug_vim_path)
# Install user apps
# ------------------------------------------------------------------------------
if args.with_user_apps:
app_list = app_manifest_user.get_manifest(is_windows=is_windows)
installed_user_apps = devenver.run(user_app_list=app_list,
download_dir=download_dir,
install_dir=install_dir,
devenv_script_name="user_env",
is_windows=is_windows)
# Source dev_env.sh in ~/.bashrc (Linux only)
if not is_windows:
bashrc_path = pathlib.Path(os.path.expanduser("~/.bashrc"))
devenv_script_path = install_dir / "dev_env.sh"
source_line = f'source "{devenv_script_path}"'
# Check if already present
already_present = False
if bashrc_path.exists():
bashrc_content = bashrc_path.read_text()
if source_line in bashrc_content:
already_present = True
if not already_present:
devenver.lprint(f"Adding dev_env.sh source line to {bashrc_path}")
with open(bashrc_path, "a") as f:
f.write(f"\n{source_line}\n")
else:
devenver.lprint(f"dev_env.sh source line already exists in {bashrc_path}")
-398
View File
@@ -1,398 +0,0 @@
#!/usr/bin/env bash
# Functions
# ------------------------------------------------------------------------------
DownloadFile()
{
url=$1
dest_file=$2
if [[ -f "${dest_file}" ]]; then
echo "- [DownloadFile/Cached] ${url} to ${dest_file}"
else
echo "- [DownloadFile] ${url} to ${dest_file}"
wget --output-document ${dest_file} ${url}
if [ $? -ne 0 ]; then
echo "- [DownloadFile] Download failed [url=${url}]"
exit
fi
fi
}
FileSHA256Check()
{
file=$1
expected=$2
echo "${expected} ${file}" | sha256sum --check
if [[ $? -ne 0 ]]; then
echo "- [FileSHA256Check] Failed [file=${file}, "
echo " expect=${expected} ${file},"
echo " actual=$(sha256sum ${file})"
echo " ]"
exit
else
echo "- [FileSHA256Check] OK [file=${file}, hash=${expected}]"
fi
}
# Setup
# ------------------------------------------------------------------------------
root_dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
home_dir=${root_dir}/Home
installer_dir=${root_dir}/Installer
tools_dir=${root_dir}/Tools
downloads_dir=${root_dir}/Downloads
mkdir --parents ${home_dir}
mkdir --parents ${tools_dir}
mkdir --parents ${downloads_dir}
bin_dir=${tools_dir}/Binaries
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
# ----------------------------------------------------------------------------
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_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_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
FileSHA256Check "${cmake_exe}" "${cmake_exe_sha256}" || exit
cd "${cmake_dir}/bin" && find . -type f,l -exec ln --force --symbolic --relative "{}" "${bin_dir}/{}-${cmake_version}" ';' && cd "${root_dir}"
cd "${cmake_dir}/bin" && find . -type f,l -exec ln --force --symbolic --relative "{}" "${bin_dir}/" ';' && cd "${root_dir}"
# FD
# ------------------------------------------------------------------------------
fd_sha256=a1e72cf4f4fbd1b061387569678f3ab3555ee1cf025280b3ce6b2eee96cd3210
fd_exe_sha256=057bea03a6f17eb99ea3b11c25a110880b012d2d5110988e80b1ce2ee6536342
fd_version=8.4.0
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_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=()
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
llvm_exe_sha256=none
if [[ "${llvm_version}" == "14.0.0" ]]; then
llvm_sha256=61582215dafafb7b576ea30cc136be92c877ba1f1c31ddbbd372d6d65622fef5
llvm_exe_sha256=3557c2deadae7e2bc3bffce4afd93ddab6ef50090971c8ce3bf15c80b27134a0
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_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_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_name=clang+llvm-${llvm_version}-x86_64-linux-gnu-ubuntu-16.04
fi
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_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
else
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
cd "${llvm_dir}/bin" && find . -type f,l -exec ln --force --symbolic --relative "{}" "${bin_dir}/{}-${llvm_version}" ';' && cd "${root_dir}"
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
cp --force ${installer_dir}/os_clang_format_style_file ~/_clang-format || exit
# Nvim Config
nvim_init_dir=~/.config/nvim
mkdir --parents "${nvim_init_dir}"
cp --force ${installer_dir}/os_nvim_init.vim ${nvim_init_dir}/init.vim || exit
# Vim Package Manager
vim_plug_dir=${nvim_init_dir}/autoload
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_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
chmod +x "${nvim_exe}"
ln --force --symbolic --relative "${nvim_exe}" "${bin_dir}/nvim"
ln --force --symbolic --relative "${nvim_exe}" "${bin_dir}/vim"
# Neovide
# ----------------------------------------------------------------------------
neovide_sha256=684cbcaeb2e67f1d95822ef80e03e1475395d537f2032f47b8202fe48c428b08
neovide_exe_sha256=e4fbc8b56af2e25127938ae2974921e25b4df5722086d7e8c3e517e8ee86e2df
neovide_version=0.9.0
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_linux64_${neovide_version}
if [[ ! -f "${neovide_exe}" ]]; then
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 ${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
FileSHA256Check ${neovide_exe} ${neovide_exe_sha256} || exit
ln --force --symbolic --relative "${neovide_exe}" "${bin_dir}/neovide"
# Python 3
# ------------------------------------------------------------------------------
python_sha256=460f87a389be28c953c24c6f942f172f9ce7f331367b4daf89cb450baedd51d7
python_exe_sha256=1400cb8f2cf2f606d1c87c1edb69ea1b3479b4c2bfb5c438a4828903a1d6f9f8
python_version=3.10.5
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_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
FileSHA256Check "${python_dir}/bin/python3" "${python_exe_sha256}" || exit
ln --force --symbolic --relative "${python_dir}/bin/python3" "${bin_dir}"
ln --force --symbolic --relative "${python_dir}/bin/python3" "${bin_dir}/python-${python_version}"
ln --force --symbolic --relative "${python_dir}/bin/pip" "${bin_dir}"
ln --force --symbolic --relative "${python_dir}/bin/pip" "${bin_dir}/pip-${python_version}"
${python_dir}/bin/pip install pynvim cmake-language-server
# Ripgrep
# ------------------------------------------------------------------------------
ripgrep_sha256=ee4e0751ab108b6da4f47c52da187d5177dc371f0f512a7caaec5434e711c091
ripgrep_exe_sha256=4ef156371199b3ddac1bf584e0e52b1828279af82e4ea864b4d9c816adb5db40
ripgrep_version=13.0.0
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_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
ln --force --symbolic --relative "${ripgrep_exe}" "${bin_dir}"
# wezterm
# ------------------------------------------------------------------------------
wezterm_sha256=4de3cd65b7d7ae0c72a691597bd3def57c65f07fe4a7c98b447b8a9dc4d0adf0
wezterm_version=20220624-141144-bd1b7c5d
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_file}" ${wezterm_exe} || exit
FileSHA256Check "${wezterm_exe}" "${wezterm_sha256}" || exit
chmod +x "${wezterm_exe}"
cp --force ${installer_dir}/os_wezterm.lua ~/.wezterm.lua
# Ctags
# ------------------------------------------------------------------------------
rm --force ${bin_dir}/ctags_cpp.sh
echo ctags --c++-kinds=+p --fields=+iaS --extra=+q --language-force=C++ \$\@ >> ${bin_dir}/ctags_cpp.sh
chmod +x ${bin_dir}/ctags_cpp.sh
# Linux Terminal
# ------------------------------------------------------------------------------
echo \#!/usr/bin/env bash> ${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
-385
View File
@@ -1,385 +0,0 @@
#!/usr/bin/env python3
# This script has been gratefully sourced from Martins Mozeiko of HMN
# https://gist.github.com/mmozeiko/7f3162ec2988e81e56d5c4e22cde9977
#
# Further modifications by https://github.com/doy-lee with the primary purpose
# of facilitating multiple versions to be stored in the same root directory
# ('Redist' in the SDK was unversioned, store it versioned like all other
# folders, skip the downloading of MSVC or the SDK if we only need one of them).
#
# Changelog
# 2023-04-15
# - Fix "msvc-{version}.bat" script generating trailing "\;" on
# VCToolsInstallDir environment variable. clang-cl relies on this variable to
# identify the location of the Visual Studio toolchain or otherwise reports a
# program invocation error during the linking stage.
#
# 2023-01-30
# - Generate the short-hand version of the msvc-{version}.bat and
# win-sdk-{version}.bat using the versions passed as the argument parameter.
# - Fix win-sdk-{version}.bat overwriting the INCLUDE and LIB environment
# variables instead of appending.
#
# 2023-01-28
# - Inital revision from mmozeiko
# https://gist.github.com/mmozeiko/7f3162ec2988e81e56d5c4e22cde9977/6863f19cb98b933c7535acf3d59ac64268c6bd1b
# - Add individual scripts to source variables for MSVC and Windows 10
# separately "msvc-{version}.bat" and "win-sdk-{version}.bat"
# - Add '--no-sdk' and '--no-msvc' to prevent the download and installation of
# the Windows SDK and MSVC respectively.
# - Installation used to create 'Windows Kit/10/Redist' and unpack a D3D and MBN
# folder without being versioned. These folders are now placed under
# a versioned sub-directory to preserve the binaries and allow subsequent
# side-by-side installation of other versions of the SDK.
import io
import os
import sys
import json
import shutil
import hashlib
import zipfile
import tempfile
import argparse
import subprocess
import urllib.request
from pathlib import Path
OUTPUT = Path("msvc") # output folder
# other architectures may work or may not - not really tested
HOST = "x64" # or x86
TARGET = "x64" # or x86, arm, arm64
MANIFEST_URL = "https://aka.ms/vs/17/release/channel"
def download(url):
with urllib.request.urlopen(url) as res:
return res.read()
def download_progress(url, check, name, f):
data = io.BytesIO()
with urllib.request.urlopen(url) as res:
total = int(res.headers["Content-Length"])
size = 0
while True:
block = res.read(1<<20)
if not block:
break
f.write(block)
data.write(block)
size += len(block)
perc = size * 100 // total
print(f"\r{name} ... {perc}%", end="")
print()
data = data.getvalue()
digest = hashlib.sha256(data).hexdigest()
if check.lower() != digest:
exit(f"Hash mismatch for f{pkg}")
return data
# super crappy msi format parser just to find required .cab files
def get_msi_cabs(msi):
index = 0
while True:
index = msi.find(b".cab", index+4)
if index < 0:
return
yield msi[index-32:index+4].decode("ascii")
def first(items, cond):
return next(item for item in items if cond(item))
### parse command-line arguments
ap = argparse.ArgumentParser()
ap.add_argument("--show-versions", const=True, action="store_const", help="Show available MSVC and Windows SDK versions")
ap.add_argument("--accept-license", const=True, action="store_const", help="Automatically accept license")
ap.add_argument("--msvc-version", help="Get specific MSVC version")
ap.add_argument("--sdk-version", help="Get specific Windows SDK version")
ap.add_argument("--no-msvc", const=True, action="store_const", help="Skip download and installing of msvc")
ap.add_argument("--no-sdk", const=True, action="store_const", help="Skip download and installing of Windows SDK")
args = ap.parse_args()
### get main manifest
manifest = json.loads(download(MANIFEST_URL))
### download VS manifest
vs = first(manifest["channelItems"], lambda x: x["id"] == "Microsoft.VisualStudio.Manifests.VisualStudio")
payload = vs["payloads"][0]["url"]
vsmanifest = json.loads(download(payload))
### find MSVC & WinSDK versions
packages = {}
for p in vsmanifest["packages"]:
packages.setdefault(p["id"].lower(), []).append(p)
msvc = {}
sdk = {}
for pid,p in packages.items():
if pid.startswith("Microsoft.VisualStudio.Component.VC.".lower()) and pid.endswith(".x86.x64".lower()):
pver = ".".join(pid.split(".")[4:6])
if pver[0].isnumeric():
msvc[pver] = pid
elif pid.startswith("Microsoft.VisualStudio.Component.Windows10SDK.".lower()) or \
pid.startswith("Microsoft.VisualStudio.Component.Windows11SDK.".lower()):
pver = pid.split(".")[-1]
if pver.isnumeric():
sdk[pver] = pid
if args.show_versions:
print("MSVC versions:", " ".join(sorted(msvc.keys())))
print("Windows SDK versions:", " ".join(sorted(sdk.keys())))
exit(0)
install_sdk = not args.no_sdk
install_msvc = not args.no_msvc
if args.no_sdk and args.no_msvc:
exit()
msvc_ver = args.msvc_version or max(sorted(msvc.keys()))
sdk_ver = args.sdk_version or max(sorted(sdk.keys()))
info_line = "Downloading"
if install_msvc:
if msvc_ver in msvc:
msvc_pid = msvc[msvc_ver]
msvc_ver = ".".join(msvc_pid.split(".")[4:-2])
else:
exit(f"Unknown MSVC version: f{args.msvc_version}")
info_line += f" MSVC v{msvc_ver}"
if install_sdk:
if sdk_ver in sdk:
sdk_pid = sdk[sdk_ver]
else:
exit(f"Unknown Windows SDK version: f{args.sdk_version}")
info_line += f" Windows SDK v{sdk_ver}"
print(info_line)
### agree to license
tools = first(manifest["channelItems"], lambda x: x["id"] == "Microsoft.VisualStudio.Product.BuildTools")
resource = first(tools["localizedResources"], lambda x: x["language"] == "en-us")
license = resource["license"]
if not args.accept_license:
accept = input(f"Do you accept Visual Studio license at {license} [Y/N] ? ")
if not accept or accept[0].lower() != "y":
exit(0)
OUTPUT.mkdir(exist_ok=True)
total_download = 0
### download MSVC
if install_msvc:
msvc_packages = [
# MSVC binaries
f"microsoft.vc.{msvc_ver}.tools.host{HOST}.target{TARGET}.base",
f"microsoft.vc.{msvc_ver}.tools.host{HOST}.target{TARGET}.res.base",
# MSVC headers
f"microsoft.vc.{msvc_ver}.crt.headers.base",
# MSVC libs
f"microsoft.vc.{msvc_ver}.crt.{TARGET}.desktop.base",
f"microsoft.vc.{msvc_ver}.crt.{TARGET}.store.base",
# MSVC runtime source
f"microsoft.vc.{msvc_ver}.crt.source.base",
# ASAN
f"microsoft.vc.{msvc_ver}.asan.headers.base",
f"microsoft.vc.{msvc_ver}.asan.{TARGET}.base",
# MSVC redist
#f"microsoft.vc.{msvc_ver}.crt.redist.x64.base",
]
for pkg in msvc_packages:
p = first(packages[pkg], lambda p: p.get("language") in (None, "en-US"))
for payload in p["payloads"]:
with tempfile.TemporaryFile() as f:
data = download_progress(payload["url"], payload["sha256"], pkg, f)
total_download += len(data)
with zipfile.ZipFile(f) as z:
for name in z.namelist():
if name.startswith("Contents/"):
out = OUTPUT / Path(name).relative_to("Contents")
out.parent.mkdir(parents=True, exist_ok=True)
out.write_bytes(z.read(name))
### download Windows SDK
if install_sdk:
sdk_packages = [
# Windows SDK tools (like rc.exe & mt.exe)
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",
# CRT headers & libs
f"Universal CRT Headers Libraries and Sources-x86_en-us.msi",
# CRT redist
#"Universal CRT Redistributable-x86_en-us.msi",
]
with tempfile.TemporaryDirectory() as d:
dst = Path(d)
sdk_pkg = packages[sdk_pid][0]
sdk_pkg = packages[first(sdk_pkg["dependencies"], lambda x: True).lower()][0]
msi = []
cabs = []
# download msi files
for pkg in sdk_packages:
payload = first(sdk_pkg["payloads"], lambda p: p["fileName"] == f"Installers\\{pkg}")
msi.append(dst / pkg)
with open(dst / pkg, "wb") as f:
data = download_progress(payload["url"], payload["sha256"], pkg, f)
total_download += len(data)
cabs += list(get_msi_cabs(data))
# download .cab files
for pkg in cabs:
payload = first(sdk_pkg["payloads"], lambda p: p["fileName"] == f"Installers\\{pkg}")
with open(dst / pkg, "wb") as f:
download_progress(payload["url"], payload["sha256"], pkg, f)
print("Unpacking msi files...")
# run msi installers
for m in msi:
subprocess.check_call(["msiexec.exe", "/a", m, "/quiet", "/qn", f"TARGETDIR={OUTPUT.resolve()}"])
### versions
msvcv = ""
sdkv = ""
if install_msvc:
msvcv = list((OUTPUT / "VC/Tools/MSVC").glob("*"))[0].name
if install_sdk:
sdkv = list((OUTPUT / "Windows Kits/10/bin").glob("*"))[0].name
# place debug CRT runtime into MSVC folder (not what real Visual Studio installer does... but is reasonable)
if install_msvc:
dst = str(OUTPUT / "VC/Tools/MSVC" / msvcv / f"bin/Host{HOST}/{TARGET}")
pkg = "microsoft.visualcpp.runtimedebug.14"
dbg = packages[pkg][0]
payload = first(dbg["payloads"], lambda p: p["fileName"] == "cab1.cab")
try:
with tempfile.TemporaryFile(suffix=".cab", delete=False) as f:
data = download_progress(payload["url"], payload["sha256"], pkg, f)
total_download += len(data)
subprocess.check_call(["expand.exe", f.name, "-F:*", dst], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
finally:
os.unlink(f.name)
# place the folders under the Redist folder in the SDK under a versioned folder to allow other versions to be installed
if install_sdk:
redist_dir = OUTPUT / "Windows Kits/10/Redist"
redist_versioned_dir = redist_dir / f'{sdkv}'
if not os.path.exists(redist_versioned_dir):
os.makedirs(redist_versioned_dir)
for file_name in os.listdir(redist_dir):
if not file_name.startswith('10.0.'): # Simple heuristic
shutil.move((redist_dir / file_name), redist_versioned_dir)
### cleanup
shutil.rmtree(OUTPUT / "Common7", ignore_errors=True)
if install_msvc:
for f in ["Auxiliary", f"lib/{TARGET}/store", f"lib/{TARGET}/uwp"]:
shutil.rmtree(OUTPUT / "VC/Tools/MSVC" / msvcv / f)
for f in OUTPUT.glob("*.msi"):
f.unlink()
if install_sdk:
for f in ["Catalogs", "DesignTime", f"bin/{sdkv}/chpe", f"Lib/{sdkv}/ucrt_enclave"]:
shutil.rmtree(OUTPUT / "Windows Kits/10" / f, ignore_errors=True)
for arch in ["x86", "x64", "arm", "arm64"]:
if arch != TARGET:
if install_msvc:
shutil.rmtree(OUTPUT / "VC/Tools/MSVC" / msvcv / f"bin/Host{arch}", ignore_errors=True)
if install_sdk:
shutil.rmtree(OUTPUT / "Windows Kits/10/bin" / sdkv / arch)
shutil.rmtree(OUTPUT / "Windows Kits/10/Lib" / sdkv / "ucrt" / arch)
shutil.rmtree(OUTPUT / "Windows Kits/10/Lib" / sdkv / "um" / arch)
### setup.bat
if install_msvc and install_sdk:
SETUP = f"""@echo off
set MSVC_VERSION={msvcv}
set MSVC_HOST=Host{HOST}
set MSVC_ARCH={TARGET}
set SDK_VERSION={sdkv}
set SDK_ARCH={TARGET}
set MSVC_ROOT=%~dp0VC\\Tools\\MSVC\\%MSVC_VERSION%
set SDK_INCLUDE=%~dp0Windows Kits\\10\\Include\\%SDK_VERSION%
set SDK_LIBS=%~dp0Windows Kits\\10\\Lib\\%SDK_VERSION%
set VCToolsInstallDir=%MSVC_ROOT%\\
set PATH=%MSVC_ROOT%\\bin\\%MSVC_HOST%\\%MSVC_ARCH%;%~dp0Windows Kits\\10\\bin\\%SDK_VERSION%\\%SDK_ARCH%;%~dp0Windows Kits\\10\\bin\\%SDK_VERSION%\\%SDK_ARCH%\\ucrt;%PATH%
set INCLUDE=%MSVC_ROOT%\\include;%SDK_INCLUDE%\\ucrt;%SDK_INCLUDE%\\shared;%SDK_INCLUDE%\\um;%SDK_INCLUDE%\\winrt;%SDK_INCLUDE%\\cppwinrt
set LIB=%MSVC_ROOT%\\lib\\%MSVC_ARCH%;%SDK_LIBS%\\ucrt\\%SDK_ARCH%;%SDK_LIBS%\\um\\%SDK_ARCH%
"""
(OUTPUT / "setup.bat").write_text(SETUP)
if install_msvc:
MSVC_SCRIPT = f"""@echo off
set MSVC_VERSION={msvcv}
set MSVC_HOST=Host{HOST}
set MSVC_ARCH={TARGET}
set MSVC_ROOT=%~dp0VC\\Tools\\MSVC\\%MSVC_VERSION%
set VCToolsInstallDir=%MSVC_ROOT%
set PATH=%MSVC_ROOT%\\bin\\%MSVC_HOST%\\%MSVC_ARCH%;%PATH%
set INCLUDE=%MSVC_ROOT%\\include;%INCLUDE%
set LIB=%MSVC_ROOT%\\lib\\%MSVC_ARCH%;%LIB%
"""
(OUTPUT / f"msvc-{msvcv}.bat").write_text(MSVC_SCRIPT)
(OUTPUT / f"msvc-{args.msvc_version}.bat").write_text(MSVC_SCRIPT)
if install_sdk:
WIN10_SDK_SCRIPT = f"""@echo off
set SDK_VERSION={sdkv}
set SDK_ARCH={TARGET}
set SDK_INCLUDE=%~dp0Windows Kits\\10\\Include\\%SDK_VERSION%
set SDK_LIBS=%~dp0Windows Kits\\10\\Lib\\%SDK_VERSION%
set PATH=%~dp0Windows Kits\\10\\bin\\%SDK_VERSION%\\%SDK_ARCH%;%~dp0Windows Kits\\10\\bin\\%SDK_VERSION%\\%SDK_ARCH%\\ucrt;%PATH%
set INCLUDE=%SDK_INCLUDE%\\ucrt;%SDK_INCLUDE%\\shared;%SDK_INCLUDE%\\um;%SDK_INCLUDE%\\winrt;%SDK_INCLUDE%\\cppwinrt;%INCLUDE%
set LIB=%SDK_LIBS%\\ucrt\\%SDK_ARCH%;%SDK_LIBS%\\um\\%SDK_ARCH%;%LIB%
"""
(OUTPUT / f"win-sdk-{sdkv}.bat").write_text(WIN10_SDK_SCRIPT)
(OUTPUT / f"win-sdk-{args.sdk_version}.bat").write_text(WIN10_SDK_SCRIPT)
print(f"Total downloaded: {total_download>>20} MB")
print("Done!")