You are not logged in.

#1 2004-05-01 23:36:04

zeppelin
Member
From: Athens, Greece
Registered: 2004-03-05
Posts: 807
Website

how to write a patch and how to integrate it in PKGBUILD

I have a file [yes it's a Makefile]
with this idiot line:
CFLAGS  += '-DGLADEDIR="data"'

I want it replaced to

CFLAGS  += '-DGLADEDIR="/usr/local/share/de-jong-explorer/data"'

how can I write a patch to do this
and do I integrate it to my PKGBUILD

thank you very much in advance

Offline

#2 2004-05-02 01:52:12

contrasutra
Member
From: New Jersey
Registered: 2003-07-26
Posts: 507

Re: how to write a patch and how to integrate it in PKGBUILD

Modify the line, and then save the Makefile and something like Makefile.new. Then run this to make a patch:

diff -u Makefile Makefile.new > Makefile.patch

Then in your PKGBUILD, run the patch like this:

patch -p0 < $startdir/Makefile.patch

Modify the instructions to taste.


"Contrary to popular belief, penguins are not the salvation of modern technology.  Neither do they throw parties for the urban proletariat."

Offline

#3 2004-05-02 01:59:24

kpiche
Forum Fellow
From: Ottawa, ON, Canada
Registered: 2004-03-30
Posts: 246
Website

Re: how to write a patch and how to integrate it in PKGBUILD

Well you have two possibilities: use sed or use diff to create a patch.  With sed:

sed -i -e '/^CFLAGS +=/  s@data@/usr/local/share/de-jong-explorer/data@' Makefile

Or keep a copy of the original Makefile, create the new one and then diff:

diff -Naur Makefile.orig Makefile >patchfile

Then in the PKGBUILD apply with patch:

patch -Np0 -i patchfile

You may have to change the 0 to suit pathnames in the source tree.  See the man page.

Offline

#4 2004-05-02 23:39:27

zeppelin
Member
From: Athens, Greece
Registered: 2004-03-05
Posts: 807
Website

Re: how to write a patch and how to integrate it in PKGBUILD

Offline

Board footer

Powered by FluxBB