Skip to content

Instantly share code, notes, and snippets.

@mflatt
Last active June 28, 2026 21:33
Show Gist options
  • Select an option

  • Save mflatt/ec2160029e99fa7c7cf095a79fc7eebd to your computer and use it in GitHub Desktop.

Select an option

Save mflatt/ec2160029e99fa7c7cf095a79fc7eebd to your computer and use it in GitHub Desktop.
Makefile for Rhombus packages using new pkg destdir support
MAIN_PKG = rhombus-main
PKGS = \
actor-lib \
actor \
box-extra-lib \
box-extra \
enforest-lib \
enforest \
ffi2-lib \
ffi2 \
gui-easy-lib \
gui-easy \
http-easy-lib \
http-easy \
pict-balloon2 \
pretty-expressive-lib \
pretty-expressive \
rackcheck-lib \
rackcheck \
resource-pool-lib \
resource-pool \
rhombus-csv-lib \
rhombus-csv \
rhombus-draw-lib \
rhombus-draw \
rhombus-exe \
rhombus-ffi-lib \
rhombus-ffi \
rhombus-gui-lib \
rhombus-gui \
rhombus-html-lib \
rhombus-html-page-lib \
rhombus-html-page \
rhombus-html \
rhombus-http-lib \
rhombus-http \
rhombus-icons \
rhombus-json-lib \
rhombus-json \
rhombus-lib \
rhombus-logo-lib \
rhombus-logo \
rhombus-main-distribution-lib \
rhombus-main-distribution \
rhombus-main \
rhombus-net-cookie-lib \
rhombus-net-cookie \
rhombus-parser-lib \
rhombus-parser \
rhombus-pict-lib \
rhombus-pict \
rhombus-prototype \
rhombus-scribble-lib \
rhombus-scribble \
rhombus-slideshow-lib \
rhombus-slideshow \
rhombus-ssl-lib \
rhombus-ssl \
rhombus-url-lib \
rhombus-url \
rhombus-xml-lib \
rhombus-xml \
rhombus \
shrubbery-lib \
shrubbery-render-lib \
shrubbery-render \
shrubbery \
version-case-lib \
version-case
RACKET = racket
DESTDIR =
DESTDIR_DOC =
FORCE =
DEST = build/rhombus-pkg-platform
platform:
"$(RACKET)" -A build -l- raco pkg install -u --auto --catalog catalog/ --adjacent-deps $(MAIN_PKG)
"$(RACKET)" -A build -l- raco pkg create --dest $(DEST)/pkgs --built --format dir --from-install --adjacent-deps $(MAIN_PKG)
"$(RACKET)" -l- pkg/dirs-catalog -q $(DEST)/catalog $(DEST)/pkgs
# For a Racket that already has packages in `PKGS` installed
# --- not recommended, and there will be warnings to ignore
platform-force:
"$(RACKET)" -A build -l- raco pkg install $(FORCE) -u --auto --catalog catalog/ $(PKGS)
"$(RACKET)" -A build -l- raco pkg create --dest $(DEST)/pkgs --built --format dir --from-install $(PKGS)
"$(RACKET)" -l- pkg/dirs-catalog -q $(DEST)/catalog $(DEST)/pkgs
install:
if [ -z "$(DESTDIR)" ]; then $(MAKE) install-no-destdir; else $(MAKE) install-destdir; fi
install-no-destdir:
"$(RACKET)" -l- raco pkg install -i --auto --catalog $(DEST)/catalog/ $(MAIN_PKG)
install-destdir:
"$(RACKET)" -l- raco pkg install -i --auto --catalog $(DEST)/catalog --destdir "$(DESTDIR)" $(MAIN_PKG)
if [ -n "$(DESTDIR_DOC)" ]; then $(MAKE) install-destdir-doc; fi
# Use with `platform-force`
install-destdir-force:
"$(RACKET)" -l- raco pkg install -i --force --catalog $(DEST)/catalog --destdir "$(DESTDIR)" $(PKGS)
if [ -n "$(DESTDIR_DOC)" ]; then $(MAKE) install-destdir-doc; fi
install-destdir-doc:
"$(RACKET)" -l- setup/doc-to-destdir "$(DESTDIR_DOC)" "$(DESTDIR)"
# Not in this makefile: move `($DESTDIR)` and `$(DESTDIR_DOC)` contents into place
# This makefile isn't meant to be available in the final installation context,
# but here's the intended attach command
attach:
"$(RACKET)" -l- raco pkg install -i --attach --deps search-auto --adjacent-deps $(MAIN_PKG)
# Like `attach` mode, the makefile isn't meant to be available,
# but here's the intended link command
LINK_DIR = $(DEST)/pkgs
link:
cd $(LINK_DIR) && "$(RACKET)" -l- raco pkg install -i --link --deps search-auto --adjacent-deps $(MAIN_PKG)
pkg-list:
@ echo $(PKGS)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment