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