私は醸造するのが初めてで、今まで素晴らしい効果を発揮してきました。pygame をインストールしようとしていますが、依存関係の 1 つを通過できませんsdl_ttf
。OS X 10.9 (Mavericks) を実行しています。肝心なのは、パッケージを自分でダウンロードして正常にインストールしたのですが、brew はまだそれを要求して失敗し続けているということです。
私の観点からは、依存関係をインストールしたので、そもそもbrewで続行できるはずです。1つのオプションは、依存関係があることをbrewに「納得させる」ことです。別のオプションは、brew の再インストールを支援して、満足できるようにすることです。makeについてはよくわかりませんが、brewはlibtool: link: clang
セクションで失敗しているようです。-lpng15 を -lpng16 にオーバーライドできれば、処理が進むと思います (ただし、間違っている可能性があります)。
pygame (および sdl_ttf 依存関係) のインストールを試みます。
brew install pygame
==> Installing dependencies for pygame: sdl_ttf, pixman, harfbuzz, homebr
==> Installing pygame dependency: sdl_ttf
==> Downloading http://www.libsdl.org/projects/SDL_ttf/release/SDL_ttf-2.0.11.ta
Already downloaded: /Library/Caches/Homebrew/sdl_ttf-2.0.11.tar.gz
==> ./configure --prefix=/usr/local/Cellar/sdl_ttf/2.0.11 --disable-sdltest
==> make install
/bin/sh ./libtool --tag=CC --mode=link clang -g -O2 -I/usr/local/Cellar/freetype/2.5.2/include/freetype2 -D_GNU_SOURCE=1 -D_THREAD_SAFE -I/usr/local/include/SDL -DHAVE_OPENGL -no-undefined -release 2.0 -version-info 10:1:10 -o libSDL_ttf.la -rpath /usr/local/Cellar/sdl_ttf/2.0.11/lib SDL_ttf.lo -L/usr/local/Cellar/freetype/2.5.2/lib -lfreetype -lz -lbz2 -lpng15 -L/usr/local/lib -lSDLmain -lSDL -Wl,-framework,Cocoa
libtool: link: clang -dynamiclib -o .libs/libSDL_ttf-2.0.0.dylib .libs/SDL_ttf.o -L/usr/local/Cellar/freetype/2.5.2/lib -lfreetype -lz -lbz2 -lpng15 -L/usr/local/lib -lSDLmain -lSDL -Wl,-framework -Wl,Cocoa -install_name /usr/local/Cellar/sdl_ttf/2.0.11/lib/libSDL_ttf-2.0.0.dylib -compatibility_version 11 -current_version 11.1 -Wl,-single_module
ld: library not found for -lpng15
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [libSDL_ttf.la] Error 1
libpng15 と libpng16 という名前のライブラリが見つからないという以前のインストールの問題があったため、lpng15 の問題が私の記憶に残っていました。私の勘は正しかったと思います -- SDL2_ttf-2.0.12 ソースをダウンロードして ./configure, make, make install を実行すると、上記の lpng15 ではなく lpng16 が使用されました。
SDL2_ttf-2.0.12 の成功した (醸造ではない) make の出力:
make
/bin/sh ./libtool --tag=CC --mode=compile gcc -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DPACKAGE=\"SDL2_ttf\" -DVERSION=\"2.0.12\" -DHAVE_ALLOCA_H=1 -DHAVE_ALLOCA=1 -I. -g -O2 -I/opt/local/include/freetype2 -I/usr/local/include/SDL2 -D_THREAD_SAFE -DHAVE_OPENGL -MT SDL_ttf.lo -MD -MP -MF .deps/SDL_ttf.Tpo -c -o SDL_ttf.lo SDL_ttf.c
libtool: compile: gcc -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DPACKAGE=\"SDL2_ttf\" -DVERSION=\"2.0.12\" -DHAVE_ALLOCA_H=1 -DHAVE_ALLOCA=1 -I. -g -O2 -I/opt/local/include/freetype2 -I/usr/local/include/SDL2 -D_THREAD_SAFE -DHAVE_OPENGL -MT SDL_ttf.lo -MD -MP -MF .deps/SDL_ttf.Tpo -c SDL_ttf.c -fno-common -DPIC -o .libs/SDL_ttf.o
libtool: compile: gcc -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DPACKAGE=\"SDL2_ttf\" -DVERSION=\"2.0.12\" -DHAVE_ALLOCA_H=1 -DHAVE_ALLOCA=1 -I. -g -O2 -I/opt/local/include/freetype2 -I/usr/local/include/SDL2 -D_THREAD_SAFE -DHAVE_OPENGL -MT SDL_ttf.lo -MD -MP -MF .deps/SDL_ttf.Tpo -c SDL_ttf.c -o SDL_ttf.o >/dev/null 2>&1
mv -f .deps/SDL_ttf.Tpo .deps/SDL_ttf.Plo
/bin/sh ./libtool --tag=CC --mode=link gcc -g -O2 -I/opt/local/include/freetype2 -I/usr/local/include/SDL2 -D_THREAD_SAFE -DHAVE_OPENGL -no-undefined -release 2.0 -version-info 10:2:10 -o libSDL2_ttf.la -rpath /usr/local/lib SDL_ttf.lo -L/opt/local/lib -lfreetype -lz -lbz2 -lpng16 -L/usr/local/lib -lSDL2
libtool: link: gcc -dynamiclib -o .libs/libSDL2_ttf-2.0.0.dylib .libs/SDL_ttf.o -L/opt/local/lib -lfreetype -lz -lbz2 -lpng16 -L/usr/local/lib -lSDL2 -install_name /usr/local/lib/libSDL2_ttf-2.0.0.dylib -compatibility_version 11 -current_version 11.2 -Wl,-single_module
libtool: link: dsymutil .libs/libSDL2_ttf-2.0.0.dylib || :
libtool: link: (cd ".libs" && rm -f "libSDL2_ttf.dylib" && ln -s "libSDL2_ttf-2.0.0.dylib" "libSDL2_ttf.dylib")
libtool: link: ar cru .libs/libSDL2_ttf.a SDL_ttf.o
libtool: link: ranlib .libs/libSDL2_ttf.a
libtool: link: ( cd ".libs" && rm -f "libSDL2_ttf.la" && ln -s "../libSDL2_ttf.la" "libSDL2_ttf.la" )
gcc -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DPACKAGE=\"SDL2_ttf\" -DVERSION=\"2.0.12\" -DHAVE_ALLOCA_H=1 -DHAVE_ALLOCA=1 -I. -g -O2 -I/opt/local/include/freetype2 -I/usr/local/include/SDL2 -D_THREAD_SAFE -DHAVE_OPENGL -MT showfont.o -MD -MP -MF .deps/showfont.Tpo -c -o showfont.o showfont.c
showfont.c:302:47: warning: format specifies type 'short' but the argument has
type 'int' [-Wformat]
TTF_FontHeight(font), text->h);
^~~~~~~
1 warning generated.
mv -f .deps/showfont.Tpo .deps/showfont.Po
/bin/sh ./libtool --tag=CC --mode=link gcc -g -O2 -I/opt/local/include/freetype2 -I/usr/local/include/SDL2 -D_THREAD_SAFE -DHAVE_OPENGL -o showfont showfont.o libSDL2_ttf.la -L/opt/local/lib -lfreetype -lz -lbz2 -lpng16 -L/usr/local/lib -lSDL2
libtool: link: gcc -g -O2 -I/opt/local/include/freetype2 -I/usr/local/include/SDL2 -D_THREAD_SAFE -DHAVE_OPENGL -o .libs/showfont showfont.o ./.libs/libSDL2_ttf.dylib -L/opt/local/lib -L/usr/local/lib -lfreetype -lz -lbz2 -lpng16 -lSDL2
gcc -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DPACKAGE=\"SDL2_ttf\" -DVERSION=\"2.0.12\" -DHAVE_ALLOCA_H=1 -DHAVE_ALLOCA=1 -I. -g -O2 -I/opt/local/include/freetype2 -I/usr/local/include/SDL2 -D_THREAD_SAFE -DHAVE_OPENGL -MT glfont.o -MD -MP -MF .deps/glfont.Tpo -c -o glfont.o glfont.c
glfont.c:386:47: warning: format specifies type 'short' but the argument has
type 'int' [-Wformat]
TTF_FontHeight(font), text->h);
^~~~~~~
1 warning generated.
mv -f .deps/glfont.Tpo .deps/glfont.Po
/bin/sh ./libtool --tag=CC --mode=link gcc -g -O2 -I/opt/local/include/freetype2 -I/usr/local/include/SDL2 -D_THREAD_SAFE -DHAVE_OPENGL -o glfont glfont.o libSDL2_ttf.la -Wl,-framework,OpenGL -L/opt/local/lib -lfreetype -lz -lbz2 -lpng16 -L/usr/local/lib -lSDL2
libtool: link: gcc -g -O2 -I/opt/local/include/freetype2 -I/usr/local/include/SDL2 -D_THREAD_SAFE -DHAVE_OPENGL -o .libs/glfont glfont.o -Wl,-framework -Wl,OpenGL ./.libs/libSDL2_ttf.dylib -L/opt/local/lib -L/usr/local/lib -lfreetype -lz -lbz2 -lpng16 -lSDL2
その最後の部分を見てください-おそらく実行した構成に基づいて、lpng16を使用しました:
libtool: リンク: gcc -g -O2 -I/opt/local/include/freetype2 -I/usr/local/include/SDL2 -D_THREAD_SAFE -DHAVE_OPENGL -o .libs/glfont glfont.o -Wl,-framework -Wl, OpenGL ./.libs/libSDL2_ttf.dylib -L/opt/local/lib -L/usr/local/lib -lfreetype -lz -lbz2 -lpng16 -lSDL2
brew がこのセグメントを実行したとき、lpng15 を使用しようとしたが見つからなかったことを思い出してください。
ld: library not found for -lpng15
この場合のインストールは引き続きスムーズに進みます (ただし、brew はまだわからずsdl_ttf
、投稿の最初から依存関係を望んでいます):
インストール出力を作成します。
make install
./install-sh -c -d '/usr/local/lib'
/bin/sh ./libtool --mode=install /usr/bin/install -c libSDL2_ttf.la '/usr/local/lib'
libtool: install: /usr/bin/install -c .libs/libSDL2_ttf-2.0.0.dylib /usr/local/lib/libSDL2_ttf-2.0.0.dylib
libtool: install: (cd /usr/local/lib && { ln -s -f libSDL2_ttf-2.0.0.dylib libSDL2_ttf.dylib || { rm -f libSDL2_ttf.dylib && ln -s libSDL2_ttf-2.0.0.dylib libSDL2_ttf.dylib; }; })
libtool: install: /usr/bin/install -c .libs/libSDL2_ttf.lai /usr/local/lib/libSDL2_ttf.la
libtool: install: /usr/bin/install -c .libs/libSDL2_ttf.a /usr/local/lib/libSDL2_ttf.a
libtool: install: chmod 644 /usr/local/lib/libSDL2_ttf.a
libtool: install: ranlib /usr/local/lib/libSDL2_ttf.a
----------------------------------------------------------------------
Libraries have been installed in:
/usr/local/lib
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
- add LIBDIR to the `DYLD_LIBRARY_PATH' environment variable
during execution
See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
./install-sh -c -d '/usr/local/include/SDL2'
/usr/bin/install -c -m 644 SDL_ttf.h '/usr/local/include/SDL2'
./install-sh -c -d '/usr/local/lib/pkgconfig'
/usr/bin/install -c -m 644 SDL2_ttf.pc '/usr/local/lib/pkgconfig'