Skip to content
Permalink
Browse files

cmake: redo +pythonXY and add dependencies on py3Y-sphinxcontrib-[var…

  • Loading branch information
michaelld committed Apr 15, 2019
1 parent 93bee75 commit f850901e748132e6ae042d646afec2266ff4652b
Showing with 42 additions and 39 deletions.
  1. +42 −39 devel/cmake/Portfile
@@ -51,7 +51,7 @@ if {${subport} eq ${name}} {
checksums rmd160 2c883e9858a2d3d1c360a094ccd9c7bf38fdaa7f \
sha256 a3cbf562b99270c0ff192f692139e98c605f292bfdbc04d70da0309a5358e71e \
size 8850106
revision 0
revision 1

master_sites ${homepage}/files/v${branch}/
conflicts cmake-devel
@@ -80,7 +80,7 @@ if {${subport} eq ${name}} {
checksums rmd160 44f730f91005984e95f608c9e59dbb1d2a40288e \
sha256 5f8d7f0b2f0369152ca4ef49cff1fa07d9c3faf792b188d1741440d6ab3bf68a \
size 6878866
revision 0
revision 1

use_bzip2 yes
master_sites https://gitlab.kitware.com/cmake/cmake/repository/archive${extract.suffix}?ref=${commit}&
@@ -200,17 +200,6 @@ post-patch {
# used, because the PYTHON_EXECUTABLE is used only when building
# docs -- so, when not building docs its setting makes no difference.

if {[variant_isset python27]} {
set PYTHON_VERSION_WITH_DOT "2.7"
} elseif {[variant_isset python34]} {
set PYTHON_VERSION_WITH_DOT "3.4"
} elseif {[variant_isset python35]} {
set PYTHON_VERSION_WITH_DOT "3.5"
} elseif {[variant_isset python36]} {
set PYTHON_VERSION_WITH_DOT "3.6"
} else {
set PYTHON_VERSION_WITH_DOT "3.7"
}
reinplace "s|__PYTHON_VERSION_WITH_DOT__|${PYTHON_VERSION_WITH_DOT}|g" ${worksrcpath}/macports.cmake

This comment has been minimized.

Copy link
@cjones051073

cjones051073 Apr 15, 2019

Contributor

you have removed the lines that set PYTHON_VERSION_WITH_DOT but still try and refer to it.

This comment has been minimized.

Copy link
@enekochan

enekochan Apr 15, 2019

you have removed the lines that set PYTHON_VERSION_WITH_DOT but still try and refer to it.

This is the error I get while applying patches:

Error: Failed to patch cmake: can't read "PYTHON_VERSION_WITH_DOT": no such variable

}

@@ -273,48 +262,47 @@ if {[variant_isset gui]} {
}

variant docs description {Build documentation: HTML and manpages} {

configure.args-append \
--mandir=share/man \
--sphinx-man \
--sphinx-html
--sphinx-html \
--sphinx-build=${prefix}/bin/sphinx-build-${PYTHON_VERSION_WITH_DOT}

depends_build-append \
port:py${PYTHON_VERSION_NO_DOT}-sphinx

# these are required for Py3X, but not Py27
if {${PYTHON_VERSION_NO_DOT} ne "27"} {
depends_build-append \
port:py${PYTHON_VERSION_NO_DOT}-sphinxcontrib-applehelp \
port:py${PYTHON_VERSION_NO_DOT}-sphinxcontrib-devhelp \
port:py${PYTHON_VERSION_NO_DOT}-sphinxcontrib-htmlhelp \
port:py${PYTHON_VERSION_NO_DOT}-sphinxcontrib-jsmath \
port:py${PYTHON_VERSION_NO_DOT}-sphinxcontrib-qthelp \
port:py${PYTHON_VERSION_NO_DOT}-sphinxcontrib-serializinghtml \
port:py${PYTHON_VERSION_NO_DOT}-sphinxcontrib-websupport
}
}

variant python27 conflicts python34 python35 python36 requires docs \
description {Build documentation using Sphinx from Python 2.7} {
depends_build-append port:py27-sphinx
configure.args-append \
--sphinx-build=${prefix}/bin/sphinx-build-2.7
}
description {Build documentation using Sphinx from Python 2.7} {}

variant python34 conflicts python27 python35 python36 python37 requires docs \
description {Build documentation using Sphinx from Python 3.4} {
depends_build-append port:py34-sphinx
configure.args-append \
--sphinx-build=${prefix}/bin/sphinx-build-3.4
}
description {Build documentation using Sphinx from Python 3.4} {}

variant python35 conflicts python27 python34 python36 python37 requires docs \
description {Build documentation using Sphinx from Python 3.5} {
depends_build-append port:py35-sphinx
configure.args-append \
--sphinx-build=${prefix}/bin/sphinx-build-3.5
}
description {Build documentation using Sphinx from Python 3.5} {}

variant python36 conflicts python27 python34 python35 python37 requires docs \
description {Build documentation using Sphinx from Python 3.6} {
depends_build-append port:py36-sphinx
configure.args-append \
--sphinx-build=${prefix}/bin/sphinx-build-3.6
}
description {Build documentation using Sphinx from Python 3.6} {}

variant python37 conflicts python27 python34 python35 python36 requires docs \
description {Build documentation using Sphinx from Python 3.7} {
depends_build-append port:py37-sphinx
configure.args-append \
--sphinx-build=${prefix}/bin/sphinx-build-3.7
}
description {Build documentation using Sphinx from Python 3.7} {}

if {[variant_isset docs]} {

# default Python is 2.7
if {![variant_isset python27] &&
![variant_isset python34] &&
![variant_isset python35] &&
@@ -323,6 +311,7 @@ if {[variant_isset docs]} {
default_variants +python27
}

# make sure -python27 is not specified alone
if {![variant_isset python27] &&
![variant_isset python34] &&
![variant_isset python35] &&
@@ -331,4 +320,18 @@ if {[variant_isset docs]} {
ui_error "\n\nYou must select either the +python27, +python34, +python35, +python36, or +python37 variant when using variant +docs.\n"
return -code error "Invalid variant selection"
}

# determine Python-related variables
if {[variant_isset python27]} {
set PYTHON_VERSION_WITH_DOT "2.7"
} elseif {[variant_isset python34]} {
set PYTHON_VERSION_WITH_DOT "3.4"
} elseif {[variant_isset python35]} {
set PYTHON_VERSION_WITH_DOT "3.5"
} elseif {[variant_isset python36]} {
set PYTHON_VERSION_WITH_DOT "3.6"
} else {
set PYTHON_VERSION_WITH_DOT "3.7"
}
set PYTHON_VERSION_NO_DOT [join [split ${PYTHON_VERSION_WITH_DOT} "."] ""]
}

7 comments on commit f850901

@cjones051073

This comment has been minimized.

Copy link
Contributor

@cjones051073 cjones051073 replied Apr 15, 2019

There is a problem with this update, it is failing to build.

--->  Applying patch-fix_cxx14_17_checks.release.diff
Executing:  cd "/opt/local/var/macports/build/_Users_chris_Projects_MacPorts_ports_devel_cmake/cmake/work/cmake-3.14.2" && /usr/bin/patch -p0 < '/Users/chris/Projects/MacPorts/ports/devel/cmake/files/patch-fix_cxx14_17_checks.release.diff'
patching file Source/Checks/cm_cxx14_check.cpp
patching file Source/Checks/cm_cxx17_check.cpp
--->  Patching macports.cmake: s|__PREFIX__|/opt/local|g
--->  Patching CMakeFindFrameworks.cmake: s|__PREFIX__|/opt/local|g
Error: Failed to patch cmake: can't read "PYTHON_VERSION_WITH_DOT": no such variable
Error: See /opt/local/var/macports/logs/_Users_chris_Projects_MacPorts_ports_devel_cmake/cmake/main.log for details.
Error: Follow https://guide.macports.org/#project.tickets to report a bug.

@kencu

This comment has been minimized.

Copy link
Contributor

@kencu kencu replied Apr 15, 2019

Yes, the variable is used before it's being set. Have to rethink this.

@kencu

This comment has been minimized.

Copy link
Contributor

@kencu kencu replied Apr 15, 2019

No - that's not right. The variable is only set if the +docs variant is selected. Setting the +docs variant gets things going again.

@cjones051073

This comment has been minimized.

Copy link
Contributor

@cjones051073 cjones051073 replied Apr 15, 2019

the line

 reinplace "s|__PYTHON_VERSION_WITH_DOT__|${PYTHON_VERSION_WITH_DOT}|g" ${worksrcpath}/macports.cmake

probably just needs to be moved to the docs variant as well ?

@michaelld

This comment has been minimized.

Copy link
Contributor Author

@michaelld michaelld replied Apr 15, 2019

@cjones051073

This comment has been minimized.

Copy link
Contributor

@cjones051073 cjones051073 replied Apr 15, 2019

Done.

@michaelld

This comment has been minimized.

Copy link
Contributor Author

@michaelld michaelld replied Apr 15, 2019

Thx!

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