How to bypass "Retrieving sources" step when build AUR package?

Hi, all.
I want to build an AUR package which will clone sources from github.com.
But my Internet connection is unstable when access to github.com.
So I want to clone the source from github.com manually, and bypass “Retrieving sources” step in pamac.
Can pamac bypass the “Retrieving sources” step? And how to do it?

Install from AUR manually (instructions are towards the bottom of the page):

https://wiki.manjaro.org/index.php/Arch_User_Repository

There are --nocheck and --noprepare options in makepkg, but there are no --noretrieving option :worried:

Maybe this’ll help: Installing from the AUR by hand

1 Like

What software are you attempting to install? Is it a secret?

No, I just want to install swift-language

Well, very luck, the makepkg command is just bash script.
So I modify /usr/share/makepkg/source.sh, and make download_source() return immediately.
Makepkg bypass retrieve sources now. :grinning:

Go to the AUR page of the project AUR (en) - swift-language

Download snapshot from right side of the page under “Package Actions”

extract the snapshot

In terminal change to the directory where you extracted the snapshot

In terminal run makepkg -cs or makepkg -csi

If you run makepkg -cs it will create the install file .zst
If you run makepkg -csi it will ask for your password and install the package

Do not modify files in the system manually. Also, doing so will break installing other AUR packages.

See the man page: makepkg(8)

-e, --noextract

Do not extract source files or run the prepare() function (if present); use whatever source already exists in the $srcdir/ directory. This is handy if you want to go into $srcdir/ and manually patch or tweak code, then make a package out of the result. Keep in mind that creating a patch may be a better solution to allow others to use your PKGBUILD.

2 Likes

I suggest you download the snapshot from that AUR packages, and then put the cloned git files at the same place as where the PKGBUILD is. You can then modify the PKGBUILD to make it use your local files rather than cloning from GitHub.

Yes, I agree that modifying the makepkg sourcode is not good, but I really think that makepkg should provide a --noretrieve option.
There are --noextract, --noprepare, --nobuild, --noarchive, --nosign options that can skip some step in building flow, I’m very confused that why there are no --noretrieve option.

What would be the difference / benefit to the --noextract option?
Only that it would additionally extract the archive with the source-files (that you have downloaded prior to that) ? Extracting an archive should not be big deal normally :slight_smile:

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.