mirror of
https://github.com/feather-wallet/feather.git
synced 2024-12-22 03:29:24 +00:00
Bootstrappable builds (WIP) [2]
This commit is contained in:
parent
09a3c7b15d
commit
952d8d9654
189 changed files with 16849 additions and 11101 deletions
|
@ -1,4 +0,0 @@
|
|||
*
|
||||
!contrib/build-deps/verify-packages.sh
|
||||
!contrib/QTBUG-92199-fix.patch
|
||||
!contrib/patches/
|
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -17,3 +17,4 @@ feather.AppDir/*
|
|||
src/assets/tor/*
|
||||
!src/assets/tor/.gitkeep
|
||||
guix-build-*
|
||||
contrib/installers/windows/setup.nsi
|
159
CMakeLists.txt
159
CMakeLists.txt
|
@ -1,29 +1,32 @@
|
|||
cmake_minimum_required(VERSION 3.20)
|
||||
project(feather)
|
||||
cmake_minimum_required(VERSION 3.18)
|
||||
|
||||
message(STATUS "Initiating compile using CMake ${CMAKE_VERSION}")
|
||||
project(feather
|
||||
VERSION "2.1.2"
|
||||
DESCRIPTION "A free Monero desktop wallet"
|
||||
LANGUAGES CXX C ASM
|
||||
)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 14)
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
set(VERSION_MAJOR "2")
|
||||
set(VERSION_MINOR "1")
|
||||
set(VERSION_REVISION "2")
|
||||
set(VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_REVISION}")
|
||||
|
||||
set ( CMAKE_CXX_FLAGS "-no-pie" )
|
||||
#target_compile_options(feather PRIVATE -no-pie)
|
||||
|
||||
option(STATIC "Link libraries statically, requires static Qt")
|
||||
set(PACKAGE_NAME ${PROJECT_NAME})
|
||||
set(PACKAGE_BUGREPORT "https://github.com/feather-wallet/feather/issues")
|
||||
set(PACKAGE_URL "https://featherwallet.org/")
|
||||
set(COPYRIGHT_YEAR "2022")
|
||||
set(COPYRIGHT_HOLDERS "The Monero Project")
|
||||
|
||||
# Configurable options
|
||||
option(STATIC "Link libraries statically, requires static Qt" OFF)
|
||||
option(SELF_CONTAINED "Disable when building Feather for packages" OFF)
|
||||
option(LOCALMONERO "Include LocalMonero module" ON)
|
||||
option(XMRIG "Include XMRig module" ON)
|
||||
option(TOR_DIR "Path to Tor binary to embed inside Feather" OFF)
|
||||
option(TOR_DIR "Directory containing Tor binaries to embed inside Feather" OFF)
|
||||
option(CHECK_UPDATES "Enable checking for application updates" OFF)
|
||||
option(PLATFORM_INSTALLER "Built-in updater fetches installer (windows-only)" OFF)
|
||||
option(USE_DEVICE_TREZOR "Trezor support compilation" ON)
|
||||
option(DONATE_BEG "Prompt donation window every once in a while" ON)
|
||||
|
||||
|
||||
option(WITH_SCANNER "Enable webcam QR scanner" OFF)
|
||||
|
||||
list(INSERT CMAKE_MODULE_PATH 0 "${CMAKE_SOURCE_DIR}/cmake")
|
||||
|
@ -37,14 +40,14 @@ if(DEBUG)
|
|||
set(CMAKE_VERBOSE_MAKEFILE ON)
|
||||
endif()
|
||||
|
||||
set(BUILD_GUI_DEPS ON)
|
||||
option(ARCH "Target architecture" "native")
|
||||
set(BUILD_64 ON)
|
||||
set(USE_SINGLE_BUILDDIR ON)
|
||||
|
||||
check_include_file(sys/prctl.h HAVE_SYS_PRCTL_H)
|
||||
check_symbol_exists(prctl "sys/prctl.h" HAVE_PRCTL)
|
||||
|
||||
# Monero configuration
|
||||
set(BUILD_GUI_DEPS ON)
|
||||
set(BUILD_64 ON)
|
||||
set(USE_SINGLE_BUILDDIR ON)
|
||||
|
||||
if(STATIC)
|
||||
message(STATUS "Initiating static build, turning on manual submodules")
|
||||
set(MANUAL_SUBMODULES 1)
|
||||
|
@ -53,16 +56,19 @@ if(STATIC)
|
|||
set(Boost_USE_STATIC_RUNTIME ON)
|
||||
endif()
|
||||
|
||||
add_subdirectory(monero)
|
||||
include(CMakePackageConfigHelpers)
|
||||
include(VersionFeather)
|
||||
|
||||
#### Dependencies
|
||||
# Monero
|
||||
add_subdirectory(monero EXCLUDE_FROM_ALL)
|
||||
set_property(TARGET wallet_merged PROPERTY FOLDER "monero")
|
||||
get_directory_property(ARCH_WIDTH DIRECTORY "monero" DEFINITION ARCH_WIDTH)
|
||||
get_directory_property(UNBOUND_LIBRARY DIRECTORY "monero" DEFINITION UNBOUND_LIBRARY)
|
||||
get_directory_property(DEVICE_TREZOR_READY DIRECTORY "monero" DEFINITION DEVICE_TREZOR_READY)
|
||||
get_directory_property(TREZOR_DEP_LIBS DIRECTORY "monero" DEFINITION TREZOR_DEP_LIBS)
|
||||
|
||||
include(CMakePackageConfigHelpers)
|
||||
include(VersionFeather)
|
||||
|
||||
# Easylogging
|
||||
include_directories(${EASYLOGGING_INCLUDE})
|
||||
link_directories(${EASYLOGGING_LIBRARY_DIRS})
|
||||
|
||||
|
@ -73,18 +79,15 @@ message(STATUS "libsodium: libraries at ${SODIUM_LIBRARY}")
|
|||
# QrEncode
|
||||
find_package(QREncode REQUIRED)
|
||||
|
||||
# Qr scanner
|
||||
# ZBAR
|
||||
find_package(ZBAR REQUIRED)
|
||||
message(STATUS "libzbar: include dir at ${ZBAR_INCLUDE_DIR}")
|
||||
message(STATUS "libzbar: libraries at ${ZBAR_LIBRARIES}")
|
||||
|
||||
# Tevador 14 word Monero seed
|
||||
add_subdirectory(contrib/monero-seed)
|
||||
|
||||
# Polyseed 16 word mnemonic seeds
|
||||
# Polyseed
|
||||
find_package(Polyseed REQUIRED)
|
||||
if(Polyseed_SUBMODULE)
|
||||
add_subdirectory(src/third-party/polyseed)
|
||||
add_subdirectory(src/third-party/polyseed EXCLUDE_FROM_ALL)
|
||||
endif()
|
||||
|
||||
# libzip
|
||||
|
@ -122,17 +125,6 @@ if(UNIX AND NOT APPLE)
|
|||
# https://github.com/monero-project/monero-gui/issues/3142#issuecomment-705940446
|
||||
set(CMAKE_SKIP_RPATH ON)
|
||||
endif()
|
||||
|
||||
# find_package(X11 REQUIRED)
|
||||
# message(STATUS "X11_FOUND = ${X11_FOUND}")
|
||||
# message(STATUS "X11_INCLUDE_DIR = ${X11_INCLUDE_DIR}")
|
||||
# message(STATUS "X11_LIBRARIES = ${X11_LIBRARIES}")
|
||||
# include_directories(${X11_INCLUDE_DIR})
|
||||
# link_directories(${X11_LIBRARIES})
|
||||
if(STATIC)
|
||||
find_library(XCB_LIBRARY xcb)
|
||||
message(STATUS "Found xcb library: ${XCB_LIBRARY}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
include(TorQrcGenerator)
|
||||
|
@ -163,19 +155,6 @@ else()
|
|||
message(STATUS "Skipping Tor inclusion because -DTOR_DIR=Off")
|
||||
endif()
|
||||
|
||||
if(MINGW)
|
||||
string(REGEX MATCH "^[^/]:/[^/]*" msys2_install_path "${CMAKE_C_COMPILER}")
|
||||
message(STATUS "MSYS location: ${msys2_install_path}")
|
||||
set(CMAKE_INCLUDE_PATH "${msys2_install_path}/mingw${ARCH_WIDTH}/include")
|
||||
# This is necessary because otherwise CMake will make Boost libraries -lfoo
|
||||
# rather than a full path. Unfortunately, this makes the shared libraries get
|
||||
# linked due to a bug in CMake which misses putting -static flags around the
|
||||
# -lfoo arguments.
|
||||
set(DEFLIB ${msys2_install_path}/mingw${ARCH_WIDTH}/lib)
|
||||
list(REMOVE_ITEM CMAKE_C_IMPLICIT_LINK_DIRECTORIES ${DEFLIB})
|
||||
list(REMOVE_ITEM CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES ${DEFLIB})
|
||||
endif()
|
||||
|
||||
message(STATUS "Using Boost include dir at ${Boost_INCLUDE_DIRS}")
|
||||
message(STATUS "Using Boost libraries at ${Boost_LIBRARIES}")
|
||||
|
||||
|
@ -183,11 +162,6 @@ include_directories(SYSTEM ${Boost_INCLUDE_DIRS})
|
|||
if(MINGW)
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wa,-mbig-obj")
|
||||
set(EXTRA_LIBRARIES mswsock;ws2_32;iphlpapi;crypt32;bcrypt)
|
||||
# if(DEPENDS)
|
||||
# set(ICU_LIBRARIES iconv)
|
||||
# else()
|
||||
# set(ICU_LIBRARIES icuio icuin icuuc icudt icutu iconv)
|
||||
# endif()
|
||||
elseif(APPLE)
|
||||
set(EXTRA_LIBRARIES "-framework AppKit")
|
||||
elseif(OPENBSD)
|
||||
|
@ -208,13 +182,7 @@ list(APPEND EXTRA_LIBRARIES ${CMAKE_DL_LIBS})
|
|||
|
||||
if(APPLE)
|
||||
cmake_policy(SET CMP0042 NEW)
|
||||
endif()
|
||||
|
||||
if (APPLE AND NOT IOS)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=default -std=c++11")
|
||||
endif()
|
||||
|
||||
if(APPLE)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=default -DGTEST_HAS_TR1_TUPLE=0")
|
||||
endif()
|
||||
|
||||
|
@ -237,7 +205,7 @@ if (NOT OPENBSD AND NOT (WIN32 AND (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND CMAKE
|
|||
add_c_flag_if_supported(-fcf-protection=full C_SECURITY_FLAGS)
|
||||
add_cxx_flag_if_supported(-fcf-protection=full CXX_SECURITY_FLAGS)
|
||||
endif()
|
||||
if (NOT WIN32 AND NOT OPENBSD)
|
||||
if (NOT WIN32 AND NOT OPENBSD AND NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
|
||||
add_c_flag_if_supported(-fstack-clash-protection C_SECURITY_FLAGS)
|
||||
add_cxx_flag_if_supported(-fstack-clash-protection CXX_SECURITY_FLAGS)
|
||||
endif()
|
||||
|
@ -254,10 +222,10 @@ if (APPLE)
|
|||
add_linker_flag_if_supported(-Wl,-dead_strip LD_SECURITY_FLAGS)
|
||||
add_linker_flag_if_supported(-Wl,-dead_strip_dylibs LD_SECURITY_FLAGS)
|
||||
endif()
|
||||
#if (NOT APPLE AND NOT (WIN32 AND CMAKE_C_COMPILER_ID STREQUAL "GNU"))
|
||||
# # Windows binaries die on startup with PIE when compiled with GCC
|
||||
# add_linker_flag_if_supported(-pie LD_SECURITY_FLAGS)
|
||||
#endif()
|
||||
if (NOT APPLE AND NOT (WIN32 AND CMAKE_C_COMPILER_ID STREQUAL "GNU"))
|
||||
# Windows binaries die on startup with PIE when compiled with GCC
|
||||
add_linker_flag_if_supported(-pie LD_SECURITY_FLAGS)
|
||||
endif()
|
||||
add_linker_flag_if_supported(-Wl,-z,relro LD_SECURITY_FLAGS)
|
||||
add_linker_flag_if_supported(-Wl,-z,now LD_SECURITY_FLAGS)
|
||||
add_linker_flag_if_supported(-Wl,-z,noexecstack noexecstack_SUPPORTED)
|
||||
|
@ -276,6 +244,14 @@ if (WIN32)
|
|||
add_linker_flag_if_supported(-Wl,--high-entropy-va LD_SECURITY_FLAGS)
|
||||
endif()
|
||||
|
||||
if(STATIC)
|
||||
# add_linker_flag_if_supported(-static-libgcc STATIC_FLAGS)
|
||||
# add_linker_flag_if_supported(-static-libstdc++ STATIC_FLAGS)
|
||||
if(MINGW)
|
||||
add_linker_flag_if_supported(-static STATIC_FLAGS)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
add_c_flag_if_supported(-fPIC C_SECURITY_FLAGS)
|
||||
add_cxx_flag_if_supported(-fPIC CXX_SECURITY_FLAGS)
|
||||
|
||||
|
@ -288,3 +264,48 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 ${CXX_SECURITY_FLAGS}")
|
|||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${LD_SECURITY_FLAGS} ${STATIC_FLAGS}")
|
||||
|
||||
add_subdirectory(src)
|
||||
|
||||
configure_file("${CMAKE_SOURCE_DIR}/contrib/installers/windows/setup.nsi.in" "${CMAKE_SOURCE_DIR}/contrib/installers/windows/setup.nsi" @ONLY)
|
||||
|
||||
if(APPLE AND CMAKE_CROSSCOMPILING)
|
||||
set(macos_app "feather.app")
|
||||
configure_file(contrib/macdeploy/background.tiff contrib/macdeploy/background.tiff COPYONLY)
|
||||
configure_file(contrib/macdeploy/Info.plist.in ${macos_app}/Contents/Info.plist @ONLY)
|
||||
configure_file(src/assets/images/appicons/appicon.icns ${macos_app}/Contents/Resources/appicon.icns COPYONLY)
|
||||
|
||||
set(xorrisofs_options)
|
||||
if(DEFINED ENV{SOURCE_DATE_EPOCH})
|
||||
set(xorrisofs_options -volume_date all_file_dates =$ENV{SOURCE_DATE_EPOCH})
|
||||
endif()
|
||||
add_custom_target(deploy
|
||||
COMMAND "${CMAKE_COMMAND}" --install "${CMAKE_BINARY_DIR}" --config "$<CONFIG>" --prefix "${CMAKE_BINARY_DIR}/release" --strip
|
||||
COMMAND "${CMAKE_COMMAND}" -E make_directory "${CMAKE_BINARY_DIR}/${macos_app}/Contents/MacOS"
|
||||
COMMAND "${CMAKE_COMMAND}" -E rename "${CMAKE_BINARY_DIR}/bin/$<TARGET_FILE_NAME:feather>" "${CMAKE_BINARY_DIR}/${macos_app}/Contents/MacOS/feather"
|
||||
COMMAND PYTHONPATH=${PYTHONPATH} INSTALL_NAME_TOOL=${CMAKE_INSTALL_NAME_TOOL} OTOOL=${OTOOL} STRIP=${CMAKE_STRIP} ${CMAKE_SOURCE_DIR}/contrib/macdeploy/macdeployqtplus ${macos_app} ${PACKAGE_NAME}
|
||||
COMMAND xorrisofs -D -l -V "${PACKAGE_NAME}" -no-pad -r -dir-mode 0755 -o ${PACKAGE_NAME}.dmg ${CMAKE_BINARY_DIR}/dist -- ${xorrisofs_options}
|
||||
VERBATIM
|
||||
)
|
||||
endif()
|
||||
|
||||
SET(CPACK_GENERATOR "DEB")
|
||||
SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "tobtoht") #required
|
||||
INCLUDE(CPack)
|
||||
|
||||
message("\n")
|
||||
message("Configure summary")
|
||||
message("=================")
|
||||
|
||||
if(CMAKE_CROSSCOMPILING)
|
||||
set(cross_status "TRUE, for ${CMAKE_SYSTEM_NAME}, ${CMAKE_SYSTEM_PROCESSOR}")
|
||||
else()
|
||||
set(cross_status "FALSE")
|
||||
endif()
|
||||
message("Cross compiling ....................... ${cross_status}")
|
||||
get_directory_property(definitions COMPILE_DEFINITIONS)
|
||||
message("Preprocessor defined macros ........... ${definitions}")
|
||||
message("C compiler ............................ ${CMAKE_C_COMPILER}")
|
||||
message("CFLAGS ................................ ${CMAKE_C_FLAGS}")
|
||||
message("C++ compiler .......................... ${CMAKE_CXX_COMPILER}")
|
||||
message("CXXFLAGS .............................. ${CMAKE_CXX_FLAGS}")
|
||||
message("LDFLAGS for executables ............... ${CMAKE_EXE_LINKER_FLAGS}")
|
||||
message("\n")
|
||||
|
|
15
HACKING.md
15
HACKING.md
|
@ -16,7 +16,7 @@ https://www.qt.io/download (under open-source).
|
|||
#### Arch Linux
|
||||
|
||||
```bash
|
||||
pacman -S git cmake base-devel ccache unbound boost qrencode zbar qt6-base qt6-svg qt6-websockets libzip hidapi protobuf
|
||||
pacman -S git cmake base-devel ccache unbound boost qrencode zbar qt6-base qt6-svg qt6-websockets qt6-multimedia libzip hidapi protobuf
|
||||
```
|
||||
|
||||
#### Ubuntu 22.04
|
||||
|
@ -77,9 +77,8 @@ We recommend using Jetbrains Clion for Feather development. It integrates nicely
|
|||
debugger.
|
||||
|
||||
To pass CMake flags to CLion, go to `File->Settings->Build->CMake`, set Build Type to `Debug` and set your
|
||||
preferred CMake options/definitions. Add `-DARCH=x86-64` to the CMake options. If you installed Qt using the online
|
||||
installer you may have to add `-DCMAKE_PREFIX_PATH=/path/to/qt/installation` in the CMake options. More CMake options
|
||||
are documented below.
|
||||
preferred CMake options. If you installed Qt using the online installer you may have to add
|
||||
`-DCMAKE_PREFIX_PATH=/path/to/qt/installation` in the CMake options. More CMake options are documented below.
|
||||
|
||||
Run CMake (`View -> Tool Windows -> CMake`). Click on the 🔃 (`Reload CMake Project`) button.
|
||||
|
||||
|
@ -95,8 +94,12 @@ After the target is configured, `Run -> Run 'feather'` or press Shift + F10 to b
|
|||
|
||||
To build Feather without an IDE:
|
||||
|
||||
- Linux: `make release`
|
||||
- macOS: `make mac-release`
|
||||
```bash
|
||||
mkdir build && \
|
||||
cd build && \
|
||||
cmake .. && \
|
||||
cmake --build . -j $(nproc)
|
||||
```
|
||||
|
||||
### CMake
|
||||
|
||||
|
|
110
Makefile
110
Makefile
|
@ -1,110 +0,0 @@
|
|||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# SPDX-FileCopyrightText: 2020-2022 The Monero Project
|
||||
|
||||
CMAKEFLAGS = \
|
||||
-DTOR_DIR=$(or ${TOR_DIR}, Off) \
|
||||
-DTOR_VERSION=$(or ${TOR_VERSION}, Off) \
|
||||
-DCHECK_UPDATES=$(or ${CHECK_UPDATES}, Off) \
|
||||
-DWITH_SCANNER=$(or ${WITH_SCANNER}, Off) \
|
||||
-DREPRODUCIBLE=$(or ${SOURCE_DATE_EPOCH}, Off)
|
||||
|
||||
guix:
|
||||
mkdir -p build/$(target)/release && \
|
||||
cd build/$(target)/release && \
|
||||
cmake -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \
|
||||
-DCMAKE_PREFIX_PATH=/gnu/store \
|
||||
-DCMAKE_PREFIX_PATH=$(CURDIR)/contrib/depends/$(target) \
|
||||
-DCMAKE_PREFIX_PATH=$(CURDIR)/contrib/depends/$(target)/native/bin \
|
||||
-DCMAKE_TOOLCHAIN_FILE=/feather/contrib/depends/$(target)/share/toolchain.cmake ../../.. \
|
||||
$(CMAKEFLAGS) && \
|
||||
$(MAKE)
|
||||
|
||||
release:
|
||||
mkdir -p build/release && \
|
||||
cd build/release && \
|
||||
cmake \
|
||||
-DARCH=x86-64 \
|
||||
-D BUILD_TAG="linux-x64" \
|
||||
-D CMAKE_BUILD_TYPE=Release \
|
||||
$(CMAKEFLAGS) \
|
||||
../.. && \
|
||||
$(MAKE)
|
||||
|
||||
release-static:
|
||||
mkdir -p build/release && \
|
||||
cd build/release && \
|
||||
cmake \
|
||||
-DARCH=x86-64 \
|
||||
-D BUILD_TAG="linux-x64" \
|
||||
-D CMAKE_BUILD_TYPE=Release \
|
||||
-D STATIC=On \
|
||||
$(CMAKEFLAGS) \
|
||||
../.. && \
|
||||
$(MAKE)
|
||||
|
||||
release-static-linux-arm64:
|
||||
mkdir -p build/release && \
|
||||
cd build/release && \
|
||||
cmake \
|
||||
-D ARCH="armv8-a" \
|
||||
-D BUILD_TAG="linux-armv8" \
|
||||
-D CMAKE_BUILD_TYPE=Release \
|
||||
-D STATIC=On \
|
||||
$(CMAKEFLAGS) \
|
||||
../.. && \
|
||||
$(MAKE)
|
||||
|
||||
release-static-linux-arm64-rpi:
|
||||
mkdir -p build/release && \
|
||||
cd build/release && \
|
||||
cmake \
|
||||
-D ARCH="armv8-a" \
|
||||
-D NO_AES=On \
|
||||
-D BUILD_TAG="linux-armv8-noaes" \
|
||||
-D CMAKE_BUILD_TYPE=Release \
|
||||
-D STATIC=On \
|
||||
$(CMAKEFLAGS) \
|
||||
../.. && \
|
||||
$(MAKE)
|
||||
|
||||
release-static-windows:
|
||||
mkdir -p build/$(target)/release && \
|
||||
cd build/$(target)/release && \
|
||||
cmake \
|
||||
-DARCH=x86-64 \
|
||||
-D BUILD_TAG=$(tag) \
|
||||
-D CMAKE_BUILD_TYPE=Release \
|
||||
-D STATIC=ON \
|
||||
-D CMAKE_TOOLCHAIN_FILE=$(root)/$(target)/share/toolchain.cmake \
|
||||
$(CMAKEFLAGS) \
|
||||
../../.. && \
|
||||
$(MAKE)
|
||||
|
||||
release-static-windows-installer:
|
||||
mkdir -p build/$(target)/release && \
|
||||
cd build/$(target)/release && \
|
||||
cmake \
|
||||
-D PLATFORM_INSTALLER=On \
|
||||
-DARCH=x86-64 \
|
||||
-D BUILD_TAG=$(tag) \
|
||||
-D CMAKE_BUILD_TYPE=Release \
|
||||
-D STATIC=ON \
|
||||
-D CMAKE_TOOLCHAIN_FILE=$(root)/$(target)/share/toolchain.cmake \
|
||||
$(CMAKEFLAGS) \
|
||||
-D TOR_DIR=Off \
|
||||
-D TOR_VERSION=Off \
|
||||
../../.. && \
|
||||
$(MAKE)
|
||||
|
||||
mac-release:
|
||||
mkdir -p build && \
|
||||
cd build && \
|
||||
cmake \
|
||||
-DARCH=native \
|
||||
-D BUILD_TAG="mac-x64" \
|
||||
-D CMAKE_BUILD_TYPE=Release \
|
||||
-D STATIC=Off \
|
||||
$(CMAKEFLAGS) \
|
||||
.. && \
|
||||
$(MAKE) && \
|
||||
$(MAKE) deploy
|
|
@ -1,29 +0,0 @@
|
|||
if(APPLE OR (WIN32 AND NOT STATIC))
|
||||
add_custom_target(deploy)
|
||||
get_target_property(_qmake_executable Qt::qmake IMPORTED_LOCATION)
|
||||
get_filename_component(_qt_bin_dir "${_qmake_executable}" DIRECTORY)
|
||||
|
||||
if(APPLE AND NOT IOS)
|
||||
find_program(MACDEPLOYQT_EXECUTABLE macdeployqt HINTS "${_qt_bin_dir}")
|
||||
MESSAGE(INFO "MACDEPLOY ${MACDEPLOYQT_EXECUTABLE}")
|
||||
add_custom_command(TARGET deploy
|
||||
POST_BUILD
|
||||
COMMAND "${MACDEPLOYQT_EXECUTABLE}" "$<TARGET_FILE_DIR:feather>/../.." -always-overwrite
|
||||
COMMENT "Running macdeployqt..."
|
||||
)
|
||||
|
||||
# workaround for a Qt bug that requires manually adding libqsvg.dylib to bundle
|
||||
find_file(_qt_svg_dylib "libqsvg.dylib" PATHS "${CMAKE_PREFIX_PATH}/plugins/imageformats" NO_DEFAULT_PATH)
|
||||
if(_qt_svg_dylib)
|
||||
add_custom_command(TARGET deploy
|
||||
POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${_qt_svg_dylib} $<TARGET_FILE_DIR:feather>/../PlugIns/imageformats/
|
||||
COMMAND ${CMAKE_INSTALL_NAME_TOOL} -change "${CMAKE_PREFIX_PATH}/lib/QtGui.framework/Versions/5/QtGui" "@executable_path/../Frameworks/QtGui.framework/Versions/5/QtGui" $<TARGET_FILE_DIR:feather>/../PlugIns/imageformats/libqsvg.dylib
|
||||
COMMAND ${CMAKE_INSTALL_NAME_TOOL} -change "${CMAKE_PREFIX_PATH}/lib/QtWidgets.framework/Versions/5/QtWidgets" "@executable_path/../Frameworks/QtGui.framework/Versions/5/QtGui" $<TARGET_FILE_DIR:feather>/../PlugIns/imageformats/libqsvg.dylib
|
||||
COMMAND ${CMAKE_INSTALL_NAME_TOOL} -change "${CMAKE_PREFIX_PATH}/lib/QtSvg.framework/Versions/5/QtSvg" "@executable_path/../Frameworks/QtGui.framework/Versions/5/QtGui" $<TARGET_FILE_DIR:feather>/../PlugIns/imageformats/libqsvg.dylib
|
||||
COMMAND ${CMAKE_INSTALL_NAME_TOOL} -change "${CMAKE_PREFIX_PATH}/lib/QtCore.framework/Versions/5/QtCore" "@executable_path/../Frameworks/QtGui.framework/Versions/5/QtGui" $<TARGET_FILE_DIR:feather>/../PlugIns/imageformats/libqsvg.dylib
|
||||
COMMENT "Copying libqsvg.dylib, running install_name_tool"
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
|
@ -1,21 +0,0 @@
|
|||
find_package(PkgConfig)
|
||||
|
||||
if(PkgConfig_FOUND)
|
||||
pkg_check_modules(PC_ZLIB QUIET ZLIB)
|
||||
if(PC_ZLIB_FOUND)
|
||||
set(ZLIB_DEFINITIONS ${PC_ZLIB_CFLAGS_OTHER})
|
||||
find_library(ZLIB_LIBRARIES NAMES ZLIB HINTS ${PC_ZLIB_LIBDIR} ${PC_ZLIB_LIBRARY_DIRS})
|
||||
find_path(ZLIB_INCLUDE_DIR Decoder.h HINTS ${PC_ZLIB_INCLUDEDIR} ${PC_ZLIB_INCLUDE_DIRS})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(NOT ZLIB_INCLUDE_DIR)
|
||||
find_path(ZLIB_H_PATH ZLIB.h)
|
||||
if(ZLIB_H_PATH)
|
||||
set(ZLIB_INCLUDE_DIR "${ZLIB_H_PATH}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(ZLIB DEFAULT_MSG ZLIB_LIBRARIES ZLIB_INCLUDE_DIR)
|
||||
message(STATUS "Found ZLIB libraries ${ZLIB_LIBRARIES}")
|
|
@ -3,9 +3,6 @@
|
|||
HERE="$(dirname "$(readlink -f "${0}")")"
|
||||
echo $HERE
|
||||
|
||||
export GST_PLUGIN_SCANNER=$(readlink -f $(dirname "$0")/usr/lib/gst-plugin-scanner)
|
||||
export GST_PLUGIN_SYSTEM_PATH=$(readlink -f $(dirname "$0")/usr/lib)
|
||||
# Tails 5.8 sets QT_QPA_PLATFORM to wayland which breaks our app
|
||||
export QT_QPA_PLATFORM=xcb
|
||||
|
||||
${APPDIR}/usr/bin/feather $*
|
||||
|
|
43
contrib/AppImage/build-appimage.sh
Executable file
43
contrib/AppImage/build-appimage.sh
Executable file
|
@ -0,0 +1,43 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
unset SOURCE_DATE_EPOCH
|
||||
|
||||
APPDIR="$PWD/feather.AppDir"
|
||||
|
||||
mkdir -p "$APPDIR"
|
||||
mkdir -p "$APPDIR/usr/share/applications/"
|
||||
mkdir -p "$APPDIR/usr/bin"
|
||||
mkdir -p "$APPDIR/usr/lib"
|
||||
mkdir -p "$APPDIR/usr/plugins"
|
||||
|
||||
cp "src/assets/feather.desktop" "$APPDIR/usr/share/applications/feather.desktop"
|
||||
cp "src/assets/images/appicons/64x64.png" "$APPDIR/feather.png"
|
||||
cp "build/bin/feather" "$APPDIR/usr/bin/feather"
|
||||
chmod +x "$APPDIR/usr/bin/feather"
|
||||
|
||||
export LD_LIBRARY_PATH=/feather/contrib/depends/x86_64-linux-gnu/lib/:/gnu/store:/gnu/store/yk91cxchassi5ykxsyd4vci32vncgjkf-gcc-cross-x86_64-linux-gnu-10.3.0-lib/x86_64-linux-gnu/lib
|
||||
|
||||
# fuck you linuxdeployqt
|
||||
mkdir -p "$APPDIR/usr/share/doc/libc6"
|
||||
touch "$APPDIR/usr/share/doc/libc6/copyright"
|
||||
|
||||
linuxdeployqt feather.AppDir/usr/share/applications/feather.desktop -verbose=2 -bundle-non-qt-libs -unsupported-allow-new-glibc
|
||||
|
||||
rm "$APPDIR/AppRun"
|
||||
cp "contrib/AppImage/AppRun" "$APPDIR/"
|
||||
chmod +x "$APPDIR/AppRun"
|
||||
|
||||
find feather.AppDir/ -exec touch -h -a -m -t 202101010100.00 {} \;
|
||||
|
||||
# Manually create AppImage (reproducibly)
|
||||
|
||||
mksquashfs feather.AppDir feather.squashfs -info -root-owned -no-xattrs -noappend -fstime 0
|
||||
# mksquashfs writes a timestamp to the header
|
||||
printf '\x00\x00\x00\x00' | dd conv=notrunc of=feather.squashfs bs=1 seek=$((0x8))
|
||||
|
||||
rm -f feather.AppImage
|
||||
## Don't hardcode this
|
||||
cat /feather/contrib/depends/x86_64-linux-gnu/runtime-x86_64 >> feather.AppImage
|
||||
cat feather.squashfs >> feather.AppImage
|
||||
chmod a+x feather.AppImage
|
|
@ -1,17 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
# Wrapper to launch gst-plugin-scanner inside the AppImage.
|
||||
|
||||
HERE="$(dirname "$(readlink -f "${0}")")"
|
||||
export PATH="${HERE}:${PATH}"
|
||||
|
||||
binary=$(find "$HERE" -name "gst-plugin-scanner-x86_64" | head -n 1)
|
||||
LD_LINUX=$(find "$HERE/../../../" -name 'ld-*.so.*' | head -n 1)
|
||||
if [ -e "$LD_LINUX" ] ; then
|
||||
case $line in
|
||||
"ld-linux"*) exec "${LD_LINUX}" --inhibit-cache "${binary}" "$@" ;;
|
||||
*) exec "${LD_LINUX}" "${binary}" "$@" ;;
|
||||
esac
|
||||
else
|
||||
exec "${binary}" "$@"
|
||||
fi
|
|
@ -1,46 +0,0 @@
|
|||
diff --git a/src/widgets/styles/qstylesheetstyle.cpp b/src/widgets/styles/qstylesheetstyle.cpp
|
||||
index 2ab9756f8d..a9d6ecd51a 100644
|
||||
--- a/src/widgets/styles/qstylesheetstyle.cpp
|
||||
+++ b/src/widgets/styles/qstylesheetstyle.cpp
|
||||
@@ -1465,7 +1465,6 @@ void QRenderRule::configurePalette(QPalette *p, QPalette::ColorGroup cg, const Q
|
||||
p->setBrush(cg, w->foregroundRole(), pal->foreground);
|
||||
p->setBrush(cg, QPalette::WindowText, pal->foreground);
|
||||
p->setBrush(cg, QPalette::Text, pal->foreground);
|
||||
- p->setBrush(cg, QPalette::PlaceholderText, pal->foreground);
|
||||
}
|
||||
if (pal->selectionBackground.style() != Qt::NoBrush)
|
||||
p->setBrush(cg, QPalette::Highlight, pal->selectionBackground);
|
||||
diff --git a/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp b/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp
|
||||
index 26868a763c..82527849b0 100644
|
||||
--- a/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp
|
||||
+++ b/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp
|
||||
@@ -126,7 +126,6 @@ private slots:
|
||||
void QTBUG15910_crashNullWidget();
|
||||
void QTBUG36933_brokenPseudoClassLookup();
|
||||
void styleSheetChangeBeforePolish();
|
||||
- void placeholderColor();
|
||||
//at the end because it mess with the style.
|
||||
void widgetStyle();
|
||||
void appStyle();
|
||||
@@ -2230,21 +2229,6 @@ void tst_QStyleSheetStyle::highdpiImages()
|
||||
QHighDpiScaling::updateHighDpiScaling(); // reset to normal
|
||||
}
|
||||
|
||||
-void tst_QStyleSheetStyle::placeholderColor()
|
||||
-{
|
||||
- const QColor red(Qt::red);
|
||||
- qApp->setStyleSheet("* { color: red; }");
|
||||
- QLineEdit le1;
|
||||
- QLineEdit le2;
|
||||
- le2.setEnabled(false);
|
||||
- le1.ensurePolished();
|
||||
- QCOMPARE(le1.palette().placeholderText(), red);
|
||||
- le2.ensurePolished();
|
||||
- QCOMPARE(le2.palette().placeholderText(), red);
|
||||
- le2.setEnabled(true);
|
||||
- QCOMPARE(le2.palette().placeholderText(), red);
|
||||
-}
|
||||
-
|
||||
QTEST_MAIN(tst_QStyleSheetStyle)
|
||||
#include "tst_qstylesheetstyle.moc"
|
||||
|
|
@ -1,79 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
# TODO: Merge with build-appimage.sh
|
||||
|
||||
set -e
|
||||
unset SOURCE_DATE_EPOCH
|
||||
|
||||
# Temporary workaround for linuxdeployqt issue on arm64
|
||||
if [ "$(uname -m)" = "aarch64" ]; then
|
||||
pushd /
|
||||
apt update
|
||||
apt install -y qt5-default
|
||||
git clone https://github.com/probonopd/linuxdeployqt.git
|
||||
cd linuxdeployqt
|
||||
git reset --hard b4697483c98120007019c3456914cfd1dba58384
|
||||
qmake
|
||||
make -j$THREADS
|
||||
make install
|
||||
rm -rf $(pwd)
|
||||
popd
|
||||
fi
|
||||
|
||||
APPDIR="$PWD/feather.AppDir"
|
||||
rm -rf $APPDIR
|
||||
mkdir -p "$APPDIR"
|
||||
mkdir -p "$APPDIR/usr/share/applications/"
|
||||
mkdir -p "$APPDIR/usr/bin"
|
||||
mkdir -p "$APPDIR/usr/lib"
|
||||
mkdir -p "$APPDIR/usr/plugins"
|
||||
|
||||
cp "$PWD/../src/assets/feather.desktop" "$APPDIR/usr/share/applications/feather.desktop"
|
||||
cp "$PWD/../src/assets/images/appicons/64x64.png" "$APPDIR/feather.png"
|
||||
cp "$PWD/release/bin/feather" "$APPDIR/usr/bin/feather"
|
||||
chmod +x "$APPDIR/usr/bin/feather"
|
||||
|
||||
export LD_LIBRARY_PATH=/usr/lib/aarch64-linux-gnu/:/usr/local/lib/$LD_LIBRARY_PATH
|
||||
linuxdeployqt feather.AppDir/usr/share/applications/feather.desktop -verbose=2 -bundle-non-qt-libs
|
||||
|
||||
pushd feather.AppDir/usr/plugins
|
||||
ln -s ../lib/ gstreamer
|
||||
popd
|
||||
|
||||
GST_PLUGINS=("libgstcamerabin.so libgstcoreelements.so libgstvolume.so libgstapp.so libgstvideoconvert.so
|
||||
libgstvideoscale.so libgstvideo4linux2.so libgstencoding.so libgstmultifile.so libgstmatroska.so
|
||||
libgstvpx.so libgstjpegformat.so libgstjpeg.so libgstautodetect.so libgstaudiotestsrc.so
|
||||
libgstvorbis.so libgstaudiorate.so libgstaudioconvert.so libgstaudioresample.so libgstvideocrop.so")
|
||||
|
||||
for plugin in ${GST_PLUGINS[*]}; do
|
||||
cp /usr/lib/aarch64-linux-gnu/gstreamer-1.0/$plugin feather.AppDir/usr/plugins/gstreamer/
|
||||
|
||||
# linuxdeployqt doesn't set RUNPATH on libs that are only loaded at runtime
|
||||
patchelf --set-rpath "\$ORIGIN" feather.AppDir/usr/plugins/gstreamer/$plugin
|
||||
done
|
||||
|
||||
cp /usr/lib/aarch64-linux-gnu/gstreamer1.0/gstreamer-1.0/gst-plugin-scanner feather.AppDir/usr/plugins/gstreamer/
|
||||
|
||||
# Need second deploy for gstreamer dependencies
|
||||
linuxdeployqt feather.AppDir/usr/share/applications/feather.desktop -verbose=2 -bundle-non-qt-libs
|
||||
|
||||
rm "$APPDIR/AppRun"
|
||||
cp "$PWD/../contrib/AppImage/AppRun" "$APPDIR/"
|
||||
chmod +x "$APPDIR/AppRun"
|
||||
|
||||
find feather.AppDir/ -exec touch -h -a -m -t 202101010100.00 {} \;
|
||||
|
||||
# Manually create AppImage (reproducibly)
|
||||
|
||||
# download runtime
|
||||
wget -nc https://github.com/AppImage/AppImageKit/releases/download/13/runtime-aarch64
|
||||
echo "d2624ce8cc2c64ef76ba986166ad67f07110cdbf85112ace4f91611bc634c96a runtime-aarch64" | sha256sum -c
|
||||
|
||||
mksquashfs feather.AppDir feather.squashfs -info -root-owned -no-xattrs -noappend -fstime 0
|
||||
# mksquashfs writes a timestamp to the header
|
||||
printf '\x00\x00\x00\x00' | dd conv=notrunc of=feather.squashfs bs=1 seek=$((0x8))
|
||||
|
||||
rm -f feather.AppImage
|
||||
cat runtime-aarch64 >> feather.AppImage
|
||||
cat feather.squashfs >> feather.AppImage
|
||||
chmod a+x feather.AppImage
|
|
@ -1,62 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
unset SOURCE_DATE_EPOCH
|
||||
|
||||
APPDIR="$PWD/feather.AppDir"
|
||||
rm -rf $APPDIR
|
||||
mkdir -p "$APPDIR"
|
||||
mkdir -p "$APPDIR/usr/share/applications/"
|
||||
mkdir -p "$APPDIR/usr/bin"
|
||||
mkdir -p "$APPDIR/usr/lib"
|
||||
mkdir -p "$APPDIR/usr/plugins"
|
||||
|
||||
cp "$PWD/../src/assets/feather.desktop" "$APPDIR/usr/share/applications/feather.desktop"
|
||||
cp "$PWD/../src/assets/images/appicons/64x64.png" "$APPDIR/feather.png"
|
||||
cp "$PWD/release/bin/feather" "$APPDIR/usr/bin/feather"
|
||||
chmod +x "$APPDIR/usr/bin/feather"
|
||||
|
||||
export LD_LIBRARY_PATH=/usr/local/lib/x86_64-linux-gnu/:/usr/local/lib/$LD_LIBRARY_PATH
|
||||
linuxdeployqt feather.AppDir/usr/share/applications/feather.desktop -verbose=2 -bundle-non-qt-libs
|
||||
|
||||
pushd feather.AppDir/usr/plugins
|
||||
ln -s ../lib/ gstreamer
|
||||
popd
|
||||
|
||||
GST_PLUGINS=("libgstcamerabin.so libgstcoreelements.so libgstvolume.so libgstapp.so libgstvideoconvert.so
|
||||
libgstvideoscale.so libgstvideo4linux2.so libgstencoding.so libgstmultifile.so libgstmatroska.so
|
||||
libgstvpx.so libgstjpegformat.so libgstjpeg.so libgstautodetect.so libgstaudiotestsrc.so
|
||||
libgstvorbis.so libgstaudiorate.so libgstaudioconvert.so libgstaudioresample.so libgstvideocrop.so")
|
||||
|
||||
for plugin in ${GST_PLUGINS[*]}; do
|
||||
cp /usr/lib/x86_64-linux-gnu/gstreamer-1.0/$plugin feather.AppDir/usr/plugins/gstreamer/
|
||||
|
||||
# linuxdeployqt doesn't set RUNPATH on libs that are only loaded at runtime
|
||||
patchelf --set-rpath "\$ORIGIN" feather.AppDir/usr/plugins/gstreamer/$plugin
|
||||
done
|
||||
|
||||
cp /usr/lib/x86_64-linux-gnu/gstreamer1.0/gstreamer-1.0/gst-plugin-scanner feather.AppDir/usr/plugins/gstreamer/
|
||||
|
||||
# Need second deploy for gstreamer dependencies
|
||||
linuxdeployqt feather.AppDir/usr/share/applications/feather.desktop -verbose=2 -bundle-non-qt-libs
|
||||
|
||||
rm "$APPDIR/AppRun"
|
||||
cp "$PWD/../contrib/AppImage/AppRun" "$APPDIR/"
|
||||
chmod +x "$APPDIR/AppRun"
|
||||
|
||||
find feather.AppDir/ -exec touch -h -a -m -t 202101010100.00 {} \;
|
||||
|
||||
# Manually create AppImage (reproducibly)
|
||||
|
||||
# download runtime
|
||||
wget -nc https://github.com/AppImage/AppImageKit/releases/download/13/runtime-x86_64
|
||||
echo "328e0d745c5c6817048c27bc3e8314871703f8f47ffa81a37cb06cd95a94b323 runtime-x86_64" | sha256sum -c
|
||||
|
||||
mksquashfs feather.AppDir feather.squashfs -info -root-owned -no-xattrs -noappend -fstime 0
|
||||
# mksquashfs writes a timestamp to the header
|
||||
printf '\x00\x00\x00\x00' | dd conv=notrunc of=feather.squashfs bs=1 seek=$((0x8))
|
||||
|
||||
rm -f feather.AppImage
|
||||
cat runtime-x86_64 >> feather.AppImage
|
||||
cat feather.squashfs >> feather.AppImage
|
||||
chmod a+x feather.AppImage
|
|
@ -1,61 +0,0 @@
|
|||
FROM ubuntu:18.04
|
||||
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
WORKDIR /deps
|
||||
|
||||
RUN sed -i '/bionic-backports/d' /etc/apt/sources.list
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get install -y wget xz-utils nano gpg xz-utils ca-certificates
|
||||
|
||||
COPY get-packages.sh .
|
||||
RUN bash get-packages.sh
|
||||
|
||||
RUN apt-get install -y --no-install-recommends --no-install-suggests --reinstall --download-only \
|
||||
# build tools
|
||||
software-properties-common python3 build-essential automake libtool-bin git \
|
||||
# ninja
|
||||
unzip \
|
||||
# GStreamer plugins
|
||||
libjpeg-dev libvpx-dev libvorbis-dev \
|
||||
# fontconfig
|
||||
autopoint gettext gperf libpng-dev \
|
||||
# libxkbcommon
|
||||
bison \
|
||||
# Qt 5.15
|
||||
# https://doc.qt.io/qt-5/linux-requirements.html
|
||||
libx11-dev \
|
||||
libx11-xcb-dev \
|
||||
libxext-dev \
|
||||
libxfixes-dev \
|
||||
libxi-dev \
|
||||
libxrender-dev \
|
||||
libxcb1-dev \
|
||||
libxcb-keysyms1-dev \
|
||||
libxcb-image0-dev \
|
||||
libxcb-icccm4-dev \
|
||||
libxcb-xfixes0-dev \
|
||||
libxcb-render-util0-dev \
|
||||
libxcb-xinerama0-dev \
|
||||
libxcb-randr0-dev \
|
||||
libxcb-sync-dev \
|
||||
libxkbcommon-dev \
|
||||
libxkbcommon-x11-dev \
|
||||
xutils-dev \
|
||||
libxcb-util-dev \
|
||||
libxcb-xinput-dev \
|
||||
# libwallet
|
||||
# libudev.so is included in AppImage
|
||||
libudev1 libudev-dev \
|
||||
# GStreamer
|
||||
gstreamer1.0-plugins-good \
|
||||
libgstreamer1.0-dev \
|
||||
libgstreamer-plugins-base1.0-dev \
|
||||
# git dependency
|
||||
libpsl5
|
||||
|
||||
# Verify packages
|
||||
RUN ln -s /var/cache/apt/archives /archives
|
||||
COPY verify-packages.sh .
|
||||
RUN bash verify-packages.sh
|
|
@ -1,25 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
base_uri="http://archive.ubuntu.com/ubuntu/dists"
|
||||
arch="amd64"
|
||||
if [ "$(uname -m)" = "aarch64" ]; then
|
||||
base_uri="http://ports.ubuntu.com/ubuntu-ports/dists"
|
||||
arch="arm64"
|
||||
fi
|
||||
|
||||
for target in bionic bionic-updates bionic-security
|
||||
do
|
||||
mkdir "$target"
|
||||
pushd "$target"
|
||||
target_uri="$base_uri/$target/"
|
||||
wget "$target_uri/Release"
|
||||
wget "$target_uri/Release.gpg"
|
||||
for repo in main multiverse restricted universe
|
||||
do
|
||||
mkdir "$repo"
|
||||
pushd "$repo"
|
||||
wget "$target_uri/$repo/binary-$arch/Packages.xz"
|
||||
popd
|
||||
done
|
||||
popd
|
||||
done
|
|
@ -1,37 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
arch="amd64"
|
||||
if [ "$(uname -m)" = "aarch64" ]; then
|
||||
arch="arm64"
|
||||
fi
|
||||
|
||||
cd /deps
|
||||
for target in bionic bionic-updates bionic-security
|
||||
do
|
||||
pushd "$target"
|
||||
|
||||
# Verify Releases
|
||||
gpg --no-default-keyring --keyring /usr/share/keyrings/ubuntu-archive-keyring.gpg --verify Release.gpg Release
|
||||
|
||||
for repo in main multiverse restricted universe
|
||||
do
|
||||
pushd "$repo"
|
||||
|
||||
# Verify Packages.xz
|
||||
sha256=`cat ../Release | grep "$repo/binary-$arch/Packages.xz" | tail -n 1 | awk '{print $1}'`
|
||||
echo "$sha256 Packages.xz" | sha256sum -c
|
||||
|
||||
xz -d -c Packages.xz >> ../../Packages-all
|
||||
popd
|
||||
done
|
||||
popd
|
||||
done
|
||||
|
||||
# Verify individual .deb files
|
||||
cd /archives
|
||||
for deb in *.deb; do
|
||||
file_name=`echo $deb | sed 's/[0-9]*%3a//g'` # --download-only uses this version format sometimes, not sure what that is all about
|
||||
sha256=`sed -n "/\/${file_name}$"'/{:start /SHA256: /!{N;b start};//p}' /deps/Packages-all | tail -n 1 | awk '{print $2}'`
|
||||
echo "$sha256 $deb" | sha256sum -c
|
||||
done
|
|
@ -32,7 +32,7 @@ SOURCES_PATH ?= $(BASEDIR)/sources
|
|||
WORK_PATH = $(BASEDIR)/work
|
||||
BASE_CACHE ?= $(BASEDIR)/built
|
||||
SDK_PATH ?= $(BASEDIR)/SDKs
|
||||
FALLBACK_DOWNLOAD_PATH ?= https://downloads.getmonero.org/depends-sources
|
||||
FALLBACK_DOWNLOAD_PATH ?=
|
||||
|
||||
BUILD = $(shell ./config.guess)
|
||||
HOST ?= $(BUILD)
|
||||
|
@ -178,7 +178,6 @@ build-only-$(1)_$(3): CMAKE_SHARED_BOOL = $(if $(findstring shared,$(3)),ON,OFF)
|
|||
|
||||
|
||||
toolchain_path=$($($(host_arch)_$(host_os)_native_toolchain)_prefixbin)
|
||||
final_build_id_long+=$(shell $(build_SHA256SUM) config.site.in)
|
||||
final_build_id_long+=$(shell $(build_SHA256SUM) toolchain.cmake.in)
|
||||
final_build_id+=$(shell echo -n "$(final_build_id_long)" | $(build_SHA256SUM) | cut -c-$(HASH_LENGTH))
|
||||
$(host_prefix)/.stamp_$(final_build_id): $(native_packages) $(packages)
|
||||
|
@ -213,26 +212,6 @@ $(host_prefix)/.stamp_$(final_build_id): $(native_packages) $(packages)
|
|||
# Minor note: it is also okay to refer to tools by their absolute path even if
|
||||
# we expect them to be available in $PATH at all times, more specificity does
|
||||
# not hurt.
|
||||
$(host_prefix)/share/config.site : config.site.in $(host_prefix)/.stamp_$(final_build_id)
|
||||
@mkdir -p $(@D)
|
||||
sed -e 's|@HOST@|$(host)|' \
|
||||
-e 's|@CC@|$(toolchain_path)$(host_CC)|' \
|
||||
-e 's|@CXX@|$(toolchain_path)$(host_CXX)|' \
|
||||
-e 's|@AR@|$(toolchain_path)$(host_AR)|' \
|
||||
-e 's|@RANLIB@|$(toolchain_path)$(host_RANLIB)|' \
|
||||
-e 's|@NM@|$(toolchain_path)$(host_NM)|' \
|
||||
-e 's|@STRIP@|$(toolchain_path)$(host_STRIP)|' \
|
||||
-e 's|@build_os@|$(build_os)|' \
|
||||
-e 's|@host_os@|$(host_os)|' \
|
||||
-e 's|@CFLAGS@|$(strip $(host_CFLAGS) $(host_$(release_type)_CFLAGS))|' \
|
||||
-e 's|@CXXFLAGS@|$(strip $(host_CXXFLAGS) $(host_$(release_type)_CXXFLAGS))|' \
|
||||
-e 's|@CPPFLAGS@|$(strip $(host_CPPFLAGS) $(host_$(release_type)_CPPFLAGS))|' \
|
||||
-e 's|@LDFLAGS@|$(strip $(host_LDFLAGS) $(host_$(release_type)_LDFLAGS))|' \
|
||||
-e 's|@allow_host_packages@|$(ALLOW_HOST_PACKAGES)|' \
|
||||
-e 's|@debug@|$(DEBUG)|' \
|
||||
$< > $@
|
||||
touch $@
|
||||
|
||||
$(host_prefix)/share/toolchain.cmake : toolchain.cmake.in $(host_prefix)/.stamp_$(final_build_id)
|
||||
@mkdir -p $(@D)
|
||||
sed -e 's|@HOST@|$(host)|' \
|
||||
|
@ -242,6 +221,8 @@ $(host_prefix)/share/toolchain.cmake : toolchain.cmake.in $(host_prefix)/.stamp_
|
|||
-e 's|@RANLIB@|$(toolchain_path)$(host_RANLIB)|' \
|
||||
-e 's|@NM@|$(toolchain_path)$(host_NM)|' \
|
||||
-e 's|@STRIP@|$(toolchain_path)$(host_STRIP)|' \
|
||||
-e 's|@CMAKE_INSTALL_NAME_TOOL@|$(host_INSTALL_NAME_TOOL)|' \
|
||||
-e 's|@OTOOL@|$(host_OTOOL)|' \
|
||||
-e 's|@build_os@|$(build_os)|' \
|
||||
-e 's|@host_os@|$(host_os)|' \
|
||||
-e 's|@CFLAGS@|$(strip $(host_CFLAGS) $(host_$(release_type)_CFLAGS))|' \
|
||||
|
@ -255,6 +236,8 @@ $(host_prefix)/share/toolchain.cmake : toolchain.cmake.in $(host_prefix)/.stamp_
|
|||
-e 's|@depends@|$(host_cmake)|' \
|
||||
-e 's|@prefix@|$($(host_arch)_$(host_os)_prefix)|'\
|
||||
-e 's|@arch@|$(host_arch)|'\
|
||||
-e 's|@guix_ldflags@|$(guix_ldflags)|'\
|
||||
-e 's|@tor_version@|$(tor_$(host_os)_version)|'\
|
||||
$< > $@
|
||||
touch $@
|
||||
|
||||
|
|
616
contrib/depends/config.guess
vendored
616
contrib/depends/config.guess
vendored
File diff suppressed because it is too large
Load diff
|
@ -1,154 +0,0 @@
|
|||
# shellcheck shell=sh disable=SC2034 # Many variables set will be used in
|
||||
# ./configure but shellcheck doesn't know
|
||||
# that, hence: disable=SC2034
|
||||
|
||||
true # Dummy command because shellcheck treats all directives before first
|
||||
# command as file-wide, and we only want to disable for one line.
|
||||
#
|
||||
# See: https://github.com/koalaman/shellcheck/wiki/Directive
|
||||
|
||||
# shellcheck disable=SC2154
|
||||
depends_prefix="$(cd "$(dirname "$ac_site_file")/.." && pwd)"
|
||||
|
||||
cross_compiling=maybe
|
||||
host_alias="@HOST@"
|
||||
ac_tool_prefix="${host_alias}-"
|
||||
|
||||
if test -z "$with_boost"; then
|
||||
with_boost="$depends_prefix"
|
||||
fi
|
||||
if test -z "$with_qt_plugindir"; then
|
||||
with_qt_plugindir="${depends_prefix}/plugins"
|
||||
fi
|
||||
if test -z "$with_qt_translationdir"; then
|
||||
with_qt_translationdir="${depends_prefix}/translations"
|
||||
fi
|
||||
if test -z "$with_qt_bindir" && test -z "@no_qt@"; then
|
||||
with_qt_bindir="${depends_prefix}/native/bin"
|
||||
fi
|
||||
if test -z "$with_mpgen" && test -n "@multiprocess@"; then
|
||||
with_mpgen="${depends_prefix}/native"
|
||||
fi
|
||||
|
||||
if test -z "$with_qrencode" && test -n "@no_qr@"; then
|
||||
with_qrencode=no
|
||||
fi
|
||||
|
||||
if test -z "$enable_wallet" && test -n "@no_wallet@"; then
|
||||
enable_wallet=no
|
||||
fi
|
||||
|
||||
if test -z "$with_bdb" && test -n "@no_bdb@"; then
|
||||
with_bdb=no
|
||||
fi
|
||||
|
||||
if test -z "$with_sqlite" && test -n "@no_sqlite@"; then
|
||||
with_sqlite=no
|
||||
fi
|
||||
|
||||
if test -z "$enable_multiprocess" && test -n "@multiprocess@"; then
|
||||
enable_multiprocess=yes
|
||||
fi
|
||||
|
||||
if test -z "$with_miniupnpc" && test -n "@no_upnp@"; then
|
||||
with_miniupnpc=no
|
||||
fi
|
||||
|
||||
if test -z "$with_natpmp" && test -n "@no_natpmp@"; then
|
||||
with_natpmp=no
|
||||
fi
|
||||
|
||||
if test -z "$with_gui" && test -n "@no_qt@"; then
|
||||
with_gui=no
|
||||
fi
|
||||
|
||||
if test -n "@debug@" && test -z "@no_qt@" && test "$with_gui" != "no"; then
|
||||
with_gui=qt5_debug
|
||||
fi
|
||||
|
||||
if test -z "$enable_zmq" && test -n "@no_zmq@"; then
|
||||
enable_zmq=no
|
||||
fi
|
||||
|
||||
if test -z "$enable_usdt" && test -n "@no_usdt@"; then
|
||||
enable_usdt=no
|
||||
fi
|
||||
|
||||
if test "@host_os@" = darwin; then
|
||||
BREW=no
|
||||
fi
|
||||
|
||||
PKG_CONFIG="$(which pkg-config) --static"
|
||||
|
||||
# These two need to remain exported because pkg-config does not see them
|
||||
# otherwise. That means they must be unexported at the end of configure.ac to
|
||||
# avoid ruining the cache. Sigh.
|
||||
export PKG_CONFIG_PATH="${depends_prefix}/share/pkgconfig:${depends_prefix}/lib/pkgconfig"
|
||||
if test -z "@allow_host_packages@"; then
|
||||
export PKG_CONFIG_LIBDIR="${depends_prefix}/lib/pkgconfig"
|
||||
fi
|
||||
|
||||
CPPFLAGS="-I${depends_prefix}/include/ ${CPPFLAGS}"
|
||||
LDFLAGS="-L${depends_prefix}/lib ${LDFLAGS}"
|
||||
|
||||
if test -n "@CC@" -a -z "${CC}"; then
|
||||
CC="@CC@"
|
||||
fi
|
||||
if test -n "@CXX@" -a -z "${CXX}"; then
|
||||
CXX="@CXX@"
|
||||
fi
|
||||
PYTHONPATH="${depends_prefix}/native/lib/python3/dist-packages${PYTHONPATH:+${PATH_SEPARATOR}}${PYTHONPATH}"
|
||||
|
||||
if test -n "@AR@"; then
|
||||
AR="@AR@"
|
||||
ac_cv_path_ac_pt_AR="${AR}"
|
||||
fi
|
||||
|
||||
if test -n "@RANLIB@"; then
|
||||
RANLIB="@RANLIB@"
|
||||
ac_cv_path_ac_pt_RANLIB="${RANLIB}"
|
||||
fi
|
||||
|
||||
if test -n "@NM@"; then
|
||||
NM="@NM@"
|
||||
ac_cv_path_ac_pt_NM="${NM}"
|
||||
fi
|
||||
|
||||
if test -n "@STRIP@"; then
|
||||
STRIP="@STRIP@"
|
||||
ac_cv_path_ac_pt_STRIP="${STRIP}"
|
||||
fi
|
||||
|
||||
if test "@host_os@" = darwin; then
|
||||
if test -n "@OTOOL@"; then
|
||||
OTOOL="@OTOOL@"
|
||||
ac_cv_path_ac_pt_OTOOL="${OTOOL}"
|
||||
fi
|
||||
|
||||
if test -n "@INSTALL_NAME_TOOL@"; then
|
||||
INSTALL_NAME_TOOL="@INSTALL_NAME_TOOL@"
|
||||
ac_cv_path_ac_pt_INSTALL_NAME_TOOL="${INSTALL_NAME_TOOL}"
|
||||
fi
|
||||
|
||||
if test -n "@DSYMUTIL@"; then
|
||||
DSYMUTIL="@DSYMUTIL@"
|
||||
ac_cv_path_ac_pt_DSYMUTIL="${DSYMUTIL}"
|
||||
fi
|
||||
fi
|
||||
|
||||
if test -n "@debug@"; then
|
||||
enable_reduce_exports=no
|
||||
fi
|
||||
|
||||
if test -n "@CFLAGS@"; then
|
||||
CFLAGS="@CFLAGS@ ${CFLAGS}"
|
||||
fi
|
||||
if test -n "@CXXFLAGS@"; then
|
||||
CXXFLAGS="@CXXFLAGS@ ${CXXFLAGS}"
|
||||
fi
|
||||
if test -n "@CPPFLAGS@"; then
|
||||
CPPFLAGS="@CPPFLAGS@ ${CPPFLAGS}"
|
||||
fi
|
||||
if test -n "@LDFLAGS@"; then
|
||||
LDFLAGS="@LDFLAGS@ ${LDFLAGS}"
|
||||
fi
|
2899
contrib/depends/config.sub
vendored
2899
contrib/depends/config.sub
vendored
File diff suppressed because it is too large
Load diff
|
@ -111,6 +111,7 @@ darwin_CXX=env -u C_INCLUDE_PATH -u CPLUS_INCLUDE_PATH \
|
|||
|
||||
darwin_CFLAGS=-pipe
|
||||
darwin_CXXFLAGS=$(darwin_CFLAGS)
|
||||
darwin_ARFLAGS=cr
|
||||
|
||||
darwin_release_CFLAGS=-O2
|
||||
darwin_release_CXXFLAGS=$(darwin_release_CFLAGS)
|
||||
|
|
|
@ -11,6 +11,7 @@ default_host_LIBTOOL = $(host_toolchain)libtool
|
|||
default_host_INSTALL_NAME_TOOL = $(host_toolchain)install_name_tool
|
||||
default_host_OTOOL = $(host_toolchain)otool
|
||||
default_host_NM = $(host_toolchain)nm
|
||||
default_host_OBJCOPY = $(host_toolchain)objcopy
|
||||
|
||||
define add_host_tool_func
|
||||
ifneq ($(filter $(origin $1),undefined default),)
|
||||
|
@ -35,5 +36,5 @@ host_$1 = $$($(host_arch)_$(host_os)_$1)
|
|||
host_$(release_type)_$1 = $$($(host_arch)_$(host_os)_$(release_type)_$1)
|
||||
endef
|
||||
|
||||
$(foreach tool,CC CXX AR RANLIB STRIP NM LIBTOOL OTOOL INSTALL_NAME_TOOL DSYMUTIL,$(eval $(call add_host_tool_func,$(tool))))
|
||||
$(foreach tool,CC CXX AR RANLIB STRIP LIBTOOL NM OBJCOPY OTOOL INSTALL_NAME_TOOL DSYMUTIL,$(eval $(call add_host_tool_func,$(tool))))
|
||||
$(foreach flags,CFLAGS CXXFLAGS ARFLAGS CPPFLAGS LDFLAGS, $(eval $(call add_host_flags_func,$(flags))))
|
||||
|
|
24
contrib/depends/packages/appimage_runtime.mk
Normal file
24
contrib/depends/packages/appimage_runtime.mk
Normal file
|
@ -0,0 +1,24 @@
|
|||
# TODO: we're not actually using the sources downloaded here. Perhaps host patches in a github repo.
|
||||
package=appimage_runtime
|
||||
$(package)_version=13
|
||||
$(package)_download_path=https://github.com/AppImage/AppImageKit/archive/refs/tags/
|
||||
$(package)_file_name=$($(package)_version).tar.gz
|
||||
$(package)_sha256_hash=51b837c78dd99ecc1cf3dd283f4a98a1be665b01457da0edc1ff736d12974b1a
|
||||
$(package)_dependencies=native_cmake libsquashfuse libappimage liblzma
|
||||
$(package)_patches=CMakeLists.txt runtime.c notify.c
|
||||
|
||||
define $(package)_preprocess_cmds
|
||||
cp -v $($(package)_patch_dir)/* .
|
||||
endef
|
||||
|
||||
define $(package)_config_cmds
|
||||
$($(package)_cmake) -DCMAKE_INSTALL_PREFIX=$(host_prefix) .
|
||||
endef
|
||||
|
||||
define $(package)_build_cmds
|
||||
$(MAKE)
|
||||
endef
|
||||
|
||||
define $(package)_stage_cmds
|
||||
cp -a runtime $($(package)_staging_prefix_dir)/runtime-x86_64
|
||||
endef
|
|
@ -1,8 +1,8 @@
|
|||
package=boost
|
||||
$(package)_version=1_64_0
|
||||
$(package)_download_path=https://downloads.sourceforge.net/project/boost/boost/1.64.0/
|
||||
$(package)_version=1_68_0
|
||||
$(package)_download_path=https://downloads.sourceforge.net/project/boost/boost/1.68.0/
|
||||
$(package)_file_name=$(package)_$($(package)_version).tar.bz2
|
||||
$(package)_sha256_hash=7bcc5caace97baa948931d712ea5f37038dbb1c5d89b43ad4def4ed7cb683332
|
||||
$(package)_sha256_hash=7f6130bc3cf65f56a618888ce9d5ea704fa10b462be126ad053e80e553d6d8b7
|
||||
$(package)_dependencies=libiconv
|
||||
$(package)_patches=fix_aroptions.patch fix_arm_arch.patch fix_coalesce.patch
|
||||
|
||||
|
@ -23,7 +23,7 @@ $(package)_archiver_$(host_os)=$($(package)_ar)
|
|||
$(package)_toolset_darwin=darwin
|
||||
$(package)_archiver_darwin=$($(package)_libtool)
|
||||
$(package)_config_libraries=chrono,filesystem,program_options,system,thread,test,date_time,regex,serialization,locale
|
||||
$(package)_cxxflags=-std=c++11
|
||||
$(package)_cxxflags=-std=c++17
|
||||
$(package)_cxxflags_linux=-fPIC
|
||||
$(package)_cxxflags_freebsd=-fPIC
|
||||
endef
|
||||
|
|
|
@ -10,8 +10,7 @@ $(package)_sha256_hash=f79b8f904b749e3e0d20afeadecf8249c55b2e32d4ebb089ae378df47
|
|||
define $(package)_set_vars
|
||||
$(package)_config_opts=--disable-shared --without-docbook --without-tests --without-examples
|
||||
$(package)_config_opts += --disable-dependency-tracking --enable-option-checking
|
||||
$(package)_config_opts += --without-xmlwf
|
||||
$(package)_config_opts_linux=--with-pic
|
||||
$(package)_config_opts += --without-xmlwf --with-pic
|
||||
$(package)_cppflags += -D_DEFAULT_SOURCE
|
||||
endef
|
||||
|
||||
|
|
|
@ -1,30 +0,0 @@
|
|||
package=graphviz
|
||||
$(package)_version=2.40.1
|
||||
$(package)_download_path=www.graphviz.org/pub/graphviz/stable/SOURCES/
|
||||
$(package)_file_name=$(package)-$($(package)_version).tar.gz
|
||||
$(package)_sha256_hash=ca5218fade0204d59947126c38439f432853543b0818d9d728c589dfe7f3a421
|
||||
|
||||
define $(package)_preprocess_cmds
|
||||
./autogen.sh
|
||||
endef
|
||||
|
||||
define $(package)_set_vars
|
||||
$(package)_config_opts=--disable-shared --enable-multibye --without-purify --without-curses
|
||||
$(package)_config_opts_release=--disable-debug-mode
|
||||
$(package)_config_opts_linux=--with-pic
|
||||
endef
|
||||
|
||||
define $(package)_config_cmds
|
||||
$($(package)_autoconf)
|
||||
endef
|
||||
|
||||
define $(package)_build_cmds
|
||||
$(MAKE)
|
||||
endef
|
||||
|
||||
define $(package)_stage_cmds
|
||||
$(MAKE) DESTDIR=$($(package)_staging_dir) install
|
||||
endef
|
||||
|
||||
define $(package)_postprocess_cmds
|
||||
endef
|
|
@ -1,39 +0,0 @@
|
|||
package=gtest
|
||||
$(package)_version=1.8.1
|
||||
$(package)_download_path=https://github.com/google/googletest/archive/
|
||||
$(package)_download_file=release-$($(package)_version).tar.gz
|
||||
$(package)_file_name=$(package)-$($(package)_version).tar.gz
|
||||
$(package)_sha256_hash=9bf1fe5182a604b4135edc1a425ae356c9ad15e9b23f9f12a02e80184c3a249c
|
||||
$(package)_cxxflags=-std=c++11
|
||||
$(package)_cxxflags_linux=-fPIC
|
||||
|
||||
define $(package)_config_cmds
|
||||
cd googletest && \
|
||||
CC="$(host_prefix)/native/bin/$($(package)_cc)" \
|
||||
CXX="$(host_prefix)/native/bin/$($(package)_cxx)" \
|
||||
AR="$(host_prefix)/native/bin/$($(package)_ar)" \
|
||||
RANLIB="$(host_prefix)/native/bin/$($(package)_ranlib)" \
|
||||
LIBTOOL="$(host_prefix)/native/bin/$($(package)_libtool)" \
|
||||
CXXFLAGS="$($(package)_cxxflags)" \
|
||||
CCFLAGS="$($(package)_ccflags)" \
|
||||
CPPFLAGS="$($(package)_cppflags)" \
|
||||
CFLAGS="$($(package)_cflags) $($(package)_cppflags)" \
|
||||
LDLAGS="$($(package)_ldflags)" \
|
||||
cmake -DCMAKE_INSTALL_PREFIX=$(build_prefix) \
|
||||
-DTOOLCHAIN_PREFIX=$(host_toolchain) \
|
||||
-DCMAKE_AR="$(host_prefix)/native/bin/$($(package)_ar)" \
|
||||
-DCMAKE_RANLIB="$(host_prefix)/native/bin/$($(package)_ranlib)" \
|
||||
-DCMAKE_CXX_FLAGS_DEBUG=ON
|
||||
endef
|
||||
# -DCMAKE_TOOLCHAIN_FILE=$(HOST)/share/toolchain.cmake
|
||||
|
||||
define $(package)_build_cmds
|
||||
cd googletest && CC="$(host_prefix)/native/bin/$($(package)_cc)" $(MAKE)
|
||||
endef
|
||||
|
||||
define $(package)_stage_cmds
|
||||
mkdir $($(package)_staging_prefix_dir)/lib $($(package)_staging_prefix_dir)/include &&\
|
||||
cp googletest/libgtest.a $($(package)_staging_prefix_dir)/lib/ &&\
|
||||
cp googletest/libgtest_main.a $($(package)_staging_prefix_dir)/lib/ &&\
|
||||
cp -a googletest/include/* $($(package)_staging_prefix_dir)/include/
|
||||
endef
|
|
@ -1,23 +0,0 @@
|
|||
package=libICE
|
||||
$(package)_version=1.0.9
|
||||
$(package)_download_path=https://xorg.freedesktop.org/releases/individual/lib/
|
||||
$(package)_file_name=$(package)-$($(package)_version).tar.bz2
|
||||
$(package)_sha256_hash=8f7032f2c1c64352b5423f6b48a8ebdc339cc63064af34d66a6c9aa79759e202
|
||||
$(package)_dependencies=xtrans xproto
|
||||
|
||||
define $(package)_set_vars
|
||||
$(package)_config_opts=--disable-static --disable-docs --disable-specs --without-xsltproc
|
||||
$(package)_config_opts_linux=--with-pic
|
||||
endef
|
||||
|
||||
define $(package)_config_cmds
|
||||
$($(package)_autoconf)
|
||||
endef
|
||||
|
||||
define $(package)_build_cmds
|
||||
$(MAKE)
|
||||
endef
|
||||
|
||||
define $(package)_stage_cmds
|
||||
$(MAKE) DESTDIR=$($(package)_staging_dir) install
|
||||
endef
|
|
@ -1,23 +0,0 @@
|
|||
package=libSM
|
||||
$(package)_version=1.2.2
|
||||
$(package)_download_path=https://xorg.freedesktop.org/releases/individual/lib/
|
||||
$(package)_file_name=$(package)-$($(package)_version).tar.bz2
|
||||
$(package)_sha256_hash=0baca8c9f5d934450a70896c4ad38d06475521255ca63b717a6510fdb6e287bd
|
||||
$(package)_dependencies=xtrans xproto libICE
|
||||
|
||||
define $(package)_set_vars
|
||||
$(package)_config_opts=--without-libuuid --without-xsltproc --disable-docs --disable-static
|
||||
$(package)_config_opts_linux=--with-pic
|
||||
endef
|
||||
|
||||
define $(package)_config_cmds
|
||||
$($(package)_autoconf)
|
||||
endef
|
||||
|
||||
define $(package)_build_cmds
|
||||
$(MAKE)
|
||||
endef
|
||||
|
||||
define $(package)_stage_cmds
|
||||
$(MAKE) DESTDIR=$($(package)_staging_dir) install
|
||||
endef
|
25
contrib/depends/packages/libappimage.mk
Normal file
25
contrib/depends/packages/libappimage.mk
Normal file
|
@ -0,0 +1,25 @@
|
|||
package=libappimage
|
||||
$(package)_version=v0.1.x-legacy
|
||||
$(package)_download_path=https://github.com/AppImageCommunity/libappimage/archive/refs/heads/
|
||||
$(package)_file_name=$($(package)_version).tar.gz
|
||||
$(package)_sha256_hash=fef3962bfb75f986f24c530a6230e95b8c79e46da3dd581543f1b615d45e7389
|
||||
$(package)_dependencies=native_cmake liblzma libfuse libarchive
|
||||
$(package)_patches=no-unneeded-deps.patch
|
||||
|
||||
define $(package)_preprocess_cmds
|
||||
patch -p1 < $($(package)_patch_dir)/no-unneeded-deps.patch
|
||||
endef
|
||||
|
||||
define $(package)_config_cmds
|
||||
$($(package)_cmake) -DCMAKE_INSTALL_PREFIX=$(host_prefix) -DCMAKE_C_COMPILER= -DUSE_SYSTEM_XZ=ON -DUSE_SYSTEM_SQUASHFUSE=ON -DUSE_SYSTEM_LIBARCHIVE=ON -DBUILD_TESTING=OFF .
|
||||
endef
|
||||
|
||||
define $(package)_build_cmds
|
||||
$(MAKE)
|
||||
endef
|
||||
|
||||
define $(package)_stage_cmds
|
||||
$(MAKE) DESTDIR=$($(package)_staging_dir) install && \
|
||||
cp src/libappimage_hashlib/include/hashlib.h $($(package)_staging_prefix_dir)/include/ && \
|
||||
cp src/libappimage_hashlib/include/md5.h $($(package)_staging_prefix_dir)/include/
|
||||
endef
|
26
contrib/depends/packages/libarchive.mk
Normal file
26
contrib/depends/packages/libarchive.mk
Normal file
|
@ -0,0 +1,26 @@
|
|||
# Needed for libappimage
|
||||
package=libarchive
|
||||
$(package)_version=3.3.1
|
||||
$(package)_download_path=https://www.libarchive.org/downloads/
|
||||
$(package)_file_name=libarchive-$($(package)_version).tar.gz
|
||||
$(package)_sha256_hash=29ca5bd1624ca5a007aa57e16080262ab4379dbf8797f5c52f7ea74a3b0424e7
|
||||
|
||||
define $(package)_set_vars
|
||||
$(package)_config_opts=--with-pic --disable-shared --enable-static --disable-bsdtar --disable-bsdcat
|
||||
$(package)_config_opts+=--disable-bsdcpio --with-zlib --without-bz2lib --without-iconv --without-lz4 --without-lzma
|
||||
$(package)_config_opts+=--without-lzo2 --without-nettle --without-openssl --without-xml2 --without-expat
|
||||
$(package)_config_opts+=--prefix=$(host_prefix)
|
||||
$(package)_config_opts+=--libdir=$(host_prefix)/lib
|
||||
endef
|
||||
|
||||
define $(package)_config_cmds
|
||||
$($(package)_autoconf) $($(package)_config_opts)
|
||||
endef
|
||||
|
||||
define $(package)_build_cmds
|
||||
$(MAKE)
|
||||
endef
|
||||
|
||||
define $(package)_stage_cmds
|
||||
$(MAKE) DESTDIR=$($(package)_staging_dir) install
|
||||
endef
|
18
contrib/depends/packages/libfuse.mk
Normal file
18
contrib/depends/packages/libfuse.mk
Normal file
|
@ -0,0 +1,18 @@
|
|||
# Needed for libsquashfuse
|
||||
package=libfuse
|
||||
$(package)_version=2.9.9
|
||||
$(package)_download_path=https://github.com/libfuse/libfuse/releases/download/fuse-2.9.9/
|
||||
$(package)_file_name=fuse-$($(package)_version).tar.gz
|
||||
$(package)_sha256_hash=d0e69d5d608cc22ff4843791ad097f554dd32540ddc9bed7638cc6fea7c1b4b5
|
||||
|
||||
define $(package)_config_cmds
|
||||
$($(package)_autoconf)
|
||||
endef
|
||||
|
||||
define $(package)_build_cmds
|
||||
$(MAKE)
|
||||
endef
|
||||
|
||||
define $(package)_stage_cmds
|
||||
$(MAKE) DESTDIR=$($(package)_staging_dir) install
|
||||
endef
|
|
@ -10,15 +10,16 @@ define $(package)_set_vars
|
|||
$(package)_build_opts=CFLAGS="-fPIE"
|
||||
endef
|
||||
|
||||
# TODO: do a native compile first to eliminate the need for this patch
|
||||
define $(package)_preprocess_cmds
|
||||
mv $($(package)_patch_dir)/gost-sb.h cipher/gost-sb.h && \
|
||||
patch -p1 < $($(package)_patch_dir)/no_gen_gost-sb.patch
|
||||
endef
|
||||
|
||||
# building on linux with $($(package)_autoconf) fails for mysterious reasons
|
||||
# TODO: building on linux with $($(package)_autoconf) fails for mysterious reasons (related to --host)
|
||||
ifeq ($(host_os),linux)
|
||||
define $(package)_config_cmds
|
||||
CLAGS='-fPIE' CXXFLAGS='-fPIE' ./configure --disable-shared --enable-static --disable-doc --with-libgpg-error-prefix=$(host_prefix) --prefix=$(host_prefix)
|
||||
CFLAGS='-fPIE' CXXFLAGS='-fPIE' ./configure --enable-digests="sha256 blake2" --enable-ciphers=aes --disable-amd64-as-feature-detection --disable-asm --disable-avx-support --disable-avx2-support --disable-sse41-support --disable-shared --enable-static --disable-doc --with-libgpg-error-prefix=$(host_prefix) --prefix=$(host_prefix)
|
||||
endef
|
||||
else
|
||||
define $(package)_config_cmds
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
package=libiconv
|
||||
$(package)_version=1.15
|
||||
$(package)_version=1.17
|
||||
$(package)_download_path=https://ftp.gnu.org/gnu/libiconv
|
||||
$(package)_file_name=libiconv-$($(package)_version).tar.gz
|
||||
$(package)_sha256_hash=ccf536620a45458d26ba83887a983b96827001e92a13847b45e4925cc8913178
|
||||
$(package)_patches=fix-whitespace.patch
|
||||
$(package)_sha256_hash=8f74213b56238c85a50a5329f77e06198771e70dd9a739779f4c02f65d971313
|
||||
|
||||
define $(package)_set_vars
|
||||
$(package)_config_opts=--disable-nls
|
||||
|
@ -13,13 +12,8 @@ define $(package)_set_vars
|
|||
$(package)_config_opts_freebsd=--with-pic
|
||||
endef
|
||||
|
||||
define $(package)_preprocess_cmds
|
||||
cp -f $(BASEDIR)/config.guess $(BASEDIR)/config.sub build-aux/ &&\
|
||||
patch -p1 < $($(package)_patch_dir)/fix-whitespace.patch
|
||||
endef
|
||||
|
||||
define $(package)_config_cmds
|
||||
$($(package)_autoconf)
|
||||
$($(package)_autoconf) AR_FLAGS=$($(package)_arflags)
|
||||
endef
|
||||
|
||||
define $(package)_build_cmds
|
||||
|
|
24
contrib/depends/packages/liblzma.mk
Normal file
24
contrib/depends/packages/liblzma.mk
Normal file
|
@ -0,0 +1,24 @@
|
|||
# Needed for libappimage
|
||||
package=liblzma
|
||||
$(package)_version=5.2.3
|
||||
$(package)_download_path=https://netcologne.dl.sourceforge.net/project/lzmautils/
|
||||
$(package)_file_name=xz-$($(package)_version).tar.gz
|
||||
$(package)_sha256_hash=71928b357d0a09a12a4b4c5fafca8c31c19b0e7d3b8ebb19622e96f26dbf28cb
|
||||
|
||||
define $(package)_set_vars
|
||||
$(package)_config_opts=--with-pic --disable-shared --enable-static --disable-xz --disable-xzdec
|
||||
$(package)_config_opts+=--prefix=$(host_prefix)
|
||||
$(package)_config_opts+=--libdir=$(host_prefix)/lib
|
||||
endef
|
||||
|
||||
define $(package)_config_cmds
|
||||
$($(package)_autoconf) $($(package)_config_opts)
|
||||
endef
|
||||
|
||||
define $(package)_build_cmds
|
||||
$(MAKE)
|
||||
endef
|
||||
|
||||
define $(package)_stage_cmds
|
||||
$(MAKE) DESTDIR=$($(package)_staging_dir) install
|
||||
endef
|
45
contrib/depends/packages/libsquashfuse.mk
Normal file
45
contrib/depends/packages/libsquashfuse.mk
Normal file
|
@ -0,0 +1,45 @@
|
|||
# Needed for libappimage
|
||||
package=libsquashfuse
|
||||
$(package)_version=1f980303b89c779eabfd0a0fdd36d6a7a311bf92
|
||||
$(package)_download_path=https://github.com/vasi/squashfuse/archive/
|
||||
$(package)_file_name=$($(package)_version).tar.gz
|
||||
$(package)_sha256_hash=8cef1539bd9c9efd3c407004fdd7a3bbef44102a5966b892819a275d609013a3
|
||||
$(package)_dependencies=liblzma libfuse zlib
|
||||
$(package)_patches=squashfuse.patch squashfuse_dlopen.patch squashfuse_dlopen.c squashfuse_dlopen.h
|
||||
|
||||
# for some reason, a first run may fail, but it seems just running it a second time fixes the issues
|
||||
define $(package)_preprocess_cmds
|
||||
patch -p1 < $($(package)_patch_dir)/squashfuse.patch && \
|
||||
patch -p1 < $($(package)_patch_dir)/squashfuse_dlopen.patch && \
|
||||
cp -v $($(package)_patch_dir)/squashfuse_dlopen.c $($(package)_patch_dir)/squashfuse_dlopen.h . && \
|
||||
libtoolize --force && \
|
||||
./autogen.sh || true && \
|
||||
./autogen.sh && \
|
||||
sed -i "/PKG_CHECK_MODULES.*/,/,:./d" configure && \
|
||||
sed -i "s/typedef off_t sqfs_off_t/typedef int64_t sqfs_off_t/g" common.h
|
||||
endef
|
||||
|
||||
define $(package)_set_vars
|
||||
$(package)_config_opts=--disable-demo --disable-high-level --without-lzo --without-lz4
|
||||
$(package)_config_opts+=--prefix=$(host_prefix)
|
||||
$(package)_config_opts+=--libdir=$(host_prefix)/lib
|
||||
endef
|
||||
|
||||
define $(package)_config_cmds
|
||||
$($(package)_autoconf) $($(package)_config_opts)
|
||||
endef
|
||||
|
||||
define $(package)_build_cmds
|
||||
$(MAKE) && \
|
||||
ls .libs
|
||||
endef
|
||||
|
||||
define $(package)_stage_cmds
|
||||
$(MAKE) DESTDIR=$($(package)_staging_dir) install && \
|
||||
mkdir -p $($(package)_staging_prefix_dir)/lib && \
|
||||
mkdir -p $($(package)_staging_prefix_dir)/include && \
|
||||
cp .libs/libfuseprivate.a $($(package)_staging_prefix_dir)/lib/ && \
|
||||
cp .libs/libsquashfuse.a $($(package)_staging_prefix_dir)/lib/ && \
|
||||
cp .libs/libsquashfuse_ll.a $($(package)_staging_prefix_dir)/lib/ && \
|
||||
find . -name "*.h" -exec cp "{}" $($(package)_staging_prefix_dir)/include/ \;
|
||||
endef
|
|
@ -35,5 +35,6 @@ define $(package)_stage_cmds
|
|||
$(MAKE) DESTDIR=$($(package)_staging_dir) install
|
||||
endef
|
||||
|
||||
define $(package)_postprocess_cmds cp -f lib/libusb-1.0.a lib/libusb.a
|
||||
define $(package)_postprocess_cmds
|
||||
cp -f lib/libusb-1.0.a lib/libusb.a
|
||||
endef
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package=native_ds_store
|
||||
$(package)_version=1.3.0
|
||||
$(package)_download_path=https://github.com/al45tair/ds_store/archive/
|
||||
$(package)_download_path=https://github.com/dmgbuild/ds_store/archive/
|
||||
$(package)_file_name=v$($(package)_version).tar.gz
|
||||
$(package)_sha256_hash=76b3280cd4e19e5179defa23fb594a9dd32643b0c80d774bd3108361d94fb46d
|
||||
$(package)_install_libdir=$(build_prefix)/lib/python3/dist-packages
|
||||
|
|
32
contrib/depends/packages/native_expat.mk
Normal file
32
contrib/depends/packages/native_expat.mk
Normal file
|
@ -0,0 +1,32 @@
|
|||
package=native_expat
|
||||
$(package)_version=2.4.8
|
||||
$(package)_download_path=https://github.com/libexpat/libexpat/releases/download/R_$(subst .,_,$($(package)_version))/
|
||||
$(package)_file_name=expat-$($(package)_version).tar.xz
|
||||
$(package)_sha256_hash=f79b8f904b749e3e0d20afeadecf8249c55b2e32d4ebb089ae378df479dcaf25
|
||||
|
||||
# -D_DEFAULT_SOURCE defines __USE_MISC, which exposes additional
|
||||
# definitions in endian.h, which are required for a working
|
||||
# endianess check in configure when building with -flto.
|
||||
define $(package)_set_vars
|
||||
$(package)_config_opts=--disable-shared --without-docbook --without-tests --without-examples
|
||||
$(package)_config_opts += --disable-dependency-tracking --enable-option-checking
|
||||
$(package)_config_opts += --without-xmlwf --with-pic
|
||||
$(package)_cppflags += -D_DEFAULT_SOURCE
|
||||
endef
|
||||
|
||||
define $(package)_config_cmds
|
||||
echo "$($(package)_autoconf)" && \
|
||||
$($(package)_autoconf)
|
||||
endef
|
||||
|
||||
define $(package)_build_cmds
|
||||
$(MAKE)
|
||||
endef
|
||||
|
||||
define $(package)_stage_cmds
|
||||
$(MAKE) DESTDIR=$($(package)_staging_dir) install
|
||||
endef
|
||||
|
||||
define $(package)_postprocess_cmds
|
||||
rm -rf share lib/cmake lib/*.la
|
||||
endef
|
|
@ -1,9 +1,9 @@
|
|||
package=fontconfig
|
||||
package=native_fontconfig
|
||||
$(package)_version=2.12.6
|
||||
$(package)_download_path=https://www.freedesktop.org/software/fontconfig/release/
|
||||
$(package)_file_name=$(package)-$($(package)_version).tar.bz2
|
||||
$(package)_file_name=fontconfig-$($(package)_version).tar.bz2
|
||||
$(package)_sha256_hash=cf0c30807d08f6a28ab46c61b8dbd55c97d2f292cf88f3a07d3384687f31f017
|
||||
$(package)_dependencies=freetype expat
|
||||
$(package)_dependencies=native_freetype native_expat
|
||||
$(package)_patches=gperf_header_regen.patch
|
||||
|
||||
define $(package)_set_vars
|
|
@ -1,16 +1,18 @@
|
|||
package=freetype
|
||||
package=native_freetype
|
||||
$(package)_version=2.11.0
|
||||
$(package)_download_path=https://download.savannah.gnu.org/releases/$(package)
|
||||
$(package)_file_name=$(package)-$($(package)_version).tar.xz
|
||||
$(package)_download_path=https://download.savannah.gnu.org/releases/freetype
|
||||
$(package)_file_name=freetype-$($(package)_version).tar.xz
|
||||
$(package)_sha256_hash=8bee39bd3968c4804b70614a0a3ad597299ad0e824bc8aad5ce8aaf48067bde7
|
||||
|
||||
define $(package)_set_vars
|
||||
$(package)_config_opts=--without-zlib --without-png --without-harfbuzz --without-bzip2 --disable-static
|
||||
$(package)_config_opts = --without-zlib --without-png --without-harfbuzz --without-bzip2 --enable-static --disable-shared
|
||||
$(package)_config_opts += --enable-option-checking --without-brotli
|
||||
$(package)_config_opts_linux=--with-pic
|
||||
$(package)_config_opts += --with-pic
|
||||
endef
|
||||
|
||||
define $(package)_config_cmds
|
||||
printenv && \
|
||||
echo "$($(package)_autoconf)" && \
|
||||
$($(package)_autoconf)
|
||||
endef
|
||||
|
|
@ -1,16 +1,16 @@
|
|||
package=libXau
|
||||
package=native_libXau
|
||||
$(package)_version=1.0.9
|
||||
$(package)_download_path=https://xorg.freedesktop.org/releases/individual/lib/
|
||||
$(package)_file_name=$(package)-$($(package)_version).tar.bz2
|
||||
$(package)_file_name=libXau-$($(package)_version).tar.bz2
|
||||
$(package)_sha256_hash=ccf8cbf0dbf676faa2ea0a6d64bcc3b6746064722b606c8c52917ed00dcb73ec
|
||||
$(package)_dependencies=xproto
|
||||
$(package)_dependencies=native_xproto
|
||||
|
||||
# When updating this package, check the default value of
|
||||
# --disable-xthreads. It is currently enabled.
|
||||
define $(package)_set_vars
|
||||
$(package)_config_opts=--disable-shared --disable-lint-library --without-lint
|
||||
$(package)_config_opts += --disable-dependency-tracking --enable-option-checking
|
||||
$(package)_config_opts_linux=--with-pic
|
||||
$(package)_config_opts += --with-pic
|
||||
endef
|
||||
|
||||
define $(package)_preprocess_cmds
|
|
@ -1,9 +1,9 @@
|
|||
package=libxcb
|
||||
package=native_libxcb
|
||||
$(package)_version=1.14
|
||||
$(package)_download_path=https://xcb.freedesktop.org/dist
|
||||
$(package)_file_name=$(package)-$($(package)_version).tar.xz
|
||||
$(package)_file_name=libxcb-$($(package)_version).tar.xz
|
||||
$(package)_sha256_hash=a55ed6db98d43469801262d81dc2572ed124edc3db31059d4e9916eb9f844c34
|
||||
$(package)_dependencies=xcb_proto libXau
|
||||
$(package)_dependencies=native_xcb_proto native_libXau
|
||||
$(package)_patches = remove_pthread_stubs.patch
|
||||
|
||||
define $(package)_set_vars
|
|
@ -1,9 +1,9 @@
|
|||
package=libxcb_util
|
||||
package=native_libxcb_util
|
||||
$(package)_version=0.4.0
|
||||
$(package)_download_path=https://xcb.freedesktop.org/dist
|
||||
$(package)_file_name=xcb-util-$($(package)_version).tar.bz2
|
||||
$(package)_sha256_hash=46e49469cb3b594af1d33176cd7565def2be3fa8be4371d62271fabb5eae50e9
|
||||
$(package)_dependencies=libxcb
|
||||
$(package)_dependencies=native_libxcb
|
||||
|
||||
define $(package)_set_vars
|
||||
$(package)_config_opts = --disable-shared --disable-devel-docs --without-doxygen
|
|
@ -1,9 +1,9 @@
|
|||
package=libxcb_util_image
|
||||
package=native_libxcb_util_image
|
||||
$(package)_version=0.4.0
|
||||
$(package)_download_path=https://xcb.freedesktop.org/dist
|
||||
$(package)_file_name=xcb-util-image-$($(package)_version).tar.bz2
|
||||
$(package)_sha256_hash=2db96a37d78831d643538dd1b595d7d712e04bdccf8896a5e18ce0f398ea2ffc
|
||||
$(package)_dependencies=libxcb libxcb_util
|
||||
$(package)_dependencies=native_libxcb native_libxcb_util
|
||||
|
||||
define $(package)_set_vars
|
||||
$(package)_config_opts=--disable-static --disable-devel-docs --without-doxygen
|
|
@ -1,9 +1,9 @@
|
|||
package=libxcb_util_keysyms
|
||||
package=native_libxcb_util_keysyms
|
||||
$(package)_version=0.4.0
|
||||
$(package)_download_path=https://xcb.freedesktop.org/dist
|
||||
$(package)_file_name=xcb-util-keysyms-$($(package)_version).tar.bz2
|
||||
$(package)_sha256_hash=0ef8490ff1dede52b7de533158547f8b454b241aa3e4dcca369507f66f216dd9
|
||||
$(package)_dependencies=libxcb xproto
|
||||
$(package)_dependencies=native_libxcb native_xproto
|
||||
|
||||
define $(package)_set_vars
|
||||
$(package)_config_opts=--disable-static --disable-devel-docs --without-doxygen
|
|
@ -1,9 +1,9 @@
|
|||
package=libxcb_util_render
|
||||
package=native_libxcb_util_render
|
||||
$(package)_version=0.3.9
|
||||
$(package)_download_path=https://xcb.freedesktop.org/dist
|
||||
$(package)_file_name=xcb-util-renderutil-$($(package)_version).tar.bz2
|
||||
$(package)_sha256_hash=c6e97e48fb1286d6394dddb1c1732f00227c70bd1bedb7d1acabefdd340bea5b
|
||||
$(package)_dependencies=libxcb
|
||||
$(package)_dependencies=native_libxcb
|
||||
|
||||
define $(package)_set_vars
|
||||
$(package)_config_opts=--disable-static --disable-devel-docs --without-doxygen
|
|
@ -1,9 +1,9 @@
|
|||
package=libxcb_util_wm
|
||||
package=native_libxcb_util_wm
|
||||
$(package)_version=0.4.1
|
||||
$(package)_download_path=https://xcb.freedesktop.org/dist
|
||||
$(package)_file_name=xcb-util-wm-$($(package)_version).tar.bz2
|
||||
$(package)_sha256_hash=28bf8179640eaa89276d2b0f1ce4285103d136be6c98262b6151aaee1d3c2a3f
|
||||
$(package)_dependencies=libxcb
|
||||
$(package)_dependencies=native_libxcb
|
||||
|
||||
define $(package)_set_vars
|
||||
$(package)_config_opts=--disable-static --disable-devel-docs --without-doxygen
|
|
@ -1,9 +1,9 @@
|
|||
package=libxkbcommon
|
||||
package=native_libxkbcommon
|
||||
$(package)_version=0.8.4
|
||||
$(package)_download_path=https://xkbcommon.org/download/
|
||||
$(package)_file_name=$(package)-$($(package)_version).tar.xz
|
||||
$(package)_file_name=libxkbcommon-$($(package)_version).tar.xz
|
||||
$(package)_sha256_hash=60ddcff932b7fd352752d51a5c4f04f3d0403230a584df9a2e0d5ed87c486c8b
|
||||
$(package)_dependencies=libxcb
|
||||
$(package)_dependencies=native_libxcb
|
||||
|
||||
# This package explicitly enables -Werror=array-bounds, which causes build failures
|
||||
# with GCC 12.1+. Work around that by turning errors back into warnings.
|
|
@ -1,60 +0,0 @@
|
|||
package=native_qmake
|
||||
$(package)_version=5.15.3
|
||||
$(package)_download_path=https://download.qt.io/official_releases/qt/5.15/$($(package)_version)/submodules
|
||||
$(package)_suffix=everywhere-opensource-src-$($(package)_version).tar.xz
|
||||
$(package)_file_name=qtbase-$($(package)_suffix)
|
||||
$(package)_sha256_hash=26394ec9375d52c1592bd7b689b1619c6b8dbe9b6f91fdd5c355589787f3a0b6
|
||||
$(package)_linux_dependencies=freetype fontconfig libxcb libxkbcommon libxcb_util libxcb_util_render libxcb_util_keysyms libxcb_util_image libxcb_util_wm
|
||||
$(package)_patches += no-xlib.patch
|
||||
|
||||
define $(package)_set_vars
|
||||
$(package)_config_opts_release = -release
|
||||
$(package)_config_opts += -bindir $(build_prefix)/bin
|
||||
$(package)_config_opts += -c++std c++17
|
||||
$(package)_config_opts += -confirm-license
|
||||
$(package)_config_opts += -hostprefix $(build_prefix)
|
||||
$(package)_config_opts += -opensource
|
||||
$(package)_config_opts += -prefix $(host_prefix)
|
||||
$(package)_config_opts += -v
|
||||
$(package)_config_opts_linux = -xcb
|
||||
$(package)_config_opts_linux += -no-xcb-xlib
|
||||
$(package)_config_opts_linux += -no-feature-xlib
|
||||
$(package)_config_opts_linux += -no-opengl
|
||||
$(package)_config_opts_linux += -no-feature-vulkan
|
||||
$(package)_config_opts_linux += -dbus-runtime
|
||||
endef
|
||||
|
||||
define $(package)_fetch_cmds
|
||||
$(call fetch_file,$(package),$($(package)_download_path),$($(package)_download_file),$($(package)_file_name),$($(package)_sha256_hash))
|
||||
endef
|
||||
|
||||
define $(package)_extract_cmds
|
||||
mkdir -p $($(package)_extract_dir) && \
|
||||
echo "$($(package)_sha256_hash) $($(package)_source)" > $($(package)_extract_dir)/.$($(package)_file_name).hash && \
|
||||
$(build_SHA256SUM) -c $($(package)_extract_dir)/.$($(package)_file_name).hash && \
|
||||
mkdir qtbase && \
|
||||
$(build_TAR) --no-same-owner --strip-components=1 -xf $($(package)_source) -C qtbase
|
||||
endef
|
||||
|
||||
define $(package)_preprocess_cmds
|
||||
patch -p1 -i $($(package)_patch_dir)/no-xlib.patch
|
||||
endef
|
||||
|
||||
define $(package)_config_cmds
|
||||
cd qtbase && \
|
||||
./configure $($(package)_config_opts)
|
||||
endef
|
||||
|
||||
define $(package)_build_cmds
|
||||
cd qtbase && \
|
||||
$(MAKE)
|
||||
endef
|
||||
|
||||
define $(package)_stage_cmds
|
||||
cd qtbase && \
|
||||
$(MAKE) INSTALL_ROOT=$($(package)_staging_dir) install
|
||||
endef
|
||||
|
||||
define $(package)_postprocess_cmds
|
||||
echo -n "" > lib/cmake/Qt5Core/Qt5CoreConfigExtras.cmake
|
||||
endef
|
218
contrib/depends/packages/native_qt.mk
Normal file
218
contrib/depends/packages/native_qt.mk
Normal file
|
@ -0,0 +1,218 @@
|
|||
package=native_qt
|
||||
$(package)_version=6.4.0
|
||||
$(package)_download_path=https://download.qt.io/official_releases/qt/6.4/$($(package)_version)/submodules
|
||||
$(package)_suffix=everywhere-src-$($(package)_version).tar.xz
|
||||
$(package)_file_name=qtbase-$($(package)_suffix)
|
||||
$(package)_sha256_hash=cb6475a0bd8567c49f7ffbb072a05516ee6671171bed55db75b22b94ead9b37d
|
||||
$(package)_dependencies=native_cmake native_libxcb native_libxkbcommon native_libxcb_util native_libxcb_util_render native_libxcb_util_keysyms native_libxcb_util_image native_libxcb_util_wm
|
||||
$(package)_qt_libs=corelib network widgets gui plugins testlib
|
||||
$(package)_linguist_tools = lrelease lupdate lconvert
|
||||
$(package)_patches = root_CMakeLists.txt
|
||||
$(package)_patches += mac-qmake.conf
|
||||
$(package)_patches += no-xlib.patch
|
||||
$(package)_patches += dont_hardcode_pwd.patch
|
||||
$(package)_patches += qtbase-moc-ignore-gcc-macro.patch
|
||||
$(package)_patches += rcc_hardcode_timestamp.patch
|
||||
$(package)_patches += fast_fixed_dtoa_no_optimize.patch
|
||||
$(package)_patches += guix_cross_lib_path.patch
|
||||
$(package)_patches += no-statx.patch
|
||||
$(package)_patches += no-renameat2.patch
|
||||
$(package)_patches += no_pthread_cond_clockwait.patch
|
||||
$(package)_patches += QTBUG-92199-fix.patch
|
||||
|
||||
$(package)_qttranslations_file_name=qttranslations-$($(package)_suffix)
|
||||
$(package)_qttranslations_sha256_hash=7ab93a930b693eeb53ab97b038b4e6e057d06374e6f49a3814d99145a276925f
|
||||
|
||||
$(package)_qttools_file_name=qttools-$($(package)_suffix)
|
||||
$(package)_qttools_sha256_hash=97f3d5f88c458be7a8f7b7b08efc06c4ebad39ca51669476b18bf9e4c11afba2
|
||||
|
||||
$(package)_qtsvg_file_name=qtsvg-$($(package)_suffix)
|
||||
$(package)_qtsvg_sha256_hash=03fdae9437d074dcfa387dc1f2c6e7e14fea0f989bf7e1aa265fd35ffc2c5b25
|
||||
|
||||
$(package)_qtmultimedia_file_name=qtmultimedia-$($(package)_suffix)
|
||||
$(package)_qtmultimedia_sha256_hash=e82e8e847cae2a951a11db05b6d10a22b21e3a1d72e06a7781cce4bd197e796f
|
||||
|
||||
$(package)_qtshadertools_file_name=qtshadertools-$($(package)_suffix)
|
||||
$(package)_qtshadertools_sha256_hash=dbd6a5f00e8178cd2fea7e84c4eef3818de5287d34e20a68383929c754ae3b90
|
||||
|
||||
$(package)_extra_sources = $($(package)_qttranslations_file_name)
|
||||
$(package)_extra_sources += $($(package)_qttools_file_name)
|
||||
$(package)_extra_sources += $($(package)_qtsvg_file_name)
|
||||
$(package)_extra_sources += $($(package)_qtmultimedia_file_name)
|
||||
$(package)_extra_sources += $($(package)_qtshadertools_file_name)
|
||||
|
||||
define $(package)_set_vars
|
||||
$(package)_config_opts_release = -release
|
||||
$(package)_config_opts_debug = -debug
|
||||
$(package)_config_opts_debug += -optimized-tools
|
||||
$(package)_config_opts += -libexecdir $(build_prefix)/qt-host/bin
|
||||
$(package)_config_opts += -c++std c++17
|
||||
$(package)_config_opts += -confirm-license
|
||||
$(package)_config_opts += -no-cups
|
||||
$(package)_config_opts += -no-egl
|
||||
$(package)_config_opts += -no-eglfs
|
||||
$(package)_config_opts += -no-evdev
|
||||
$(package)_config_opts += -no-gif
|
||||
$(package)_config_opts += -no-glib
|
||||
$(package)_config_opts += -no-icu
|
||||
$(package)_config_opts += -no-ico
|
||||
$(package)_config_opts += -no-kms
|
||||
$(package)_config_opts += -no-linuxfb
|
||||
#$(package)_config_opts += -no-libjpeg # Needed
|
||||
#$(package)_config_opts += -no-libproxy # Needed
|
||||
$(package)_config_opts += -no-libudev
|
||||
$(package)_config_opts += -no-mtdev
|
||||
$(package)_config_opts += -no-openssl
|
||||
#$(package)_config_opts += -openssl-linked
|
||||
$(package)_config_opts += -no-openvg
|
||||
$(package)_config_opts += -no-reduce-relocations
|
||||
$(package)_config_opts += -no-schannel
|
||||
$(package)_config_opts += -no-sctp
|
||||
$(package)_config_opts += -no-securetransport
|
||||
$(package)_config_opts += -no-system-proxies
|
||||
$(package)_config_opts += -no-use-gold-linker
|
||||
$(package)_config_opts += -no-zstd
|
||||
$(package)_config_opts += -nomake examples
|
||||
$(package)_config_opts += -nomake tests
|
||||
$(package)_config_opts += -opensource
|
||||
$(package)_config_opts += -pkg-config
|
||||
$(package)_config_opts += -prefix $(build_prefix)/qt-host
|
||||
$(package)_config_opts += -qt-libpng
|
||||
$(package)_config_opts += -qt-pcre
|
||||
$(package)_config_opts += -qt-harfbuzz
|
||||
$(package)_config_opts += -qt-zlib
|
||||
$(package)_config_opts += -static
|
||||
$(package)_config_opts += -no-feature-colordialog
|
||||
#$(package)_config_opts += -no-feature-concurrent # Needed
|
||||
$(package)_config_opts += -no-feature-dial
|
||||
$(package)_config_opts += -no-feature-fontcombobox
|
||||
$(package)_config_opts += -no-feature-http
|
||||
$(package)_config_opts += -no-feature-image_heuristic_mask
|
||||
$(package)_config_opts += -no-feature-keysequenceedit
|
||||
$(package)_config_opts += -no-feature-lcdnumber
|
||||
$(package)_config_opts += -no-feature-networkdiskcache
|
||||
#$(package)_config_opts += -no-feature-networkproxy # Needed
|
||||
$(package)_config_opts += -no-feature-pdf
|
||||
$(package)_config_opts += -no-feature-printdialog
|
||||
$(package)_config_opts += -no-feature-printer
|
||||
$(package)_config_opts += -no-feature-printpreviewdialog
|
||||
$(package)_config_opts += -no-feature-printpreviewwidget
|
||||
$(package)_config_opts += -no-feature-sessionmanager
|
||||
#$(package)_config_opts += -no-feature-socks5 # Needed
|
||||
$(package)_config_opts += -no-feature-sql
|
||||
$(package)_config_opts += -no-feature-syntaxhighlighter
|
||||
#$(package)_config_opts += -no-feature-textbrowser # Needed
|
||||
$(package)_config_opts += -no-feature-textmarkdownwriter
|
||||
$(package)_config_opts += -no-feature-textodfwriter
|
||||
$(package)_config_opts += -no-feature-topleveldomain
|
||||
#$(package)_config_opts += -no-feature-udpsocket # Neede
|
||||
$(package)_config_opts += -no-feature-undocommand
|
||||
$(package)_config_opts += -no-feature-undogroup
|
||||
$(package)_config_opts += -no-feature-undostack
|
||||
$(package)_config_opts += -no-feature-undoview
|
||||
$(package)_config_opts += -no-feature-vnc
|
||||
#$(package)_config_opts += -no-feature-wizard # Needed
|
||||
$(package)_config_opts += -no-feature-fontconfig
|
||||
$(package)_config_opts += -no-feature-dbus
|
||||
|
||||
$(package)_config_opts += -xcb
|
||||
$(package)_config_opts += -no-xcb-xlib
|
||||
$(package)_config_opts += -no-feature-xlib
|
||||
#$(package)_config_opts += -feature-ffmpeg
|
||||
#$(package)_config_opts += -feature-pulseaudio
|
||||
|
||||
# https://bugreports.qt.io/browse/QTBUG-99957
|
||||
$(package)_config_opts += -no-pch
|
||||
|
||||
$(package)_config_opts += -no-opengl
|
||||
$(package)_config_opts += -no-feature-vulkan
|
||||
ifneq ($(LTO),)
|
||||
$(package)_config_opts += -ltcg
|
||||
endif
|
||||
$(package)_config_opts += -platform linux-g++ -xplatform bitcoin-linux-g++
|
||||
ifneq (,$(findstring -stdlib=libc++,$($(1)_cxx)))
|
||||
$(package)_config_opts_x86_64 = -xplatform linux-clang-libc++
|
||||
endif
|
||||
|
||||
$(package)_config_opts_aarch64_android += -android-arch arm64-v8a
|
||||
$(package)_config_opts_armv7a_android += -android-arch armeabi-v7a
|
||||
$(package)_config_opts_x86_64_android += -android-arch x86_64
|
||||
|
||||
endef
|
||||
|
||||
define $(package)_fetch_cmds
|
||||
$(call fetch_file,$(package),$($(package)_download_path),$($(package)_download_file),$($(package)_file_name),$($(package)_sha256_hash)) && \
|
||||
$(call fetch_file,$(package),$($(package)_download_path),$($(package)_qttranslations_file_name),$($(package)_qttranslations_file_name),$($(package)_qttranslations_sha256_hash)) && \
|
||||
$(call fetch_file,$(package),$($(package)_download_path),$($(package)_qttools_file_name),$($(package)_qttools_file_name),$($(package)_qttools_sha256_hash)) && \
|
||||
$(call fetch_file,$(package),$($(package)_download_path),$($(package)_qtsvg_file_name),$($(package)_qtsvg_file_name),$($(package)_qtsvg_sha256_hash)) && \
|
||||
$(call fetch_file,$(package),$($(package)_download_path),$($(package)_qtmultimedia_file_name),$($(package)_qtmultimedia_file_name),$($(package)_qtmultimedia_sha256_hash)) && \
|
||||
$(call fetch_file,$(package),$($(package)_download_path),$($(package)_qtshadertools_file_name),$($(package)_qtshadertools_file_name),$($(package)_qtshadertools_sha256_hash))
|
||||
endef
|
||||
|
||||
define $(package)_extract_cmds
|
||||
mkdir -p $($(package)_extract_dir) && \
|
||||
echo "$($(package)_sha256_hash) $($(package)_source)" > $($(package)_extract_dir)/.$($(package)_file_name).hash && \
|
||||
echo "$($(package)_qttranslations_sha256_hash) $($(package)_source_dir)/$($(package)_qttranslations_file_name)" >> $($(package)_extract_dir)/.$($(package)_file_name).hash && \
|
||||
echo "$($(package)_qttools_sha256_hash) $($(package)_source_dir)/$($(package)_qttools_file_name)" >> $($(package)_extract_dir)/.$($(package)_file_name).hash && \
|
||||
echo "$($(package)_qtsvg_sha256_hash) $($(package)_source_dir)/$($(package)_qtsvg_file_name)" >> $($(package)_extract_dir)/.$($(package)_file_name).hash && \
|
||||
echo "$($(package)_qtmultimedia_sha256_hash) $($(package)_source_dir)/$($(package)_qtmultimedia_file_name)" >> $($(package)_extract_dir)/.$($(package)_file_name).hash && \
|
||||
echo "$($(package)_qtshadertools_sha256_hash) $($(package)_source_dir)/$($(package)_qtshadertools_file_name)" >> $($(package)_extract_dir)/.$($(package)_file_name).hash && \
|
||||
$(build_SHA256SUM) -c $($(package)_extract_dir)/.$($(package)_file_name).hash && \
|
||||
mkdir qtbase && \
|
||||
$(build_TAR) --no-same-owner --strip-components=1 -xf $($(package)_source) -C qtbase && \
|
||||
mkdir qttranslations && \
|
||||
$(build_TAR) --no-same-owner --strip-components=1 -xf $($(package)_source_dir)/$($(package)_qttranslations_file_name) -C qttranslations && \
|
||||
mkdir qttools && \
|
||||
$(build_TAR) --no-same-owner --strip-components=1 -xf $($(package)_source_dir)/$($(package)_qttools_file_name) -C qttools && \
|
||||
mkdir qtsvg && \
|
||||
$(build_TAR) --no-same-owner --strip-components=1 -xf $($(package)_source_dir)/$($(package)_qtsvg_file_name) -C qtsvg && \
|
||||
mkdir qtmultimedia && \
|
||||
$(build_TAR) --no-same-owner --strip-components=1 -xf $($(package)_source_dir)/$($(package)_qtmultimedia_file_name) -C qtmultimedia && \
|
||||
mkdir qtshadertools && \
|
||||
$(build_TAR) --no-same-owner --strip-components=1 -xf $($(package)_source_dir)/$($(package)_qtshadertools_file_name) -C qtshadertools
|
||||
endef
|
||||
|
||||
define $(package)_preprocess_cmds
|
||||
cp $($(package)_patch_dir)/root_CMakeLists.txt CMakeLists.txt && \
|
||||
patch -p1 -i $($(package)_patch_dir)/dont_hardcode_pwd.patch && \
|
||||
patch -p1 -i $($(package)_patch_dir)/no-xlib.patch && \
|
||||
patch -p1 -i $($(package)_patch_dir)/qtbase-moc-ignore-gcc-macro.patch && \
|
||||
patch -p1 -i $($(package)_patch_dir)/rcc_hardcode_timestamp.patch && \
|
||||
patch -p1 -i $($(package)_patch_dir)/fast_fixed_dtoa_no_optimize.patch && \
|
||||
patch -p1 -i $($(package)_patch_dir)/guix_cross_lib_path.patch && \
|
||||
patch -p1 -i $($(package)_patch_dir)/no-statx.patch && \
|
||||
patch -p1 -i $($(package)_patch_dir)/no-renameat2.patch && \
|
||||
patch -p1 -i $($(package)_patch_dir)/no_pthread_cond_clockwait.patch && \
|
||||
patch -p1 -i $($(package)_patch_dir)/QTBUG-92199-fix.patch && \
|
||||
mkdir -p qtbase/mkspecs/macx-clang-linux &&\
|
||||
cp -f qtbase/mkspecs/macx-clang/qplatformdefs.h qtbase/mkspecs/macx-clang-linux/ &&\
|
||||
cp -f $($(package)_patch_dir)/mac-qmake.conf qtbase/mkspecs/macx-clang-linux/qmake.conf && \
|
||||
cp -r qtbase/mkspecs/linux-arm-gnueabi-g++ qtbase/mkspecs/bitcoin-linux-g++ && \
|
||||
sed -i.old "s|arm-linux-gnueabi-gcc|$($($(package)_type)_CC)|" qtbase/mkspecs/bitcoin-linux-g++/qmake.conf && \
|
||||
sed -i.old "s|arm-linux-gnueabi-g++|$($($(package)_type)_CXX)|" qtbase/mkspecs/bitcoin-linux-g++/qmake.conf && \
|
||||
sed -i.old "s|arm-linux-gnueabi-ar|$($($(package)_type)_AR)|" qtbase/mkspecs/bitcoin-linux-g++/qmake.conf && \
|
||||
sed -i.old "s|arm-linux-gnueabi-objcopy|$($($(package)_type)_OBJCOPY)|" qtbase/mkspecs/bitcoin-linux-g++/qmake.conf && \
|
||||
sed -i.old "s|arm-linux-gnueabi-nm|$($($(package)_type)_NM)|" qtbase/mkspecs/bitcoin-linux-g++/qmake.conf && \
|
||||
sed -i.old "s|arm-linux-gnueabi-strip|$($($(package)_type)_STRIP)|" qtbase/mkspecs/bitcoin-linux-g++/qmake.conf && \
|
||||
echo "!host_build: QMAKE_CFLAGS += $($(package)_cflags) $($(package)_cppflags)" >> qtbase/mkspecs/common/gcc-base.conf && \
|
||||
echo "!host_build: QMAKE_CXXFLAGS += $($(package)_cxxflags) $($(package)_cppflags)" >> qtbase/mkspecs/common/gcc-base.conf && \
|
||||
echo "!host_build: QMAKE_LFLAGS += $($(package)_ldflags)" >> qtbase/mkspecs/common/gcc-base.conf && \
|
||||
sed -i.old "s|QMAKE_CC = \$$$$\$$$${CROSS_COMPILE}clang|QMAKE_CC = $($(package)_cc)|" qtbase/mkspecs/common/clang.conf && \
|
||||
sed -i.old "s|QMAKE_CXX = \$$$$\$$$${CROSS_COMPILE}clang++|QMAKE_CXX = $($(package)_cxx)|" qtbase/mkspecs/common/clang.conf
|
||||
endef
|
||||
|
||||
define $(package)_config_cmds
|
||||
export PKG_CONFIG_SYSROOT_DIR=/ && \
|
||||
export PKG_CONFIG_LIBDIR=$(build_prefix)/lib/pkgconfig && \
|
||||
export QT_MAC_SDK_NO_VERSION_CHECK=1 && \
|
||||
cd qtbase && \
|
||||
./configure -top-level $($(package)_config_opts)
|
||||
endef
|
||||
|
||||
define $(package)_build_cmds
|
||||
$(MAKE)
|
||||
endef
|
||||
|
||||
define $(package)_stage_cmds
|
||||
DESTDIR=$($(package)_staging_dir) cmake --install .
|
||||
endef
|
|
@ -1,4 +1,4 @@
|
|||
package=xcb_proto
|
||||
package=native_xcb_proto
|
||||
$(package)_version=1.14.1
|
||||
$(package)_download_path=https://xorg.freedesktop.org/archive/individual/proto
|
||||
$(package)_file_name=xcb-proto-$($(package)_version).tar.xz
|
|
@ -1,12 +1,12 @@
|
|||
package=xproto
|
||||
package=native_xproto
|
||||
$(package)_version=7.0.31
|
||||
$(package)_download_path=https://xorg.freedesktop.org/releases/individual/proto
|
||||
$(package)_file_name=$(package)-$($(package)_version).tar.bz2
|
||||
$(package)_file_name=xproto-$($(package)_version).tar.bz2
|
||||
$(package)_sha256_hash=c6f9747da0bd3a95f86b17fb8dd5e717c8f3ab7f0ece3ba1b247899ec1ef7747
|
||||
|
||||
define $(package)_set_vars
|
||||
$(package)_config_opts=--without-fop --without-xmlto --without-xsltproc --disable-specs
|
||||
$(package)_config_opts += --disable-dependency-tracking --enable-option-checking
|
||||
$(package)_config_opts=--without-fop --without-xmlto --without-xsltproc --disable-specs
|
||||
$(package)_config_opts += --disable-dependency-tracking --enable-option-checking
|
||||
endef
|
||||
|
||||
define $(package)_preprocess_cmds
|
|
@ -1,64 +0,0 @@
|
|||
package=ncurses
|
||||
$(package)_version=6.1
|
||||
$(package)_download_path=https://ftp.gnu.org/gnu/ncurses
|
||||
$(package)_file_name=$(package)-$($(package)_version).tar.gz
|
||||
$(package)_sha256_hash=aa057eeeb4a14d470101eff4597d5833dcef5965331be3528c08d99cebaa0d17
|
||||
$(package)_patches=fallback.c
|
||||
|
||||
define $(package)_set_vars
|
||||
$(package)_build_opts=CC="$($(package)_cc)"
|
||||
$(package)_config_env_mingw32=cf_cv_ar_flags=""
|
||||
$(package)_config_env_linux=cf_cv_ar_flags=""
|
||||
$(package)_config_opts=--prefix=$(host_prefix)
|
||||
$(package)_config_opts+=--disable-shared
|
||||
$(package)_config_opts+=--with-build-cc=gcc
|
||||
$(package)_config_opts+=--without-debug
|
||||
$(package)_config_opts+=--without-ada
|
||||
$(package)_config_opts+=--without-cxx-binding
|
||||
$(package)_config_opts+=--without-cxx
|
||||
$(package)_config_opts+=--without-ticlib
|
||||
$(package)_config_opts+=--without-tic
|
||||
$(package)_config_opts+=--without-progs
|
||||
$(package)_config_opts+=--without-tests
|
||||
$(package)_config_opts+=--without-tack
|
||||
$(package)_config_opts+=--without-manpages
|
||||
$(package)_config_opts+=--with-termlib=tinfo
|
||||
$(package)_config_opts+=--disable-tic-depends
|
||||
$(package)_config_opts+=--disable-big-strings
|
||||
$(package)_config_opts+=--disable-ext-colors
|
||||
$(package)_config_opts+=--enable-pc-files
|
||||
$(package)_config_opts+=--host=$(HOST)
|
||||
$(pacakge)_config_opts+=--without-shared
|
||||
$(pacakge)_config_opts+=--without-pthread
|
||||
$(pacakge)_config_opts+=--disable-rpath
|
||||
$(pacakge)_config_opts+=--disable-colorfgbg
|
||||
$(pacakge)_config_opts+=--disable-ext-mouse
|
||||
$(pacakge)_config_opts+=--disable-symlinks
|
||||
$(pacakge)_config_opts+=--enable-warnings
|
||||
$(pacakge)_config_opts+=--enable-assertions
|
||||
$(package)_config_opts+=--with-default-terminfo-dir=/etc/_terminfo_
|
||||
$(package)_config_opts+=--with-terminfo-dirs=/etc/_terminfo_
|
||||
$(pacakge)_config_opts+=--enable-database
|
||||
$(pacakge)_config_opts+=--enable-sp-funcs
|
||||
$(pacakge)_config_opts+=--disable-term-driver
|
||||
$(pacakge)_config_opts+=--enable-interop
|
||||
$(pacakge)_config_opts+=--enable-widec
|
||||
$(package)_build_opts=CFLAGS="$($(package)_cflags) $($(package)_cppflags) -fPIC"
|
||||
endef
|
||||
|
||||
define $(package)_preprocess_cmds
|
||||
cp $($(package)_patch_dir)/fallback.c ncurses
|
||||
endef
|
||||
|
||||
define $(package)_config_cmds
|
||||
$($(package)_autoconf)
|
||||
endef
|
||||
|
||||
define $(package)_build_cmds
|
||||
$(MAKE) $($(package)_build_opts) V=1
|
||||
endef
|
||||
|
||||
define $(package)_stage_cmds
|
||||
$(MAKE) install.libs DESTDIR=$($(package)_staging_dir)
|
||||
endef
|
||||
|
|
@ -1,9 +1,8 @@
|
|||
package=openssl
|
||||
$(package)_version=1.1.1l
|
||||
$(package)_version=1.1.1q
|
||||
$(package)_download_path=https://www.openssl.org/source
|
||||
$(package)_file_name=$(package)-$($(package)_version).tar.gz
|
||||
$(package)_sha256_hash=0b7a3e5e59c34827fe0c3a74b7ec8baef302b98fa80088d7f9153aa16fa76bd1
|
||||
$(package)_patches=fix_darwin.patch
|
||||
$(package)_sha256_hash=d7939ce614029cdff0b6c20f0e2e5703158a489a72b2507b8bd51bf8c8fd10ca
|
||||
|
||||
define $(package)_set_vars
|
||||
$(package)_config_env=AR="$($(package)_ar)" ARFLAGS=$($(package)_arflags) RANLIB="$($(package)_ranlib)" CC="$($(package)_cc)"
|
||||
|
@ -38,6 +37,7 @@ $(package)_config_opts_arm_linux=linux-generic32
|
|||
$(package)_config_opts_aarch64_linux=linux-generic64
|
||||
$(package)_config_opts_arm_android=--static android-arm
|
||||
$(package)_config_opts_aarch64_android=--static android-arm64
|
||||
$(package)_config_opts_aarch64_darwin=darwin64-arm64-cc
|
||||
$(package)_config_opts_riscv64_linux=linux-generic64
|
||||
$(package)_config_opts_mipsel_linux=linux-generic32
|
||||
$(package)_config_opts_mips_linux=linux-generic32
|
||||
|
@ -49,8 +49,8 @@ $(package)_config_opts_x86_64_freebsd=BSD-x86_64
|
|||
endef
|
||||
|
||||
define $(package)_preprocess_cmds
|
||||
sed -i.old 's|"engines", "apps", "test", "util", "tools", "fuzz"|"engines", "tools"|' Configure && \
|
||||
patch -p1 < $($(package)_patch_dir)/fix_darwin.patch
|
||||
printenv && \
|
||||
sed -i.old 's|"engines", "apps", "test", "util", "tools", "fuzz"|"engines", "tools"|' Configure
|
||||
endef
|
||||
|
||||
define $(package)_config_cmds
|
||||
|
|
|
@ -1,26 +1,24 @@
|
|||
native_packages := native_cmake
|
||||
packages := boost openssl libiconv ldns unbound qrencode zbar sodium polyseed hidapi protobuf libusb zlib libgpg-error libgcrypt ncurses readline expat
|
||||
packages := boost openssl libiconv ldns unbound qrencode zbar sodium polyseed hidapi protobuf libusb zlib libgpg-error libgcrypt expat
|
||||
|
||||
hardware_packages := hidapi protobuf libusb
|
||||
hardware_native_packages := native_protobuf
|
||||
|
||||
linux_packages := eudev libzip
|
||||
linux_packages := eudev libzip liblzma libarchive libfuse libsquashfuse libappimage
|
||||
linux_native_packages = $(hardware_native_packages) native_patchelf
|
||||
# native_linuxdeployqt native_squashfs-tools native_qmake
|
||||
|
||||
qt_linux_packages:=qt expat libxcb xcb_proto libXau xproto freetype fontconfig libxkbcommon libxcb_util libxcb_util_render libxcb_util_keysyms libxcb_util_image libxcb_util_wm
|
||||
qt_darwin_packages=qt
|
||||
qt_mingw32_packages=qt
|
||||
qt_linux_packages:=qt native_expat native_libxcb native_xcb_proto native_libXau native_xproto native_freetype native_fontconfig native_libxkbcommon native_libxcb_util native_libxcb_util_render native_libxcb_util_keysyms native_libxcb_util_image native_libxcb_util_wm appimage_runtime
|
||||
qt_darwin_packages=native_qt qt
|
||||
qt_mingw32_packages=native_qt
|
||||
|
||||
# apt install python3-setuptools
|
||||
darwin_packages := libzip
|
||||
darwin_native_packages = $(hardware_native_packages) native_ds_store native_mac_alias
|
||||
darwin_native_packages = $(hardware_native_packages) native_ds_store native_mac_alias native_expat native_libxcb native_xcb_proto native_libXau native_xproto native_freetype native_fontconfig native_libxkbcommon native_libxcb_util native_libxcb_util_render native_libxcb_util_keysyms native_libxcb_util_image native_libxcb_util_wm
|
||||
|
||||
tor_linux_packages := libevent tor
|
||||
tor_darwin_packages := tor-macos
|
||||
tor_linux_packages := libevent tor_linux
|
||||
tor_darwin_packages := tor_darwin
|
||||
|
||||
mingw32_packages = icu4c sodium $(hardware_packages) tor-win libzip
|
||||
mingw32_native_packages = $(hardware_native_packages)
|
||||
mingw32_packages = icu4c sodium $(hardware_packages) tor_mingw32 libzip qt
|
||||
mingw32_native_packages = $(hardware_native_packages) native_expat native_libxcb native_xcb_proto native_libXau native_xproto native_freetype native_fontconfig native_libxkbcommon native_libxcb_util native_libxcb_util_render native_libxcb_util_keysyms native_libxcb_util_image native_libxcb_util_wm
|
||||
|
||||
ifneq ($(build_os),darwin)
|
||||
darwin_native_packages += native_cctools native_libtapi
|
||||
|
|
|
@ -5,11 +5,11 @@ $(package)_file_name=$(package)-$($(package)_version).tar.bz2
|
|||
$(package)_sha256_hash=efe5188b1ddbcbf98763b819b146be6a90481aac30cfc8d858ab78a19cde1fa5
|
||||
|
||||
define $(package)_set_vars
|
||||
$(package)_config_opts=--disable-shared --without-tools --without-tests --disable-sdltest
|
||||
$(package)_config_opts += --disable-gprof --disable-gcov --disable-mudflap
|
||||
$(package)_config_opts += --disable-dependency-tracking --enable-option-checking
|
||||
$(package)_config_opts_linux=--with-pic
|
||||
$(package)_config_opts_android=--with-pic
|
||||
$(package)_config_opts=--disable-shared --without-tools --without-tests --disable-sdltest
|
||||
$(package)_config_opts += --disable-gprof --disable-gcov --disable-mudflap
|
||||
$(package)_config_opts += --disable-dependency-tracking --enable-option-checking
|
||||
$(package)_config_opts_linux=--with-pic
|
||||
$(package)_config_opts_android=--with-pic
|
||||
endef
|
||||
|
||||
define $(package)_preprocess_cmds
|
||||
|
|
|
@ -1,57 +1,68 @@
|
|||
package=qt
|
||||
$(package)_version=5.15.5
|
||||
$(package)_download_path=https://download.qt.io/official_releases/qt/5.15/$($(package)_version)/submodules
|
||||
$(package)_suffix=everywhere-opensource-src-$($(package)_version).tar.xz
|
||||
$(package)_version=6.4.0
|
||||
$(package)_download_path=https://download.qt.io/official_releases/qt/6.4/$($(package)_version)/submodules
|
||||
$(package)_suffix=everywhere-src-$($(package)_version).tar.xz
|
||||
$(package)_file_name=qtbase-$($(package)_suffix)
|
||||
$(package)_sha256_hash=0c42c799aa7c89e479a07c451bf5a301e291266ba789e81afc18f95049524edc
|
||||
$(package)_dependencies=openssl
|
||||
$(package)_linux_dependencies=freetype fontconfig libxcb libxkbcommon libxcb_util libxcb_util_render libxcb_util_keysyms libxcb_util_image libxcb_util_wm
|
||||
$(package)_sha256_hash=cb6475a0bd8567c49f7ffbb072a05516ee6671171bed55db75b22b94ead9b37d
|
||||
$(package)_darwin_dependencies=native_cctools native_qt openssl
|
||||
$(package)_mingw32_dependencies=openssl native_cmake native_qt native_freetype native_fontconfig native_libxkbcommon
|
||||
$(package)_linux_dependencies=openssl native_cmake native_freetype native_fontconfig native_libxcb native_libxkbcommon native_libxcb_util native_libxcb_util_render native_libxcb_util_keysyms native_libxcb_util_image native_libxcb_util_wm
|
||||
$(package)_qt_libs=corelib network widgets gui plugins testlib
|
||||
$(package)_linguist_tools = lrelease lupdate lconvert
|
||||
$(package)_patches = qt.pro
|
||||
$(package)_patches += qttools_src.pro
|
||||
$(package)_patches = root_CMakeLists.txt
|
||||
$(package)_patches += mac-qmake.conf
|
||||
$(package)_patches += fix_qt_pkgconfig.patch
|
||||
$(package)_patches += no-xlib.patch
|
||||
$(package)_patches += dont_hardcode_x86_64.patch
|
||||
$(package)_patches += fix_montery_include.patch
|
||||
$(package)_patches += fix_android_jni_static.patch
|
||||
$(package)_patches += dont_hardcode_pwd.patch
|
||||
$(package)_patches += qtbase-moc-ignore-gcc-macro.patch
|
||||
$(package)_patches += use_android_ndk23.patch
|
||||
$(package)_patches += rcc_hardcode_timestamp.patch
|
||||
$(package)_patches += duplicate_lcqpafonts.patch
|
||||
$(package)_patches += fast_fixed_dtoa_no_optimize.patch
|
||||
$(package)_patches += guix_cross_lib_path.patch
|
||||
$(package)_patches += no-statx.patch
|
||||
$(package)_patches += no-renameat2.patch
|
||||
$(package)_patches += no_pthread_cond_clockwait.patch
|
||||
$(package)_patches += QTBUG-92199-fix.patch
|
||||
$(package)_patches += WindowsToolchain.cmake
|
||||
$(package)_patches += windows_func_fix.patch
|
||||
$(package)_patches += fix_include_capitalization.patch
|
||||
$(package)_patches += dont_capitalize_wmf_libs.patch
|
||||
$(package)_patches += MacToolchain.cmake
|
||||
$(package)_patches += no_wraprt_on_apple.patch
|
||||
$(package)_patches += ___isOSVersionAtLeast_hack.patch
|
||||
$(package)_patches += missing-include.patch
|
||||
$(package)_patches += no-__builtin_available.patch
|
||||
$(package)_patches += no-ffmpeg.patch
|
||||
|
||||
$(package)_qttranslations_file_name=qttranslations-$($(package)_suffix)
|
||||
$(package)_qttranslations_sha256_hash=c92af4171397a0ed272330b4fa0669790fcac8d050b07c8b8cc565ebeba6735e
|
||||
$(package)_qttranslations_sha256_hash=7ab93a930b693eeb53ab97b038b4e6e057d06374e6f49a3814d99145a276925f
|
||||
|
||||
$(package)_qttools_file_name=qttools-$($(package)_suffix)
|
||||
$(package)_qttools_sha256_hash=6d0778b71b2742cb527561791d1d3d255366163d54a10f78c683a398f09ffc6c
|
||||
$(package)_qttools_sha256_hash=97f3d5f88c458be7a8f7b7b08efc06c4ebad39ca51669476b18bf9e4c11afba2
|
||||
|
||||
$(package)_qtsvg_file_name=qtsvg-$($(package)_suffix)
|
||||
$(package)_qtsvg_sha256_hash=c4cf9e640ad43f157c6b14ee7624047f5945288991ad5de83c9eec673bacb031
|
||||
$(package)_qtsvg_sha256_hash=03fdae9437d074dcfa387dc1f2c6e7e14fea0f989bf7e1aa265fd35ffc2c5b25
|
||||
|
||||
$(package)_qtwebsockets_file_name=qtwebsockets-$($(package)_suffix)
|
||||
$(package)_qtwebsockets_sha256_hash=66ab8b5bb2e64392fe43786ca1c2fd4be3306fbc4b969aa1748e568b5d062238
|
||||
$(package)_qtwebsockets_sha256_hash=ff3c6629cd6537266123c441709acdd67f231ff2a07216fc848448255bec9bca
|
||||
|
||||
$(package)_qtmultimedia_file_name=qtmultimedia-$($(package)_suffix)
|
||||
$(package)_qtmultimedia_sha256_hash=e82e8e847cae2a951a11db05b6d10a22b21e3a1d72e06a7781cce4bd197e796f
|
||||
|
||||
$(package)_qtshadertools_file_name=qtshadertools-$($(package)_suffix)
|
||||
$(package)_qtshadertools_sha256_hash=dbd6a5f00e8178cd2fea7e84c4eef3818de5287d34e20a68383929c754ae3b90
|
||||
|
||||
$(package)_extra_sources = $($(package)_qttranslations_file_name)
|
||||
$(package)_extra_sources += $($(package)_qttools_file_name)
|
||||
$(package)_extra_sources += $($(package)_qtsvg_file_name)
|
||||
$(package)_extra_sources += $($(package)_qtwebsockets_file_name)
|
||||
$(package)_extra_sources += $($(package)_qtmultimedia_file_name)
|
||||
$(package)_extra_sources += $($(package)_qtshadertools_file_name)
|
||||
|
||||
define $(package)_set_vars
|
||||
$(package)_config_opts_release = -release
|
||||
$(package)_config_opts_release += -silent
|
||||
$(package)_config_opts_debug = -debug
|
||||
$(package)_config_opts_debug += -optimized-tools
|
||||
$(package)_config_opts += -bindir $(build_prefix)/bin
|
||||
$(package)_config_opts += -c++std c++17
|
||||
$(package)_config_opts += -libexecdir $(build_prefix)/bin
|
||||
$(package)_config_opts += -confirm-license
|
||||
$(package)_config_opts += -hostprefix $(build_prefix)
|
||||
$(package)_config_opts += -no-compile-examples
|
||||
$(package)_config_opts += -no-cups
|
||||
$(package)_config_opts += -no-egl
|
||||
$(package)_config_opts += -no-eglfs
|
||||
|
@ -60,36 +71,26 @@ $(package)_config_opts += -no-gif
|
|||
$(package)_config_opts += -no-glib
|
||||
$(package)_config_opts += -no-icu
|
||||
$(package)_config_opts += -no-ico
|
||||
$(package)_config_opts += -no-iconv
|
||||
$(package)_config_opts += -no-kms
|
||||
$(package)_config_opts += -no-linuxfb
|
||||
$(package)_config_opts += -no-libjpeg
|
||||
#$(package)_config_opts += -no-libjpeg # Needed
|
||||
#$(package)_config_opts += -no-libproxy # Needed
|
||||
$(package)_config_opts += -no-libudev
|
||||
$(package)_config_opts += -no-mtdev
|
||||
#$(package)_config_opts += -no-openssl # Needed
|
||||
$(package)_config_opts_mingw32 += -openssl-linked
|
||||
$(package)_config_opts_linux += -openssl-linked
|
||||
$(package)_config_opts += -no-openvg
|
||||
$(package)_config_opts += -no-reduce-relocations
|
||||
$(package)_config_opts += -no-schannel
|
||||
$(package)_config_opts += -no-sctp
|
||||
$(package)_config_opts += -no-securetransport
|
||||
$(package)_config_opts += -no-sql-db2
|
||||
$(package)_config_opts += -no-sql-ibase
|
||||
$(package)_config_opts += -no-sql-oci
|
||||
$(package)_config_opts += -no-sql-tds
|
||||
$(package)_config_opts += -no-sql-mysql
|
||||
$(package)_config_opts += -no-sql-odbc
|
||||
$(package)_config_opts += -no-sql-psql
|
||||
$(package)_config_opts += -no-sql-sqlite
|
||||
$(package)_config_opts += -no-sql-sqlite2
|
||||
$(package)_config_opts += -no-system-proxies
|
||||
$(package)_config_opts += -no-use-gold-linker
|
||||
$(package)_config_opts += -no-zstd
|
||||
$(package)_config_opts += -nomake examples
|
||||
$(package)_config_opts += -nomake tests
|
||||
$(package)_config_opts += -nomake tools
|
||||
$(package)_config_opts += -opensource
|
||||
$(package)_config_opts += -openssl-linked
|
||||
$(package)_config_opts += -pkg-config
|
||||
$(package)_config_opts += -prefix $(host_prefix)
|
||||
$(package)_config_opts += -qt-libpng
|
||||
|
@ -97,41 +98,41 @@ $(package)_config_opts += -qt-pcre
|
|||
$(package)_config_opts += -qt-harfbuzz
|
||||
$(package)_config_opts += -qt-zlib
|
||||
$(package)_config_opts += -static
|
||||
$(package)_config_opts += -v
|
||||
$(package)_config_opts += -no-feature-bearermanagement
|
||||
$(package)_config_opts += -no-feature-colordialog
|
||||
#$(package)_config_opts += -no-feature-concurrent # Needed
|
||||
$(package)_config_opts += -no-feature-dial
|
||||
$(package)_config_opts += -no-feature-fontcombobox
|
||||
$(package)_config_opts += -no-feature-ftp
|
||||
$(package)_config_opts += -no-feature-http
|
||||
$(package)_config_opts += -no-feature-image_heuristic_mask
|
||||
$(package)_config_opts += -no-feature-keysequenceedit
|
||||
$(package)_config_opts += -no-feature-lcdnumber
|
||||
$(package)_config_opts += -no-feature-networkdiskcache
|
||||
#$(package)_config_opts += -no-feature-networkproxy # Needed
|
||||
$(package)_config_opts += -no-feature-pdf
|
||||
$(package)_config_opts += -no-feature-printdialog
|
||||
$(package)_config_opts += -no-feature-printer
|
||||
$(package)_config_opts += -no-feature-printpreviewdialog
|
||||
$(package)_config_opts += -no-feature-printpreviewwidget
|
||||
$(package)_config_opts += -no-feature-printsupport
|
||||
$(package)_config_opts += -no-feature-sessionmanager
|
||||
#$(package)_config_opts += -no-feature-socks5 # Needed
|
||||
$(package)_config_opts += -no-feature-sql
|
||||
$(package)_config_opts += -no-feature-sqlmodel
|
||||
$(package)_config_opts += -no-feature-statemachine
|
||||
$(package)_config_opts += -no-feature-syntaxhighlighter
|
||||
#$(package)_config_opts += -no-feature-textbrowser # Needed
|
||||
$(package)_config_opts += -no-feature-textmarkdownwriter
|
||||
$(package)_config_opts += -no-feature-textodfwriter
|
||||
$(package)_config_opts += -no-feature-topleveldomain
|
||||
#$(package)_config_opts += -no-feature-udpsocket # Neede
|
||||
$(package)_config_opts += -no-feature-undocommand
|
||||
$(package)_config_opts += -no-feature-undogroup
|
||||
$(package)_config_opts += -no-feature-undostack
|
||||
$(package)_config_opts += -no-feature-undoview
|
||||
$(package)_config_opts += -no-feature-vnc
|
||||
$(package)_config_opts += -no-feature-xml
|
||||
#$(package)_config_opts += -no-feature-wizard # Needed
|
||||
|
||||
$(package)_config_opts_darwin = -no-dbus
|
||||
$(package)_config_opts_darwin += -no-opengl
|
||||
$(package)_config_opts_darwin += -pch
|
||||
$(package)_config_opts_darwin += -no-feature-corewlan
|
||||
$(package)_config_opts_darwin += -no-pch
|
||||
$(package)_config_opts_darwin += -no-freetype
|
||||
$(package)_config_opts_darwin += QMAKE_MACOSX_DEPLOYMENT_TARGET=$(OSX_MIN_VERSION)
|
||||
|
||||
|
@ -142,6 +143,7 @@ $(package)_config_opts_darwin += -device-option MAC_SDK_VERSION=$(OSX_SDK_VERSIO
|
|||
$(package)_config_opts_darwin += -device-option CROSS_COMPILE="$(host)-"
|
||||
$(package)_config_opts_darwin += -device-option MAC_TARGET=$(host)
|
||||
$(package)_config_opts_darwin += -device-option XCODE_VERSION=$(XCODE_VERSION)
|
||||
$(package)_config_opts_darwin += -qt-host-path $(build_prefix)/qt-host
|
||||
endif
|
||||
|
||||
ifneq ($(build_arch),$(host_arch))
|
||||
|
@ -149,9 +151,18 @@ $(package)_config_opts_aarch64_darwin += -device-option QMAKE_APPLE_DEVICE_ARCHS
|
|||
$(package)_config_opts_x86_64_darwin += -device-option QMAKE_APPLE_DEVICE_ARCHS=x86_64
|
||||
endif
|
||||
|
||||
$(package)_config_opts_darwin += -no-feature-ffmpeg
|
||||
$(package)_config_opts_darwin += -- -DCMAKE_TOOLCHAIN_FILE=MacToolchain.cmake -DCMAKE_LIBRARY_PATH=$(HOME)/.guix-profile/lib
|
||||
|
||||
$(package)_config_opts_linux = -xcb
|
||||
$(package)_config_opts_linux += -no-xcb-xlib
|
||||
$(package)_config_opts_linux += -no-feature-xlib
|
||||
#$(package)_config_opts_linux += -feature-ffmpeg
|
||||
#$(package)_config_opts_linux += -feature-pulseaudio
|
||||
|
||||
# https://bugreports.qt.io/browse/QTBUG-99957
|
||||
$(package)_config_opts_linux += -no-pch
|
||||
|
||||
$(package)_config_opts_linux += -system-freetype
|
||||
$(package)_config_opts_linux += -fontconfig
|
||||
$(package)_config_opts_linux += -no-opengl
|
||||
|
@ -160,30 +171,21 @@ $(package)_config_opts_linux += -dbus-runtime
|
|||
ifneq ($(LTO),)
|
||||
$(package)_config_opts_linux += -ltcg
|
||||
endif
|
||||
$(package)_config_opts_arm_linux += -platform linux-g++ -xplatform bitcoin-linux-g++
|
||||
$(package)_config_opts_i686_linux = -xplatform linux-g++-32
|
||||
$(package)_config_opts_linux += -platform linux-g++ -xplatform bitcoin-linux-g++
|
||||
ifneq (,$(findstring -stdlib=libc++,$($(1)_cxx)))
|
||||
$(package)_config_opts_x86_64_linux = -xplatform linux-clang-libc++
|
||||
else
|
||||
$(package)_config_opts_x86_64_linux = -xplatform linux-g++-64
|
||||
endif
|
||||
$(package)_config_opts_aarch64_linux = -xplatform linux-aarch64-gnu-g++
|
||||
$(package)_config_opts_powerpc64_linux = -platform linux-g++ -xplatform bitcoin-linux-g++
|
||||
$(package)_config_opts_powerpc64le_linux = -platform linux-g++ -xplatform bitcoin-linux-g++
|
||||
$(package)_config_opts_riscv64_linux = -platform linux-g++ -xplatform bitcoin-linux-g++
|
||||
$(package)_config_opts_s390x_linux = -platform linux-g++ -xplatform bitcoin-linux-g++
|
||||
|
||||
$(package)_config_opts_mingw32 = -no-opengl
|
||||
$(package)_config_opts_mingw32 += -no-dbus
|
||||
$(package)_config_opts_mingw32 += -no-freetype
|
||||
$(package)_config_opts_mingw32 += -xplatform win32-g++
|
||||
$(package)_config_opts_mingw32 += "QMAKE_CFLAGS = '$($(package)_cflags) $($(package)_cppflags)'"
|
||||
$(package)_config_opts_mingw32 += "QMAKE_CXX = '$($(package)_cxx)'"
|
||||
$(package)_config_opts_mingw32 += "QMAKE_CXXFLAGS = '$($(package)_cxxflags) $($(package)_cppflags)'"
|
||||
$(package)_config_opts_mingw32 += "QMAKE_LFLAGS = '$($(package)_ldflags)'"
|
||||
$(package)_config_opts_mingw32 += "QMAKE_LIB = '$($(package)_ar) rc'"
|
||||
$(package)_config_opts_mingw32 += -device-option CROSS_COMPILE="$(host)-"
|
||||
$(package)_config_opts_mingw32 += -pch
|
||||
$(package)_config_opts_mingw32 += -qt-host-path $(build_prefix)/qt-host
|
||||
$(package)_config_opts_mingw32 += -no-feature-ffmpeg
|
||||
$(package)_config_opts_mingw32 += -wmf
|
||||
$(package)_config_opts_mingw32 += -- -DCMAKE_TOOLCHAIN_FILE=WindowsToolchain.cmake -DCMAKE_LIBRARY_PATH=$(HOME)/.guix-profile/lib
|
||||
|
||||
$(package)_config_opts_android = -xplatform android-clang
|
||||
$(package)_config_opts_android += -android-sdk $(ANDROID_SDK)
|
||||
|
@ -212,7 +214,9 @@ $(call fetch_file,$(package),$($(package)_download_path),$($(package)_download_f
|
|||
$(call fetch_file,$(package),$($(package)_download_path),$($(package)_qttranslations_file_name),$($(package)_qttranslations_file_name),$($(package)_qttranslations_sha256_hash)) && \
|
||||
$(call fetch_file,$(package),$($(package)_download_path),$($(package)_qttools_file_name),$($(package)_qttools_file_name),$($(package)_qttools_sha256_hash)) && \
|
||||
$(call fetch_file,$(package),$($(package)_download_path),$($(package)_qtsvg_file_name),$($(package)_qtsvg_file_name),$($(package)_qtsvg_sha256_hash)) && \
|
||||
$(call fetch_file,$(package),$($(package)_download_path),$($(package)_qtwebsockets_file_name),$($(package)_qtwebsockets_file_name),$($(package)_qtwebsockets_sha256_hash))
|
||||
$(call fetch_file,$(package),$($(package)_download_path),$($(package)_qtwebsockets_file_name),$($(package)_qtwebsockets_file_name),$($(package)_qtwebsockets_sha256_hash)) && \
|
||||
$(call fetch_file,$(package),$($(package)_download_path),$($(package)_qtmultimedia_file_name),$($(package)_qtmultimedia_file_name),$($(package)_qtmultimedia_sha256_hash)) && \
|
||||
$(call fetch_file,$(package),$($(package)_download_path),$($(package)_qtshadertools_file_name),$($(package)_qtshadertools_file_name),$($(package)_qtshadertools_sha256_hash))
|
||||
endef
|
||||
|
||||
define $(package)_extract_cmds
|
||||
|
@ -222,6 +226,8 @@ define $(package)_extract_cmds
|
|||
echo "$($(package)_qttools_sha256_hash) $($(package)_source_dir)/$($(package)_qttools_file_name)" >> $($(package)_extract_dir)/.$($(package)_file_name).hash && \
|
||||
echo "$($(package)_qtsvg_sha256_hash) $($(package)_source_dir)/$($(package)_qtsvg_file_name)" >> $($(package)_extract_dir)/.$($(package)_file_name).hash && \
|
||||
echo "$($(package)_qtwebsockets_sha256_hash) $($(package)_source_dir)/$($(package)_qtwebsockets_file_name)" >> $($(package)_extract_dir)/.$($(package)_file_name).hash && \
|
||||
echo "$($(package)_qtmultimedia_sha256_hash) $($(package)_source_dir)/$($(package)_qtmultimedia_file_name)" >> $($(package)_extract_dir)/.$($(package)_file_name).hash && \
|
||||
echo "$($(package)_qtshadertools_sha256_hash) $($(package)_source_dir)/$($(package)_qtshadertools_file_name)" >> $($(package)_extract_dir)/.$($(package)_file_name).hash && \
|
||||
$(build_SHA256SUM) -c $($(package)_extract_dir)/.$($(package)_file_name).hash && \
|
||||
mkdir qtbase && \
|
||||
$(build_TAR) --no-same-owner --strip-components=1 -xf $($(package)_source) -C qtbase && \
|
||||
|
@ -232,48 +238,47 @@ define $(package)_extract_cmds
|
|||
mkdir qtsvg && \
|
||||
$(build_TAR) --no-same-owner --strip-components=1 -xf $($(package)_source_dir)/$($(package)_qtsvg_file_name) -C qtsvg && \
|
||||
mkdir qtwebsockets && \
|
||||
$(build_TAR) --no-same-owner --strip-components=1 -xf $($(package)_source_dir)/$($(package)_qtwebsockets_file_name) -C qtwebsockets
|
||||
$(build_TAR) --no-same-owner --strip-components=1 -xf $($(package)_source_dir)/$($(package)_qtwebsockets_file_name) -C qtwebsockets && \
|
||||
mkdir qtmultimedia && \
|
||||
$(build_TAR) --no-same-owner --strip-components=1 -xf $($(package)_source_dir)/$($(package)_qtmultimedia_file_name) -C qtmultimedia && \
|
||||
mkdir qtshadertools && \
|
||||
$(build_TAR) --no-same-owner --strip-components=1 -xf $($(package)_source_dir)/$($(package)_qtshadertools_file_name) -C qtshadertools
|
||||
endef
|
||||
|
||||
# Preprocessing steps work as follows:
|
||||
#
|
||||
# 1. Apply our patches to the extracted source. See each patch for more info.
|
||||
#
|
||||
# 2. Create a macOS-Clang-Linux mkspec using our mac-qmake.conf.
|
||||
#
|
||||
# 3. After making a copy of the mkspec for the linux-arm-gnueabi host, named
|
||||
# bitcoin-linux-g++, replace instances of linux-arm-gnueabi with $(host). This
|
||||
# way we can generically support hosts like riscv64-linux-gnu, which Qt doesn't
|
||||
# ship a mkspec for. See it's usage in config_opts_* above.
|
||||
#
|
||||
# 4. Put our C, CXX and LD FLAGS into gcc-base.conf. Only used for non-host builds.
|
||||
#
|
||||
# 5. Do similar for the win32-g++ mkspec.
|
||||
#
|
||||
# 6. In clang.conf, swap out clang & clang++, for our compiler + flags. See #17466.
|
||||
#
|
||||
# 7. Adjust a regex in toolchain.prf, to accommodate Guix's usage of
|
||||
# CROSS_LIBRARY_PATH. See #15277.
|
||||
define $(package)_preprocess_cmds
|
||||
cp $($(package)_patch_dir)/qt.pro qt.pro && \
|
||||
cp $($(package)_patch_dir)/qttools_src.pro qttools/src/src.pro && \
|
||||
cp $($(package)_patch_dir)/root_CMakeLists.txt CMakeLists.txt && \
|
||||
patch -p1 -i $($(package)_patch_dir)/dont_hardcode_pwd.patch && \
|
||||
patch -p1 -i $($(package)_patch_dir)/fix_qt_pkgconfig.patch && \
|
||||
patch -p1 -i $($(package)_patch_dir)/fix_android_jni_static.patch && \
|
||||
patch -p1 -i $($(package)_patch_dir)/no-xlib.patch && \
|
||||
patch -p1 -i $($(package)_patch_dir)/dont_hardcode_x86_64.patch && \
|
||||
patch -p1 -i $($(package)_patch_dir)/qtbase-moc-ignore-gcc-macro.patch && \
|
||||
patch -p1 -i $($(package)_patch_dir)/fix_montery_include.patch && \
|
||||
patch -p1 -i $($(package)_patch_dir)/use_android_ndk23.patch && \
|
||||
patch -p1 -i $($(package)_patch_dir)/rcc_hardcode_timestamp.patch && \
|
||||
patch -p1 -i $($(package)_patch_dir)/duplicate_lcqpafonts.patch && \
|
||||
patch -p1 -i $($(package)_patch_dir)/fast_fixed_dtoa_no_optimize.patch && \
|
||||
patch -p1 -i $($(package)_patch_dir)/guix_cross_lib_path.patch && \
|
||||
patch -p1 -i $($(package)_patch_dir)/no-statx.patch && \
|
||||
patch -p1 -i $($(package)_patch_dir)/no-renameat2.patch && \
|
||||
patch -p1 -i $($(package)_patch_dir)/no_pthread_cond_clockwait.patch && \
|
||||
patch -p1 -i $($(package)_patch_dir)/QTBUG-92199-fix.patch && \
|
||||
patch -p1 -i $($(package)_patch_dir)/windows_func_fix.patch && \
|
||||
patch -p1 -i $($(package)_patch_dir)/fix_include_capitalization.patch && \
|
||||
patch -p1 -i $($(package)_patch_dir)/dont_capitalize_wmf_libs.patch && \
|
||||
patch -p1 -i $($(package)_patch_dir)/no_wraprt_on_apple.patch && \
|
||||
patch -p1 -i $($(package)_patch_dir)/___isOSVersionAtLeast_hack.patch && \
|
||||
patch -p1 -i $($(package)_patch_dir)/missing-include.patch && \
|
||||
patch -p1 -i $($(package)_patch_dir)/no-__builtin_available.patch && \
|
||||
mv $($(package)_patch_dir)/WindowsToolchain.cmake . && \
|
||||
mv $($(package)_patch_dir)/MacToolchain.cmake . && \
|
||||
cd qtmultimedia && \
|
||||
patch -p1 -i $($(package)_patch_dir)/no-ffmpeg.patch && \
|
||||
cd .. && \
|
||||
mkdir -p qtbase/mkspecs/macx-clang-linux &&\
|
||||
cp -f qtbase/mkspecs/macx-clang/qplatformdefs.h qtbase/mkspecs/macx-clang-linux/ &&\
|
||||
cp -f $($(package)_patch_dir)/mac-qmake.conf qtbase/mkspecs/macx-clang-linux/qmake.conf && \
|
||||
cp -r qtbase/mkspecs/linux-arm-gnueabi-g++ qtbase/mkspecs/bitcoin-linux-g++ && \
|
||||
sed -i.old "s/arm-linux-gnueabi-/$(host)-/g" qtbase/mkspecs/bitcoin-linux-g++/qmake.conf && \
|
||||
sed -i.old "s|arm-linux-gnueabi-gcc|$($($(package)_type)_CC)|" qtbase/mkspecs/bitcoin-linux-g++/qmake.conf && \
|
||||
sed -i.old "s|arm-linux-gnueabi-g++|$($($(package)_type)_CXX)|" qtbase/mkspecs/bitcoin-linux-g++/qmake.conf && \
|
||||
sed -i.old "s|arm-linux-gnueabi-ar|$($($(package)_type)_AR)|" qtbase/mkspecs/bitcoin-linux-g++/qmake.conf && \
|
||||
sed -i.old "s|arm-linux-gnueabi-objcopy|$($($(package)_type)_OBJCOPY)|" qtbase/mkspecs/bitcoin-linux-g++/qmake.conf && \
|
||||
sed -i.old "s|arm-linux-gnueabi-nm|$($($(package)_type)_NM)|" qtbase/mkspecs/bitcoin-linux-g++/qmake.conf && \
|
||||
sed -i.old "s|arm-linux-gnueabi-strip|$($($(package)_type)_STRIP)|" qtbase/mkspecs/bitcoin-linux-g++/qmake.conf && \
|
||||
echo "!host_build: QMAKE_CFLAGS += $($(package)_cflags) $($(package)_cppflags)" >> qtbase/mkspecs/common/gcc-base.conf && \
|
||||
echo "!host_build: QMAKE_CXXFLAGS += $($(package)_cxxflags) $($(package)_cppflags)" >> qtbase/mkspecs/common/gcc-base.conf && \
|
||||
echo "!host_build: QMAKE_LFLAGS += $($(package)_ldflags)" >> qtbase/mkspecs/common/gcc-base.conf && \
|
||||
|
@ -281,6 +286,42 @@ define $(package)_preprocess_cmds
|
|||
sed -i.old "s|QMAKE_CXX = \$$$$\$$$${CROSS_COMPILE}clang++|QMAKE_CXX = $($(package)_cxx)|" qtbase/mkspecs/common/clang.conf
|
||||
endef
|
||||
|
||||
# TODO: this is a mess, but i'm tired of rebuilding Qt so it is what it is
|
||||
# TODO: find a better way to make WMF libraries available to Qt without polluting the environment
|
||||
ifeq ($(host_os),darwin)
|
||||
define $(package)_config_cmds
|
||||
export OPENSSL_LIBS=${$(package)_openssl_flags_$(host_os)} \
|
||||
export PKG_CONFIG_SYSROOT_DIR=/ && \
|
||||
export PKG_CONFIG_LIBDIR=$(host_prefix)/lib/pkgconfig && \
|
||||
export QT_MAC_SDK_NO_VERSION_CHECK=1 && \
|
||||
cd qtbase && \
|
||||
env -u C_INCLUDE_PATH -u CPLUS_INCLUDE_PATH -u OBJC_INCLUDE_PATH -u OBJCPLUS_INCLUDE_PATH -u CPATH -u LIBRARY_PATH ./configure -top-level $($(package)_config_opts) --debug-find-pkg=Threads -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON
|
||||
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 \
|
||||
/feather/contrib/depends/x86_64-w64-mingw32/lib/ && \
|
||||
export OPENSSL_LIBS=${$(package)_openssl_flags_$(host_os)} \
|
||||
export PKG_CONFIG_SYSROOT_DIR=/ && \
|
||||
export PKG_CONFIG_LIBDIR=$(host_prefix)/lib/pkgconfig && \
|
||||
export QT_MAC_SDK_NO_VERSION_CHECK=1 && \
|
||||
export V=1 && \
|
||||
export VERBOSE=1 && \
|
||||
cd qtbase && \
|
||||
./configure -top-level $($(package)_config_opts) -DCMAKE_LIBRARY_PATH=$(HOME)/.guix-profile/lib --debug-find-pkg=WMF -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON
|
||||
endef
|
||||
else
|
||||
define $(package)_config_cmds
|
||||
export OPENSSL_LIBS=${$(package)_openssl_flags_$(host_os)} \
|
||||
export PKG_CONFIG_SYSROOT_DIR=/ && \
|
||||
|
@ -289,19 +330,24 @@ define $(package)_config_cmds
|
|||
cd qtbase && \
|
||||
./configure -top-level $($(package)_config_opts)
|
||||
endef
|
||||
endif
|
||||
|
||||
ifeq ($(host_os),darwin)
|
||||
define $(package)_build_cmds
|
||||
export LD_LIBRARY_PATH=${build_prefix}/lib/ && \
|
||||
env -u C_INCLUDE_PATH -u CPLUS_INCLUDE_PATH -u OBJC_INCLUDE_PATH -u OBJCPLUS_INCLUDE_PATH -u CPATH -u LIBRARY_PATH $(MAKE)
|
||||
endef
|
||||
else ifeq ($(host_os),mingw32)
|
||||
define $(package)_build_cmds
|
||||
export LD_LIBRARY_PATH=${build_prefix}/lib/ && \
|
||||
$(MAKE)
|
||||
endef
|
||||
else
|
||||
define $(package)_build_cmds
|
||||
$(MAKE)
|
||||
endef
|
||||
endif
|
||||
|
||||
define $(package)_stage_cmds
|
||||
$(MAKE) -C qtbase INSTALL_ROOT=$($(package)_staging_dir) install && \
|
||||
$(MAKE) -C qttools/src/linguist INSTALL_ROOT=$($(package)_staging_dir) $(addsuffix -install_subtargets,$(addprefix sub-,$($(package)_linguist_tools))) && \
|
||||
$(MAKE) -C qttranslations INSTALL_ROOT=$($(package)_staging_dir) install_subtargets && \
|
||||
$(MAKE) -C qtsvg/src INSTALL_ROOT=$($(package)_staging_dir) install && \
|
||||
$(MAKE) -C qtwebsockets/src INSTALL_ROOT=$($(package)_staging_dir) install
|
||||
endef
|
||||
|
||||
define $(package)_postprocess_cmds
|
||||
echo -n "" > lib/cmake/Qt5Core/Qt5CoreConfigExtras.cmake
|
||||
DESTDIR=$($(package)_staging_dir) cmake --install .
|
||||
endef
|
||||
|
|
|
@ -1,29 +0,0 @@
|
|||
package=readline
|
||||
$(package)_version=8.0
|
||||
$(package)_download_path=https://ftp.gnu.org/gnu/readline
|
||||
$(package)_file_name=$(package)-$($(package)_version).tar.gz
|
||||
$(package)_sha256_hash=e339f51971478d369f8a053a330a190781acb9864cf4c541060f12078948e461
|
||||
$(package)_dependencies=ncurses
|
||||
|
||||
define $(package)_set_vars
|
||||
$(package)_build_opts=CC="$($(package)_cc)"
|
||||
$(package)_config_opts+=--prefix=$(host_prefix)
|
||||
$(package)_config_opts+=--exec-prefix=$(host_prefix)
|
||||
$(package)_config_opts+=--host=$(HOST)
|
||||
$(package)_config_opts+=--disable-shared --with-curses
|
||||
$(package)_config_opts_release=--disable-debug-mode
|
||||
$(package)_build_opts=CFLAGS="$($(package)_cflags) $($(package)_cppflags) -fPIC"
|
||||
endef
|
||||
|
||||
define $(package)_config_cmds
|
||||
$($(package)_autoconf)
|
||||
endef
|
||||
|
||||
define $(package)_build_cmds
|
||||
$(MAKE) $($(package)_build_opts)
|
||||
endef
|
||||
|
||||
define $(package)_stage_cmds
|
||||
$(MAKE) install DESTDIR=$($(package)_staging_dir) prefix=$(host_prefix) exec-prefix=$(host_prefix)
|
||||
endef
|
||||
|
|
@ -6,8 +6,8 @@ $(package)_sha256_hash=6f504490b342a4f8a4c4a02fc9b866cbef8622d5df4e5452b46be121e
|
|||
$(package)_patches=disable-glibc-getrandom-getentropy.patch fix-whitespace.patch
|
||||
|
||||
define $(package)_set_vars
|
||||
$(package)_config_opts=--enable-static --disable-shared
|
||||
$(package)_config_opts+=--prefix=$(host_prefix)
|
||||
$(package)_config_opts=--enable-static --disable-shared
|
||||
$(package)_config_opts+=--prefix=$(host_prefix)
|
||||
endef
|
||||
|
||||
define $(package)_preprocess_cmds
|
||||
|
@ -17,7 +17,7 @@ define $(package)_preprocess_cmds
|
|||
endef
|
||||
|
||||
define $(package)_config_cmds
|
||||
$($(package)_autoconf)
|
||||
$($(package)_autoconf) AR_FLAGS=$($(package)_arflags)
|
||||
endef
|
||||
|
||||
define $(package)_build_cmds
|
||||
|
@ -31,4 +31,3 @@ endef
|
|||
define $(package)_postprocess_cmds
|
||||
rm lib/*.la
|
||||
endef
|
||||
|
||||
|
|
|
@ -1,13 +0,0 @@
|
|||
package=tor-win
|
||||
$(package)_version=0.4.7.8
|
||||
$(package)_download_path=https://dist.torproject.org/torbrowser/11.5.1/
|
||||
$(package)_file_name=tor-win64-$($(package)_version).zip
|
||||
$(package)_sha256_hash=6658aaf7d22052861631917590e248fdf8b3fe40a795d740811362b517113a47
|
||||
$(package)_extract_cmds=mkdir -p $$($(1)_extract_dir) && \
|
||||
echo "$$($(1)_sha256_hash) $$($(1)_source)" > $$($(1)_extract_dir)/.$$($(1)_file_name).hash && \
|
||||
$(build_SHA256SUM) -c $$($(1)_extract_dir)/.$$($(1)_file_name).hash && \
|
||||
unzip $$($(1)_source)
|
||||
|
||||
define $(package)_stage_cmds
|
||||
cp -a Tor $($(package)_staging_prefix_dir)/Tor/
|
||||
endef
|
|
@ -1,8 +1,8 @@
|
|||
package=tor-win
|
||||
$(package)_version=0.4.7.8
|
||||
$(package)_download_path=https://dist.torproject.org/torbrowser/11.5.1/
|
||||
$(package)_file_name=TorBrowser-11.5.1-osx64_en-US.dmg
|
||||
$(package)_sha256_hash=616d719572e4917d1264c622033afb1b4dd98e2553a0d09fd72470c99bad48e5
|
||||
package=tor_darwin
|
||||
$(package)_version=0.4.7.11
|
||||
$(package)_download_path=https://dist.torproject.org/torbrowser/11.5.8/
|
||||
$(package)_file_name=TorBrowser-11.5.8-osx64_en-US.dmg
|
||||
$(package)_sha256_hash=051e5a92ff493826e569eb5487adb4f767ed4936edf7ca8f5c12a8b31e1fad16
|
||||
$(package)_extract_cmds=mkdir -p $$($(1)_extract_dir) && \
|
||||
echo "$$($(1)_sha256_hash) $$($(1)_source)" > $$($(1)_extract_dir)/.$$($(1)_file_name).hash && \
|
||||
$(build_SHA256SUM) -c $$($(1)_extract_dir)/.$$($(1)_file_name).hash && \
|
|
@ -1,4 +1,4 @@
|
|||
package=tor
|
||||
package=tor_linux
|
||||
$(package)_version=0.4.7.7
|
||||
$(package)_download_path=https://dist.torproject.org/
|
||||
$(package)_file_name=tor-$($(package)_version).tar.gz
|
10
contrib/depends/packages/tor_mingw32.mk
Normal file
10
contrib/depends/packages/tor_mingw32.mk
Normal file
|
@ -0,0 +1,10 @@
|
|||
package=tor_mingw32
|
||||
$(package)_version=0.4.7.12
|
||||
$(package)_download_path=https://dist.torproject.org/torbrowser/12.0.1/
|
||||
$(package)_file_name=tor-expert-bundle-12.0.1-windows-x86_64.tar.gz
|
||||
$(package)_sha256_hash=f53cfbc4f4454a265f10a853219b40067ef73feffc4a7d67472b61dbab9129ba
|
||||
|
||||
define $(package)_stage_cmds
|
||||
mkdir -p $($(package)_staging_prefix_dir)/Tor/ && \
|
||||
cp tor.exe $($(package)_staging_prefix_dir)/Tor/
|
||||
endef
|
|
@ -23,6 +23,3 @@ endef
|
|||
define $(package)_stage_cmds
|
||||
$(MAKE) DESTDIR=$($(package)_staging_dir) install
|
||||
endef
|
||||
|
||||
define $(package)_postprocess_cmds
|
||||
endef
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package=zlib
|
||||
$(package)_version=1.2.11
|
||||
$(package)_download_path=https://github.com/madler/zlib/archive/refs/tags/
|
||||
$(package)_file_name=v1.2.11.tar.gz
|
||||
$(package)_sha256_hash=629380c90a77b964d896ed37163f5c3a34f6e6d897311f1df2a7016355c45eff
|
||||
$(package)_version=1.2.13
|
||||
$(package)_download_path=https://github.com/madler/zlib/releases/download/v$($(package)_version)/
|
||||
$(package)_file_name=$(package)-$($(package)_version).tar.gz
|
||||
$(package)_sha256_hash=b3a24de97a8fdbc835b9833169501030b8977031bcb54b3b3ac13740f846ab30
|
||||
|
||||
define $(package)_config_cmds
|
||||
CC="$($(package)_cc)" \
|
||||
|
|
135
contrib/depends/patches/appimage_runtime/CMakeLists.txt
Normal file
135
contrib/depends/patches/appimage_runtime/CMakeLists.txt
Normal file
|
@ -0,0 +1,135 @@
|
|||
cmake_minimum_required(VERSION 3.2)
|
||||
project(appimage_runtime)
|
||||
|
||||
# DISCLAIMER:
|
||||
# Feather builds should be bootstrappable. For this reason we cannot use the runtime binaries provided by the AppImage devs.
|
||||
# This directory exists to allow the AppImage runtime to be compiled from source using the depends build system.
|
||||
# We strongly discourage other projects from copying this code, as it WILL NOT produce a standard runtime.
|
||||
# The runtime produced here is not guaranteed to run on all officially supported platforms.
|
||||
# You have been warned.
|
||||
|
||||
set(CMAKE_VERBOSE_MAKEFILE ON)
|
||||
|
||||
# C and C++ versions
|
||||
set(CMAKE_C_STANDARD 99)
|
||||
set(CMAKE_CXX_STANDARD 98)
|
||||
set(CMAKE_C_STANDARD_REQUIRED ON)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
||||
|
||||
# sanitizer support
|
||||
set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/sanitizers-cmake/cmake" ${CMAKE_MODULE_PATH})
|
||||
|
||||
set(APPIMAGEKIT_RUNTIME_ENABLE_SETPROCTITLE OFF CACHE BOOL "Useful for $TARGET_APPIMAGE; see issue #763")
|
||||
|
||||
# check type of current build
|
||||
string(TOUPPER "${CMAKE_BUILD_TYPE}" BUILD_TYPE_UPPER)
|
||||
if (BUILD_TYPE_UPPER STREQUAL DEBUG)
|
||||
set(BUILD_DEBUG TRUE)
|
||||
else()
|
||||
set(BUILD_DEBUG FALSE)
|
||||
endif()
|
||||
|
||||
# must not include -flto in the following flags, otherwise the data sections will be stripped out
|
||||
set(runtime_cflags
|
||||
-std=c99 -ffunction-sections -fdata-sections
|
||||
-I/feather/contrib/depends/x86_64-linux-gnu/include
|
||||
-I/feather/contrib/depends/x86_64-linux-gnu/include/appimage
|
||||
)
|
||||
# must not include -Wl,--gc-sections in the following flags, otherwise the data sections will be stripped out
|
||||
set(runtime_ldflags -s -ffunction-sections -fdata-sections -flto)
|
||||
|
||||
if(BUILD_DEBUG)
|
||||
message(WARNING "Debug build, adding debug information")
|
||||
set(runtime_cflags -g ${runtime_cflags})
|
||||
else()
|
||||
message(STATUS "Release build, optimizing runtime")
|
||||
set(runtime_cflags -Os ${runtime_cflags})
|
||||
endif()
|
||||
|
||||
if(APPIMAGEKIT_RUNTIME_ENABLE_SETPROCTITLE)
|
||||
set(runtime_cflags ${runtime_cflags} -DENABLE_SETPROCTITLE)
|
||||
endif()
|
||||
|
||||
# objcopy requires actual files for creating new sections to populate the new section
|
||||
# therefore, we generate 3 suitable files containing blank bytes in the right sizes
|
||||
add_custom_command(
|
||||
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/16_blank_bytes
|
||||
COMMAND dd if=/dev/zero bs=1 count=16 of=${CMAKE_CURRENT_BINARY_DIR}/16_blank_bytes
|
||||
)
|
||||
add_custom_command(
|
||||
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/1024_blank_bytes
|
||||
COMMAND dd if=/dev/zero bs=1 count=1024 of=${CMAKE_CURRENT_BINARY_DIR}/1024_blank_bytes
|
||||
)
|
||||
add_custom_command(
|
||||
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/8192_blank_bytes
|
||||
COMMAND dd if=/dev/zero bs=1 count=8192 of=${CMAKE_CURRENT_BINARY_DIR}/8192_blank_bytes
|
||||
)
|
||||
|
||||
# compile first raw object (not linked yet) into which the sections will be embedded
|
||||
# TODO: find out how this .o object can be generated using a normal add_executable call
|
||||
# that'd allow us to get rid of the -I parameters in runtime_cflags
|
||||
add_custom_command(
|
||||
MAIN_DEPENDENCY runtime.c
|
||||
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/runtime.0.o
|
||||
COMMAND ${CMAKE_C_COMPILER} ${runtime_cflags} -c ${CMAKE_CURRENT_SOURCE_DIR}/runtime.c -o runtime.0.o
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||
)
|
||||
|
||||
# embed the sections, one by one
|
||||
# TODO: find out whether all the sections can be embedded in a single objcopy call
|
||||
add_custom_command(
|
||||
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/runtime.1.o
|
||||
COMMAND objcopy --add-section .digest_md5=16_blank_bytes --set-section-flags .digest_md5=noload,readonly runtime.0.o runtime.1.o
|
||||
MAIN_DEPENDENCY ${CMAKE_CURRENT_BINARY_DIR}/runtime.0.o
|
||||
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/16_blank_bytes
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||
)
|
||||
add_custom_command(
|
||||
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/runtime.2.o
|
||||
COMMAND objcopy --add-section .upd_info=1024_blank_bytes --set-section-flags .upd_info=noload,readonly runtime.1.o runtime.2.o
|
||||
MAIN_DEPENDENCY ${CMAKE_CURRENT_BINARY_DIR}/runtime.1.o
|
||||
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/1024_blank_bytes
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||
)
|
||||
add_custom_command(
|
||||
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/runtime.3.o
|
||||
COMMAND objcopy --add-section .sha256_sig=1024_blank_bytes --set-section-flags .sha256_sig=noload,readonly runtime.2.o runtime.3.o
|
||||
MAIN_DEPENDENCY ${CMAKE_CURRENT_BINARY_DIR}/runtime.2.o
|
||||
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/1024_blank_bytes
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||
)
|
||||
add_custom_command(
|
||||
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/runtime.4.o
|
||||
COMMAND objcopy --add-section .sig_key=8192_blank_bytes --set-section-flags .sig_key=noload,readonly runtime.3.o runtime.4.o
|
||||
MAIN_DEPENDENCY ${CMAKE_CURRENT_BINARY_DIR}/runtime.3.o
|
||||
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/8192_blank_bytes
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||
)
|
||||
|
||||
# add the runtime as a normal executable
|
||||
# CLion will recognize it as a normal executable, one can simply step into the code
|
||||
add_executable(runtime ${CMAKE_CURRENT_BINARY_DIR}/runtime.4.o notify.c)
|
||||
if(COMMAND target_link_options)
|
||||
target_link_options(runtime PRIVATE ${runtime_ldflags})
|
||||
else()
|
||||
message(WARNING "CMake version < 3.13, falling back to using target_link_libraries instead of target_link_options")
|
||||
target_link_libraries(runtime PRIVATE ${runtime_ldflags})
|
||||
endif()
|
||||
# CMake gets confused by the .o object, therefore we need to tell it that it shall link everything using the C compiler
|
||||
set_property(TARGET runtime PROPERTY LINKER_LANGUAGE C)
|
||||
target_link_libraries(runtime PRIVATE -Wl,--as-needed -Wl,--dynamic-linker=/lib64/ld-linux-x86-64.so.2 -static-libstdc++ -Wl,-O2 -zmuldefs -L/feather/contrib/depends/x86_64-linux-gnu/lib squashfuse squashfuse_ll fuseprivate lzma z dl pthread appimage_shared appimage_hashlib )
|
||||
|
||||
target_include_directories(runtime PRIVATE ${PROJECT_SOURCE_DIR}/include)
|
||||
|
||||
add_custom_command(
|
||||
TARGET runtime
|
||||
POST_BUILD
|
||||
COMMAND strip ${CMAKE_CURRENT_BINARY_DIR}/runtime
|
||||
)
|
||||
|
||||
add_custom_command(
|
||||
TARGET runtime
|
||||
POST_BUILD
|
||||
COMMAND echo -ne 'AI\\x02' | dd of="${CMAKE_CURRENT_BINARY_DIR}/runtime" bs=1 count=3 seek=8 conv=notrunc
|
||||
)
|
78
contrib/depends/patches/appimage_runtime/notify.c
Normal file
78
contrib/depends/patches/appimage_runtime/notify.c
Normal file
|
@ -0,0 +1,78 @@
|
|||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <dlfcn.h>
|
||||
#include <unistd.h>
|
||||
|
||||
/* Try to show a notification on the GUI, fall back to the command line
|
||||
* timeout is the timeout in milliseconds. timeout = NULL seems to trigger a
|
||||
* GUI error dialog rather than a notification */
|
||||
int notify(char *title, char *body, int timeout)
|
||||
{
|
||||
/* http://stackoverflow.com/questions/13204177/how-to-find-out-if-running-from-terminal-or-gui */
|
||||
if (isatty(fileno(stdin))){
|
||||
/* We were launched from the command line. */
|
||||
printf("\n%s\n", title);
|
||||
printf("%s\n", body);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* We were launched from inside the desktop */
|
||||
printf("\n%s\n", title);
|
||||
printf("%s\n", body);
|
||||
/* https://debian-administration.org/article/407/Creating_desktop_notifications */
|
||||
void *handle, *n;
|
||||
typedef void (*notify_init_t)(char *);
|
||||
typedef void *(*notify_notification_new_t)( char *, char *, char *, char *);
|
||||
typedef void (*notify_notification_set_timeout_t)( void *, int );
|
||||
typedef void (*notify_notification_show_t)(void *, char *);
|
||||
handle = NULL;
|
||||
if(handle == NULL)
|
||||
handle= dlopen("libnotify.so.3", RTLD_LAZY);
|
||||
if(handle == NULL)
|
||||
handle= dlopen("libnotify.so.4", RTLD_LAZY);
|
||||
if(handle == NULL)
|
||||
handle= dlopen("libnotify.so.5", RTLD_LAZY);
|
||||
if(handle == NULL)
|
||||
handle= dlopen("libnotify.so.6", RTLD_LAZY);
|
||||
if(handle == NULL)
|
||||
handle= dlopen("libnotify.so.7", RTLD_LAZY);
|
||||
if(handle == NULL)
|
||||
handle= dlopen("libnotify.so.8", RTLD_LAZY);
|
||||
|
||||
if(handle == NULL)
|
||||
{
|
||||
printf("Failed to open libnotify.\n\n" );
|
||||
}
|
||||
notify_init_t init = (notify_init_t)dlsym(handle, "notify_init");
|
||||
if ( init == NULL )
|
||||
{
|
||||
dlclose( handle );
|
||||
return 1;
|
||||
}
|
||||
init("AppImage");
|
||||
|
||||
notify_notification_new_t nnn = (notify_notification_new_t)dlsym(handle, "notify_notification_new");
|
||||
if ( nnn == NULL )
|
||||
{
|
||||
dlclose( handle );
|
||||
return 1;
|
||||
}
|
||||
n = nnn(title, body, NULL, NULL);
|
||||
notify_notification_set_timeout_t nnst = (notify_notification_set_timeout_t)dlsym(handle, "notify_notification_set_timeout");
|
||||
if ( nnst == NULL )
|
||||
{
|
||||
dlclose( handle );
|
||||
return 1;
|
||||
}
|
||||
nnst(n, timeout);
|
||||
notify_notification_show_t show = (notify_notification_show_t)dlsym(handle, "notify_notification_show");
|
||||
if ( init == NULL )
|
||||
{
|
||||
dlclose( handle );
|
||||
return 1;
|
||||
}
|
||||
show(n, NULL );
|
||||
dlclose(handle );
|
||||
}
|
||||
return 0;
|
||||
}
|
946
contrib/depends/patches/appimage_runtime/runtime.c
Normal file
946
contrib/depends/patches/appimage_runtime/runtime.c
Normal file
|
@ -0,0 +1,946 @@
|
|||
/**************************************************************************
|
||||
*
|
||||
* Copyright (c) 2004-18 Simon Peter
|
||||
* Portions Copyright (c) 2007 Alexander Larsson
|
||||
*
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
#ident "AppImage by Simon Peter, http://appimage.org/"
|
||||
|
||||
#define _GNU_SOURCE
|
||||
|
||||
#include "squashfuse.h"
|
||||
#include <squashfs_fs.h>
|
||||
#include <nonstd.h>
|
||||
|
||||
#include <limits.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <ftw.h>
|
||||
#include <stdio.h>
|
||||
#include <signal.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <pthread.h>
|
||||
#include <errno.h>
|
||||
#include <wait.h>
|
||||
#include <fnmatch.h>
|
||||
|
||||
#include <appimage/appimage_shared.h>
|
||||
#include <hashlib.h>
|
||||
|
||||
#ifndef ENABLE_DLOPEN
|
||||
#define ENABLE_DLOPEN
|
||||
#endif
|
||||
#include "squashfuse_dlopen.h"
|
||||
|
||||
/* Exit status to use when launching an AppImage fails.
|
||||
* For applications that assign meanings to exit status codes (e.g. rsync),
|
||||
* we avoid "cluttering" pre-defined exit status codes by using 127 which
|
||||
* is known to alias an application exit status and also known as launcher
|
||||
* error, see SYSTEM(3POSIX).
|
||||
*/
|
||||
#define EXIT_EXECERROR 127 /* Execution error exit status. */
|
||||
|
||||
//#include "notify.c"
|
||||
extern int notify(char *title, char *body, int timeout);
|
||||
struct stat st;
|
||||
|
||||
static ssize_t fs_offset; // The offset at which a filesystem image is expected = end of this ELF
|
||||
|
||||
static void die(const char *msg) {
|
||||
fprintf(stderr, "%s\n", msg);
|
||||
exit(EXIT_EXECERROR);
|
||||
}
|
||||
|
||||
/* Check whether directory is writable */
|
||||
bool is_writable_directory(char* str) {
|
||||
if(access(str, W_OK) == 0) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
bool startsWith(const char *pre, const char *str)
|
||||
{
|
||||
size_t lenpre = strlen(pre),
|
||||
lenstr = strlen(str);
|
||||
return lenstr < lenpre ? false : strncmp(pre, str, lenpre) == 0;
|
||||
}
|
||||
|
||||
/* Fill in a stat structure. Does not set st_ino */
|
||||
sqfs_err private_sqfs_stat(sqfs *fs, sqfs_inode *inode, struct stat *st) {
|
||||
sqfs_err err = SQFS_OK;
|
||||
uid_t id;
|
||||
|
||||
memset(st, 0, sizeof(*st));
|
||||
st->st_mode = inode->base.mode;
|
||||
st->st_nlink = inode->nlink;
|
||||
st->st_mtime = st->st_ctime = st->st_atime = inode->base.mtime;
|
||||
|
||||
if (S_ISREG(st->st_mode)) {
|
||||
/* FIXME: do symlinks, dirs, etc have a size? */
|
||||
st->st_size = inode->xtra.reg.file_size;
|
||||
st->st_blocks = st->st_size / 512;
|
||||
} else if (S_ISBLK(st->st_mode) || S_ISCHR(st->st_mode)) {
|
||||
st->st_rdev = sqfs_makedev(inode->xtra.dev.major,
|
||||
inode->xtra.dev.minor);
|
||||
} else if (S_ISLNK(st->st_mode)) {
|
||||
st->st_size = inode->xtra.symlink_size;
|
||||
}
|
||||
|
||||
st->st_blksize = fs->sb.block_size; /* seriously? */
|
||||
|
||||
err = sqfs_id_get(fs, inode->base.uid, &id);
|
||||
if (err)
|
||||
return err;
|
||||
st->st_uid = id;
|
||||
err = sqfs_id_get(fs, inode->base.guid, &id);
|
||||
st->st_gid = id;
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
return SQFS_OK;
|
||||
}
|
||||
|
||||
/* ================= End ELF parsing */
|
||||
|
||||
extern int fusefs_main(int argc, char *argv[], void (*mounted) (void));
|
||||
// extern void ext2_quit(void);
|
||||
|
||||
static pid_t fuse_pid;
|
||||
static int keepalive_pipe[2];
|
||||
|
||||
static void *
|
||||
write_pipe_thread (void *arg)
|
||||
{
|
||||
char c[32];
|
||||
int res;
|
||||
// sprintf(stderr, "Called write_pipe_thread");
|
||||
memset (c, 'x', sizeof (c));
|
||||
while (1) {
|
||||
/* Write until we block, on broken pipe, exit */
|
||||
res = write (keepalive_pipe[1], c, sizeof (c));
|
||||
if (res == -1) {
|
||||
kill (fuse_pid, SIGTERM);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void
|
||||
fuse_mounted (void)
|
||||
{
|
||||
pthread_t thread;
|
||||
fuse_pid = getpid();
|
||||
pthread_create(&thread, NULL, write_pipe_thread, keepalive_pipe);
|
||||
}
|
||||
|
||||
char* getArg(int argc, char *argv[],char chr)
|
||||
{
|
||||
int i;
|
||||
for (i=1; i<argc; ++i)
|
||||
if ((argv[i][0]=='-') && (argv[i][1]==chr))
|
||||
return &(argv[i][2]);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* mkdir -p implemented in C, needed for https://github.com/AppImage/AppImageKit/issues/333
|
||||
* https://gist.github.com/JonathonReinhart/8c0d90191c38af2dcadb102c4e202950 */
|
||||
int
|
||||
mkdir_p(const char* const path)
|
||||
{
|
||||
/* Adapted from http://stackoverflow.com/a/2336245/119527 */
|
||||
const size_t len = strlen(path);
|
||||
char _path[PATH_MAX];
|
||||
char *p;
|
||||
|
||||
errno = 0;
|
||||
|
||||
/* Copy string so its mutable */
|
||||
if (len > sizeof(_path)-1) {
|
||||
errno = ENAMETOOLONG;
|
||||
return -1;
|
||||
}
|
||||
strcpy(_path, path);
|
||||
|
||||
/* Iterate the string */
|
||||
for (p = _path + 1; *p; p++) {
|
||||
if (*p == '/') {
|
||||
/* Temporarily truncate */
|
||||
*p = '\0';
|
||||
|
||||
if (mkdir(_path, 0755) != 0) {
|
||||
if (errno != EEXIST)
|
||||
return -1;
|
||||
}
|
||||
|
||||
*p = '/';
|
||||
}
|
||||
}
|
||||
|
||||
if (mkdir(_path, 0755) != 0) {
|
||||
if (errno != EEXIST)
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
print_help(const char *appimage_path)
|
||||
{
|
||||
// TODO: "--appimage-list List content from embedded filesystem image\n"
|
||||
fprintf(stderr,
|
||||
"AppImage options:\n\n"
|
||||
" --appimage-extract [<pattern>] Extract content from embedded filesystem image\n"
|
||||
" If pattern is passed, only extract matching files\n"
|
||||
" --appimage-help Print this help\n"
|
||||
" --appimage-mount Mount embedded filesystem image and print\n"
|
||||
" mount point and wait for kill with Ctrl-C\n"
|
||||
" --appimage-offset Print byte offset to start of embedded\n"
|
||||
" filesystem image\n"
|
||||
" --appimage-portable-home Create a portable home folder to use as $HOME\n"
|
||||
" --appimage-portable-config Create a portable config folder to use as\n"
|
||||
" $XDG_CONFIG_HOME\n"
|
||||
" --appimage-signature Print digital signature embedded in AppImage\n"
|
||||
" --appimage-updateinfo[rmation] Print update info embedded in AppImage\n"
|
||||
"\n"
|
||||
"Portable home:\n"
|
||||
"\n"
|
||||
" If you would like the application contained inside this AppImage to store its\n"
|
||||
" data alongside this AppImage rather than in your home directory, then you can\n"
|
||||
" place a directory named\n"
|
||||
"\n"
|
||||
" %s.home\n"
|
||||
"\n"
|
||||
" Or you can invoke this AppImage with the --appimage-portable-home option,\n"
|
||||
" which will create this directory for you. As long as the directory exists\n"
|
||||
" and is neither moved nor renamed, the application contained inside this\n"
|
||||
" AppImage to store its data in this directory rather than in your home\n"
|
||||
" directory\n"
|
||||
, appimage_path);
|
||||
}
|
||||
|
||||
void
|
||||
portable_option(const char *arg, const char *appimage_path, const char *name)
|
||||
{
|
||||
char option[32];
|
||||
sprintf(option, "appimage-portable-%s", name);
|
||||
|
||||
if (arg && strcmp(arg, option)==0) {
|
||||
char portable_dir[PATH_MAX];
|
||||
char fullpath[PATH_MAX];
|
||||
|
||||
ssize_t length = readlink(appimage_path, fullpath, sizeof(fullpath));
|
||||
if (length < 0) {
|
||||
fprintf(stderr, "Error getting realpath for %s\n", appimage_path);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
fullpath[length] = '\0';
|
||||
|
||||
sprintf(portable_dir, "%s.%s", fullpath, name);
|
||||
if (!mkdir(portable_dir, S_IRWXU))
|
||||
fprintf(stderr, "Portable %s directory created at %s\n", name, portable_dir);
|
||||
else
|
||||
fprintf(stderr, "Error creating portable %s directory at %s: %s\n", name, portable_dir, strerror(errno));
|
||||
|
||||
exit(0);
|
||||
}
|
||||
}
|
||||
|
||||
bool extract_appimage(const char* const appimage_path, const char* const _prefix, const char* const _pattern, const bool overwrite, const bool verbose) {
|
||||
sqfs_err err = SQFS_OK;
|
||||
sqfs_traverse trv;
|
||||
sqfs fs;
|
||||
char prefixed_path_to_extract[1024];
|
||||
|
||||
// local copy we can modify safely
|
||||
// allocate 1 more byte than we would need so we can add a trailing slash if there is none yet
|
||||
char* prefix = malloc(strlen(_prefix) + 2);
|
||||
strcpy(prefix, _prefix);
|
||||
|
||||
// sanitize prefix
|
||||
if (prefix[strlen(prefix) - 1] != '/')
|
||||
strcat(prefix, "/");
|
||||
|
||||
if (access(prefix, F_OK) == -1) {
|
||||
if (mkdir_p(prefix) == -1) {
|
||||
perror("mkdir_p error");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if ((err = sqfs_open_image(&fs, appimage_path, (size_t) fs_offset))) {
|
||||
fprintf(stderr, "Failed to open squashfs image\n");
|
||||
return false;
|
||||
};
|
||||
|
||||
// track duplicate inodes for hardlinks
|
||||
char** created_inode = calloc(fs.sb.inodes, sizeof(char*));
|
||||
if (created_inode == NULL) {
|
||||
fprintf(stderr, "Failed allocating memory to track hardlinks\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
if ((err = sqfs_traverse_open(&trv, &fs, sqfs_inode_root(&fs)))) {
|
||||
fprintf(stderr, "sqfs_traverse_open error\n");
|
||||
free(created_inode);
|
||||
return false;
|
||||
}
|
||||
|
||||
bool rv = true;
|
||||
|
||||
while (sqfs_traverse_next(&trv, &err)) {
|
||||
if (!trv.dir_end) {
|
||||
if (_pattern == NULL || fnmatch(_pattern, trv.path, FNM_FILE_NAME | FNM_LEADING_DIR) == 0) {
|
||||
// fprintf(stderr, "trv.path: %s\n", trv.path);
|
||||
// fprintf(stderr, "sqfs_inode_id: %lu\n", trv.entry.inode);
|
||||
sqfs_inode inode;
|
||||
if (sqfs_inode_get(&fs, &inode, trv.entry.inode)) {
|
||||
fprintf(stderr, "sqfs_inode_get error\n");
|
||||
rv = false;
|
||||
break;
|
||||
}
|
||||
// fprintf(stderr, "inode.base.inode_type: %i\n", inode.base.inode_type);
|
||||
// fprintf(stderr, "inode.xtra.reg.file_size: %lu\n", inode.xtra.reg.file_size);
|
||||
strcpy(prefixed_path_to_extract, "");
|
||||
strcat(strcat(prefixed_path_to_extract, prefix), trv.path);
|
||||
|
||||
if (verbose)
|
||||
fprintf(stdout, "%s\n", prefixed_path_to_extract);
|
||||
|
||||
if (inode.base.inode_type == SQUASHFS_DIR_TYPE || inode.base.inode_type == SQUASHFS_LDIR_TYPE) {
|
||||
// fprintf(stderr, "inode.xtra.dir.parent_inode: %ui\n", inode.xtra.dir.parent_inode);
|
||||
// fprintf(stderr, "mkdir_p: %s/\n", prefixed_path_to_extract);
|
||||
if (access(prefixed_path_to_extract, F_OK) == -1) {
|
||||
if (mkdir_p(prefixed_path_to_extract) == -1) {
|
||||
perror("mkdir_p error");
|
||||
rv = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else if (inode.base.inode_type == SQUASHFS_REG_TYPE || inode.base.inode_type == SQUASHFS_LREG_TYPE) {
|
||||
// if we've already created this inode, then this is a hardlink
|
||||
char* existing_path_for_inode = created_inode[inode.base.inode_number - 1];
|
||||
if (existing_path_for_inode != NULL) {
|
||||
unlink(prefixed_path_to_extract);
|
||||
if (link(existing_path_for_inode, prefixed_path_to_extract) == -1) {
|
||||
fprintf(stderr, "Couldn't create hardlink from \"%s\" to \"%s\": %s\n",
|
||||
prefixed_path_to_extract, existing_path_for_inode, strerror(errno));
|
||||
rv = false;
|
||||
break;
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
struct stat st;
|
||||
if (!overwrite && stat(prefixed_path_to_extract, &st) == 0 && st.st_size == inode.xtra.reg.file_size) {
|
||||
fprintf(stderr, "File exists and file size matches, skipping\n");
|
||||
continue;
|
||||
}
|
||||
|
||||
// track the path we extract to for this inode, so that we can `link` if this inode is found again
|
||||
created_inode[inode.base.inode_number - 1] = strdup(prefixed_path_to_extract);
|
||||
// fprintf(stderr, "Extract to: %s\n", prefixed_path_to_extract);
|
||||
if (private_sqfs_stat(&fs, &inode, &st) != 0)
|
||||
die("private_sqfs_stat error");
|
||||
|
||||
// create parent dir
|
||||
char* p = strrchr(prefixed_path_to_extract, '/');
|
||||
if (p) {
|
||||
// set an \0 to end the split the string
|
||||
*p = '\0';
|
||||
mkdir_p(prefixed_path_to_extract);
|
||||
|
||||
// restore dir seprator
|
||||
*p = '/';
|
||||
}
|
||||
|
||||
// Read the file in chunks
|
||||
off_t bytes_already_read = 0;
|
||||
sqfs_off_t bytes_at_a_time = 64 * 1024;
|
||||
FILE* f;
|
||||
f = fopen(prefixed_path_to_extract, "w+");
|
||||
if (f == NULL) {
|
||||
perror("fopen error");
|
||||
rv = false;
|
||||
break;
|
||||
}
|
||||
while (bytes_already_read < inode.xtra.reg.file_size) {
|
||||
char buf[bytes_at_a_time];
|
||||
if (sqfs_read_range(&fs, &inode, (sqfs_off_t) bytes_already_read, &bytes_at_a_time, buf)) {
|
||||
perror("sqfs_read_range error");
|
||||
rv = false;
|
||||
break;
|
||||
}
|
||||
// fwrite(buf, 1, bytes_at_a_time, stdout);
|
||||
fwrite(buf, 1, bytes_at_a_time, f);
|
||||
bytes_already_read = bytes_already_read + bytes_at_a_time;
|
||||
}
|
||||
fclose(f);
|
||||
chmod(prefixed_path_to_extract, st.st_mode);
|
||||
if (!rv)
|
||||
break;
|
||||
}
|
||||
} else if (inode.base.inode_type == SQUASHFS_SYMLINK_TYPE || inode.base.inode_type == SQUASHFS_LSYMLINK_TYPE) {
|
||||
size_t size;
|
||||
sqfs_readlink(&fs, &inode, NULL, &size);
|
||||
char buf[size];
|
||||
int ret = sqfs_readlink(&fs, &inode, buf, &size);
|
||||
if (ret != 0) {
|
||||
perror("symlink error");
|
||||
rv = false;
|
||||
break;
|
||||
}
|
||||
// fprintf(stderr, "Symlink: %s to %s \n", prefixed_path_to_extract, buf);
|
||||
unlink(prefixed_path_to_extract);
|
||||
ret = symlink(buf, prefixed_path_to_extract);
|
||||
if (ret != 0)
|
||||
fprintf(stderr, "WARNING: could not create symlink\n");
|
||||
} else {
|
||||
fprintf(stderr, "TODO: Implement inode.base.inode_type %i\n", inode.base.inode_type);
|
||||
}
|
||||
// fprintf(stderr, "\n");
|
||||
|
||||
if (!rv)
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < fs.sb.inodes; i++) {
|
||||
free(created_inode[i]);
|
||||
}
|
||||
free(created_inode);
|
||||
|
||||
if (err != SQFS_OK) {
|
||||
fprintf(stderr, "sqfs_traverse_next error\n");
|
||||
rv = false;
|
||||
}
|
||||
sqfs_traverse_close(&trv);
|
||||
sqfs_fd_close(fs.fd);
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
int rm_recursive_callback(const char* path, const struct stat* stat, const int type, struct FTW* ftw) {
|
||||
(void) stat;
|
||||
(void) ftw;
|
||||
|
||||
switch (type) {
|
||||
case FTW_NS:
|
||||
case FTW_DNR:
|
||||
fprintf(stderr, "%s: ftw error: %s\n",
|
||||
path, strerror(errno));
|
||||
return 1;
|
||||
|
||||
case FTW_D:
|
||||
// ignore directories at first, will be handled by FTW_DP
|
||||
break;
|
||||
|
||||
case FTW_F:
|
||||
case FTW_SL:
|
||||
case FTW_SLN:
|
||||
if (remove(path) != 0) {
|
||||
fprintf(stderr, "Failed to remove %s: %s\n", path, strerror(errno));
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case FTW_DP:
|
||||
if (rmdir(path) != 0) {
|
||||
fprintf(stderr, "Failed to remove directory %s: %s\n", path, strerror(errno));
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
fprintf(stderr, "Unexpected fts_info\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
};
|
||||
|
||||
bool rm_recursive(const char* const path) {
|
||||
// FTW_DEPTH: perform depth-first search to make sure files are deleted before the containing directories
|
||||
// FTW_MOUNT: prevent deletion of files on other mounted filesystems
|
||||
// FTW_PHYS: do not follow symlinks, but report symlinks as such; this way, the symlink targets, which might point
|
||||
// to locations outside path will not be deleted accidentally (attackers might abuse this)
|
||||
int rv = nftw(path, &rm_recursive_callback, 0, FTW_DEPTH | FTW_MOUNT | FTW_PHYS);
|
||||
|
||||
return rv == 0;
|
||||
}
|
||||
|
||||
bool build_mount_point(char* mount_dir, const char* const argv0, char const* const temp_base, const size_t templen) {
|
||||
const size_t maxnamelen = 6;
|
||||
|
||||
// when running for another AppImage, we should use that for building the mountpoint name instead
|
||||
char* target_appimage = getenv("TARGET_APPIMAGE");
|
||||
|
||||
char* path_basename;
|
||||
if (target_appimage != NULL) {
|
||||
path_basename = basename(target_appimage);
|
||||
} else {
|
||||
path_basename = basename(argv0);
|
||||
}
|
||||
|
||||
size_t namelen = strlen(path_basename);
|
||||
// limit length of tempdir name
|
||||
if (namelen > maxnamelen) {
|
||||
namelen = maxnamelen;
|
||||
}
|
||||
|
||||
strcpy(mount_dir, temp_base);
|
||||
strncpy(mount_dir + templen, "/.mount_", 8);
|
||||
strncpy(mount_dir + templen + 8, path_basename, namelen);
|
||||
strncpy(mount_dir+templen+8+namelen, "XXXXXX", 6);
|
||||
mount_dir[templen+8+namelen+6] = 0; // null terminate destination
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
char appimage_path[PATH_MAX];
|
||||
char argv0_path[PATH_MAX];
|
||||
char * arg;
|
||||
|
||||
/* We might want to operate on a target appimage rather than this file itself,
|
||||
* e.g., for appimaged which must not run untrusted code from random AppImages.
|
||||
* This variable is intended for use by e.g., appimaged and is subject to
|
||||
* change any time. Do not rely on it being present. We might even limit this
|
||||
* functionality specifically for builds used by appimaged.
|
||||
*/
|
||||
if (getenv("TARGET_APPIMAGE") == NULL) {
|
||||
strcpy(appimage_path, "/proc/self/exe");
|
||||
strcpy(argv0_path, argv[0]);
|
||||
} else {
|
||||
strcpy(appimage_path, getenv("TARGET_APPIMAGE"));
|
||||
strcpy(argv0_path, getenv("TARGET_APPIMAGE"));
|
||||
|
||||
#ifdef ENABLE_SETPROCTITLE
|
||||
// load libbsd dynamically to change proc title
|
||||
// this is an optional feature, therefore we don't hard require it
|
||||
void* libbsd = dlopen("libbsd.so", RTLD_NOW);
|
||||
|
||||
if (libbsd != NULL) {
|
||||
// clear error state
|
||||
dlerror();
|
||||
|
||||
// try to load the two required symbols
|
||||
void (*setproctitle_init)(int, char**, char**) = dlsym(libbsd, "setproctitle_init");
|
||||
|
||||
char* error;
|
||||
|
||||
if ((error = dlerror()) == NULL) {
|
||||
void (*setproctitle)(const char*, char*) = dlsym(libbsd, "setproctitle");
|
||||
|
||||
if (dlerror() == NULL) {
|
||||
char buffer[1024];
|
||||
strcpy(buffer, getenv("TARGET_APPIMAGE"));
|
||||
for (int i = 1; i < argc; i++) {
|
||||
strcat(buffer, " ");
|
||||
strcat(buffer, argv[i]);
|
||||
}
|
||||
|
||||
(*setproctitle_init)(argc, argv, environ);
|
||||
(*setproctitle)("%s", buffer);
|
||||
}
|
||||
}
|
||||
|
||||
dlclose(libbsd);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
// temporary directories are required in a few places
|
||||
// therefore we implement the detection of the temp base dir at the top of the code to avoid redundancy
|
||||
char temp_base[PATH_MAX] = P_tmpdir;
|
||||
|
||||
{
|
||||
const char* const TMPDIR = getenv("TMPDIR");
|
||||
if (TMPDIR != NULL)
|
||||
strcpy(temp_base, getenv("TMPDIR"));
|
||||
}
|
||||
|
||||
fs_offset = appimage_get_elf_size(appimage_path);
|
||||
|
||||
// error check
|
||||
if (fs_offset < 0) {
|
||||
fprintf(stderr, "Failed to get fs offset for %s\n", appimage_path);
|
||||
exit(EXIT_EXECERROR);
|
||||
}
|
||||
|
||||
arg=getArg(argc,argv,'-');
|
||||
|
||||
/* Print the help and then exit */
|
||||
if(arg && strcmp(arg,"appimage-help")==0) {
|
||||
char fullpath[PATH_MAX];
|
||||
|
||||
ssize_t length = readlink(appimage_path, fullpath, sizeof(fullpath));
|
||||
if (length < 0) {
|
||||
fprintf(stderr, "Error getting realpath for %s\n", appimage_path);
|
||||
exit(EXIT_EXECERROR);
|
||||
}
|
||||
fullpath[length] = '\0';
|
||||
|
||||
print_help(fullpath);
|
||||
exit(0);
|
||||
}
|
||||
|
||||
/* Just print the offset and then exit */
|
||||
if(arg && strcmp(arg,"appimage-offset")==0) {
|
||||
printf("%lu\n", fs_offset);
|
||||
exit(0);
|
||||
}
|
||||
|
||||
arg=getArg(argc,argv,'-');
|
||||
|
||||
/* extract the AppImage */
|
||||
if(arg && strcmp(arg,"appimage-extract")==0) {
|
||||
char* pattern;
|
||||
|
||||
// default use case: use standard prefix
|
||||
if (argc == 2) {
|
||||
pattern = NULL;
|
||||
} else if (argc == 3) {
|
||||
pattern = argv[2];
|
||||
} else {
|
||||
fprintf(stderr, "Unexpected argument count: %d\n", argc - 1);
|
||||
fprintf(stderr, "Usage: %s --appimage-extract [<prefix>]\n", argv0_path);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (!extract_appimage(appimage_path, "squashfs-root/", pattern, true, true)) {
|
||||
exit(1);
|
||||
}
|
||||
|
||||
exit(0);
|
||||
}
|
||||
|
||||
// calculate full path of AppImage
|
||||
int length;
|
||||
char fullpath[PATH_MAX];
|
||||
|
||||
if(getenv("TARGET_APPIMAGE") == NULL) {
|
||||
// If we are operating on this file itself
|
||||
ssize_t len = readlink(appimage_path, fullpath, sizeof(fullpath));
|
||||
if (len < 0) {
|
||||
perror("Failed to obtain absolute path");
|
||||
exit(EXIT_EXECERROR);
|
||||
}
|
||||
fullpath[len] = '\0';
|
||||
} else {
|
||||
char* abspath = realpath(appimage_path, NULL);
|
||||
if (abspath == NULL) {
|
||||
perror("Failed to obtain absolute path");
|
||||
exit(EXIT_EXECERROR);
|
||||
}
|
||||
strcpy(fullpath, abspath);
|
||||
free(abspath);
|
||||
}
|
||||
|
||||
if (getenv("APPIMAGE_EXTRACT_AND_RUN") != NULL || (arg && strcmp(arg, "appimage-extract-and-run") == 0)) {
|
||||
char* hexlified_digest = NULL;
|
||||
|
||||
// calculate MD5 hash of file, and use it to make extracted directory name "content-aware"
|
||||
// see https://github.com/AppImage/AppImageKit/issues/841 for more information
|
||||
{
|
||||
FILE* f = fopen(appimage_path, "rb");
|
||||
if (f == NULL) {
|
||||
perror("Failed to open AppImage file");
|
||||
exit(EXIT_EXECERROR);
|
||||
}
|
||||
|
||||
Md5Context ctx;
|
||||
Md5Initialise(&ctx);
|
||||
|
||||
char buf[4096];
|
||||
for (size_t bytes_read; (bytes_read = fread(buf, sizeof(char), sizeof(buf), f)); bytes_read > 0) {
|
||||
Md5Update(&ctx, buf, (uint32_t) bytes_read);
|
||||
}
|
||||
|
||||
MD5_HASH digest;
|
||||
Md5Finalise(&ctx, &digest);
|
||||
|
||||
hexlified_digest = appimage_hexlify(digest.bytes, sizeof(digest.bytes));
|
||||
}
|
||||
|
||||
char* prefix = malloc(strlen(temp_base) + 20 + strlen(hexlified_digest) + 2);
|
||||
strcpy(prefix, temp_base);
|
||||
strcat(prefix, "/appimage_extracted_");
|
||||
strcat(prefix, hexlified_digest);
|
||||
free(hexlified_digest);
|
||||
|
||||
const bool verbose = (getenv("VERBOSE") != NULL);
|
||||
|
||||
if (!extract_appimage(appimage_path, prefix, NULL, false, verbose)) {
|
||||
fprintf(stderr, "Failed to extract AppImage\n");
|
||||
exit(EXIT_EXECERROR);
|
||||
}
|
||||
|
||||
int pid;
|
||||
if ((pid = fork()) == -1) {
|
||||
int error = errno;
|
||||
fprintf(stderr, "fork() failed: %s\n", strerror(error));
|
||||
exit(EXIT_EXECERROR);
|
||||
} else if (pid == 0) {
|
||||
const char apprun_fname[] = "AppRun";
|
||||
char* apprun_path = malloc(strlen(prefix) + 1 + strlen(apprun_fname) + 1);
|
||||
strcpy(apprun_path, prefix);
|
||||
strcat(apprun_path, "/");
|
||||
strcat(apprun_path, apprun_fname);
|
||||
|
||||
// create copy of argument list without the --appimage-extract-and-run parameter
|
||||
char* new_argv[argc];
|
||||
int new_argc = 0;
|
||||
new_argv[new_argc++] = strdup(apprun_path);
|
||||
for (int i = 1; i < argc; ++i) {
|
||||
if (strcmp(argv[i], "--appimage-extract-and-run") != 0) {
|
||||
new_argv[new_argc++] = strdup(argv[i]);
|
||||
}
|
||||
}
|
||||
new_argv[new_argc] = NULL;
|
||||
|
||||
/* Setting some environment variables that the app "inside" might use */
|
||||
setenv("APPIMAGE", fullpath, 1);
|
||||
setenv("ARGV0", argv0_path, 1);
|
||||
setenv("APPDIR", prefix, 1);
|
||||
|
||||
execv(apprun_path, new_argv);
|
||||
|
||||
int error = errno;
|
||||
fprintf(stderr, "Failed to run %s: %s\n", apprun_path, strerror(error));
|
||||
|
||||
free(apprun_path);
|
||||
exit(EXIT_EXECERROR);
|
||||
}
|
||||
|
||||
int status = 0;
|
||||
int rv = waitpid(pid, &status, 0);
|
||||
status = rv > 0 && WIFEXITED (status) ? WEXITSTATUS (status) : EXIT_EXECERROR;
|
||||
|
||||
if (getenv("NO_CLEANUP") == NULL) {
|
||||
if (!rm_recursive(prefix)) {
|
||||
fprintf(stderr, "Failed to clean up cache directory\n");
|
||||
if (status == 0) /* avoid messing existing failure exit status */
|
||||
status = EXIT_EXECERROR;
|
||||
}
|
||||
}
|
||||
|
||||
// template == prefix, must be freed only once
|
||||
free(prefix);
|
||||
|
||||
exit(status);
|
||||
}
|
||||
|
||||
if(arg && (strcmp(arg,"appimage-updateinformation")==0 || strcmp(arg,"appimage-updateinfo")==0)) {
|
||||
unsigned long offset = 0;
|
||||
unsigned long length = 0;
|
||||
appimage_get_elf_section_offset_and_length(appimage_path, ".upd_info", &offset, &length);
|
||||
// fprintf(stderr, "offset: %lu\n", offset);
|
||||
// fprintf(stderr, "length: %lu\n", length);
|
||||
// print_hex(appimage_path, offset, length);
|
||||
appimage_print_binary(appimage_path, offset, length);
|
||||
exit(0);
|
||||
}
|
||||
|
||||
if(arg && strcmp(arg,"appimage-signature")==0) {
|
||||
unsigned long offset = 0;
|
||||
unsigned long length = 0;
|
||||
appimage_get_elf_section_offset_and_length(appimage_path, ".sha256_sig", &offset, &length);
|
||||
// fprintf(stderr, "offset: %lu\n", offset);
|
||||
// fprintf(stderr, "length: %lu\n", length);
|
||||
// print_hex(appimage_path, offset, length);
|
||||
appimage_print_binary(appimage_path, offset, length);
|
||||
exit(0);
|
||||
}
|
||||
|
||||
portable_option(arg, appimage_path, "home");
|
||||
portable_option(arg, appimage_path, "config");
|
||||
|
||||
// If there is an argument starting with appimage- (but not appimage-mount which is handled further down)
|
||||
// then stop here and print an error message
|
||||
if((arg && strncmp(arg, "appimage-", 8) == 0) && (arg && strcmp(arg,"appimage-mount")!=0)) {
|
||||
fprintf(stderr,"--%s is not yet implemented\n", arg);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
LOAD_LIBRARY; /* exit if libfuse is missing */
|
||||
|
||||
int dir_fd, res;
|
||||
|
||||
size_t templen = strlen(temp_base);
|
||||
|
||||
// allocate enough memory (size of name won't exceed 60 bytes)
|
||||
char mount_dir[templen + 60];
|
||||
|
||||
build_mount_point(mount_dir, argv[0], temp_base, templen);
|
||||
|
||||
size_t mount_dir_size = strlen(mount_dir);
|
||||
pid_t pid;
|
||||
char **real_argv;
|
||||
int i;
|
||||
|
||||
if (mkdtemp(mount_dir) == NULL) {
|
||||
perror ("create mount dir error");
|
||||
exit (EXIT_EXECERROR);
|
||||
}
|
||||
|
||||
if (pipe (keepalive_pipe) == -1) {
|
||||
perror ("pipe error");
|
||||
exit (EXIT_EXECERROR);
|
||||
}
|
||||
|
||||
pid = fork ();
|
||||
if (pid == -1) {
|
||||
perror ("fork error");
|
||||
exit (EXIT_EXECERROR);
|
||||
}
|
||||
|
||||
if (pid == 0) {
|
||||
/* in child */
|
||||
|
||||
char *child_argv[5];
|
||||
|
||||
/* close read pipe */
|
||||
close (keepalive_pipe[0]);
|
||||
|
||||
char *dir = realpath(appimage_path, NULL );
|
||||
|
||||
char options[100];
|
||||
sprintf(options, "ro,offset=%lu", fs_offset);
|
||||
|
||||
child_argv[0] = dir;
|
||||
child_argv[1] = "-o";
|
||||
child_argv[2] = options;
|
||||
child_argv[3] = dir;
|
||||
child_argv[4] = mount_dir;
|
||||
|
||||
if(0 != fusefs_main (5, child_argv, fuse_mounted)){
|
||||
char *title;
|
||||
char *body;
|
||||
title = "Cannot mount AppImage, please check your FUSE setup.";
|
||||
body = "You might still be able to extract the contents of this AppImage \n"
|
||||
"if you run it with the --appimage-extract option. \n"
|
||||
"See https://github.com/AppImage/AppImageKit/wiki/FUSE \n"
|
||||
"for more information";
|
||||
notify(title, body, 0); // 3 seconds timeout
|
||||
};
|
||||
} else {
|
||||
/* in parent, child is $pid */
|
||||
int c;
|
||||
|
||||
/* close write pipe */
|
||||
close (keepalive_pipe[1]);
|
||||
|
||||
/* Pause until mounted */
|
||||
read (keepalive_pipe[0], &c, 1);
|
||||
|
||||
/* Fuse process has now daemonized, reap our child */
|
||||
waitpid(pid, NULL, 0);
|
||||
|
||||
dir_fd = open (mount_dir, O_RDONLY);
|
||||
if (dir_fd == -1) {
|
||||
perror ("open dir error");
|
||||
exit (EXIT_EXECERROR);
|
||||
}
|
||||
|
||||
res = dup2 (dir_fd, 1023);
|
||||
if (res == -1) {
|
||||
perror ("dup2 error");
|
||||
exit (EXIT_EXECERROR);
|
||||
}
|
||||
close (dir_fd);
|
||||
|
||||
real_argv = malloc (sizeof (char *) * (argc + 1));
|
||||
for (i = 0; i < argc; i++) {
|
||||
real_argv[i] = argv[i];
|
||||
}
|
||||
real_argv[i] = NULL;
|
||||
|
||||
if(arg && strcmp(arg, "appimage-mount") == 0) {
|
||||
char real_mount_dir[PATH_MAX];
|
||||
|
||||
if (realpath(mount_dir, real_mount_dir) == real_mount_dir) {
|
||||
printf("%s\n", real_mount_dir);
|
||||
} else {
|
||||
printf("%s\n", mount_dir);
|
||||
}
|
||||
|
||||
// stdout is, by default, buffered (unlike stderr), therefore in order to allow other processes to read
|
||||
// the path from stdout, we need to flush the buffers now
|
||||
// this is a less-invasive alternative to setbuf(stdout, NULL);
|
||||
fflush(stdout);
|
||||
|
||||
for (;;) pause();
|
||||
|
||||
exit(0);
|
||||
}
|
||||
|
||||
/* Setting some environment variables that the app "inside" might use */
|
||||
setenv( "APPIMAGE", fullpath, 1 );
|
||||
setenv( "ARGV0", argv0_path, 1 );
|
||||
setenv( "APPDIR", mount_dir, 1 );
|
||||
|
||||
char portable_home_dir[PATH_MAX];
|
||||
char portable_config_dir[PATH_MAX];
|
||||
|
||||
/* If there is a directory with the same name as the AppImage plus ".home", then export $HOME */
|
||||
strcpy (portable_home_dir, fullpath);
|
||||
strcat (portable_home_dir, ".home");
|
||||
if(is_writable_directory(portable_home_dir)){
|
||||
fprintf(stderr, "Setting $HOME to %s\n", portable_home_dir);
|
||||
setenv("HOME",portable_home_dir,1);
|
||||
}
|
||||
|
||||
/* If there is a directory with the same name as the AppImage plus ".config", then export $XDG_CONFIG_HOME */
|
||||
strcpy (portable_config_dir, fullpath);
|
||||
strcat (portable_config_dir, ".config");
|
||||
if(is_writable_directory(portable_config_dir)){
|
||||
fprintf(stderr, "Setting $XDG_CONFIG_HOME to %s\n", portable_config_dir);
|
||||
setenv("XDG_CONFIG_HOME",portable_config_dir,1);
|
||||
}
|
||||
|
||||
/* Original working directory */
|
||||
char cwd[1024];
|
||||
if (getcwd(cwd, sizeof(cwd)) != NULL) {
|
||||
setenv( "OWD", cwd, 1 );
|
||||
}
|
||||
|
||||
char filename[mount_dir_size + 8]; /* enough for mount_dir + "/AppRun" */
|
||||
strcpy (filename, mount_dir);
|
||||
strcat (filename, "/AppRun");
|
||||
|
||||
/* TODO: Find a way to get the exit status and/or output of this */
|
||||
execv (filename, real_argv);
|
||||
/* Error if we continue here */
|
||||
perror("execv error");
|
||||
exit(EXIT_EXECERROR);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
163
contrib/depends/patches/libappimage/no-unneeded-deps.patch
Normal file
163
contrib/depends/patches/libappimage/no-unneeded-deps.patch
Normal file
|
@ -0,0 +1,163 @@
|
|||
From b7875398d91821a49b7b0233950a3e687257c790 Mon Sep 17 00:00:00 2001
|
||||
From: tobtoht <tob@featherwallet.org>
|
||||
Date: Mon, 7 Nov 2022 11:30:46 +0100
|
||||
Subject: [PATCH] no unneeded deps
|
||||
|
||||
---
|
||||
cmake/dependencies.cmake | 78 +++++++++++++++----------------
|
||||
cmake/imported_dependencies.cmake | 10 ++--
|
||||
cmake/tools.cmake | 3 --
|
||||
src/CMakeLists.txt | 12 ++---
|
||||
4 files changed, 50 insertions(+), 53 deletions(-)
|
||||
|
||||
diff --git a/cmake/dependencies.cmake b/cmake/dependencies.cmake
|
||||
index 7c65e85..5bf5e51 100644
|
||||
--- a/cmake/dependencies.cmake
|
||||
+++ b/cmake/dependencies.cmake
|
||||
@@ -55,45 +55,45 @@ endif()
|
||||
# for distro packaging, it can be linked to an existing package just fine
|
||||
set(USE_SYSTEM_SQUASHFUSE OFF CACHE BOOL "Use system libsquashfuse instead of building our own")
|
||||
|
||||
-if(NOT USE_SYSTEM_SQUASHFUSE)
|
||||
- message(STATUS "Downloading and building squashfuse")
|
||||
-
|
||||
- # TODO: implement out-of-source builds for squashfuse, as for the other dependencies
|
||||
- configure_file(
|
||||
- ${CMAKE_CURRENT_SOURCE_DIR}/src/patches/patch-squashfuse.sh.in
|
||||
- ${CMAKE_CURRENT_BINARY_DIR}/patch-squashfuse.sh
|
||||
- @ONLY
|
||||
- )
|
||||
-
|
||||
- ExternalProject_Add(squashfuse-EXTERNAL
|
||||
- GIT_REPOSITORY https://github.com/vasi/squashfuse/
|
||||
- GIT_TAG 1f98030
|
||||
- UPDATE_COMMAND "" # make sure CMake won't try to fetch updates unnecessarily and hence rebuild the dependency every time
|
||||
- PATCH_COMMAND bash -xe ${CMAKE_CURRENT_BINARY_DIR}/patch-squashfuse.sh
|
||||
- CONFIGURE_COMMAND ${LIBTOOLIZE} --force
|
||||
- # for some reason, a first run may fail, but it seems just running it a second time fixes the issues
|
||||
- COMMAND env PKG_CONFIG_PATH=${xz_LIBRARY_DIRS}/pkgconfig ./autogen.sh || true
|
||||
- COMMAND env PKG_CONFIG_PATH=${xz_LIBRARY_DIRS}/pkgconfig ./autogen.sh
|
||||
- COMMAND ${SED} -i "/PKG_CHECK_MODULES.*/,/,:./d" configure # https://github.com/vasi/squashfuse/issues/12
|
||||
- COMMAND ${SED} -i "s/typedef off_t sqfs_off_t/typedef int64_t sqfs_off_t/g" common.h # off_t's size might differ, see https://stackoverflow.com/a/9073762
|
||||
- COMMAND CC=${CC} CXX=${CXX} CFLAGS=${CFLAGS} LDFLAGS=${LDFLAGS} <SOURCE_DIR>/configure --disable-demo --disable-high-level --without-lzo --without-lz4 --prefix=<INSTALL_DIR> --libdir=<INSTALL_DIR>/lib --with-xz=${xz_PREFIX} ${EXTRA_CONFIGURE_FLAGS}
|
||||
- COMMAND ${SED} -i "s|XZ_LIBS = -llzma |XZ_LIBS = -Bstatic ${xz_LIBRARIES}/|g" Makefile
|
||||
- BUILD_COMMAND ${MAKE}
|
||||
- BUILD_IN_SOURCE ON
|
||||
- INSTALL_COMMAND ${MAKE} install
|
||||
- )
|
||||
-
|
||||
- import_external_project(
|
||||
- TARGET_NAME libsquashfuse
|
||||
- EXT_PROJECT_NAME squashfuse-EXTERNAL
|
||||
- LIBRARIES "<SOURCE_DIR>/.libs/libsquashfuse.a;<SOURCE_DIR>/.libs/libsquashfuse_ll.a;<SOURCE_DIR>/.libs/libfuseprivate.a"
|
||||
- INCLUDE_DIRS "<SOURCE_DIR>"
|
||||
- )
|
||||
-else()
|
||||
- message(STATUS "Using system squashfuse")
|
||||
-
|
||||
- import_pkgconfig_target(TARGET_NAME libsquashfuse PKGCONFIG_TARGET squashfuse)
|
||||
-endif()
|
||||
+#if(NOT USE_SYSTEM_SQUASHFUSE)
|
||||
+# message(STATUS "Downloading and building squashfuse")
|
||||
+#
|
||||
+# # TODO: implement out-of-source builds for squashfuse, as for the other dependencies
|
||||
+# configure_file(
|
||||
+# ${CMAKE_CURRENT_SOURCE_DIR}/src/patches/patch-squashfuse.sh.in
|
||||
+# ${CMAKE_CURRENT_BINARY_DIR}/patch-squashfuse.sh
|
||||
+# @ONLY
|
||||
+# )
|
||||
+#
|
||||
+# ExternalProject_Add(squashfuse-EXTERNAL
|
||||
+# GIT_REPOSITORY https://github.com/vasi/squashfuse/
|
||||
+# GIT_TAG 1f98030
|
||||
+# UPDATE_COMMAND "" # make sure CMake won't try to fetch updates unnecessarily and hence rebuild the dependency every time
|
||||
+# PATCH_COMMAND bash -xe ${CMAKE_CURRENT_BINARY_DIR}/patch-squashfuse.sh
|
||||
+# CONFIGURE_COMMAND ${LIBTOOLIZE} --force
|
||||
+# # for some reason, a first run may fail, but it seems just running it a second time fixes the issues
|
||||
+# COMMAND env PKG_CONFIG_PATH=${xz_LIBRARY_DIRS}/pkgconfig ./autogen.sh || true
|
||||
+# COMMAND env PKG_CONFIG_PATH=${xz_LIBRARY_DIRS}/pkgconfig ./autogen.sh
|
||||
+# COMMAND ${SED} -i "/PKG_CHECK_MODULES.*/,/,:./d" configure # https://github.com/vasi/squashfuse/issues/12
|
||||
+# COMMAND ${SED} -i "s/typedef off_t sqfs_off_t/typedef int64_t sqfs_off_t/g" common.h # off_t's size might differ, see https://stackoverflow.com/a/9073762
|
||||
+# COMMAND CC=${CC} CXX=${CXX} CFLAGS=${CFLAGS} LDFLAGS=${LDFLAGS} <SOURCE_DIR>/configure --disable-demo --disable-high-level --without-lzo --without-lz4 --prefix=<INSTALL_DIR> --libdir=<INSTALL_DIR>/lib --with-xz=${xz_PREFIX} ${EXTRA_CONFIGURE_FLAGS}
|
||||
+# COMMAND ${SED} -i "s|XZ_LIBS = -llzma |XZ_LIBS = -Bstatic ${xz_LIBRARIES}/|g" Makefile
|
||||
+# BUILD_COMMAND ${MAKE}
|
||||
+# BUILD_IN_SOURCE ON
|
||||
+# INSTALL_COMMAND ${MAKE} install
|
||||
+# )
|
||||
+#
|
||||
+# import_external_project(
|
||||
+# TARGET_NAME libsquashfuse
|
||||
+# EXT_PROJECT_NAME squashfuse-EXTERNAL
|
||||
+# LIBRARIES "<SOURCE_DIR>/.libs/libsquashfuse.a;<SOURCE_DIR>/.libs/libsquashfuse_ll.a;<SOURCE_DIR>/.libs/libfuseprivate.a"
|
||||
+# INCLUDE_DIRS "<SOURCE_DIR>"
|
||||
+# )
|
||||
+#else()
|
||||
+# message(STATUS "Using system squashfuse")
|
||||
+#
|
||||
+# import_pkgconfig_target(TARGET_NAME libsquashfuse PKGCONFIG_TARGET squashfuse)
|
||||
+#endif()
|
||||
|
||||
|
||||
set(USE_SYSTEM_LIBARCHIVE OFF CACHE BOOL "Use system libarchive instead of building our own")
|
||||
diff --git a/cmake/imported_dependencies.cmake b/cmake/imported_dependencies.cmake
|
||||
index 56d7fc0..2a709c9 100644
|
||||
--- a/cmake/imported_dependencies.cmake
|
||||
+++ b/cmake/imported_dependencies.cmake
|
||||
@@ -3,8 +3,8 @@ include(${CMAKE_CURRENT_LIST_DIR}/scripts.cmake)
|
||||
# the names of the targets need to differ from the library filenames
|
||||
# this is especially an issue with libcairo, where the library is called libcairo
|
||||
# therefore, all libs imported this way have been prefixed with lib
|
||||
-import_pkgconfig_target(TARGET_NAME libglib PKGCONFIG_TARGET glib-2.0>=2.40)
|
||||
-import_pkgconfig_target(TARGET_NAME libgobject PKGCONFIG_TARGET gobject-2.0>=2.40)
|
||||
-import_pkgconfig_target(TARGET_NAME libgio PKGCONFIG_TARGET gio-2.0>=2.40)
|
||||
-import_pkgconfig_target(TARGET_NAME libzlib PKGCONFIG_TARGET zlib)
|
||||
-import_pkgconfig_target(TARGET_NAME libcairo PKGCONFIG_TARGET cairo)
|
||||
+#import_pkgconfig_target(TARGET_NAME libglib PKGCONFIG_TARGET glib-2.0>=2.40)
|
||||
+#import_pkgconfig_target(TARGET_NAME libgobject PKGCONFIG_TARGET gobject-2.0>=2.40)
|
||||
+#import_pkgconfig_target(TARGET_NAME libgio PKGCONFIG_TARGET gio-2.0>=2.40)
|
||||
+#import_pkgconfig_target(TARGET_NAME libzlib PKGCONFIG_TARGET zlib)
|
||||
+#import_pkgconfig_target(TARGET_NAME libcairo PKGCONFIG_TARGET cairo)
|
||||
diff --git a/cmake/tools.cmake b/cmake/tools.cmake
|
||||
index d0941bb..c93b6b3 100644
|
||||
--- a/cmake/tools.cmake
|
||||
+++ b/cmake/tools.cmake
|
||||
@@ -50,9 +50,6 @@ check_program(NAME autoreconf)
|
||||
check_program(NAME libtoolize)
|
||||
check_program(NAME patch)
|
||||
check_program(NAME sed)
|
||||
-check_program(NAME wget)
|
||||
-check_program(NAME xxd)
|
||||
-check_program(NAME desktop-file-validate)
|
||||
check_program(NAME objcopy FORCE_PREFIX)
|
||||
check_program(NAME objdump FORCE_PREFIX)
|
||||
check_program(NAME readelf FORCE_PREFIX)
|
||||
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
|
||||
index 664bf2a..081523b 100644
|
||||
--- a/src/CMakeLists.txt
|
||||
+++ b/src/CMakeLists.txt
|
||||
@@ -3,16 +3,16 @@ cmake_minimum_required(VERSION 3.6)
|
||||
|
||||
find_package(PkgConfig)
|
||||
|
||||
-pkg_check_modules(glib glib-2.0>=2.40 IMPORTED_TARGET)
|
||||
-pkg_check_modules(gobject gobject-2.0>=2.40 IMPORTED_TARGET)
|
||||
-pkg_check_modules(gio gio-2.0>=2.40 IMPORTED_TARGET)
|
||||
-pkg_check_modules(zlib zlib IMPORTED_TARGET)
|
||||
-pkg_check_modules(cairo cairo IMPORTED_TARGET)
|
||||
+#pkg_check_modules(glib glib-2.0>=2.40 IMPORTED_TARGET)
|
||||
+#pkg_check_modules(gobject gobject-2.0>=2.40 IMPORTED_TARGET)
|
||||
+#pkg_check_modules(gio gio-2.0>=2.40 IMPORTED_TARGET)
|
||||
+#pkg_check_modules(zlib zlib IMPORTED_TARGET)
|
||||
+#pkg_check_modules(cairo cairo IMPORTED_TARGET)
|
||||
|
||||
add_subdirectory(xdg-basedir)
|
||||
add_subdirectory(libappimage_hashlib)
|
||||
add_subdirectory(libappimage_shared)
|
||||
-add_subdirectory(libappimage)
|
||||
+#add_subdirectory(libappimage)
|
||||
|
||||
# Export the package for use from the build-tree
|
||||
# (this registers the build-tree with a global CMake-registry)
|
||||
--
|
||||
2.38.1
|
||||
|
57
contrib/depends/patches/libsquashfuse/squashfuse.patch
Normal file
57
contrib/depends/patches/libsquashfuse/squashfuse.patch
Normal file
|
@ -0,0 +1,57 @@
|
|||
diff --git a/Makefile.am b/Makefile.am
|
||||
index f0d7cde..70c4aa0 100644
|
||||
--- a/Makefile.am
|
||||
+++ b/Makefile.am
|
||||
@@ -14,6 +14,7 @@ bin_PROGRAMS =
|
||||
noinst_PROGRAMS =
|
||||
|
||||
noinst_LTLIBRARIES = libsquashfuse.la
|
||||
+noinst_LTLIBRARIES += libsquashfuse_ll.la
|
||||
|
||||
# Main library: libsquashfuse
|
||||
libsquashfuse_la_SOURCES = swap.c cache.c table.c dir.c file.c fs.c \
|
||||
@@ -46,10 +47,9 @@ endif
|
||||
|
||||
# Low-level squashfuse_ll, if supported
|
||||
if SQ_WANT_LOWLEVEL
|
||||
-bin_PROGRAMS += squashfuse_ll
|
||||
-squashfuse_ll_SOURCES = ll.c ll_inode.c nonstd-daemon.c ll.h
|
||||
-squashfuse_ll_CPPFLAGS = $(FUSE_CPPFLAGS)
|
||||
-squashfuse_ll_LDADD = libsquashfuse.la libfuseprivate.la $(COMPRESSION_LIBS) \
|
||||
+libsquashfuse_ll_la_SOURCES = ll.c ll_inode.c nonstd-daemon.c ll.h
|
||||
+libsquashfuse_ll_la_CPPFLAGS = $(FUSE_CPPFLAGS)
|
||||
+libsquashfuse_ll_la_LIBADD = libsquashfuse.la libfuseprivate.la $(COMPRESSION_LIBS) \
|
||||
$(FUSE_LIBS)
|
||||
|
||||
noinst_LTLIBRARIES += libfuseprivate.la
|
||||
diff --git a/ll.c b/ll.c
|
||||
index a2c7902..8fcb3f4 100644
|
||||
--- a/ll.c
|
||||
+++ b/ll.c
|
||||
@@ -390,7 +390,7 @@ static sqfs_ll *sqfs_ll_open(const char *path, size_t offset) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
-int main(int argc, char *argv[]) {
|
||||
+int fusefs_main(int argc, char *argv[], void (*mounted) (void)) {
|
||||
struct fuse_args args;
|
||||
sqfs_opts opts;
|
||||
|
||||
@@ -451,6 +451,8 @@ int main(int argc, char *argv[]) {
|
||||
if (sqfs_ll_daemonize(fg) != -1) {
|
||||
if (fuse_set_signal_handlers(se) != -1) {
|
||||
fuse_session_add_chan(se, ch.ch);
|
||||
+ if (mounted)
|
||||
+ mounted ();
|
||||
/* FIXME: multithreading */
|
||||
err = fuse_session_loop(se);
|
||||
fuse_remove_signal_handlers(se);
|
||||
@@ -466,6 +468,8 @@ int main(int argc, char *argv[]) {
|
||||
}
|
||||
}
|
||||
fuse_opt_free_args(&args);
|
||||
+ if (mounted)
|
||||
+ rmdir (mountpoint);
|
||||
free(ll);
|
||||
free(mountpoint);
|
||||
|
11
contrib/depends/patches/libsquashfuse/squashfuse_dlopen.c
Normal file
11
contrib/depends/patches/libsquashfuse/squashfuse_dlopen.c
Normal file
|
@ -0,0 +1,11 @@
|
|||
#include "squashfuse_dlopen.h"
|
||||
|
||||
int have_libloaded = 0;
|
||||
|
||||
const char *load_library_errmsg =
|
||||
"AppImages require FUSE to run. \n"
|
||||
"You might still be able to extract the contents of this AppImage \n"
|
||||
"if you run it with the --appimage-extract option. \n"
|
||||
"See https://github.com/AppImage/AppImageKit/wiki/FUSE \n"
|
||||
"for more information\n";
|
||||
|
262
contrib/depends/patches/libsquashfuse/squashfuse_dlopen.h
Normal file
262
contrib/depends/patches/libsquashfuse/squashfuse_dlopen.h
Normal file
|
@ -0,0 +1,262 @@
|
|||
#ifndef SQFS_DLOPEN_H
|
||||
#define SQFS_DLOPEN_H
|
||||
|
||||
//#define ENABLE_DLOPEN
|
||||
|
||||
#ifdef ENABLE_DLOPEN
|
||||
|
||||
#include <dlfcn.h>
|
||||
|
||||
#include <time.h>
|
||||
#include <utime.h>
|
||||
#include <fcntl.h>
|
||||
#include <inttypes.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/statvfs.h>
|
||||
#include <sys/uio.h>
|
||||
|
||||
|
||||
/*** dlopen() stuff ***/
|
||||
|
||||
#define LIBNAME "libfuse.so.2"
|
||||
|
||||
void *libhandle;
|
||||
int have_libloaded;
|
||||
const char *load_library_errmsg;
|
||||
|
||||
#define LOAD_LIBRARY \
|
||||
if (have_libloaded != 1) { \
|
||||
if (!(libhandle = dlopen(LIBNAME, RTLD_LAZY))) { \
|
||||
fprintf(stderr, "dlopen(): error loading " LIBNAME "\n\n%s", load_library_errmsg ); \
|
||||
exit(1); \
|
||||
} else { \
|
||||
have_libloaded = 1; \
|
||||
} \
|
||||
}
|
||||
|
||||
#define STRINGIFY(x) #x
|
||||
|
||||
#define LOAD_SYMBOL(type,x,param) \
|
||||
type (*dl_##x) param; \
|
||||
*(void **) (&dl_##x) = dlsym(libhandle, STRINGIFY(x)); \
|
||||
if (dlerror()) { \
|
||||
fprintf(stderr, "dlsym(): error loading symbol from " LIBNAME "\n\n%s", load_library_errmsg ); \
|
||||
CLOSE_LIBRARY; \
|
||||
exit(1); \
|
||||
}
|
||||
|
||||
#define DL(x) dl_##x
|
||||
#define CLOSE_LIBRARY dlclose(libhandle);
|
||||
|
||||
|
||||
/*** libfuse stuff ***/
|
||||
|
||||
#define FUSE_ROOT_ID 1
|
||||
#define FUSE_ARGS_INIT(argc, argv) { argc, argv, 0 }
|
||||
#define FUSE_OPT_KEY(templ, key) { templ, -1U, key }
|
||||
#define FUSE_OPT_KEY_OPT -1
|
||||
#define FUSE_OPT_KEY_NONOPT -2
|
||||
#define FUSE_OPT_END { NULL, 0, 0 }
|
||||
|
||||
enum fuse_buf_flags {
|
||||
FUSE_BUF_IS_FD = (1 << 1),
|
||||
FUSE_BUF_FD_SEEK = (1 << 2),
|
||||
FUSE_BUF_FD_RETRY = (1 << 3),
|
||||
};
|
||||
|
||||
typedef unsigned long fuse_ino_t;
|
||||
typedef struct fuse_req *fuse_req_t;
|
||||
|
||||
struct fuse_chan;
|
||||
struct fuse_pollhandle;
|
||||
|
||||
struct fuse_args {
|
||||
int argc;
|
||||
char **argv;
|
||||
int allocated;
|
||||
};
|
||||
|
||||
typedef int (*fuse_fill_dir_t) (void *buf, const char *name, const struct stat *stbuf, off_t off);
|
||||
typedef int (*fuse_opt_proc_t)(void *data, const char *arg, int key, struct fuse_args *outargs);
|
||||
typedef struct fuse_dirhandle *fuse_dirh_t;
|
||||
typedef int (*fuse_dirfil_t) (fuse_dirh_t h, const char *name, int type, ino_t ino);
|
||||
|
||||
struct fuse_file_info {
|
||||
int flags;
|
||||
unsigned long fh_old;
|
||||
int writepage;
|
||||
unsigned int direct_io : 1;
|
||||
unsigned int keep_cache : 1;
|
||||
unsigned int flush : 1;
|
||||
unsigned int nonseekable : 1;
|
||||
unsigned int flock_release : 1;
|
||||
unsigned int padding : 27;
|
||||
uint64_t fh;
|
||||
uint64_t lock_owner;
|
||||
};
|
||||
|
||||
struct fuse_entry_param {
|
||||
fuse_ino_t ino;
|
||||
unsigned long generation;
|
||||
struct stat attr;
|
||||
double attr_timeout;
|
||||
double entry_timeout;
|
||||
};
|
||||
|
||||
struct fuse_opt {
|
||||
const char *templ;
|
||||
unsigned long offset;
|
||||
int value;
|
||||
};
|
||||
|
||||
struct fuse_forget_data {
|
||||
uint64_t ino;
|
||||
uint64_t nlookup;
|
||||
};
|
||||
|
||||
struct fuse_conn_info {
|
||||
unsigned proto_major;
|
||||
unsigned proto_minor;
|
||||
unsigned async_read;
|
||||
unsigned max_write;
|
||||
unsigned max_readahead;
|
||||
unsigned capable;
|
||||
unsigned want;
|
||||
unsigned max_background;
|
||||
unsigned congestion_threshold;
|
||||
unsigned reserved[23];
|
||||
};
|
||||
|
||||
struct fuse_buf {
|
||||
size_t size;
|
||||
enum fuse_buf_flags flags;
|
||||
void *mem;
|
||||
int fd;
|
||||
off_t pos;
|
||||
};
|
||||
|
||||
struct fuse_bufvec {
|
||||
size_t count;
|
||||
size_t idx;
|
||||
size_t off;
|
||||
struct fuse_buf buf[1];
|
||||
};
|
||||
|
||||
struct fuse_context {
|
||||
struct fuse *fuse;
|
||||
uid_t uid;
|
||||
gid_t gid;
|
||||
pid_t pid;
|
||||
void *private_data;
|
||||
mode_t umask;
|
||||
};
|
||||
|
||||
struct fuse_operations {
|
||||
int (*getattr) (const char *, struct stat *);
|
||||
int (*readlink) (const char *, char *, size_t);
|
||||
int (*getdir) (const char *, fuse_dirh_t, fuse_dirfil_t);
|
||||
int (*mknod) (const char *, mode_t, dev_t);
|
||||
int (*mkdir) (const char *, mode_t);
|
||||
int (*unlink) (const char *);
|
||||
int (*rmdir) (const char *);
|
||||
int (*symlink) (const char *, const char *);
|
||||
int (*rename) (const char *, const char *);
|
||||
int (*link) (const char *, const char *);
|
||||
int (*chmod) (const char *, mode_t);
|
||||
int (*chown) (const char *, uid_t, gid_t);
|
||||
int (*truncate) (const char *, off_t);
|
||||
int (*utime) (const char *, struct utimbuf *);
|
||||
int (*open) (const char *, struct fuse_file_info *);
|
||||
int (*read) (const char *, char *, size_t, off_t, struct fuse_file_info *);
|
||||
int (*write) (const char *, const char *, size_t, off_t, struct fuse_file_info *);
|
||||
int (*statfs) (const char *, struct statvfs *);
|
||||
int (*flush) (const char *, struct fuse_file_info *);
|
||||
int (*release) (const char *, struct fuse_file_info *);
|
||||
int (*fsync) (const char *, int, struct fuse_file_info *);
|
||||
int (*setxattr) (const char *, const char *, const char *, size_t, int);
|
||||
int (*getxattr) (const char *, const char *, char *, size_t);
|
||||
int (*listxattr) (const char *, char *, size_t);
|
||||
int (*removexattr) (const char *, const char *);
|
||||
int (*opendir) (const char *, struct fuse_file_info *);
|
||||
int (*readdir) (const char *, void *, fuse_fill_dir_t, off_t, struct fuse_file_info *);
|
||||
int (*releasedir) (const char *, struct fuse_file_info *);
|
||||
int (*fsyncdir) (const char *, int, struct fuse_file_info *);
|
||||
void *(*init) (struct fuse_conn_info *conn);
|
||||
void (*destroy) (void *);
|
||||
int (*access) (const char *, int);
|
||||
int (*create) (const char *, mode_t, struct fuse_file_info *);
|
||||
int (*ftruncate) (const char *, off_t, struct fuse_file_info *);
|
||||
int (*fgetattr) (const char *, struct stat *, struct fuse_file_info *);
|
||||
int (*lock) (const char *, struct fuse_file_info *, int cmd, struct flock *);
|
||||
int (*utimens) (const char *, const struct timespec tv[2]);
|
||||
int (*bmap) (const char *, size_t blocksize, uint64_t *idx);
|
||||
unsigned int flag_nullpath_ok:1;
|
||||
unsigned int flag_nopath:1;
|
||||
unsigned int flag_utime_omit_ok:1;
|
||||
unsigned int flag_reserved:29;
|
||||
int (*ioctl) (const char *, int cmd, void *arg, struct fuse_file_info *, unsigned int flags, void *data);
|
||||
int (*poll) (const char *, struct fuse_file_info *, struct fuse_pollhandle *ph, unsigned *reventsp);
|
||||
int (*write_buf) (const char *, struct fuse_bufvec *buf, off_t off, struct fuse_file_info *);
|
||||
int (*read_buf) (const char *, struct fuse_bufvec **bufp, size_t size, off_t off, struct fuse_file_info *);
|
||||
int (*flock) (const char *, struct fuse_file_info *, int op);
|
||||
int (*fallocate) (const char *, int, off_t, off_t, struct fuse_file_info *);
|
||||
};
|
||||
|
||||
struct fuse_lowlevel_ops {
|
||||
void (*init) (void *userdata, struct fuse_conn_info *conn);
|
||||
void (*destroy) (void *userdata);
|
||||
void (*lookup) (fuse_req_t req, fuse_ino_t parent, const char *name);
|
||||
void (*forget) (fuse_req_t req, fuse_ino_t ino, unsigned long nlookup);
|
||||
void (*getattr) (fuse_req_t req, fuse_ino_t ino, struct fuse_file_info *fi);
|
||||
void (*setattr) (fuse_req_t req, fuse_ino_t ino, struct stat *attr, int to_set, struct fuse_file_info *fi);
|
||||
void (*readlink) (fuse_req_t req, fuse_ino_t ino);
|
||||
void (*mknod) (fuse_req_t req, fuse_ino_t parent, const char *name, mode_t mode, dev_t rdev);
|
||||
void (*mkdir) (fuse_req_t req, fuse_ino_t parent, const char *name, mode_t mode);
|
||||
void (*unlink) (fuse_req_t req, fuse_ino_t parent, const char *name);
|
||||
void (*rmdir) (fuse_req_t req, fuse_ino_t parent, const char *name);
|
||||
void (*symlink) (fuse_req_t req, const char *link, fuse_ino_t parent, const char *name);
|
||||
void (*rename) (fuse_req_t req, fuse_ino_t parent, const char *name, fuse_ino_t newparent, const char *newname);
|
||||
void (*link) (fuse_req_t req, fuse_ino_t ino, fuse_ino_t newparent, const char *newname);
|
||||
void (*open) (fuse_req_t req, fuse_ino_t ino, struct fuse_file_info *fi);
|
||||
void (*read) (fuse_req_t req, fuse_ino_t ino, size_t size, off_t off, struct fuse_file_info *fi);
|
||||
void (*write) (fuse_req_t req, fuse_ino_t ino, const char *buf, size_t size, off_t off, struct fuse_file_info *fi);
|
||||
void (*flush) (fuse_req_t req, fuse_ino_t ino, struct fuse_file_info *fi);
|
||||
void (*release) (fuse_req_t req, fuse_ino_t ino, struct fuse_file_info *fi);
|
||||
void (*fsync) (fuse_req_t req, fuse_ino_t ino, int datasync, struct fuse_file_info *fi);
|
||||
void (*opendir) (fuse_req_t req, fuse_ino_t ino, struct fuse_file_info *fi);
|
||||
void (*readdir) (fuse_req_t req, fuse_ino_t ino, size_t size, off_t off, struct fuse_file_info *fi);
|
||||
void (*releasedir) (fuse_req_t req, fuse_ino_t ino, struct fuse_file_info *fi);
|
||||
void (*fsyncdir) (fuse_req_t req, fuse_ino_t ino, int datasync, struct fuse_file_info *fi);
|
||||
void (*statfs) (fuse_req_t req, fuse_ino_t ino);
|
||||
void (*setxattr) (fuse_req_t req, fuse_ino_t ino, const char *name, const char *value, size_t size, int flags);
|
||||
void (*getxattr) (fuse_req_t req, fuse_ino_t ino, const char *name, size_t size);
|
||||
void (*listxattr) (fuse_req_t req, fuse_ino_t ino, size_t size);
|
||||
void (*removexattr) (fuse_req_t req, fuse_ino_t ino, const char *name);
|
||||
void (*access) (fuse_req_t req, fuse_ino_t ino, int mask);
|
||||
void (*create) (fuse_req_t req, fuse_ino_t parent, const char *name, mode_t mode, struct fuse_file_info *fi);
|
||||
void (*getlk) (fuse_req_t req, fuse_ino_t ino, struct fuse_file_info *fi, struct flock *lock);
|
||||
void (*setlk) (fuse_req_t req, fuse_ino_t ino, struct fuse_file_info *fi, struct flock *lock, int sleep);
|
||||
void (*bmap) (fuse_req_t req, fuse_ino_t ino, size_t blocksize, uint64_t idx);
|
||||
void (*ioctl) (fuse_req_t req, fuse_ino_t ino, int cmd, void *arg, struct fuse_file_info *fi, unsigned flags, const void *in_buf, size_t in_bufsz, size_t out_bufsz);
|
||||
void (*poll) (fuse_req_t req, fuse_ino_t ino, struct fuse_file_info *fi, struct fuse_pollhandle *ph);
|
||||
void (*write_buf) (fuse_req_t req, fuse_ino_t ino, struct fuse_bufvec *bufv, off_t off, struct fuse_file_info *fi);
|
||||
void (*retrieve_reply) (fuse_req_t req, void *cookie, fuse_ino_t ino, off_t offset, struct fuse_bufvec *bufv);
|
||||
void (*forget_multi) (fuse_req_t req, size_t count, struct fuse_forget_data *forgets);
|
||||
void (*flock) (fuse_req_t req, fuse_ino_t ino, struct fuse_file_info *fi, int op);
|
||||
void (*fallocate) (fuse_req_t req, fuse_ino_t ino, int mode, off_t offset, off_t length, struct fuse_file_info *fi);
|
||||
};
|
||||
|
||||
#else /* !ENABLE_DLOPEN */
|
||||
|
||||
#define LOAD_LIBRARY
|
||||
#define LOAD_SYMBOL(x)
|
||||
#define DL(x)
|
||||
#define CLOSE_LIBRARY
|
||||
|
||||
#endif /* !ENABLE_DLOPEN */
|
||||
|
||||
#endif /* SQFS_DLOPEN_H */
|
||||
|
640
contrib/depends/patches/libsquashfuse/squashfuse_dlopen.patch
Normal file
640
contrib/depends/patches/libsquashfuse/squashfuse_dlopen.patch
Normal file
|
@ -0,0 +1,640 @@
|
|||
--- a/Makefile.am
|
||||
+++ b/Makefile.am
|
||||
@@ -1,6 +1,7 @@
|
||||
COMPRESSION_LIBS = $(ZLIB_LIBS) $(XZ_LIBS) $(LZO_LIBS) $(LZ4_LIBS)
|
||||
|
||||
ACLOCAL_AMFLAGS = -I m4 --install
|
||||
+AM_CFLAGS = -fno-strict-aliasing -DENABLE_DLOPEN
|
||||
|
||||
# Suppress AppleDouble
|
||||
if MAKE_EXPORT
|
||||
@@ -19,13 +20,13 @@
|
||||
# Main library: libsquashfuse
|
||||
libsquashfuse_la_SOURCES = swap.c cache.c table.c dir.c file.c fs.c \
|
||||
decompress.c xattr.c hash.c stack.c traverse.c util.c \
|
||||
- nonstd-pread.c nonstd-stat.c \
|
||||
+ nonstd-pread.c nonstd-stat.c squashfuse_dlopen.c \
|
||||
squashfs_fs.h common.h nonstd-internal.h nonstd.h swap.h cache.h table.h \
|
||||
dir.h file.h decompress.h xattr.h squashfuse.h hash.h stack.h traverse.h \
|
||||
- util.h fs.h
|
||||
+ util.h fs.h squashfuse_dlopen.h
|
||||
libsquashfuse_la_CPPFLAGS = $(ZLIB_CPPFLAGS) $(XZ_CPPFLAGS) $(LZO_CPPFLAGS) \
|
||||
$(LZ4_CPPFLAGS)
|
||||
-libsquashfuse_la_LIBADD =
|
||||
+libsquashfuse_la_LIBADD = -ldl
|
||||
|
||||
# Helper for FUSE clients: libfuseprivate
|
||||
libfuseprivate_la_SOURCES = fuseprivate.c nonstd-makedev.c nonstd-enoattr.c \
|
||||
--- a/fuseprivate.c
|
||||
+++ b/fuseprivate.c
|
||||
@@ -94,15 +94,17 @@
|
||||
}
|
||||
|
||||
void sqfs_usage(char *progname, bool fuse_usage) {
|
||||
+ LOAD_SYMBOL(int,fuse_opt_add_arg,(struct fuse_args *args, const char *arg));
|
||||
+ LOAD_SYMBOL(int,fuse_parse_cmdline,(struct fuse_args *args, char **mountpoint, int *multithreaded, int *foreground));
|
||||
fprintf(stderr, "%s (c) 2012 Dave Vasilevsky\n\n", PACKAGE_STRING);
|
||||
fprintf(stderr, "Usage: %s [options] ARCHIVE MOUNTPOINT\n",
|
||||
progname ? progname : PACKAGE_NAME);
|
||||
if (fuse_usage) {
|
||||
struct fuse_args args = FUSE_ARGS_INIT(0, NULL);
|
||||
- fuse_opt_add_arg(&args, ""); /* progname */
|
||||
- fuse_opt_add_arg(&args, "-ho");
|
||||
+ DL(fuse_opt_add_arg)(&args, ""); /* progname */
|
||||
+ DL(fuse_opt_add_arg)(&args, "-ho");
|
||||
fprintf(stderr, "\n");
|
||||
- fuse_parse_cmdline(&args, NULL, NULL, NULL);
|
||||
+ DL(fuse_parse_cmdline)(&args, NULL, NULL, NULL);
|
||||
}
|
||||
exit(-2);
|
||||
}
|
||||
--- a/fuseprivate.h
|
||||
+++ b/fuseprivate.h
|
||||
@@ -27,7 +27,10 @@
|
||||
|
||||
#include "squashfuse.h"
|
||||
|
||||
-#include <fuse.h>
|
||||
+#include "squashfuse_dlopen.h"
|
||||
+#ifndef ENABLE_DLOPEN
|
||||
+# include <fuse.h>
|
||||
+#endif
|
||||
|
||||
#include <sys/stat.h>
|
||||
|
||||
--- a/hl.c
|
||||
+++ b/hl.c
|
||||
@@ -33,6 +33,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
+int have_libloaded = 0;
|
||||
|
||||
typedef struct sqfs_hl sqfs_hl;
|
||||
struct sqfs_hl {
|
||||
@@ -42,9 +43,10 @@
|
||||
|
||||
static sqfs_err sqfs_hl_lookup(sqfs **fs, sqfs_inode *inode,
|
||||
const char *path) {
|
||||
+ LOAD_SYMBOL(struct fuse_context *,fuse_get_context,(void));
|
||||
bool found;
|
||||
|
||||
- sqfs_hl *hl = fuse_get_context()->private_data;
|
||||
+ sqfs_hl *hl = DL(fuse_get_context)()->private_data;
|
||||
*fs = &hl->fs;
|
||||
if (inode)
|
||||
*inode = hl->root; /* copy */
|
||||
@@ -67,7 +69,8 @@
|
||||
}
|
||||
|
||||
static void *sqfs_hl_op_init(struct fuse_conn_info *conn) {
|
||||
- return fuse_get_context()->private_data;
|
||||
+ LOAD_SYMBOL(struct fuse_context *,fuse_get_context,(void));
|
||||
+ return DL(fuse_get_context)()->private_data;
|
||||
}
|
||||
|
||||
static int sqfs_hl_op_getattr(const char *path, struct stat *st) {
|
||||
@@ -264,7 +267,16 @@
|
||||
return NULL;
|
||||
}
|
||||
|
||||
+#ifdef ENABLE_DLOPEN
|
||||
+#define fuse_main(argc, argv, op, user_data) \
|
||||
+ DL(fuse_main_real)(argc, argv, op, sizeof(*(op)), user_data)
|
||||
+#endif
|
||||
+
|
||||
int main(int argc, char *argv[]) {
|
||||
+ LOAD_SYMBOL(int,fuse_opt_parse,(struct fuse_args *args, void *data, const struct fuse_opt opts[], fuse_opt_proc_t proc));
|
||||
+ LOAD_SYMBOL(int,fuse_opt_add_arg,(struct fuse_args *args, const char *arg));
|
||||
+ LOAD_SYMBOL(int,fuse_main_real,(int argc, char *argv[], const struct fuse_operations *op, size_t op_size, void *user_data)); /* fuse_main */
|
||||
+ LOAD_SYMBOL(void,fuse_opt_free_args,(struct fuse_args *args));
|
||||
struct fuse_args args;
|
||||
sqfs_opts opts;
|
||||
sqfs_hl *hl;
|
||||
@@ -299,7 +311,7 @@
|
||||
opts.image = NULL;
|
||||
opts.mountpoint = 0;
|
||||
opts.offset = 0;
|
||||
- if (fuse_opt_parse(&args, &opts, fuse_opts, sqfs_opt_proc) == -1)
|
||||
+ if (DL(fuse_opt_parse)(&args, &opts, fuse_opts, sqfs_opt_proc) == -1)
|
||||
sqfs_usage(argv[0], true);
|
||||
if (!opts.image)
|
||||
sqfs_usage(argv[0], true);
|
||||
@@ -308,8 +320,9 @@
|
||||
if (!hl)
|
||||
return -1;
|
||||
|
||||
- fuse_opt_add_arg(&args, "-s"); /* single threaded */
|
||||
+ DL(fuse_opt_add_arg)(&args, "-s"); /* single threaded */
|
||||
ret = fuse_main(args.argc, args.argv, &sqfs_hl_ops, hl);
|
||||
- fuse_opt_free_args(&args);
|
||||
+ DL(fuse_opt_free_args)(&args);
|
||||
+ CLOSE_LIBRARY;
|
||||
return ret;
|
||||
}
|
||||
--- a/ll.h
|
||||
+++ b/ll.h
|
||||
@@ -27,7 +27,10 @@
|
||||
|
||||
#include "squashfuse.h"
|
||||
|
||||
-#include <fuse_lowlevel.h>
|
||||
+#include "squashfuse_dlopen.h"
|
||||
+#ifndef ENABLE_DLOPEN
|
||||
+# include <fuse_lowlevel.h>
|
||||
+#endif
|
||||
|
||||
typedef struct sqfs_ll sqfs_ll;
|
||||
struct sqfs_ll {
|
||||
--- a/ll_inode.c
|
||||
+++ b/ll_inode.c
|
||||
@@ -348,12 +348,14 @@
|
||||
|
||||
|
||||
sqfs_err sqfs_ll_iget(fuse_req_t req, sqfs_ll_i *lli, fuse_ino_t i) {
|
||||
+ LOAD_SYMBOL(void *,fuse_req_userdata,(fuse_req_t req));
|
||||
+ LOAD_SYMBOL(int,fuse_reply_err,(fuse_req_t req, int err));
|
||||
sqfs_err err = SQFS_OK;
|
||||
- lli->ll = fuse_req_userdata(req);
|
||||
+ lli->ll = DL(fuse_req_userdata)(req);
|
||||
if (i != SQFS_FUSE_INODE_NONE) {
|
||||
err = sqfs_ll_inode(lli->ll, &lli->inode, i);
|
||||
if (err)
|
||||
- fuse_reply_err(req, ENOENT);
|
||||
+ DL(fuse_reply_err)(req, ENOENT);
|
||||
}
|
||||
return err;
|
||||
}
|
||||
--- a/nonstd-daemon.c
|
||||
+++ b/nonstd-daemon.c
|
||||
@@ -28,11 +28,16 @@
|
||||
#include "nonstd-internal.h"
|
||||
|
||||
#include <unistd.h>
|
||||
-#include <fuse_lowlevel.h>
|
||||
+
|
||||
+#include "squashfuse_dlopen.h"
|
||||
+#ifndef ENABLE_DLOPEN
|
||||
+# include <fuse_lowlevel.h>
|
||||
+#endif
|
||||
|
||||
int sqfs_ll_daemonize(int fg) {
|
||||
#if HAVE_DECL_FUSE_DAEMONIZE
|
||||
- return fuse_daemonize(fg);
|
||||
+ LOAD_SYMBOL(int,fuse_daemonize,(int foreground));
|
||||
+ return DL(fuse_daemonize)(fg);
|
||||
#else
|
||||
return daemon(0,0);
|
||||
#endif
|
||||
--- a/ll.c
|
||||
+++ b/ll.c
|
||||
@@ -38,37 +38,41 @@
|
||||
|
||||
static void sqfs_ll_op_getattr(fuse_req_t req, fuse_ino_t ino,
|
||||
struct fuse_file_info *fi) {
|
||||
+ LOAD_SYMBOL(int,fuse_reply_err,(fuse_req_t req, int err));
|
||||
+ LOAD_SYMBOL(int,fuse_reply_attr,(fuse_req_t req, const struct stat *attr, double attr_timeout));
|
||||
sqfs_ll_i lli;
|
||||
struct stat st;
|
||||
if (sqfs_ll_iget(req, &lli, ino))
|
||||
return;
|
||||
|
||||
if (sqfs_stat(&lli.ll->fs, &lli.inode, &st)) {
|
||||
- fuse_reply_err(req, ENOENT);
|
||||
+ DL(fuse_reply_err)(req, ENOENT);
|
||||
} else {
|
||||
st.st_ino = ino;
|
||||
- fuse_reply_attr(req, &st, SQFS_TIMEOUT);
|
||||
+ DL(fuse_reply_attr)(req, &st, SQFS_TIMEOUT);
|
||||
}
|
||||
}
|
||||
|
||||
static void sqfs_ll_op_opendir(fuse_req_t req, fuse_ino_t ino,
|
||||
struct fuse_file_info *fi) {
|
||||
+ LOAD_SYMBOL(int,fuse_reply_err,(fuse_req_t req, int err));
|
||||
+ LOAD_SYMBOL(int,fuse_reply_open,(fuse_req_t req, const struct fuse_file_info *fi));
|
||||
sqfs_ll_i *lli;
|
||||
|
||||
fi->fh = (intptr_t)NULL;
|
||||
|
||||
lli = malloc(sizeof(*lli));
|
||||
if (!lli) {
|
||||
- fuse_reply_err(req, ENOMEM);
|
||||
+ DL(fuse_reply_err)(req, ENOMEM);
|
||||
return;
|
||||
}
|
||||
|
||||
if (sqfs_ll_iget(req, lli, ino) == SQFS_OK) {
|
||||
if (!S_ISDIR(lli->inode.base.mode)) {
|
||||
- fuse_reply_err(req, ENOTDIR);
|
||||
+ DL(fuse_reply_err)(req, ENOTDIR);
|
||||
} else {
|
||||
fi->fh = (intptr_t)lli;
|
||||
- fuse_reply_open(req, fi);
|
||||
+ DL(fuse_reply_open)(req, fi);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -77,28 +81,35 @@
|
||||
|
||||
static void sqfs_ll_op_create(fuse_req_t req, fuse_ino_t parent, const char *name,
|
||||
mode_t mode, struct fuse_file_info *fi) {
|
||||
- fuse_reply_err(req, EROFS);
|
||||
+ LOAD_SYMBOL(int,fuse_reply_err,(fuse_req_t req, int err));
|
||||
+ DL(fuse_reply_err)(req, EROFS);
|
||||
}
|
||||
|
||||
static void sqfs_ll_op_releasedir(fuse_req_t req, fuse_ino_t ino,
|
||||
struct fuse_file_info *fi) {
|
||||
free((sqfs_ll_i*)(intptr_t)fi->fh);
|
||||
- fuse_reply_err(req, 0); /* yes, this is necessary */
|
||||
+ LOAD_SYMBOL(int,fuse_reply_err,(fuse_req_t req, int err));
|
||||
+ DL(fuse_reply_err)(req, 0); /* yes, this is necessary */
|
||||
}
|
||||
|
||||
static size_t sqfs_ll_add_direntry(fuse_req_t req, char *buf, size_t bufsize,
|
||||
const char *name, const struct stat *st, off_t off) {
|
||||
#if HAVE_DECL_FUSE_ADD_DIRENTRY
|
||||
- return fuse_add_direntry(req, buf, bufsize, name, st, off);
|
||||
+ LOAD_SYMBOL(size_t,fuse_add_direntry,(fuse_req_t req, char *buf, size_t bufsize, const char *name, const struct stat *stbuf, off_t off));
|
||||
+ return DL(fuse_add_direntry)(req, buf, bufsize, name, st, off);
|
||||
#else
|
||||
- size_t esize = fuse_dirent_size(strlen(name));
|
||||
+ LOAD_SYMBOL(size_t,fuse_dirent_size(size_t namelen));
|
||||
+ LOAD_SYMBOL(char *,fuse_add_dirent,(char *buf, const char *name, const struct stat *stbuf, off_t off));
|
||||
+ size_t esize = DL(fuse_dirent_size)(strlen(name));
|
||||
if (bufsize >= esize)
|
||||
- fuse_add_dirent(buf, name, st, off);
|
||||
+ DL(fuse_add_dirent)(buf, name, st, off);
|
||||
return esize;
|
||||
#endif
|
||||
}
|
||||
static void sqfs_ll_op_readdir(fuse_req_t req, fuse_ino_t ino, size_t size,
|
||||
off_t off, struct fuse_file_info *fi) {
|
||||
+ LOAD_SYMBOL(int,fuse_reply_err,(fuse_req_t req, int err));
|
||||
+ LOAD_SYMBOL(int,fuse_reply_buf,(fuse_req_t req, const char *buf, size_t size));
|
||||
sqfs_err sqerr;
|
||||
sqfs_dir dir;
|
||||
sqfs_name namebuf;
|
||||
@@ -135,14 +146,16 @@
|
||||
}
|
||||
|
||||
if (err)
|
||||
- fuse_reply_err(req, err);
|
||||
+ DL(fuse_reply_err)(req, err);
|
||||
else
|
||||
- fuse_reply_buf(req, buf, bufpos - buf);
|
||||
+ DL(fuse_reply_buf)(req, buf, bufpos - buf);
|
||||
free(buf);
|
||||
}
|
||||
|
||||
static void sqfs_ll_op_lookup(fuse_req_t req, fuse_ino_t parent,
|
||||
const char *name) {
|
||||
+ LOAD_SYMBOL(int,fuse_reply_err,(fuse_req_t req, int err));
|
||||
+ LOAD_SYMBOL(int,fuse_reply_entry,(fuse_req_t req, const struct fuse_entry_param *e));
|
||||
sqfs_ll_i lli;
|
||||
sqfs_err sqerr;
|
||||
sqfs_name namebuf;
|
||||
@@ -154,7 +167,7 @@
|
||||
return;
|
||||
|
||||
if (!S_ISDIR(lli.inode.base.mode)) {
|
||||
- fuse_reply_err(req, ENOTDIR);
|
||||
+ DL(fuse_reply_err)(req, ENOTDIR);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -162,55 +175,58 @@
|
||||
sqerr = sqfs_dir_lookup(&lli.ll->fs, &lli.inode, name, strlen(name), &entry,
|
||||
&found);
|
||||
if (sqerr) {
|
||||
- fuse_reply_err(req, EIO);
|
||||
+ DL(fuse_reply_err)(req, EIO);
|
||||
return;
|
||||
}
|
||||
if (!found) {
|
||||
- fuse_reply_err(req, ENOENT);
|
||||
+ DL(fuse_reply_err)(req, ENOENT);
|
||||
return;
|
||||
}
|
||||
|
||||
if (sqfs_inode_get(&lli.ll->fs, &inode, sqfs_dentry_inode(&entry))) {
|
||||
- fuse_reply_err(req, ENOENT);
|
||||
+ DL(fuse_reply_err)(req, ENOENT);
|
||||
} else {
|
||||
struct fuse_entry_param fentry;
|
||||
memset(&fentry, 0, sizeof(fentry));
|
||||
if (sqfs_stat(&lli.ll->fs, &inode, &fentry.attr)) {
|
||||
- fuse_reply_err(req, EIO);
|
||||
+ DL(fuse_reply_err)(req, EIO);
|
||||
} else {
|
||||
fentry.attr_timeout = fentry.entry_timeout = SQFS_TIMEOUT;
|
||||
fentry.ino = lli.ll->ino_register(lli.ll, &entry);
|
||||
fentry.attr.st_ino = fentry.ino;
|
||||
- fuse_reply_entry(req, &fentry);
|
||||
+ DL(fuse_reply_entry)(req, &fentry);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void sqfs_ll_op_open(fuse_req_t req, fuse_ino_t ino,
|
||||
struct fuse_file_info *fi) {
|
||||
+ LOAD_SYMBOL(int,fuse_reply_err,(fuse_req_t req, int err));
|
||||
+ LOAD_SYMBOL(int,fuse_reply_open,(fuse_req_t req, const struct fuse_file_info *fi));
|
||||
+ LOAD_SYMBOL(void *,fuse_req_userdata,(fuse_req_t req));
|
||||
sqfs_inode *inode;
|
||||
sqfs_ll *ll;
|
||||
|
||||
if (fi->flags & (O_WRONLY | O_RDWR)) {
|
||||
- fuse_reply_err(req, EROFS);
|
||||
+ DL(fuse_reply_err)(req, EROFS);
|
||||
return;
|
||||
}
|
||||
|
||||
inode = malloc(sizeof(sqfs_inode));
|
||||
if (!inode) {
|
||||
- fuse_reply_err(req, ENOMEM);
|
||||
+ DL(fuse_reply_err)(req, ENOMEM);
|
||||
return;
|
||||
}
|
||||
|
||||
- ll = fuse_req_userdata(req);
|
||||
+ ll = DL(fuse_req_userdata)(req);
|
||||
if (sqfs_ll_inode(ll, inode, ino)) {
|
||||
- fuse_reply_err(req, ENOENT);
|
||||
+ DL(fuse_reply_err)(req, ENOENT);
|
||||
} else if (!S_ISREG(inode->base.mode)) {
|
||||
- fuse_reply_err(req, EISDIR);
|
||||
+ DL(fuse_reply_err)(req, EISDIR);
|
||||
} else {
|
||||
fi->fh = (intptr_t)inode;
|
||||
fi->keep_cache = 1;
|
||||
- fuse_reply_open(req, fi);
|
||||
+ DL(fuse_reply_open)(req, fi);
|
||||
return;
|
||||
}
|
||||
free(inode);
|
||||
@@ -218,37 +234,43 @@
|
||||
|
||||
static void sqfs_ll_op_release(fuse_req_t req, fuse_ino_t ino,
|
||||
struct fuse_file_info *fi) {
|
||||
+ LOAD_SYMBOL(int,fuse_reply_err,(fuse_req_t req, int err));
|
||||
free((sqfs_inode*)(intptr_t)fi->fh);
|
||||
fi->fh = 0;
|
||||
- fuse_reply_err(req, 0);
|
||||
+ DL(fuse_reply_err)(req, 0);
|
||||
}
|
||||
|
||||
static void sqfs_ll_op_read(fuse_req_t req, fuse_ino_t ino,
|
||||
size_t size, off_t off, struct fuse_file_info *fi) {
|
||||
- sqfs_ll *ll = fuse_req_userdata(req);
|
||||
+ LOAD_SYMBOL(void *,fuse_req_userdata,(fuse_req_t req));
|
||||
+ LOAD_SYMBOL(int,fuse_reply_err,(fuse_req_t req, int err));
|
||||
+ LOAD_SYMBOL(int,fuse_reply_buf,(fuse_req_t req, const char *buf, size_t size));
|
||||
+ sqfs_ll *ll = DL(fuse_req_userdata)(req);
|
||||
sqfs_inode *inode = (sqfs_inode*)(intptr_t)fi->fh;
|
||||
sqfs_err err = SQFS_OK;
|
||||
|
||||
off_t osize;
|
||||
char *buf = malloc(size);
|
||||
if (!buf) {
|
||||
- fuse_reply_err(req, ENOMEM);
|
||||
+ DL(fuse_reply_err)(req, ENOMEM);
|
||||
return;
|
||||
}
|
||||
|
||||
osize = size;
|
||||
err = sqfs_read_range(&ll->fs, inode, off, &osize, buf);
|
||||
if (err) {
|
||||
- fuse_reply_err(req, EIO);
|
||||
+ DL(fuse_reply_err)(req, EIO);
|
||||
} else if (osize == 0) { /* EOF */
|
||||
- fuse_reply_buf(req, NULL, 0);
|
||||
+ DL(fuse_reply_buf)(req, NULL, 0);
|
||||
} else {
|
||||
- fuse_reply_buf(req, buf, osize);
|
||||
+ DL(fuse_reply_buf)(req, buf, osize);
|
||||
}
|
||||
free(buf);
|
||||
}
|
||||
|
||||
static void sqfs_ll_op_readlink(fuse_req_t req, fuse_ino_t ino) {
|
||||
+ LOAD_SYMBOL(int,fuse_reply_err,(fuse_req_t req, int err));
|
||||
+ LOAD_SYMBOL(int,fuse_reply_readlink,(fuse_req_t req, const char *link));
|
||||
char *dst;
|
||||
size_t size;
|
||||
sqfs_ll_i lli;
|
||||
@@ -256,21 +278,24 @@
|
||||
return;
|
||||
|
||||
if (!S_ISLNK(lli.inode.base.mode)) {
|
||||
- fuse_reply_err(req, EINVAL);
|
||||
+ DL(fuse_reply_err)(req, EINVAL);
|
||||
} else if (sqfs_readlink(&lli.ll->fs, &lli.inode, NULL, &size)) {
|
||||
- fuse_reply_err(req, EIO);
|
||||
+ DL(fuse_reply_err)(req, EIO);
|
||||
} else if (!(dst = malloc(size + 1))) {
|
||||
- fuse_reply_err(req, ENOMEM);
|
||||
+ DL(fuse_reply_err)(req, ENOMEM);
|
||||
} else if (sqfs_readlink(&lli.ll->fs, &lli.inode, dst, &size)) {
|
||||
- fuse_reply_err(req, EIO);
|
||||
+ DL(fuse_reply_err)(req, EIO);
|
||||
free(dst);
|
||||
} else {
|
||||
- fuse_reply_readlink(req, dst);
|
||||
+ DL(fuse_reply_readlink)(req, dst);
|
||||
free(dst);
|
||||
}
|
||||
}
|
||||
|
||||
static void sqfs_ll_op_listxattr(fuse_req_t req, fuse_ino_t ino, size_t size) {
|
||||
+ LOAD_SYMBOL(int,fuse_reply_err,(fuse_req_t req, int err));
|
||||
+ LOAD_SYMBOL(int,fuse_reply_xattr,(fuse_req_t req, size_t count));
|
||||
+ LOAD_SYMBOL(int,fuse_reply_buf,(fuse_req_t req, const char *buf, size_t size));
|
||||
sqfs_ll_i lli;
|
||||
char *buf;
|
||||
int ferr;
|
||||
@@ -280,17 +305,17 @@
|
||||
|
||||
buf = NULL;
|
||||
if (size && !(buf = malloc(size))) {
|
||||
- fuse_reply_err(req, ENOMEM);
|
||||
+ DL(fuse_reply_err)(req, ENOMEM);
|
||||
return;
|
||||
}
|
||||
|
||||
ferr = sqfs_listxattr(&lli.ll->fs, &lli.inode, buf, &size);
|
||||
if (ferr) {
|
||||
- fuse_reply_err(req, ferr);
|
||||
+ DL(fuse_reply_err)(req, ferr);
|
||||
} else if (buf) {
|
||||
- fuse_reply_buf(req, buf, size);
|
||||
+ DL(fuse_reply_buf)(req, buf, size);
|
||||
} else {
|
||||
- fuse_reply_xattr(req, size);
|
||||
+ DL(fuse_reply_xattr)(req, size);
|
||||
}
|
||||
free(buf);
|
||||
}
|
||||
@@ -301,13 +326,16 @@
|
||||
, uint32_t position
|
||||
#endif
|
||||
) {
|
||||
+ LOAD_SYMBOL(int,fuse_reply_err,(fuse_req_t req, int err));
|
||||
+ LOAD_SYMBOL(int,fuse_reply_xattr,(fuse_req_t req, size_t count));
|
||||
+ LOAD_SYMBOL(int,fuse_reply_buf,(fuse_req_t req, const char *buf, size_t size));
|
||||
sqfs_ll_i lli;
|
||||
char *buf = NULL;
|
||||
size_t real = size;
|
||||
|
||||
#ifdef FUSE_XATTR_POSITION
|
||||
if (position != 0) { /* We don't support resource forks */
|
||||
- fuse_reply_err(req, EINVAL);
|
||||
+ DL(fuse_reply_err)(req, EINVAL);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
@@ -316,26 +344,27 @@
|
||||
return;
|
||||
|
||||
if (!(buf = malloc(size)))
|
||||
- fuse_reply_err(req, ENOMEM);
|
||||
+ DL(fuse_reply_err)(req, ENOMEM);
|
||||
else if (sqfs_xattr_lookup(&lli.ll->fs, &lli.inode, name, buf, &real))
|
||||
- fuse_reply_err(req, EIO);
|
||||
+ DL(fuse_reply_err)(req, EIO);
|
||||
else if (real == 0)
|
||||
- fuse_reply_err(req, sqfs_enoattr());
|
||||
+ DL(fuse_reply_err)(req, sqfs_enoattr());
|
||||
else if (size == 0)
|
||||
- fuse_reply_xattr(req, real);
|
||||
+ DL(fuse_reply_xattr)(req, real);
|
||||
else if (size < real)
|
||||
- fuse_reply_err(req, ERANGE);
|
||||
+ DL(fuse_reply_err)(req, ERANGE);
|
||||
else
|
||||
- fuse_reply_buf(req, buf, real);
|
||||
+ DL(fuse_reply_buf)(req, buf, real);
|
||||
free(buf);
|
||||
}
|
||||
|
||||
static void sqfs_ll_op_forget(fuse_req_t req, fuse_ino_t ino,
|
||||
unsigned long nlookup) {
|
||||
+ LOAD_SYMBOL(void,fuse_reply_none,(fuse_req_t req));
|
||||
sqfs_ll_i lli;
|
||||
sqfs_ll_iget(req, &lli, SQFS_FUSE_INODE_NONE);
|
||||
lli.ll->ino_forget(lli.ll, ino, nlookup);
|
||||
- fuse_reply_none(req);
|
||||
+ DL(fuse_reply_none)(req);
|
||||
}
|
||||
|
||||
|
||||
@@ -348,23 +377,27 @@
|
||||
|
||||
static sqfs_err sqfs_ll_mount(sqfs_ll_chan *ch, const char *mountpoint,
|
||||
struct fuse_args *args) {
|
||||
+ LOAD_SYMBOL(struct fuse_chan *,fuse_mount,(const char *mountpoint, struct fuse_args *args));
|
||||
#ifdef HAVE_NEW_FUSE_UNMOUNT
|
||||
- ch->ch = fuse_mount(mountpoint, args);
|
||||
+ ch->ch = DL(fuse_mount)(mountpoint, args);
|
||||
#else
|
||||
- ch->fd = fuse_mount(mountpoint, args);
|
||||
+ LOAD_SYMBOL(struct fuse_chan *,fuse_kern_chan_new,(int fd));
|
||||
+ ch->fd = DL(fuse_mount)(mountpoint, args);
|
||||
if (ch->fd == -1)
|
||||
return SQFS_ERR;
|
||||
- ch->ch = fuse_kern_chan_new(ch->fd);
|
||||
+ ch->ch = DL(fuse_kern_chan_new)(ch->fd);
|
||||
#endif
|
||||
return ch->ch ? SQFS_OK : SQFS_ERR;
|
||||
}
|
||||
|
||||
static void sqfs_ll_unmount(sqfs_ll_chan *ch, const char *mountpoint) {
|
||||
#ifdef HAVE_NEW_FUSE_UNMOUNT
|
||||
- fuse_unmount(mountpoint, ch->ch);
|
||||
+ LOAD_SYMBOL(void,fuse_unmount,(const char *mountpoint, struct fuse_chan *ch));
|
||||
+ DL(fuse_unmount)(mountpoint, ch->ch);
|
||||
#else
|
||||
+ LOAD_SYMBOL(void,fuse_unmount,(const char *mountpoint));
|
||||
close(ch->fd);
|
||||
- fuse_unmount(mountpoint);
|
||||
+ DL(fuse_unmount)(mountpoint);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -391,6 +424,19 @@
|
||||
}
|
||||
|
||||
int fusefs_main(int argc, char *argv[], void (*mounted) (void)) {
|
||||
+ LOAD_SYMBOL(int,fuse_opt_parse,(struct fuse_args *args, void *data, const struct fuse_opt opts[], fuse_opt_proc_t proc));
|
||||
+ LOAD_SYMBOL(int,fuse_parse_cmdline,(struct fuse_args *args, char **mountpoint, int *multithreaded, int *foreground));
|
||||
+ LOAD_SYMBOL(struct fuse_session *,fuse_lowlevel_new,(struct fuse_args *args, const struct fuse_lowlevel_ops *op, size_t op_size, void *userdata));
|
||||
+ LOAD_SYMBOL(int,fuse_set_signal_handlers,(struct fuse_session *se));
|
||||
+ LOAD_SYMBOL(void,fuse_session_add_chan,(struct fuse_session *se, struct fuse_chan *ch));
|
||||
+ LOAD_SYMBOL(int,fuse_session_loop,(struct fuse_session *se));
|
||||
+ LOAD_SYMBOL(void,fuse_remove_signal_handlers,(struct fuse_session *se));
|
||||
+#if HAVE_DECL_FUSE_SESSION_REMOVE_CHAN
|
||||
+ LOAD_SYMBOL(void,fuse_session_remove_chan,(struct fuse_chan *ch));
|
||||
+#endif
|
||||
+ LOAD_SYMBOL(void,fuse_session_destroy,(struct fuse_session *se));
|
||||
+ LOAD_SYMBOL(void,fuse_opt_free_args,(struct fuse_args *args));
|
||||
+
|
||||
struct fuse_args args;
|
||||
sqfs_opts opts;
|
||||
|
||||
@@ -429,10 +475,10 @@
|
||||
opts.image = NULL;
|
||||
opts.mountpoint = 0;
|
||||
opts.offset = 0;
|
||||
- if (fuse_opt_parse(&args, &opts, fuse_opts, sqfs_opt_proc) == -1)
|
||||
+ if (DL(fuse_opt_parse)(&args, &opts, fuse_opts, sqfs_opt_proc) == -1)
|
||||
sqfs_usage(argv[0], true);
|
||||
|
||||
- if (fuse_parse_cmdline(&args, &mountpoint, &mt, &fg) == -1)
|
||||
+ if (DL(fuse_parse_cmdline)(&args, &mountpoint, &mt, &fg) == -1)
|
||||
sqfs_usage(argv[0], true);
|
||||
if (mountpoint == NULL)
|
||||
sqfs_usage(argv[0], true);
|
||||
@@ -445,33 +491,34 @@
|
||||
sqfs_ll_chan ch;
|
||||
err = -1;
|
||||
if (sqfs_ll_mount(&ch, mountpoint, &args) == SQFS_OK) {
|
||||
- struct fuse_session *se = fuse_lowlevel_new(&args,
|
||||
+ struct fuse_session *se = DL(fuse_lowlevel_new)(&args,
|
||||
&sqfs_ll_ops, sizeof(sqfs_ll_ops), ll);
|
||||
if (se != NULL) {
|
||||
if (sqfs_ll_daemonize(fg) != -1) {
|
||||
- if (fuse_set_signal_handlers(se) != -1) {
|
||||
- fuse_session_add_chan(se, ch.ch);
|
||||
+ if (DL(fuse_set_signal_handlers)(se) != -1) {
|
||||
+ DL(fuse_session_add_chan)(se, ch.ch);
|
||||
if (mounted)
|
||||
mounted ();
|
||||
/* FIXME: multithreading */
|
||||
- err = fuse_session_loop(se);
|
||||
- fuse_remove_signal_handlers(se);
|
||||
+ err = DL(fuse_session_loop)(se);
|
||||
+ DL(fuse_remove_signal_handlers)(se);
|
||||
#if HAVE_DECL_FUSE_SESSION_REMOVE_CHAN
|
||||
- fuse_session_remove_chan(ch.ch);
|
||||
+ DL(fuse_session_remove_chan)(ch.ch);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
- fuse_session_destroy(se);
|
||||
+ DL(fuse_session_destroy)(se);
|
||||
}
|
||||
sqfs_ll_destroy(ll);
|
||||
sqfs_ll_unmount(&ch, mountpoint);
|
||||
}
|
||||
}
|
||||
- fuse_opt_free_args(&args);
|
||||
+ DL(fuse_opt_free_args)(&args);
|
||||
if (mounted)
|
||||
rmdir (mountpoint);
|
||||
free(ll);
|
||||
free(mountpoint);
|
||||
+ CLOSE_LIBRARY;
|
||||
|
||||
return -err;
|
||||
}
|
|
@ -1,19 +0,0 @@
|
|||
# Create the super cache so modules will add themselves to it.
|
||||
cache(, super)
|
||||
|
||||
!QTDIR_build: cache(CONFIG, add, $$list(QTDIR_build))
|
||||
|
||||
#prl = no_install_prl
|
||||
#CONFIG += $$prl
|
||||
cache(CONFIG, add stash, prl)
|
||||
|
||||
TEMPLATE = subdirs
|
||||
SUBDIRS = qtbase
|
||||
#SUBDIRS = qtbase qttools qttranslations qtsvg qtwebsockets
|
||||
|
||||
#qtwebsockets.depends = qtbase
|
||||
#qtsvg.depends = qtbase
|
||||
#qttools.depends = qtbase
|
||||
#qttranslations.depends = qttools
|
||||
|
||||
load(qt_configure)
|
59
contrib/depends/patches/native_qt/QTBUG-92199-fix.patch
Normal file
59
contrib/depends/patches/native_qt/QTBUG-92199-fix.patch
Normal file
|
@ -0,0 +1,59 @@
|
|||
From c765bc51864b90ebc46c11780ccc20ad16eddd6a Mon Sep 17 00:00:00 2001
|
||||
From: tobtoht <tob@featherwallet.org>
|
||||
Date: Tue, 8 Nov 2022 00:59:36 +0100
|
||||
Subject: [PATCH] Fix QTBUG-92199
|
||||
|
||||
---
|
||||
src/widgets/styles/qstylesheetstyle.cpp | 1 -
|
||||
.../qstylesheetstyle/tst_qstylesheetstyle.cpp | 16 ----------------
|
||||
2 files changed, 17 deletions(-)
|
||||
|
||||
diff --git a/qtbase/src/widgets/styles/qstylesheetstyle.cpp b/qtbase/src/widgets/styles/qstylesheetstyle.cpp
|
||||
index 6abef62835..7aca4d5788 100644
|
||||
--- a/qtbase/src/widgets/styles/qstylesheetstyle.cpp
|
||||
+++ b/qtbase/src/widgets/styles/qstylesheetstyle.cpp
|
||||
@@ -1474,7 +1474,6 @@ void QRenderRule::configurePalette(QPalette *p, QPalette::ColorGroup cg, const Q
|
||||
p->setBrush(cg, w->foregroundRole(), pal->foreground);
|
||||
p->setBrush(cg, QPalette::WindowText, pal->foreground);
|
||||
p->setBrush(cg, QPalette::Text, pal->foreground);
|
||||
- p->setBrush(cg, QPalette::PlaceholderText, pal->foreground);
|
||||
}
|
||||
if (pal->selectionBackground.style() != Qt::NoBrush)
|
||||
p->setBrush(cg, QPalette::Highlight, pal->selectionBackground);
|
||||
diff --git a/qtbase/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp b/qtbase/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp
|
||||
index 82d48b1692..9add99325b 100644
|
||||
--- a/qtbase/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp
|
||||
+++ b/qtbase/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp
|
||||
@@ -103,7 +103,6 @@ private slots:
|
||||
void QTBUG15910_crashNullWidget();
|
||||
void QTBUG36933_brokenPseudoClassLookup();
|
||||
void styleSheetChangeBeforePolish();
|
||||
- void placeholderColor();
|
||||
void enumPropertySelector_data();
|
||||
void enumPropertySelector();
|
||||
//at the end because it mess with the style.
|
||||
@@ -2331,21 +2330,6 @@ void tst_QStyleSheetStyle::highdpiImages()
|
||||
QHighDpiScaling::updateHighDpiScaling(); // reset to normal
|
||||
}
|
||||
|
||||
-void tst_QStyleSheetStyle::placeholderColor()
|
||||
-{
|
||||
- const QColor red(Qt::red);
|
||||
- qApp->setStyleSheet("* { color: red; }");
|
||||
- QLineEdit le1;
|
||||
- QLineEdit le2;
|
||||
- le2.setEnabled(false);
|
||||
- le1.ensurePolished();
|
||||
- QCOMPARE(le1.palette().placeholderText(), red);
|
||||
- le2.ensurePolished();
|
||||
- QCOMPARE(le2.palette().placeholderText(), red);
|
||||
- le2.setEnabled(true);
|
||||
- QCOMPARE(le2.palette().placeholderText(), red);
|
||||
-}
|
||||
-
|
||||
void tst_QStyleSheetStyle::enumPropertySelector_data()
|
||||
{
|
||||
QTest::addColumn<QString>("styleSheet");
|
||||
--
|
||||
2.38.1
|
||||
|
25
contrib/depends/patches/native_qt/dont_hardcode_pwd.patch
Normal file
25
contrib/depends/patches/native_qt/dont_hardcode_pwd.patch
Normal file
|
@ -0,0 +1,25 @@
|
|||
commit 0e953866fc4672486e29e1ba6d83b4207e7b2f0b
|
||||
Author: fanquake <fanquake@gmail.com>
|
||||
Date: Tue Aug 18 15:09:06 2020 +0800
|
||||
|
||||
Don't hardcode pwd path
|
||||
|
||||
Let a man use his builtins if he wants to! Also, removes the unnecessary
|
||||
assumption that pwd lives under /bin/pwd.
|
||||
|
||||
See #15581.
|
||||
|
||||
--- a/qtbase/configure
|
||||
+++ b/qtbase/configure
|
||||
@@ -34,9 +34,9 @@
|
||||
|
||||
# the directory of this script is the "source tree"
|
||||
relpath=`dirname $0`
|
||||
-relpath=`(cd "$relpath"; /bin/pwd)`
|
||||
+relpath=`(cd "$relpath"; pwd)`
|
||||
# the current directory is the "build tree" or "object tree"
|
||||
-outpath=`/bin/pwd`
|
||||
+outpath=`pwd`
|
||||
|
||||
# do this early so we don't store it in config.status
|
||||
CFG_TOPLEVEL=
|
|
@ -0,0 +1,20 @@
|
|||
Modify the optimisation flags for FastFixedDtoa.
|
||||
This fixes a non-determinism issue in the asm produced for
|
||||
this function when cross-compiling on x86_64 and aarch64 for
|
||||
the arm-linux-gnueabihf HOST.
|
||||
|
||||
--- a/qtbase/src/3rdparty/double-conversion/double-conversion/fixed-dtoa.h
|
||||
+++ b/qtbase/src/3rdparty/double-conversion/double-conversion/fixed-dtoa.h
|
||||
@@ -48,9 +48,12 @@ namespace double_conversion {
|
||||
//
|
||||
// This method only works for some parameters. If it can't handle the input it
|
||||
// returns false. The output is null-terminated when the function succeeds.
|
||||
+#pragma GCC push_options
|
||||
+#pragma GCC optimize ("-O1")
|
||||
bool FastFixedDtoa(double v, int fractional_count,
|
||||
Vector<char> buffer, int* length, int* decimal_point);
|
||||
|
||||
+#pragma GCC pop_options
|
||||
} // namespace double_conversion
|
||||
|
||||
#endif // DOUBLE_CONVERSION_FIXED_DTOA_H_
|
17
contrib/depends/patches/native_qt/guix_cross_lib_path.patch
Normal file
17
contrib/depends/patches/native_qt/guix_cross_lib_path.patch
Normal file
|
@ -0,0 +1,17 @@
|
|||
Facilitate guix building with CROSS_LIBRARY_PATH
|
||||
|
||||
See discussion in https://github.com/bitcoin/bitcoin/pull/15277.
|
||||
|
||||
--- a/qtbase/mkspecs/features/toolchain.prf
|
||||
+++ b/qtbase/mkspecs/features/toolchain.prf
|
||||
@@ -236,8 +236,8 @@ isEmpty($${target_prefix}.INCDIRS) {
|
||||
add_libraries = false
|
||||
for (line, output) {
|
||||
line ~= s/^[ \\t]*// # remove leading spaces
|
||||
- contains(line, "LIBRARY_PATH=.*") {
|
||||
- line ~= s/^LIBRARY_PATH=// # remove leading LIBRARY_PATH=
|
||||
+ contains(line, "(CROSS_)?LIBRARY_PATH=.*") {
|
||||
+ line ~= s/^(CROSS_)?LIBRARY_PATH=// # remove leading (CROSS_)?LIBRARY_PATH=
|
||||
equals(QMAKE_HOST.os, Windows): \
|
||||
paths = $$split(line, ;)
|
||||
else: \
|
22
contrib/depends/patches/native_qt/mac-qmake.conf
Normal file
22
contrib/depends/patches/native_qt/mac-qmake.conf
Normal file
|
@ -0,0 +1,22 @@
|
|||
MAKEFILE_GENERATOR = UNIX
|
||||
CONFIG += app_bundle incremental lib_version_first absolute_library_soname
|
||||
QMAKE_INCREMENTAL_STYLE = sublib
|
||||
include(../common/macx.conf)
|
||||
include(../common/gcc-base-mac.conf)
|
||||
include(../common/clang.conf)
|
||||
include(../common/clang-mac.conf)
|
||||
QMAKE_MAC_SDK_PATH=$${MAC_SDK_PATH}
|
||||
QMAKE_XCODE_VERSION = $${XCODE_VERSION}
|
||||
QMAKE_XCODE_DEVELOPER_PATH=/Developer
|
||||
QMAKE_MAC_SDK=macosx
|
||||
QMAKE_MAC_SDK.macosx.Path = $${MAC_SDK_PATH}
|
||||
QMAKE_MAC_SDK.macosx.platform_name = macosx
|
||||
QMAKE_MAC_SDK.macosx.SDKVersion = $${MAC_SDK_VERSION}
|
||||
QMAKE_MAC_SDK.macosx.PlatformPath = /phony
|
||||
!host_build: QMAKE_CFLAGS += -target $${MAC_TARGET}
|
||||
!host_build: QMAKE_OBJECTIVE_CFLAGS += $$QMAKE_CFLAGS
|
||||
!host_build: QMAKE_CXXFLAGS += -target $${MAC_TARGET}
|
||||
!host_build: QMAKE_LFLAGS += -target $${MAC_TARGET}
|
||||
QMAKE_AR = $${CROSS_COMPILE}ar cq
|
||||
QMAKE_RANLIB=$${CROSS_COMPILE}ranlib
|
||||
load(qt_config)
|
42
contrib/depends/patches/native_qt/no-renameat2.patch
Normal file
42
contrib/depends/patches/native_qt/no-renameat2.patch
Normal file
|
@ -0,0 +1,42 @@
|
|||
From 92ba295ee64a55c73c8a32b77c352a6181289fe8 Mon Sep 17 00:00:00 2001
|
||||
From: tobtoht <tob@featherwallet.org>
|
||||
Date: Sun, 30 Oct 2022 23:15:34 +0100
|
||||
Subject: [PATCH] no renameat2
|
||||
|
||||
---
|
||||
qtbase/src/corelib/configure.cmake | 2 --
|
||||
qtbase/src/corelib/global/qconfig-bootstrapped.h | 4 ----
|
||||
2 files changed, 6 deletions(-)
|
||||
|
||||
diff --git a/qtbase/src/corelib/configure.cmake b/qtbase/src/corelib/configure.cmake
|
||||
index 183decb530..f8e9ad0e87 100644
|
||||
--- a/qtbase/src/corelib/configure.cmake
|
||||
+++ b/qtbase/src/corelib/configure.cmake
|
||||
@@ -434,8 +434,6 @@ qt_config_compile_test(renameat2
|
||||
LABEL "renameat2()"
|
||||
CODE
|
||||
"#define _ATFILE_SOURCE 1
|
||||
-#include <fcntl.h>
|
||||
-#include <stdio.h>
|
||||
|
||||
int main(int, char **argv)
|
||||
{
|
||||
diff --git a/qtbase/src/corelib/global/qconfig-bootstrapped.h b/qtbase/src/corelib/global/qconfig-bootstrapped.h
|
||||
index 61fd6479b1..06d06235d5 100644
|
||||
--- a/qtbase/src/corelib/global/qconfig-bootstrapped.h
|
||||
+++ b/qtbase/src/corelib/global/qconfig-bootstrapped.h
|
||||
@@ -74,11 +74,7 @@
|
||||
#define QT_NO_QOBJECT
|
||||
#define QT_FEATURE_process -1
|
||||
#define QT_FEATURE_regularexpression 1
|
||||
-#ifdef __GLIBC_PREREQ
|
||||
-# define QT_FEATURE_renameat2 (__GLIBC_PREREQ(2, 28) ? 1 : -1)
|
||||
-#else
|
||||
# define QT_FEATURE_renameat2 -1
|
||||
-#endif
|
||||
#define QT_FEATURE_shortcut -1
|
||||
#define QT_FEATURE_signaling_nan -1
|
||||
#define QT_FEATURE_slog2 -1
|
||||
--
|
||||
2.38.1
|
||||
|
56
contrib/depends/patches/native_qt/no-statx.patch
Normal file
56
contrib/depends/patches/native_qt/no-statx.patch
Normal file
|
@ -0,0 +1,56 @@
|
|||
From ceb48fa2f01b9c421d880f6220778d830e5c5f7b Mon Sep 17 00:00:00 2001
|
||||
From: tobtoht <tob@featherwallet.org>
|
||||
Date: Sun, 30 Oct 2022 16:52:17 +0100
|
||||
Subject: [PATCH] Never use statx
|
||||
|
||||
---
|
||||
src/corelib/configure.cmake | 1 -
|
||||
src/corelib/global/qconfig-bootstrapped.h | 6 +-----
|
||||
src/corelib/io/qfilesystemengine_unix.cpp | 2 +-
|
||||
3 files changed, 2 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/qtbase/src/corelib/configure.cmake b/qtbase/src/corelib/configure.cmake
|
||||
index 4ab122afd0..7b89fa3dd7 100644
|
||||
--- a/qtbase/src/corelib/configure.cmake
|
||||
+++ b/qtbase/src/corelib/configure.cmake
|
||||
@@ -428,7 +428,6 @@ qt_config_compile_test(statx
|
||||
CODE
|
||||
"#define _ATFILE_SOURCE 1
|
||||
#include <sys/types.h>
|
||||
-#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
diff --git a/qtbase/src/corelib/global/qconfig-bootstrapped.h b/qtbase/src/corelib/global/qconfig-bootstrapped.h
|
||||
index 42d38d0d04..25b551210c 100644
|
||||
--- a/qtbase/src/corelib/global/qconfig-bootstrapped.h
|
||||
+++ b/qtbase/src/corelib/global/qconfig-bootstrapped.h
|
||||
@@ -119,11 +119,7 @@
|
||||
#define QT_FEATURE_shortcut -1
|
||||
#define QT_FEATURE_signaling_nan -1
|
||||
#define QT_FEATURE_slog2 -1
|
||||
-#ifdef __GLIBC_PREREQ
|
||||
-# define QT_FEATURE_statx (__GLIBC_PREREQ(2, 28) ? 1 : -1)
|
||||
-#else
|
||||
-# define QT_FEATURE_statx -1
|
||||
-#endif
|
||||
+#define QT_FEATURE_statx -1
|
||||
#define QT_FEATURE_syslog -1
|
||||
#define QT_NO_SYSTEMLOCALE
|
||||
#define QT_FEATURE_systemsemaphore -1
|
||||
diff --git a/qtbase/src/corelib/io/qfilesystemengine_unix.cpp b/qtbase/src/corelib/io/qfilesystemengine_unix.cpp
|
||||
index 5ba9309426..c968d1c61f 100644
|
||||
--- a/qtbase/src/corelib/io/qfilesystemengine_unix.cpp
|
||||
+++ b/qtbase/src/corelib/io/qfilesystemengine_unix.cpp
|
||||
@@ -99,7 +99,7 @@ extern "C" NSString *NSTemporaryDirectory();
|
||||
#endif
|
||||
#endif
|
||||
|
||||
-#if defined(Q_OS_ANDROID)
|
||||
+#if defined(Q_OS_LINUX)
|
||||
// statx() is disabled on Android because quite a few systems
|
||||
// come with sandboxes that kill applications that make system calls outside a
|
||||
// whitelist and several Android vendors can't be bothered to update the list.
|
||||
--
|
||||
2.38.1
|
||||
|
|
@ -1,18 +1,17 @@
|
|||
From 9563cef873ae82e06f60708d706d054717e801ce Mon Sep 17 00:00:00 2001
|
||||
From: Carl Dong <contact@carldong.me>
|
||||
Date: Thu, 18 Jul 2019 17:22:05 -0400
|
||||
Subject: [PATCH] Wrap xlib related code blocks in #if's
|
||||
From 0171c86423f6c5aa8becf1259d42a3e67b8da59c Mon Sep 17 00:00:00 2001
|
||||
From: tobtoht <tob@featherwallet.org>
|
||||
Date: Sun, 30 Oct 2022 17:43:43 +0100
|
||||
Subject: [PATCH] no xlib
|
||||
|
||||
They are not necessary to compile QT.
|
||||
---
|
||||
qtbase/src/plugins/platforms/xcb/qxcbcursor.cpp | 8 ++++++++
|
||||
src/plugins/platforms/xcb/qxcbcursor.cpp | 8 ++++++++
|
||||
1 file changed, 8 insertions(+)
|
||||
|
||||
diff --git a/qtbase/src/plugins/platforms/xcb/qxcbcursor.cpp b/qtbase/src/plugins/platforms/xcb/qxcbcursor.cpp
|
||||
index 7c62c2e2b3..c05c6c0a07 100644
|
||||
index 2cc39f1e85..90efc1f1fb 100644
|
||||
--- a/qtbase/src/plugins/platforms/xcb/qxcbcursor.cpp
|
||||
+++ b/qtbase/src/plugins/platforms/xcb/qxcbcursor.cpp
|
||||
@@ -49,7 +49,9 @@
|
||||
@@ -13,7 +13,9 @@
|
||||
#include <QtGui/QWindow>
|
||||
#include <QtGui/QBitmap>
|
||||
#include <QtGui/private/qguiapplication_p.h>
|
||||
|
@ -22,7 +21,7 @@ index 7c62c2e2b3..c05c6c0a07 100644
|
|||
#include <xcb/xfixes.h>
|
||||
#include <xcb/xcb_image.h>
|
||||
|
||||
@@ -391,6 +391,7 @@ void QXcbCursor::changeCursor(QCursor *cursor, QWindow *window)
|
||||
@@ -357,6 +359,7 @@ void QXcbCursor::changeCursor(QCursor *cursor, QWindow *window)
|
||||
xcb_flush(xcb_connection());
|
||||
}
|
||||
|
||||
|
@ -30,7 +29,7 @@ index 7c62c2e2b3..c05c6c0a07 100644
|
|||
static int cursorIdForShape(int cshape)
|
||||
{
|
||||
int cursorId = 0;
|
||||
@@ -444,6 +445,7 @@ static int cursorIdForShape(int cshape)
|
||||
@@ -410,6 +413,7 @@ static int cursorIdForShape(int cshape)
|
||||
}
|
||||
return cursorId;
|
||||
}
|
||||
|
@ -38,7 +37,7 @@ index 7c62c2e2b3..c05c6c0a07 100644
|
|||
|
||||
xcb_cursor_t QXcbCursor::createNonStandardCursor(int cshape)
|
||||
{
|
||||
@@ -556,7 +558,9 @@ static xcb_cursor_t loadCursor(void *dpy, int cshape)
|
||||
@@ -524,7 +528,9 @@ static xcb_cursor_t loadCursor(void *dpy, int cshape)
|
||||
xcb_cursor_t QXcbCursor::createFontCursor(int cshape)
|
||||
{
|
||||
xcb_connection_t *conn = xcb_connection();
|
||||
|
@ -47,16 +46,16 @@ index 7c62c2e2b3..c05c6c0a07 100644
|
|||
+#endif
|
||||
xcb_cursor_t cursor = XCB_NONE;
|
||||
|
||||
// Try Xcursor first
|
||||
@@ -586,6 +590,7 @@ xcb_cursor_t QXcbCursor::createFontCursor(int cshape)
|
||||
#if QT_CONFIG(xcb_xlib) && QT_CONFIG(library)
|
||||
@@ -556,6 +562,7 @@ xcb_cursor_t QXcbCursor::createFontCursor(int cshape)
|
||||
// Non-standard X11 cursors are created from bitmaps
|
||||
cursor = createNonStandardCursor(cshape);
|
||||
|
||||
+#if QT_CONFIG(xcb_xlib) && QT_CONFIG(library)
|
||||
// Create a glpyh cursor if everything else failed
|
||||
// Create a glyph cursor if everything else failed
|
||||
if (!cursor && cursorId) {
|
||||
cursor = xcb_generate_id(conn);
|
||||
@@ -593,6 +598,7 @@ xcb_cursor_t QXcbCursor::createFontCursor(int cshape)
|
||||
@@ -563,6 +570,7 @@ xcb_cursor_t QXcbCursor::createFontCursor(int cshape)
|
||||
cursorId, cursorId + 1,
|
||||
0xFFFF, 0xFFFF, 0xFFFF, 0, 0, 0);
|
||||
}
|
||||
|
@ -65,5 +64,5 @@ index 7c62c2e2b3..c05c6c0a07 100644
|
|||
if (cursor && cshape >= 0 && cshape < Qt::LastCursor && connection()->hasXFixes()) {
|
||||
const char *name = cursorNames[cshape].front();
|
||||
--
|
||||
2.22.0
|
||||
2.38.1
|
||||
|
|
@ -0,0 +1,174 @@
|
|||
From e062494e888e4dfbb42cb0b2f2c9d41dd76b9bfb Mon Sep 17 00:00:00 2001
|
||||
From: tobtoht <tob@featherwallet.org>
|
||||
Date: Mon, 31 Oct 2022 00:38:39 +0100
|
||||
Subject: [PATCH] Revert "Re-apply "QReadWriteLock: replace (QWaitCondition,
|
||||
QMutex) with std::(condition_variable, mutex)""
|
||||
|
||||
This reverts commit fd8f81f3859fe92082caec925223e08cf61c69d4.
|
||||
---
|
||||
src/corelib/thread/qreadwritelock.cpp | 35 ++++++++++++---------------
|
||||
src/corelib/thread/qreadwritelock_p.h | 12 ++++-----
|
||||
2 files changed, 22 insertions(+), 25 deletions(-)
|
||||
|
||||
diff --git a/qtbase/src/corelib/thread/qreadwritelock.cpp b/qtbase/src/corelib/thread/qreadwritelock.cpp
|
||||
index c31782d684..a46b70180c 100644
|
||||
--- a/qtbase/src/corelib/thread/qreadwritelock.cpp
|
||||
+++ b/qtbase/src/corelib/thread/qreadwritelock.cpp
|
||||
@@ -31,9 +31,6 @@ QT_BEGIN_NAMESPACE
|
||||
*/
|
||||
|
||||
namespace {
|
||||
-
|
||||
-using ms = std::chrono::milliseconds;
|
||||
-
|
||||
enum {
|
||||
StateMask = 0x3,
|
||||
StateLockedForRead = 0x1,
|
||||
@@ -243,7 +240,7 @@ bool QReadWriteLock::tryLockForRead(int timeout)
|
||||
d = d_ptr.loadAcquire();
|
||||
continue;
|
||||
}
|
||||
- return d->lockForRead(lock, timeout);
|
||||
+ return d->lockForRead(timeout);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -347,7 +344,7 @@ bool QReadWriteLock::tryLockForWrite(int timeout)
|
||||
d = d_ptr.loadAcquire();
|
||||
continue;
|
||||
}
|
||||
- return d->lockForWrite(lock, timeout);
|
||||
+ return d->lockForWrite(timeout);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -431,9 +428,9 @@ QReadWriteLock::StateForWaitCondition QReadWriteLock::stateForWaitCondition() co
|
||||
|
||||
}
|
||||
|
||||
-bool QReadWriteLockPrivate::lockForRead(std::unique_lock<QtPrivate::mutex> &lock, int timeout)
|
||||
+bool QReadWriteLockPrivate::lockForRead(int timeout)
|
||||
{
|
||||
- Q_ASSERT(!mutex.try_lock()); // mutex must be locked when entering this function
|
||||
+ Q_ASSERT(!mutex.tryLock()); // mutex must be locked when entering this function
|
||||
|
||||
QElapsedTimer t;
|
||||
if (timeout > 0)
|
||||
@@ -447,10 +444,10 @@ bool QReadWriteLockPrivate::lockForRead(std::unique_lock<QtPrivate::mutex> &lock
|
||||
if (elapsed > timeout)
|
||||
return false;
|
||||
waitingReaders++;
|
||||
- readerCond.wait_for(lock, ms{timeout - elapsed});
|
||||
+ readerCond.wait(&mutex, QDeadlineTimer(timeout - elapsed));
|
||||
} else {
|
||||
waitingReaders++;
|
||||
- readerCond.wait(lock);
|
||||
+ readerCond.wait(&mutex);
|
||||
}
|
||||
waitingReaders--;
|
||||
}
|
||||
@@ -459,9 +456,9 @@ bool QReadWriteLockPrivate::lockForRead(std::unique_lock<QtPrivate::mutex> &lock
|
||||
return true;
|
||||
}
|
||||
|
||||
-bool QReadWriteLockPrivate::lockForWrite(std::unique_lock<QtPrivate::mutex> &lock, int timeout)
|
||||
+bool QReadWriteLockPrivate::lockForWrite(int timeout)
|
||||
{
|
||||
- Q_ASSERT(!mutex.try_lock()); // mutex must be locked when entering this function
|
||||
+ Q_ASSERT(!mutex.tryLock()); // mutex must be locked when entering this function
|
||||
|
||||
QElapsedTimer t;
|
||||
if (timeout > 0)
|
||||
@@ -476,15 +473,15 @@ bool QReadWriteLockPrivate::lockForWrite(std::unique_lock<QtPrivate::mutex> &loc
|
||||
if (waitingReaders && !waitingWriters && !writerCount) {
|
||||
// We timed out and now there is no more writers or waiting writers, but some
|
||||
// readers were queued (probably because of us). Wake the waiting readers.
|
||||
- readerCond.notify_all();
|
||||
+ readerCond.wakeAll();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
waitingWriters++;
|
||||
- writerCond.wait_for(lock, ms{timeout - elapsed});
|
||||
+ writerCond.wait(&mutex, QDeadlineTimer(timeout - elapsed));
|
||||
} else {
|
||||
waitingWriters++;
|
||||
- writerCond.wait(lock);
|
||||
+ writerCond.wait(&mutex);
|
||||
}
|
||||
waitingWriters--;
|
||||
}
|
||||
@@ -497,11 +494,11 @@ bool QReadWriteLockPrivate::lockForWrite(std::unique_lock<QtPrivate::mutex> &loc
|
||||
|
||||
void QReadWriteLockPrivate::unlock()
|
||||
{
|
||||
- Q_ASSERT(!mutex.try_lock()); // mutex must be locked when entering this function
|
||||
+ Q_ASSERT(!mutex.tryLock()); // mutex must be locked when entering this function
|
||||
if (waitingWriters)
|
||||
- writerCond.notify_one();
|
||||
+ writerCond.wakeOne();
|
||||
else if (waitingReaders)
|
||||
- readerCond.notify_all();
|
||||
+ readerCond.wakeAll();
|
||||
}
|
||||
|
||||
static auto handleEquals(Qt::HANDLE handle)
|
||||
@@ -523,7 +520,7 @@ bool QReadWriteLockPrivate::recursiveLockForRead(int timeout)
|
||||
return true;
|
||||
}
|
||||
|
||||
- if (!lockForRead(lock, timeout))
|
||||
+ if (!lockForRead(timeout))
|
||||
return false;
|
||||
|
||||
Reader r = {self, 1};
|
||||
@@ -542,7 +539,7 @@ bool QReadWriteLockPrivate::recursiveLockForWrite(int timeout)
|
||||
return true;
|
||||
}
|
||||
|
||||
- if (!lockForWrite(lock, timeout))
|
||||
+ if (!lockForWrite(timeout))
|
||||
return false;
|
||||
|
||||
currentWriter = self;
|
||||
diff --git a/qtbase/src/corelib/thread/qreadwritelock_p.h b/qtbase/src/corelib/thread/qreadwritelock_p.h
|
||||
index e1d42fbbf3..c88eb15e1b 100644
|
||||
--- a/qtbase/src/corelib/thread/qreadwritelock_p.h
|
||||
+++ b/qtbase/src/corelib/thread/qreadwritelock_p.h
|
||||
@@ -17,8 +17,8 @@
|
||||
//
|
||||
|
||||
#include <QtCore/private/qglobal_p.h>
|
||||
-#include <QtCore/private/qwaitcondition_p.h>
|
||||
#include <QtCore/qvarlengtharray.h>
|
||||
+#include <QtCore/qwaitcondition.h>
|
||||
|
||||
QT_REQUIRE_CONFIG(thread);
|
||||
|
||||
@@ -30,9 +30,9 @@ public:
|
||||
explicit QReadWriteLockPrivate(bool isRecursive = false)
|
||||
: recursive(isRecursive) {}
|
||||
|
||||
- QtPrivate::mutex mutex;
|
||||
- QtPrivate::condition_variable writerCond;
|
||||
- QtPrivate::condition_variable readerCond;
|
||||
+ QMutex mutex;
|
||||
+ QWaitCondition writerCond;
|
||||
+ QWaitCondition readerCond;
|
||||
int readerCount = 0;
|
||||
int writerCount = 0;
|
||||
int waitingReaders = 0;
|
||||
@@ -40,8 +40,8 @@ public:
|
||||
const bool recursive;
|
||||
|
||||
//Called with the mutex locked
|
||||
- bool lockForWrite(std::unique_lock<QtPrivate::mutex> &lock, int timeout);
|
||||
- bool lockForRead(std::unique_lock<QtPrivate::mutex> &lock, int timeout);
|
||||
+ bool lockForWrite(int timeout);
|
||||
+ bool lockForRead(int timeout);
|
||||
void unlock();
|
||||
|
||||
//memory management
|
||||
--
|
||||
2.38.1
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
The moc executable loops through headers on CPLUS_INCLUDE_PATH and stumbles
|
||||
on the GCC internal _GLIBCXX_VISIBILITY macro. Tell it to ignore it as it is
|
||||
not supposed to be looking there to begin with.
|
||||
|
||||
Upstream report: https://bugreports.qt.io/browse/QTBUG-83160
|
||||
|
||||
diff --git a/qtbase/src/tools/moc/main.cpp b/qtbase/src/tools/moc/main.cpp
|
||||
--- a/qtbase/src/tools/moc/main.cpp
|
||||
+++ b/qtbase/src/tools/moc/main.cpp
|
||||
@@ -197,6 +197,7 @@ int runMoc(int argc, char **argv)
|
||||
dummyVariadicFunctionMacro.arguments += Symbol(0, PP_IDENTIFIER, "__VA_ARGS__");
|
||||
pp.macros["__attribute__"] = dummyVariadicFunctionMacro;
|
||||
pp.macros["__declspec"] = dummyVariadicFunctionMacro;
|
||||
+ pp.macros["_GLIBCXX_VISIBILITY"] = dummyVariadicFunctionMacro;
|
||||
|
||||
QString filename;
|
||||
QString output;
|
|
@ -0,0 +1,24 @@
|
|||
Hardcode last modified timestamp in Qt RCC
|
||||
|
||||
This change allows the already built qt package to be reused even with
|
||||
the SOURCE_DATE_EPOCH variable set, e.g., for Guix builds.
|
||||
|
||||
|
||||
--- old/qtbase/src/tools/rcc/rcc.cpp
|
||||
+++ new/qtbase/src/tools/rcc/rcc.cpp
|
||||
@@ -229,14 +229,7 @@ void RCCFileInfo::writeDataInfo(RCCResourceLibrary &lib)
|
||||
|
||||
if (lib.formatVersion() >= 2) {
|
||||
// last modified time stamp
|
||||
- const QDateTime lastModified = m_fileInfo.lastModified();
|
||||
- quint64 lastmod = quint64(lastModified.isValid() ? lastModified.toMSecsSinceEpoch() : 0);
|
||||
- static const quint64 sourceDate = 1000 * qgetenv("QT_RCC_SOURCE_DATE_OVERRIDE").toULongLong();
|
||||
- if (sourceDate != 0)
|
||||
- lastmod = sourceDate;
|
||||
- static const quint64 sourceDate2 = 1000 * qgetenv("SOURCE_DATE_EPOCH").toULongLong();
|
||||
- if (sourceDate2 != 0)
|
||||
- lastmod = sourceDate2;
|
||||
+ quint64 lastmod = quint64(1);
|
||||
lib.writeNumber8(lastmod);
|
||||
if (text || pass1)
|
||||
lib.writeChar('\n');
|
51
contrib/depends/patches/native_qt/root_CMakeLists.txt
Normal file
51
contrib/depends/patches/native_qt/root_CMakeLists.txt
Normal file
|
@ -0,0 +1,51 @@
|
|||
# The real minimum version will be checked by the qtbase project.
|
||||
# 3.16 is the absolute minimum though.
|
||||
cmake_minimum_required(VERSION 3.16...3.20)
|
||||
|
||||
# Include qtbase's .cmake.conf for access to QT_REPO_MODULE_VERSION
|
||||
set(__qt6_qtbase_src_path "${CMAKE_CURRENT_SOURCE_DIR}/qtbase")
|
||||
include("${__qt6_qtbase_src_path}/.cmake.conf")
|
||||
|
||||
# Run platform auto-detection /before/ the first project() call and thus
|
||||
# before the toolchain file is loaded.
|
||||
include("${__qt6_qtbase_src_path}/cmake/QtAutoDetect.cmake")
|
||||
|
||||
project(Qt
|
||||
VERSION "${QT_REPO_MODULE_VERSION}"
|
||||
DESCRIPTION "Qt Libraries"
|
||||
HOMEPAGE_URL "https://qt.io/"
|
||||
LANGUAGES CXX C ASM
|
||||
)
|
||||
|
||||
# Required so we can call ctest from the root build directory
|
||||
enable_testing()
|
||||
|
||||
set(qt_module_prop_prefix "__qt_prop_")
|
||||
|
||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
|
||||
list(APPEND CMAKE_MODULE_PATH "${__qt6_qtbase_src_path}/cmake")
|
||||
list(APPEND CMAKE_MODULE_PATH
|
||||
"${__qt6_qtbase_src_path}/cmake/3rdparty/extra-cmake-modules/find-modules")
|
||||
list(APPEND CMAKE_MODULE_PATH "${__qt6_qtbase_src_path}/cmake/3rdparty/kwin")
|
||||
|
||||
# Also make sure the CMake config files do not recreate the already-existing targets
|
||||
set(QT_NO_CREATE_TARGETS TRUE)
|
||||
set(QT_SUPERBUILD TRUE)
|
||||
|
||||
set(QT_BUILD_SUBMODULES "qtbase;qttranslations;qtsvg;qtshadertools;qtmultimedia" CACHE STRING "Submodules to build")
|
||||
|
||||
foreach(module IN LISTS QT_BUILD_SUBMODULES)
|
||||
message(NOTICE "Configuring '${module}'")
|
||||
add_subdirectory("${module}")
|
||||
|
||||
if(module STREQUAL "qtbase")
|
||||
list(APPEND CMAKE_PREFIX_PATH "${QtBase_BINARY_DIR}/lib/cmake")
|
||||
list(APPEND CMAKE_FIND_ROOT_PATH "${QtBase_BINARY_DIR}")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
# Display a summary of everything
|
||||
include(QtBuildInformation)
|
||||
include(QtPlatformSupport)
|
||||
qt_print_feature_summary()
|
||||
qt_print_build_instructions()
|
File diff suppressed because it is too large
Load diff
25
contrib/depends/patches/qt/MacToolchain.cmake
Normal file
25
contrib/depends/patches/qt/MacToolchain.cmake
Normal file
|
@ -0,0 +1,25 @@
|
|||
# Targeted operating system.
|
||||
set(CMAKE_SYSTEM_NAME Darwin)
|
||||
|
||||
# TODO: don't hardcode this
|
||||
set(TARGET_SYSROOT /feather/contrib/depends/SDKs/Xcode-12.2-12B45b-extracted-SDK-with-libcxx-headers)
|
||||
set(CMAKE_SYSROOT ${TARGET_SYSROOT})
|
||||
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.15 -B/feather/contrib/depends/x86_64-apple-darwin/native/bin -mlinker-version=609 -isysroot/feather/contrib/depends/SDKs/Xcode-12.2-12B45b-extracted-SDK-with-libcxx-headers -Xclang -internal-externc-isystem/gnu/store/rwsysyzpxzwi7g1jv4hxwi3m8i36iwcc-clang-10.0.1/lib/clang/10.0.1/include -Xclang -internal-externc-isystem/feather/contrib/depends/SDKs/Xcode-12.2-12B45b-extracted-SDK-with-libcxx-headers/usr/include")
|
||||
set(CMAKE_CXX_FLAGS "--target=x86_64-apple-darwin -mmacosx-version-min=10.15 -B/feather/contrib/depends/x86_64-apple-darwin/native/bin -mlinker-version=609 -isysroot/feather/contrib/depends/SDKs/Xcode-12.2-12B45b-extracted-SDK-with-libcxx-headers -stdlib=libc++ -stdlib++-isystem/feather/contrib/depends/SDKs/Xcode-12.2-12B45b-extracted-SDK-with-libcxx-headers/usr/include/c++/v1 -isystem/feather/contrib/depends/SDKs/Xcode-12.2-12B45b-extracted-SDK-with-libcxx-headers/usr/include/c++/v1 -isystem/feather/contrib/depends/SDKs/Xcode-12.2-12B45b-extracted-SDK-with-libcxx-headers/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/SDKs/Xcode-12.2-12B45b-extracted-SDK-with-libcxx-headers/usr/include")
|
||||
|
||||
set(CMAKE_INSTALL_NAME_TOOL x86_64-apple-darwin-install_name_tool)
|
||||
set(CMAKE_FIND_ROOT_PATH /feather/contrib/depends/x86_64-apple-darwin/)
|
||||
|
||||
# Adjust the default behavior of the find commands:
|
||||
# search headers and libraries in the target environment
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
||||
|
||||
# Search programs in the host environment
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
59
contrib/depends/patches/qt/QTBUG-92199-fix.patch
Normal file
59
contrib/depends/patches/qt/QTBUG-92199-fix.patch
Normal file
|
@ -0,0 +1,59 @@
|
|||
From c765bc51864b90ebc46c11780ccc20ad16eddd6a Mon Sep 17 00:00:00 2001
|
||||
From: tobtoht <tob@featherwallet.org>
|
||||
Date: Tue, 8 Nov 2022 00:59:36 +0100
|
||||
Subject: [PATCH] Fix QTBUG-92199
|
||||
|
||||
---
|
||||
src/widgets/styles/qstylesheetstyle.cpp | 1 -
|
||||
.../qstylesheetstyle/tst_qstylesheetstyle.cpp | 16 ----------------
|
||||
2 files changed, 17 deletions(-)
|
||||
|
||||
diff --git a/qtbase/src/widgets/styles/qstylesheetstyle.cpp b/qtbase/src/widgets/styles/qstylesheetstyle.cpp
|
||||
index 6abef62835..7aca4d5788 100644
|
||||
--- a/qtbase/src/widgets/styles/qstylesheetstyle.cpp
|
||||
+++ b/qtbase/src/widgets/styles/qstylesheetstyle.cpp
|
||||
@@ -1474,7 +1474,6 @@ void QRenderRule::configurePalette(QPalette *p, QPalette::ColorGroup cg, const Q
|
||||
p->setBrush(cg, w->foregroundRole(), pal->foreground);
|
||||
p->setBrush(cg, QPalette::WindowText, pal->foreground);
|
||||
p->setBrush(cg, QPalette::Text, pal->foreground);
|
||||
- p->setBrush(cg, QPalette::PlaceholderText, pal->foreground);
|
||||
}
|
||||
if (pal->selectionBackground.style() != Qt::NoBrush)
|
||||
p->setBrush(cg, QPalette::Highlight, pal->selectionBackground);
|
||||
diff --git a/qtbase/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp b/qtbase/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp
|
||||
index 82d48b1692..9add99325b 100644
|
||||
--- a/qtbase/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp
|
||||
+++ b/qtbase/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp
|
||||
@@ -103,7 +103,6 @@ private slots:
|
||||
void QTBUG15910_crashNullWidget();
|
||||
void QTBUG36933_brokenPseudoClassLookup();
|
||||
void styleSheetChangeBeforePolish();
|
||||
- void placeholderColor();
|
||||
void enumPropertySelector_data();
|
||||
void enumPropertySelector();
|
||||
//at the end because it mess with the style.
|
||||
@@ -2331,21 +2330,6 @@ void tst_QStyleSheetStyle::highdpiImages()
|
||||
QHighDpiScaling::updateHighDpiScaling(); // reset to normal
|
||||
}
|
||||
|
||||
-void tst_QStyleSheetStyle::placeholderColor()
|
||||
-{
|
||||
- const QColor red(Qt::red);
|
||||
- qApp->setStyleSheet("* { color: red; }");
|
||||
- QLineEdit le1;
|
||||
- QLineEdit le2;
|
||||
- le2.setEnabled(false);
|
||||
- le1.ensurePolished();
|
||||
- QCOMPARE(le1.palette().placeholderText(), red);
|
||||
- le2.ensurePolished();
|
||||
- QCOMPARE(le2.palette().placeholderText(), red);
|
||||
- le2.setEnabled(true);
|
||||
- QCOMPARE(le2.palette().placeholderText(), red);
|
||||
-}
|
||||
-
|
||||
void tst_QStyleSheetStyle::enumPropertySelector_data()
|
||||
{
|
||||
QTest::addColumn<QString>("styleSheet");
|
||||
--
|
||||
2.38.1
|
||||
|
15
contrib/depends/patches/qt/WindowsToolchain.cmake
Normal file
15
contrib/depends/patches/qt/WindowsToolchain.cmake
Normal file
|
@ -0,0 +1,15 @@
|
|||
# Targeted operating system.
|
||||
set(CMAKE_SYSTEM_NAME Windows)
|
||||
|
||||
# Use mingw 64-bit compilers.
|
||||
set(CMAKE_C_COMPILER x86_64-w64-mingw32-gcc)
|
||||
set(CMAKE_CXX_COMPILER x86_64-w64-mingw32-g++)
|
||||
set(CMAKE_FIND_ROOT_PATH /feather/contrib/depends/x86_64-w64-mingw32/)
|
||||
|
||||
# Adjust the default behavior of the find commands:
|
||||
# search headers and libraries in the target environment
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
||||
|
||||
# Search programs in the host environment
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
151
contrib/depends/patches/qt/___isOSVersionAtLeast_hack.patch
Normal file
151
contrib/depends/patches/qt/___isOSVersionAtLeast_hack.patch
Normal file
|
@ -0,0 +1,151 @@
|
|||
From 3a7a87074b8c1efd93b587e25a0790708f43dc17 Mon Sep 17 00:00:00 2001
|
||||
From: tobtoht <tob@featherwallet.org>
|
||||
Date: Sat, 26 Nov 2022 19:50:04 +0100
|
||||
Subject: [PATCH] don't use @available
|
||||
|
||||
---
|
||||
src/gui/rhi/qrhimetal.mm | 25 ++-----------------------
|
||||
1 file changed, 2 insertions(+), 23 deletions(-)
|
||||
|
||||
diff --git a/qtbase/src/gui/rhi/qrhimetal.mm b/qtbase/src/gui/rhi/qrhimetal.mm
|
||||
index bd761b4e15..deb584125c 100644
|
||||
--- a/qtbase/src/gui/rhi/qrhimetal.mm
|
||||
+++ b/qtbase/src/gui/rhi/qrhimetal.mm
|
||||
@@ -2545,119 +2545,102 @@ static inline MTLPixelFormat toMetalTextureFormat(QRhiTexture::Format format, QR
|
||||
#else
|
||||
case QRhiTexture::ETC2_RGB8:
|
||||
if (d->caps.isAppleGPU) {
|
||||
- if (@available(macOS 11.0, *))
|
||||
return srgb ? MTLPixelFormatETC2_RGB8_sRGB : MTLPixelFormatETC2_RGB8;
|
||||
}
|
||||
qWarning("QRhiMetal: ETC2 compression not supported on this platform");
|
||||
return MTLPixelFormatInvalid;
|
||||
case QRhiTexture::ETC2_RGB8A1:
|
||||
if (d->caps.isAppleGPU) {
|
||||
- if (@available(macOS 11.0, *))
|
||||
return srgb ? MTLPixelFormatETC2_RGB8A1_sRGB : MTLPixelFormatETC2_RGB8A1;
|
||||
}
|
||||
qWarning("QRhiMetal: ETC2 compression not supported on this platform");
|
||||
return MTLPixelFormatInvalid;
|
||||
case QRhiTexture::ETC2_RGBA8:
|
||||
if (d->caps.isAppleGPU) {
|
||||
- if (@available(macOS 11.0, *))
|
||||
return srgb ? MTLPixelFormatEAC_RGBA8_sRGB : MTLPixelFormatEAC_RGBA8;
|
||||
}
|
||||
qWarning("QRhiMetal: ETC2 compression not supported on this platform");
|
||||
return MTLPixelFormatInvalid;
|
||||
case QRhiTexture::ASTC_4x4:
|
||||
if (d->caps.isAppleGPU) {
|
||||
- if (@available(macOS 11.0, *))
|
||||
return srgb ? MTLPixelFormatASTC_4x4_sRGB : MTLPixelFormatASTC_4x4_LDR;
|
||||
}
|
||||
qWarning("QRhiMetal: ASTC compression not supported on this platform");
|
||||
return MTLPixelFormatInvalid;
|
||||
case QRhiTexture::ASTC_5x4:
|
||||
if (d->caps.isAppleGPU) {
|
||||
- if (@available(macOS 11.0, *))
|
||||
return srgb ? MTLPixelFormatASTC_5x4_sRGB : MTLPixelFormatASTC_5x4_LDR;
|
||||
}
|
||||
qWarning("QRhiMetal: ASTC compression not supported on this platform");
|
||||
return MTLPixelFormatInvalid;
|
||||
case QRhiTexture::ASTC_5x5:
|
||||
if (d->caps.isAppleGPU) {
|
||||
- if (@available(macOS 11.0, *))
|
||||
return srgb ? MTLPixelFormatASTC_5x5_sRGB : MTLPixelFormatASTC_5x5_LDR;
|
||||
}
|
||||
qWarning("QRhiMetal: ASTC compression not supported on this platform");
|
||||
return MTLPixelFormatInvalid;
|
||||
case QRhiTexture::ASTC_6x5:
|
||||
if (d->caps.isAppleGPU) {
|
||||
- if (@available(macOS 11.0, *))
|
||||
return srgb ? MTLPixelFormatASTC_6x5_sRGB : MTLPixelFormatASTC_6x5_LDR;
|
||||
}
|
||||
qWarning("QRhiMetal: ASTC compression not supported on this platform");
|
||||
return MTLPixelFormatInvalid;
|
||||
case QRhiTexture::ASTC_6x6:
|
||||
if (d->caps.isAppleGPU) {
|
||||
- if (@available(macOS 11.0, *))
|
||||
return srgb ? MTLPixelFormatASTC_6x6_sRGB : MTLPixelFormatASTC_6x6_LDR;
|
||||
}
|
||||
qWarning("QRhiMetal: ASTC compression not supported on this platform");
|
||||
return MTLPixelFormatInvalid;
|
||||
case QRhiTexture::ASTC_8x5:
|
||||
if (d->caps.isAppleGPU) {
|
||||
- if (@available(macOS 11.0, *))
|
||||
return srgb ? MTLPixelFormatASTC_8x5_sRGB : MTLPixelFormatASTC_8x5_LDR;
|
||||
}
|
||||
qWarning("QRhiMetal: ASTC compression not supported on this platform");
|
||||
return MTLPixelFormatInvalid;
|
||||
case QRhiTexture::ASTC_8x6:
|
||||
if (d->caps.isAppleGPU) {
|
||||
- if (@available(macOS 11.0, *))
|
||||
return srgb ? MTLPixelFormatASTC_8x6_sRGB : MTLPixelFormatASTC_8x6_LDR;
|
||||
}
|
||||
qWarning("QRhiMetal: ASTC compression not supported on this platform");
|
||||
return MTLPixelFormatInvalid;
|
||||
case QRhiTexture::ASTC_8x8:
|
||||
if (d->caps.isAppleGPU) {
|
||||
- if (@available(macOS 11.0, *))
|
||||
return srgb ? MTLPixelFormatASTC_8x8_sRGB : MTLPixelFormatASTC_8x8_LDR;
|
||||
}
|
||||
qWarning("QRhiMetal: ASTC compression not supported on this platform");
|
||||
return MTLPixelFormatInvalid;
|
||||
case QRhiTexture::ASTC_10x5:
|
||||
if (d->caps.isAppleGPU) {
|
||||
- if (@available(macOS 11.0, *))
|
||||
return srgb ? MTLPixelFormatASTC_10x5_sRGB : MTLPixelFormatASTC_10x5_LDR;
|
||||
}
|
||||
qWarning("QRhiMetal: ASTC compression not supported on this platform");
|
||||
return MTLPixelFormatInvalid;
|
||||
case QRhiTexture::ASTC_10x6:
|
||||
if (d->caps.isAppleGPU) {
|
||||
- if (@available(macOS 11.0, *))
|
||||
return srgb ? MTLPixelFormatASTC_10x6_sRGB : MTLPixelFormatASTC_10x6_LDR;
|
||||
}
|
||||
qWarning("QRhiMetal: ASTC compression not supported on this platform");
|
||||
return MTLPixelFormatInvalid;
|
||||
case QRhiTexture::ASTC_10x8:
|
||||
if (d->caps.isAppleGPU) {
|
||||
- if (@available(macOS 11.0, *))
|
||||
return srgb ? MTLPixelFormatASTC_10x8_sRGB : MTLPixelFormatASTC_10x8_LDR;
|
||||
}
|
||||
qWarning("QRhiMetal: ASTC compression not supported on this platform");
|
||||
return MTLPixelFormatInvalid;
|
||||
case QRhiTexture::ASTC_10x10:
|
||||
if (d->caps.isAppleGPU) {
|
||||
- if (@available(macOS 11.0, *))
|
||||
return srgb ? MTLPixelFormatASTC_10x10_sRGB : MTLPixelFormatASTC_10x10_LDR;
|
||||
}
|
||||
qWarning("QRhiMetal: ASTC compression not supported on this platform");
|
||||
return MTLPixelFormatInvalid;
|
||||
case QRhiTexture::ASTC_12x10:
|
||||
if (d->caps.isAppleGPU) {
|
||||
- if (@available(macOS 11.0, *))
|
||||
return srgb ? MTLPixelFormatASTC_12x10_sRGB : MTLPixelFormatASTC_12x10_LDR;
|
||||
}
|
||||
qWarning("QRhiMetal: ASTC compression not supported on this platform");
|
||||
return MTLPixelFormatInvalid;
|
||||
case QRhiTexture::ASTC_12x12:
|
||||
if (d->caps.isAppleGPU) {
|
||||
- if (@available(macOS 11.0, *))
|
||||
return srgb ? MTLPixelFormatASTC_12x12_sRGB : MTLPixelFormatASTC_12x12_LDR;
|
||||
}
|
||||
qWarning("QRhiMetal: ASTC compression not supported on this platform");
|
||||
@@ -2727,12 +2710,8 @@ bool QMetalRenderBuffer::create()
|
||||
case DepthStencil:
|
||||
#ifdef Q_OS_MACOS
|
||||
if (rhiD->caps.isAppleGPU) {
|
||||
- if (@available(macOS 11.0, *)) {
|
||||
- desc.storageMode = MTLStorageModeMemoryless;
|
||||
- d->format = MTLPixelFormatDepth32Float_Stencil8;
|
||||
- } else {
|
||||
- Q_UNREACHABLE();
|
||||
- }
|
||||
+ desc.storageMode = MTLStorageModeMemoryless;
|
||||
+ d->format = MTLPixelFormatDepth32Float_Stencil8;
|
||||
} else {
|
||||
desc.storageMode = MTLStorageModePrivate;
|
||||
d->format = rhiD->d->dev.depth24Stencil8PixelFormatSupported
|
||||
--
|
||||
2.38.1
|
||||
|
33
contrib/depends/patches/qt/dont_capitalize_wmf_libs.patch
Normal file
33
contrib/depends/patches/qt/dont_capitalize_wmf_libs.patch
Normal file
|
@ -0,0 +1,33 @@
|
|||
From 2c284ef4e533b4a0f10e337b2998884c381377e6 Mon Sep 17 00:00:00 2001
|
||||
From: tobtoht <tob@featherwallet.org>
|
||||
Date: Wed, 16 Nov 2022 20:02:52 +0100
|
||||
Subject: [PATCH] don't capitalize WMF libs
|
||||
|
||||
---
|
||||
cmake/FindWMF.cmake | 10 +++++-----
|
||||
1 file changed, 5 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/qtmultimedia/cmake/FindWMF.cmake b/qtmultimedia/cmake/FindWMF.cmake
|
||||
index 7c6923c1e..b69274be5 100644
|
||||
--- a/qtmultimedia/cmake/FindWMF.cmake
|
||||
+++ b/qtmultimedia/cmake/FindWMF.cmake
|
||||
@@ -22,11 +22,11 @@ find_library(WMF_UUID_LIBRARY uuid HINTS ${CMAKE_C_IMPLICIT_LINK_DIRECTORIES})
|
||||
find_library(WMF_MSDMO_LIBRARY msdmo HINTS ${CMAKE_C_IMPLICIT_LINK_DIRECTORIES})
|
||||
find_library(WMF_OLE32_LIBRARY ole32 HINTS ${CMAKE_C_IMPLICIT_LINK_DIRECTORIES})
|
||||
find_library(WMF_OLEAUT32_LIBRARY oleaut32 HINTS ${CMAKE_C_IMPLICIT_LINK_DIRECTORIES})
|
||||
-find_library(WMF_MF_LIBRARY Mf HINTS ${CMAKE_C_IMPLICIT_LINK_DIRECTORIES})
|
||||
-find_library(WMF_MFUUID_LIBRARY Mfuuid HINTS ${CMAKE_C_IMPLICIT_LINK_DIRECTORIES})
|
||||
-find_library(WMF_MFPLAT_LIBRARY Mfplat HINTS ${CMAKE_C_IMPLICIT_LINK_DIRECTORIES})
|
||||
-find_library(WMF_MFCORE_LIBRARY Mfcore HINTS ${CMAKE_C_IMPLICIT_LINK_DIRECTORIES})
|
||||
-find_library(WMF_PROPSYS_LIBRARY Propsys HINTS ${CMAKE_C_IMPLICIT_LINK_DIRECTORIES})
|
||||
+find_library(WMF_MF_LIBRARY mf HINTS ${CMAKE_C_IMPLICIT_LINK_DIRECTORIES})
|
||||
+find_library(WMF_MFUUID_LIBRARY mfuuid HINTS ${CMAKE_C_IMPLICIT_LINK_DIRECTORIES})
|
||||
+find_library(WMF_MFPLAT_LIBRARY mfplat HINTS ${CMAKE_C_IMPLICIT_LINK_DIRECTORIES})
|
||||
+find_library(WMF_MFCORE_LIBRARY mfcore HINTS ${CMAKE_C_IMPLICIT_LINK_DIRECTORIES})
|
||||
+find_library(WMF_PROPSYS_LIBRARY propsys HINTS ${CMAKE_C_IMPLICIT_LINK_DIRECTORIES})
|
||||
|
||||
|
||||
set(WMF_LIBRARIES ${WMF_STRMIIDS_LIBRARY} ${WMF_AMSTRMID_LIBRARY} ${WMF_DMOGUIDS_LIBRARY} ${WMF_UUID_LIBRARY}
|
||||
--
|
||||
2.38.1
|
||||
|
|
@ -9,12 +9,10 @@ Date: Tue Aug 18 15:09:06 2020 +0800
|
|||
|
||||
See #15581.
|
||||
|
||||
diff --git a/qtbase/configure b/qtbase/configure
|
||||
index 08b49a8d..faea5b55 100755
|
||||
--- a/qtbase/configure
|
||||
+++ b/qtbase/configure
|
||||
@@ -36,9 +36,9 @@
|
||||
relconf=`basename $0`
|
||||
@@ -34,9 +34,9 @@
|
||||
|
||||
# the directory of this script is the "source tree"
|
||||
relpath=`dirname $0`
|
||||
-relpath=`(cd "$relpath"; /bin/pwd)`
|
||||
|
@ -23,5 +21,5 @@ index 08b49a8d..faea5b55 100755
|
|||
-outpath=`/bin/pwd`
|
||||
+outpath=`pwd`
|
||||
|
||||
WHICH="which"
|
||||
|
||||
# do this early so we don't store it in config.status
|
||||
CFG_TOPLEVEL=
|
||||
|
|
|
@ -1,119 +0,0 @@
|
|||
macOS: Don't hard-code x86_64 as the architecture when using qmake
|
||||
|
||||
Upstream commit:
|
||||
- Qt 6.1: 9082cc8e8d5a6441dabe5e7a95bc0cd9085b95fe
|
||||
|
||||
For other Qt branches see
|
||||
https://codereview.qt-project.org/q/I70db7e4c27f0d3da5d0af33cb491d72c312d3fa8
|
||||
|
||||
|
||||
--- old/qtbase/configure.json
|
||||
+++ new/qtbase/configure.json
|
||||
@@ -244,11 +244,18 @@
|
||||
|
||||
"testTypeDependencies": {
|
||||
"linkerSupportsFlag": [ "use_bfd_linker", "use_gold_linker", "use_lld_linker" ],
|
||||
- "verifySpec": [ "shared", "use_bfd_linker", "use_gold_linker", "use_lld_linker", "compiler-flags", "qmakeargs", "commit" ],
|
||||
+ "verifySpec": [
|
||||
+ "shared",
|
||||
+ "use_bfd_linker", "use_gold_linker", "use_lld_linker",
|
||||
+ "compiler-flags", "qmakeargs",
|
||||
+ "simulator_and_device",
|
||||
+ "thread",
|
||||
+ "commit" ],
|
||||
"compile": [ "verifyspec" ],
|
||||
"detectPkgConfig": [ "cross_compile", "machineTuple" ],
|
||||
"library": [ "pkg-config", "compiler-flags" ],
|
||||
- "getPkgConfigVariable": [ "pkg-config" ]
|
||||
+ "getPkgConfigVariable": [ "pkg-config" ],
|
||||
+ "architecture" : [ "verifyspec" ]
|
||||
},
|
||||
|
||||
"testTypeAliases": {
|
||||
@@ -762,7 +769,7 @@
|
||||
},
|
||||
"architecture": {
|
||||
"label": "Architecture",
|
||||
- "output": [ "architecture" ]
|
||||
+ "output": [ "architecture", "commitConfig" ]
|
||||
},
|
||||
"pkg-config": {
|
||||
"label": "Using pkg-config",
|
||||
diff --git a/configure.pri b/configure.pri
|
||||
index 49755f7abfd..8be9b10d7d4 100644
|
||||
--- old/qtbase/configure.pri
|
||||
+++ new/qtbase/configure.pri
|
||||
@@ -662,6 +662,13 @@ defineTest(qtConfOutput_commitOptions) {
|
||||
write_file($$QT_BUILD_TREE/mkspecs/qdevice.pri, $${currentConfig}.output.devicePro)|error()
|
||||
}
|
||||
|
||||
+# Output is written after configuring each Qt module,
|
||||
+# but some tests within a module might depend on the
|
||||
+# configuration output of previous tests.
|
||||
+defineTest(qtConfOutput_commitConfig) {
|
||||
+ qtConfProcessOutput()
|
||||
+}
|
||||
+
|
||||
# type (empty or 'host'), option name, default value
|
||||
defineTest(processQtPath) {
|
||||
out_var = config.rel_input.$${2}
|
||||
diff --git a/mkspecs/common/macx.conf b/mkspecs/common/macx.conf
|
||||
index d16b77acb8e..4ba0a8eaa36 100644
|
||||
--- old/qtbase/mkspecs/common/macx.conf
|
||||
+++ new/qtbase/mkspecs/common/macx.conf
|
||||
@@ -6,7 +6,6 @@ QMAKE_PLATFORM += macos osx macx
|
||||
QMAKE_MAC_SDK = macosx
|
||||
|
||||
QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.13
|
||||
-QMAKE_APPLE_DEVICE_ARCHS = x86_64
|
||||
|
||||
# Should be 10.15, but as long as the CI builds with
|
||||
# older SDKs we have to keep this.
|
||||
diff --git a/mkspecs/features/mac/default_post.prf b/mkspecs/features/mac/default_post.prf
|
||||
index 92a9112bca6..d888731ec8d 100644
|
||||
--- old/qtbase/mkspecs/features/mac/default_post.prf
|
||||
+++ new/qtbase/mkspecs/features/mac/default_post.prf
|
||||
@@ -95,6 +95,11 @@ app_extension_api_only {
|
||||
QMAKE_LFLAGS += $$QMAKE_CFLAGS_APPLICATION_EXTENSION
|
||||
}
|
||||
|
||||
+# Non-universal builds do not set QMAKE_APPLE_DEVICE_ARCHS,
|
||||
+# so we pick it up from what the arch test resolved instead.
|
||||
+isEmpty(QMAKE_APPLE_DEVICE_ARCHS): \
|
||||
+ QMAKE_APPLE_DEVICE_ARCHS = $$QT_ARCH
|
||||
+
|
||||
macx-xcode {
|
||||
qmake_pkginfo_typeinfo.name = QMAKE_PKGINFO_TYPEINFO
|
||||
!isEmpty(QMAKE_PKGINFO_TYPEINFO): \
|
||||
@@ -150,9 +155,6 @@ macx-xcode {
|
||||
simulator: VALID_SIMULATOR_ARCHS = $$QMAKE_APPLE_SIMULATOR_ARCHS
|
||||
VALID_ARCHS = $$VALID_DEVICE_ARCHS $$VALID_SIMULATOR_ARCHS
|
||||
|
||||
- isEmpty(VALID_ARCHS): \
|
||||
- error("QMAKE_APPLE_DEVICE_ARCHS or QMAKE_APPLE_SIMULATOR_ARCHS must contain at least one architecture")
|
||||
-
|
||||
single_arch: VALID_ARCHS = $$first(VALID_ARCHS)
|
||||
|
||||
ACTIVE_ARCHS = $(filter $(EXPORT_VALID_ARCHS), $(ARCHS))
|
||||
diff --git a/mkspecs/features/toolchain.prf b/mkspecs/features/toolchain.prf
|
||||
index efbe7c1e55b..8add6dc8043 100644
|
||||
--- old/qtbase/mkspecs/features/toolchain.prf
|
||||
+++ new/qtbase/mkspecs/features/toolchain.prf
|
||||
@@ -182,9 +182,14 @@ isEmpty($${target_prefix}.INCDIRS) {
|
||||
# UIKit simulator platforms will see the device SDK's sysroot in
|
||||
# QMAKE_DEFAULT_*DIRS, because they're handled in a single build pass.
|
||||
darwin {
|
||||
- # Clang doesn't pick up the architecture from the sysroot, and will
|
||||
- # default to the host architecture, so we need to manually set it.
|
||||
- cxx_flags += -arch $$QMAKE_APPLE_DEVICE_ARCHS
|
||||
+ uikit {
|
||||
+ # Clang doesn't automatically pick up the architecture, just because
|
||||
+ # we're passing the iOS sysroot below, and we will end up building the
|
||||
+ # test for the host architecture, resulting in linker errors when
|
||||
+ # linking against the iOS libraries. We work around this by passing
|
||||
+ # the architecture explicitly.
|
||||
+ cxx_flags += -arch $$first(QMAKE_APPLE_DEVICE_ARCHS)
|
||||
+ }
|
||||
|
||||
uikit:macx-xcode: \
|
||||
cxx_flags += -isysroot $$sdk_path_device.value
|
|
@ -1,104 +0,0 @@
|
|||
QtGui: Fix duplication of logging category lcQpaFonts
|
||||
|
||||
Move it to qplatformfontdatabase.h.
|
||||
|
||||
Upstream commit:
|
||||
- Qt 6.0: ab01885e48873fb2ad71841a3f1627fe4d9cd835
|
||||
|
||||
--- a/qtbase/src/gui/text/qplatformfontdatabase.cpp
|
||||
+++ b/qtbase/src/gui/text/qplatformfontdatabase.cpp
|
||||
@@ -52,6 +52,8 @@
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
+Q_LOGGING_CATEGORY(lcQpaFonts, "qt.qpa.fonts")
|
||||
+
|
||||
void qt_registerFont(const QString &familyname, const QString &stylename,
|
||||
const QString &foundryname, int weight,
|
||||
QFont::Style style, int stretch, bool antialiased,
|
||||
|
||||
--- a/qtbase/src/gui/text/qplatformfontdatabase.h
|
||||
+++ b/qtbase/src/gui/text/qplatformfontdatabase.h
|
||||
@@ -50,6 +50,7 @@
|
||||
//
|
||||
|
||||
#include <QtGui/qtguiglobal.h>
|
||||
+#include <QtCore/qloggingcategory.h>
|
||||
#include <QtCore/QString>
|
||||
#include <QtCore/QStringList>
|
||||
#include <QtCore/QList>
|
||||
@@ -62,6 +63,7 @@
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
+Q_DECLARE_LOGGING_CATEGORY(lcQpaFonts)
|
||||
|
||||
class QWritingSystemsPrivate;
|
||||
|
||||
|
||||
--- a/qtbase/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm
|
||||
+++ b/qtbase/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm
|
||||
@@ -86,8 +86,6 @@
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
-Q_LOGGING_CATEGORY(lcQpaFonts, "qt.qpa.fonts")
|
||||
-
|
||||
static float SYNTHETIC_ITALIC_SKEW = std::tan(14.f * std::acos(0.f) / 90.f);
|
||||
|
||||
bool QCoreTextFontEngine::ct_getSfntTable(void *user_data, uint tag, uchar *buffer, uint *length)
|
||||
|
||||
--- a/qtbase/src/platformsupport/fontdatabases/mac/qfontengine_coretext_p.h
|
||||
+++ b/qtbase/src/platformsupport/fontdatabases/mac/qfontengine_coretext_p.h
|
||||
@@ -64,8 +64,6 @@
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
-Q_DECLARE_LOGGING_CATEGORY(lcQpaFonts)
|
||||
-
|
||||
class QCoreTextFontEngine : public QFontEngine
|
||||
{
|
||||
Q_GADGET
|
||||
|
||||
--- a/qtbase/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase.cpp
|
||||
+++ b/qtbase/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase.cpp
|
||||
@@ -68,8 +68,6 @@
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
-Q_LOGGING_CATEGORY(lcQpaFonts, "qt.qpa.fonts")
|
||||
-
|
||||
#ifndef QT_NO_DIRECTWRITE
|
||||
// ### fixme: Consider direct linking of dwrite.dll once Windows Vista pre SP2 is dropped (QTBUG-49711)
|
||||
|
||||
|
||||
--- a/qtbase/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase_p.h
|
||||
+++ b/qtbase/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase_p.h
|
||||
@@ -63,8 +63,6 @@
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
-Q_DECLARE_LOGGING_CATEGORY(lcQpaFonts)
|
||||
-
|
||||
class QWindowsFontEngineData
|
||||
{
|
||||
Q_DISABLE_COPY_MOVE(QWindowsFontEngineData)
|
||||
|
||||
--- a/qtbase/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp
|
||||
+++ b/qtbase/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp
|
||||
@@ -40,6 +40,7 @@
|
||||
#include "qgenericunixthemes_p.h"
|
||||
|
||||
#include "qpa/qplatformtheme_p.h"
|
||||
+#include "qpa/qplatformfontdatabase.h"
|
||||
|
||||
#include <QtGui/QPalette>
|
||||
#include <QtGui/QFont>
|
||||
@@ -76,7 +77,6 @@
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
Q_DECLARE_LOGGING_CATEGORY(qLcTray)
|
||||
-Q_LOGGING_CATEGORY(lcQpaFonts, "qt.qpa.fonts")
|
||||
|
||||
ResourceHelper::ResourceHelper()
|
||||
{
|
|
@ -3,8 +3,8 @@ This fixes a non-determinism issue in the asm produced for
|
|||
this function when cross-compiling on x86_64 and aarch64 for
|
||||
the arm-linux-gnueabihf HOST.
|
||||
|
||||
--- a/qtbase/src/3rdparty/double-conversion/fixed-dtoa.h
|
||||
+++ b/qtbase/src/3rdparty/double-conversion/fixed-dtoa.h
|
||||
--- a/qtbase/src/3rdparty/double-conversion/double-conversion/fixed-dtoa.h
|
||||
+++ b/qtbase/src/3rdparty/double-conversion/double-conversion/fixed-dtoa.h
|
||||
@@ -48,9 +48,12 @@ namespace double_conversion {
|
||||
//
|
||||
// This method only works for some parameters. If it can't handle the input it
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue