diff options
author | Alexis Christoforides <alexis@thenull.net> | 2016-11-04 17:55:13 +0300 |
---|---|---|
committer | Alexis Christoforides <alexis@thenull.net> | 2016-11-04 18:31:25 +0300 |
commit | 147e97cb6dd501d6c837fdbd6f0c42b6463a463a (patch) | |
tree | b36a653d43a19ffe559a38a1e8cb73cdc8179616 /packaging/MacSDK | |
parent | befd4fa677adbac8b7a0d9353693797bfda66caf (diff) |
Rename 'bockbuild' to 'packaging' so that it can be home to other packaging code
Diffstat (limited to 'packaging/MacSDK')
39 files changed, 2116 insertions, 0 deletions
diff --git a/packaging/MacSDK/__init__.py b/packaging/MacSDK/__init__.py new file mode 100644 index 00000000000..e69de29bb2d --- /dev/null +++ b/packaging/MacSDK/__init__.py diff --git a/packaging/MacSDK/fsharp.py b/packaging/MacSDK/fsharp.py new file mode 100644 index 00000000000..9e5348975ee --- /dev/null +++ b/packaging/MacSDK/fsharp.py @@ -0,0 +1,24 @@ +class FsharpPackage(GitHubTarballPackage): + + def __init__(self): + GitHubTarballPackage.__init__(self, + 'fsharp', 'fsharp', + '4.0.1.9', + '0a6c66a8f18eb8a5c4d0bfac61d883b6994a918a', + configure='./configure --prefix="%{package_prefix}"') + + self.extra_stage_files = [ + 'lib/mono/xbuild/Microsoft/VisualStudio/v/FSharp/Microsoft.FSharp.Targets'] + + def prep(self): + Package.prep(self) + + for p in range(1, len(self.sources)): + self.sh('patch -p1 < "%{local_sources[' + str(p) + ']}"') + + def build(self): + self.sh('autoreconf') + Package.configure(self) + Package.make(self) + +FsharpPackage() diff --git a/packaging/MacSDK/gdk-pixbuf/0001-pixbuf-Add-getter-setter-for-the-2x-variants.patch b/packaging/MacSDK/gdk-pixbuf/0001-pixbuf-Add-getter-setter-for-the-2x-variants.patch new file mode 100644 index 00000000000..2ca1c6acb83 --- /dev/null +++ b/packaging/MacSDK/gdk-pixbuf/0001-pixbuf-Add-getter-setter-for-the-2x-variants.patch @@ -0,0 +1,56 @@ +From f6d2db5a0c105785ee6f03717966ef0dbb1421f6 Mon Sep 17 00:00:00 2001 +From: Carlos Garnacho <carlosg@gnome.org> +Date: Tue, 16 Jul 2013 10:32:11 +0200 +Subject: [PATCH] pixbuf: Add getter/setter for the 2x variants + +--- + gdk-pixbuf/gdk-pixbuf-core.h | 3 +++ + gdk-pixbuf/gdk-pixbuf.c | 22 ++++++++++++++++++++++ + 2 files changed, 25 insertions(+) + +diff --git a/gdk-pixbuf/gdk-pixbuf-core.h b/gdk-pixbuf/gdk-pixbuf-core.h +index eb4d0a1..60c4ea3 100644 +--- a/gdk-pixbuf/gdk-pixbuf-core.h ++++ b/gdk-pixbuf/gdk-pixbuf-core.h +@@ -474,6 +474,9 @@ GdkPixbuf *gdk_pixbuf_apply_embedded_orientation (GdkPixbuf *src); + const gchar * gdk_pixbuf_get_option (GdkPixbuf *pixbuf, + const gchar *key); + ++GdkPixbuf * gdk_pixbuf_get_hires_variant (GdkPixbuf *pixbuf); ++void gdk_pixbuf_set_hires_variant (GdkPixbuf *pixbuf, ++ GdkPixbuf *hires); + + G_END_DECLS + +diff --git a/gdk-pixbuf/gdk-pixbuf.c b/gdk-pixbuf/gdk-pixbuf.c +index 0e13f27..d61f2c7 100644 +--- a/gdk-pixbuf/gdk-pixbuf.c ++++ b/gdk-pixbuf/gdk-pixbuf.c +@@ -990,3 +990,25 @@ gdk_pixbuf_get_property (GObject *object, + break; + } + } ++ ++GdkPixbuf * ++gdk_pixbuf_get_hires_variant (GdkPixbuf *pixbuf) ++{ ++ g_return_val_if_fail (GDK_IS_PIXBUF (pixbuf), NULL); ++ ++ return g_object_get_data (G_OBJECT (pixbuf), ++ "gdk-pixbuf-2x-variant"); ++} ++ ++void ++gdk_pixbuf_set_hires_variant (GdkPixbuf *pixbuf, ++ GdkPixbuf *hires) ++{ ++ g_return_if_fail (GDK_IS_PIXBUF (pixbuf)); ++ g_return_if_fail (GDK_IS_PIXBUF (hires)); ++ ++ g_object_set_data_full (G_OBJECT (pixbuf), ++ "gdk-pixbuf-2x-variant", ++ g_object_ref (hires), ++ (GDestroyNotify) g_object_unref); ++} +-- +1.8.3.2 diff --git a/packaging/MacSDK/gdk-pixbuf/0001-pixbuf-load-2x-variants-as-pixbuf-gobject-data.patch b/packaging/MacSDK/gdk-pixbuf/0001-pixbuf-load-2x-variants-as-pixbuf-gobject-data.patch new file mode 100644 index 00000000000..80d3d399ef0 --- /dev/null +++ b/packaging/MacSDK/gdk-pixbuf/0001-pixbuf-load-2x-variants-as-pixbuf-gobject-data.patch @@ -0,0 +1,99 @@ +>From de5d91aa15cc98795a68c8e553eb4baadaa0e501 Mon Sep 17 00:00:00 2001 +From: Carlos Garnacho <carlosg@gnome.org> +Date: Fri, 17 May 2013 15:56:28 +0200 +Subject: [PATCH] pixbuf: load "@2x" variants as pixbuf gobject data + +if a variant of the filename is found that has a "@2x" appended +to the file name (before the extension), such file is loaded +and added as GObject data to the pixbuf +--- + gdk-pixbuf/gdk-pixbuf-io.c | 55 ++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 55 insertions(+) + +diff --git a/gdk-pixbuf/gdk-pixbuf-io.c b/gdk-pixbuf/gdk-pixbuf-io.c +index dac21b8..ed98cd3 100644 +--- a/gdk-pixbuf/gdk-pixbuf-io.c ++++ b/gdk-pixbuf/gdk-pixbuf-io.c +@@ -1025,6 +1025,40 @@ _gdk_pixbuf_generic_image_load (GdkPixbufModule *module, + return pixbuf; + } + ++static gboolean ++_gdk_pixbuf_file_is_scaled (const gchar *filename) ++{ ++ gchar *basename, *ext; ++ ++ basename = g_path_get_basename (filename); ++ ext = strrchr (basename, '.'); ++ ++ if (!ext) ++ ext = &basename[strlen(basename)]; ++ ++ if (ext > basename + 3 && strncmp (ext - 3, "@2x", 3) == 0) ++ return TRUE; ++ ++ return FALSE; ++} ++ ++static gchar * ++_gdk_pixbuf_compose_scaled_filename (const gchar *filename) ++{ ++ gchar *ext, *first, *composed; ++ ++ ext = strrchr (filename, '.'); ++ ++ if (!ext) ++ return NULL; ++ ++ first = g_strndup (filename, ext - filename); ++ composed = g_strdup_printf ("%s@2x%s", first, ext); ++ g_free (first); ++ ++ return composed; ++} ++ + /** + * gdk_pixbuf_new_from_file: + * @filename: Name of file to load, in the GLib file name encoding +@@ -1049,11 +1083,13 @@ gdk_pixbuf_new_from_file (const char *filename, + guchar buffer[SNIFF_BUFFER_SIZE]; + GdkPixbufModule *image_module; + gchar *display_name; ++ gboolean filename_is_scaled; + + g_return_val_if_fail (filename != NULL, NULL); + g_return_val_if_fail (error == NULL || *error == NULL, NULL); + + display_name = g_filename_display_name (filename); ++ filename_is_scaled = _gdk_pixbuf_file_is_scaled (filename); + + f = g_fopen (filename, "rb"); + if (!f) { +@@ -1097,6 +1133,25 @@ gdk_pixbuf_new_from_file (const char *filename, + pixbuf = _gdk_pixbuf_generic_image_load (image_module, f, error); + fclose (f); + ++ if (pixbuf && !filename_is_scaled) { ++ GdkPixbuf *scaled_pixbuf = NULL; ++ gchar *scaled_filename; ++ ++ scaled_filename = _gdk_pixbuf_compose_scaled_filename (filename); ++ ++ if (scaled_filename) { ++ scaled_pixbuf = gdk_pixbuf_new_from_file (scaled_filename, NULL); ++ g_free (scaled_filename); ++ } ++ ++ if (scaled_pixbuf) { ++ g_object_set_data_full (G_OBJECT (pixbuf), ++ "gdk-pixbuf-2x-variant", ++ scaled_pixbuf, ++ (GDestroyNotify) g_object_unref); ++ } ++ } ++ + if (pixbuf == NULL && error != NULL && *error == NULL) { + + /* I don't trust these crufty longjmp()'ing image libs +-- +1.8.3.rc1 diff --git a/packaging/MacSDK/gtkrc b/packaging/MacSDK/gtkrc new file mode 100644 index 00000000000..b1168d69d3f --- /dev/null +++ b/packaging/MacSDK/gtkrc @@ -0,0 +1,216 @@ +include "/Library/Frameworks/Mono.framework/Versions/Current/share/themes/Clearlooks/gtk-2.0/gtkrc" +#gtk-icon-theme-name = "OSX" +gtk-icon-theme-name = "Tango" +gtk_color_scheme = "fg_color:#222\nbg_color:#e6e6e6\nbase_color:#f9f9f9\ntext_color:#222\nselected_bg_color:#788ab0\nselected_fg_color:#fff" +gtk-menu-popup-delay = 1 +gtk-button-images = 0 +gtk-menu-images = 0 +gtk-enable-mnemonics = 0 + +style "theme-default" +{ + GtkButton ::default_border = { 0, 0, 0, 0 } + GtkRange ::trough_border = 0 + GtkPaned ::handle_size = 8 + GtkRange ::slider_width = 15 + GtkRange ::stepper_size = 15 + GtkScrollbar ::min_slider_length = 30 + GtkCheckButton ::indicator_size = 14 + GtkMenuBar ::internal-padding = 0 + GtkTreeView ::expander_size = 12 + GtkExpander ::expander_size = 14 + + xthickness = 2 + ythickness = 2 + + fg[NORMAL] = @fg_color #"#000000" # black + fg[PRELIGHT] = @fg_color #"#000000" # black + fg[SELECTED] = @selected_fg_color #"#ffffff" # white + fg[ACTIVE] = @fg_color #"#000000" # black + fg[INSENSITIVE] = darker (@bg_color) #"#b5b3ac" # dark beige + + bg[NORMAL] = @bg_color # "#ede9e3" + bg[PRELIGHT] = shade (1.02, @bg_color) #"#f9f7f3" # very light beige + bg[SELECTED] = @selected_bg_color # "#5598d7" # deepsky + bg[INSENSITIVE] = @bg_color # "#efebe5" # beige + bg[ACTIVE] = shade (0.9, @bg_color) #"#dcd4c9" #"#d7d3ca" # dark beige + + base[NORMAL] = @base_color # "#ffffff" # white + base[PRELIGHT] = shade (0.95, @bg_color) # "#5f8ec4" # dark beige + base[ACTIVE] = shade (0.9, @selected_bg_color) # "#a69f91" # darker deepsky + base[SELECTED] = @selected_bg_color # "#5598d7" # deepsky + base[INSENSITIVE] = @bg_color # "#e8e5de" # beige + + text[NORMAL] = @text_color # "#000000" # black + text[PRELIGHT] = @text_color # "#000000" # black + text[ACTIVE] = @selected_fg_color # "#ffffff" # white + text[SELECTED] = @selected_fg_color # "#ffffff" # white + text[INSENSITIVE] = darker (@bg_color) # "#b5b3ac" # dark beige + + engine "clearlooks" { + style = GUMMY # gummy look + toolbarstyle = 0 # flat toolbars + animation = TRUE # animated progressbars + menubarstyle = 2 # rounded menus + colorize_scrollbar = TRUE # colored slider + } + + font = "Lucida Grande 14" +} + +style "theme-wide" = "theme-default" +{ + xthickness = 3 + ythickness = 3 +} + +style "theme-text" = "theme-default" +{ + #base[SELECTED] = "#fc9747" # Outline? +} + +style "theme-toolbar" = "theme-default" +{ + #top and bottom border + bg[NORMAL] = @bg_color +} + +style "theme-scrollbar" = "theme-default" +{ + bg[SELECTED] = shade (1.1, @selected_bg_color) +} + +style "theme-tasklist" = "theme-default" +{ + xthickness = 5 + ythickness = 3 +} + +style "theme-menu" = "theme-default" +{ + xthickness = 3 + ythickness = 3 + bg[NORMAL] = shade (1.1,@bg_color) +} + +style "theme-menu-item" = "theme-default" +{ + xthickness = 2 + ythickness = 4 + fg[PRELIGHT] = @selected_fg_color + text[PRELIGHT] = @selected_fg_color + base[PRELIGHT] = @selected_bg_color # Selection color +} + +style "theme-menu-itembar" = "theme-default" +{ + xthickness = 0 + ythickness = 0 +} + +style "theme-tree" = "theme-default" +{ + xthickness = 2 + ythickness = 2 + GtkTreeView::odd-row-color = shade(0.9, @base_color) + GtkTreeView::even-row-color = @base_color +} + +style "theme-frame-title" = "theme-default" +{ + #fg[NORMAL] = "#f00" #button frames +} + +style "theme-tooltips" = "theme-default" +{ + xthickness = 4 + ythickness = 4 + bg[NORMAL] = { 1.0,1.0,0.75 } +} + +style "theme-progressbar" = "theme-default" +{ + xthickness = 1 + ythickness = 1 + fg[PRELIGHT] = @base_color +} + +style "theme-combo" = "theme-default" +{ + xthickness = 2 + ythickness = 4 +} + +style "theme-button" = "theme-wide" +{ + bg[NORMAL] = @bg_color + bg[PRELIGHT] = shade (1.1, @bg_color) + bg[ACTIVE] = shade (0.9, @bg_color) + #xthickness = 4 + #ythickness = 2 +} + +style "theme-check" = "theme-button" +{ +} + +style "theme-panel" = "theme-default" +{ + xthickness = 3 + ythickness = 3 + bg[ACTIVE] = shade (1.1, @selected_bg_color) + fg[ACTIVE] = @selected_fg_color +} + +style "theme-notebook" = "theme-wide" +{ + base[SELECTED] = @selected_bg_color # Tab selection color + bg[ACTIVE] = shade(0.9, @bg_color) # Unselected tabs + +# engine "clearlooks" { +# style = CLASSIC +# } +} + +# widget styles +class "GtkWidget" style "theme-default" +class "GtkButton" style "theme-button" +class "GtkCombo" style "theme-button" +class "GtkRange" style "theme-wide" +class "GtkFrame" style "theme-wide" +class "GtkMenu" style "theme-menu" +class "GtkEntry" style "theme-button" +class "GtkMenuItem" style "theme-menu-item" +class "GtkStatusbar" style "theme-wide" +class "GtkNotebook" style "theme-notebook" +class "GtkProgressBar" style "theme-progressbar" +class "GtkCheckButton" style "theme-check" +class "GtkRadioButton" style "theme-check" +class "GtkToolbar" style "theme-toolbar" + +widget_class "*MenuItem.*" style "theme-menu-item" + +# combobox stuff +widget_class "*.GtkComboBox.GtkButton" style "theme-combo" +widget_class "*.GtkCombo.GtkButton" style "theme-combo" + +# tooltips stuff +widget_class "*.tooltips.*.GtkToggleButton" style "theme-tasklist" +widget "gtk-tooltips" style "theme-tooltips" + +# treeview stuff +widget "*GtkTreeView*" style "theme-tree" +widget_class "*.GtkTreeView.GtkButton" style "theme-tree" +widget_class "*.GtkCTree.GtkButton" style "theme-tree" +widget_class "*.GtkList.GtkButton" style "theme-tree" +widget_class "*.GtkCList.GtkButton" style "theme-tree" +widget_class "*.GtkFrame.GtkLabel" style "theme-frame-title" + +# notebook stuff +widget_class "*.GtkNotebook.*.GtkEventBox" style "theme-notebook" +widget_class "*.GtkNotebook.*.GtkViewport" style "theme-notebook" + +# scrollbar stuff +class "GtkScrollbar" style "theme-scrollbar" + +gtk-font-name = "Lucida Grande 12" diff --git a/packaging/MacSDK/ironlangs.py b/packaging/MacSDK/ironlangs.py new file mode 100644 index 00000000000..0d4e336a879 --- /dev/null +++ b/packaging/MacSDK/ironlangs.py @@ -0,0 +1,66 @@ +import os +import string + + +class IronLanguagesPackage(GitHubTarballPackage): + + def __init__(self): + GitHubTarballPackage.__init__(self, + 'IronLanguages', 'iron-languages', + '2.11', + 'de63773744ccf9873c1826470730ae0446fd64d7', + configure='') + + # override: avoid naming the package 'main' because of the repo name + self.sources = [ + 'https://github.com/%{organization}/main/tarball/%{revision}'] + self.source_dir_name = '%s-%s-%s' % ( + self.organization, 'main', self.revision[:7]) + + def build(self): + self.ironruby = os.path.join( + self.workspace, 'ironruby', 'bin') + os.sep + self.ironpython = os.path.join( + self.workspace, 'ironpython', 'bin') + os.sep + self.sh( + 'xbuild /p:Configuration=Release /p:OutDir="%{ironruby}" Solutions/Ruby.sln') + self.sh( + 'xbuild /p:Configuration=Release /p:OutDir="%{ironpython}" Solutions/IronPython.Mono.sln') + + def install_ruby_scripts(self, path, installdir): + for cmd, ext in map(os.path.splitext, os.listdir(path)): + if ext != '.exe': + continue + wrapper = os.path.join(self.staged_prefix, "bin", cmd) + with open(wrapper, "w") as output: + output.write("#!/bin/sh\n") + output.write( + "exec {0}/bin/mono {0}/lib/{1}/{2}.exe \"$@\"\n".format( + self.staged_prefix, installdir, cmd)) + os.chmod(wrapper, 0o755) + + def install_python_scripts(self, path, installdir): + for cmd, ext in map(os.path.splitext, os.listdir(path)): + if ext != '.exe': + continue + wrapper = os.path.join(self.staged_prefix, "bin", cmd) + with open(wrapper, "w") as output: + output.write("#!/bin/sh\n") + output.write( + 'export IRONPYTHONPATH=/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/\n') + output.write( + "exec {0}/bin/mono {0}/lib/{1}/{2}.exe \"$@\"\n".format( + self.staged_prefix, installdir, cmd)) + os.chmod(wrapper, 0o755) + + def install(self): + self.sh("mkdir -p %{staged_prefix}/lib/ironruby/") + self.sh("mkdir -p %{staged_prefix}/bin/") + self.sh("cp -R %{ironruby} %{staged_prefix}/lib/ironruby/") + self.install_ruby_scripts(self.ironruby, 'ironruby') + + self.sh("mkdir -p %{staged_prefix}/lib/ironpython/") + self.sh("cp -R %{ironpython} %{staged_prefix}/lib/ironpython/") + self.install_python_scripts(self.ironpython, 'ironpython') + +IronLanguagesPackage() diff --git a/packaging/MacSDK/libgdiplus.py b/packaging/MacSDK/libgdiplus.py new file mode 100644 index 00000000000..e40baac24a6 --- /dev/null +++ b/packaging/MacSDK/libgdiplus.py @@ -0,0 +1,8 @@ +GitHubTarballPackage( + 'mono', + 'libgdiplus', + '2.11', + '4e7ab0f555a13a6b2f954c714c4ee5213954ff79', + configure='CFLAGS="%{gcc_flags} %{local_gcc_flags} -I/opt/X11/include" ./autogen.sh --prefix="%{package_prefix}"', + override_properties={ + 'make': 'C_INCLUDE_PATH="" make'}) diff --git a/packaging/MacSDK/mono-basic.py b/packaging/MacSDK/mono-basic.py new file mode 100644 index 00000000000..ffdbde07da9 --- /dev/null +++ b/packaging/MacSDK/mono-basic.py @@ -0,0 +1,12 @@ + +class MonoBasicPackage (GitHubTarballPackage): + + def __init__(self): + GitHubTarballPackage.__init__(self, 'mono', 'mono-basic', '4.6', 'c93133db1d511f994918391f429fee29b9250004', + configure='./configure --prefix="%{staged_profile}"') + + def install(self): + self.sh('./configure --prefix="%{staged_prefix}"') + self.sh('make install') + +MonoBasicPackage() diff --git a/packaging/MacSDK/mono-llvm.py b/packaging/MacSDK/mono-llvm.py new file mode 100644 index 00000000000..cf9e89ba9bd --- /dev/null +++ b/packaging/MacSDK/mono-llvm.py @@ -0,0 +1,35 @@ +import os + + +class MonoLlvmPackage (GitHubPackage): + + def __init__(self): + GitHubPackage.__init__(self, 'mono', 'llvm', '3.0', + revision='8b1520c8aae53e219cf80cdc0f02ad96600887d6', + configure_flags=[ + '--enable-optimized', + '--enable-assertions=no', + '--enable-targets="x86,x86_64"'] + ) + + # This package would like to be lipoed. + self.needs_lipo = True + + # TODO: find out which flags are causing issues. reset ld_flags for the + # package + self.ld_flags = [] + self.cpp_flags = [] + + def arch_build(self, arch): + if arch == 'darwin-64': # 64-bit build pass + self.local_configure_flags = ['--build=x86_64-apple-darwin11.2.0'] + + if arch == 'darwin-32': + self.local_configure_flags = ['--build=i386-apple-darwin11.2.0'] + + # LLVM says that libstdc++4.6 is broken and we should use libstdc++4.7. + # This switches it to the right libstdc++. + if Package.profile.name == 'darwin': + self.local_configure_flags.extend(['--enable-libcpp=yes']) + +MonoLlvmPackage() diff --git a/packaging/MacSDK/mono.py b/packaging/MacSDK/mono.py new file mode 100644 index 00000000000..8b9f6b3a6fc --- /dev/null +++ b/packaging/MacSDK/mono.py @@ -0,0 +1,99 @@ +import os +import re + +from bockbuild.package import Package +from bockbuild.util.util import * + + +class MonoMasterPackage(Package): + + def __init__(self): + Package.__init__(self, 'mono', None, + sources=[ + Package.profile.git_root], + git_branch=os.getenv('MONO_BRANCH') or None, + revision=os.getenv('MONO_BUILD_REVISION'), + configure_flags=[ + '--enable-nls=no', + '--with-ikvm=yes' + ] + ) + self.source_dir_name = 'mono' + # This package would like to be lipoed. + self.needs_lipo = True + + # Don't clean the workspace, so we can run 'make check' afterwards + self.dont_clean = True + + if Package.profile.name == 'darwin': + self.configure_flags.extend([ + '--with-libgdiplus=%s/lib/libgdiplus.dylib' % Package.profile.staged_prefix, + '--enable-loadedllvm', + 'CXXFLAGS=-stdlib=libc++' + ]) + + self.sources.extend([ + # Fixes up pkg-config usage on the Mac + 'patches/mcs-pkgconfig.patch' + ]) + else: + self.configure_flags.extend([ + '--with-libgdiplus=%s/lib/libgdiplus.so' % Package.profile.staged_prefix + ]) + + self.gcc_flags.extend(['-O2']) + + self.configure = './autogen.sh --prefix="%{package_prefix}"' + + self.extra_stage_files = ['etc/mono/config'] + + def build(self): + self.make = '%s EXTERNAL_MCS=%s EXTERNAL_RUNTIME=%s' % ( + self.make, self.profile.env.system_mcs, self.profile.env.system_mono) + Package.build(self) + + def prep(self): + Package.prep(self) + for p in range(1, len(self.local_sources)): + self.sh('patch -p1 < "%{local_sources[' + str(p) + ']}"') + + def arch_build(self, arch): + if arch == 'darwin-64': # 64-bit build pass + self.local_gcc_flags = ['-m64'] + self.local_configure_flags = ['--build=x86_64-apple-darwin11.2.0'] + + if arch == 'darwin-32': # 32-bit build pass + self.local_gcc_flags = ['-m32'] + self.local_configure_flags = ['--build=i386-apple-darwin11.2.0'] + + self.local_configure_flags.extend( + ['--cache-file=%s/%s-%s.cache' % (self.profile.bockbuild.build_root, self.name, arch)]) + + def install(self): + Package.install(self) + + registry_dir = os.path.join( + self.staged_prefix, + "etc", + "mono", + "registry", + "LocalMachine") + ensure_dir(registry_dir) + + # Add ImportBefore/ImportAfter files from xbuild to the msbuild + # directories + xbuild_dir = os.path.join(self.staged_prefix, 'lib/mono/xbuild') + new_xbuild_tv_dir = os.path.join(xbuild_dir, self.version) + os.makedirs(new_xbuild_tv_dir) + + self.sh('cp -R %s/14.0/Imports %s' % (xbuild_dir, new_xbuild_tv_dir)) + self.sh( + 'cp -R %s/14.0/Microsoft.Common.targets %s' % + (xbuild_dir, new_xbuild_tv_dir)) + + def deploy(self): + if bockbuild.cmd_options.arch == 'darwin-universal': + os.symlink('mono-sgen64', '%s/bin/mono64' % self.staged_profile) + os.symlink('mono-sgen32', '%s/bin/mono32' % self.staged_profile) + +MonoMasterPackage() diff --git a/packaging/MacSDK/msbuild.py b/packaging/MacSDK/msbuild.py new file mode 100644 index 00000000000..0e16af1fa79 --- /dev/null +++ b/packaging/MacSDK/msbuild.py @@ -0,0 +1,44 @@ +import fileinput + + +class MSBuild (GitHubPackage): + + def __init__(self): + GitHubPackage.__init__(self, 'mono', 'msbuild', '15.0', + git_branch='xplat-c8p') + + def build(self): + self.sh('./cibuild.sh --scope Compile --target Mono --host Mono') + + def install(self): + # adjusted from 'install-mono-prefix.sh' + + build_output = 'bin/Debug-MONO/OSX_Deployment' + new_location = os.path.join( + self.staged_prefix, + 'lib/mono/msbuild/%s/bin' % + self.version) + bindir = os.path.join(self.staged_prefix, 'bin') + + os.makedirs(new_location) + self.sh('cp -R %s/* %s' % (build_output, new_location)) + + os.makedirs(bindir) + + self.sh('cp msbuild-mono-deploy.in %s/msbuild' % bindir) + + for line in fileinput.input('%s/msbuild' % bindir, inplace=True): + line = line.replace('@bindir@', '%s/bin' % self.staged_prefix) + line = line.replace( + '@mono_instdir@', + '%s/lib/mono' % + self.staged_prefix) + print line + + for excluded in glob.glob("%s/*UnitTests*" % new_location): + self.rm(excluded) + + for excluded in glob.glob("%s/*xunit*" % new_location): + self.rm(excluded) + +MSBuild() diff --git a/packaging/MacSDK/nuget.py b/packaging/MacSDK/nuget.py new file mode 100644 index 00000000000..321bedfa12d --- /dev/null +++ b/packaging/MacSDK/nuget.py @@ -0,0 +1,18 @@ + +class NuGetPackage(GitHubPackage): + + def __init__(self): + GitHubPackage.__init__(self, + 'mono', 'nuget', + '2.12.0', + '9e2d2c1cc09d2a40eeb72e8c5db789e3b9bf2586', + configure='') + + def build(self): + self.sh('%{make} update_submodules') + self.sh('%{make} PREFIX=%{package_prefix}') + + def install(self): + self.sh('%{makeinstall} PREFIX=%{staged_prefix}') + +NuGetPackage() diff --git a/packaging/MacSDK/packaging/Info.plist b/packaging/MacSDK/packaging/Info.plist new file mode 100644 index 00000000000..8c3799d978a --- /dev/null +++ b/packaging/MacSDK/packaging/Info.plist @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>CFBundleGetInfoString</key> + <string>@@MONO_VERSION_RELEASE@@</string> + <key>CFBundleIdentifier</key> + <string>com.ximian.mono-@@MONO_VERSION@@</string> + <key>CFBundleName</key> + <string>Mono.framework</string> + <key>CFBundleShortVersionString</key> + <string>@@MONO_VERSION@@</string> + <key>IFPkgFlagAllowBackRev</key> + <true/> + <key>IFPkgFlagAuthorizationAction</key> + <string>AdminAuthorization</string> + <key>IFPkgFlagDefaultLocation</key> + <string>/</string> + <key>IFPkgFlagInstallFat</key> + <false/> + <key>IFPkgFlagIsRequired</key> + <false/> + <key>IFPkgFlagRelocatable</key> + <false/> + <key>IFPkgFlagRestartAction</key> + <string>NoRestart</string> + <key>IFPkgFlagRootVolumeOnly</key> + <true/> + <key>IFPkgFlagUpdateInstalledLanguages</key> + <false/> + <key>IFPkgFormatVersion</key> + <real>0.10000000149011612</real> +</dict> +</plist> diff --git a/packaging/MacSDK/packaging/Info_sdk.plist b/packaging/MacSDK/packaging/Info_sdk.plist new file mode 100644 index 00000000000..7d75b1a0a76 --- /dev/null +++ b/packaging/MacSDK/packaging/Info_sdk.plist @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>CFBundleGetInfoString</key> + <string>@@MONO_VERSION_RELEASE@@</string> + <key>CFBundleIdentifier</key> + <string>com.ximian.mono-@@MONO_VERSION@@-csdk</string> + <key>CFBundleName</key> + <string>Mono.framework</string> + <key>CFBundleShortVersionString</key> + <string>@@MONO_VERSION@@</string> + <key>IFPkgFlagAllowBackRev</key> + <true/> + <key>IFPkgFlagAuthorizationAction</key> + <string>AdminAuthorization</string> + <key>IFPkgFlagDefaultLocation</key> + <string>/</string> + <key>IFPkgFlagInstallFat</key> + <false/> + <key>IFPkgFlagIsRequired</key> + <false/> + <key>IFPkgFlagRelocatable</key> + <false/> + <key>IFPkgFlagRestartAction</key> + <string>NoRestart</string> + <key>IFPkgFlagRootVolumeOnly</key> + <true/> + <key>IFPkgFlagUpdateInstalledLanguages</key> + <false/> + <key>IFPkgFormatVersion</key> + <real>0.10000000149011612</real> +</dict> +</plist> diff --git a/packaging/MacSDK/packaging/mdk_blacklist.sh b/packaging/MacSDK/packaging/mdk_blacklist.sh new file mode 100755 index 00000000000..ab426a7c952 --- /dev/null +++ b/packaging/MacSDK/packaging/mdk_blacklist.sh @@ -0,0 +1,135 @@ +#!/bin/bash + +if test x$1 = x; then + echo usage is cleanup MONODIR + exit 1 +fi + +MONODIR=$1 + +cd $MONODIR +rm -rf lib/gtk-2.0/2.10.0/engines/libcrux-engine.so +rm -rf lib/gtk-2.0/2.10.0/engines/libglide.so +rm -rf lib/gtk-2.0/2.10.0/engines/libhcengine.so +rm -rf lib/gtk-2.0/2.10.0/engines/libindustrial.so +rm -rf lib/gtk-2.0/2.10.0/engines/libmist.so +rm -rf lib/gtk-2.0/2.10.0/engines/libpixmap.so +rm -rf lib/gtk-2.0/2.10.0/engines/libredmond95.so +rm -rf lib/gtk-2.0/2.10.0/engines/libthinice.so +rm -rf gtk-2.0/modules/libferret.* +rm -rf gtk-2.0/modules/libgail.* +rm -rf share/gtk-2.0/demo/* +rm -rf share/man/man1/oldmono.1 +rm -rf share/themes/Crux +rm -rf share/themes/Default +rm -rf share/themes/Emacs +rm -rf share/themes/Industrial +rm -rf share/themes/Mist +rm -rf share/themes/Raleigh +rm -rf share/themes/Redmond +rm -rf share/themes/ThinIce +rm -rf share/info +rm -rf share/icons/gnome +rm -rf share/icons/hicolor +rm -rf share/gtk-doc +rm -rf share/gettext/*.class +rm -rf share/doc +rm -rf share/emacs +rm -rf share/strings +rm -rf share/pixmaps +rm -rf share/intltool +rm -rf var/cache/fontconfig + +# delete most of the *.a files +rm -rf lib/cairo/libcairo-trace.a +rm -rf lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-svg.a +rm -rf lib/gtk-2.0/2.10.0/engines/libsvg.a +rm -rf lib/libCompilerDriver.a +rm -rf lib/libEnhancedDisassembly.a +rm -rf lib/libLLVMAnalysis.a +rm -rf lib/libLLVMArchive.a +rm -rf lib/libLLVMAsmParser.a +rm -rf lib/libLLVMAsmPrinter.a +rm -rf lib/libLLVMBitReader.a +rm -rf lib/libLLVMBitWriter.a +rm -rf lib/libLLVMCodeGen.a +rm -rf lib/libLLVMCore.a +rm -rf lib/libLLVMExecutionEngine.a +rm -rf lib/libLLVMInstCombine.a +rm -rf lib/libLLVMInstrumentation.a +rm -rf lib/libLLVMInterpreter.a +rm -rf lib/libLLVMJIT.a +rm -rf lib/libLLVMLinker.a +rm -rf lib/libLLVMMC.a +rm -rf lib/libLLVMMCDisassembler.a +rm -rf lib/libLLVMMCJIT.a +rm -rf lib/libLLVMMCParser.a +rm -rf lib/libLLVMObject.a +rm -rf lib/libLLVMScalarOpts.a +rm -rf lib/libLLVMSelectionDAG.a +rm -rf lib/libLLVMSupport.a +rm -rf lib/libLLVMTarget.a +rm -rf lib/libLLVMTransformUtils.a +rm -rf lib/libLLVMX86AsmParser.a +rm -rf lib/libLLVMX86AsmPrinter.a +rm -rf lib/libLLVMX86CodeGen.a +rm -rf lib/libLLVMX86Disassembler.a +rm -rf lib/libLLVMX86Info.a +rm -rf lib/libLLVMipa.a +rm -rf lib/libLLVMipo.a +rm -rf lib/libLTO.a +# rm -rf lib/libMonoPosixHelper.a +# rm -rf lib/libMonoSupportW.a +rm -rf lib/libUnitTestMain.a +rm -rf lib/libatksharpglue-2.a +rm -rf lib/libcairo-gobject.a +rm -rf lib/libcairo-script-interpreter.a +rm -rf lib/libcairo.a +rm -rf lib/libcroco-0.6.a +rm -rf lib/libexpat.a +rm -rf lib/libffi.a +rm -rf lib/libfontconfig.a +rm -rf lib/libfreetype.a +rm -rf lib/libgdiplus.a +rm -rf lib/libgdksharpglue-2.a +rm -rf lib/libgettextpo.a +rm -rf lib/libgif.a +rm -rf lib/libglade-2.0.a +rm -rf lib/libgladesharpglue-2.a +rm -rf lib/libglibsharpglue-2.a +rm -rf lib/libgtksharpglue-2.a +rm -rf lib/libikvm-native.a +rm -rf lib/libintl.a +rm -rf lib/libjpeg.a +rm -rf lib/liblzma.a +# rm -rf lib/libmono-2.0.a +# rm -rf lib/libmono-llvm.a +# rm -rf lib/libmono-profiler-aot.a +# rm -rf lib/libmono-profiler-cov.a +# rm -rf lib/libmono-profiler-iomap.a +# rm -rf lib/libmono-profiler-log.a +# rm -rf lib/libmonosgen-2.0.a +rm -rf lib/libpangosharpglue-2.a +rm -rf lib/libpixman-1.a +rm -rf lib/libpng.a +rm -rf lib/libpng14.a +rm -rf lib/librsvg-2.a +rm -rf lib/libsqlite3.a +rm -rf lib/libtiff.a +rm -rf lib/libtiffxx.a +rm -rf lib/libxml2.a + +# we don't need any of the llvm executables except llc and opt +rm -rf bin/bugpoint +rm -rf bin/lli +rm -rf bin/llvm-* +rm -rf bin/macho-dump +rm -rf bin/ccache + +# +# 14:39 <baulig> the install script needs to be modified not to +# install .mdb's for these +# 14:39 <baulig> System.Windows.dll, System.Xml.Serialization.dll and +# everything in Facades + +find ./lib/mono/4.5/Facades -name "*.mdb" -delete diff --git a/packaging/MacSDK/packaging/resources/License.rtf b/packaging/MacSDK/packaging/resources/License.rtf new file mode 100644 index 00000000000..ab13fe4cf4d --- /dev/null +++ b/packaging/MacSDK/packaging/resources/License.rtf @@ -0,0 +1,26 @@ +{\rtf1\mac\ansicpg10000\cocoartf102 +{\fonttbl\f0\fswiss\fcharset77 Helvetica;} +{\colortbl;\red255\green255\blue255;} +\margl1440\margr1440\vieww9000\viewh9000\viewkind0 +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural + +\f0\fs24 \cf0 The software included in the package is licensed under several different agreements.\ +\ +MIT License:\ +\ +http://www.opensource.org/licenses/mit-license.php\ +\ +LGPL:\ +\ +http://www.opensource.org/licenses/lgpl-2.1.php\ +\ +GPL:\ +\ +http://www.opensource.org/licenses/gpl-2.0.php\ +\ +You can develop commercial applications and redistribute the code in this package. +You only need to obtain a commercial license if you wish to make changes to Mono or +if you are using Mono as an embedded runtime into your application.\ +\ +Contact contact@xamarin.com if you think you need a license. +} diff --git a/packaging/MacSDK/packaging/resources/ReadMe.rtf b/packaging/MacSDK/packaging/resources/ReadMe.rtf new file mode 100644 index 00000000000..704571f4137 --- /dev/null +++ b/packaging/MacSDK/packaging/resources/ReadMe.rtf @@ -0,0 +1,41 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf320 +{\fonttbl\f0\fswiss\fcharset0 Helvetica;} +{\colortbl;\red255\green255\blue255;} +\margl1440\margr1440\vieww15940\viewh15760\viewkind0 +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640 + +\f0\fs24 \cf0 This README is for +\b Mono.framework @@MONO_VERSION_RELEASE@@ +\b0 .\ +\ +This is the Mono Runtime and Development Platform (http://www.mono-project.com/).\ +\ +This package installs Mono and all of its dependencies inside of /Library/Frameworks/Mono.framework. This behavior is likely to change with a future release so that dependancies will get their own frameworks.\ +\ +The following components are included inside Mono.framework:\ +@@PACKAGES@@\ +\ +Other packages used to build Mono.framework:\ +@@DEP_PACKAGES@@\ +If you want to build native Mac applications with Mono, you can use the MonoMac bindings, an add-on to this product available from http://www.mono-project.com/MonoMac\ +\ +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720 +\cf0 \ +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640 +\cf0 \ +\ +A simple uninstallMono.sh script is included in the disk image. This is shell script that must be run as root, and it will remove the Mono.framework and the links in /usr/bin.\ +\ +This package was created by the Mono team. Major contributors to this team include (in alphabetical order): \ +\ +Wade Berrier\ +Adhamh Findlay\ +Miguel de Icaza\ +Urs Muff\ +Geoff Norton\ +Andy Satori\ +\ +Questions or problems related directly to the Mono.framework should be addressed to mono-osx@lists.xamarin.com.\ +\ +Questions about Mono should be directed to an appropriate resource that can be found on http://www.mono-project.com/about. \ +}
\ No newline at end of file diff --git a/packaging/MacSDK/packaging/resources/Welcome.rtf b/packaging/MacSDK/packaging/resources/Welcome.rtf new file mode 100644 index 00000000000..200bc994abb --- /dev/null +++ b/packaging/MacSDK/packaging/resources/Welcome.rtf @@ -0,0 +1,12 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360 +{\fonttbl\f0\fnil\fcharset0 HelveticaNeue;} +{\colortbl;\red255\green255\blue255;} +\margl1440\margr1440\vieww9000\viewh9000\viewkind0 +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural + +\f0\fs32 \cf0 Welcome to +\b Mono.framework @@MONO_VERSION_RELEASE@@ +\b0 for OS X. +\fs36 \ +\ +}
\ No newline at end of file diff --git a/packaging/MacSDK/packaging/resources/distribution.xml b/packaging/MacSDK/packaging/resources/distribution.xml new file mode 100644 index 00000000000..39926f94fed --- /dev/null +++ b/packaging/MacSDK/packaging/resources/distribution.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8" standalone="no"?> +<installer-gui-script minSpecVersion="1"> + <title>Mono Framework</title> + <license file="License.rtf" mime-type="application/rtf" /> + <readme file="ReadMe.rtf" mime-type="application/rtf" /> + <pkg-ref id="mono"> + <bundle-version/> + </pkg-ref> + <choices-outline> + <line choice="default"> + <line choice="mono"/> + </line> + </choices-outline> + <choice id="default"/> + <choice id="mono" visible="false"> + <pkg-ref id="mono"/> + </choice> + <pkg-ref id="mono">#mono.pkg</pkg-ref> +</installer-gui-script> diff --git a/packaging/MacSDK/packaging/resources/postinstall b/packaging/MacSDK/packaging/resources/postinstall new file mode 100755 index 00000000000..5ad19adf1df --- /dev/null +++ b/packaging/MacSDK/packaging/resources/postinstall @@ -0,0 +1,107 @@ +#!/bin/sh -x + +FW=/Library/Frameworks/Mono.framework +FW_CURRENT=${FW}/Versions/Current +CURRENT=`basename $(readlink ${FW_CURRENT})` + +# Remove PCL assemblies that we installed from Mono 3.1.1 +LICENSE="Portable Class Library Reference Assemblies License-07JUN2013.docx" +if [ -f "$FW/External/xbuild-frameworks/.NETPortable/$LICENSE" ]; then + echo "Removing PCL because we're upgrading from 3.1.1" >> /tmp/mono-installation + rm -rf $FW/External/xbuild-frameworks/.NETPortable +fi + +# Remove /usr/local/bin/pkg-config if it's a symlink to the Mono-installed one +PKG_CONFIG_LINK="/usr/local/bin/pkg-config" +if [ -L $PKG_CONFIG_LINK ]; then + location=`readlink $PKG_CONFIG_LINK` + case "$location" in + *Mono.framework*) rm $PKG_CONFIG_LINK;; + esac +fi + +WHITELIST=$(cat "$(dirname "$0")/whitelist.txt") +MONO_COMMANDS_FILE=/etc/paths.d/mono-commands +FW_WHITELISTED_COMMANDS=${FW_CURRENT}/Commands + +mkdir ${FW_WHITELISTED_COMMANDS} +mkdir /etc/paths.d + +if test -e ${MONO_COMMANDS_FILE}; then + rm "${MONO_COMMANDS_FILE}" +fi + +echo "${FW_WHITELISTED_COMMANDS}" >> "${MONO_COMMANDS_FILE}" + +if [ -d "${FW}"/Commands ]; then + for i in ${WHITELIST}; do + if test -e "${FW}/Commands/${i}"; then + ln -s "${FW}/Commands/${i}" "${FW_WHITELISTED_COMMANDS}/${i}" + fi + done; +else + echo "${FW}/Commands does not exist" + echo "Can not add command links to $PATH." +fi + +if [ -d ${FW_CURRENT} ]; then + cd ${FW_CURRENT}/share/man + for i in ${WHITELIST}; do + for j in $(ls man*/${i}.*); do + if test ! -e "/usr/local/share/man/${j}"; then + ln -sf "${FW_CURRENT}/share/man/${j}" "/usr/local/share/man/${j}" + fi + done + done + + cd ${FW_CURRENT}/etc + # Make sure we run the files we lay down, and not other stuff installed on the system + export PATH=${FW_CURRENT}/bin:$PATH + # gtk+ setup + gdk-pixbuf-query-loaders --update-cache + # pango setup + mkdir -p pango + pango-querymodules > pango/pango.modules + pango-querymodules --update-cache + fc-cache + + cd ${FW_CURRENT}/lib/gtk-2.0/2.10.0 + gtk-query-immodules-2.0 > immodules.cache +fi + +# Delete older Monos +# +# - keep if the major version is different +# - keep if 'Versions/x.y.z/keep' exists +# - Keep if it is greater than $CURRENT +# +echo "Current:" $CURRENT >> /tmp/mono-installation + +pushd ${FW}/Versions +for i in `ls -d *`; do + result=`echo "${i:0:1} == ${CURRENT:0:1}" | bc` + if [ $result -ne 1 ]; then + echo "keeping" $i "because it has a different major version" >> /tmp/mono-installation + continue + fi + + if [ -f $i/keep ]; then + echo "Keeping" $i "because of keep file" >> /tmp/mono-installation + continue + fi + + # A magical bit of Perl: http://stackoverflow.com/a/7366753/494990 + result=$(perl -e '($a,$b)=@ARGV; for ($a,$b) {s/(\d+)/sprintf "%5d", $1/ge}; print $a cmp $b;' $i $CURRENT) + if [ $result -ge 0 ]; then + echo "Skipping" $i "because $i >= $CURRENT" >> /tmp/mono-installation + continue + + else + echo "rm -rf" $i >> /tmp/mono-installation + rm -rf $i + fi +done +popd + +# Mono framework should be owned by root +chown -R root:admin ${FW} diff --git a/packaging/MacSDK/packaging/resources/version.plist b/packaging/MacSDK/packaging/resources/version.plist new file mode 100644 index 00000000000..df2e67c0982 --- /dev/null +++ b/packaging/MacSDK/packaging/resources/version.plist @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>BuildVersion</key> + <string>@@MONO_VERSION_RELEASE@@</string> + <key>CFBundleShortVersionString</key> + <string>@@MONO_VERSION_RELEASE@@</string> + <key>CFBundleVersion</key> + <string>@@MONO_VERSION_RELEASE@@</string> + <key>ProjectName</key> + <string>Mono</string> + <key>SourceVersion</key> + <string>@@MONO_VERSION_RELEASE@@</string> +</dict> +</plist> diff --git a/packaging/MacSDK/packaging/resources/whitelist.txt b/packaging/MacSDK/packaging/resources/whitelist.txt new file mode 100644 index 00000000000..7d329a91271 --- /dev/null +++ b/packaging/MacSDK/packaging/resources/whitelist.txt @@ -0,0 +1,129 @@ +al +al2 +asp-state +asp-state2 +asp-state4 +booc +booi +booish +caspol +ccrewrite +cccheck +cert2spc +certmgr +chktrust +ClassInitGenerator +csharp +csharp2 +dbsessmgr +dbsessmgr2 +dbsessmgr4 +disco +dmcs +dtd2rng +dtd2xsd +fastcgi-mono-server +fastcgi-mono-server2 +fastcgi-mono-server4 +fsharpc +fsharpc2 +fsharpi +fsharpi2 +gacutil +gacutil2 +gapi2-codegen +gapi2-fixup +gapi2-parser +genxs +gmcs +httpcfg +ikdasm +ilasm +installvst +ipy +ipy64 +ipyw +ipyw64 +ir +ir64 +IronRuby.Tests +irw +irw64 +lc +macpack +makecert +mautil +mconfig +mcs +mdassembler +mdoc +mdoc-assemble +mdoc-export-html +mdoc-export-msxdoc +mdoc-update +mdoc-validate +mdvalidater +mkbundle +mod +mod-mono-server +mod-mono-server2 +mod-mono-server4 +mono +mono64 +mono-boehm +mono-api-info +mono-api-html +mono-cil-strip +mono-configuration-crypto +monodis +monodocer +monodocs2html +monodocs2slashdoc +mono-find-provides +mono-find-requires +mono-gdb.py +monograph +mono-heapviz +monolinker +monop +monop2 +mono-service +mono-service2 +mono-sgen +mono-shlib-cop +mono-symbolicate +mono-test-install +mono-xmltool +mozroots +mprof-report +msbuild +nant +nuget +nunit-console +nunit-console2 +nunit-console4 +pdb2mdb +pedump +permview +peverify +prj2make +resgen +resgen2 +secutil +setreg +sgen +signcode +sn +soapsuds +sqlmetal +sqlsharp +svcutil +vbnc +vbnc2 +wsdl +wsdl2 +xbuild +xsd +xsp +xsp2 +xsp4 diff --git a/packaging/MacSDK/packaging/uninstallMono.sh b/packaging/MacSDK/packaging/uninstallMono.sh new file mode 100755 index 00000000000..9e88ad1a8bc --- /dev/null +++ b/packaging/MacSDK/packaging/uninstallMono.sh @@ -0,0 +1,15 @@ +#!/bin/sh -x + +#This script removes Mono from an OS X System. It must be run as root + +rm -r /Library/Frameworks/Mono.framework + +# In 10.6+ the receipts are stored here +rm /var/db/receipts/com.ximian.mono* + +for dir in /usr/local/bin; do + (cd ${dir}; + for i in `ls -al | grep /Library/Frameworks/Mono.framework/ | awk '{print $9}'`; do + rm ${i} + done); +done diff --git a/packaging/MacSDK/patches/find-unused-patches.sh b/packaging/MacSDK/patches/find-unused-patches.sh new file mode 100755 index 00000000000..b758c978521 --- /dev/null +++ b/packaging/MacSDK/patches/find-unused-patches.sh @@ -0,0 +1,3 @@ +#!/bin/sh +for f in *.patch; do grep $f ../*.py > /dev/null || echo $f; done +for f in */*.patch; do grep $f ../*.py > /dev/null || echo $f; done diff --git a/packaging/MacSDK/patches/gettext-no-samples.patch b/packaging/MacSDK/patches/gettext-no-samples.patch new file mode 100644 index 00000000000..80c198fd67f --- /dev/null +++ b/packaging/MacSDK/patches/gettext-no-samples.patch @@ -0,0 +1,10 @@ +--- a/gettext-tools/Makefile.in.orig 2010-06-03 16:38:55.000000000 -0500 ++++ b/gettext-tools/Makefile.in 2010-06-04 01:16:07.000000000 -0500 +@@ -1248,7 +1248,7 @@ + top_srcdir = @top_srcdir@ + AUTOMAKE_OPTIONS = 1.5 gnu no-dependencies + ACLOCAL_AMFLAGS = -I m4 -I ../gettext-runtime/m4 -I ../m4 -I gnulib-m4 -I libgrep/gnulib-m4 -I libgettextpo/gnulib-m4 +-SUBDIRS = doc intl gnulib-lib libgrep src libgettextpo po projects styles misc man m4 tests gnulib-tests examples ++SUBDIRS = doc intl gnulib-lib libgrep src libgettextpo po projects styles misc man m4 tests gnulib-tests + + # Allow users to use "gnulib-tool --update". diff --git a/packaging/MacSDK/patches/glib/config.h.ed b/packaging/MacSDK/patches/glib/config.h.ed new file mode 100644 index 00000000000..bbf6cf4545e --- /dev/null +++ b/packaging/MacSDK/patches/glib/config.h.ed @@ -0,0 +1,32 @@ +/ AC_APPLE_UNIVERSAL_BUILD /c +/* #undef AC_APPLE_UNIVERSAL_BUILD */ +. +/ G_VA_COPY_AS_ARRAY /c +#ifdef __LP64__ +#define G_VA_COPY_AS_ARRAY 1 +#else +/* #undef G_VA_COPY_AS_ARRAY */ +#endif +. +/ SIZEOF_LONG /c +#ifdef __LP64__ +#define SIZEOF_LONG 8 +#else +#define SIZEOF_LONG 4 +#endif +. +/ SIZEOF_SIZE_T /c +#ifdef __LP64__ +#define SIZEOF_SIZE_T 8 +#else +#define SIZEOF_SIZE_T 4 +#endif +. +/ SIZEOF_VOID_P /c +#ifdef __LP64__ +#define SIZEOF_VOID_P 8 +#else +#define SIZEOF_VOID_P 4 +#endif +. +w diff --git a/packaging/MacSDK/patches/glib/patch-configure.diff b/packaging/MacSDK/patches/glib/patch-configure.diff new file mode 100644 index 00000000000..09848ac4d8d --- /dev/null +++ b/packaging/MacSDK/patches/glib/patch-configure.diff @@ -0,0 +1,203 @@ +--- configure.orig 2012-10-15 19:29:14.000000000 -0500 ++++ configure 2012-10-22 17:29:31.000000000 -0500 +@@ -5602,7 +5602,7 @@ + fi + + GLIB_RUNTIME_LIBDIR="$with_runtime_libdir" +-ABS_GLIB_RUNTIME_LIBDIR="`readlink -f $libdir/$with_runtime_libdir`" ++ABS_GLIB_RUNTIME_LIBDIR="`readlink $libdir/$with_runtime_libdir`" + + + if test "x$with_runtime_libdir" != "x"; then +@@ -30649,10 +30649,10 @@ + *) glib_vacopy='' + esac + +-if test x$glib_cv_va_val_copy = xno; then + glib_vacopy="\$glib_vacopy +-#define G_VA_COPY_AS_ARRAY 1" +-fi ++#ifdef __LP64__ ++#define G_VA_COPY_AS_ARRAY 1 ++#endif" + + if test x$glib_cv_hasinline = xyes; then + glib_inline='#define G_HAVE_INLINE 1' +@@ -32411,18 +32411,32 @@ + cat >>$outfile <<_______EOF + #define G_HAVE_GINT64 1 /* deprecated, always true */ + +-${glib_extension}typedef signed $gint64 gint64; +-${glib_extension}typedef unsigned $gint64 guint64; ++#ifdef __LP64__ ++${glib_extension}typedef signed long gint64; ++${glib_extension}typedef unsigned long guint64; + +-#define G_GINT64_CONSTANT(val) $gint64_constant +-#define G_GUINT64_CONSTANT(val) $guint64_constant ++#define G_GINT64_CONSTANT(val) (val##L) ++#define G_GUINT64_CONSTANT(val) (val##UL) ++#else ++${glib_extension}typedef signed long long gint64; ++${glib_extension}typedef unsigned long long guint64; ++ ++#define G_GINT64_CONSTANT(val) (G_GNUC_EXTENSION (val##LL)) ++#define G_GUINT64_CONSTANT(val) (G_GNUC_EXTENSION (val##ULL)) ++#endif + _______EOF + + if test x$gint64_format != x ; then + cat >>$outfile <<_______EOF +-#define G_GINT64_MODIFIER $gint64_modifier +-#define G_GINT64_FORMAT $gint64_format +-#define G_GUINT64_FORMAT $guint64_format ++#ifdef __LP64__ ++#define G_GINT64_MODIFIER "l" ++#define G_GINT64_FORMAT "li" ++#define G_GUINT64_FORMAT "lu" ++#else ++#define G_GINT64_MODIFIER "ll" ++#define G_GINT64_FORMAT "lli" ++#define G_GUINT64_FORMAT "llu" ++#endif + _______EOF + else + cat >>$outfile <<_______EOF +@@ -32434,9 +32448,15 @@ + + cat >>$outfile <<_______EOF + +-#define GLIB_SIZEOF_VOID_P $glib_void_p +-#define GLIB_SIZEOF_LONG $glib_long +-#define GLIB_SIZEOF_SIZE_T $glib_size_t ++#ifdef __LP64__ ++#define GLIB_SIZEOF_VOID_P 8 ++#define GLIB_SIZEOF_LONG 8 ++#define GLIB_SIZEOF_SIZE_T 8 ++#else ++#define GLIB_SIZEOF_VOID_P 4 ++#define GLIB_SIZEOF_LONG 4 ++#define GLIB_SIZEOF_SIZE_T 4 ++#endif + + _______EOF + +@@ -32464,18 +32484,33 @@ + if test -z "$glib_unknown_void_p"; then + cat >>$outfile <<_______EOF + +-#define GPOINTER_TO_INT(p) ((gint) ${glib_gpi_cast} (p)) +-#define GPOINTER_TO_UINT(p) ((guint) ${glib_gpui_cast} (p)) ++#ifdef __LP64__ ++#define GPOINTER_TO_INT(p) ((gint) (glong) (p)) ++#define GPOINTER_TO_UINT(p) ((guint) (gulong) (p)) ++ ++#define GINT_TO_POINTER(i) ((gpointer) (glong) (i)) ++#define GUINT_TO_POINTER(u) ((gpointer) (gulong) (u)) ++ ++typedef signed long gintptr; ++typedef unsigned long guintptr; ++ ++#define G_GINTPTR_MODIFIER "l" ++#define G_GINTPTR_FORMAT "li" ++#define G_GUINTPTR_FORMAT "lu" ++#else ++#define GPOINTER_TO_INT(p) ((gint) (p)) ++#define GPOINTER_TO_UINT(p) ((guint) (p)) + +-#define GINT_TO_POINTER(i) ((gpointer) ${glib_gpi_cast} (i)) +-#define GUINT_TO_POINTER(u) ((gpointer) ${glib_gpui_cast} (u)) ++#define GINT_TO_POINTER(i) ((gpointer) (i)) ++#define GUINT_TO_POINTER(u) ((gpointer) (u)) + +-typedef signed $glib_intptr_type_define gintptr; +-typedef unsigned $glib_intptr_type_define guintptr; ++typedef signed int gintptr; ++typedef unsigned int guintptr; + +-#define G_GINTPTR_MODIFIER $gintptr_modifier +-#define G_GINTPTR_FORMAT $gintptr_format +-#define G_GUINTPTR_FORMAT $guintptr_format ++#define G_GINTPTR_MODIFIER "" ++#define G_GINTPTR_FORMAT "i" ++#define G_GUINTPTR_FORMAT "u" ++#endif + _______EOF + else + echo '#error SIZEOF_VOID_P unknown - This should never happen' >>$outfile +@@ -32588,7 +32623,9 @@ + + if test x"$g_memory_barrier_needed" != xno; then + echo >>$outfile ++ echo "#ifdef __BIG_ENDIAN__" >>$outfile + echo "#define G_ATOMIC_OP_MEMORY_BARRIER_NEEDED 1" >>$outfile ++ echo "#endif" >>$outfile + fi + if test x"$g_atomic_lock_free" = xyes; then + echo >>$outfile +@@ -32598,27 +32635,52 @@ + g_bit_sizes="16 32 64" + for bits in $g_bit_sizes; do + cat >>$outfile <<_______EOF +-#define GINT${bits}_TO_${g_bs_native}(val) ((gint${bits}) (val)) +-#define GUINT${bits}_TO_${g_bs_native}(val) ((guint${bits}) (val)) +-#define GINT${bits}_TO_${g_bs_alien}(val) ((gint${bits}) GUINT${bits}_SWAP_LE_BE (val)) +-#define GUINT${bits}_TO_${g_bs_alien}(val) (GUINT${bits}_SWAP_LE_BE (val)) ++#ifdef __BIG_ENDIAN__ ++#define GINT${bits}_TO_BE(val) ((gint${bits}) (val)) ++#define GUINT${bits}_TO_BE(val) ((guint${bits}) (val)) ++#define GINT${bits}_TO_LE(val) ((gint${bits}) GUINT${bits}_SWAP_LE_BE (val)) ++#define GUINT${bits}_TO_LE(val) (GUINT${bits}_SWAP_LE_BE (val)) ++#else ++#define GINT${bits}_TO_LE(val) ((gint${bits}) (val)) ++#define GUINT${bits}_TO_LE(val) ((guint${bits}) (val)) ++#define GINT${bits}_TO_BE(val) ((gint${bits}) GUINT${bits}_SWAP_LE_BE (val)) ++#define GUINT${bits}_TO_BE(val) (GUINT${bits}_SWAP_LE_BE (val)) ++#endif + _______EOF + done + + cat >>$outfile <<_______EOF +-#define GLONG_TO_LE(val) ((glong) GINT${glongbits}_TO_LE (val)) +-#define GULONG_TO_LE(val) ((gulong) GUINT${glongbits}_TO_LE (val)) +-#define GLONG_TO_BE(val) ((glong) GINT${glongbits}_TO_BE (val)) +-#define GULONG_TO_BE(val) ((gulong) GUINT${glongbits}_TO_BE (val)) ++#ifdef __LP64__ ++#define GLONG_TO_LE(val) ((glong) GINT64_TO_LE (val)) ++#define GULONG_TO_LE(val) ((gulong) GUINT64_TO_LE (val)) ++#define GLONG_TO_BE(val) ((glong) GINT64_TO_BE (val)) ++#define GULONG_TO_BE(val) ((gulong) GUINT64_TO_BE (val)) ++#else ++#define GLONG_TO_LE(val) ((glong) GINT32_TO_LE (val)) ++#define GULONG_TO_LE(val) ((gulong) GUINT32_TO_LE (val)) ++#define GLONG_TO_BE(val) ((glong) GINT32_TO_BE (val)) ++#define GULONG_TO_BE(val) ((gulong) GUINT32_TO_BE (val)) ++#endif + #define GINT_TO_LE(val) ((gint) GINT${gintbits}_TO_LE (val)) + #define GUINT_TO_LE(val) ((guint) GUINT${gintbits}_TO_LE (val)) + #define GINT_TO_BE(val) ((gint) GINT${gintbits}_TO_BE (val)) + #define GUINT_TO_BE(val) ((guint) GUINT${gintbits}_TO_BE (val)) +-#define GSIZE_TO_LE(val) ((gsize) GUINT${gsizebits}_TO_LE (val)) +-#define GSSIZE_TO_LE(val) ((gssize) GINT${gsizebits}_TO_LE (val)) +-#define GSIZE_TO_BE(val) ((gsize) GUINT${gsizebits}_TO_BE (val)) +-#define GSSIZE_TO_BE(val) ((gssize) GINT${gsizebits}_TO_BE (val)) +-#define G_BYTE_ORDER $g_byte_order ++#ifdef __LP64__ ++#define GSIZE_TO_LE(val) ((gsize) GUINT64_TO_LE (val)) ++#define GSSIZE_TO_LE(val) ((gssize) GINT64_TO_LE (val)) ++#define GSIZE_TO_BE(val) ((gsize) GUINT64_TO_BE (val)) ++#define GSSIZE_TO_BE(val) ((gssize) GINT64_TO_BE (val)) ++#else ++#define GSIZE_TO_LE(val) ((gsize) GUINT32_TO_LE (val)) ++#define GSSIZE_TO_LE(val) ((gssize) GINT32_TO_LE (val)) ++#define GSIZE_TO_BE(val) ((gsize) GUINT32_TO_BE (val)) ++#define GSSIZE_TO_BE(val) ((gssize) GINT32_TO_BE (val)) ++#endif ++#ifdef __BIG_ENDIAN__ ++#define G_BYTE_ORDER G_BIG_ENDIAN ++#else ++#define G_BYTE_ORDER G_LITTLE_ENDIAN ++#endif + + #define GLIB_SYSDEF_POLLIN =$g_pollin + #define GLIB_SYSDEF_POLLOUT =$g_pollout diff --git a/packaging/MacSDK/patches/glib/patch-gi18n.h.diff b/packaging/MacSDK/patches/glib/patch-gi18n.h.diff new file mode 100644 index 00000000000..3d3821b8a19 --- /dev/null +++ b/packaging/MacSDK/patches/glib/patch-gi18n.h.diff @@ -0,0 +1,11 @@ +--- glib/gi18n.h.orig 2008-11-23 23:45:23.000000000 -0600 ++++ glib/gi18n.h 2008-11-25 23:59:29.000000000 -0600 +@@ -27,7 +27,9 @@ + + #define _(String) gettext (String) + #define Q_(String) g_dpgettext (NULL, String, 0) ++#ifndef N_ + #define N_(String) (String) ++#endif + #define C_(Context,String) g_dpgettext (NULL, Context "\004" String, strlen (Context) + 1) + #define NC_(Context, String) (String) diff --git a/packaging/MacSDK/patches/glib/patch-gio_gdbusprivate.c.diff b/packaging/MacSDK/patches/glib/patch-gio_gdbusprivate.c.diff new file mode 100644 index 00000000000..5c77d56a011 --- /dev/null +++ b/packaging/MacSDK/patches/glib/patch-gio_gdbusprivate.c.diff @@ -0,0 +1,20 @@ +--- gio/gdbusprivate.c.orig 2012-04-30 11:24:02.000000000 -0500 ++++ gio/gdbusprivate.c 2012-05-02 01:57:47.000000000 -0500 +@@ -2094,7 +2094,7 @@ + /* TODO: use PACKAGE_LOCALSTATEDIR ? */ + ret = NULL; + first_error = NULL; +- if (!g_file_get_contents ("/var/lib/dbus/machine-id", ++ if (!g_file_get_contents ("@@PREFIX@@/var/lib/dbus/machine-id", + &ret, + NULL, + &first_error) && +@@ -2104,7 +2104,7 @@ + NULL)) + { + g_propagate_prefixed_error (error, first_error, +- _("Unable to load /var/lib/dbus/machine-id or /etc/machine-id: ")); ++ _("Unable to load @@PREFIX@@/var/lib/dbus/machine-id or /etc/machine-id: ")); + } + else + { diff --git a/packaging/MacSDK/patches/glib/patch-gio_xdgmime_xdgmime.c.diff b/packaging/MacSDK/patches/glib/patch-gio_xdgmime_xdgmime.c.diff new file mode 100644 index 00000000000..feaaed48115 --- /dev/null +++ b/packaging/MacSDK/patches/glib/patch-gio_xdgmime_xdgmime.c.diff @@ -0,0 +1,10 @@ +--- gio/xdgmime/xdgmime.c.orig 2009-03-12 22:09:52.000000000 -0600 ++++ gio/xdgmime/xdgmime.c 2009-04-09 23:41:01.000000000 -0600 +@@ -257,7 +257,7 @@ + + xdg_data_dirs = getenv ("XDG_DATA_DIRS"); + if (xdg_data_dirs == NULL) +- xdg_data_dirs = "/usr/local/share/:/usr/share/"; ++ xdg_data_dirs = "@@PREFIX@@/share/:/usr/share/"; + + ptr = xdg_data_dirs; diff --git a/packaging/MacSDK/patches/glib/patch-glib-2.0.pc.in.diff b/packaging/MacSDK/patches/glib/patch-glib-2.0.pc.in.diff new file mode 100644 index 00000000000..b15274e8c51 --- /dev/null +++ b/packaging/MacSDK/patches/glib/patch-glib-2.0.pc.in.diff @@ -0,0 +1,8 @@ +--- glib-2.0.pc.in.orig 2012-01-15 21:12:06.000000000 -0600 ++++ glib-2.0.pc.in 2012-01-19 22:29:43.000000000 -0600 +@@ -13,4 +13,4 @@ + Requires.private: @PCRE_REQUIRES@ + Libs: -L${libdir} -lglib-2.0 @INTLLIBS@ + Libs.private: @G_THREAD_LIBS@ @G_LIBS_EXTRA@ @PCRE_LIBS@ @INTLLIBS@ @ICONV_LIBS@ +-Cflags: -I${includedir}/glib-2.0 -I${libdir}/glib-2.0/include @GLIB_EXTRA_CFLAGS@ ++Cflags: -I${includedir}/glib-2.0 -I${libdir}/glib-2.0/include -I${includedir} @GLIB_EXTRA_CFLAGS@ diff --git a/packaging/MacSDK/patches/glib/patch-glib_gunicollate.c.diff b/packaging/MacSDK/patches/glib/patch-glib_gunicollate.c.diff new file mode 100644 index 00000000000..2a49282d408 --- /dev/null +++ b/packaging/MacSDK/patches/glib/patch-glib_gunicollate.c.diff @@ -0,0 +1,12 @@ +--- glib/gunicollate.c.orig 2009-03-31 18:04:20.000000000 -0500 ++++ glib/gunicollate.c 2010-03-06 17:59:08.000000000 -0600 +@@ -26,6 +26,9 @@ + #include <wchar.h> + #endif + ++/* Carbon is not available on 64-bit */ ++#undef HAVE_CARBON ++ + #ifdef HAVE_CARBON + #include <CoreServices/CoreServices.h> + #endif diff --git a/packaging/MacSDK/patches/mcs-pkgconfig.patch b/packaging/MacSDK/patches/mcs-pkgconfig.patch new file mode 100644 index 00000000000..eeefebce34c --- /dev/null +++ b/packaging/MacSDK/patches/mcs-pkgconfig.patch @@ -0,0 +1,23 @@ +diff --git a/scripts/Makefile.am b/scripts/Makefile.am +index 73b9cea..98b8cfb 100644 +--- a/scripts/Makefile.am ++++ b/scripts/Makefile.am +@@ -179,7 +179,8 @@ REWRITE_COMMON = sed \ + -e 's,@''bindir@,$(bindir),g' \ + -e 's,@''plat_bindir@,$(plat_bindir),g' \ + -e 's,@''mono_instdir@,$(mono_instdir),g' \ +- -e 's,@''gtkdir@,$(gtkdir),g' ++ -e 's,@''gtkdir@,$(gtkdir),g' \ ++ -e 's,@''mono_version@,$(VERSION),g' + + REWRITE = $(REWRITE_COMMON) -e 's,@''mono_interp@,$(mono_interp),g' + REWRITE_DEBUG = $(REWRITE_COMMON) -e 's,@''mono_interp@,$(mono_interp) --debug,g' +diff --git a/scripts/mcs.in b/scripts/mcs.in +index 32498fa..c15087e 100644 +--- a/scripts/mcs.in ++++ b/scripts/mcs.in +@@ -1,2 +1,4 @@ + #!/bin/sh ++export PATH=$PATH:/Library/Frameworks/Mono.framework/Versions/@mono_version@/bin ++export PKG_CONFIG_PATH=/Library/Frameworks/Mono.framework/External/pkgconfig:/Library/Frameworks/Mono.framework/Versions/@mono_version@/lib/pkgconfig:/Library/Frameworks/Mono.framework/Versions/@mono_version@/share/pkgconfig:$PKG_CONFIG_PATH + exec @bindir@/mono $MONO_OPTIONS @mono_instdir@/2.0/mcs.exe -lib:@mono_instdir@/2.0 -lib:@mono_instdir@/3.5 "$@" diff --git a/packaging/MacSDK/patches/murrine-osx.patch b/packaging/MacSDK/patches/murrine-osx.patch new file mode 100644 index 00000000000..ae5b1f26302 --- /dev/null +++ b/packaging/MacSDK/patches/murrine-osx.patch @@ -0,0 +1,42 @@ +diff --git a/src/murrine_draw.c b/src/murrine_draw.c +index 4cab20f..06ed9b1 100644 +--- a/src/murrine_draw.c ++++ b/src/murrine_draw.c +@@ -1625,10 +1625,6 @@ murrine_draw_scrollbar_slider (cairo_t *cr, + } + + cairo_restore (cr); +- +- murrine_set_color_rgb (cr, &border); +- murrine_rounded_rectangle (cr, 0.5, 0.5, width-1, height-1, widget->roundness, widget->corners); +- cairo_stroke (cr); + } + + static void +@@ -1791,21 +1787,15 @@ murrine_draw_normal_arrow (cairo_t *cr, + { + double arrow_width; + double arrow_height; +- double line_width_2; + +- cairo_save (cr); +- +- arrow_width = MIN (height*2.0 + MAX (1.0, ceil (height*2.0/6.0*2.0)/2.0)/2.0, width); +- line_width_2 = MAX (1.0, ceil (arrow_width/6.0*2.0)/2.0)/2.0; +- arrow_height = arrow_width/2.0+line_width_2; ++ arrow_width = CLAMP (width, 3, 8); ++ arrow_height = CLAMP (height, 3, 8); + +- cairo_translate (cr, x, y-arrow_height/2.0); ++ cairo_save (cr); + +- cairo_move_to (cr, -arrow_width/2.0, line_width_2); +- cairo_line_to (cr, -arrow_width/2.0 + line_width_2, 0); +- cairo_arc_negative (cr, 0, arrow_height-2*line_width_2-2*line_width_2*sqrt(2), 2*line_width_2, M_PI_2+M_PI_4, M_PI_4); +- cairo_line_to (cr, arrow_width/2.0-line_width_2, 0); +- cairo_line_to (cr, arrow_width/2.0, line_width_2); ++ cairo_translate (cr, x, y - arrow_height / 2.0); ++ cairo_move_to (cr, -arrow_width / 2.0, 0); ++ cairo_line_to (cr, arrow_width / 2.0, 0); + cairo_line_to (cr, 0, arrow_height); + cairo_close_path (cr); diff --git a/packaging/MacSDK/pcl-reference-assemblies.py b/packaging/MacSDK/pcl-reference-assemblies.py new file mode 100644 index 00000000000..216e9f7bc09 --- /dev/null +++ b/packaging/MacSDK/pcl-reference-assemblies.py @@ -0,0 +1,57 @@ +import glob +import os +import shutil + + +class PCLReferenceAssembliesPackage(Package): + + def __init__(self): + Package.__init__(self, + name='PortableReferenceAssemblies', + version='2014-04-14', + sources=['http://xamarin-storage/bot-provisioning/PortableReferenceAssemblies-2014-04-14.zip']) + + def build(self): + pass + + # A bunch of shell script written inside python literals ;( + def install(self): + dest = os.path.join( + self.staged_prefix, + "lib", + "mono", + "xbuild-frameworks", + ".NETPortable") + if not os.path.exists(dest): + os.makedirs(dest) + + shutil.rmtree(dest, ignore_errors=True) + + self.sh("rsync -abv -q %s/* %s" % (self.workspace, dest)) + + for f in glob.glob("%s/*/Profile/*/SupportedFrameworks" % dest): + self.write_xml(f) + + def write_xml(self, directory): + # print "Writing iOS/Android/Mac listings for " + directory + data = { + os.path.join(directory, "MonoTouch.xml"): + """<Framework Identifier="MonoTouch" MinimumVersion="1.0" Profile="*" DisplayName="Xamarin.iOS Classic"/>""", + os.path.join(directory, "Xamarin.iOS.xml"): + """<Framework Identifier="Xamarin.iOS" MinimumVersion="1.0" Profile="*" DisplayName="Xamarin.iOS Unified"/>""", + os.path.join(directory, "Xamarin.Android.xml"): + """<Framework Identifier="MonoAndroid" MinimumVersion="1.0" Profile="*" DisplayName="Xamarin.Android"/>""", + os.path.join(directory, "Xamarin.Mac.xml"): + """<Framework Identifier="Xamarin.Mac" MinimumVersion="2.0" Profile="*" DisplayName="Xamarin.Mac Unified"/>""", + os.path.join(directory, "Xamarin.TVOS.xml"): + """<Framework Identifier="Xamarin.TVOS" MinimumVersion="1.0" Profile="*" DisplayName="Xamarin.TVOS"/>""", + os.path.join(directory, "Xamarin.WatchOS.xml"): + """<Framework Identifier="Xamarin.WatchOS" MinimumVersion="1.0" Profile="*" DisplayName="Xamarin.WatchOS"/>""", + } + for filename, content in data.iteritems(): + f = open(filename, "w") + f.write(content + "\n") + f.close() + + +PCLReferenceAssembliesPackage() diff --git a/packaging/MacSDK/profile.py b/packaging/MacSDK/profile.py new file mode 100755 index 00000000000..1a7827d4745 --- /dev/null +++ b/packaging/MacSDK/profile.py @@ -0,0 +1,394 @@ +import itertools +import os +import re +import shutil +import string +import sys +import tempfile +import subprocess +import stat + +from bockbuild.darwinprofile import DarwinProfile +from bockbuild.util.util import * +from glob import glob + +class MonoReleaseProfile(DarwinProfile): + description = 'The Mono Framework for MacOS' + packages = [ + 'gettext', + 'pkg-config', + + # Base Libraries + 'libpng', + 'libjpeg', + 'libtiff', + 'libgif', + 'libxml2', + 'freetype', + 'fontconfig', + 'pixman', + 'cairo', + 'libffi', + 'glib', + 'pango', + 'atk', + 'intltool', + 'gdk-pixbuf', + 'gtk+', + 'libglade', + 'sqlite', + 'expat', + 'ige-mac-integration', + + # Theme + 'libcroco', + 'librsvg', + 'hicolor-icon-theme', + 'gtk-engines', + 'murrine', + 'xamarin-gtk-theme', + 'gtk-quartz-engine', + + # Mono + 'mono-llvm', + 'mono', + 'msbuild', + 'pcl-reference-assemblies', + 'libgdiplus', + 'xsp', + 'gtk-sharp', + 'ironlangs', + 'fsharp', + 'mono-basic', + 'nuget' + ] + + def attach (self, bockbuild): + self.min_version = 7 + DarwinProfile.attach (self, bockbuild) + + # quick disk space check (http://stackoverflow.com/questions/787776/) + s = os.statvfs(bockbuild.root) + free_space = (s.f_bavail * s.f_frsize) / (1024 * 1024 * 1024) # in GB + + if free_space < 10: + error('Low disk space (less than 10GB), aborting') + + # check for XQuartz installation (needed for libgdiplus) + if not os.path.exists('/opt/X11/include/X11/Xlib.h'): + error( + 'XQuartz is required to be installed (download from http://xquartz.macosforge.org/) ') + + self.MONO_ROOT = "/Library/Frameworks/Mono.framework" + self.BUILD_NUMBER = "0" + self.MDK_GUID = "964ebddd-1ffe-47e7-8128-5ce17ffffb05" + + system_mono_dir = '/Library/Frameworks/Mono.framework/Versions/Current' + self.env.set('system_mono', os.path.join( + system_mono_dir, 'bin', 'mono')) + self.env.set('system_mcs', os.path.join(system_mono_dir, 'bin', 'mcs')) + + self.env.set('system_mono_version', backtick( + '%s --version' % self.env.system_mono)[0]) + + # config overrides for some programs to be functional while staged + + self.env.set('GDK_PIXBUF_MODULE_FILE', + '%{staged_prefix}/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache') + self.env.set('GDK_PIXBUF_MODULEDIR', + '%{staged_prefix}/lib/gdk-pixbuf-2.0/2.10.0/loaders') + self.env.set('PANGO_SYSCONFDIR', '%{staged_prefix}/etc') + self.env.set('PANGO_LIBDIR', '%{staged_prefix}/lib') + # self.env.set ('MONO_PATH', '%{staged_prefix}/lib/mono/4.0') + self.debug_info = ['gtk+', 'cairo', + 'pango', 'mono', 'llvm', 'libgdiplus'] + self.cache_host = None + + def setup_release(self): + self.mono_package = self.release_packages['mono'] + self.mono_package.fetch() + + verbose('Mono version: %s' % self.mono_package.version) + self.RELEASE_VERSION = self.mono_package.version + self.prefix = os.path.join( + self.MONO_ROOT, "Versions", self.RELEASE_VERSION) + + if os.path.exists(self.prefix): + error('Prefix %s exists, and may interfere with the staged build. Please remove and try again.' % self.prefix) + + self.calculate_updateid() + trace(self.package_info('MDK')) + + self.dont_optimize = ['pixman'] + + for p in self.release_packages.values(): + if p.name in self.dont_optimize: + continue + self.gcc_flags.extend(['-O2']) + + # THIS IS THE MAIN METHOD FOR MAKING A PACKAGE + def package(self): + self.fix_gtksharp_configs() + self.verify_binaries() + + working = self.setup_working_dir() + uninstall_script = os.path.join(working, "uninstallMono.sh") + + # make the MDK + self.apply_blacklist(working, 'mdk_blacklist.sh') + self.make_updateinfo(working, self.MDK_GUID) + mdk_pkg = self.run_pkgbuild(working, "MDK") + title(mdk_pkg) + # self.make_dmg(mdk_dmg, title, mdk_pkg, uninstall_script) + + shutil.rmtree(working) + + def calculate_updateid(self): + # Create the updateid + pwd = os.getcwd() + git_bin = self.bockbuild.git_bin + trace("cur path is %s and git is %s" % (pwd, git_bin)) + blame_rev_str = 'cd %s; %s blame configure.ac HEAD | grep AC_INIT | sed \'s/ .*//\' ' % ( + self.mono_package.workspace, git_bin) + blame_rev = backtick(blame_rev_str)[0] + trace("Last commit to the version string %s" % (blame_rev)) + version_number_str = 'cd %s; %s log %s..HEAD --oneline | wc -l | sed \'s/ //g\'' % ( + self.mono_package.workspace, git_bin, blame_rev) + self.BUILD_NUMBER = backtick(version_number_str)[0] + trace("Calculating commit distance, %s" % (self.BUILD_NUMBER)) + self.FULL_VERSION = self.RELEASE_VERSION + "." + self.BUILD_NUMBER + os.chdir(pwd) + + parts = self.RELEASE_VERSION.split(".") + version_list = (parts + ["0"] * (3 - len(parts)))[:4] + for i in range(1, 3): + version_list[i] = version_list[i].zfill(2) + self.updateid = "".join(version_list) + self.updateid += self.BUILD_NUMBER.replace( + ".", "").zfill(9 - len(self.updateid)) + trace(self.updateid) + + # creates and returns the path to a working directory containing: + # PKGROOT/ - this root will be bundled into the .pkg and extracted at / + # uninstallMono.sh - copied onto the DMG + # Info{_sdk}.plist - used by packagemaker to make the installer + # resources/ - other resources used by packagemaker for the installer + def setup_working_dir(self): + def make_package_symlinks(root): + os.symlink(self.prefix, os.path.join(root, "Versions", "Current")) + currentlink = os.path.join(self.MONO_ROOT, "Versions", "Current") + links = [ + ("bin", "Commands"), + ("include", "Headers"), + ("lib", "Libraries"), + ("", "Home"), + (os.path.join("lib", "libmono-2.0.dylib"), "Mono") + ] + for srcname, destname in links: + src = os.path.join(currentlink, srcname) + dest = os.path.join(root, destname) + # If the symlink exists, we remove it so we can create a fresh + # one + if os.path.exists(dest): + os.unlink(dest) + os.symlink(src, dest) + + tmpdir = tempfile.mkdtemp() + monoroot = os.path.join(tmpdir, "PKGROOT", self.MONO_ROOT[1:]) + versions = os.path.join(monoroot, "Versions") + os.makedirs(versions) + + print "Setting up temporary package directory:", tmpdir + + # setup metadata + self.packaging_dir = os.path.join(self.resource_path, "packaging") + run_shell('rsync -aPq %s/* %s' % (self.packaging_dir, tmpdir), False) + + packages_list = string.join( + [pkg.desc for pkg in self.release_packages.values()], "\\\n") + deps_list = 'bockbuild (rev. %s)\\\n' % bockbuild.bockbuild_rev + string.join( + [pkg.desc for pkg in self.toolchain_packages.values()], "\\\n") + + parameter_map = { + '@@MONO_VERSION@@': self.RELEASE_VERSION, + '@@MONO_RELEASE@@': self.BUILD_NUMBER, + '@@MONO_VERSION_RELEASE@@': self.RELEASE_VERSION + '_' + self.BUILD_NUMBER, + '@@MONO_CSDK_GUID@@': self.MDK_GUID, + '@@MONO_VERSION_RELEASE_INT@@': self.updateid, + '@@PACKAGES@@': packages_list, + '@@DEP_PACKAGES@@': deps_list + } + for dirpath, d, files in os.walk(tmpdir): + for name in files: + if not name.startswith('.'): + replace_in_file(os.path.join(dirpath, name), parameter_map) + + make_package_symlinks(monoroot) + + # copy to package root + run_shell('rsync -aPq "%s"/* "%s/%s"' % + (bockbuild.package_root, versions, self.RELEASE_VERSION), False) + + return tmpdir + + def apply_blacklist(self, working_dir, blacklist_name): + print "Applying blacklist script:", blacklist_name + blacklist = os.path.join(self.packaging_dir, blacklist_name) + root = os.path.join(working_dir, "PKGROOT", self.prefix[1:]) + run_shell('%s "%s" > /dev/null' % (blacklist, root), print_cmd=False) + + def run_pkgbuild(self, working_dir, package_type): + print 'Running pkgbuild & productbuild...', + info = self.package_info(package_type) + output = os.path.join(self.resource_path, info["filename"]) + identifier = "com.xamarin.mono-" + info["type"] + ".pkg" + resources_dir = os.path.join(working_dir, "resources") + distribution_xml = os.path.join(resources_dir, "distribution.xml") + + old_cwd = os.getcwd() + os.chdir(working_dir) + pkgbuild = "/usr/bin/pkgbuild" + pkgbuild_cmd = ' '.join([pkgbuild, + "--identifier " + identifier, + "--root '%s/PKGROOT'" % working_dir, + "--version '%s'" % self.RELEASE_VERSION, + "--install-location '/'", + "--scripts '%s'" % resources_dir, + "--quiet", + os.path.join(working_dir, "mono.pkg")]) + + run_shell(pkgbuild_cmd) + + productbuild = "/usr/bin/productbuild" + productbuild_cmd = ' '.join([productbuild, + "--resources %s" % resources_dir, + "--distribution %s" % distribution_xml, + "--package-path %s" % working_dir, + "--quiet", + output]) + + run_shell(productbuild_cmd) + + assert_exists(output) + os.chdir(old_cwd) + print output + return output + + def make_updateinfo(self, working_dir, guid): + updateinfo = os.path.join( + working_dir, "PKGROOT", self.prefix[1:], "updateinfo") + with open(updateinfo, "w") as updateinfo: + updateinfo.write(guid + ' ' + self.updateid + "\n") + + def package_info(self, pkg_type): + arch = self.bockbuild.cmd_options.arch + arch_str = None + if arch == "darwin-32": + arch_str = "x86" + elif arch == "darwin-64": + arch_str = "x64" + elif arch == "darwin-universal": + arch_str = "universal" + else: + error ("Unknown architecture") + + if self.bockbuild.cmd_options.release_build: + info = (pkg_type, self.FULL_VERSION, arch_str) + else: + info = (pkg_type, '%s-%s' % (git_shortid(self.bockbuild, + self.mono_package.workspace), self.FULL_VERSION), arch_str) + + filename = "MonoFramework-%s-%s.macos10.xamarin.%s.pkg" % info + return { + "type": pkg_type, + "filename": filename + } + + def fix_line(self, line, matcher): + def insert_install_root(matches): + root = self.prefix + captures = matches.groupdict() + return 'target="%s"' % os.path.join(root, "lib", captures["lib"]) + + if matcher(line): + pattern = r'target="(?P<lib>.+\.dylib)"' + result = re.sub(pattern, insert_install_root, line) + return result + else: + return line + + def fix_dllmap(self, config, matcher): + handle, temp = tempfile.mkstemp() + with open(config) as c: + with open(temp, "w") as output: + for line in c: + output.write(self.fix_line(line, matcher)) + os.rename(temp, config) + os.system('chmod a+r %s' % config) + + def fix_gtksharp_configs(self): + print 'Fixing GTK# configuration files...', + count = 0 + libs = [ + 'atk-sharp', + 'gdk-sharp', + 'glade-sharp', + 'glib-sharp', + 'gtk-dotnet', + 'gtk-sharp', + 'pango-sharp' + ] + gac = os.path.join(bockbuild.package_root, "lib", "mono", "gac") + confs = [glob.glob(os.path.join(gac, x, "*", "*.dll.config")) for x in libs] + for c in itertools.chain(*confs): + count = count + 1 + self.fix_dllmap(c, lambda line: "dllmap" in line) + print count + + def verify(self, f): + result = " ".join(backtick("otool -L " + f)) + regex = os.path.join(self.MONO_ROOT, "Versions", r"(\d+\.\d+\.\d+)") + + match = re.search(regex, result) + if match is None: + return + token = match.group(1) + trace(token) + if self.RELEASE_VERSION not in token: + raise Exception("%s references Mono %s\n%s" % (f, token, text)) + + def verify_binaries(self): + bindir = os.path.join(bockbuild.package_root, "bin") + for path, dirs, files in os.walk(bindir): + for name in files: + f = os.path.join(path, name) + file_type = backtick('file "%s"' % f) + if "Mach-O executable" in "".join(file_type): + self.verify(f) + + def shell(self): + envscript = '''#!/bin/sh + PROFNAME="%s" + INSTALLDIR="%s" + ROOT="%s" + export DYLD_FALLBACK_LIBRARY_PATH="$INSTALLDIR/lib:/lib:/usr/lib" + export ACLOCAL_PATH="$INSTALLDIR/share/aclocal" + export CONFIG_SITE="$INSTALLDIR/$PROFNAME-config.site" + export MONO_GAC_PREFIX="$INSTALLDIR" + export MONO_ADDINS_REGISTRY="$ROOT/addinreg" + export MONO_INSTALL_PREFIX="$INSTALLDIR" + + export PS1="\[\e[1;3m\][$PROFNAME] \w @ " + bash -i + ''' % (self.profile_name, self.staged_prefix, self.root) + + path = os.path.join(self.root, self.profile_name + '.sh') + + with open(path, 'w') as f: + f.write(envscript) + + os.chmod(path, os.stat(path).st_mode | stat.S_IEXEC) + + subprocess.call(['bash', '-c', path]) + +MonoReleaseProfile()
\ No newline at end of file diff --git a/packaging/MacSDK/sqlite.py b/packaging/MacSDK/sqlite.py new file mode 100644 index 00000000000..f0f5082c47a --- /dev/null +++ b/packaging/MacSDK/sqlite.py @@ -0,0 +1,3 @@ +Package('sqlite-autoconf', '3090200', sources=[ + 'http://www.sqlite.org/2015/%{name}-%{version}.tar.gz' +]) diff --git a/packaging/MacSDK/xamarin-gtk-theme.py b/packaging/MacSDK/xamarin-gtk-theme.py new file mode 100644 index 00000000000..34d3ae0c650 --- /dev/null +++ b/packaging/MacSDK/xamarin-gtk-theme.py @@ -0,0 +1,20 @@ +class XamarinGtkThemePackage (Package): + + def __init__(self): + Package.__init__(self, 'xamarin-gtk-theme', + sources=[ + 'git://github.com/mono/xamarin-gtk-theme.git'], + revision='cc3fb66e56d494e968be3a529a0737a60e31c1f3') + + def build(self): + try: + self.sh('./autogen.sh --prefix=%{staged_prefix}') + except: + pass + finally: + #self.sh ('intltoolize --force --copy --debug') + #self.sh ('./configure --prefix="%{package_prefix}"') + Package.build(self) + + +XamarinGtkThemePackage() diff --git a/packaging/MacSDK/xsp.py b/packaging/MacSDK/xsp.py new file mode 100644 index 00000000000..8180001e336 --- /dev/null +++ b/packaging/MacSDK/xsp.py @@ -0,0 +1,23 @@ +class XspPackage (GitHubTarballPackage): + + def __init__(self): + GitHubTarballPackage.__init__(self, 'mono', 'xsp', '4.4', + 'c98e068f5647fb06ff2fbef7cd5f1b35417362b1', + configure='./autogen.sh --prefix="%{package_prefix}"') + + def install(self): + # scoop up some mislocated files + misdir = '%s%s' % (self.stage_root, self.staged_profile) + unprotect_dir(self.stage_root) + Package.install(self) + if not os.path.exists(misdir): + for path in iterate_dir(self.stage_root): + print path + error('Could not find mislocated files') + + self.sh('rsync -a --ignore-existing %s/* %s' % + (misdir, self.profile.staged_prefix)) + self.sh('rm -rf %s/*' % misdir) + + +XspPackage() |