At the time this question was asked, the Mussels tool was not yet open-sourced. The Mussels project has since been made public.
See: https://github.com/Cisco-Talos/Mussels
To build the ClamAV dependencies with Mussels on Windows, you will need the following tools:
Mussels dependencies:
- Python 3.6+
- Git (added to your PATH environment variable)
Build tools needed to build ClamAV's dependencies:
- Visual Studio 2017 (2019 may work, not sure)
- CMake
- ActivePerl (required for openssl)
- NASM (required for openssl)
Install Mussels:
pip install --user mussels
Important: Run the following in cmd.exe or powershell in an empty directory or in a small directory tree. Mussels will recursively index your current working directory looking for recipes. This will take a really long time if you run these commands from a large directory tree like your home directory.
mkdir clam_dependencies cd clam_dependencies
Update the Mussels cookbooks:
mussels update msl up # (shorthand)
Tip: If the mussels or msl commands don't work, you may not have the Python 3 scripts directory in your %PATH%. If you don't care to add it to your %PATH%, you can still execute Mussels with python -m mussels instead of using msl. Eg:
python -m mussels up
Enable trust for ClamAV's recipe cookbook so you can build the ClamAV recipes:
msl cookbook trust clamav -y
List available build recipes:
msl list msl list -V # (verbose)
Build ClamAV with Mussels for the current archicture
Perform a dry-run of the build. This will show you the dependency chain and may complain if you're missing any of the required tools:
msl build clamav -v 0.102 --dry-run
Build ClamAV. The optional --install <directory> option is used to install to .\clamav rather than the default %HOME%\.mussels\install\<target>\clamav:
msl build clamav -v 0.102 --install clamav
Or, build just the dependencies (for 64-bit and then 32-bit target architectures)
Build the ClamAV dependencies. The optional --install <directory> option is used to install them to .\x64 and .\x86 rather than the default %HOME%\.mussels\install\<target>:
msl build clamav_deps -v 0.102 --target x64 --install x64 msl build clamav_deps -v 0.102 --target x86 --install x86
Rename the x86 directory to Win32, so it matches the name expected by ClamAV's Visual Studio project file.
mv .\x86 .\Win32
Create an environment variable named CLAM_DEPENDENCIES and set the value to the full path of the clam_dependencies directory. Eg:
setx CLAM_DEPENDENCIES C:\Users\gary\clam_dependencies
At this point, you should be ready to build ClamAV on Windows using the Visual Studio project file.
I hope that helps! Please submit an issue on GitHub if you believe you've encountered a bug with Mussels https://github.com/Cisco-Talos/Mussels/issues or to https://github.com/Cisco-Talos/clamav-mussels-cookbook/issues if you think you've found an issue with the ClamAV build recipes.
There is a Mussels Discord server listed in the README if you want to ask questions.