Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import shutil
from dockerfile import Dockerfile
class Windows(Dockerfile):
def __init__(self, arch, linktype='static'):
self.arch = arch
name = 'windows-{}'.format(arch)
mxe_prefix = '{}-w64-mingw32.{}'.format(arch, linktype)
configuration_file = 'configuration-windows-{}-{}.cmake'.format(arch, linktype)
self.cmake_binary = mxe_prefix + '-cmake'
self.os_family = 'windows'
substitutions = {
'CMAKE_BIN': self.cmake_binary,
'MXE_PREFIX': mxe_prefix,
'ARCH': arch,
'LINKTYPE': linktype,
'CMAKE_CACHE_INIT': configuration_file,
'PACKAGE_SYSTEM_NAME': 'Windows-' + arch,
}
import shutil
from dockerfile import Dockerfile
class LinuxBase(Dockerfile):
def __init__(self, snippet, flavour, version, arch, extra_snippets = [], extra_substitutions={}):
self.flavour = flavour
self.version = version
self.arch = arch
name = '{}-{}-{}'.format(flavour, version, arch)
base_image = '{}:{}'.format(flavour, version)
config_name = '{}-{}'.format(flavour, version)
self.cmake_binary = 'cmake'
self.os_family = 'linux'
if arch != 'x86_64':
base_image = arch + '/' + base_image
configuration_file = 'configuration-{}.cmake'.format(config_name)
substitutions = {