Can someone help me patch wine in Gentoo/Fu Bob Wya? anyone?

Questions about Wine on Linux
Locked
adcdam
Level 2
Level 2
Posts: 42
Joined: Thu Feb 16, 2017 1:08 am

Can someone help me patch wine in Gentoo/Fu Bob Wya? anyone?

Post by adcdam »

I need this patch https://github.com/hdmap/wine-hackery/tree/master/f4se to patch wine staging 3.17
perhaps it would be easy to modify the ebuild of wine staging or applying patches this way
https://wiki.gentoo.org/wiki//etc/portage/patches
i use Funtoo not Gentoo but its very similar. I followed that guide and i got errors.
Bob you use Gentoo perhaps you can help me.
best regards!!
User avatar
Bob Wya
Level 12
Level 12
Posts: 3068
Joined: Sat Oct 16, 2010 7:40 pm

Re: Can someone help me patch wine in Gentoo/Fu Bob Wya? any

Post by Bob Wya »

adcdam wrote:I need this patch https://github.com/hdmap/wine-hackery/tree/master/f4se to patch wine staging 3.17
perhaps it would be easy to modify the ebuild of wine staging or applying patches this way
https://wiki.gentoo.org/wiki//etc/portage/patches
i use Funtoo not Gentoo but its very similar. I followed that guide and i got errors.
Bob you use Gentoo perhaps you can help me.
best regards!!
Yeah I would say, for small patches like this, just plonk them in as User Patches. E.g.:

Code: Select all

/etc/portage/patches/app-emulation/wine-staging-3.17/getfreememstatecallbackfix.patch
/etc/portage/patches/app-emulation/wine-staging-3.17/mapimagetopdown.patch
The patches are coded in a P1 format (one leading directory) - so should apply cleanly...
I just had a look and they should apply cleanly to wine-vanilla-3.18 as well.

Problems may arise if wine-staging alters dlls/ntdll/virtual.c, with any "patch overlaps".
The user patches are applied after the wine-staging patch-sets.

Just let me know if the patches don't apply or lead to a build breakage (i doubt this - they are clearly syntactically correct C).
I can test them out, on my system, if that would help. 8)

Bob
adcdam
Level 2
Level 2
Posts: 42
Joined: Thu Feb 16, 2017 1:08 am

Re: Can someone help me patch wine in Gentoo/Fu Bob Wya? any

Post by adcdam »

Thanks Bob what is a p1 format?
i make a /etc/portage/patches/app-emulation/wine-staging-3.17 directory inside the wine-staging-3.17 directory i have two files
getfreememstatecallbackfix.patch and mapimagetopdown.patch i copy the text just like in this page

https://github.com/hdmap/wine-hackery/b ... kfix.patch
inside the getfreememstatecallbackfix.patch i have this:

Code: Select all

--- a/dlls/ntdll/virtual.c	2018-05-15 12:07:53.839882299 -0400
+++ a/dlls/ntdll/virtual.c	2018-05-15 14:51:22.632513314 -0400
@@ -2750,7 +2753,7 @@ static int get_free_mem_state_callback(
     MEMORY_BASIC_INFORMATION *info = arg;
     void *end = (char *)start + size;
 
-    if ((char *)info->BaseAddress + info->RegionSize < (char *)start) return 0;
+    if ((char *)info->BaseAddress + info->RegionSize <= (char *)start) return 0;
 
     if (info->BaseAddress >= end)
{
perhaps not all the text goes in that file?

when doing sudo ebuild wine-staging-3.17.ebuild clean prepare i got this:

Code: Select all

* Applying getfreememstatecallbackfix.patch ...
patch: **** malformed patch at line 11: {
                                                                                                                [ !! ]
 * ERROR: app-emulation/wine-staging-3.17::nokit failed (prepare phase):
 *   patch -p1  failed with /etc/portage/patches/app-emulation/wine-staging-3.17/getfreememstatecallbackfix.patch
 * 
 * Call stack:
 *               ebuild.sh, line   92:  Called src_prepare
 *             environment, line 4557:  Called default
 *      phase-functions.sh, line  868:  Called default_src_prepare
 *      phase-functions.sh, line  933:  Called __eapi6_src_prepare
 *             environment, line  621:  Called eapply_user
 *             environment, line 1377:  Called eapply '/etc/portage/patches/app-emulation/wine-staging-3.17/getfreememstatecallbackfix.patch'
 *             environment, line 1347:  Called _eapply_patch '/etc/portage/patches/app-emulation/wine-staging-3.17/getfreememstatecallbackfix.patch'
 *             environment, line 1285:  Called __helpers_die 'patch -p1  failed with /etc/portage/patches/app-emulation/wine-staging-3.17/getfreememstatecallbackfix.patch'
 *   isolated-functions.sh, line  121:  Called die
 * The specific snippet of code:
 *   		die "$@"



cheers!
User avatar
Bob Wya
Level 12
Level 12
Posts: 3068
Joined: Sat Oct 16, 2010 7:40 pm

Re: Can someone help me patch wine in Gentoo/Fu Bob Wya? any

Post by Bob Wya »

adcdam wrote:Thanks Bob what is a p1 format?
See the -pn parameter to: patch
adcdam wrote:i make a /etc/portage/patches/app-emulation/wine-staging-3.17 directory inside the wine-staging-3.17 directory i have two files
getfreememstatecallbackfix.patch and mapimagetopdown.patch i copy the text just like in this page
...
perhaps not all the text goes in that file?

when doing sudo ebuild wine-staging-3.17.ebuild clean prepare i got this:

Code: Select all

* Applying getfreememstatecallbackfix.patch ...
patch: **** malformed patch at line 11: {
...
Err no. You don't copy-paste the text from patches.
You are bound the mess up the delicate formatting, by doing this! :shock:
Copies of a patch file have to precisely match the original (every space counts!)

So you'd want to do, what I just did:

Code: Select all

mkdir -p /etc/portage/patches/app-emulation/wine-staging-3.17
cd /etc/portage/patches/app-emulation/wine-staging-3.17/
wget https://raw.githubusercontent.com/hdmap/wine-hackery/master/f4se/getfreememstatecallbackfix.patch
wget https://raw.githubusercontent.com/hdmap/wine-hackery/master/f4se/mapimagetopdown.patch
Which I should add, built successfully, first time... 8)

Yes, all that text can go in the patch file.
It's just part of the standard diff preamble.

Bob
adcdam
Level 2
Level 2
Posts: 42
Joined: Thu Feb 16, 2017 1:08 am

Re: Can someone help me patch wine in Gentoo/Fu Bob Wya? any

Post by adcdam »

Thanks!!!! i got user patches applied!!!! and i was able to build wine-staging with the patch!!!
pd: Gentoo and Funtoo are the best distros!!!! easier to patch!
thanks a lot Bob!! :D
User avatar
Bob Wya
Level 12
Level 12
Posts: 3068
Joined: Sat Oct 16, 2010 7:40 pm

Re: Can someone help me patch wine in Gentoo/Fu Bob Wya? any

Post by Bob Wya »

@adcdam

Hmmm, that's great news... 8)

Bob
Locked