StepMania is an open-source rhythm game similar to the "Dance Dance Revolution" line of arcade and console games. One of StepMania's build dependencies happens to be FFmpeg, which infringes patents that are currently recognized in the United States. This means that most downloads for StepMania available online are not legal to use within the United States, unless they were built the way I will show below. It turns out that FFmpeg is an optional dependency (it is used to play music videos corresponding to songs, which is a nice but unessential feature), and the build scripts honor an optional flag to exclude FFmpeg when building StepMania. We can legally obtain a working build of StepMania that is legal to possess and use in the US by acquiring the source code and building the project outside the US and copying the resulting files to our desired machine.
I will build StepMania using Fedora 30, since that is the operating system I am using personally. I have also followed similar steps successfully on Ubuntu 16.04. Most of the steps are based on the StepMania team's guide for building StepMania.
We need a machine that is located somewhere that can legally download and build StepMania. Unfortunately, the git repo itself includes builds of FFmpeg for Windows machines, so it is not sufficient to download the source code locally and build using the previously-mentioned flag. AWS has a "Paris" region for hosting virtual machines that we can use. France essentially does not recognize software patents. Interestingly VideoLAN, the organization behind VLC media player, is based in France, which explains how they can keep distributing software that infringes every software patent under the sun with impunity. We can likely use other regions, but Paris works fine. Start a t2.medium or larger EC2 instance running Fedora 30 in the Paris AWS region and connect to it. The VM will not need to be kept for more than half an hour, so do not worry about the price of a large instance size - the faster build time is worth it.
Connect to your VM and download any available updates and install the necessary dependencies with the following commands.
$ sudo dnf update -y
$ sudo dnf install -y libXrandr-devel libXtst-devel libpng-devel libjpeg-devel zlib-devel libogg-devel libvorbis-devel yasm alsa-lib-devel pulseaudio-libs-devel libmad-devel bzip2-devel jack-audio-connection-kit-devel libva-devel pcre-devel gtk2-devel glew-devel libudev-devel gcc gcc-c++ cmake make
In your VM, download and build the sources for StepMania with the following commands. Note the all-important WITH_FFMPEG=false flag.
$ git clone --depth=1 https://github.com/stepmania/stepmania.git
$ cd stepmania/
$ git submodule update --init
$ cd Build
$ cmake -G 'Unix Makefiles' -DCMAKE_BUILD_TYPE=Release -DWITH_FFMPEG=false .. && cmake ..
$ make -j4
Check the size of the resulting executable
$ du -h ../stepmania
The size when I ran these steps was 13 MB. If the size is much larger, over 50 MB, then FFmpeg was included and this guide is out of date - grep the source code to see if a similarly-named flag is now used to exclude FFmpeg and try again. If FFmpeg was included, then the build process would mention FFmpeg in its console output, as it currently mentions FFmpeg if you omit the build flag.
The repo includes many data files needed to run StepMania. Before copying all these files to your machine, you need to remove everything that is not part of the game in order to avoid accidentally copying over any files not legal in the US.
$ cd ..
$ rm -r autoconf autogen.sh Build CMake CMakeLists.txt configure.ac Docs extern Installer Makefile.am src Xcode Utils StepmaniaCore.cmake stepmania.nsi
$ yes | rm -r .git
Now all you need to do is copy the remaining files to your local machine.
$ cd ..
$ tar -zcf stepmania.tgz stepmania/
$ pwd
$ ls stepmania.tgz
$ exit
On your local machine, use scp to copy over the tar file you just made. Once you have the tar file, you can discard the VM.
When I did these steps, I had to install two runtime dependencies:
$ sudo dnf install -y libglvnd-opengl mesa-libGLU
Enjoy!
$ ./stepmania
If you get an error like
./stepmania: error while loading shared libraries: foo : cannot open shared object file: No such file or directory
then use
$ dnf whatprovides foo
to help figure out what runtime dependencies you are missing.
At this point you will likely want songs to use beyond the built-in samples. Fortunately, there are free tools available to build decently rhythmic step pattern files based on user-provided WAV files, so you do not need either to write your own pattern files or download "song packs" that include the pattern files but also dubiously include the songs themselves just to play other songs.
The above information is correct based on my current understanding. I am not a lawyer so I may have made a mistake that makes this process or its result still illegal in the US; use this guide at your own risk.