|
349 | 349 | stub_repeated brew false |
350 | 350 | # shellcheck disable=SC2016 |
351 | 351 | stub cc '-xc -E - : [[ "$(cat)" == *OPENSSL_VERSION_TEXT* ]] && printf "# <unrelated> 4.0.2\n\"OpenSSL 1.0.3a 1 Aug 202\"\n0 errors.\n"' |
| 352 | + stub_repeated pkg-config false |
352 | 353 | stub_make_install |
353 | 354 |
|
354 | 355 | mkdir -p "$INSTALL_ROOT"/openssl/ssl # OPENSSLDIR |
|
360 | 361 |
|
361 | 362 | unstub uname |
362 | 363 | unstub brew |
| 364 | + unstub pkg-config |
| 365 | + unstub make |
| 366 | + |
| 367 | + assert_build_log <<OUT |
| 368 | +ruby-3.2.0: [--prefix=$INSTALL_ROOT,--with-ext=openssl,psych,+] |
| 369 | +make -j 2 |
| 370 | +make install |
| 371 | +OUT |
| 372 | +} |
| 373 | + |
| 374 | +@test "use pkg-config OpenSSL" { |
| 375 | + cached_tarball "ruby-3.2.0" configure |
| 376 | + |
| 377 | + openssl_libdir="$TMP/opt/local/libexec/openssl3" |
| 378 | + |
| 379 | + stub_repeated uname '-s : echo Linux' |
| 380 | + stub_repeated brew false |
| 381 | + stub pkg-config \ |
| 382 | + "--variable=prefix openssl : echo '$openssl_libdir'" \ |
| 383 | + "--modversion openssl : echo 3.0.0" |
| 384 | + stub_make_install |
| 385 | + |
| 386 | + run_inline_definition <<DEF |
| 387 | +install_package "openssl-1.1.1w" "https://www.openssl.org/source/openssl-1.1.1w.tar.gz" openssl --if needs_openssl_102_300 |
| 388 | +install_package "ruby-3.2.0" "http://ruby-lang.org/ruby/2.0/ruby-3.2.0.tar.gz" |
| 389 | +DEF |
| 390 | + assert_success |
| 391 | + |
| 392 | + unstub uname |
| 393 | + unstub brew |
| 394 | + unstub pkg-config |
363 | 395 | unstub make |
364 | 396 |
|
365 | 397 | assert_build_log <<OUT |
|
380 | 412 | stub_repeated brew false |
381 | 413 | stub cc '-xc -E - : echo "OpenSSL 1.0.1a 1 Aug 2023"' # system_openssl_version |
382 | 414 | stub openssl "version -d : echo 'OPENSSLDIR: \"${TMP}/ssl\"'" |
| 415 | + stub_repeated pkg-config false |
383 | 416 | stub_make_install "install_sw" |
384 | 417 | stub_make_install |
385 | 418 |
|
|
393 | 426 | unstub uname |
394 | 427 | unstub brew |
395 | 428 | unstub cc |
| 429 | + unstub pkg-config |
396 | 430 | # Depending on certain system certificate files being present under /etc/, |
397 | 431 | # `openssl version -d` might not have been called, so avoid unstubbing it |
398 | 432 | # since that would verify the number of invocations. |
|
420 | 454 | stub_repeated brew false |
421 | 455 | stub cc '-xc -E - : echo "OpenSSL 1.0.1a 1 Aug 2023"' # system_openssl_version |
422 | 456 | stub openssl |
| 457 | + stub_repeated pkg-config false |
423 | 458 | stub_make_install "install_sw" |
424 | 459 | stub_make_install |
425 | 460 |
|
|
433 | 468 | unstub uname |
434 | 469 | unstub security |
435 | 470 | unstub brew |
| 471 | + unstub pkg-config |
436 | 472 | # Depending on the state of system `/usr/bin/openssl` in the test runner, |
437 | 473 | # `cc` might not have been called, so avoid unstubbing it since that would |
438 | 474 | # verify the number of invocations. |
|
533 | 569 | stub cc '-xc -E - : echo "OpenSSL 1.0.1a 1 Aug 2023"' |
534 | 570 | stub_repeated brew \ |
535 | 571 | 'list : printf "git\nopenssl@3\nopenssl-utils\nopenssl@1.1\nopenssl@3.0\nwget\nopenssl@3.1"' \ |
536 | | - "--prefix : echo '$homebrew_prefix'/opt/\$2 " |
| 572 | + "--prefix : if [ \$# -ge 2 ]; then echo '$homebrew_prefix'/opt/\$2; else echo '$homebrew_prefix'; fi " \ |
| 573 | + "--repository : echo '$homebrew_prefix'" |
| 574 | + stub_repeated pkg-config false |
537 | 575 | stub_make_install |
538 | 576 |
|
539 | 577 | run_inline_definition <<DEF |
|
545 | 583 | unstub uname |
546 | 584 | unstub cc |
547 | 585 | unstub brew |
| 586 | + unstub pkg-config |
548 | 587 | unstub make |
549 | 588 |
|
550 | 589 | assert_build_log <<OUT |
|
0 commit comments