Difference between revisions of "Patching"

From WineHQ Wiki
Jump to: navigation, search
(Created page with "== Getting the Wine source == To get the Wine source code, you need to have Git installed on your system. From the command-line, run: {{{ git clone git://source.winehq.org/g...")
 
Line 3: Line 3:
 
To get the Wine source code, you need to have Git installed on your system. From the command-line, run:
 
To get the Wine source code, you need to have Git installed on your system. From the command-line, run:
  
{{{
 
 
git clone git://source.winehq.org/git/wine.git wine-git
 
git clone git://source.winehq.org/git/wine.git wine-git
}}}
 
  
 
For much more information about using Git with Wine, see GitWine.
 
For much more information about using Git with Wine, see GitWine.
Line 12: Line 10:
 
Often times, developers post test patches for users to test their programs with. Though this may seem overwhelming, it's quite simple. Simply download the patch (likely from bugzilla, or possibly from e-mail) and copy it to your wine source folder (often ~/wine-git/). Then run:
 
Often times, developers post test patches for users to test their programs with. Though this may seem overwhelming, it's quite simple. Simply download the patch (likely from bugzilla, or possibly from e-mail) and copy it to your wine source folder (often ~/wine-git/). Then run:
  
{{{
+
<code>
 
patch -p1 < patch_name.diff
 
patch -p1 < patch_name.diff
}}}
+
</code>
 +
 
 
This will patch the source code. It should return something similar to this:
 
This will patch the source code. It should return something similar to this:
  
{{{
+
<code>
 
patching file programs/winecfg/Pt.rc
 
patching file programs/winecfg/Pt.rc
}}}
+
</code>
 +
 
 
Once this is done, simply compile again:
 
Once this is done, simply compile again:
  
{{{
+
<code>
 
./configure && make depend && make
 
./configure && make depend && make
}}}
+
</code>
 +
 
 
And rerun your program:
 
And rerun your program:
  
{{{
+
<code>
./wine "C:\Program Files\Program Name\program.exe" }}}
+
./wine "C:\Program Files\Program Name\program.exe"
 +
</code>
 +
 
 
See, that wasn't hard! Now if you're going to be testing any other programs, you don't want your tree cluttered with patches you were testing for another program. To reset your git tree run:
 
See, that wasn't hard! Now if you're going to be testing any other programs, you don't want your tree cluttered with patches you were testing for another program. To reset your git tree run:
  
{{{
+
<code>
 
git checkout -f
 
git checkout -f
}}}
+
</code>
  
 
This will undo any uncommitted changes in your local git tree.
 
This will undo any uncommitted changes in your local git tree.
Line 40: Line 43:
 
If you've been the victim of a regression in wine, you probably want to revert that patch in your local build. While you can use git-revert, it's pretty messy. Instead, use git show along with some terminal voodoo:
 
If you've been the victim of a regression in wine, you probably want to revert that patch in your local build. While you can use git-revert, it's pretty messy. Instead, use git show along with some terminal voodoo:
  
{{{
+
<code>
 
git show c959867510703a100106f292cd26cb8f489236bb | patch -p1 -R
 
git show c959867510703a100106f292cd26cb8f489236bb | patch -p1 -R
}}}
+
</code>
 +
 
 
This will show the patch in question, pipe this information to the patch program, and revert it.
 
This will show the patch in question, pipe this information to the patch program, and revert it.
  
{{{
+
<code>
 
patching file programs/winecfg/Pt.rc
 
patching file programs/winecfg/Pt.rc
}}}
+
</code>
 +
 
 
Once this is done, simply compile again:
 
Once this is done, simply compile again:
  
{{{
+
<code>
 
./configure && make depend && make
 
./configure && make depend && make
}}}
+
</code>
And test.
+
  
{{{
+
And test:
 +
 
 +
<code>
 
./wine "C:\Program Files\Program Name\program.exe"
 
./wine "C:\Program Files\Program Name\program.exe"
}}}
+
</code>
 +
 
 +
or
 +
 
 +
<code>
 +
cd "$HOME/.wine/drive_c/Program Files/Program Name"
 +
 
 +
~/wine-git//wine program.exe
 +
</code>
 +
 
 
----
 
----
 
CategoryDevelopment
 
CategoryDevelopment

Revision as of 20:36, 24 January 2016

Getting the Wine source

To get the Wine source code, you need to have Git installed on your system. From the command-line, run:

git clone git://source.winehq.org/git/wine.git wine-git

For much more information about using Git with Wine, see GitWine.

Patching Your Git Tree

Often times, developers post test patches for users to test their programs with. Though this may seem overwhelming, it's quite simple. Simply download the patch (likely from bugzilla, or possibly from e-mail) and copy it to your wine source folder (often ~/wine-git/). Then run:

patch -p1 < patch_name.diff

This will patch the source code. It should return something similar to this:

patching file programs/winecfg/Pt.rc

Once this is done, simply compile again:

./configure && make depend && make

And rerun your program:

./wine "C:\Program Files\Program Name\program.exe"

See, that wasn't hard! Now if you're going to be testing any other programs, you don't want your tree cluttered with patches you were testing for another program. To reset your git tree run:

git checkout -f

This will undo any uncommitted changes in your local git tree.

Reverting Patches in Git

If you've been the victim of a regression in wine, you probably want to revert that patch in your local build. While you can use git-revert, it's pretty messy. Instead, use git show along with some terminal voodoo:

git show c959867510703a100106f292cd26cb8f489236bb | patch -p1 -R

This will show the patch in question, pipe this information to the patch program, and revert it.

patching file programs/winecfg/Pt.rc

Once this is done, simply compile again:

./configure && make depend && make

And test:

./wine "C:\Program Files\Program Name\program.exe"

or

cd "$HOME/.wine/drive_c/Program Files/Program Name"

~/wine-git//wine program.exe


CategoryDevelopment