Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
qt5*: add openssl variant
Some users might not want to use OpenSSL because
of licensing issues with GPL.
See https://lists.macports.org/pipermail/macports-dev/2017-January/thread.html#35234
See https://trac.macports.org/ticket/53369
See http://doc.qt.io/qt-5/qtnetwork-index.html#licenses-and-attributions

Some users may have LibreSSL installed, which conflicts with OpenSSL
and is currently incompatible with Qt.
See https://trac.macports.org/ticket/51358
  • Loading branch information
MarcusCalhoun-Lopez committed Feb 17, 2017
1 parent df3cc8d commit c7a7730
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 14 deletions.
37 changes: 30 additions & 7 deletions aqua/qt5/Portfile
Expand Up @@ -46,9 +46,6 @@ foreach test_qt_name ${available_qt_versions} {
}
}

# see https://trac.macports.org/ticket/51358
conflicts-append libressl libressl-devel

############################################################################### Modules Not Considered
#
# No qtactiveqt (Windows Only)
Expand Down Expand Up @@ -133,12 +130,12 @@ array set modules {
55b2d2d9474cb565e872eed1ab0e8e01bf5031a8
2f6eae93c5d982fe0a387a01aeb3435571433e23e9d9d9246741faf51f1ee787
""
"port:zlib port:libpng port:jpeg port:fontconfig port:freetype path:bin/dbus-daemon:dbus path:lib/libssl.dylib:openssl port:tiff port:libmng path:lib/pkgconfig/glib-2.0.pc:glib2 port:icu port:pcre port:libiconv port:harfbuzz"
"port:zlib port:libpng port:jpeg port:fontconfig port:freetype path:bin/dbus-daemon:dbus port:tiff port:libmng path:lib/pkgconfig/glib-2.0.pc:glib2 port:icu port:pcre port:libiconv port:harfbuzz"
""
{"Qt Gui" "Qt Widgets" "Qt Print Support" "Qt OpenGL" "Qt Core" "Qt XML" "Qt SQL" "Qt Network" "Qt Test" "Qt D-Bus" "Qt Concurrent" "Qt Platform Headers"}
""
"variant overrides: ~docs"
"revision 0"
"revision 1"
"License: "
}
qtcanvas3d {
Expand Down Expand Up @@ -610,6 +607,17 @@ foreach {module module_info} [array get modules] {
}
}

# Qt uses TLS protocols introduced in OS X 10.8
# see https://developer.apple.com/reference/security/sslprotocol/ktlsprotocol11
# see https://developer.apple.com/reference/security/sslprotocol?language=objc
pre-fetch {
if { ${os.major} == 11 && ![variant_isset openssl] } {
ui_error "using Secure Transport requires OS X 10.8 or later"
ui_error "please use openssl variant"
return -code error "incompatible variant choice"
}
}

# https://codereview.qt-project.org/#/c/141654/
patchfiles-append patch-add_sdk.diff

