[Vm-dev] VM Maker: CMakeVMMaker-IgorStasenko.205.mcz

commits at source.squeak.org commits at source.squeak.org
Thu May 30 13:37:48 UTC 2013


Igor Stasenko uploaded a new version of CMakeVMMaker to project VM Maker:
http://source.squeak.org/VMMaker/CMakeVMMaker-IgorStasenko.205.mcz

==================== Summary ====================

Name: CMakeVMMaker-IgorStasenko.205
Author: IgorStasenko
Time: 30 May 2013, 3:37:29.743 pm
UUID: 1387af88-274a-4677-83c3-fcce592e2bce
Ancestors: CMakeVMMaker-EstebanLorenzano.204

- change 3rd party libs download logic to try downloading from pharo file server first

=============== Diff against CMakeVMMaker-EstebanLorenzano.204 ===============

Item was changed:
  ----- Method: CMCairo>>unpack (in category 'generating actions') -----
  unpack
  	"produce commands for unpacking the library archive.
  	
  	the output of this command should use a directory
  	${workDir}/${libName}
  	where the unpacked library sources will be located.
  	
  	see #setVariables method for understanding what variables used here
  	
  	NOTE: had to override since cairo uses 7z compression
  	"
  
  	gen set: #unpackTarget toString: '${libSourcesDir}/touch.cmake'.
  	
  	gen puts:
  'add_custom_command(OUTPUT "${unpackTarget}"
+ 		COMMAND tar -Jxf "${archiveFileName}"  
- 		COMMAND tar -Jxf "${libName}.tgz" 
  		COMMAND touch "${unpackTarget}"
  		COMMENT "Unpacking ${libName} ... "
  	)
  '.
  !

Item was added:
+ ----- Method: CMThirdpartyLibrary>>archiveFileName (in category 'as yet unclassified') -----
+ archiveFileName
+ 	^ self downloadURL asUrl fileName !

Item was changed:
  ----- Method: CMThirdpartyLibrary>>download (in category 'generating actions') -----
  download
  
  	"Produce output to download library archive.
  	By default, we use .tgz extension.. since it is most often used by OSS.
  	Note, that we check if file is already present, to not download it every time
  	we build"	
  	
  	gen puts:
+ 'if (NOT EXISTS "${workDir}/${archiveFileName}")
+ 	Message("Downloading  ',self fileServerURL,'${archiveFileName}")
+ 
- 'if (NOT EXISTS "${workDir}/${libName}.tgz")
- 	Message("Downloading ${url} ....")
- 	Message("Into: ${workDir}/${libName}.tgz")
- 	
  	FILE(DOWNLOAD
+ 		', self fileServerURL , self archiveFileName ,'
+ 	 	"${workDir}/${archiveFileName}"
+ 		STATUS downloadStatus
- 		${url}
- 	 	"${workDir}/${libName}.tgz"
  		SHOW_PROGRESS
- 		EXPECTED_MD5 ${md5sum}
  	)
+ 	
+ 	LIST(GET downloadStatus 0 downloadError)
+ 	if (NOT downloadError EQUAL 0)
+ 		Message("File is missing on file server (', self fileServerURL,'), downloading from official repository...")
+ 		FILE(DOWNLOAD
+ 			${url}
+ 		 	"${workDir}/${archiveFileName}"
+ 			STATUS downloadStatus
+ 			SHOW_PROGRESS
+ 			EXPECTED_MD5 ${md5sum}
+ 		)
+ 		LIST(GET downloadStatus 0 downloadError)
+ 	endif ()
+ 	if (NOT downloadError EQUAL 0)
+ 		message(FATAL_ERROR "Cannot find/download the source file from:" ${url})
+ 	endif ()
+ 		
+ 	
+ endif ()
- endif (NOT EXISTS "${workDir}/${libName}.tgz")
  '!

Item was added:
+ ----- Method: CMThirdpartyLibrary>>fileServerURL (in category 'settings') -----
+ fileServerURL
+ 	"Base url to file server where all external libs sources stored"
+ 	^'http://files.pharo.org/vm/src/lib/'!

Item was changed:
  ----- Method: CMThirdpartyLibrary>>setVariables (in category 'generating actions') -----
  setVariables
  
  	gen
  		set: #libName toString: self canonicalName;
  		set: #workDir toString: '${thirdpartyDir}/${libName}';
  		set: #unpackedDirName toString: self unpackedDirName;
  		set: #libSourcesDir toString: '${workDir}/${unpackedDirName}';
  		set: #url toString: self downloadURL;
  		set: #md5sum toString: self archiveMD5Sum;
+ 		set: #archiveFileName toString: self archiveFileName;
  		set: #installPrefix toString: '${thirdpartyDir}/out'.!

