Update .local/share/chezmoi/software.yml, .local/share/chezmoi/home/.chezmoidata.yaml, .local/share/chezmoi/home/private_dot_config/zap/v2/config.ini, .local/share/chezmoi/home/dot_local/bin/executable_install-program

This commit is contained in:
Brian Zalewski 2022-12-09 06:37:26 +00:00
parent d261280dc1
commit 33427cd0db
4 changed files with 207 additions and 31 deletions

View file

@ -460,8 +460,8 @@ softwareGroups:
- composer
- php
Package-Management: &Package-Management
- homebrew
- whalebrew
# - homebrew
# - whalebrew
- zap
Productivity-Desktop: &Productivity-Desktop
- libreoffice

View file

@ -541,6 +541,7 @@ async function afterInstall(packageManager) {
} else if (packageManager === "pkg") {
} else if (packageManager === "port") {
} else if (packageManager === "scoop") {
} else if (packageManager === "script") {
} else if (packageManager === "snap") {
} else if (packageManager === "whalebrew") {
} else if (packageManager === "winget") {
@ -549,8 +550,63 @@ async function afterInstall(packageManager) {
}
}
async function ensureCurl() {
const curl = which.sync('curl', { nothrow: true })
if (!curl) {
log("warn", "Ensure curl", `Installing curl because it is required for the binary install method`)
if (osType === 'linux') {
const apk = which.sync("apk", { nothrow: true });
const apt = which.sync("apt", { nothrow: true });
const dnf = which.sync("dnf", { nothrow: true });
const yum = which.sync("yum", { nothrow: true });
const pacman = which.sync("pacman", { nothrow: true });
const zypper = which.sync("zypper", { nothrow: true });
if (apk) {
$`sudo apk add curl`;
} else if (apt) {
if (updateDone[packageManager] !== true) {
await beforeInstall('apt-get')
}
await $`sudo apt-get install -y curl`;
} else if (dnf) {
if (updateDone[packageManager] !== true) {
await beforeInstall('dnf')
}
await $`sudo dnf install -y curl`;
} else if (yum) {
if (updateDone[packageManager] !== true) {
await beforeInstall('dnf')
}
await $`sudo yum install -y curl`;
} else if (pacman) {
if (updateDone[packageManager] !== true) {
await beforeInstall('pacman')
}
await $`sudo pacman -Sy curl`;
} else if (zypper) {
if (updateDone[packageManager] !== true) {
await beforeInstall('zypper')
}
await $`sudo zypper install -y curl`;
}
} else if (osType === 'darwin') {
if (updateDone['brew'] !== true) {
await beforeInstall('brew')
}
await $`brew install curl`
} else if (osType === 'windows') {
if (updateDone['choco'] !== true) {
await beforeInstall('choco')
}
await `choco install -y curl`
}
}
}
// Pre-install hook
const updateDone = {}
async function beforeInstall(packageManager) {
updateDone[packageManager] = true
const logStage = "Pre-Install Package Manager";
if (packageManager === "appimage") {
} else if (packageManager === "ansible") {
@ -721,6 +777,12 @@ async function ensurePackageManager(packageManager) {
await ensurePackageManager("brew");
}
if (packageManager === "appimage") {
const zap = which.sync('zap', { nothrow: true })
if (!zap) {
log("info", "Zap Installation", 'Installing Zap to handle AppImage installation')
await ensureCurl()
await $`sudo curl -sSL https://github.com/srevinsaju/zap/releases/download/continuous/zap-amd64 > /usr/local/bin/zap`
}
} else if (packageManager === "ansible") {
try {
await $`test -f "$HOME/.cache/megabyte-labs/ansible-installed"`;
@ -750,6 +812,7 @@ async function ensurePackageManager(packageManager) {
`
);
} else if (packageManager === "binary") {
await ensureCurl()
} else if (packageManager === "bpkg") {
await ensureInstalled(
"bpkg",
@ -987,6 +1050,7 @@ async function ensurePackageManager(packageManager) {
} else {
log("warn", logStage, 'Snap installation sequence completed but the snap bin is still not available')
}
} else if (packageManager === "script") {
} else if (packageManager === "whalebrew") {
await ensureInstalled("whalebrew", $`brew install whalebrew`);
} else if (packageManager === "winget") {
@ -1016,6 +1080,22 @@ async function installPackageList(packageManager, packages) {
const logStage = "Package Install";
try {
if (packageManager === "appimage") {
for (let pkg of packages) {
try {
if (pkg.substring(0, 3) === 'http' && pkg.slice(-8) === 'AppImage') {
log("info", "AppImage Install", `Installing ${pkg} from its URL`)
await $`zap install --from ${pkg}`
} else if (pkg.includes("/")) {
log("info", "AppImage Install", `Installing ${pkg} from a GitHub Release`)
await $`zap install --github --from ${pkg}`
} else {
log("info", "AppImage Install", `Installing ${pkg} using the AppImage Catalog`)
await $`zap install ${pkg}`
}
} catch (e) {
log("error", "AppImage / Zap Failure", `There was an error using Zap to install ${pkg}`)
}
}
} else if (packageManager === "ansible") {
for (let pkg of packages) {
try {
@ -1070,6 +1150,13 @@ async function installPackageList(packageManager, packages) {
}
}
} else if (packageManager === "binary") {
for (let pkg of packages) {
try {
await $`TMP="$(mktemp)" && curl -sSL ${pkg} > "$TMP" && sudo mv "$TMP" /usr/local/src/${binName} && chmod +x /usr/local/src/${binName}`
} catch (e) {
log("error", "Binary Release Install", `There was an error installing the binary release for ${pkg}`)
}
}
} else if (packageManager === "brew") {
for (let pkg of packages) {
try {
@ -1267,6 +1354,14 @@ async function installPackageList(packageManager, packages) {
);
}
}
} else if (packageManager === "script") {
for (let pkg of packages) {
try {
await $`${pkg}`
} catch(e) {
log("error", "Script Install Failure", `There was an error running the script installation method for ${pkg}`)
}
}
} else if (packageManager === "snap-classic") {
for (let pkg of packages) {
try {

View file

@ -0,0 +1,9 @@
[Zap]
Version = 2
Mirror = https://g.srev.in/get-appimage/%s/core.json
MirrorRoot = https://g.srev.in/get-appimage
ApplicationStore = {{ .host.home }}/Applications
IconStore = {{ .host.home }}/.local/icons
LocalStore = {{ .host.home }}/Applications
CustomIconTheme = true
Integrate = yes

View file

@ -53,6 +53,10 @@
# pkg-termux: altair
# port: altair
# scoop: altair
# script >-
# curl -sS https://getcomposer.org/installer | php
# sudo mv composer.phar /usr/local/bin/composer
# sudo chmod +x /usr/local/bin/composer
# _snapClassic: true # Install the snap in classic mode
# snap: altair
# whalebrew:
@ -1068,14 +1072,20 @@ softwarePackages:
_service: null
ansible: professormanhattan.common
composer:
_bin: null
_bin: composer
_desc: '[Composer](https://getcomposer.org/) is an application-level package manager for the PHP programming language that provides a standard format for managing dependencies of PHP software and required libraries. It was developed by Nils Adermann and Jordi Boggiano, who continue to manage the project.'
_docs: https://getcomposer.org/doc/
_github: https://github.com/composer/composer
_home: https://getcomposer.org/
_name: Composer
_service: null
_service: false
ansible: professormanhattan.composer
brew: composer
choco: composer
pacman: composer
scoop: composer
script:darwin: cd ~ && curl -sS https://getcomposer.org/installer | php && sudo mv composer.phar /usr/local/bin/composer && sudo chmod +x /usr/local/bin/composer
script:linux: cd ~ && curl -sS https://getcomposer.org/installer | php && sudo mv composer.phar /usr/local/bin/composer && sudo chmod +x /usr/local/bin/composer
confd:
_bin: null
_desc: Manage local application configuration files using templates and data from etcd or consul
@ -3001,15 +3011,6 @@ softwarePackages:
ansible: professormanhattan.himalaya
brew: himalaya
scoop: himalaya
homebrew:
_bin: null
_desc: '[Homebrew](https://brew.sh/) is a free and open-source software package management system that simplifies the installation of software on Apple''s operating system macOS as well as Linux. The name is intended to suggest the idea of building software on the Mac depending on the user''s taste.'
_docs: null
_github: null
_home: null
_name: Homebrew
_service: null
ansible: professormanhattan.homebrew
hostctl:
_bin: null
_desc: This tool gives more control over the use of hosts file
@ -4770,14 +4771,90 @@ softwarePackages:
pipx: pgcli
port: pgcli
php:
_bin: null
_deps:
- php-extensions
_bin: php
_desc: '[PHP](https://www.php.net/) is a general-purpose scripting language especially suited to web development. It was originally created by Danish-Canadian programmer Rasmus Lerdorf in 1994. The PHP reference implementation is now produced by The PHP Group.'
_docs: https://www.php.net/docs.php
_github: https://github.com/php/php-src
_home: https://www.php.net/
_name: PHP
_service: null
_service: false
ansible: professormanhattan.php
apt: php
brew: php
choco: php
dnf: php
pacman: php
port: php
scoop: php
php-extensions:
_name: PHP Extensions
_service: false
_note: Needs testing
apt:
- libpcre3-dev
- php-apache
- php-apcu
- php-cgi
- php-cli
- php-common
- php-curl
- php-dev
- php-fpm
- php-gd
- php-embed
- php-intl
- php-imap
- php-json
- php-mbstring
- php-opcache
- php-redis
- php-snmp
- php-sqlite3
- php-xml
dnf:
- libpcre3-dev
- php-apache
- php-apcu
- php-cgi
- php-cli
- php-common
- php-curl
- php-dev
- php-fpm
- php-gd
- php-embed
- php-intl
- php-imap
- php-json
- php-mbstring
- php-opcache
- php-redis
- php-snmp
- php-sqlite3
- php-xml
pacman:
- libpcre3-dev
- php-apache
- php-apcu
- php-cgi
- php-cli
- php-common
- php-curl
- php-dev
- php-fpm
- php-gd
- php-embed
- php-intl
- php-imap
- php-json
- php-mbstring
- php-opcache
- php-redis
- php-snmp
- php-sqlite3
- php-xml
pihole:
_bin: null
_desc: '[Pi-hole](https://pi-hole.net/) is a Linux network-level advertisement and Internet tracker blocking application which acts as a DNS sinkhole and optionally a DHCP server, intended for use on a private network. It is designed for low-power embedded devices with network capability, such as the Raspberry Pi, but supports any Linux machines.'
@ -5435,7 +5512,9 @@ softwarePackages:
_github: https://github.com/rust-lang/rust
_home: https://www.rust-lang.org/
_name: Rust
_post:snap: rustup toolchain install stable
_service: false
_snapClassic: true
ansible: professormanhattan.rust
apt:
- cargo
@ -5450,6 +5529,7 @@ softwarePackages:
- cargo
- rust
scoop: rust
snap: rustup
rvm:
_bin: null
_desc: '[rvm](https://rvm.io/) lets you manage Ruby environments and switch between them.'
@ -6948,16 +7028,6 @@ softwarePackages:
brew: wget
dnf: wget
# whalebrew: whalebrew/wget # Temporarily commentted out for debugging
whalebrew:
_bin: whalebrew
_desc: Homebrew, but with Docker images
_docs: https://github.com/whalebrew/whalebrew
_github: https://github.com/whalebrew/whalebrew
_home: https://github.com/whalebrew/whalebrew
_name: Whalebrew
_service: false
_type: cli
brew: whalebrew
whaler:
_bin: null
_desc: Whaler takes a Docker image and attempts to reverse engineer the Dockerfile that created it
@ -7269,14 +7339,16 @@ softwarePackages:
pacman: yubikey-manager-qt
scoop: yubikey-manager-qt
zap:
_bin: null
_bin: zap
_desc: Delightful AppImage package manager
_docs: null
_docs: https://zap.srev.in/
_github: https://github.com/srevinsaju/zap
_home: null
_name: null
_service: null
ansible: professormanhattan.zap
_home: https://zap.srev.in/
_name: Zap
_service: false
ansible:linux: professormanhattan.zap
binary:linux: https://github.com/srevinsaju/zap/releases/download/continuous/zap-amd64
script:linux: curl https://raw.githubusercontent.com/srevinsaju/zap/main/install.sh | sudo bash -s
zoom:
_bin: null
_desc: '[Zoom](https://zoom.us/) is a videotelephony software program developed by Zoom Video Communications. This role installs Zoom on nearly any platform. The Zoom free plan provides a video chatting service that allows up to 100 participants concurrently, with a 40-minute time restriction.'