Wine test image

Thank you for the hint! :+1:

But it didn’t work for me. I get always the message:

AddHaikuImagePackages: package wine not available!

I also don’t really know where I have to place the package so that jam could find it.
I’ve tried to put it in the $(HAIKU_TOP), $(HAIKU_TOP)/generated.x86_64 and $(HAIKU_TOP)/generated.x86_64/downloads directory, but without any success.

I also found in the rule definition of AddHaikuImagePackages (File: ‘ImageRules’) that it takes a second argument for a directory, so I put:

AddHaikuImagePackages wine : /path/to/package ;

in ‘UserBuildConfig’ but again without any success.

Finally to see if it works and how it works, I decided to take the example of ‘UserBuildConfig.sample’ and give it a try, but it also fail. Here the output:

~/Projekte/Haiku/haiku/build/jam> cat UserBuildConfig
# Add the optional package WonderBrush to the image.
AddHaikuImagePackages WonderBrush ;

~/Projekte/Haiku/haiku/build/jam> 
~/Projekte/Haiku/haiku/generated.x86_64> jam -q -j4 @nightly-anyboot
Starting build of type regular ... 
AddHaikuImagePackages: package WonderBrush not available! 
Building Haiku Nightly 

I also found some discussion on the freelist about this bug, but according them it should be already fixed:

There are also two more rules described in ‘UserBuildConfig.ReadMe’:

AddHaikuImageSystemPackages and AddOptionalHaikuImagePackages but they didn’t work either.

So I have two questions now :nerd_face:

Where do I have to put ‘wine-6.23-1-x86_64.hpkg’ package, so that jam can find it?
And which of the three rules:

AddHaikuImagePackages
AddHaikuImageSystemPackages
AddOptionalHaikuImagePackages

should I use?

Thanks in advance.

1 Like

AddHaikuImagePackages will only work for HaikuPorts packages which are referenced in build/jam/repositories/HaikuPorts/ and wine isn’t one of them.

1 Like

Thank you!
I have already thought that but it should be somehow possible to install local packages?
Or do you guys upload anything, when you test you packages?

You can install local packages while Haiku is running (using pkgman install or simply double click the package to open it in HaikuDepot). But you can’t easily do it from the buildsystem unless the packages are in our repositories. It may be possible to add it manually to the generated/downloads folder but you will need to change some things in Jamfiles (a bit more than just using AddHaikuImagePackages, the package needs to be declared first somewhere in build/jam/).

1 Like

It seems possible to add package to “download” directory and to Jamfile list.

1 Like

I’ve got it – finally :partying_face:

You can download the iso image with pre installed Wine package from here:
https://drive.google.com/file/d/1X3FB2A30hSEZODvfERu5wX7B6m6qIbFC/view?usp=sharing

The bad news is: Wine refuses to start in a live environment :roll_eyes:
I get this massage:

~> winecfg 
wine: created the configuration directory '/boot/home/.wine'
wineserver: bind: Operation not supported
~> 

Thank you guys, the hint with downloads directory was the game changer :+1:

Here a quick HowTo in case someone is also searching for a way to include pre compiled local packages in a nightly image.


Fist: compile the image like described on Haiku homepage.

Then copy your packages to $(HAIKU_TOP)/generated.x86_64/download directory.
In my case: libusb-1.0.24-1-x86_64.hpkg, libusb_compat-0.1.7-1-x86_64.hpkg, vulkan-1.2.203-1-x86_64.hpkg, wine-6.23-1-x86_64.hpkg packages.

Then edit the file: $(HAIKU_TOP)/build/jam/repositories/HaikuPorts/x86_64 and add your packages there.
Here are my changes:

~/Projekte/Haiku/haiku/build/jam/repositories/HaikuPorts> diff -uNr x86_64.orig x86_64
--- x86_64.orig 2022-02-03 14:06:14.061603840 +0100
+++ x86_64      2022-02-03 15:33:54.930611200 +0100
@@ -140,6 +140,8 @@
        libtheora_devel-1.1.1-7
        libtool-2.4.6-2
        libunistring-0.9.10-1
+       libusb-1.0.24-1
+       libusb_compat-0.1.7-1
        libvorbis-1.3.7-1
        libvorbis_devel-1.3.7-1
        libvpx-1.10.0-1
@@ -213,10 +215,12 @@
        tnftp-20151004-6
        unzip-6.10c23-4
        vision-0.10.6-2
+       vulkan-1.2.203-1
        wavpack-5.4.0-1
        wavpack_devel-5.4.0-1
        wget-1.21.1-1
        which-2.21-6
+       wine-6.23-1
        wpa_supplicant-2.9.haiku.1-3
        xz_utils-5.2.5-1
        xz_utils_devel-5.2.5-1
~/Projekte/Haiku/haiku/build/jam/repositories/HaikuPorts> 

