You are not logged in.

#1 2017-07-13 20:44:53

dnt
Member
Registered: 2017-07-13
Posts: 1

Prevent yaourt from overwriting .cpp file to compile

This is my first post on this forum so i apologize in advance for any faux pas i make (and i promise to improve, given feedback), and i understand that this may not be strictly Arch problem, but it's very related so i wanne give it a shot.

I wanted to install polybar https://aur.archlinux.org/packages/polybar using yaourt, but there is an obsolete header included in one of source files, what prevents whole thing from compiling. bug https://github.com/jaagr/polybar/issues/647 is described here.  Whole fix for this problem boils down to removing said header (<curl/curlbuild.h>), but every time i remove header and retry installing via yaourt this file is being overwritten with faulty one.

Now i know there are easier ways to fix this issue (heck, i could even wait few days for merge, or just plain give up, its just a status bar), but I made a point for myself to learn from this (i dont know C++ or bash that much) and after two days of frustration i ran out of ideas, plus the fact that this issue will be fixed soon probably and i will never again have this chance to learn.

Thus here is my question for you guys (because man, i love this forum, this culture of requesting help and professional support from community, lack of personal insults and offtopic - lol the irony now), how to prevent yaourt (or whatever process overwrites this file) from overwriting corrected code?

I wanted to include log from installation, but i cant get relevant info packed into file, so i post what's important

[ 74%] Building CXX object bin/CMakeFiles/polybar.dir/utils/http.cpp.o
/tmp/yaourt-tmp-dante/aur-polybar-git/src/polybar/src/utils/http.cpp:2:10: fatal error: 
      'curl/curlbuild.h' file not found
#include <curl/curlbuild.h>
         ^~~~~~~~~~~~~~~~~~
1 error generated.
make[2]: *** [bin/CMakeFiles/polybar.dir/build.make:1287: bin/CMakeFiles/polybar.dir/utils/http.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:512: bin/CMakeFiles/polybar.dir/all] Error 2
make: *** [Makefile:130: all] Error 2
==> ERROR: A failure occurred in build().
    Aborting...
==> ERROR: Makepkg was unable to build polybar-git.

thanks for help in advance.

Offline

#2 2017-07-13 20:51:46

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

Re: Prevent yaourt from overwriting .cpp file to compile

See `man makepkg` the noextract option.

Offline

#3 2017-07-13 21:51:08

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

Re: Prevent yaourt from overwriting .cpp file to compile

If you're still learning your way around the AUR, I'd advise against using yaourt.  Yaourt hides far too much from the user preventing them from learning about or understanding what it is doing.


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

Offline

#4 2017-07-13 23:34:17

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: Prevent yaourt from overwriting .cpp file to compile

Using *any* AUR helper when you need to modify the "$srcdir", is simply not going to work. AUR helpers assume that the PKGBUILD itself is sufficient, and cleaning the build directory is considered to be a "feature" of using AUR helpers.


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#5 2017-07-14 12:16:06

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

Re: Prevent yaourt from overwriting .cpp file to compile

You could use a patch in the prepare() function of the PKGBUILD to change the sourcecode before compiling.


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

#6 2017-07-14 13:26:46

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: Prevent yaourt from overwriting .cpp file to compile

That is true. But once you are also adding patchfiles, you can no longer solve this in the limited context of an AUR helper's automated prompt to edit the PKGBUILD, and it is time to switch to makepkg. Which is kind of the point -- that by using makepkg you have infinitely more control over modifying the source package to do what you need it to do.


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#7 2017-07-14 19:49:29

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,774

Re: Prevent yaourt from overwriting .cpp file to compile

... Moving to AUR Issues.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

Board footer

Powered by FluxBB