2022-07-02 06:48:36 +08:00
### Steps to update the qt6 ports
## 1. Change QT_VERSION below to the new version
## 2. Set QT_UPDATE_VERSION to 1
## 3. Add any new Qt modules to QT_PORTS
## 4. Run a build of `qtbase`
## 5. Fix any intermediate failures by adding the module into QT_FROM_GITHUB, QT_FROM_GITHUB_BRANCH, or QT_FROM_QT_GIT as appropriate
## 6. The build should fail with "Done downloading version and emitting hashes." This will have changed out the vcpkg.json versions of the qt ports and rewritten qt_port_data.cmake
## 7. Set QT_UPDATE_VERSION back to 0
2022-09-16 03:30:09 +08:00
set ( QT_VERSION 6.3.2 )
2022-07-02 06:48:36 +08:00
set ( QT_UPDATE_VERSION 0 )
if ( PORT MATCHES "(qtquickcontrols2)" )
set ( VCPKG_POLICY_EMPTY_PACKAGE enabled )
return ( )
endif ( )
if ( PORT MATCHES "qtlocation" ) # No 6.3.1 tag/branch
set ( QT_VERSION 6.3.0 )
endif ( )
### Setting up the git tag.
set ( QT_PORTS qt
q t b a s e
q t t o o l s
q t d e c l a r a t i v e
q t s v g
q t 5 c o m p a t
q t s h a d e r t o o l s
q t q u i c k t i m e l i n e
q t q u i c k 3 d
q t t r a n s l a t i o n s
q t w a y l a n d
q t d o c
q t c o a p
q t o p c u a
q t i m a g e f o r m a t s
q t m q t t
2022-10-12 16:21:25 +08:00
q t n e t w o r k a u t h
q t 3 d )
2022-07-02 06:48:36 +08:00
# qtquickcontrols2 -> moved into qtdeclarative
if ( QT_VERSION VERSION_GREATER_EQUAL 6.1 )
list ( APPEND QT_PORTS
## New in 6.1
q t a c t i v e q t
q t d a t a v i s 3 d
q t d e v i c e u t i l i t i e s
q t l o t t i e
q t s c x m l
q t v i r t u a l k e y b o a r d
q t c h a r t s )
endif ( )
if ( QT_VERSION VERSION_GREATER_EQUAL 6.2 )
list ( APPEND QT_PORTS
## New in 6.2
q t c o n n e c t i v i t y
q t p o s i t i o n i n g
q t l o c a t i o n
q t m u l t i m e d i a
q t r e m o t e o b j e c t s
q t s e n s o r s
q t s e r i a l b u s
q t s e r i a l p o r t
q t w e b c h a n n e l
q t w e b e n g i n e
q t w e b s o c k e t s
q t w e b v i e w )
endif ( )
if ( QT_VERSION VERSION_GREATER_EQUAL 6.2.2 )
list ( APPEND QT_PORTS
## New in 6.2.2
q t i n t e r f a c e f r a m e w o r k
q t a p p l i c a t i o n m a n a g e r )
endif ( )
# 1. By default, modules come from the official release
# 2. These modules are mirrored to github and have tags matching the release
set ( QT_FROM_GITHUB qtcoap qtopcua qtmqtt qtapplicationmanager )
# 3. These modules are mirrored to github and have branches matching the release
set ( QT_FROM_GITHUB_BRANCH qtdeviceutilities qtlocation )
# 4. These modules are not mirrored to github and not part of the release
set ( QT_FROM_QT_GIT qtinterfaceframework )
function ( qt_get_url_filename qt_port out_url out_filename )
if ( "${qt_port}" IN_LIST QT_FROM_GITHUB )
set ( url "https://github.com/qt/${qt_port}/archive/v${QT_VERSION}.tar.gz" )
set ( filename "qt-${qt_port}-v${QT_VERSION}.tar.gz" )
elseif ( "${qt_port}" IN_LIST QT_FROM_GITHUB_BRANCH )
set ( url "https://github.com/qt/${qt_port}/archive/${QT_VERSION}.tar.gz" )
set ( filename "qt-${qt_port}-${QT_VERSION}.tar.gz" )
else ( )
string ( SUBSTRING "${QT_VERSION}" 0 3 qt_major_minor )
set ( url "https://download.qt.io/archive/qt/${qt_major_minor}/${QT_VERSION}/submodules/${qt_port}-everywhere-src-${QT_VERSION}.tar.xz" )
set ( filename "${qt_port}-everywhere-src-${QT_VERSION}.tar.xz" )
endif ( )
set ( ${ out_url } "${url}" PARENT_SCOPE )
set ( ${ out_filename } "${filename}" PARENT_SCOPE )
endfunction ( )
if ( QT_UPDATE_VERSION )
if ( NOT PORT STREQUAL "qtbase" )
message ( FATAL_ERROR "QT_UPDATE_VERSION must be used from the root 'qtbase' package" )
endif ( )
set ( VCPKG_USE_HEAD_VERSION 1 )
set ( msg "" CACHE INTERNAL "" )
foreach ( qt_port IN LISTS QT_PORTS )
set ( port_json "${CMAKE_CURRENT_LIST_DIR}/../../${qt_port}/vcpkg.json" )
file ( READ "${port_json}" _control_contents )
string ( REGEX REPLACE "\" version(-(string|semver ) ) ? \ " : [ ^ \ n ] + \ n " " \ " v e r s i o n \ " : \ " $ { Q T _ V E R S I O N } \ " , \ n " _ c o n t r o l _ c o n t e n t s " $ { _ c o n t r o l _ c o n t e n t s } " )
string ( REGEX REPLACE "\" port-version\ ": [^\n]+\n" "" _control_contents "${_control_contents}" )
file ( WRITE "${port_json}" "${_control_contents}" )
if ( qt_port STREQUAL "qt" )
continue ( )
endif ( )
if ( "${qt_port}" IN_LIST QT_FROM_QT_GIT )
vcpkg_find_acquire_program ( GIT )
execute_process (
C O M M A N D " $ { G I T } " l s - r e m o t e - t " h t t p s : / / c o d e . q t . i o / c g i t / q t / $ { q t _ p o r t } . g i t " " v $ { Q T _ V E R S I O N } "
O U T P U T _ V A R I A B L E o u t
)
string ( SUBSTRING "${out}" 0 40 tag_sha )
string ( APPEND msg "set(${qt_port}_REF ${tag_sha})\n" )
else ( )
qt_get_url_filename ( "${qt_port}" url filename )
vcpkg_download_distfile ( archive
U R L S " $ { u r l } "
F I L E N A M E " $ { f i l e n a m e } "
S K I P _ S H A 5 1 2
)
file ( SHA512 "${archive}" hash )
string ( APPEND msg "set(${qt_port}_HASH \" ${ hash } \")\n")
endif ( )
endforeach ( )
message ( "${msg}" )
file ( WRITE "${CMAKE_CURRENT_LIST_DIR}/qt_port_data_new.cmake" "${msg}" )
message ( FATAL_ERROR "Done downloading version and emitting hashes." )
endif ( )
include ( "${CMAKE_CURRENT_LIST_DIR}/qt_port_data.cmake" )