rgtk icon indicating copy to clipboard operation
rgtk copied to clipboard

Support Windows

Open dubcanada opened this issue 11 years ago • 9 comments
trafficstars

http://win32builder.gnome.org/ has unoffical builds for 3.10 for Windows. Also this is another reason to have #1 to allow Windows people to use 3.6.4 (the last "official" release).

Either way it would be nice to redo the Makefile (or switch to something slightly more cross platform like cmake) to allow for Windows support.

dubcanada avatar Jun 29 '14 23:06 dubcanada

We started to handle multiple versions (3.6, 3.8, 3.10 and 3.12). With this, it should be fine for Windows people to use it. For the Makefile, we already were speaking about using cmake because it's more pleasant to use. I think it'll be added in a near future.

GuillaumeGomez avatar Jun 29 '14 23:06 GuillaumeGomez

Window's dies while running rgtk-build at the moment. Access violation error for one of the pointers. Glue builds and appears to work fine.

dubcanada avatar Jul 01 '14 16:07 dubcanada

@jeremyletang and myself aren't developing under windows. We'll test more on this platform when the development will be in a more advanced stage I think. Feel free to create a pull request if you fix that issue and thank you for your interest.

GuillaumeGomez avatar Jul 07 '14 21:07 GuillaumeGomez

I played around with this a bunch, I just can't get past the rust compilation error. I am not sure if it is a Rust compiler error as there are a bunch of them on Windows. Or it is related to something else.

I reported it anyways https://github.com/rust-lang/rust/issues/15811

dubcanada avatar Aug 05 '14 12:08 dubcanada

The ICE on rust-lang/rust#15811 is triggered by src/gtk/signals.rs#L239:

signal!(show_help, ShowHelp(help_type : gtk::WidgetHelpType) -> bool)

which defines pub extern fn trampoline(widget: *mut ffi::C_GtkWidget, help_type: gtk::WidgetHelpType, ...) where struct WidgetHelpType; is empty. Is it intended? It seems like *mut WidgetHelpType is appropriate but I don't know details.

klutzy avatar Aug 14 '14 06:08 klutzy

@klutzy thanks for the help !

It seems that WidgetHelpType was an enum, if change this in my last commit, maybe this fix the ICE? Anyone on Windows can try ?

jeremyletang avatar Aug 14 '14 09:08 jeremyletang

I'll give it a try later today.

dubcanada avatar Aug 14 '14 12:08 dubcanada

(mozilla/rust#16484 fixed the ICE issue!) The remaining issue is that some codes assume pointer is 64-bit. (this seems relevant for 32-bit linux as well?)

--- a/src/cairo/fonts.rs
+++ b/src/cairo/fonts.rs
@@ -111,7 +111,7 @@ impl FontOptions{

     pub fn hash(&self) -> u64{
         unsafe{
-            ffi::cairo_font_options_hash(self.get_ptr())
+            ffi::cairo_font_options_hash(self.get_ptr()) as u64
         }
     }

--- a/src/gtk/traits/recentchooser.rs
+++ b/src/gtk/traits/recentchooser.rs
@@ -176,7 +176,7 @@ pub trait RecentChooser: traits::Widget {
     }

     fn get_uris(&self) -> Option<Vec<String>> {
-        let mut length = 0i64;
+        let mut length = 0;
         let tmp = unsafe { ffi::gtk_recent_chooser_get_uris(GTK_RECENT_CHOOSER(self.get_widget()), &mut length) }
         if tmp.is_null() {
@@ -184,7 +184,7 @@ pub trait RecentChooser: traits::Widget {
         } else {
             let mut ret = Vec::with_capacity(length as uint);

-            for count in range(0i64, length) {
+            for count in range(0, length) {
                 ret.push(unsafe { string::raw::from_buf(*tmp.offset(count as int) as *const u8) });
             }
             Some(ret)

diff --git a/src/gtk/widgets/recentinfo.rs b/src/gtk/widgets/recentinfo.rs
index be2aa4d..107d08c 100644
--- a/src/gtk/widgets/recentinfo.rs
+++ b/src/gtk/widgets/recentinfo.rs
@@ -115,7 +115,7 @@ impl RecentInfo {
     }

     pub fn get_applications(&self) -> Option<Vec<String>> {

         if tmp.is_null() {;
@@ -123,7 +123,7 @@ impl RecentInfo {recent_info_get_applications(GTK_RECENT_INFO(self.get_widget()), &mut length)         } else {
             let mut ret = Vec::with_capacity(length as uint);

-            for count in range(0i64, length) {
+            for count in range(0, length) {
                 ret.push(unsafe { string::raw::from_buf(*tmp.offset(count as int) as *const u8) });
             }
             Some(ret)
@@ -150,7 +150,7 @@ impl RecentInfo {
     }

     pub fn get_groups(&self) -> Option<Vec<String>> {
-        let mut length = 0i64;
+        let mut length = 0;
         let tmp = unsafe { ffi::gtk_recent_info_get_groups(GTK_RECENT_INFO(self.get_widget()), &mut length) };

         if tmp.is_null() {
@@ -158,7 +158,7 @@ impl RecentInfo {
         } else {
             let mut ret = Vec::with_capacity(length as uint);

-            for count in range(0i64, length) {
+            for count in range(0, length) {
                 ret.push(unsafe { string::raw::from_buf(*tmp.offset(count as int) as *const u8) });
             }
             Some(ret)

After touching some lines, I've succeeded to get librgtk.rlib. So the "build" issue is nearly done!

klutzy avatar Aug 14 '14 16:08 klutzy

Oh nice ! I like when bugs nearly disappear by themselves haha. Thanks !

GuillaumeGomez avatar Aug 14 '14 18:08 GuillaumeGomez