Item was changed:
  ----- Method: CMThirdpartyLibrary>>unpack (in category 'generating actions') -----
  unpack
  	"produce commands for unpacking the library archive.
  	
  	the output of this command should use a directory
  	${workDir}/${libName}
  	where the unpacked library sources will be located.
  	
  	see #setVariables method for understanding what variables used here
  	"
  
  	gen set: #unpackTarget toString: '${libSourcesDir}/touch.cmake'.
  	
  	gen puts:
  'add_custom_command(OUTPUT "${unpackTarget}"
+ 		COMMAND tar -xzf "${archiveFileName}" 
- 		COMMAND tar -xzf "${libName}.tgz" 
  		COMMAND touch "${unpackTarget}"
  		COMMENT "Unpacking ${libName} ... "
  	)
  '.
  !

Item was changed:
+ ----- Method: CMWin32ZLib>>archiveMD5Sum (in category 'package properties') -----
- ----- Method: CMWin32ZLib>>archiveMD5Sum (in category 'as yet unclassified') -----
  archiveMD5Sum
  	"answer the MD5 checksum (in string) for downloaded library archive 
  	(to check that downloaded file is not corrupt).
  	
  	You can take this sum by issuing:
  	  md5 filename
  	from command line
  	"
  	^ '44d667c142d7cda120332623eab69f40'!

Item was changed:
+ ----- Method: CMWin32ZLib>>build (in category 'generating actions') -----
- ----- Method: CMWin32ZLib>>build (in category 'as yet unclassified') -----
  build
  
  '	COMMAND ./configure --prefix="${installPrefix}" --archs="-arch i386" '.
  	
  	gen 
  		puts: '
  add_custom_command(OUTPUT "${libzInstalled}"
  	COMMAND make -fwin32/Makefile.gcc 
  	COMMAND make install -fwin32/Makefile.gcc prefix="${installPrefix}" INCLUDE_PATH="${installPrefix}/include" LIBRARY_PATH="${installPrefix}/lib" BINARY_PATH="${installPrefix}/bin" SHARED_MODE=1
  	WORKING_DIRECTORY "${libSourcesDir}"
  	DEPENDS "${unpackTarget}"
  	COMMENT "Building ${libName}"
  )
  '
  !

Item was changed:
+ ----- Method: CMWin32ZLib>>copyArtefacts (in category 'generating actions') -----
- ----- Method: CMWin32ZLib>>copyArtefacts (in category 'as yet unclassified') -----
  copyArtefacts
  
  	self 
  		copy: '${libzInstalled}' 
  		to: '${externalModulesDir}/${libraryFileName}'
  !

Item was changed:
+ ----- Method: CMWin32ZLib>>defineAsTarget (in category 'generating actions') -----
- ----- Method: CMWin32ZLib>>defineAsTarget (in category 'as yet unclassified') -----
  defineAsTarget 
  	
  	gen puts:
  	'add_custom_target(', self buildTarget , '
  		DEPENDS 
  		"${externalModulesDir}/${libraryFileName}"
  	)'
  	
  		"${externalModulesDir}/${libraryFileName}"
  !

Item was changed:
+ ----- Method: CMWin32ZLib>>defineGlobalTargets (in category 'generating actions') -----
- ----- Method: CMWin32ZLib>>defineGlobalTargets (in category 'as yet unclassified') -----
  defineGlobalTargets 
  !

Item was changed:
+ ----- Method: CMWin32ZLib>>downloadURL (in category 'package properties') -----
- ----- Method: CMWin32ZLib>>downloadURL (in category 'as yet unclassified') -----
  downloadURL 
  	^ 'http://zlib.net/zlib-1.2.8.tar.gz'!

Item was changed:
+ ----- Method: CMWin32ZLib>>libraryFileName (in category 'package properties') -----
- ----- Method: CMWin32ZLib>>libraryFileName (in category 'as yet unclassified') -----
  libraryFileName
  	^ 'zlib1.dll'!

Item was changed:
+ ----- Method: CMWin32ZLib>>setVariables (in category 'generating actions') -----
- ----- Method: CMWin32ZLib>>setVariables (in category 'as yet unclassified') -----
  setVariables
  	super setVariables.
  	gen 
  		set: #libraryFileName to: self libraryFileName;
  		set: #libzInstalled toString: '${installPrefix}/bin/${libraryFileName}'.
  		!

Item was changed:
+ ----- Method: CMWin32ZLib>>unpackedDirName (in category 'package properties') -----
- ----- Method: CMWin32ZLib>>unpackedDirName (in category 'as yet unclassified') -----
  unpackedDirName
  	^ 'zlib-1.2.8'!



More information about the Vm-dev mailing list