Welcome to mirror list, hosted at ThFree Co, Russian Federation.

monobjc.py « packages - github.com/mono/bockbuild.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 320ee7340b771545e924a972f221a5fb6c6ccc82 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
class MonobjcPackage (Package):
	def __init__ (self):
		Package.__init__ (self, 'Monobjc', '2.0.479.0', sources = [
			'http://downloads.monobjc.net/%{name}-%{version}.tar.gz',
			'patches/monobjc/Makefile',
			'patches/monobjc/nant-disable-native-enable-debug.patch',
			'patches/monobjc/remove-executable-path-dllimport.patch',
			'patches/monobjc/PkgConfigGenerator.cs'
		])

		self.dylib_compatibility_version = '2.0.0'
		self.dylib_current_version = '2.4.79'

	def prep (self):
		# Create and extract into top-level directory
		# since Monobjc is archived incorrectly
		self.sh ('mkdir "%{source_dir_name}"')
		self.cd ('%{source_dir_name}')
		self.sh ('tar xf "%{sources[0]}"')
		
		# Remove the binaries that come with the release
		self.sh ('rm -rf -- dist')

		# Install a proper Makefile that builds properly
		self.sh ('cp "%{sources[1]}" src/native/Monobjc/src')

		# Disable native and 1.0 profile builds in nant,
		# and enable debugging (produce .mdb files)
		self.sh ('patch -p1 < "%{sources[2]}"')

		# Remove the @executable_path/ prefix from the
		# DllImport attributes for libmonobjc.2.dylib
		self.sh ('patch -p1 < "%{sources[3]}"')

	def build (self):
		# Build the managed libraries
		self.sh ('nant build-libraries')

		# Build the native library
		self.pushd ('src/native/Monobjc/src')
		self.sh ('make COMPATIBILITY_VERSION=%{dylib_compatibility_version} CURRENT_VERSION=%{dylib_current_version}')
		self.popd ()

		# Build the pkg-config generator
		self.sh ('gmcs -out:pc-gen.exe "%{sources[4]}"')

	def install (self):
		# Install assemblies into the GAC, generate a pkg-config file
		self.sh ('mkdir -p "%{prefix}/share/pkgconfig"')
		for path in glob.glob ('dist/2.0/*.dll'):
			basename = os.path.basename (path)
			pkgconfig = os.path.splitext (basename)[0] + '.pc'
			self.sh ('gacutil -i -package Monobjc -root "%{prefix}/lib" "' +
				path + '"')
			self.sh ('mono pc-gen.exe "%{prefix}/lib/mono/Monobjc/' +
				basename + '" > "%{prefix}/share/pkgconfig/' + pkgconfig + '"')

		# Install native library into the standard lib dir
		self.sh ('cp "src/native/Monobjc/src/libmonobjc.2.dylib" "%{prefix}/lib"')

MonobjcPackage ()