Skip to content
Permalink
Browse files

qmake-1.0 PG: sync debug variant generation with qmake5-1.0 PG.

Adds a new option qt4.debug_variant - defaulting to yes, but the
PG-generated debug variant can be disabled by setting it to no.

Note that the variant checking code can stay in pre-extract, since it's
only checking information available in the database, not any actual file
location. Otherwise, it would have needed to be moved from pre-extract
to pre-configure in order to work correctly in trace mode, or if we ever
decide to implement something like background pre-fetching and
-extraction of ports.

See: https://trac.macports.org/ticket/58229
  • Loading branch information
Ionic committed Apr 24, 2019
1 parent 63f472a commit 91b6be4b947ec0153f75d8eeab99597f23b37130
Showing with 30 additions and 5 deletions.
  1. +30 −5 _resources/port1.0/group/qmake-1.0.tcl
@@ -6,6 +6,10 @@
# PortGroup qmake 1.0

PortGroup qt4 1.0
PortGroup active_variants 1.1

options qt4.debug_variant
default qt4.debug_variant yes

pre-configure {
configure.cmd ${qt_qmake_cmd}
@@ -28,8 +32,17 @@ pre-configure {
}
}

variant debug description "Enable debug binaries" {
configure.pre_args-append "CONFIG+=debug"
# add debug variant if one does not exist and one is requested via qt4.debug_variant
# variant is added in eval_variants so that qt4.debug_variant can be set anywhere in the Portfile
rename ::eval_variants ::real_qmake_eval_variants
proc eval_variants {variations} {
global qt4.debug_variant
if { ![variant_exists debug] && [tbool qt4.debug_variant] } {
variant debug description {Build both release and debug binaries and libraries} {
configure.pre_args-append "CONFIG+=debug"
}
}
uplevel ::real_qmake_eval_variants $variations
}

# check for +debug variant of this port, and make sure Qt was
@@ -39,10 +52,22 @@ platform darwin {
if {[variant_exists debug] && \
[variant_isset debug] && \
![info exists building_qt4]} {
if {![file exists ${qt_frameworks_dir}/QtCore.framework/QtCore_debug]} {
if {![catch {set result [active_variants "qt4-mac" "debug" ""]}]} {
if {$result} {
# code to be executed if $depspec is active with at least all variants in
# $required and none from $forbidden
} else {
# code to be executed if $depspec is active, but either not with all
# variants in $required or any variant in $forbidden
return -code error "\n\nERROR:\n\
In order to install this port with variant +debug,\
qt4-mac must also be installed with variant +debug.\n"
}
} else {
# code to be executed if $depspec isn't active
return -code error "\n\nERROR:\n\
In order to install this port as +debug,
Qt4 must also be installed with +debug.\n"
Requested to install this port with variant +debug,\
but qt4-mac is not installed or installed but not active.\n"
}
}
}

0 comments on commit 91b6be4

Please sign in to comment.
You can’t perform that action at this time.