Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Solved] Ebuild files for script-based utilities
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
lars_the_bear
Guru
Guru


Joined: 05 Jun 2024
Posts: 522

PostPosted: Sun Jun 23, 2024 9:28 am    Post subject: [Solved] Ebuild files for script-based utilities Reply with quote

Hi folks

Is there a nice way to write a .ebuild file for a utility that consists of nothing but scripts? There's a Makefile, but only 'make install' does anything, because there's nothing to build. I'm fairly sure these utilities could be treated like C programs, but is there an official, nicer way? I guess I could just provide empty implementations of `src_compile()` etc.

BR, Lars.


Last edited by lars_the_bear on Wed Jun 26, 2024 8:38 am; edited 1 time in total
Back to top
View user's profile Send private message
logrusx
Advocate
Advocate


Joined: 22 Feb 2018
Posts: 2435

PostPosted: Sun Jun 23, 2024 10:46 am    Post subject: Re: Ebuild files for script-based utilities Reply with quote

lars_the_bear wrote:
Hi folks
I guess I could just provide empty implementations of `src_compile()` etc.


I think you don't need to provide anything at all. Just package and host the scripts somewhere. Everything else will be taken care of. See mktwpol for reference. It seems to be purely scripts. It does something but it doesn't seem to be related to installing the scripts.

Best Regards,
Georgi
Back to top
View user's profile Send private message
RumpletonBongworth
Tux's lil' helper
Tux's lil' helper


Joined: 17 Jun 2024
Posts: 77

PostPosted: Sun Jun 23, 2024 4:38 pm    Post subject: Reply with quote

An implementation of src_compile that does nothing would save a minute amount of overhead. You can do what whatever you want in the src_install phase (exeinto, doexe etc).

EDIT: I just realised that you mentioned that there is already a Makefile. In that case, and as logrusx stated, you shouldn't have to do anything in particular.
Back to top
View user's profile Send private message
eschwartz
Developer
Developer


Joined: 29 Oct 2023
Posts: 227

PostPosted: Mon Jun 24, 2024 2:52 pm    Post subject: Reply with quote

If the default Makefile target does something incompatible with src_compile, such as attempting to install to $(DESTDIR)/usr/bin, then you do indeed need to override src_compile.

Or make the default Makefile target be a no-op target, which is a good idea anyway. It's not generally expected that running `make` would install the software.

Perhaps this Makefile is already doing the right thing and the default target is a no-op.

(If there is *no* Makefile, then you don't need to do anything since it will only try to execute a Makefile if a Makefile exists.)
Back to top
View user's profile Send private message
lars_the_bear
Guru
Guru


Joined: 05 Jun 2024
Posts: 522

PostPosted: Mon Jun 24, 2024 6:07 pm    Post subject: Reply with quote

eschwartz wrote:

Perhaps this Makefile is already doing the right thing and the default target is a no-op.


Exactly so. And the package installs perfectly well, with a .ebuild file that is essentially empty except for the download URI. It just seems a bit pointless to run 'make' at all, when there's nothing to build. But it does no harm. I was just wondering if there was an official, idiomatic Gentoo way to package something that is just scripts.

BR, Lars.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum