Friday 12 December 2014

MacPorts problem installing mono-addins

OSX version: 10.9.5
MacPorts version: 2.3.3
mono-addins version: 0.6.2

Command line error:
$ sudo port install mono-addins
--->  Computing dependencies for mono-addins
--->  Building mono-addins
Error: org.macports.build for port mono-addins returned: command execution failed
Please see the log file for port mono-addins for details:
    /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_mono-addins/mono-addins/main.log
To report a bug, follow the instructions in the guide:
    http://guide.macports.org/#project.tickets
Error: Processing of port mono-addins failed

main.log error: (toward the end)
:info:build error CS1705: Assembly `gdk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f' references `Mono.Cairo, Version=4.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756' which has a higher version number than imported assembly `Mono.Cairo, Version=2.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756'

Find it fast using:
grep -n ":info:build error" /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_mono-addins/mono-addins/main.log 

Where is Mono.Addins.Gui?:
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_mono-addins/mono-addins/work/mono-addins-0.6.2/Mono.Addins.Gui

From https://monoaddins.codeplex.com/discussions/399592 :
"Go to makefile in the Mono.Addins.Gui project and find ASSEMBLY_COMPILER_FLAGS. Add -sdk:4 after -d:DEBUG and run make again."