py-cipheycore: Fix python3 configuration #9964
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Apologies for all these bug fixes for cipheycore. Loads of Ciphey users who use macOS have issues with cipheycore (e.g. Ciphey/Ciphey#256 Ciphey/Ciphey#362), which is why I think it's so important to have a working MacPorts portfile. Hopefully, this should be the last bug fix before adding ciphey.
cipheycore builds fine if only it's equivalent python version is active (i.e. py38-cipheycore builds fine if only python38 is active). This is fine for the buildbots, but not if the user has to build from source and has different python versions active. If the wrong python version is found, a segmentation fault occurs at runtime. This sort of issue is very similar to https://trac.macports.org/ticket/59946, and a temporary fix before this PR is merged would be to use trace mode.
The reason why this happens is explained here Ciphey/Ciphey#238 (comment).
This bug fix manually sets the build dependency python to be used during the configure stage. It sets
-DCIPHEY_CORE_PYTHON
to the folder containing the python headers (see https://github.com/Ciphey/CipheyCore#linuxosxother-unices).Type(s)
Tested on
macOS 11.1 20C69
xcode-select version 2384.
Verification
Have you
port lint
?sudo port test
?sudo port -vst install
?