cargo-aur icon indicating copy to clipboard operation
cargo-aur copied to clipboard

Add support for post installation script

Open Dzordzu opened this issue 3 years ago • 16 comments

Simply- add an option that will allow to insert a line inside package()

Dzordzu avatar Apr 10 '22 07:04 Dzordzu

What would the argument to the option be? A string to be inserted verbatim?

fosskers avatar Apr 11 '22 16:04 fosskers

Any updates on this?

fosskers avatar Oct 02 '23 07:10 fosskers

I'm thinking about a path to the executable that will be called after the installation

Dzordzu avatar Oct 04 '23 05:10 Dzordzu

makepkg already supports having a install.sh file separate from the PKGBUILD. Would that suffice?

fosskers avatar Oct 04 '23 06:10 fosskers

I couldn't find such a flag within makepkg. Can you tell me how to pass it?

My original idea was about performing additional actions just after binary installation. Looking back, I've got no idea why did I suggest package() when post_install() is already available.

And to the background for this issue: I've got a binary that generates manpages and bash completions. It would be awesome if I could setup them during the installation process!

Dzordzu avatar Oct 04 '23 10:10 Dzordzu

I've got a binary that generates manpages and bash completions.

Ah now I see. Is the binary that generates the manpages and completions separate from the binary produced by cargo aur, or would it be built at the same time in the original Rust build?

fosskers avatar Oct 05 '23 02:10 fosskers

Ideally both options should be available, but in my case it's the binary that generates manpages and completions :)

Dzordzu avatar Oct 05 '23 07:10 Dzordzu

Since PKGBUILDs are downloaded and ran by users, and cargo aur packages prebuilt binaries, where would the manpage generator binary come from so that it could be ran within the PKGBUILD?

fosskers avatar Oct 05 '23 07:10 fosskers

manpage generator binary

It's the same binary that is built by the cargo aur :)

https://github.com/clap-rs/clap/tree/master/clap_mangen https://github.com/Icelk/clap_autocomplete

Dzordzu avatar Oct 05 '23 07:10 Dzordzu

So perhaps we should return to the original request:

Simply- add an option that will allow to insert a line inside package()

This is generally reasonable. I could add a new config field that accepts a list of raw strings that would be inserted verbatim into the package function.

fosskers avatar Oct 24 '23 02:10 fosskers

Love it! I would also like to thank you for the time you put into this repo. It really does its job :)

Dzordzu avatar Oct 25 '23 10:10 Dzordzu

I'm glad it's helping you!

fosskers avatar Oct 26 '23 01:10 fosskers

Update: I have this scheduled to work on in mid-December.

fosskers avatar Nov 21 '23 01:11 fosskers

@Dzordzu Can you take a look at https://github.com/fosskers/cargo-aur/pull/26 and confirm if it offers what you're expecting?

fosskers avatar Mar 21 '24 23:03 fosskers