Smackage is a prototype package manager for Standard ML libraries. Right now it does not do any installation, it just provides a standard way of getting Standard ML code that understands where other Standard ML code might be found on the filesystem.
Before installation, it's important to set up your SML compilers to interact
with smackage correctly. Smackage will live in a directory that we'll refer to
$SMACKAGE_HOME. This directory is probably
~/.smackage, but see the
$SMACKAGE_HOME below for more information.
Setting up SML/NJ
To set up Standard ML of New Jersey to interact with Smackage, create a file
~/.smlnj-pathconfig containing the following line:
Don't actually write $SMACKAGE_HOME, though, replace it with the appropriate absolute file path; on my machine this file contains the line
Setting up MLton
MLton doesn't currently allow user-specific basis maps, so you'll have to be
able to edit the MLBasis Path Map, which
is found in a place like
/usr/local/lib/mlton/mlb-path-map, depending on your system. Add the line
with the same caveat as before; after I edited my path map, the file had these contents:
MLTON_ROOT $(LIB_MLTON_DIR)/sml SML_LIB $(LIB_MLTON_DIR)/sml SMACKAGE /Users/rjsimmon/.smackage/lib
Make sure it's an absolute path, starting with "/" or whatever your system uses to refer to the file system root.
Now, assuming you have downloaded the smackage source on your system, you can build and start using smackage like this:
$ cd smackage $ make mlton # (or make smlnj) $ bin/smackage selfupdate $ bin/smackage install cmlib v0
Referring to Smackage packages
If you've run the four lines as described above, you can refer to cmlib as
$SMACKAGE/cmlib/v0/cmlib.cm (in SML/NJ .cm files) or as
$(SMACKAGE)/cmlib/v0/cmlib.mlb (in MLton .mlb files).
You might want to add
$SMACKAGE_HOME/bin to your path if you want to use
applications compiled through smackage.
The $SMACKAGE_HOME directory
Smackage has to figure out where it lives on the file system whenever it
starts up; the installation instructions referred to the directory where
smackage lives as
$SMACKAGE_HOME. Smackage goes through the following process
to try and determine
- If the
SMACKAGE_HOMEenvironment variable is defined, then smackage will always use that as
$SMACKAGE_HOME. If this directory does not exist, smackage will try to create it. Otherwise,
/usr/local/smackageexists, smackage will use that as
/opt/smackage/exists, smackage will use that as
- As a last resort, smackage will try to use
~is defined by the
HOMEenvironment variable. If this directory does not exist, smackage will try to create it.