Ticket #48024: qt5mac-mindiff+review.diff
File qt5mac-mindiff+review.diff, 19.3 KB (added by RJVB (René Bertin), 9 years ago) |
---|
-
Portfile
old new 3 3 4 4 PortSystem 1.0 5 5 6 # RJVB: at the time of the initial request for a Qt5 port, the opinion was voiced and supported by michaelld 7 # that it should be called simply qt5 . I adhere to that opinion because there will be no "non-mac" Qt5 port. 8 # Instead, it is possible to create (and I have implemented) a qt5-x11 subport that installs the xcb platform 9 # plugin in the Qt5 plugin directory. Semantics, but it would be weird to call it qt5-mac-x11 ... 6 10 name qt5-mac 7 11 version 5.4.2 8 12 set branch [join [lrange [split ${version} .] 0 1] .] … … 12 16 maintainers mcalhoun openmaintainer 13 17 license {LGPL-2.1 GPL-3} 14 18 15 homepage http://qt -project.org16 description Qt Tool Kit 19 homepage http://qt.io 20 description Qt Tool Kit ${branch} 17 21 long_description Qt Tool Kit: A cross-platform framework \ 18 22 (headers, data, and libraries) for writing \ 19 23 cross-platform GUI-based applications. 20 24 21 25 distname qt-everywhere-opensource-src-${version} 22 26 23 master_sites http://download.qt -project.org/official_releases/qt/${branch}/${version}/single/27 master_sites http://download.qt.io/official_releases/qt/${branch}/${version}/single/ 24 28 25 29 checksums rmd160 3382c482a99e114560f56a9fe9501b8cabf334a9 \ 26 30 sha256 cfc768c55f0a0cd232bed914a9022528f8f2e50cb010bf0e4f3f62db3dfa17bd … … 73 77 # See https://bugreports.qt.io/browse/QTBUG-34902 74 78 conflicts_build-append qt4-mac 75 79 76 # Kuba states in https://trac.macports.org/ticket/44207#comment:7 80 # Kuba states in https://trac.macports.org/ticket/44207#comment:7 77 81 # "There's no reason to have parallel building disabled. Really." 78 82 #use_parallel_build no 79 83 … … 135 139 set libreplace [string repeat ../ [llength ${qt_list}]][join ${framework_list} /] 136 140 if { ${libreplace} ne "lib" } { 137 141 patchfiles-append patch-shared.diff 138 reinplace "s|__MACPORTS_FRAMWORK_DIR__|${libreplace}|g" ${worksrcpath}/qttools/src/macdeployqt/shared/shared.cpp 142 # RJVB: reinplace should be done in the post-patch 143 post-patch { 144 reinplace "s|__MACPORTS_FRAMWORK_DIR__|${libreplace}|g" ${worksrcpath}/qttools/src/macdeployqt/shared/shared.cpp 145 } 139 146 } 140 147 } 141 148 … … 152 159 #-hostbindir HOSTPREFIX/bin 153 160 #-hostlibdir HOSTPREFIX/lib 154 161 configure.args-append \ 155 -prefix ${ qt_dir} \162 -prefix ${prefix} \ 156 163 -bindir ${qt_bins_dir} \ 157 164 -headerdir ${qt_includes_dir} \ 158 -libdir ${qt_ libs_dir}\165 -libdir ${qt_frameworks_dir} \ 159 166 -archdatadir ${qt_archdata_dir} \ 160 167 -plugindir ${qt_plugins_dir} \ 161 168 -importdir ${qt_imports_dir} \ … … 166 173 -sysconfdir ${qt_sysconf_dir} \ 167 174 -examplesdir ${qt_examples_dir} \ 168 175 -testsdir ${qt_tests_dir} \ 169 -hostdatadir ${qt_host_data_dir} 176 -hostdatadir ${qt_host_data_dir} \ 177 -hostbindir ${qt_bins_dir} \ 178 -hostlibdir ${qt_frameworks_dir} 179 170 180 171 181 # Configure options: 182 # RJVB : -c++11 is the default (when auto-detection detects it's supported) and it 183 # is probably best left implicit (e.g. for building on earlier OS X versions) => remove -c++11 172 184 configure.args-append \ 173 185 -release \ 174 186 -opensource \ … … 177 189 -shared \ 178 190 -largefile \ 179 191 -accessibility 180 181 foreach driver { db2 ibase mysql oci odbc psql sqlite sqlite2 tds } { 192 193 # RJVB/pixilla: the sqlite3 plugin ("sqlite") should be re-absorbed into the main port 194 configure.args-append -system-sqlite 195 depends_lib-append port:sqlite3 196 foreach driver { db2 ibase mysql oci odbc psql sqlite2 tds } { 182 197 configure.args-append -no-sql-${driver} 183 198 } 184 199 200 # RJVB: -qml-debug is the default 185 201 configure.args-append \ 186 202 -qml-debug 187 203 … … 196 212 -force-pkg-config 197 213 198 214 # Third Party Libraries: 215 # RJVB : Qt has no business depending on PulseAudio on OS X; it only pulls in undesirable dependencies (like gnome...) 199 216 configure.args-append \ 200 217 -system-zlib \ 201 218 -no-mtdev \ … … 216 233 -no-gtkstyle 217 234 218 235 # Additional options: 236 # RJVB: what's the point in not optimising qmake? Any increase in configure time (which I don't believe in) 237 # can be compensated by patching the configure script so it builds qmake with -j${build.jobs} . 219 238 configure.args-append \ 220 239 {-make libs} \ 221 240 {-make tools} \ … … 243 262 -no-linuxfb \ 244 263 -no-kms \ 245 264 -no-system-proxies 246 265 247 266 # MacOS/iOS options: 248 267 configure.args-append \ 249 268 -framework … … 252 271 configure.args-append \ 253 272 -sdk [string tolower [join [lrange [split [lindex [split ${configure.sdkroot} "/"] end] "."] 0 end-1] "."]] 254 273 } 255 274 256 275 # configure options that don't show up in configure --help 257 276 configure.args-append \ 258 277 -no-libudev \ … … 288 307 } 289 308 290 309 if { ${subport} eq ${name} } { 310 # RJVB: port:pulseaudio should disappear from this list when Qt is configured *without* PA support 291 311 depends_lib \ 292 312 port:zlib \ 293 313 port:libpng \ … … 325 345 326 346 reinplace "s|${worksrcpath}-${arch}|${worksrcpath}|g" ${dir}${qt_mkspecs_dir}/modules/qt_lib_bootstrap_private.pri 327 347 reinplace "s|macx-clang-32|macx-clang|g" ${dir}${qt_libs_dir}/cmake/Qt5Core/Qt5CoreConfigExtrasMkspecDir.cmake 328 329 348 349 330 350 if { [variant_isset examples] } { 331 351 reinplace "s|${worksrcpath}-${arch}|${worksrcpath}|g" ${dir}${qt_examples_dir}/declarative/tutorials/gettingStarted/parts/part5/filedialog/Makefile 332 352 reinplace -E "/\\w*-arch \\\\/d" ${dir}${qt_examples_dir}/declarative/tutorials/gettingStarted/parts/part5/filedialog/Makefile … … 358 378 359 379 post-destroot { 360 380 # see #44204 361 foreach f [glob -nocomplain -tails -directory ${destroot}${qt_libs_dir} *.framework] { 362 set framework [file rootname ${f}] 381 # RJVB: use the code below ">>>..." instead of this block, which fails to populate qt_includes_dir completely. 382 # foreach f [glob -nocomplain -tails -directory ${destroot}${qt_libs_dir} *.framework] { 383 # set framework [file rootname ${f}] 384 # 385 # set include_list [split ${qt_includes_dir} '/'] 386 # set framework_list [split ${qt_libs_dir} '/'] 387 # 388 # while {[llength ${include_list}] && [llength ${framework_list}]} { 389 # set var_include [lindex $include_list 0] 390 # set var_framework [lindex $framework_list 0] 391 # 392 # if { ${var_include} ne ${var_framework} } { 393 # break 394 # } 395 # 396 # # remove first element from list 397 # set include_list [lreplace ${include_list} 0 0] 398 # set framework_list [lreplace ${framework_list} 0 0] 399 # } 400 # 401 # ln -s [string repeat ../ [llength ${include_list}]][join ${framework_list} /]/${f}/Headers ${destroot}${qt_includes_dir}/${framework} 402 # } 403 404 # RJVB: tried and true logic copied from the qt4-mac port 405 # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 406 # move items out of the Frameworks directory that are more appropriate to lib directory 407 xinstall -m 775 -d ${destroot}${qt_cmake_module_dir} 408 foreach d [glob -tails -nocomplain -directory ${destroot}${qt_frameworks_dir}/cmake *] { 409 xinstall -m 775 -d ${destroot}${qt_cmake_module_dir}/${d} 410 foreach f [glob -nocomplain -directory ${destroot}${qt_frameworks_dir}/cmake/${d} *.cmake] { 411 # ${qt_frameworks_dir} is ${qt_dir}/Library/Frameworks while 412 # ${qt_libs_dir} is ${qt_dir}/lib 413 # unless modified, cmake files will point to a directory that is too high in the directory hierarchy 414 reinplace "s|/../../../../|/../../../${qt_dir_rel}/|g" ${f} 415 file rename ${f} ${destroot}${qt_cmake_module_dir}/${d}/ 416 } 417 } 418 set qt_vers [split ${version} "."] 419 set qt_major [lindex ${qt_vers} 0] 420 set qt_minor [lindex ${qt_vers} 1] 421 set qt_patch [lindex ${qt_vers} 2] 422 423 # link includes and libraries for each actual installed framework 424 # make sure that the target directories exist 425 exec mkdir -p ${destroot}${qt_includes_dir} ${destroot}${qt_libs_dir} 426 foreach fixfile [exec find ${destroot}${qt_frameworks_dir} \ 427 -name "*.framework" | \ 428 sed -e "s@${destroot}@@g"] { 429 430 set tf_full [strsed ${fixfile} {s@\\.framework@@}] 431 set tf [strsed ${tf_full} {g@.*\/@@}] 432 433 # special for QtWebKit entries 434 set t_minor ${qt_minor} 435 set is_QtWebKit 0 436 if {[string compare ${tf} QtWebKit] == 0} { 437 set t_minor 9 438 set is_QtWebKit 1 439 } 440 441 # link headers into ${qt_includes_dir}, removing directories 442 # if they are already there first 443 set inc_file ${destroot}${qt_includes_dir}/${tf} 444 if {[file exists ${inc_file}]} { 445 ui_msg "*Warning* replacing directory ${inc_file} with a symlink to ${tf_full}.framework/Headers!" 446 file delete -force ${inc_file} 447 } 448 ln -s ${tf_full}.framework/Headers ${inc_file} 449 450 # link libraries into ${qt_libs_dir}, all 4 number variants 451 set dr_qt_libs_dir ${destroot}${qt_libs_dir} 452 ln -s ${tf_full}.framework/${tf} ${dr_qt_libs_dir}/lib${tf}.dylib 453 ln -s ${tf_full}.framework/${tf} ${dr_qt_libs_dir}/lib${tf}.${qt_major}.dylib 454 ln -s ${tf_full}.framework/${tf} ${dr_qt_libs_dir}/lib${tf}.${qt_major}.${t_minor}.dylib 455 ln -s ${tf_full}.framework/${tf} ${dr_qt_libs_dir}/lib${tf}.${qt_major}.${t_minor}.${qt_patch}.dylib 456 457 # copy .prl file, then correct it for library usage 458 copy ${destroot}${tf_full}.framework/${tf}.prl ${dr_qt_libs_dir}/lib${tf}.prl 459 460 # fix TARGET in .prl file 461 reinplace "/QMAKE_PRL_TARGET/s|Qt\\(\[^ \]*\\)|libQt\\1.${qt_major}.${t_minor}.${qt_patch}.dylib|" ${dr_qt_libs_dir}/lib${tf}.prl 462 463 # fix PRL_LIBS -F -> -L in .prl file 464 reinplace "/QMAKE_PRL_LIBS/s|-F${qt_frameworks_dir}|-L${qt_libs_dir}|" ${dr_qt_libs_dir}/lib${tf}.prl 465 466 # fix "-framework Qt*" -> "-lQt*" in .prl file 467 reinplace "/QMAKE_PRL_LIBS/s|-framework Qt|-lQt|g" \ 468 ${dr_qt_libs_dir}/lib${tf}.prl 469 470 # remove the QMAKE_PRL_BUILD_DIR line from the .prl file 471 reinplace "/QMAKE_PRL_BUILD_DIR/d" ${dr_qt_libs_dir}/lib${tf}.prl 363 472 364 set include_list [split ${qt_includes_dir} '/'] 365 set framework_list [split ${qt_libs_dir} '/'] 473 # deal with debug files 474 # RJVB: this is the only block I never tested 475 if {[variant_isset debug]} { 366 476 367 while {[llength ${include_list}] && [llength ${framework_list}]} {368 set var_include [lindex $include_list 0]369 set var_framework [lindex $framework_list 0]477 # but not if QtWebKit and +universal, since that one does 478 # not exist (the 32-bit version of the debug library is 479 # larger than fits into the 32-bit filespace). 370 480 371 if { ${var_include} ne ${var_framework} } { 372 break 481 if {[variant_isset debug] && ${is_QtWebKit}} { 482 continue 483 } 484 485 # link libraries into ${qt_libs_dir}, all 4 number variants 486 ln -s ${tf_full}.framework/${tf}_debug ${dr_qt_libs_dir}/lib${tf}_debug.dylib 487 ln -s ${tf_full}.framework/${tf}_debug ${dr_qt_libs_dir}/lib${tf}_debug.${qt_major}.dylib 488 ln -s ${tf_full}.framework/${tf}_debug ${dr_qt_libs_dir}/lib${tf}_debug.${qt_major}.${t_minor}.dylib 489 ln -s ${tf_full}.framework/${tf}_debug ${dr_qt_libs_dir}/lib${tf}_debug.${qt_major}.${t_minor}.${qt_patch}.dylib 490 491 # copy .prl file, then correct it for library usage 492 copy ${destroot}${tf_full}.framework/${tf}_debug.prl ${dr_qt_libs_dir}/lib${tf}_debug.prl 493 494 # fix TARGET in .prl file 495 reinplace "/QMAKE_PRL_TARGET/s|Qt\\(\[^ \]*\\)|libQt\\1.${qt_major}.${t_minor}.${qt_patch}.dylib|" ${dr_qt_libs_dir}/lib${tf}_debug.prl 496 497 # fix PRL_LIBS -F -> -L in .prl file 498 reinplace "/QMAKE_PRL_LIBS/s|-F${qt_frameworks_dir}|-L${qt_libs_dir}|" ${dr_qt_libs_dir}/lib${tf}_debug.prl 499 500 # fix "-framework Qt*" -> "-lQt*_debug" in .prl file 501 reinplace "/QMAKE_PRL_LIBS/s|-framework Qt\\(\[^ \]*\\)|-lQt\\1_debug|g" ${dr_qt_libs_dir}/lib${tf}_debug.prl 502 } 503 } 504 # RJVB: spoiler: reference to the qt5*-kde subport 505 if {${subport} eq ${name} || ${subport} eq "${name}-kde"} { 506 ln -s ${qt_qmake_cmd} ${destroot}/${prefix}/bin/qmake-qt${qt_major} 507 ln -s ${qt_moc_cmd} ${destroot}/${prefix}/bin/moc-qt${qt_major} 508 ln -s ${qt_uic_cmd} ${destroot}/${prefix}/bin/uic-qt${qt_major} 509 ln -s ${qt_lrelease_cmd} ${destroot}/${prefix}/bin/lrelease-qt${qt_major} 510 } 511 if {${qt_pkg_config_dir} ne "${qt_frameworks_dir}/pkgconfig"} { 512 # move the pkgconfig files to their assigned location 513 foreach f [glob -nocomplain -directory ${destroot}${qt_frameworks_dir}/pkgconfig *.pc] { 514 file rename ${f} ${destroot}${qt_pkg_config_dir} 515 } 516 } 517 if {${qt_libs_dir} ne ${qt_frameworks_dir}} { 518 xinstall -m 775 -d ${destroot}${qt_libs_dir}/ 519 foreach f [glob -nocomplain -directory ${destroot}${qt_frameworks_dir} *.{a,prl,la}] { 520 file rename ${f} ${destroot}${qt_libs_dir}/ 373 521 } 374 522 375 # remove first element from list 376 set include_list [lreplace ${include_list} 0 0] 377 set framework_list [lreplace ${framework_list} 0 0] 523 # link back the static libraries to where some Qt components expect them: 524 foreach f [exec find ${destroot}${qt_libs_dir} \ 525 -name "*.a" | \ 526 sed -e "s@${destroot}@@g"] { 527 ln -s ${f} ${destroot}${qt_frameworks_dir}/ 528 } 529 # certain applications might expect to find the following .prl files in ${qt_frameworks_dir} 530 foreach fixfile { libQt5OpenGLExtensions_debug.prl libQt5PlatformSupport_debug.prl \ 531 libQt5QmlDevTools.prl libQt5UiTools.prl libQt5UiTools_debug.prl } { 532 if {[file exists ${destroot}${qt_libs_dir}/${fixfile}]} { 533 ln -s ${qt_libs_dir}/${fixfile} ${destroot}${qt_frameworks_dir}/${fixfile} 534 } 535 } 378 536 } 379 537 380 ln -s [string repeat ../ [llength ${include_list}]][join ${framework_list} /]/${f}/Headers ${destroot}${qt_includes_dir}/${framework} 381 } 538 # Move .apps into the applications_dir, and link each .apps' 539 # executable back into ${qt_bins_dir} 540 set dr_qt_apps_dir ${destroot}${qt_apps_dir} 541 set dr_qt_bins_dir ${destroot}${qt_bins_dir} 542 xinstall -m 755 -d ${dr_qt_apps_dir} 543 foreach app [glob -nocomplain ${dr_qt_bins_dir}/*.app] { 544 # remove the leading stuff 545 set app [lindex [split ${app} /] end] 546 # move the .app 547 move ${dr_qt_bins_dir}/${app} ${dr_qt_apps_dir} 548 # link it back 549 ln -s ${qt_apps_dir}/${app} ${dr_qt_bins_dir} 550 # provide a proxy to the app's executable; symlinks won't 551 # be accepted by qtchooser if the user has that port installed. 552 # RJVB: requires ${filespath}/appProxy.sh 553 # set texe [strsed ${app} {g@\.app@@}] 554 # set appProxy ${dr_qt_bins_dir}/[string tolower ${texe}] 555 # copy ${filespath}/appProxy.sh ${appProxy} 556 # reinplace "s|@BUNDLEEXEC@|${qt_apps_dir}/${app}/Contents/MacOS/${texe}|g" ${appProxy} 557 558 } 559 if {[file exists ${destroot}${qt_mkspecs_dir}/qmodule.pri]} { 560 # clean up the generated mkspecs/qmodule.pri: 561 # undo any symlink normalisation that introduced the clang version number into QMAKE_CC/CXX (e.g. clang++-mp-3.5) 562 reinplace "s|bin/clang-mp-.*|bin/clang|g" ${destroot}${qt_mkspecs_dir}/qmodule.pri 563 reinplace "s|bin/clang\+\+-mp-.*|bin/clang\+\+|g" ${destroot}${qt_mkspecs_dir}/qmodule.pri 564 } 565 if {[file exists ${destroot}${qt_mkspecs_dir}/qmodule.pri]} { 566 # if the user used configure.optflags="-something" make sure that gets added to compiler options qmake 567 # determines, rather than replacing all of those 568 reinplace "s|QMAKE_CFLAGS = |QMAKE_CFLAGS \+= |g" ${destroot}${qt_mkspecs_dir}/qmodule.pri 569 reinplace "s|QMAKE_CXXFLAGS = |QMAKE_CXXFLAGS \+= |g" ${destroot}${qt_mkspecs_dir}/qmodule.pri 570 } 571 #<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 382 572 } 383 573 384 574 variant tests description {Enable tests} { … … 394 584 } 395 585 } 396 586 587 # RJVB: the docs subport should be renamed such that it comes last during an `upgrade outdated` 397 588 subport ${name}-docs { 398 589 depends_lib-append \ 399 590 path:${qt_bins_dir}/qdoc:${name} \ … … 422 613 423 614 # See http://doc.qt.io/qt-5/sql-driver.html for info on building SQL Database Drivers 424 615 616 # RJVB/pixilla: applications built by the main port depend on the sqlite3 plugin. It should be built 617 # with the main port and not be a separate subport. 425 618 subport ${name}-sqlite3-plugin { 619 replaced_by ${name} 620 PortGroup obsolete 1.0 426 621 PortGroup qmake5 1.0 427 622 428 623 depends_lib-append port:sqlite3 … … 468 663 } 469 664 470 665 livecheck.type regex 471 livecheck.url http:// qt-project.org/downloads472 livecheck.regex "Qt (5(?:\\.\\d+)*) for Mac"666 livecheck.url http://download.qt.io/archive/qt/5.4/ 667 livecheck.regex (\\d+(\\.\\d+)+)