Monday, January 14, 2019

mscgen on macOS

mscgen is a handy tool for making message sequence charts. I've used this on links before, but using it on my macOS device required some hoops to jump through. Here's how I got this to work!

Download mscgen source package and un-tar to your favorite location

# d="~/work/mscgen"; mkdir $d; pushd $d
# curl http://www.mcternan.me.uk/mscgen/software/mscgen-src-0.20.tar.gz | tar -xvz
# pushd mscgen-0.20 
# vi README
# ./configure
Here's where the fun begins with dependencies. On my machine, I needed to install libgd, libpng. these dependencies are reported in the "missing" file

# vi missing

The following steps got me what's needed. I used sudo make install for both these to simplify my life. there's always a risk of doing this wrong and messing up your machine, so please be careful. Also ensure that the download is secure (TLS/https) and that the hash matches the published.

# d="~/work/libpng"; mkdir $d; pushd $d
# curl https://download.sourceforge.net/libpng/libpng-1.6.35.tar.gz | tar -xvzf libpng-1.6.35.tar
# pushd libpng-1.6.35
# ./configure
# make
# sudo make install

# d="~/work/libgd"; mkdir $d; pushd $d
# curl https://github.com/libgd/libgd/releases/download/gd-2.2.5/libgd-2.2.5.tar.gz | tar -xvz
# pushd libgd-2.2.5
# ./configure --with-png=/usr/local/
# make
# sudo make install

# pushd ../../mscgen/mscgen-0.20/
# ./configure
# make

At this point, if alls gone well, there should be a macOS binary mscgen under the src directory.

# file .//src/mscgen

Create a test file and check output

# ./mscgen -i test.msc -o test.png -T png
# open test.png

test.png

No comments: