Patch Glib

C de-Avillez hggdh2 at ubuntu.com
Thu Sep 16 00:29:10 UTC 2010


On Wed, 15 Sep 2010 17:42:21 -0300
"Luana C. Rocha" <luanac.rocha at gmail.com> wrote:

>   Hi,
> 
> I'm new linux user and I need do patch my glib in order to make
> pacemaker-gui to work.
> I know that i have to apply the following
> patch: http://git.gnome.org/browse/glib/commit/?
> id=bf2719c815d719d1899b4bdb1b81ff6798471094, but i don't know how to
> do it.
> 
> 
> I tried to do these steps, but didn't work. Can someone give me a
> detailed tutorial about how to apply patchs, or point me what i did
> wrong?
> 
> I've copy the content of the patch to a file named patch:

<snip/>

Good, hold on it for a while.

> 
> Then I execute the commands:
> 
> diff -uN /usr/include/glib-2.0/glib/gatomic.h /home/luana/patch >
> glib.patch

I am not sure what you wanted do to here, since you *already* have a
patch. But the resulting file is most certainly worthless as a patch.

> 
> patch glib.patch

Wrong syntax: you would have to either redirect your patch as stdin,
or run 'patch -i <your patch>'.

 
> But didn't solve my problem.
> In fact the system "freezes" and looks like the patch wasn't applied.

Yes. As Nils pointed out on another email, 'patch' is waiting for
input. See above.

But even doing redirection when running 'patch' will *NOT* solve your
problem: the gnome.org patch redefines some in-line code -- it will
*only* be used when you remake the whole of glib2.0 (I did not stop to
see where it is used, so for me it is _all_).

What you have to do is rebuild glib2.0. And... now we have some issues:

* what version of Ubuntu are you using? Specifically what version of
  glib2.0? 
* this patch seems to only change some casts to avoid gcc warnings
  when building glib (unless you are building your programme with
  '-Werror'). Are you sure this is what you need?

But, let's consider this is what you need. You should rebuild the
Ubuntu glib2.0 packages for your version of Ubuntu -- the current, or
better, the most up-to-date version of them.

So you will need (at least):

* build-essentials
* ubuntu-dev-tools

sudo apt-get install build-essentials ubuntu-dev-tools

then you need to grab *all* build dependencies for glib2.0:

sudo apt-get build-dep glib2.0

Now cd into the just-created glib2.0, and try to *fake*-apply the
patch:

cd glib2.0-2.25.15 
patch --dry-run --verbose -p0 < ~/patch

I am assuming the GIT patch you downloaded is under your home
directory, and it is named 'patch'.

If everything is fine -- to say, no 'patch' errors:

* copy your patch to the ./debian/patches, and GIVE IT A MORE CORRECT
  NAME. 'patch' really does not do the trick. NOTE: since glib2.0 uses
  'quilt', you will have to take some care. Usually making it the last
  patch in the series is OK. YMMV.
* edit ./debian/patches/series, and add in the appropriate position
  the patch file name
* edit ./debian/changelog and add an entry AT THE TOP for your patch.
  Increase the mod level, and make sure to end the version string as
  '~whatever'. This will allow for future official updates to replace
  glib2.0, and will not break any possible dependencies from other
  packages. For example, on my Maverick system, glib2.0 is versioned
  '2.25.15-0ubuntu2', so I would set the version to
  '2.25.15-0ubuntu3~test').
* now you can build the new glib2.0 packages: 'debuild -b' will do the
  trick.

If everything has gone OK, you will have a series of new packages on
the parent directory, and all you will need to do is update *those you
already have installed*.

Yes, it is not as simple as one could wish. But you are changing a
critical Gnome package... simply building it from source (like
'./configure && make && sudo make install') may or may not work --
probably will not work, BTW.

You really should read https://wiki.ubuntu.com/PackagingGuide/Complete
on the applicable parts.

Good luck!

-- 
C de-Avillez
IRC: hggdh

This email (and any attachments) is digitally signed using GNUpg
(http://gnupg.org). The public key is available at http://pgp.mit.edu.
The key Id is 0xD3133E56.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20100915/e0633734/attachment.sig>


More information about the ubuntu-users mailing list