Skip to content
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

Merged
merged 1 commit into from Sep 30, 2017
Merged

luaiconv: init at 7 #29949

merged 1 commit into from Sep 30, 2017

Conversation

richardipsum
Copy link
Contributor

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

This package has been tested on Debian through installation and test of Gitano itself.

Thanks!
Richard

Copy link
Contributor

@orivej orivej left a 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.

sha256 = "0rd76966qlxfp8ypkyrbif76nxnm1acclqwfs45wz3972jsk654i";
};

buildInputs = [];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delete this line.

Copy link
Contributor

@orivej orivej Sep 30, 2017

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ack

Copy link
Contributor Author

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 😕

Copy link
Contributor

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.

Copy link
Contributor Author

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 🐱

license = stdenv.lib.licenses.mit;
description = "Lua bindings for POSIX iconv";
maintainers = [ maintainers.richardipsum ];
};
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do

Copy link
Contributor Author

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}"
);
'';
Copy link
Contributor

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.

Copy link
Contributor Author

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. 🐱

Copy link
Contributor Author

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 😕

Copy link
Contributor

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}" ];

Copy link
Member

@vyp vyp Sep 30, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@richardipsum

makeFlags = [ "INSTALL_PATH=$out/lib/lua/${lua.luaversion}" ];

Edit: woops too slow

Copy link
Contributor Author

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.

Copy link
Contributor

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…

Copy link
Contributor

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.

Copy link
Contributor Author

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?

@richardipsum
Copy link
Contributor Author

@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!

@orivej
Copy link
Contributor

orivej commented Sep 30, 2017

OK, but you can simply rename this PR and push additional commits.

@richardipsum
Copy link
Contributor Author

@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.

@richardipsum richardipsum force-pushed the init-luaiconv branch 2 times, most recently from f604b8b to 4266c2f Compare September 30, 2017 12:31
@orivej
Copy link
Contributor

orivej commented Sep 30, 2017

Upstream calls this package lua-iconv, not luaiconv. Would you rename it?

@richardipsum
Copy link
Contributor Author

@orivej Good spot, renamed!

@@ -215,6 +215,31 @@ let
'';
};

lua-iconv = buildLuaPackage rec {
name = "luaiconv-${version}";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update this too please.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

woops, done 😸

@richardipsum
Copy link
Contributor Author

We merged the version before I pushed the name change?!

@orivej
Copy link
Contributor

orivej commented Sep 30, 2017

@richardipsum No, I've merged right after your last commit.

@richardipsum
Copy link
Contributor Author

@orivej Heh, you were too fast for github web ui, clearly, thanks for the review! 😸

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants