C# 无法通过Mono在Mac OS X上构建gtk sharp 3

C# 无法通过Mono在Mac OS X上构建gtk sharp 3,c#,mono,gtk3,automake,gtk#,C#,Mono,Gtk3,Automake,Gtk#,我已经做了好几个小时了,这真的快把我逼疯了。在internet上的任何位置都找不到解决方案 我从他们的Github存储库中获得了最新的gtk sharp代码,但我无法通过autoconf阶段。一开始,它失败了,因为它找不到Mono C#编译器,但我通过调整$PKG#u CONFIG_PATH变量解决了这个问题。现在,它给了我关于GTK的相同问题,我肯定已经安装了GTK(通过brew)-2.0和3.0,并调整了变量 有人有任何指示吗 automake.sh输出: $ ./autogen.sh -

我已经做了好几个小时了,这真的快把我逼疯了。在internet上的任何位置都找不到解决方案

我从他们的Github存储库中获得了最新的gtk sharp代码,但我无法通过autoconf阶段。一开始,它失败了,因为它找不到Mono C#编译器,但我通过调整
$PKG#u CONFIG_PATH
变量解决了这个问题。现在,它给了我关于GTK的相同问题,我肯定已经安装了GTK(通过brew)-2.0和3.0,并调整了变量

有人有任何指示吗

automake.sh
输出:

$ ./autogen.sh  --prefix=`pkg-config --variable=prefix mono`
Running /usr/local/bin/glibtoolize...
Running aclocal  ...
Running autoheader...
Running automake --foreign  ...
Running autoconf ...
Running ./configure --enable-maintainer-mode --prefix=/Library/Frameworks/Mono.framework/Versions/3.10.0/lib/pkgconfig/../.. ...
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... ./install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether UID '505' is supported by ustar format... yes
checking whether GID '20' is supported by ustar format... yes
checking how to create a ustar tar archive... gnutar
checking build system type... x86_64-apple-darwin14.0.0
checking host system type... x86_64-apple-darwin14.0.0
checking whether to enable maintainer-specific portions of Makefiles... yes
checking whether we're on Windows... no
checking for gcc... gcc
checking for gcc... (cached) gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking how to print strings... printf
checking for a sed that does not truncate output... /usr/bin/sed
checking for fgrep... /usr/bin/grep -F
checking for ld used by gcc... /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld
checking if the linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) is GNU ld... no
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm
checking the name lister (/usr/bin/nm) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 196608
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking how to convert x86_64-apple-darwin14.0.0 file names to x86_64-apple-darwin14.0.0 format... func_convert_file_noop
checking how to convert x86_64-apple-darwin14.0.0 file names to toolchain format... func_convert_file_noop
checking for /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... dlltool
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... no
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm output from gcc object... ok
checking for sysroot... no
checking for mt... no
checking if : is a manifest tool... no
checking for dsymutil... dsymutil
checking for nmedit... nmedit
checking for lipo... lipo
checking for otool... otool
checking for otool64... no
checking for -single_module linker flag... yes
checking for -exported_symbols_list linker flag... yes
checking for -force_load linker flag... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... yes
checking for gcc option to produce PIC... -fno-common -DPIC
checking if gcc PIC flag -fno-common -DPIC works... yes
checking if gcc static flag -static works... no
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin14.0.0 dyld
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking size of void *... 8
checking for pkg-config... /usr/local/bin/pkg-config
checking size of off_t... 8
checking pkg-config is at least version 0.9.0... yes
checking for MONO_DEPENDENCY... yes
checking for gacutil... /usr/bin/gacutil
checking for al... /usr/bin/al
checking for mono... /usr/bin/mono
checking for PROFILER... yes
checking for gmcs... /usr/bin/gmcs
checking for GLIB... yes
checking for GIO... yes
checking for PANGO... yes
checking for ATK... yes
checking for GTK... no
configure: error: Package requirements (gtk+-3.0 >= 3.0.0) were not met:

Package 'x11', required by 'gdk-3.0', not found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables GTK_CFLAGS
and GTK_LIBS to avoid the need to call pkg-config.
PKG_-CONFIG_-PATH
value:
/Library/Frameworks/Mono.framework/Versions/3.10.0/lib/pkgconfig:/usr/local/ceral/gtk+3/3.12.2/lib/pkgconfig:

我甚至尝试将
GTK_LIBS
设置为“不走运”:
/usr/local/ceral/GTK+3/3.12.2/


