ScoopInstaller / Scoop

A command-line installer for Windows.
https://scoop.sh
Other
20.74k stars 1.39k forks source link

[Feature] add `archvar` in `architecture` and use it in `env_add_path`, `bin`, `shortcuts` etc rather than stuffing these hard-coded inside `architecture` #5961

Open goyalyashpal opened 3 months ago

goyalyashpal commented 3 months ago

Summaries & Titles

Feature Request

Is your feature request related to a problem? Please describe.

i.e. you want to:

Describe the solution you'd like

the basic idea is to define a variable (say archvar) in each arch of architecture i.e. at architecture.<arch>.archvar, then using that in the global definition of all these other fields.

fields like:

more details posted at this comment below: https://github.com/ScoopInstaller/Scoop/issues/5961#issuecomment-2106383595

example manifest

examples posted at this comment below: https://github.com/ScoopInstaller/Scoop/issues/5961#issuecomment-2106380121

Describe alternatives you've considered

goyalyashpal commented 3 months ago

Example manifests

found using github.com/search on searching by nesting's 8-space indent for:

main/autoit: "_x64", ""

https://github.com/ScoopInstaller/Main/blob/7303e0576ff3f4a616f9796941974615a616e0c6/bucket/autoit.json#L33 ```json { "version": "3.3.16.1", "description": "Scripting language designed for automating the Windows GUI and general scripting", "homepage": "https://www.autoitscript.com/site/autoit/", "license": { "identifier": "Freeware", "url": "https://www.autoitscript.com/autoit3/docs/license.htm" }, "suggest": { "vcredist": [ "extras/vcredist2005", "extras/vcredist2008", "extras/vcredist2022" ], "AutoIt Script Editor": "extras/autoit-script-editor" }, "url": "https://www.autoitscript.com/files/autoit3/autoit-v3.zip", "hash": "8b7098c44275d0203c23f2ce56c0e913c0d6b6d2264bc537e8a9f0a9f07badc9", "extract_dir": "install", "architecture": { "64bit": { "archvar": "_x64" }, "32bit": { "archvar": "" }, }, "bin": [ [ "AutoIt3$archvar.exe", "AutoIt" ], [ "Aut2Exe\\Aut2exe$archvar.exe", "Aut2exe" ], "Au3Check.exe" ], "shortcuts": [ [ "AutoIt3$archvar.exe", "AutoIt" ], [ "Au3Info$archvar.exe", "AutoIt Window Info Tool" ], [ "Aut2Exe\\Aut2exe$archvar.exe", "AutoIt Script Compiler" ], [ "SciTe\\SciTE.exe", "AutoIt Script Editor" ] ], "post_install": [ "$editor = versiondir 'autoit-script-editor' 'current'", "if (Test-Path $editor) {", " Remove-Item \"$dir\\SciTe\" -Recurse -Force", " New-Item -Path \"$dir\\SciTE\" -Value \"$editor\" -ItemType Junction | Out-Null", "}" ], "checkver": { "url": "https://www.autoitscript.com/site/autoit/downloads/", "regex": "v([\\d.]+)" }, "autoupdate": { "url": "https://www.autoitscript.com/files/autoit3/autoit-v3.zip" } } ```

main/miktex: "x64"

https://github.com/ScoopInstaller/Main/blob/5354865fb1477c403de1999bfbea481e2190a786/bucket/miktex.json#L9 ```json { "version": "24.1", "description": "MikTeX, an up-to-date implementation of TeX/LaTeX and related programs.", "homepage": "https://miktex.org", "license": { "identifier": "LPPL1.3c,GPL-3.0-or-later,Public Domain,...", "url": "https://miktex.org/copying" }, "architecture": { "64bit": { "url": "https://mirrors.mit.edu/CTAN/systems/win32/miktex/setup/windows-x64/basic-miktex-24.1-x64.exe", "hash": "94ddd75e2b90309b75db6dbda7d8103fcebda4495b579695e925e885d2b92704", "archvar": "x64" } }, "bin": [ [ "texmfs\\install\\miktex\\bin\\$archvar\\miktex-console.exe", "miktex", "--hide --mkmaps" ] ], "shortcuts": [ [ "texmfs\\install\\miktex\\bin\\$archvar\\miktex-console.exe", "MiKTeX Console" ] ], "env_add_path": "texmfs\\install\\miktex\\bin\\$archvar", "installer": { "args": [ "--portable=$dir", "--unattended", "--private" ] }, "persist": "texmfs\\config", "checkver": { "url": "https://miktex.org/download", "regex": "basic-miktex-([\\d.]+)-x64\\.exe" }, "autoupdate": { "architecture": { "64bit": { "url": "https://mirrors.mit.edu/CTAN/systems/win32/miktex/setup/windows-x64/basic-miktex-$version-x64.exe" } }, "hash": { "url": "https://miktex.org/download", "regex": "(?sm)$basename

.*?$sha256" } } } ```

extras/idea: "64", ""

https://github.com/ScoopInstaller/Extras/blob/6601ee71779d02c4dd5329630c41c5ad39d168d9/bucket/idea.json#L17 ```json { "version": "2024.1.1-241.15989.150", "description": "Cross-Platform IDE for Java by JetBrains (Community edition).", "homepage": "https://www.jetbrains.com/idea/", "license": { "identifier": "Apache-2.0", "url": "https://sales.jetbrains.com/hc/en-gb/articles/115001015290-Where-can-I-find-the-EULA-End-User-License-Agreement-" }, "url": "https://download.jetbrains.com/idea/ideaIC-2024.1.1.win.zip", "hash": "347caa8c4d848bbc5694d32b99b52747c65e082d353fa1ea9428dca00ae2efaf", "extract_to": "IDE", "installer": { "script": "& \"$bucketsdir\\extras\\scripts\\jetbrains\\portable.ps1\" $dir $persist_dir" }, "architecture": { "64bit": { "archvar": "64" }, "32bit": { "archvar": "" } }, "bin": [ [ "IDE\\bin\\idea$archvar.exe", "idea" ] ], "shortcuts": [ [ "IDE\\bin\\idea$archvar.exe", "JetBrains\\IDEA" ] ], "persist": [ "IDE\\bin\\idea.properties", "IDE\\bin\\idea.exe.vmoptions", "IDE\\bin\\idea64.exe.vmoptions", "profile" ], "checkver": { "url": "https://data.services.jetbrains.com/products/releases?code=IIC&latest=true&platform=zip&type=release", "regex": "version\":\"(?[\\d.]+)\".*\"build\":\"(?[\\d.]+)\"", "replace": "${ver}-${build}" }, "autoupdate": { "url": "https://download.jetbrains.com/idea/ideaIC-$matchHead.win.zip", "hash": { "url": "$url.sha256" } } } ```

extras/q-dir "_x64", ""

https://github.com/ScoopInstaller/Extras/blob/6601ee71779d02c4dd5329630c41c5ad39d168d9/bucket/q-dir.json#L13 changes not synthesized yet ```json ```

<local>/context.json "win64", "mswin"

manifest not figured out yet ```json ```

https://github.com/ScoopInstaller/Main/blob/7303e0576ff3f4a616f9796941974615a616e0c6/bucket/ag.json#L10 https://github.com/ScoopInstaller/Main/blob/7303e0576ff3f4a616f9796941974615a616e0c6/bucket/dxc.json#L13 https://github.com/ScoopInstaller/Extras/blob/4068aeacb118ee5fe31f17529d8f1083b7c71e5e/bucket/folder-painter.json#L11

goyalyashpal commented 3 months ago

Describe the solution you'd like

a nuance:

but what would be its default value? i.e. what will happen in following cases: