-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
lua: Build a shared library #6008
Conversation
def install(self, spec, prefix): | ||
if spec.satisfies("platform=darwin"): | ||
target = 'macosx' | ||
else: | ||
target = 'linux' | ||
make('INSTALL_TOP=%s' % prefix, | ||
'MYCFLAGS=-fPIC', |
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.
here and below please use self.compiler.pic_flag
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.
Done. :-)
6170b25
to
a2f7364
Compare
'MYLDFLAGS=-L%s -L%s' % ( | ||
spec['readline'].prefix.lib, | ||
spec['ncurses'].prefix.lib), | ||
'MYLIBS=-lncursesw', | ||
'CC=%s -std=gnu99' % spack_cc, | ||
'TO_LIB=liblua.a liblua.so liblua.so.%s liblua.so.%s' % ( |
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.
sorry, another issue: this will certainly fail on macOS. Can you please get the list dynamically?
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, I see that your patch won't work on macOS either, maybe don't apply it on darwin and skip this line as well?
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.
on macOS that would be
TO_LIB=liblua.a liblua.dylib
@@ -58,24 +58,33 @@ class Lua(Package): | |||
destination="luarocks", | |||
placement='luarocks') | |||
|
|||
patch('https://git.archlinux.org/svntogit/packages.git/plain/trunk/liblua.so.patch?h=packages/lua&id=70abed4cfa74993348bf7afbbc70151a3d57cc01', |
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.
maybe add this patch to Spack (as a file inside lua
folder) and also add a variation from Homebrew: https://github.com/Homebrew/homebrew-core/blob/master/Formula/lua.rb (at the bottom)
if you put some |
a2f7364
to
73d5762
Compare
I tried to come up with something a bit more generic. The Linux path still works but you will have to test the macOS path. :-) |
ef71c46
to
3ac5b9c
Compare
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.
seems to be working 👍
$ ls /Users/davydden/spack/opt/spack/darwin-highsierra-x86_64/clang-9.0.0-apple/lua-5.3.4-orbdggfe4o2c2etu3ztpzv7xntqyg7nv/lib/
liblua.a liblua.dylib liblua.dylib.5.3 liblua.dylib.5.3.4 lua
@@ -58,24 +58,34 @@ class Lua(Package): | |||
destination="luarocks", | |||
placement='luarocks') | |||
|
|||
patch('liblua-shared.patch') |
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.
Add a comment with a link to Arch linux!
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.
but to be fair, this patch is NOT the same as in arch linux, neither is it the same as in Homebrew
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.
@junghans see the last comment #6008 (comment)
Honestly, I would prefer converting the liblua.a to liblua.so outside of their buildsystem. @tgamblin: having a generic static_to_shared_lib function would be a good idea anyhow... |
Patch is inspired by Arch Linux and Homebrew.
3ac5b9c
to
1a27df9
Compare
I have added a comment with links to the Arch Linux and Homebrew patches. If the conversion function is preferred, though, I could also give that a try in the next few days. |
Patch is taken from Arch Linux.