Pamac - how to edit source code before building AUR package

Hi,
I’m trying to install vcvrack via Pamac but I’m getting an error. In this github page I found what the problem is and want to make changes in the source code and then build it.

In the build cache folder, /var/tmp/..., I edited the two Makefiles as suggested in the github issue, and then tried to build with this command:

pamac build --no-clone vcvrack

But, the problem is, even after editing the Makefiles, it’s cloning and restoring the original Makefiles (in fact the whole source code, I don’t know from where) and then building it, then the same error.

What is the proper way to modify source code before building a package?

The --no-clone just says it should use the local PKGBUILD file instead of download it from the AUR I guess.

If you want to make changes to the sourcecode of application that is being built:

  1. Download the PKGBUILD file.
  2. Create .patch file(s) for the source code changes you want to make.
  3. Modify the PKGBUILD file and include the patch from step 2.
  4. Make package with makepkg

Afterwards you can install that package then.

2 Likes

If it’s just too test… without needing to create a patch etc…
1st:
makepkg -o
o: no build, it will run till prepare () included but not build ()
2nd
Modify the source
3rd
makepkg -se
s: install dependencies
e: no extract.

-o, --nobuild

Download and extract files, run the prepare() function, but do not build them. Useful with the –noextract option if you wish to tweak the files in $srcdir/ before building.

-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

Sorry, this part I didn’t get. could you please explain how to do this?

The code changes you make you can express in a “.patch” or diff file which basically contains instructions of which lines of code have been changed/added/removed in which source file(s).

https://docs.moodle.org/dev/How_to_create_a_patch

Anyways, go for the approach @scachemaille described in his post. That is ways easier and fully sufficient for a one time exercise…

Also, if the AUR package does not build properly, leave a comment (there is a page for each AUR package where you can leave comments, etc.) and inform the maintainer so he can fix it.

1 Like

Thanks a lot for making me solve the problem! :smiley:

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