Universal Install Script (2016)
xkcd.com
xkcd.com
Packaging for Linux isn't much better. There's .deb, for which you need a "repository". There are "snaps", which is Canonical's scheme for getting developers under control of their App Store. There was Flatpak, but Canonical is trying to kill that off. There's AppImage, but the code to build those hasn't been updated in two years. There's always .zip files.
Not sure how to package for MacOS yet.
Does anyone still use AppImage, or is it dying out?
At the end of the day, they're glorified zip files, not much different to self-extracting .exe files, and you'll have to figure out what libraries your application needs to run on various distros. Some bundlers attempt to do this for you but they're not infallible, so be prepared to test in different VMs.
I just discovered that the hard way.[1]
[1] https://users.rust-lang.org/t/packaging-a-rust-application-f...
If you're worried, you can also just, do both. A packaging overhead of 2 is still better than maintaining your own distro- and version-specific packages, unless you submit it to the distros yourself or get others to package it for you.
https://nsis.sourceforge.io/Main_Page
From the features page:
"The NSIS compiler can be compiled for POSIX platforms like Linux and *BSD. Generated installer will still run on Windows only, but this way they can be generated without Windows or WINE."
That generates an executable installer, not a .msi file or its more recent successor. But the installers will run on Windows 95!
Instead, use the portable apps model (https://portableapps.com/) , where you have a single binary that runs, and can be deployed by a simple copy/extract. Ditto with uninstallation.
This is what MacOS has, so that's why mac software is just a bundle inside a directory (that ends in `.app`).
Universal Install Script by XKCD – Combat Test - https://news.ycombinator.com/item?id=11522478 - April 2016 (17 comments)
Universal install script - https://news.ycombinator.com/item?id=11278013 - March 2016 (1 comment)
Universal Install Script - https://news.ycombinator.com/item?id=11264755 - March 2016 (4 comments)
I'm looking at you, Alpine Linux.
The idea you would chain together multiple package managers such as this:
mpm install
script/https://get.rvm.io \
rvm/1.9.3 \
script/git@github.com/rubygems/rubygems/setup.rb \
gem/rails \
apt/mysql-server \
apt/mysql-client \
bundle/http://typosphere.org/stable.tgz
https://github.com/samsquire/ideas#12-the-package-manager-pa...Might there be a case in which the git one and curl one both work?
The result of the prompt is evaluated by a root shell, naturally.
& detaches them essentially running them in parallel?
Second because there's no `-e`.
{ git clone ... ; cd "$1"; ./configure; make; make install } &
to run the group command (I had to look up the term in man bash) all in the background.Using group commands can be kind of weird though because they're run in the environment of the running shell, so
% mkdir -p /tmp/foo && cd /tmp/foo && pwd
/tmp/foo
% { mkdir bar; cd bar; echo $BASH_SUBSHELL ; }
0
% pwd
/tmp/foo/bar
but if you do the group command in the background, bash runs it in a subshell[0] and the current directory for your shell doesn't change: % mkdir -p /tmp/foo && cd /tmp/foo && pwd
/tmp/foo
% { mkdir bar; cd bar; echo $BASH_SUBSHELL ; } &
1
% pwd
/tmp/foo
[0] From man bash: If a command is terminated by the control operator &, the shell executes the command in the background in a subshell.& is for backgrounding:
#!/bin/sh
date
sleep 5 & # forks the command into the background, we proceed immediately
date
wait # pauses until the backgrounded sleep returns
date
has output Fri Apr 14 13:17:00 PDT 2023
Fri Apr 14 13:17:00 PDT 2023
Fri Apr 14 13:17:05 PDT 2023