Bug 280448 - emulators/wine: Fix PE build
Summary: emulators/wine: Fix PE build
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Gerald Pfeifer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-07-25 19:50 UTC by Alexander Vereeken
Modified: 2024-09-08 14:20 UTC (History)
5 users (show)

See Also:


Attachments
0001-emulators-wine-Fix-build.patch (65.32 KB, patch)
2024-07-25 19:50 UTC, Alexander Vereeken
no flags Details | Diff
0001-emulators-wine-Fix-PE-build.patch (64.43 KB, patch)
2024-07-25 20:10 UTC, Alexander Vereeken
no flags Details | Diff
0001-emulators-wine-Switch-to-llvm17-to-fix-PE-build.patch (56.08 KB, patch)
2024-07-31 15:59 UTC, Alexander Vereeken
Alexander88207: maintainer-approval? (gerald)
Details | Diff
Gerald's patch switching to LLVM 17 to fix the PE build (46.20 KB, patch)
2024-08-02 09:14 UTC, Gerald Pfeifer
no flags Details | Diff
Gerald's patch switching to LLVM 17 to fix the PE build (v2) (46.74 KB, patch)
2024-09-06 22:29 UTC, Gerald Pfeifer
no flags Details | Diff
Gerald's patch switching to LLVM 17 to fix the PE build (v2') (46.37 KB, patch)
2024-09-06 22:32 UTC, Gerald Pfeifer
no flags Details | Diff
Gerald's patch switching to LLVM 17 to fix the PE build (v2a) (46.09 KB, patch)
2024-09-07 09:45 UTC, Gerald Pfeifer
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Vereeken freebsd_triage 2024-07-25 19:50:33 UTC
Created attachment 252285 [details]
0001-emulators-wine-Fix-build.patch

Hello,

this an patch to return to build PE binaries how its supposed to since wine7 and wine8 (last time).

The changes to the wine-proton port were used for this, thank you Alex S for your work.

The only problem is that on i386 it fails to find/use the missing headers in files/clang.

I currently have included that llvm17 gets used when on i386 but not in an elegant way because llvm15 gets pulled in too.

In terms of runtime it works now as great as expected.

Regards.
Comment 1 Alexander Vereeken freebsd_triage 2024-07-25 20:10:10 UTC
Created attachment 252286 [details]
0001-emulators-wine-Fix-PE-build.patch

Fix pkg-plist.
Comment 2 Alexander Vereeken freebsd_triage 2024-07-28 10:23:00 UTC
Poudriere FreeBSD 14 amd64 and i386: OK
Comment 3 Gerald Pfeifer freebsd_committer freebsd_triage 2024-07-31 06:41:22 UTC
Hmm, this is more copying over wine-proton than following where wine-devel
has been going?

For example, those new files in files/clang really are the wrong direction
now that devel/llvm17 installs them. (I understand this is because with the
patch this port is now built both with llvm15 *and* llvm17).

Did you try the approach used by wine-devel? What there is not working?


(I have had a somewhat similar patch - in terms of direction, some
changes less - ready, want to get wine-devel fully up-to-date and
all issues address first.)
Comment 4 Alexander Vereeken freebsd_triage 2024-07-31 15:59:37 UTC
Created attachment 252399 [details]
0001-emulators-wine-Switch-to-llvm17-to-fix-PE-build.patch

