You are not logged in.

#1 2021-10-29 23:36:30

JustCauseWhyNot
Member
Registered: 2021-10-20
Posts: 34

[SOLVED] PKGBUILD git sparse checkout source url.

I'm creating a PKGBUILD for linux-rt-devel kernel. I'm having issue with getting the correct source url. In the git repository under the tags there's pre patched linux-rt kernels, but there's also other downloads that aren't the patched kernel that I'm trying to link.  After reading the wiki, and other kernel aur pkgbuild's I still don't understand how to link to the most updated pre patched linux-rt kernels? I would greatly appreciate some help.

Last edited by JustCauseWhyNot (2021-10-30 20:38:04)

Offline

#2 2021-10-29 23:45:09

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,442
Website

Re: [SOLVED] PKGBUILD git sparse checkout source url.

Do you mean you only want to clone certain (sub)directories of the upstream source repository?  If so, that'd be a git sparse checkout.  I don't know if that can be done (automatically) in a PKGBUILD.  But if you adjust your thread title to include that goal, you'll draw the attention of those that might know if it's possible.

If it can't be done automatically, you can fall back to the old style of VCS PKGBUILD in which there is no source array, but all the source content is retrieved in the prepare() function.  In this case, you'd just follow regular git sparse checkout documentation putting the commands in prepare().

That said, how much of a burden would it be to download the whole repo then just use what you needed?

Last edited by Trilby (2021-10-29 23:45:44)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#3 2021-10-29 23:57:54

JustCauseWhyNot
Member
Registered: 2021-10-20
Posts: 34

Re: [SOLVED] PKGBUILD git sparse checkout source url.

It wouldn't be a issue for me to download the whole directory. But if I were to upload to aur it'd be a extra 2gb download on top of a 190mb download. I didn't really think about downloading the entire directory but that could work. Thank you.

Offline

#4 2021-10-30 00:09:58

loqs
Member
Registered: 2014-03-06
Posts: 17,192

Re: [SOLVED] PKGBUILD git sparse checkout source url.

JustCauseWhyNot wrote:

It wouldn't be a issue for me to download the whole directory. But if I were to upload to aur it'd be a extra 2gb download on top of a 190mb download.

The source in any form should not be uploaded to AUR.
The latest stable linux-rt tag appears to be https://git.kernel.org/pub/scm/linux/ke … -5.14.y-rt have you tried using that in the source array?
Edit:
Similar to https://aur.archlinux.org/cgit/aur.git/ … h=linux-rt which uses a tree that is adding commits Arch locally applies.

Last edited by loqs (2021-10-30 00:13:17)

Offline

#5 2021-10-30 00:22:37

JustCauseWhyNot
Member
Registered: 2021-10-20
Posts: 34

Re: [SOLVED] PKGBUILD git sparse checkout source url.

This is the first pkgbuild I'm making, because there isn't a pkgbuild linux-rt on the mainline kernel. I'm not planning on uploading to aur, and if I did I'd make sure not to include source. What I'm trying to do is use the most updated mainline tag not stable. I'm confused as to how I'd implement the method of the second link.

Last edited by JustCauseWhyNot (2021-10-30 00:23:08)

Offline

#6 2021-10-30 00:28:40

loqs
Member
Registered: 2014-03-06
Posts: 17,192

Re: [SOLVED] PKGBUILD git sparse checkout source url.

If you wanted to use the latest tag https://git.kernel.org/pub/scm/linux/ke … 5-rc7-rt15 then something like

pkgver=5.15-rc7-rt15
...
source=("git+https://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-rt-devel.git#tag=v{pkgver}?signed"
         config)
...
validpgpkeys=(
  '64254695FFF0AA4466CC19E67B96E8162A8CF5D1'  # Sebastian Andrzej Siewior
)

Last edited by loqs (2021-10-30 00:30:07)

Offline

#7 2021-10-30 00:43:36

JustCauseWhyNot
Member
Registered: 2021-10-20
Posts: 34

Re: [SOLVED] PKGBUILD git sparse checkout source url.

Is that it? Sorry for maybe basic question, but when there's a update will that tag to the latest pre patched kernel? Thank you.

Offline

#8 2021-10-30 00:50:45

loqs
Member
Registered: 2014-03-06
Posts: 17,192

Re: [SOLVED] PKGBUILD git sparse checkout source url.

It is pinned to the tag set by pkgver.

You could switch to using a branch.  That would lose ensuring the commit was a signed tag.

git+https://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-rt-devel.git#branch=linux-5.15.y-rt

You would need to add a pkgver function as covered in the wiki to update the pkgver variable.

Offline

#9 2021-10-30 00:55:44

JustCauseWhyNot
Member
Registered: 2021-10-20
Posts: 34

Re: [SOLVED] PKGBUILD git sparse checkout source url.

Thank you very much loqs. You've helped me a lot. Thank you too Trilby.

Offline

#10 2021-10-30 16:50:29

JustCauseWhyNot
Member
Registered: 2021-10-20
Posts: 34

Re: [SOLVED] PKGBUILD git sparse checkout source url.

I'm really sorry to ask. But I'm confused by "It is pinned to the tag set by pkgver." I don't understand how they interact. If I do switch to a branch won't that pull the latest commit, and not necessarily the full pre patched kernel? I apologize for the questions I just can't seem to figure it out after reading through the wiki, threads, and other pkgbuild's.

Offline

#11 2021-10-31 12:48:33

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,868

Re: [SOLVED] PKGBUILD git sparse checkout source url.

Makepkg supports several special options for dealing with Version Control System sources.

Check https://wiki.archlinux.org/title/VCS_package_guidelines and https://man.archlinux.org/man/PKGBUILD. … CS_SOURCES


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

Board footer

Powered by FluxBB