Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[package] sdl_ttf/2.0.18: tries to use PkgConfig and harfbuzz from system #15555

Closed
kambala-decapitator opened this issue Jan 30, 2023 · 4 comments · Fixed by #15560
Closed
Labels
bug Something isn't working

Comments

@kambala-decapitator
Copy link
Contributor

Description

building for Android from macOS, CMake finds Homebrew versions of PkgConfig and harfbuzz. v2.20.1 built fine with harfbuzz disabled though.

issue resembles #12517

Package and Environment Details

  • Package Name/Version: sdl_ttf/2.0.18
  • Operating System+version: macOS 12.6.2
  • Compiler+version: clang 11
  • Conan version: conan 1.57.0
  • Python version: Python 3.10.9

Conan profile

Configuration (profile_host):
[settings]
arch=armv7
build_type=Release
compiler=clang
compiler.libcxx=c++_shared
compiler.version=11
os=Android
os.api_level=19
[options]
[build_requires]
*: android-ndk/r22
[env]
[conf]
tools.cmake.cmaketoolchain:generator=Ninja

Configuration (profile_build):
[settings]
arch=x86_64
arch_build=x86_64
build_type=Release
compiler=apple-clang
compiler.libcxx=libc++
compiler.version=14
os=Macos
os_build=Macos
[options]
[build_requires]
[env]
[conf]
tools.cmake.cmaketoolchain:generator=Ninja

Steps to reproduce

  1. brew install harfbuzz pkg-config
  2. conan install sdl_ttf/2.0.18@ with appropriate profiles

Logs

