etrombly / rust-crosscompile

docker for cross compiling rust gtk programs to windows
35 stars 6 forks source link

GTK-4 Support #8

Open MGlolenstine opened 3 years ago

MGlolenstine commented 3 years ago

As I've used this Docker image for GTK+ 3 builds, I'm wondering if there are any plans to support GTK4?

etrombly commented 3 years ago

Eventually, yes. I primarily use relm, so I wasn't going to look into it into relm supports gtk4. I just looked quick and didn't see a mingw64-gtk4 package for fedora, but I'm not sure if that's the naming convention they'll be using.

MGlolenstine commented 3 years ago

I don't know much about Fedora,, but there's mingw-w64-gtk4 in msys2. Would this help?

etrombly commented 3 years ago

just searched and the packages aren't in fedora yet. I'll keep an eye out.

MGlolenstine commented 3 years ago

Thanks!

MGlolenstine commented 3 years ago

It has taken me a few (22) days, but I've gotten a relm4 example app working. I've made a fedora container, that works pretty similar to this one. The code will be public soon enough.

I was wondering how you fixed the problems with case-insensitivity when linking. I've tried compiling my personal project, which relies on winapi, so when it tried to compile and link Iphlpapi, it couldn't find it. MinGW had a library called libiphlpapi installed, which I copied into libIphlpapi and it compiled correctly.

Is there a way to emulate Windows' case insensitivity?

etrombly commented 3 years ago

I actually haven't run into any case issues before. You can turn on case insensitive support for ext4 if you have a recent kernel. Here's instructions on setting it up with a loopback file, so you don't mess up any existing partitions:

dd if=/dev/zero of=fs.img bs=4M count=100
fdisk fs.img
#create a new partition and select the defaults
losetup --partscan --show --find fs.img
sudo mkfs -t ext4 -O casefold /dev/loop0
sudo mkdir /mnt/code
sudo mount /dev/loop0 /mnt/code
sudo mkdir /mnt/code/rust
sudo chattr +F /mnt/code/rust/

that will make a 400MB image mounted at /mnt/code and create a directory called rust that is case-insensitive. Then you can copy your code over to that directory and point the docker image to it like normal.

MGlolenstine commented 3 years ago

I think that the above wouldn't be great for a public project because people could easily mistype the dd command, but it is a nice idea to tinker with :)

I have come up with a way to compile GTK4 manually. I tried making an RPM for it but couldn't really figure out the Fedora build system or make it work with me, so I packaged it into a nice docker image.

It can be found here, and it does support multiple languages or build systems with customisable images (yours does too, don't get me wrong).

I still have a bit to go, mainly removing unnecessary .dll files and adding theming support, but it compiles and runs GTK4 projects.

I did use your package script with a few changes to make it work.