Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Fix win32 install / use meta "resources"
Problem: File::Bundled is outdated and needs to be replaced. But %?RESOURCES fails to handle situations where the lib name cannot be guessed (given ssl it would need to produce libssl.so and ssleay.dll AND libeay.dll. This leaves windows openssl-less Solution: Replace File::Bundled with %?RESOURCES anyway. The ugly part of this means non-windows users still have to store the .dll files even though they will never be used. This is accomplished by not using the actual %?RESOURCES api internally on anything except windows (see: OpenSSL::NativeLib.pm6). Its better to support openssl on windows than to wait for other possible fixes in rakudo itself, but in the future this should be replaced Bonus: Build.PM is no longer needed. So dependencies on panda and Shell::Command can be dropped (in addition to File::Bundled)
- Loading branch information
Nick Logan
committed
May 7, 2016
1 parent
03076a2
commit 85f4413
Showing
5 changed files
with
11 additions
and
59 deletions.
There are no files selected for viewing
This file contains 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 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 |
|---|---|---|
| @@ -1,28 +1,13 @@ | ||
| unit module OpenSSL::NativeLib; | ||
| use Find::Bundled; | ||
|
|
||
| sub ssl-lib is export { | ||
| state $lib; | ||
| unless $lib { | ||
| if $*DISTRO.is-win { | ||
| # try to find a bundled .dll | ||
| $lib = Find::Bundled.find('ssleay32.dll', 'OpenSSL', :return-original, :keep-filename); | ||
| } else { | ||
| $lib = $*VM.platform-library-name('ssl'.IO).Str; | ||
| } | ||
| } | ||
| $lib | ||
| state $lib = $*DISTRO.is-win | ||
| ?? %?RESOURCES<ssleay32.dll>.absolute | ||
| !! $*VM.platform-library-name('ssl'.IO).Str; | ||
| } | ||
|
|
||
| sub gen-lib is export { | ||
| state $lib; | ||
| unless $lib { | ||
| if $*DISTRO.is-win { | ||
| # try to find a bundled .dll | ||
| $lib = Find::Bundled.find('libeay32.dll', 'OpenSSL', :return-original, :keep-filename); | ||
| } else { | ||
| $lib = $*VM.platform-library-name('ssl'.IO).Str; | ||
| } | ||
| } | ||
| $lib | ||
| } | ||
| state $lib = $*DISTRO.is-win | ||
| ?? %?RESOURCES<libeay32.dll>.absolute | ||
| !! $*VM.platform-library-name('ssl'.IO).Str; | ||
| } |
File renamed without changes.
File renamed without changes.