(In reply to Gerald Pfeifer from comment #3)

I tried to respect with llvm15 because in the last commit to this port you mentioned that llvm17 includes the headers but that you sticked to llvm15 anyway.

But this is an big change in this case for many users as i had reported in some other PR that currently this port is broken.

My intention was not turn this port into wine-proton, so here is an patch that just a switch to llvm17 should fix this build as well.
Comment 5 Gerald Pfeifer freebsd_committer freebsd_triage 2024-08-02 09:13:12 UTC
Adding some that have been interested in Wine lately...
Comment 6 Gerald Pfeifer freebsd_committer freebsd_triage 2024-08-02 09:14:04 UTC
Created attachment 252447 [details]
Gerald's patch switching to LLVM 17 to fix the PE build

This is the patch I had prepared - fully aligned with the current state
of wine-devel and minimal.

Anything missing? How does this work versus status quo?
Comment 7 Gerald Pfeifer freebsd_committer freebsd_triage 2024-08-02 09:19:51 UTC
(In reply to Gerald Pfeifer from comment #6)
> Anything missing?

Apart from files/patch-include_wine_asm.h which I'll backport from
emulators/wine?
Comment 8 Alexander Vereeken freebsd_triage 2024-08-02 14:49:08 UTC
(In reply to Gerald Pfeifer from comment #7)

Looks good to far but excuse my uncertainty.. Is there a reason why our lists are slightly different when it comes to wine32 vs wine64?

For example you marked mmcndmgr.dll i386 only, even it appears on my AMD64 host.

root@Home:/usr/ports/emulators/wine # make makeplist | grep mmcndmgr.dll
lib/wine/%%WINEARCH%%-windows/mmcndmgr.dll
Comment 9 Gerald Pfeifer freebsd_committer freebsd_triage 2024-08-03 10:50:49 UTC
Ah, that would be us running into Bug 220950 (Mk/Scripts/check-stagedir.sh
false negatives (with %%OPTIONS%%)) once again.

I scripted a bit and checked both emulators/wine and emulators/wine-devel,
and this is the only such case I found. I'll adjust both ports in the next
days.

Can you find any other omissions?
Comment 10 Alexander Vereeken freebsd_triage 2024-08-03 13:59:00 UTC
(In reply to Gerald Pfeifer from comment #9)

> Can you find any other omissions?

Alot of files from include/wine/windows/ddk/ have been marked as amd64 but appear do also on i386.

Basically i think that my plist from (0001-emulators-wine-Switch-to-llvm17-to-fix-PE-build.patch) can be taken. I did the comparing via viewing difference and setting comments manually.
Comment 11 commit-hook freebsd_committer freebsd_triage 2024-08-04 08:43:29 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=a19dda7e99d2445489c509bf64abe949bdfe545b

commit a19dda7e99d2445489c509bf64abe949bdfe545b
Author:     Gerald Pfeifer <gerald@FreeBSD.org>
AuthorDate: 2024-08-04 08:40:09 +0000
Commit:     Gerald Pfeifer <gerald@FreeBSD.org>
CommitDate: 2024-08-04 08:40:09 +0000

    emulators/wine-devel: %%WINEARCH%%-windows/mmcndmgr.dll isn't 32-bit only

    PR:             280448, 220950

 emulators/wine-devel/Makefile  | 1 +
 emulators/wine-devel/pkg-plist | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)
Comment 12 commit-hook freebsd_committer freebsd_triage 2024-08-05 19:24:22 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=e7814d589d41238dfefe2f25a97a8fd335317b95

commit e7814d589d41238dfefe2f25a97a8fd335317b95
Author:     Gerald Pfeifer <gerald@FreeBSD.org>
AuthorDate: 2024-08-05 19:22:54 +0000
Commit:     Gerald Pfeifer <gerald@FreeBSD.org>
CommitDate: 2024-08-05 19:22:54 +0000

    emulators/wine: %%WINEARCH%%-windows/mmcndmgr.dll isn't 32-bit only

    PR:             280448, 220950

 emulators/wine/Makefile  | 2 +-
 emulators/wine/pkg-plist | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
Comment 13 commit-hook freebsd_committer freebsd_triage 2024-08-08 06:18:08 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=3eda9ed8abffc9114e1dcc2f8313f9e54227293d

commit 3eda9ed8abffc9114e1dcc2f8313f9e54227293d
Author:     Gerald Pfeifer <gerald@FreeBSD.org>
AuthorDate: 2024-08-08 06:14:36 +0000
Commit:     Gerald Pfeifer <gerald@FreeBSD.org>
CommitDate: 2024-08-08 06:14:36 +0000

    emulators/wine-devel: include/wine/windows/ddk isn't 64-bit only

    PR:             280448, 220950
    Reported by:    Alexander Vereeken <Alexander88207@protonmail.com>

 emulators/wine-devel/pkg-plist | 56 +++++++++++++++++++++---------------------
 1 file changed, 28 insertions(+), 28 deletions(-)
Comment 14 commit-hook freebsd_committer freebsd_triage 2024-08-09 06:16:40 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=182263cd72d7bb9f144d040adf073691baddc291

commit 182263cd72d7bb9f144d040adf073691baddc291
Author:     Gerald Pfeifer <gerald@FreeBSD.org>
AuthorDate: 2024-08-09 06:16:02 +0000
Commit:     Gerald Pfeifer <gerald@FreeBSD.org>
CommitDate: 2024-08-09 06:16:03 +0000

    emulators/wine: Also package include/wine/windows/ddk on 32-bit

    PR:             280448, 220950
    Reported by:    Alexander Vereeken <Alexander88207@protonmail.com>

 emulators/wine/pkg-plist | 56 ++++++++++++++++++++++++------------------------
 1 file changed, 28 insertions(+), 28 deletions(-)
Comment 15 Alexander Vereeken freebsd_triage 2024-09-03 16:15:10 UTC
Would you like to update your patch again so that i can take a closer look? 

Otherwise your patch with the additional plist changes should look good to go.
Comment 16 Gerald Pfeifer freebsd_committer freebsd_triage 2024-09-06 22:29:41 UTC
Created attachment 253386 [details]
Gerald's patch switching to LLVM 17 to fix the PE build (v2)
Comment 17 Gerald Pfeifer freebsd_committer freebsd_triage 2024-09-06 22:32:28 UTC
Created attachment 253387 [details]
Gerald's patch switching to LLVM 17 to fix the PE build (v2')
Comment 18 Alexander Vereeken freebsd_triage 2024-09-07 00:39:04 UTC
(In reply to Gerald Pfeifer from comment #17)

Looks good to me, thank you.
Comment 19 Gerald Pfeifer freebsd_committer freebsd_triage 2024-09-07 09:45:04 UTC
Created attachment 253397 [details]
Gerald's patch switching to LLVM 17 to fix the PE build (v2a)

I pushed one hunk that is unrelated in case we need to revert the main
change, so updating the attached patch.

No new testing is required if you had/have the previous v2' patch.
Comment 20 commit-hook freebsd_committer freebsd_triage 2024-09-08 04:54:51 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=4beb3216818c58ae4d1d53734957660ee99ecd24

commit 4beb3216818c58ae4d1d53734957660ee99ecd24
Author:     Gerald Pfeifer <gerald@FreeBSD.org>
AuthorDate: 2024-09-08 04:53:03 +0000
Commit:     Gerald Pfeifer <gerald@FreeBSD.org>
CommitDate: 2024-09-08 04:53:04 +0000

    emulators/wine: Fix the PE build

    This requires our devel/llvm17 or later ports which bring full header
    files. [1]

    It has major impact on how this port is built and the packaging list,
    so bump PORTREVISION.

    PR:             280448, 274542 [1], 279677 [1]

 emulators/wine/Makefile  |   5 +-
 emulators/wine/pkg-plist | 993 +++++++++++------------------------------------
 2 files changed, 233 insertions(+), 765 deletions(-)
Comment 21 Gerald Pfeifer freebsd_committer freebsd_triage 2024-09-08 05:27:15 UTC
Done. Thank you for testing and nudging me, Alexander.
Comment 22 Alexander Vereeken freebsd_triage 2024-09-08 14:20:52 UTC
You're welcome.