fosskers / cargo-aur

Prepare Rust projects to be released on the Arch Linux User Repository
MIT License
84 stars 12 forks source link

Add support for post installation script #10

Open Dzordzu opened 2 years ago

Dzordzu commented 2 years ago

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

fosskers commented 2 years ago

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

fosskers commented 1 year ago

Any updates on this?

Dzordzu commented 1 year ago

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

fosskers commented 1 year ago

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

Dzordzu commented 1 year ago

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!

fosskers commented 1 year ago

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?

Dzordzu commented 1 year ago

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

fosskers commented 1 year ago

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?

Dzordzu commented 1 year ago

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

fosskers commented 1 year ago

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.

Dzordzu commented 1 year ago

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

fosskers commented 1 year ago

I'm glad it's helping you!

fosskers commented 1 year ago

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

fosskers commented 8 months ago

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

Dzordzu commented 8 months ago

Will do during the weekend :)

fosskers commented 8 months ago

This section of the updated README explains the change fully: https://github.com/fosskers/cargo-aur/blob/6ea9720f902f737bfd4b274f23689d4f865cde8b/README.md#custom-commands-within-package