def compile( self, source_dir, build_dir, install_dir ): package_source_dir = os.path.join( source_dir, self.dirname ) assert( os.path.exists( package_source_dir ) ) package_build_dir = os.path.join( build_dir, self.dirname ) runpath_dir = os.path.join( package_source_dir, 'RunPath' ) if ( not os.path.exists( os.path.join( runpath_dir, 'media.zip' ) ) ): sh.cd( runpath_dir ) sh.wget( '--no-check-certificate', 'https://bitbucket.org/jacmoe/ogitor/downloads/media.zip' ) sh.unzip( 'media.zip' ) if ( not os.path.exists( os.path.join( runpath_dir, 'projects.zip' ) ) ): sh.cd( runpath_dir ) sh.wget( '--no-check-certificate', 'https://bitbucket.org/jacmoe/ogitor/downloads/projects.zip' ) sh.unzip( 'projects.zip' ) sh.mkdir( '-p', package_build_dir ) sh.cd( package_build_dir ) if ( platform.system() == 'Darwin' ): sh.cmake( '-G', 'Xcode', '-D', 'CMAKE_INSTALL_PREFIX=%s' % install_dir, '-D', 'CMAKE_MODULE_PATH=%s' % os.path.join( install_dir, 'CMake' ), package_source_dir, _out = sys.stdout ) sh.xcodebuild( '-configuration', 'Release', _out = sys.stdout ) else: sh.cmake( '-D', 'CMAKE_INSTALL_PREFIX=%s' % install_dir, '-D', 'CMAKE_MODULE_PATH=%s' % os.path.join( install_dir, 'lib/OGRE/cmake' ), package_source_dir, _out = sys.stdout ) sh.make( '-j4', 'VERBOSE=1', _out = sys.stdout ) sh.make.install( _out = sys.stdout )
def compile(self, source_dir, build_dir, install_dir): package_source_dir = os.path.join(source_dir, self.dirname) assert (os.path.exists(package_source_dir)) package_build_dir = os.path.join(build_dir, self.dirname) sh.mkdir('-p', package_build_dir) sh.cd(package_build_dir) if (platform.system() == 'Darwin'): sh.cmake('-G', 'Xcode', '-D', 'CMAKE_INSTALL_PREFIX=%s' % install_dir, package_source_dir, _out=sys.stdout) sh.xcodebuild('-scheme', 'install', '-configuration', 'Release', _out=sys.stdout) else: sh.cmake('-D', 'CMAKE_INSTALL_PREFIX=%s' % install_dir, package_source_dir, _out=sys.stdout) sh.make('-j4', 'VERBOSE=1', _out=sys.stdout) sh.make.install(_out=sys.stdout)
def compile( self, source_dir, build_dir, install_dir ): package_source_dir = os.path.join( source_dir, self.dirname ) assert( os.path.exists( package_source_dir ) ) package_build_dir = os.path.join( build_dir, self.dirname ) sh.cd( os.path.join( package_source_dir, 'scripts/Resources' ) ) sh.sh( './copyresources.sh' ) # the install target doesn't copy the stuff that copyresources.sh puts in place sh.cp( '-v', os.path.join( package_source_dir, 'bin/Release/Readme.txt' ), os.path.join( install_dir, 'Readme.meshy.txt' ) ) sh.cp( '-v', '-r', os.path.join( package_source_dir, 'bin/Release_Linux/Resources/' ), install_dir ) sh.mkdir( '-p', package_build_dir ) sh.cd( package_build_dir ) if ( platform.system() == 'Darwin' ): sh.cmake( '-G', 'Xcode', '-D', 'CMAKE_INSTALL_PREFIX=%s' % install_dir, '-D', 'CMAKE_MODULE_PATH=%s' % os.path.join( install_dir, 'CMake' ), package_source_dir, _out = sys.stdout ) sh.xcodebuild( '-configuration', 'Release', _out = sys.stdout ) else: sh.cmake( '-D', 'CMAKE_INSTALL_PREFIX=%s' % install_dir, '-D', 'CMAKE_MODULE_PATH=%s' % os.path.join( install_dir, 'lib/OGRE/cmake' ), package_source_dir, _out = sys.stdout ) sh.make( '-j4', 'VERBOSE=1', _out = sys.stdout ) sh.make.install( _out = sys.stdout )
def compile( self, source_dir, build_dir, install_dir ): package_source_dir = os.path.join( source_dir, self.dirname ) assert( os.path.exists( package_source_dir ) ) package_build_dir = os.path.join( build_dir, self.dirname ) sh.mkdir( '-p', package_build_dir ) sh.cd( package_build_dir ) if ( platform.system() == 'Darwin' ): sh.cmake( '-G', 'Xcode', '-D', 'CMAKE_INSTALL_PREFIX=%s' % install_dir, package_source_dir, _out = sys.stdout ) sh.xcodebuild( '-scheme', 'install', '-configuration', 'Release', _out = sys.stdout ) else: sh.cmake( '-D', 'CMAKE_INSTALL_PREFIX=%s' % install_dir, package_source_dir, _out = sys.stdout ) sh.make( '-j4', 'VERBOSE=1', _out = sys.stdout ) sh.make.install( _out = sys.stdout )
def compile(self, source_dir, build_dir, install_dir): package_source_dir = os.path.join(source_dir, self.dirname) assert (os.path.exists(package_source_dir)) package_build_dir = os.path.join(build_dir, self.dirname) sh.cd(os.path.join(package_source_dir, 'scripts/Resources')) sh.sh('./copyresources.sh') # the install target doesn't copy the stuff that copyresources.sh puts in place sh.cp('-v', os.path.join(package_source_dir, 'bin/Release/Readme.txt'), os.path.join(install_dir, 'Readme.meshy.txt')) sh.cp('-v', '-r', os.path.join(package_source_dir, 'bin/Release_Linux/Resources/'), install_dir) sh.mkdir('-p', package_build_dir) sh.cd(package_build_dir) if (platform.system() == 'Darwin'): sh.cmake('-G', 'Xcode', '-D', 'CMAKE_INSTALL_PREFIX=%s' % install_dir, '-D', 'CMAKE_MODULE_PATH=%s' % os.path.join(install_dir, 'CMake'), package_source_dir, _out=sys.stdout) sh.xcodebuild('-configuration', 'Release', _out=sys.stdout) else: sh.cmake('-D', 'CMAKE_INSTALL_PREFIX=%s' % install_dir, '-D', 'CMAKE_MODULE_PATH=%s' % os.path.join(install_dir, 'lib/OGRE/cmake'), package_source_dir, _out=sys.stdout) sh.make('-j4', 'VERBOSE=1', _out=sys.stdout) sh.make.install(_out=sys.stdout)
def __init__(self): super(Context, self).__init__() self.include_dirs = [] ok = True sdks = sh.xcodebuild("-showsdks").splitlines() # get the latest iphoneos iphoneos = [x for x in sdks if "iphoneos" in x] if not iphoneos: print("No iphone SDK installed") ok = False else: iphoneos = iphoneos[0].split()[-1].replace("iphoneos", "") self.sdkver = iphoneos # get the latest iphonesimulator version iphonesim = [x for x in sdks if "iphonesimulator" in x] if not iphonesim: ok = False print("Error: No iphonesimulator SDK installed") else: iphonesim = iphonesim[0].split()[-1].replace("iphonesimulator", "") self.sdksimver = iphonesim # get the path for Developer self.devroot = "{}/Platforms/iPhoneOS.platform/Developer".format( sh.xcode_select("-print-path").strip()) # path to the iOS SDK self.iossdkroot = "{}/SDKs/iPhoneOS{}.sdk".format( self.devroot, self.sdkver) # root of the toolchain self.root_dir = realpath(dirname(__file__)) self.build_dir = "{}/build".format(self.root_dir) self.cache_dir = "{}/.cache".format(self.root_dir) self.dist_dir = "{}/dist".format(self.root_dir) self.install_dir = "{}/dist/root".format(self.root_dir) self.include_dir = "{}/dist/include".format(self.root_dir) self.archs = ( ArchSimulator(self), Arch64Simulator(self), ArchIOS(self), Arch64IOS(self)) # path to some tools self.ccache = sh.which("ccache") if not self.ccache: #print("ccache is missing, the build will not be optimized in the future.") pass for cython_fn in ("cython-2.7", "cython"): cython = sh.which(cython_fn) if cython: self.cython = cython break if not self.cython: ok = False print("Missing requirement: cython is not installed") # check the basic tools for tool in ("pkg-config", "autoconf", "automake", "libtool"): if not sh.which(tool): print("Missing requirement: {} is not installed".format( tool)) if not ok: sys.exit(1) ensure_dir(self.root_dir) ensure_dir(self.build_dir) ensure_dir(self.cache_dir) ensure_dir(self.dist_dir) ensure_dir(self.install_dir) ensure_dir(self.include_dir) ensure_dir(join(self.include_dir, "common")) # remove the most obvious flags that can break the compilation self.env.pop("MACOSX_DEPLOYMENT_TARGET", None) self.env.pop("PYTHONDONTWRITEBYTECODE", None) self.env.pop("ARCHFLAGS", None) self.env.pop("CFLAGS", None) self.env.pop("LDFLAGS", None) # set the state self.state = JsonStore(join(self.dist_dir, "state.db"))