Skip to content

Instantly share code, notes, and snippets.

@skeeto
Created December 6, 2022 17:18
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save skeeto/f3a70ce1cce659c67d2c0881094de02b to your computer and use it in GitHub Desktop.
Save skeeto/f3a70ce1cce659c67d2c0881094de02b to your computer and use it in GitHub Desktop.
Build an ISO image that runs a portable w64devkit
#!/bin/sh
set -xe
dir="$(mktemp -d "${TMPDIR:-/tmp}/iso-XXXXXX")"
cleanup() {
rm -rf -- "$dir"
}
trap cleanup EXIT
todos >$dir/autorun.inf <<EOF
[autorun]
open=w64devkit\w64devkit.exe
icon=w64devkit\w64devkit.exe
label=w64devkit
EOF
export GOOS=windows GOARCH=amd64 GOBIN=
(
cd $dir
mkdir bin
cp ~/.vimrc _vimrc
cp ~/.gitconfig .gitconfig
cp ~/.gdbinit .gdbinit
cp ~/dotfiles/w64devkit.profile .profile
tar xf ~/software/cppreference-20220201.tar.xz
unzip -q ~/software/w64devkit.zip
printf 'home = ..\r\n' >>w64devkit/w64devkit.ini
7z x -ogit ~/software/PortableGit-*z.exe
unzip -q ~/software/SDL2-devel-*-mingw.zip
mv SDL2-* sdl
go install golang.org/x/tools/cmd/goimports@latest
cp "$(go env GOPATH)"/bin/windows_amd64/goimports.exe bin/
tar xf ~/qpkg/go1.*.src.*
(
cd go/src/
./make.bash
mv ../bin/windows_amd64/*.exe ../bin/
rm -rf ../bin/go ../bin/gofmt ../bin/windows_amd64
rm -rf ../pkg/linux_amd64 ../pkg/tool/linux_amd64
)
)
genisoimage -RJo w64devkit.iso "$dir"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment