FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Ubuntu > Ubuntu User

 
 
LinkBack Thread Tools
 
Old 09-15-2010, 09:31 PM
Nils Kassube
 
Default Patch Glib

Luana C. Rocha wrote:
> I'm new linux user and I need do patch my glib in order to make
> pacemaker-gui to work.
>
> 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:
>
> Then I execute the commands:
>
> diff -uN /usr/include/glib-2.0/glib/gatomic.h /home/luana/patch >
> glib.patch
>
> patch glib.patch
>
> But didn't solve my problem.
> In fact the system "freezes" and looks like the patch wasn't applied.

Actually the system didn't freeze but was waiting for your input to
patch the file glib.patch - but that isn't important because you were on
the wrong track anyway.

If you want to apply a patch to glib you should download the source.
That would be the command

apt-get source glib2.0

Then apply the patch

cd glib2.0-*/
patch -p1 < /path/to/the/patch

where you replace /path/to/the/patch with the path to the patch file
that you downloaded and which was included in your mail. Then install
some extra packages needed for the next steps:

sudo apt-get install build-essential checkinstall

Then configure and compile the patched source and make and install a
replacement package.

./configure
make
sudo checkinstall make install

However I didn't try if that actually works - I only had a quick look at
the source directory. It is very likely that you also have to install
some development packages before the "./configure" and "make" commands
succeed but on my system there are already so many -dev packages
installed that I can't easily tell you which ones you need.


Nils

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 09-16-2010, 12:29 AM
C de-Avillez
 
Default Patch Glib

On Wed, 15 Sep 2010 17:42:21 -0300
"Luana C. Rocha" <luanac.rocha@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.
--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 

Thread Tools




All times are GMT. The time now is 10:38 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org