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
luaiconv: init at 7 #29949
luaiconv: init at 7 #29949
Conversation
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.
Please submit Gitano and all of its dependencies in a single pull request (each package in a separate commit), this will make it easier to review and it will reassure that Gitano dependencies are packaged correctly.
pkgs/top-level/lua-packages.nix
Outdated
sha256 = "0rd76966qlxfp8ypkyrbif76nxnm1acclqwfs45wz3972jsk654i"; | ||
}; | ||
|
||
buildInputs = []; |
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.
Delete this line.
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.
If you need this and the latter preBuild
to override buildLuaPackage
defaults, just don't use buildLuaPackage
.
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.
ack
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 I don't understand, I am really just following the convention of the rest of this file. I will ofcourse delete buildInputs
but I don't understand why buildLuaPackage
should be dropped 😕
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.
Look at the definition of buildLuaPackage
: https://github.com/NixOS/nixpkgs/blob/b5d11a76/pkgs/development/lua-modules/generic/default.nix
Basically it's mkDerivation
with custom preBuild
and buildInputs
. I was not familiar with lua packaging and it appeared that you were attempting to circumvent its utility by overriding both of these attributes. Sorry.
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.
Ahh I see okay, well I've left buildLuaPackage
etc in tact, but have dropped the buildInputs
line, moved the meta
section to the bottom and added homepage
🐱
pkgs/top-level/lua-packages.nix
Outdated
license = stdenv.lib.licenses.mit; | ||
description = "Lua bindings for POSIX iconv"; | ||
maintainers = [ maintainers.richardipsum ]; | ||
}; |
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.
Move meta to the end, use with stdenv.lib
and with maintainers
, add homepage.
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.
Will do
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
makeFlagsArray=( | ||
INSTALL_PATH="$out/lib/lua/${lua.luaversion}" | ||
); | ||
''; |
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.
Use makeFlags
, you don't need preBuild
for this.
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'm not familiar with that, but I'll look into it, thanks. 🐱
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.
Everything else in this file seems to use preBuild
😕
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.
Yeah, buildLuaPackage does not accommodate makeFlags
… You may use this instead:
installFlags = [ "INSTALL_PATH=$(out)/lib/lua/${lua.luaversion}" ];
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.
Looking at my build log I don't think this is required, currently, I see:
make[1]: Leaving directory '/tmp/nix-build-lua5.1-luaiconv-7.drv-0/lua-iconv-e8d34024a6b185a759733915f116cc5588550261-src'
install -D -s iconv.so //nix/store/1khy7gdmz7fkim58ff05h7j2aflxb7hg-lua5.1-luaiconv-7/lib/lua/5.1/iconv.so
post-installation fixup
shrinking RPATHs of ELF executables and libraries in /nix/store/1khy7gdmz7fkim58ff05h7j2aflxb7hg-lua5.1-luaiconv-7
shrinking /nix/store/1khy7gdmz7fkim58ff05h7j2aflxb7hg-lua5.1-luaiconv-7/lib/lua/5.1/iconv.so
and when I modify the contents of INSTALL_PATH
by appending a test string /TESTSTRING
, then I see:
make[1]: Leaving directory '/tmp/nix-build-lua5.1-luaiconv-7.drv-0/lua-iconv-e8d34024a6b185a759733915f116cc5588550261-src'
install -D -s iconv.so //nix/store/m9py1qwly24gf1mk5k7wqm3vdkq4dzab-lua5.1-luaiconv-7/lib/lua/5.1/TESTSTRING/iconv.so
post-installation fixup
shrinking RPATHs of ELF executables and libraries in /nix/store/m9py1qwly24gf1mk5k7wqm3vdkq4dzab-lua5.1-luaiconv-7
shrinking /nix/store/m9py1qwly24gf1mk5k7wqm3vdkq4dzab-lua5.1-luaiconv-7/lib/lua/5.1/TESTSTRING/iconv.so
This gives me some confidence that INSTALL_PATH
is being picked up, other lua packages also set their install dir this way, as I say I really have just adopted the existing conventions used in this file.
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.
@vyp This is a little deficiency of buildLuaPackage
, it overrides makeFlags
with its makeFlagsArray
instead of extending them. We could fix it…
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.
@richardipsum makeFlagsArray
in preBuild
is certainly correct, it's just not common outside of lua-packages when makeFlags
is sufficient. Currently lua-packages have to resort to this (or, rather, set installFlags
instead of makeFlags
) because buildLuaPackage
itself defines makeFlagsArray
in its preBuild
, but it does not seem to have a reason not to use makeFlags
instead.
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.
@orivej I see, noted, it's unclear to me what that means for the patches I have in flight. I would hazard a guess that were this to be fixed it should be done for all lua-packages to maintain consistency?
@orivej Thanks for reviewing so quickly! I will be happy to submit subsequent dependencies as part of one larger "Add Gitano" pull request if that will make this easier. Thanks! |
OK, but you can simply rename this PR and push additional commits. |
@orivej My fear with opening one PR for the entire thing is that it will simply not be reviewed because it will be quite a large PR. Certainly for the first leaf deps (that are not core gitano components) I would prefer to keep them separate. |
f604b8b
to
4266c2f
Compare
Upstream calls this package |
4266c2f
to
25ecd13
Compare
@orivej Good spot, renamed! |
pkgs/top-level/lua-packages.nix
Outdated
@@ -215,6 +215,31 @@ let | |||
''; | |||
}; | |||
|
|||
lua-iconv = buildLuaPackage rec { | |||
name = "luaiconv-${version}"; |
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.
Update this too please.
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.
woops, done 😸
25ecd13
to
cdd5176
Compare
We merged the version before I pushed the name change?! |
@richardipsum No, I've merged right after your last commit. |
@orivej Heh, you were too fast for github web ui, clearly, thanks for the review! 😸 |
Motivation for this change
Hi!
I would like to package a git network auth package known as Gitano
lua-iconv is a dependency of Gitano's
I'll be opening separate PRs for each Gitano dependency, since that should make it easier to review.
Things done
build-use-sandbox
innix.conf
on non-NixOS)This package has been tested on Debian through installation and test of Gitano itself.
Thanks!
Richard