Did you know you can make your own Racket installer?
Racket has so many options, and I have a habit of destroying my configuration file. As some point in the past I started thinking about creating an installer that installed Racket to my specifications. After all, there is a chapter that is enticingly titled Distributing Racket Variants:
This chapter is about distributing variants of Racket
I can't remember what prompted me, but this weekend I set the terminal to green on black , and posted all my failures to the #off-topic channel on the discord.
I have to thank Matthew for being incredibly kind with this process.
So with all this preamble you would think this is an incredibly difficult piece of 'rocket surgery' but it turns out to be quite simple in practice. Here goes:
- make a clean checkout of GitHub - racket/racket: The Racket repository
- put your
site.rkt
file in the checkout - run
make installers CONFIG=site.rkt
You have to wait a bit but I find the Racket build process is a soothing experience, with an ASMR-like effect. YMMV.
While waiting consider the site.rkt
file is written in #lang distro-build/config
Here is mine:
#lang distro-build/config
(machine
#:pkgs '("2d"
"at-exp-lib"
"compatibility"
"contract-profile"
"compiler"
"data"
"datalog"
"db"
"draw"
"draw-doc"
"draw-lib"
"drracket"
"drracket-tool"
"expeditor"
"errortrace"
"future-visualizer"
"future-visualizer-typed"
"gui"
"htdp"
"html"
"icons"
"images"
"lazy"
"macro-debugger"
"macro-debugger-text-lib"
"make"
"math"
"mysterx"
"mzcom"
"mzscheme"
"net"
"net-cookies"
"optimization-coach"
"option-contract"
"parser-tools"
"pconvert-lib"
"pict"
"pict-snip"
"plai"
"planet"
"plot"
"preprocessor"
"profile"
"racket-doc"
"distributed-places"
"racket-cheat"
"racket-index"
"racket-lib"
"racklog"
"rackunit"
"rackunit-typed"
"readline"
"realm"
"redex"
"rhombus"
"quickscript-extra"
"sandbox-lib"
"sasl"
"schemeunit"
"scribble"
"serialize-cstruct-lib"
"sgl"
"shell-completion"
"simple-tree-text-markup"
"slatex"
"slideshow"
"snip"
"srfi"
"string-constants"
"syntax-color"
"trace"
"typed-racket"
"typed-racket-more"
"unix-socket"
"web-server"
"wxme"
"xrepl"
"ds-store"))
I removed a couple of things I don't use and added The Rhombus programming language and Quickscript-extra
site.rkt for making your own Racket. ยท GitHub
At the end it spits out an installer into the bundle folder. In my case it was called 'racket-8.15.0.12-aarch64-macosx.dmg', but I'm assuming it will work much the same on Windows or Linux.
I've made my 'racket-8.15.0.12-aarch64-macosx.dmg' installer available for download at Releases ยท spdegabrielle/racket ยท GitHub - but don't use mine - make
your own Racket
Lessons learnt:
- Just ask questions. People are kind.
- don't make checkout of spdegabrielle/racket because spdegabrielle is over 100 commits behind and it will fail.
- Don't put the checkout in a folder mapped to iCloud Drive. It causes
make installers
to fail. (I should know from experiencing how both Google Drive for desktop and Microsoft OneDrive cause unexpected behaviour.) - You can just start with minimal-Racket and just install what you need. That is a valid approach. (Does it take far longer to do this? Yes.)
What next?
- Work out how to include my own default preferences file
- White on black colour scheme
- Disable 'Enable keybindings in menus'. (enable Emacs keybindings)
- Enable automate parentheses, squar bracket, and quotes
- Restore open files from previous session
- remove the documentation and point to https://docs.racket-lang.org/
- add some DrRacket plugins (add the packages to my sites.rkt)
- add more packages to my sites.rkt
- work out how to cross-compile to Windows and Linux so I can share with others
- Do other minimal versions:
- DrRacket only
- Slideshow only
- scribble only
- Just the games package
Will you `make' your own Racket? Geddit? ( I crack myself up.)
Love to you all
Stephen
PS: my installer: Release my attempt at making my own Racket ยท spdegabrielle/racket ยท GitHub. ( Ignore the incorrect tag. )
PPS I forgot to add 'set rhombus as default #lang
so I engage with it properly instead of reverting back to #lang Racket
'