Expand Down Expand Up @@ -641,6 +649,11 @@ foreach {module module_info} [array get modules] {
# When testing, ensure that a universal object file is not inadvertently created.
patchfiles-append patch-machtest.diff

# prior to 10.8, CFNetwork was part of CoreServices
if { ${os.major} < 12 } {
patchfiles-append patch-qnetworkproxy_mac.cpp.diff

This comment has been minimized.

Copy link
@RJVB

RJVB Feb 17, 2017

Contributor

Patchfile is missing, but maybe it's never used because the new pre-fetch check errors out on Darwin < 12 (Darwin == 11, should probably be true on < 11 too)?

}

#-----------------------------------------------------------------------------
# qtbase is used for:
# 1) building qtbase
Expand Down Expand Up @@ -792,7 +805,7 @@ foreach {module module_info} [array get modules] {
-system-libjpeg \
-system-freetype \
-system-harfbuzz \
-openssl-linked \
-no-openssl \
-no-libproxy \
-system-pcre \
--disable-xcb \
Expand Down Expand Up @@ -843,7 +856,8 @@ foreach {module module_info} [array get modules] {

# MacOS/iOS options:
configure.args-append \
-framework
-framework \
-securetransport

if {${configure.sdkroot} ne ""} {
configure.args-append \
Expand Down Expand Up @@ -928,6 +942,15 @@ foreach {module module_info} [array get modules] {
configure.args-replace -no-gstreamer {-gstreamer 1.0}
}

variant openssl description {Use OpenSSL instead of Secure Transport} {
configure.args-delete -securetransport -no-openssl
configure.args-append -openssl-linked
depends_lib-append path:lib/libssl.dylib:openssl
# see https://trac.macports.org/ticket/51358
conflicts-append libressl libressl-devel
}
default_variants-append +openssl

} else {
# these subports use qmake
PortGroup qmake5 1.0
Expand Down
32 changes: 25 additions & 7 deletions aqua/qt55/Portfile
Expand Up @@ -45,9 +45,6 @@ foreach test_qt_name ${available_qt_versions} {
}
}

# see https://trac.macports.org/ticket/51358
conflicts-append libressl libressl-devel

############################################################################### Modules Not Considered
#
# No qtactiveqt (Windows Only)
Expand Down Expand Up @@ -132,12 +129,12 @@ array set modules {
ce4bccd0703aaf8d904fbecd1f334ef13d698a44
dfa4e8a4d7e4c6b69285e7e8833eeecd819987e1bdbe5baa6b6facd4420de916
""
"port:zlib port:libpng port:jpeg port:fontconfig port:freetype path:bin/dbus-daemon:dbus path:lib/libssl.dylib:openssl port:tiff port:libmng path:lib/pkgconfig/glib-2.0.pc:glib2 port:icu port:pcre port:libiconv port:harfbuzz"
"port:zlib port:libpng port:jpeg port:fontconfig port:freetype path:bin/dbus-daemon:dbus port:tiff port:libmng path:lib/pkgconfig/glib-2.0.pc:glib2 port:icu port:pcre port:libiconv port:harfbuzz"
""
{"Qt Gui" "Qt Widgets" "Qt Print Support" "Qt OpenGL" "Qt Core" "Qt XML" "Qt SQL" "Qt Network" "Qt Test" "Qt D-Bus" "Qt Concurrent" "Qt Platform Headers"}
""
"variant overrides: ~docs"
"revision 0"
"revision 1"
"License: "
}
qtcanvas3d {
Expand Down Expand Up @@ -592,6 +589,17 @@ foreach {module module_info} [array get modules] {
}
}

# Qt uses TLS protocols introduced in OS X 10.8
# see https://developer.apple.com/reference/security/sslprotocol/ktlsprotocol11
# see https://developer.apple.com/reference/security/sslprotocol?language=objc
pre-fetch {
if { ${os.major} == 11 && ![variant_isset openssl] } {
ui_error "using Secure Transport requires OS X 10.8 or later"
ui_error "please use openssl variant"
return -code error "incompatible variant choice"
}
}

# https://codereview.qt-project.org/#/c/141654/
patchfiles-append patch-add_sdk.diff

Expand Down Expand Up @@ -785,7 +793,7 @@ foreach {module module_info} [array get modules] {
-system-libjpeg \
-system-freetype \
-system-harfbuzz \
-openssl-linked \
-no-openssl \
-no-libproxy \
-system-pcre \
--disable-xcb \
Expand Down Expand Up @@ -834,7 +842,8 @@ foreach {module module_info} [array get modules] {

# MacOS/iOS options:
configure.args-append \
-framework
-framework \
-securetransport

if {${configure.sdkroot} ne ""} {
configure.args-append \
Expand Down Expand Up @@ -919,6 +928,15 @@ foreach {module module_info} [array get modules] {
configure.args-replace -no-gstreamer {-gstreamer 1.0}
}

variant openssl description {Use OpenSSL instead of Secure Transport} {
configure.args-delete -securetransport -no-openssl
configure.args-append -openssl-linked
depends_lib-append path:lib/libssl.dylib:openssl
# see https://trac.macports.org/ticket/51358
conflicts-append libressl libressl-devel
}
default_variants-append +openssl

} else {
# these subports use qmake
PortGroup qmake5 1.0
Expand Down

0 comments on commit c7a7730

Please sign in to comment.