mlton for Debian ---------------- 1. Repacking upstream tarballs ============================== The upstream mlton source tarball contains non-DFSG-free files. It also contains nested tarballs and patches for their extracted contents. We repack the original tarball to remove the non-DFSG-free files and to extract the nested tarballs. (Strictly speaking, we don't bother with sources, but just use the upstream VCS tags.) Here are the instructions for importing a new upstream release. First, make sure that upstream MLton's git repository is known to your local git clone of the Debian packaging: git remote add mlton https://github.com/MLton/mlton.git Next, fetch any known tags: git fetch mlton We now merge the desired tag into the upstream branch: export VERSION=202YMMDD git switch upstream git merge on-${VERSION}-release # Make sure we have any relevant upstream tarballs so that # we can reextract them: git checkout on-${VERSION}-release -- \ lib/mllpt-lib/ml-lpt.tgz lib/mllpt-lib/ml-lpt.patch \ lib/mlrisc-lib/MLRISC.tgz lib/mlrisc-lib/MLRISC.patch \ lib/smlnj-lib/smlnj-lib.tgz lib/smlnj-lib/smlnj-lib.patch \ runtime/gdtoa.tgz 'runtime/gdtoa.*.patch' # Delete previously extracted tarballs to make sure that # files deleted upstream are deleted in the repacked tarball: rm -fr \ lib/ckit-lib/ckit-lib \ lib/mllpt-lib/ml-lpt \ lib/mlrisc-lib/MLRISC \ lib/smlnj-lib/smlnj-lib \ runtime/gdtoa # Extract the nested tarballs and apply upstream's patches make -C lib/ckit-lib ckit-lpt/README make -C lib/mllpt-lib ml-lpt/README make -C lib/mlrisc-lib MLRISC/README.mlton make -C lib/smlnj-lib smlnj-lib/README.mlton # The Makefile in runtime has a bunch of eval lines that compile files # before ever getting around to extracting gdtoa.tgz. We extract just # the relevant Makefile target and run it ourselves with variables # substituted in: cd runtime && \ sed -n '/^gdtoa\/README/,${p;/^$/q}' Makefile | \ sed -e 's@$(PATCH)@patch@g;s@$(GZIP)@gzip@g;s@$(TAR)@tar@g' | \ make --file="-" && cd - # Delete the nested tarballs and patches rm lib/mllpt-lib/ml-lpt.tgz lib/mllpt-lib/ml-lpt.patch rm lib/mlrisc-lib/MLRISC.tgz lib/mlrisc-lib/MLRISC.patch rm lib/smlnj-lib/smlnj-lib.tgz lib/smlnj-lib/smlnj-lib.patch rm runtime/gdtoa.tgz runtime/gdtoa.*.patch # Delete non-DFSG-free files from unpacked tarballs rm -fr lib/smlnj-lib/smlnj-lib/HTML4/tests/ # We need to pass -f to git add because upstream ignores # extracted contents via .gitignore git add -f lib runtime git commit -m "Repacked new upstream release ${VERSION}" git tag -s "upstream/${VERSION}+dfsg" Now we can merge in back into the desired packaging branch, e.g.: git switch debian/unstable git merge upstream/${VERSION}+dfsg 2. Rebootstrapping ================== MLton, as with most SML compilers, requires a SML compiler to compile itself. If ever mlton becomes uninstallable, you will need to compile it with the last installable version. Unfortunately, Building the runtime system requires compiling and executing programs that determine characteristics of the platform, which is why it isn’t currently feasible to build the runtime system on the host machine using a cross-compiler toolchain. per doc/guide/src/CrossCompiling.adoc. This means that you cannot use sbuild to locally cross-compile for a different architecture, and that you will have to manually build the package on that architecture. Assuming you have access to a porterbox of that architecture, here are some instructions that you use to bootstrap mlton on that architecture: 1. Create a clean build schroot on the porterbox ------------------------------------------------ These instructions assume that you are porting mlton via one of Debian's porterboxes. In this case, it is not possible to directly install mlton's build dependencies on the host, and you must instead install them in a chroot. ARCH=i386 # Arch we are bootstrapping PORTERBOX=barriere.debian.org SCHROOT=$USER-sid-$ARCH REMOTE_TMP=tmp # temporary remote directory for building cat < Fri, 07 Nov 2025 10:38:55 -0500