Artix Linux Forum

Artix Linux => Package management => Topic started by: TheExplorer on 13 May 2024, 09:33:07

Title: [SOLVED] artools-pkg Question
Post by: TheExplorer on 13 May 2024, 09:33:07
I have a question, guys

Speaking of artools-pkg and building in a clean chroot, what is the alternative of makepkg -esr / -osr ?

I mean, if I want to get the sources and extract them only without rebuilding, then make some changes to the code by hand and rebuild the package after that.

Is it possible and how?

Thanks
Title: Re: artools-pkg Question
Post by: lq on 13 May 2024, 10:32:00
Speaking of artools-pkg and building in a clean chroot, what is the alternative of makepkg -esr / -osr ?

Code: [Select]
buildpkg -c

RTFM:

https://gitea.artixlinux.org/artix/artools/src/branch/master/README.md
Title: Re: artools-pkg Question
Post by: TheExplorer on 13 May 2024, 17:09:37

Yes, I've read this readme. buildpkg -c simply recreates the chroot. I couldn't find anything upon how to retrieve the sources, make changes and then continue building the package.

So, after buildpkg has recreated the chroot should I make changes and then run it again or what?
Title: Re: artools-pkg Question
Post by: TheExplorer on 13 May 2024, 17:13:33
RTFM:
https://gitea.artixlinux.org/artix/artools/src/branch/master/README.md

Also, why are you throwing this at me even when it doesn't have 'buildpkg -c' at all? Are you an Artix dev? That's a bit rude anyway. I asked a simple question searching for a solution and learning things. You throw 'rtfm'. Yes, I rtfm constatntly, dude.
Title: Re: artools-pkg Question
Post by: artoo on 13 May 2024, 17:21:35

I mean, if I want to get the sources and extract them only without rebuilding, then make some changes to the code by hand and rebuild the package after that.

Is it possible and how?


Short answer no, not possible.
buildpkg is simply not meant to do this, building in chroot requires you to make a patch eventually if you want to modify sources.
Title: Re: artools-pkg Question
Post by: gripped on 13 May 2024, 19:13:29
Create a chroot with system mount binds (artix-chroot)
Run artix-bootstrap in it.
Install base-devel git
git clone from gitea and if necessary checkout the stable version
Use makepkg in any setup you like.

You can create a bash or python script to take a package as an argument then do the above, pause after makepkg -sro $PKG then continue once you've done your edits.

One caveat atm is that https://gitea.artixlinux.org/artix/artix-bootstrap needs changes to work.
I've been meaning to report it but maybe I just have?
This fork should be working ? https://github.com/gripped/artix-bootstrap

I actually have a python script which I call patch-hook which does much of the above. Or at least it has functions you could extract from it to suit your needs.
patch-hook gets called by hooks I place in /etc/pacman.d/hooks so that whenever specific packages get upgraded patch-hook builds them again after applying my pre-existing patches. Optionally in a chroot.

So similarities but not exactly what you need.
I just added it to my github in case you want to see how it can be done.
https://github.com/gripped/patch-hook
Title: Re: artools-pkg Question
Post by: TheExplorer on 13 May 2024, 19:39:07
Short answer no, not possible.
buildpkg is simply not meant to do this, building in chroot requires you to make a patch eventually if you want to modify sources.

Thank you very much. That's what I wanted to hear. Also, shame on me, I forgot about patching. Awesome. I'll mark it as solved.
Title: Re: artools-pkg Question
Post by: TheExplorer on 13 May 2024, 19:42:42
Create a chroot with system mount binds (artix-chroot)
Run artix-bootstrap in it.
Install base-devel git
git clone from gitea and if necessary checkout the stable version
Use makepkg in any setup you like.
You can create a bash or python script to take a package as an argument then do the above, pause after makepkg -sro $PKG then continue once you've done your edits.
I actually have a python script which I call patch-hook which does much of the above. Or at least it has functions you could extract from it to suit your needs.
patch-hook gets called by hooks I place in /etc/pacman.d/hooks so that whenever specific packages get upgraded patch-hook builds them again after applying my pre-existing patches. Optionally in a chroot.
So similarities but not exactly what you need.
I just added it my github in case you want to see how it can be done.
https://github.com/gripped/patch-hook

That's very informative. Thanks a ton! I'll study this too. Now I guess it'd be easier to create a patch, edit a PKGBUILD accordingly and run buildpkg like it's supposed.
Title: Re: artools-pkg Question
Post by: corysanin on 14 May 2024, 00:12:02
One caveat atm is that https://gitea.artixlinux.org/artix/artix-bootstrap needs changes to work.

Fixed
Title: Re: artools-pkg Question
Post by: artoo on 14 May 2024, 09:32:56
General advice, if you plan to distribute or deploy your built package to a repo which for example your local network computers all use, same as a distro package, buildpkg is the thing.
If you just plan to install a built package locally for yourself and just your own computer, makepkg is fully sufficient.
Title: Re: artools-pkg Question
Post by: lq on 14 May 2024, 16:00:42
Also, why are you throwing this at me even when it doesn't have 'buildpkg -c' at all? Are you an Artix dev? That's a bit rude anyway. I asked a simple question searching for a solution and learning things. You throw 'rtfm'. Yes, I rtfm constatntly, dude.

LOL

It doesn't matter who I am, the tools are self-explanatory so you're definitely a lazy lunkhead if you can't deal with my answer.

Ultimately, anyone who is bothered by RTFM won't get an answer at all.
Title: Re: artools-pkg Question
Post by: TheExplorer on 14 May 2024, 16:10:45
General advice, if you plan to distribute or deploy your built package to a repo which for example your local network computers all use, same as a distro package, buildpkg is the thing.
If you just plan to install a built package locally for yourself and just your own computer, makepkg is fully sufficient.

Thank you very much. I'm stumbled now a bit with missing dependencies when building xfce4-panel with buildpkg. I guess I should go with more step-by-step thingy with mkchroot and stuff and provide other repos, right?
Title: Re: artools-pkg Question
Post by: TheExplorer on 14 May 2024, 16:16:59
LOL
It doesn't matter who I am

Yes, it matters. You're a personal insulter. Keep it up.
Title: Re: artools-pkg Question
Post by: lq on 14 May 2024, 16:21:42
You're a personal insulter. Keep it up.

A statement of fact is not an insult.
Title: Re: artools-pkg Question
Post by: TheExplorer on 14 May 2024, 17:34:18


Problem fixed. I had to edit the .conf file uncommenting and adding:

Code: [Select]
REPO="galaxy"

Just thought at first that I had to enumerate all three repos there and couldn't figure out the format for this since there is no help for that. As it turned out, only "galaxy" is needed.

Case closed, thread solved.
Title: Re: artools-pkg Question
Post by: TheExplorer on 14 May 2024, 17:49:34
If you just plan to install a built package locally for yourself and just your own computer, makepkg is fully sufficient.

Well, as it turned out, makepkg didn't work for the mkinitcpio package. So, I'll stick to the clean chroot method I guess. Thanks again for your time and help.