Then edit the file: $(HAIKU_TOP)/build/jam/DefaultBuildProfiles
Look for the line: case "nightly-*" : {
In this section increase the HAIKU_IMAGE_SIZE from 600 to 650MB and add your packages to the list after AddHaikuImageSystemPackages rule.
Here are my changes:

~/Projekte/Haiku/haiku/build/jam> diff -uNr DefaultBuildProfiles.orig DefaultBuildProfiles 
--- DefaultBuildProfiles.orig   2022-02-03 14:06:14.058195968 +0100
+++ DefaultBuildProfiles        2022-02-03 17:59:57.951058432 +0100
@@ -130,16 +130,20 @@
                        if $(DEBUG) != 0 {
                                HAIKU_IMAGE_SIZE ?= 850 ;
                        }
-                       HAIKU_IMAGE_SIZE ?= 600 ;
+                       HAIKU_IMAGE_SIZE ?= 650 ;
                        HAIKU_NIGHTLY_BUILD = 1 ;
 
                        AddHaikuImageSystemPackages
+                               libusb
+                               libusb_compat
                                mandoc
                                noto
                                openssh
                                openssl
                                pe
                                vision
+                               vulkan
+                               wine
                                wpa_supplicant
                                # xz_utils can't be built with gcc2, so we install it for
                                # primary gcc 8 architectures or gcc 2 hybrids.
~/Projekte/Haiku/haiku/build/jam> 

Now go back to $(HAIKU_TOP)/generated.x86_64 directory and execute the jam command again.
In my case: jam -q -j4 @nightly-anyboot

That’s it - congratulation - jam should now produce a new image with your packages included :slight_smile:

An alternative approach would be, instead to add your packages to $(HAIKU_TOP)/build/jam/DefaultBuildProfiles, to create a new file $(HAIKU_TOP)/build/jam/UserBuildConfig and add the packages there (see also UserBuildConfig.ReadMe and UserBuildConfig.sample for some examples). Here is how it looks like:

~/Projekte/Haiku/haiku/build/jam> cat UserBuildConfig 
# Add the optional package Wine to the image.
AddHaikuImagePackages vulkan libusb libusb_compat wine ;
~/Projekte/Haiku/haiku/build/jam>

But there is one problem, instead to copy the packages to /boot/system/packages directory, the AddHaikuImagePackages rule, puts them in the /boot directory. Here is my output:

/boot> ls
home                               trash
libusb_compat-0.1.7-1-x86_64.hpkg  vulkan-1.2.203-1-x86_64.hpkg
libusb-1.0.24-1-x86_64.hpkg        wine-6.23-1-x86_64.hpkg
system
/boot>

– Bug :question:

So here is the answer to my question in the previous post - since DefaultBuildProfiles file use the AddHaikuImageSystemPackages rule and it seems to work, use it, instead of the AddHaikuImagePackages rule which is suggested in UserBuildConfig.sample file.

See also korlis comment bellow: Wine test image - #22 by korli


Happy testing :slight_smile:

7 Likes

Nice. I am thinking of tinkering around with it later today. Thanx! <3

Thanx 2. It is fun to test it eg. in a VM, but the lack of network support is a drawback for me. I hope X512 will update the package in the near future, with network enabled.

1 Like

Ill try on bare metal.

1 Like

Good luck andreas_dr and have fun, I’m waiting for new screenshots :slight_smile:

BTW: does anyone know how I can edit my first post?
I want to add the new link there, so people can profit from it, but don’t see the edit button, I see it only for my recent posts. Is it impossible?

1 Like

You need to have a certain level of activity (at least 10 posts? I do not remember tbh) to have this functionality enabled.

@Waffel I have upped your user level a bit, see if you can edit now.

2 Likes

When I’d like to add packages manually, I’d add in UserBuildConfig something like:

AddFilesToHaikuImage system packages : /home/korli/vulkan-1.2.203-1-x86_64.hpkg /home/korli/wine-6.23-1-x86_64.hpkg ;

2 Likes

“The bad news is: Wine refuses to start in a live environment :roll_eyes:
I get this massage:”

~> winecfg 
wine: created the configuration directory '/boot/home/.wine'
wineserver: bind: Operation not supported
~> 

A Google search on the server error message brings up similar cases. It can be to do with permissions, groups, server access to files, or interference from other programs:

https://serverfault.com/questions/425529/operation-not-permitted-when-starting-unicorn
https://stackoverflow.com/questions/58244704/how-to-fix-operation-not-permitted-in-http-listener

2 Likes

What type of live environment is this? If it’s an image written to a CD/DVD, that’s going to be read-only. Why not install to a VM or bare metal?

So far testing is not very successful.

~> wine64 --version
wine-6.23
~> wine64
Usage: wine PROGRAM [ARGUMENTS…] Run the specified program
wine --help Display this help and exit
wine --version Output version information and exit
~> winecfg
Kill Thread
~> wineserver
~> winepath
Kill Thread
~> wineboot
Kill Thread

It works for me, at least in a VM, actually Virt-Manager.
Did you tried the image or just the Wine package. It is the whole point of the custom image, that you can’t use the Wine package on a stock Haiku image yet. You have to patch the kernel and build your own image.

Man korli where were you a few days ago. This seems so legit and straight forward, that’s how I imagined it. Will give it a try when I have to build an image again - Thank you! :+1:

My bad :wink: missed that part about patching kernel. I’ve burnt haiku image to usb, mounted it. And just did pkgman install /Haiku1/system/packages/*.hpkg - Rebooted. Wine is working.

1 Like

Thank you for the links! My guess is also that the Wineserver is trying to establishing a socket connection or to put a PID file somewhere, but can’t do that, because there is a missing directory or it has the wrong file permission.

BTW: do we have to bother with file permissions on Haiku?