Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
How to patch WineHQ
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
rianquinn
n00b
n00b


Joined: 01 Jul 2005
Posts: 29

PostPosted: Sun Feb 12, 2006 8:00 pm    Post subject: How to patch WineHQ Reply with quote

Ok, I have a Tablet-PC, and I installed wine 0.9.7 and it worked. Then I installed EverNote 1.1 because it is said to work after patching Wine. I have the patch. It is a ".diff" file. How do I apply the patch.

Sorry this is probably Linux 101, but I can't seem to find anything to help me with this.

Thanks,
Back to top
View user's profile Send private message
Blood Fluke
Apprentice
Apprentice


Joined: 15 Sep 2005
Posts: 224

PostPosted: Mon Feb 13, 2006 12:48 am    Post subject: Reply with quote

You use the GNU "patch" utility.
It's probably installed by default.
Back to top
View user's profile Send private message
PaulBredbury
Watchman
Watchman


Joined: 14 Jul 2005
Posts: 7310

PostPosted: Mon Feb 13, 2006 12:54 am    Post subject: Reply with quote

As a starter:
Code:
man patch
Back to top
View user's profile Send private message
ecatmur
Advocate
Advocate


Joined: 20 Oct 2003
Posts: 3595
Location: Edinburgh

PostPosted: Mon Feb 13, 2006 1:51 am    Post subject: Reply with quote

Try reading http://gentoo-wiki.com/HOWTO_Create_an_Updated_Ebuild.
_________________
No more cruft
dep: Revdeps that work
Using command-line ACCEPT_KEYWORDS?
Back to top
View user's profile Send private message
-TooL
Tux's lil' helper
Tux's lil' helper


Joined: 18 Nov 2004
Posts: 75

PostPosted: Wed Mar 01, 2006 7:42 pm    Post subject: Reply with quote

man patch is helpful to an extent, except it makes me even more lost...

I have a patch to apply to wine: http://source.winehq.org/git/?p=wine.git;a=commitdiff_plain;h=d16c72dea57e783b76137bdb885df28d0dd36678;hp=20d5741fd19093342a0c1d03a5948b5118a9393c

How would I apply it? There is no HowTo anywhere, and im a newbie trying to help them fix a bug. That patch is an attempt at fixing it.
_________________
n00b4lyfe
Back to top
View user's profile Send private message
StringCheesian
l33t
l33t


Joined: 21 Oct 2003
Posts: 887

PostPosted: Thu Mar 02, 2006 1:47 am    Post subject: Reply with quote

-TooL wrote:
How would I apply it? There is no HowTo anywhere, and im a newbie trying to help them fix a bug. That patch is an attempt at fixing it.

Here's a quick tutorial and an example of how to apply that patch:

The syntax is like this: "patch -pnumber < filename.patch"

The -pnumber part: For example, if the patch file says to replace "ignore_me/old/src/blah.c" with "ignore_me/new/src/blah.c" then -p2 would tell patch that we're really talking about "src/blah.c". Basically -pnumber means skip the first number parts of paths given in the patch file.

In your case, if you extract the wine source code you'll see a "dlls" folder. Now look in the patch:
Code:
--- a/dlls/msvcrt/locale.c
+++ b/dlls/msvcrt/locale.c
Should be "dlls/" not "a/dlls/", so we need "-p1".

Most patch files need -p1 or -p0, anything else is rare. As far as I know looking at the patch file is the only way to determine which to use.

The "<": Normally patch will ask you to type out some patch data for it. This basically tells bash to feed a file into it instead so you don't have to.

"filename.patch": The path and filename to the patch file.

So for example:
Code:
# Ask portage to extract the wine source code for us:
ebuild /usr/portage/app-emulation/wine/wine-0.9.8-r1.ebuild unpack

# Go to the directory portage unpacks to:
cd /var/tmp/portage/wine-0.9.8-r1/work/wine-0.9.8

# Apply the patch:
patch -p1 < /path/to/the/patch/file/name_of_the_patch_file.patch

# Now tell portage to emerge it (without extracting over our work):
FEATURES="keepwork" emerge wine
Back to top
View user's profile Send private message
-TooL
Tux's lil' helper
Tux's lil' helper


Joined: 18 Nov 2004
Posts: 75

PostPosted: Thu Mar 02, 2006 4:01 am    Post subject: Reply with quote

I understand the syntax, but I dont understand the file itself, or how/what to save it as.

Like where do I start the highlight for the copy and paste, and do I save it as patch.patch (or whatever I wanna name it as?).

When I do a wget on the URL it saves the URL as a whole, not a .patch file.

I understand the steps:
1. Unpack source code.
2. Go to the directory where its unpacked.
3. Apply patch to source code.
4. Compile the new patched source code (with emerge).

Very easy steps, just I dont understand the patch file url thingy..
_________________
n00b4lyfe
Back to top
View user's profile Send private message
StringCheesian
l33t
l33t


Joined: 21 Oct 2003
Posts: 887

PostPosted: Thu Mar 02, 2006 4:35 am    Post subject: Reply with quote

-TooL wrote:
Like where do I start the highlight for the copy and paste, and do I save it as patch.patch (or whatever I wanna name it as?).

I don't know anything about patch file syntax., I just used "Save Page As..." in Firefox and it worked. It doesn't matter what you name it.

-TooL wrote:
When I do a wget on the URL it saves the URL as a whole, not a .patch file.

Same here with wget (it also downloads a completely different page if you forget to put the URL in quotation marks), but Firefox saves as "git-d16c72dea57e783b76137bdb885df28d0dd36678.patch".
Back to top
View user's profile Send private message
-TooL
Tux's lil' helper
Tux's lil' helper


Joined: 18 Nov 2004
Posts: 75

PostPosted: Thu Mar 02, 2006 9:38 am    Post subject: Reply with quote

That worked! Thanks for the help.
_________________
n00b4lyfe
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum