Created attachment 327960 [details] ideskconfig-0.9.1.ebuild given the case I have a bunch of loose python scripts and want to inject them properly into the system, maybe even with multiple-abi support example ebuild from sunrise overlay.
So, the goal is to install N python modules onto the system, of which one is a Python script, correct? Nothing more, nothing less than that? I believe a python_domodule() and python_doscript() would be pretty useful in this case. Do you agree?
could be a thing that bothers me is that I'm not sure how to best fix the symlink thing. I made some weird python_foreach_impl magic, but meh another way would be to fix the "import blah" in the "modules" so we can install the "script" seperately. But that requires patching. these are basically scripts that are meant to be run from the same dir. There are more things like that, i.e. "sabnzbd" from sunrise overlay. Not sure what logic is best to apply here.
(In reply to comment #2) > could be > > a thing that bothers me is that I'm not sure how to best fix the symlink > thing. I made some weird python_foreach_impl magic, but meh > > another way would be to fix the "import blah" in the "modules" so we can > install the "script" seperately. But that requires patching. > > these are basically scripts that are meant to be run from the same dir. > There are more things like that, i.e. "sabnzbd" from sunrise overlay. Not > sure what logic is best to apply here. As far as I can see, this script has 'if __name__ == "__main__":' so you may try doing something like creating /usr/bin/newscript with: from idesk_config import IDeskConfig IDeskConfig().main()
(In reply to comment #3) > (In reply to comment #2) > > could be > > > > a thing that bothers me is that I'm not sure how to best fix the symlink > > thing. I made some weird python_foreach_impl magic, but meh > > > > another way would be to fix the "import blah" in the "modules" so we can > > install the "script" seperately. But that requires patching. > > > > these are basically scripts that are meant to be run from the same dir. > > There are more things like that, i.e. "sabnzbd" from sunrise overlay. Not > > sure what logic is best to apply here. > > As far as I can see, this script has 'if __name__ == "__main__":' so you may > try doing something like creating /usr/bin/newscript with: > > from idesk_config import IDeskConfig > > IDeskConfig().main() I don't like that either, cause it requires manual intervention. But whatever, that's no big deal. I would second python_domodule and python_doscript for now. For domodule I should be able to control the relative destination (e.g. if I want to install it into a subdir of site-packages or just in the basedir)
(In reply to comment #4) > I would second python_domodule and python_doscript for now. For domodule I > should be able to control the relative destination (e.g. if I want to > install it into a subdir of site-packages or just in the basedir) Hmm, if I am to do this similarly to helpers in Gentoo, that'd probably be a helperinto function, but it'd have to take the absolute path, I believe. In most cases 'python_domod -r' will just solve most of the cases, I guess.
Note to self: make the module compilation function public
Well, I think that's all fixed and documented now (in python-utils-r1).