Click to expand log
sdl_ttf/2.0.18: Applying build-requirement: android-ndk/r22
Downloading conan_sources.tgz completed [0.50k]                                          
Decompressing conan_sources.tgz completed [0.00k]                                        
sdl_ttf/2.0.18: Configuring sources in /Users/kambala/dev/vcmi/conan-deps-android-32/.conan/data/sdl_ttf/2.0.18/_/_/source/src
Downloading release-2.0.18.tar.gz completed [14466.05k]                                  sdl_ttf/2.0.18: .18: 
sdl_ttf/2.0.18: 
sdl_ttf/2.0.18: Copying sources to build folder
sdl_ttf/2.0.18: Building your package in /Users/kambala/dev/vcmi/conan-deps-android-32/.conan/data/sdl_ttf/2.0.18/_/_/build/df7cf4a2daebaf72c6b18d7760cff6081703e765
sdl_ttf/2.0.18: Generator txt created conanbuildinfo.txt
sdl_ttf/2.0.18: Calling generate()
sdl_ttf/2.0.18: Preset 'release' added to CMakePresets.json. Invoke it manually using 'cmake --preset release'
sdl_ttf/2.0.18: If your CMake version is not compatible with CMakePresets (<3.19) call cmake like: 'cmake <path> -G Ninja -DCMAKE_TOOLCHAIN_FILE=/Users/kambala/dev/vcmi/conan-deps-android-32/.conan/data/sdl_ttf/2.0.18/_/_/build/df7cf4a2daebaf72c6b18d7760cff6081703e765/build/Release/generators/conan_toolchain.cmake -DCMAKE_POLICY_DEFAULT_CMP0091=NEW -DCMAKE_BUILD_TYPE=Release'
sdl_ttf/2.0.18: Aggregating env generators
sdl_ttf/2.0.18: Calling build()
sdl_ttf/2.0.18: Apply patch (portability): correct target name, disable PIC fixed
sdl_ttf/2.0.18: CMake command: cmake -G "Ninja" -DCMAKE_TOOLCHAIN_FILE="/Users/kambala/dev/vcmi/conan-deps-android-32/.conan/data/sdl_ttf/2.0.18/_/_/build/df7cf4a2daebaf72c6b18d7760cff6081703e765/build/Release/generators/conan_toolchain.cmake" -DCMAKE_INSTALL_PREFIX="/Users/kambala/dev/vcmi/conan-deps-android-32/.conan/data/sdl_ttf/2.0.18/_/_/package/df7cf4a2daebaf72c6b18d7760cff6081703e765" -DCMAKE_POLICY_DEFAULT_CMP0091="NEW" -DCMAKE_BUILD_TYPE="Release" "/Users/kambala/dev/vcmi/conan-deps-android-32/.conan/data/sdl_ttf/2.0.18/_/_/build/df7cf4a2daebaf72c6b18d7760cff6081703e765/src"
-- Using Conan toolchain: /Users/kambala/dev/vcmi/conan-deps-android-32/.conan/data/sdl_ttf/2.0.18/_/_/build/df7cf4a2daebaf72c6b18d7760cff6081703e765/build/Release/generators/conan_toolchain.cmake
-- Conan toolchain: Setting CMAKE_POSITION_INDEPENDENT_CODE=ON (options.fPIC)
-- Conan toolchain: Setting BUILD_SHARED_LIBS = OFF
-- The C compiler identification is Clang 11.0.5
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Users/kambala/dev/vcmi/conan-deps-android-32/.conan/data/android-ndk/r22/_/_/package/46f53f156846659bf39ad6675fa0ee8156e859fe/bin/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang - skipped
-- Detecting C compile features
-- Detecting C compile features - done
CMake Warning (dev) at /Applications/CMake.app/Contents/share/cmake-3.25/Modules/FindPackageHandleStandardArgs.cmake:438 (message):
  The package name passed to `find_package_handle_standard_args` (PkgConfig)
  does not match the name of the calling package (HarfBuzz).  This can lead
  to problems in calling code that expects `find_package` result variables
  (e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
  /Applications/CMake.app/Contents/share/cmake-3.25/Modules/FindPkgConfig.cmake:99 (find_package_handle_standard_args)
  external/freetype-2.10.4/builds/cmake/FindHarfBuzz.cmake:35 (include)
  external/freetype-2.10.4/CMakeLists.txt:212 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Found PkgConfig: /usr/local/bin/pkg-config (found version "0.29.2") 
CMake Warning (dev) at /Applications/CMake.app/Contents/share/cmake-3.25/Modules/FindPackageHandleStandardArgs.cmake:438 (message):
  The package name passed to `find_package_handle_standard_args` (harfbuzz)
  does not match the name of the calling package (HarfBuzz).  This can lead
  to problems in calling code that expects `find_package` result variables
  (e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
  external/freetype-2.10.4/builds/cmake/FindHarfBuzz.cmake:67 (find_package_handle_standard_args)
  external/freetype-2.10.4/CMakeLists.txt:212 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Found harfbuzz: /usr/local/Cellar/harfbuzz/6.0.0_1/include/harfbuzz (found version "6.0.0") 
-- Conan: Target declared 'PNG::PNG'
-- Conan: Target declared 'ZLIB::ZLIB'
-- Conan: Target declared 'BZip2::BZip2'
-- Conan: Including build module from '/Users/kambala/dev/vcmi/conan-deps-android-32/.conan/data/bzip2/1.0.8/_/_/package/888729481c44b2a5601ff2929bcecc9a4be40682/lib/cmake/conan-official-bzip2-variables.cmake'
CMake Warning (dev) at /Applications/CMake.app/Contents/share/cmake-3.25/Modules/FindPackageHandleStandardArgs.cmake:438 (message):
  The package name passed to `find_package_handle_standard_args` (PkgConfig)
  does not match the name of the calling package (BrotliDec).  This can lead
  to problems in calling code that expects `find_package` result variables
  (e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
  /Applications/CMake.app/Contents/share/cmake-3.25/Modules/FindPkgConfig.cmake:99 (find_package_handle_standard_args)
  external/freetype-2.10.4/builds/cmake/FindBrotliDec.cmake:22 (include)
  external/freetype-2.10.4/CMakeLists.txt:236 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at /Applications/CMake.app/Contents/share/cmake-3.25/Modules/FindPackageHandleStandardArgs.cmake:438 (message):
  The package name passed to `find_package_handle_standard_args` (brotlidec)
  does not match the name of the calling package (BrotliDec).  This can lead
  to problems in calling code that expects `find_package` result variables
  (e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
  external/freetype-2.10.4/builds/cmake/FindBrotliDec.cmake:43 (find_package_handle_standard_args)
  external/freetype-2.10.4/CMakeLists.txt:236 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Could NOT find brotlidec (missing: BROTLIDEC_LIBRARIES) (found version "1.0.9")
-- Looking for unistd.h
-- Looking for unistd.h - found
-- Looking for fcntl.h
-- Looking for fcntl.h - found
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/kambala/dev/vcmi/conan-deps-android-32/.conan/data/sdl_ttf/2.0.18/_/_/build/df7cf4a2daebaf72c6b18d7760cff6081703e765/build/Release
sdl_ttf/2.0.18: CMake command: cmake --build "/Users/kambala/dev/vcmi/conan-deps-android-32/.conan/data/sdl_ttf/2.0.18/_/_/build/df7cf4a2daebaf72c6b18d7760cff6081703e765/build/Release" '--' '-j6'
[1/43] Building C object CMakeFiles/SDL2_ttf.dir/SDL_ttf.c.o
FAILED: CMakeFiles/SDL2_ttf.dir/SDL_ttf.c.o 
/Users/kambala/dev/vcmi/conan-deps-android-32/.conan/data/android-ndk/r22/_/_/package/46f53f156846659bf39ad6675fa0ee8156e859fe/bin/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang --target=armv7-none-linux-androideabi19 --gcc-toolchain=/Users/kambala/dev/vcmi/conan-deps-android-32/.conan/data/android-ndk/r22/_/_/package/46f53f156846659bf39ad6675fa0ee8156e859fe/bin/toolchains/llvm/prebuilt/darwin-x86_64 --sysroot=/Users/kambala/dev/vcmi/conan-deps-android-32/.conan/data/android-ndk/r22/_/_/package/46f53f156846659bf39ad6675fa0ee8156e859fe/bin/toolchains/llvm/prebuilt/darwin-x86_64/sysroot -DSDL2_ttf_EXPORTS -I/Users/kambala/dev/vcmi/conan-deps-android-32/.conan/data/sdl_ttf/2.0.18/_/_/build/df7cf4a2daebaf72c6b18d7760cff6081703e765/src/external/freetype-2.10.4/include -I/Users/kambala/dev/vcmi/conan-deps-android-32/.conan/data/sdl_ttf/2.0.18/_/_/build/df7cf4a2daebaf72c6b18d7760cff6081703e765/src/. -I/Users/kambala/dev/vcmi/conan-deps-android-32/.conan/data/sdl_ttf/2.0.18/_/_/build/df7cf4a2daebaf72c6b18d7760cff6081703e765/build/Release/external/freetype-2.10.4/include -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -march=armv7-a -mthumb -Wformat -Werror=format-security  -Oz -DNDEBUG  -fPIC -MD -MT CMakeFiles/SDL2_ttf.dir/SDL_ttf.c.o -MF CMakeFiles/SDL2_ttf.dir/SDL_ttf.c.o.d -o CMakeFiles/SDL2_ttf.dir/SDL_ttf.c.o -c /Users/kambala/dev/vcmi/conan-deps-android-32/.conan/data/sdl_ttf/2.0.18/_/_/build/df7cf4a2daebaf72c6b18d7760cff6081703e765/src/SDL_ttf.c
/Users/kambala/dev/vcmi/conan-deps-android-32/.conan/data/sdl_ttf/2.0.18/_/_/build/df7cf4a2daebaf72c6b18d7760cff6081703e765/src/SDL_ttf.c:22:10: fatal error: 'SDL.h' file not found
#include "SDL.h"
         ^~~~~~~
1 error generated.
[6/43] Building C object external/freetype-2.10.4/CMakeFiles/freetype.dir/src/autofit/autofit.c.o
In file included from /Users/kambala/dev/vcmi/conan-deps-android-32/.conan/data/sdl_ttf/2.0.18/_/_/build/df7cf4a2daebaf72c6b18d7760cff6081703e765/src/external/freetype-2.10.4/src/autofit/autofit.c:33:
/Users/kambala/dev/vcmi/conan-deps-android-32/.conan/data/sdl_ttf/2.0.18/_/_/build/df7cf4a2daebaf72c6b18d7760cff6081703e765/src/external/freetype-2.10.4/src/autofit/afshaper.c:135:5: warning: 'hb_ot_tags_from_script' is deprecated [-Wdeprecated-declarations]
    hb_ot_tags_from_script( script,
    ^
/usr/local/Cellar/harfbuzz/6.0.0_1/include/harfbuzz/hb-ot-deprecated.h:84:11: note: 'hb_ot_tags_from_script' has been explicitly marked deprecated here
HB_EXTERN HB_DEPRECATED_FOR (hb_ot_tags_from_script_and_language) void
          ^
/usr/local/Cellar/harfbuzz/6.0.0_1/include/harfbuzz/hb-common.h:85:30: note: expanded from macro 'HB_DEPRECATED_FOR'
#define HB_DEPRECATED_FOR(f) HB_DEPRECATED
                             ^
/usr/local/Cellar/harfbuzz/6.0.0_1/include/harfbuzz/hb-common.h:73:38: note: expanded from macro 'HB_DEPRECATED'
#define HB_DEPRECATED __attribute__((__deprecated__))
                                     ^
1 warning generated.
ninja: build stopped: subcommand failed.
sdl_ttf/2.0.18: 
sdl_ttf/2.0.18: ERROR: Package 'df7cf4a2daebaf72c6b18d7760cff6081703e765' build failed
sdl_ttf/2.0.18: WARN: Build folder /Users/kambala/dev/vcmi/conan-deps-android-32/.conan/data/sdl_ttf/2.0.18/_/_/build/df7cf4a2daebaf72c6b18d7760cff6081703e765/build/Release
ERROR: sdl_ttf/2.0.18: Error in build() method, line 97
	cmake.build()
	ConanException: Error 1 while executing cmake --build "/Users/kambala/dev/vcmi/conan-deps-android-32/.conan/data/sdl_ttf/2.0.18/_/_/build/df7cf4a2daebaf72c6b18d7760cff6081703e765/build/Release" '--' '-j6'
@kambala-decapitator kambala-decapitator added the bug Something isn't working label Jan 30, 2023
@SpaceIm
Copy link
Contributor

SpaceIm commented Jan 30, 2023

Try to add a patch replacing https://github.com/libsdl-org/SDL_ttf/blob/release-2.0.18/CMakeLists.txt#L15 by if(0). It's specific to 2.0.18

@kambala-decapitator
Copy link
Contributor Author

Try to add a patch replacing https://github.com/libsdl-org/SDL_ttf/blob/release-2.0.18/CMakeLists.txt#L15 by if(0). It's specific to 2.0.18

do you mean to PR the patch or just apply locally?

@SpaceIm
Copy link
Contributor

SpaceIm commented Jan 30, 2023

Just apply locally, and if it works you can submit a PR to conan-center. As I said it's specific to 2.0.18, it's fixed upstream in more recent versions.

@kambala-decapitator
Copy link
Contributor Author

it helped, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants