-
Notifications
You must be signed in to change notification settings - Fork 797
Add support for pkg-config #2547
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+58
−2
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -349,6 +349,7 @@ OUT | |
| stub_repeated brew false | ||
| # shellcheck disable=SC2016 | ||
| stub cc '-xc -E - : [[ "$(cat)" == *OPENSSL_VERSION_TEXT* ]] && printf "# <unrelated> 4.0.2\n\"OpenSSL 1.0.3a 1 Aug 202\"\n0 errors.\n"' | ||
| stub_repeated pkg-config false | ||
| stub_make_install | ||
|
|
||
| mkdir -p "$INSTALL_ROOT"/openssl/ssl # OPENSSLDIR | ||
|
|
@@ -360,6 +361,37 @@ DEF | |
|
|
||
| unstub uname | ||
| unstub brew | ||
| unstub pkg-config | ||
| unstub make | ||
|
|
||
| assert_build_log <<OUT | ||
| ruby-3.2.0: [--prefix=$INSTALL_ROOT,--with-ext=openssl,psych,+] | ||
| make -j 2 | ||
| make install | ||
| OUT | ||
| } | ||
|
|
||
| @test "use pkg-config OpenSSL" { | ||
| cached_tarball "ruby-3.2.0" configure | ||
|
|
||
| openssl_libdir="$TMP/opt/local/libexec/openssl3" | ||
|
|
||
| stub_repeated uname '-s : echo Linux' | ||
| stub_repeated brew false | ||
| stub pkg-config \ | ||
| "--variable=prefix openssl : echo '$openssl_libdir'" \ | ||
| "--modversion openssl : echo 3.0.0" | ||
| stub_make_install | ||
|
|
||
| run_inline_definition <<DEF | ||
| install_package "openssl-1.1.1w" "https://www.openssl.org/source/openssl-1.1.1w.tar.gz" openssl --if needs_openssl_102_300 | ||
| install_package "ruby-3.2.0" "http://ruby-lang.org/ruby/2.0/ruby-3.2.0.tar.gz" | ||
| DEF | ||
| assert_success | ||
|
|
||
| unstub uname | ||
| unstub brew | ||
| unstub pkg-config | ||
| unstub make | ||
|
|
||
| assert_build_log <<OUT | ||
|
|
@@ -380,6 +412,7 @@ OUT | |
| stub_repeated brew false | ||
| stub cc '-xc -E - : echo "OpenSSL 1.0.1a 1 Aug 2023"' # system_openssl_version | ||
| stub openssl "version -d : echo 'OPENSSLDIR: \"${TMP}/ssl\"'" | ||
| stub_repeated pkg-config false | ||
| stub_make_install "install_sw" | ||
| stub_make_install | ||
|
|
||
|
|
@@ -393,6 +426,7 @@ DEF | |
| unstub uname | ||
| unstub brew | ||
| unstub cc | ||
| unstub pkg-config | ||
| # Depending on certain system certificate files being present under /etc/, | ||
| # `openssl version -d` might not have been called, so avoid unstubbing it | ||
| # since that would verify the number of invocations. | ||
|
|
@@ -420,6 +454,7 @@ OUT | |
| stub_repeated brew false | ||
| stub cc '-xc -E - : echo "OpenSSL 1.0.1a 1 Aug 2023"' # system_openssl_version | ||
| stub openssl | ||
| stub_repeated pkg-config false | ||
| stub_make_install "install_sw" | ||
| stub_make_install | ||
|
|
||
|
|
@@ -433,6 +468,7 @@ DEF | |
| unstub uname | ||
| unstub security | ||
| unstub brew | ||
| unstub pkg-config | ||
| # Depending on the state of system `/usr/bin/openssl` in the test runner, | ||
| # `cc` might not have been called, so avoid unstubbing it since that would | ||
| # verify the number of invocations. | ||
|
|
@@ -533,7 +569,9 @@ EXE | |
| stub cc '-xc -E - : echo "OpenSSL 1.0.1a 1 Aug 2023"' | ||
| stub_repeated brew \ | ||
| 'list : printf "git\nopenssl@3\nopenssl-utils\[email protected]\[email protected]\nwget\[email protected]"' \ | ||
| "--prefix : echo '$homebrew_prefix'/opt/\$2 " | ||
| "--prefix : if [ \$# -ge 2 ]; then echo '$homebrew_prefix'/opt/\$2; else echo '$homebrew_prefix'; fi " \ | ||
| "--repository : echo '$homebrew_prefix'" | ||
| stub_repeated pkg-config false | ||
| stub_make_install | ||
|
|
||
| run_inline_definition <<DEF | ||
|
|
@@ -545,6 +583,7 @@ DEF | |
| unstub uname | ||
| unstub cc | ||
| unstub brew | ||
| unstub pkg-config | ||
| unstub make | ||
|
|
||
| assert_build_log <<OUT | ||
|
|
||
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$prefix_prefix->$brew_prefixprobably?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not understand?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, copy-paste mistake, I'll update my comment above for posterity.
But yes, what @halostatue showed (I tried to find the suggestion thing but wasn't available in the commit/diff view for some reason).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, thanks both! 🤦