depends: fix some hardcodes

This commit is contained in:
tobtoht 2023-05-28 11:36:16 +02:00
parent f975748713
commit 579725dd8d
No known key found for this signature in database
GPG key ID: E45B10DD027D2472
6 changed files with 44 additions and 37 deletions

View file

@ -90,24 +90,27 @@ $(foreach TOOL,$(cctools_TOOLS),$(eval darwin_$(TOOL) = $$(build_prefix)/bin/$$(
# include search paths, as that would be wrong in general but would also
# break #include_next's.
#
darwin_CC=env -u C_INCLUDE_PATH -u CPLUS_INCLUDE_PATH \
-u OBJC_INCLUDE_PATH -u OBJCPLUS_INCLUDE_PATH -u CPATH \
-u LIBRARY_PATH \
$(clang_prog) --target=$(host) -mmacosx-version-min=$(OSX_MIN_VERSION) \
darwin_CC_=--target=$(host) -mmacosx-version-min=$(OSX_MIN_VERSION) \
-B$(build_prefix)/bin -mlinker-version=$(LD64_VERSION) \
-isysroot$(OSX_SDK) \
-Xclang -internal-externc-isystem$(clang_resource_dir)/include \
-Xclang -internal-externc-isystem$(OSX_SDK)/usr/include
darwin_CXX=env -u C_INCLUDE_PATH -u CPLUS_INCLUDE_PATH \
darwin_CC=env -u C_INCLUDE_PATH -u CPLUS_INCLUDE_PATH \
-u OBJC_INCLUDE_PATH -u OBJCPLUS_INCLUDE_PATH -u CPATH \
-u LIBRARY_PATH \
$(clangxx_prog) --target=$(host) -mmacosx-version-min=$(OSX_MIN_VERSION) \
$(clang_prog) $(darwin_CC_)
darwin_CXX_=--target=$(host) -mmacosx-version-min=$(OSX_MIN_VERSION) \
-B$(build_prefix)/bin -mlinker-version=$(LD64_VERSION) \
-isysroot$(OSX_SDK) \
-stdlib=libc++ \
-stdlib++-isystem$(OSX_SDK)/usr/include/c++/v1 \
-Xclang -internal-externc-isystem$(clang_resource_dir)/include \
-Xclang -internal-externc-isystem$(OSX_SDK)/usr/include
darwin_CXX=env -u C_INCLUDE_PATH -u CPLUS_INCLUDE_PATH \
-u OBJC_INCLUDE_PATH -u OBJCPLUS_INCLUDE_PATH -u CPATH \
-u LIBRARY_PATH \
$(clangxx_prog) $(darwin_CXX_)
darwin_CFLAGS=-pipe
darwin_CXXFLAGS=$(darwin_CFLAGS)

View file

@ -155,6 +155,7 @@ $(package)_config_opts_linux += -system-freetype
$(package)_config_opts_linux += -fontconfig
$(package)_config_opts_linux += -no-opengl
$(package)_config_opts_linux += -no-feature-vulkan
$(package)_config_opts_linux += -no-feature-backtrace
$(package)_config_opts_linux += -dbus-runtime
ifneq ($(LTO),)
$(package)_config_opts_linux += -ltcg
@ -251,8 +252,14 @@ define $(package)_preprocess_cmds
patch -p1 -i $($(package)_patch_dir)/no_wraprt_on_apple.patch && \
mv $($(package)_patch_dir)/WindowsToolchain.cmake . && \
mv $($(package)_patch_dir)/MacToolchain.cmake . && \
sed -i -e 's|@cmake_c_flags@|$(darwin_CC_)|' \
-e 's|@cmake_cxx_flags@|$(darwin_CXX_)|' \
MacToolchain.cmake && \
mv $($(package)_patch_dir)/aarch64Toolchain.cmake . && \
mv $($(package)_patch_dir)/arm64-apple-toolchain.cmake . && \
sed -i -e 's|@cmake_c_flags@|$(darwin_CC_)|' \
-e 's|@cmake_cxx_flags@|$(darwin_CXX_)|' \
arm64-apple-toolchain.cmake && \
mv $($(package)_patch_dir)/gnueabihfToolchain.cmake . && \
mv $($(package)_patch_dir)/riscvToolchain.cmake . && \
cd qtbase && \
@ -275,18 +282,18 @@ define $(package)_config_cmds
endef
else ifeq ($(host_os),mingw32)
define $(package)_config_cmds
cp $(HOME)/.guix-profile/lib/libstrmiids.a \
$(HOME)/.guix-profile/lib/libamstrmid.a \
$(HOME)/.guix-profile/lib/libdmoguids.a \
$(HOME)/.guix-profile/lib/libuuid.a \
$(HOME)/.guix-profile/lib/libmsdmo.a \
$(HOME)/.guix-profile/lib/libole32.a \
$(HOME)/.guix-profile/lib/liboleaut32.a \
$(HOME)/.guix-profile/lib/libmf.a \
$(HOME)/.guix-profile/lib/libmfuuid.a \
$(HOME)/.guix-profile/lib/libmfplat.a \
$(HOME)/.guix-profile/lib/libmfcore.a \
$(HOME)/.guix-profile/lib/libpropsys.a \
cp $(WMF_LIBS)/lib/libstrmiids.a \
$(WMF_LIBS)/lib/libamstrmid.a \
$(WMF_LIBS)/lib/libdmoguids.a \
$(WMF_LIBS)/lib/libuuid.a \
$(WMF_LIBS)/lib/libmsdmo.a \
$(WMF_LIBS)/lib/libole32.a \
$(WMF_LIBS)/lib/liboleaut32.a \
$(WMF_LIBS)/lib/libmf.a \
$(WMF_LIBS)/lib/libmfuuid.a \
$(WMF_LIBS)/lib/libmfplat.a \
$(WMF_LIBS)/lib/libmfcore.a \
$(WMF_LIBS)/lib/libpropsys.a \
/feather/contrib/depends/x86_64-w64-mingw32/lib/ && \
export OPENSSL_LIBS=${$(package)_openssl_flags_$(host_os)} \
export PKG_CONFIG_SYSROOT_DIR=/ && \

View file

@ -9,9 +9,8 @@ set(CMAKE_OSX_SYSROOT ${TARGET_SYSROOT})
set(CMAKE_C_COMPILER clang)
set(CMAKE_CXX_COMPILER clang++)
# TODO: don't hardcode this
set(CMAKE_C_FLAGS "--target=x86_64-apple-darwin -mmacosx-version-min=10.14 -B/feather/contrib/depends/x86_64-apple-darwin/native/bin -mlinker-version=609 -isysroot/feather/contrib/depends/x86_64-apple-darwin/native/SDK -Xclang -internal-externc-isystem/gnu/store/rwsysyzpxzwi7g1jv4hxwi3m8i36iwcc-clang-10.0.1/lib/clang/10.0.1/include -Xclang -internal-externc-isystem/feather/contrib/depends/x86_64-apple-darwin/native/SDK/usr/include")
set(CMAKE_CXX_FLAGS "--target=x86_64-apple-darwin -mmacosx-version-min=10.14 -B/feather/contrib/depends/x86_64-apple-darwin/native/bin -mlinker-version=609 -isysroot/feather/contrib/depends/x86_64-apple-darwin/native/SDK -stdlib=libc++ -stdlib++-isystem/feather/contrib/depends/x86_64-apple-darwin/native/SDK/usr/include/c++/v1 -isystem/feather/contrib/depends/x86_64-apple-darwin/native/SDK/usr/include/c++/v1 -isystem/feather/contrib/depends/x86_64-apple-darwin/native/SDK/usr/include -Xclang -internal-externc-isystem/gnu/store/rwsysyzpxzwi7g1jv4hxwi3m8i36iwcc-clang-10.0.1/lib/clang/10.0.1/include -Xclang -internal-externc-isystem/feather/contrib/depends/x86_64-apple-darwin/native/SDK/usr/include")
set(CMAKE_C_FLAGS "@cmake_c_flags@")
set(CMAKE_CXX_FLAGS "@cmake_cxx_flags@")
set(CMAKE_INSTALL_NAME_TOOL x86_64-apple-darwin-install_name_tool)
set(CMAKE_FIND_ROOT_PATH /feather/contrib/depends/x86_64-apple-darwin/)

View file

@ -9,9 +9,8 @@ set(CMAKE_OSX_SYSROOT ${TARGET_SYSROOT})
set(CMAKE_C_COMPILER clang)
set(CMAKE_CXX_COMPILER clang++)
# TODO: don't hardcode this
set(CMAKE_C_FLAGS "--target=arm64-apple-darwin -mmacosx-version-min=10.14 -B/feather/contrib/depends/arm64-apple-darwin/native/bin -mlinker-version=609 -isysroot/feather/contrib/depends/arm64-apple-darwin/native/SDK -Xclang -internal-externc-isystem/gnu/store/rwsysyzpxzwi7g1jv4hxwi3m8i36iwcc-clang-10.0.1/lib/clang/10.0.1/include -Xclang -internal-externc-isystem/feather/contrib/depends/arm64-apple-darwin/native/SDK/usr/include")
set(CMAKE_CXX_FLAGS "--target=arm64-apple-darwin -mmacosx-version-min=10.14 -B/feather/contrib/depends/arm64-apple-darwin/native/bin -mlinker-version=609 -isysroot/feather/contrib/depends/arm64-apple-darwin/native/SDK -stdlib=libc++ -stdlib++-isystem/feather/contrib/depends/arm64-apple-darwin/native/SDK/usr/include/c++/v1 -isystem/feather/contrib/depends/arm64-apple-darwin/native/SDK/usr/include/c++/v1 -isystem/feather/contrib/depends/arm64-apple-darwin/native/SDK/usr/include -Xclang -internal-externc-isystem/gnu/store/rwsysyzpxzwi7g1jv4hxwi3m8i36iwcc-clang-10.0.1/lib/clang/10.0.1/include -Xclang -internal-externc-isystem/feather/contrib/depends/arm64-apple-darwin/native/SDK/usr/include")
set(CMAKE_C_FLAGS "@cmake_c_flags@")
set(CMAKE_CXX_FLAGS "@cmake_cxx_flags@")
set(CMAKE_INSTALL_NAME_TOOL arm64-apple-darwin-install_name_tool)
set(CMAKE_FIND_ROOT_PATH /feather/contrib/depends/arm64-apple-darwin/)

View file

@ -15,15 +15,11 @@ SET(BUILD_TESTS @build_tests@)
SET(TREZOR_DEBUG @build_tests@)
# where is the target environment
SET(CMAKE_FIND_ROOT_PATH @prefix@ /home/user/.guix-profile/@HOST@)
if(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND ARCHITECTURE STREQUAL "x86_64")
SET(CMAKE_FIND_ROOT_PATH ${CMAKE_FIND_ROOT_PATH} /home/user/.guix-profile/)
endif()
SET(CMAKE_FIND_ROOT_PATH @prefix@)
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
# MWF libs
SET(CMAKE_FIND_ROOT_PATH ${CMAKE_FIND_ROOT_PATH} /gnu/store/3hw9n6yl57lgv01ffi15nk3cj2rjk1km-mingw-w64-x86_64-winpthreads-10.0.0-10.0.0)
# WMF libs
SET(CMAKE_FIND_ROOT_PATH ${CMAKE_FIND_ROOT_PATH} $ENV{WMF_LIBS})
endif()
SET(ENV{PKG_CONFIG_PATH} @prefix@/lib/pkgconfig)

View file

@ -107,6 +107,9 @@ case "$HOST" in
export CROSS_C_INCLUDE_PATH="${CROSS_GCC_LIB}/include:${CROSS_GCC_LIB}/include-fixed:${CROSS_GLIBC}/include"
export CROSS_CPLUS_INCLUDE_PATH="${CROSS_GCC}/include/c++:${CROSS_GCC}/include/c++/${HOST}:${CROSS_GCC}/include/c++/backward:${CROSS_C_INCLUDE_PATH}"
export CROSS_LIBRARY_PATH="${CROSS_GCC_LIB_STORE}/lib:${CROSS_GCC_LIB}:${CROSS_GLIBC}/lib"
WMF_LIBS="$(store_path "mingw-w64-x86_64-winpthreads")"
export WMF_LIBS
;;
*darwin*)
# The CROSS toolchain for darwin uses the SDK and ignores environment variables.