如果有任何信息,我可以提供,请让我知道,我会很高兴

我写了一个自制公式来构建这个

class GtkSharp3 < Formula
  homepage "http://www.mono-project.com/GtkSharp"
  url "https://github.com/mono/gtk-sharp/archive/2.99.3.tar.gz"
  version "2.99.3"
  sha256 "6212a59809951e032f6d2712d5a6680203d0d6869f1c09127c4b9fb3c35ad384"

  depends_on "autoconf" => :build
  depends_on "automake" => :build
  depends_on "libtool" => :build
  depends_on "pkg-config"
  depends_on "gtk+3"
  depends_on "pango"
  depends_on "harfbuzz"
  depends_on "glib"
  depends_on :x11

  def install
    ENV.append_path "PKG_CONFIG_PATH", "#{HOMEBREW_PREFIX}/lib/pkgconfig"
    ENV.append_path "PKG_CONFIG_PATH", "/Library/Frameworks/Mono.framework/Versions/Current/lib/pkgconfig"

    inreplace "autogen.sh", "libtoolize", "glibtoolize"
    system "./autogen.sh", "--prefix=#{prefix}"
    system "make", "install"
  end

  test do
    # `test do` will create, run in and delete a temporary directory.
    #
    # This test will fail and we won't accept that! It's enough to just replace
    # "false" with the main program this formula installs, but it'd be nice if you
    # were more thorough. Run the test with `brew test gtk-sharp`. Options passed
    # to `brew install` such as `--HEAD` also need to be provided to `brew test`.
    #
    # The installed folder is not in the path, so use the entire path to any
    # executables being tested: `system "#{bin}/program", "do", "something"`.
    system "false"
  end
end
class GtkSharp3<公式
主页“http://www.mono-project.com/GtkSharp"
url“https://github.com/mono/gtk-sharp/archive/2.99.3.tar.gz"
版本“2.99.3”
sha256“6212A59809951E032F6D2712D5A66800203D0D6869F1C09127C4B9FB3C35AD384”
取决于“autoconf”=>:构建
取决于“automake”=>:构建
取决于“libtool”=>:构建
取决于“包装配置”
取决于“gtk+3”
依靠“盘古”
取决于“哈夫布兹”
依赖“油嘴滑舌”
取决于:x11
def安装
ENV.append_path“PKG_CONFIG_path”,“#{HOMEBREW_PREFIX}/lib/pkgconfig”
ENV.append_path“PKG_CONFIG_path”,“/Library/Frameworks/Mono.framework/Versions/Current/lib/pkgconfig”
替换“autogen.sh”、“libtoolize”、“glibtoolize”
系统“/autogen.sh”,“--prefix=#{prefix}”
系统“制造”、“安装”
结束
试做
#'test do'将创建、运行和删除一个临时目录。
#
#这项测试将失败,我们不会接受!只要换一个就够了
#此公式安装的主程序为“false”,但如果
#我们做得更彻底了。使用“brew test gtk sharp”运行测试。通过的期权
#还需要向“brew测试”提供诸如“-HEAD”之类的“brew安装”。
#
#安装的文件夹不在路径中,因此请将整个路径用于任何文件夹
#正在测试的可执行文件:`system'{bin}/program','do','something`。
系统“错误”
结束
结束
只需将其另存为
/usr/local/Library/Formula/gtk-sharp3.rb
,然后运行
brew安装gtk-sharp3
。运行mono时,您还需要将
/usr/local/lib/pkgconfig
添加到
PKG\u CONFIG\u路径
,以便它可以找到其他包


由于Gtk#3尚未稳定,因此无法将其包含在官方自制存储库中。

再次检查错误消息。它在X11包上出错,而不是GTK。您需要禁用GDK的X11后端,并启用Quartz后端。(这是通过一个
/configure
开关实现的,但我不记得是哪一个开关。)我已经使用macports的gtk软件包成功地在osx上安装了gtk#3,该软件包使用的是quartz变体。您可能还需要64位mono,因为默认情况下macports将安装64位二进制文件我不使用brew,但gtk公式似乎有一个开关,可以使用参数启用石英后端--without-x11安装Hello David时,我没有找到/usr/local/Library/formula/folder,但是我创建了一个你在回答中提到的文件夹。复制文本gtk-sharp3.rb试图执行brew安装gtk-sharp3抛出错误:没有可用公式名称gtk-sharp3。MAC OS版本10.12.6