You may use sudo's -E option:
FMPEG=yes sudo -E sbopkg -B -i vice From the manual:
-E, --preserve-env
Indicates to the security policy that the user wishes to preserve their existing environment variables. The security policy may return an error if the user does not have permission to preserve the environment.
Note that this exports all your existing environment variables. It is safer to only export the environment variables you need with the following syntaxIt is safer to only export the environment variables you need with the following syntax:
sudo FMPEG=yes sbopkg -B -i vice sudo FMPEG=yes sbopkg -B -i vice