1

I am trying to build ClamAV source code using visual studio 2017 the guide on ClamAV git says:

External library dependencies:

ClamAV relies on a handful of 3rd party libraries. In previous versions of ClamAV, most of these were copy-pasted into the win32/3rdparty directory, with the exception being OpenSSL.

In ClamAV 0.102, all of these libraries are now external to ClamAV and must be compiled ahead of time as DLLs (or for zlib, a static lib) and placed in the %CLAM_DEPENDENCIES% (typically C:\clam_dependencies) directory so the ClamAV Visual Studio project files can find them.

To build each of these libraries, we recommend using Mussels. Mussels is an open-source application dependency build tool that can build the correct version of each dependency using the build tools intended by the original library authors."

https://github.com/Cisco-Talos/clamav-devel/blob/dev/0.102/win32/README.md

But Mussels is not available anywhere. any other solution will be helpful also I tried adding the dependencies manually but the errors are still there.

Build Errors

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

1 Comment

Thank you @micah build completed successfully .

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.