rhx / SwiftGtk

A Swift wrapper around gtk-3.x and gtk-4.x that is largely auto-generated from gobject-introspection
https://rhx.github.io/SwiftGtk/
BSD 2-Clause "Simplified" License
317 stars 26 forks source link

Help building in archlinux #3

Closed lf-araujo closed 7 years ago

lf-araujo commented 7 years ago

Thank you for the wrapper.

It does not build at the moment in an Archlinux machine. I have installed the dependencies, but while trying to build, I get:

luis@pc SwiftGtk $ ./build.sh 
Fetching https://github.com/rhx/CGtk.git
Fetching https://github.com/rhx/SwiftGdk.git
Fetching https://github.com/rhx/SwiftAtk.git
Fetching https://github.com/rhx/CGdk.git
Fetching https://github.com/rhx/SwiftGdkPixbuf.git
Fetching https://github.com/rhx/SwiftPangoCairo.git
Fetching https://github.com/rhx/CGdkPixbuf.git
Fetching https://github.com/rhx/SwiftGIO.git
Fetching https://github.com/rhx/SwiftGModule.git
Fetching https://github.com/rhx/SwiftGObject.git
Fetching https://github.com/rhx/SwiftGLib.git
Fetching https://github.com/rhx/CGLib.git
Fetching https://github.com/rhx/SwiftCairo.git
Fetching https://github.com/rhx/SwiftPango.git
Fetching https://github.com/rhx/CCairo.git
Fetching https://github.com/rhx/CPango.git
Fetching https://github.com/rhx/CAtk.git
Cloning https://github.com/rhx/CGdk.git
Resolving https://github.com/rhx/CGdk.git at 1.0.5
Cloning https://github.com/rhx/SwiftGModule.git
Resolving https://github.com/rhx/SwiftGModule.git at 2.52.0
Cloning https://github.com/rhx/SwiftGdkPixbuf.git
Resolving https://github.com/rhx/SwiftGdkPixbuf.git at 2.52.0
Cloning https://github.com/rhx/CPango.git
Resolving https://github.com/rhx/CPango.git at 1.0.3
Cloning https://github.com/rhx/CGLib.git
Resolving https://github.com/rhx/CGLib.git at 1.0.16
Cloning https://github.com/rhx/CAtk.git
Resolving https://github.com/rhx/CAtk.git at 1.0.1
Cloning https://github.com/rhx/CGtk.git
Resolving https://github.com/rhx/CGtk.git at 1.0.14
Cloning https://github.com/rhx/SwiftCairo.git
Resolving https://github.com/rhx/SwiftCairo.git at 2.52.0
Cloning https://github.com/rhx/CGdkPixbuf.git
Resolving https://github.com/rhx/CGdkPixbuf.git at 1.0.1
Cloning https://github.com/rhx/SwiftPangoCairo.git
Resolving https://github.com/rhx/SwiftPangoCairo.git at 2.52.0
Cloning https://github.com/rhx/SwiftGdk.git
Resolving https://github.com/rhx/SwiftGdk.git at 3.22.0
Cloning https://github.com/rhx/CCairo.git
Resolving https://github.com/rhx/CCairo.git at 1.0.2
Cloning https://github.com/rhx/SwiftGObject.git
Resolving https://github.com/rhx/SwiftGObject.git at 2.52.0
Cloning https://github.com/rhx/SwiftGIO.git
Resolving https://github.com/rhx/SwiftGIO.git at 2.52.0
Cloning https://github.com/rhx/SwiftAtk.git
Resolving https://github.com/rhx/SwiftAtk.git at 2.52.0
Cloning https://github.com/rhx/SwiftGLib.git
Resolving https://github.com/rhx/SwiftGLib.git at 2.52.0
Cloning https://github.com/rhx/SwiftPango.git
Resolving https://github.com/rhx/SwiftPango.git at 2.52.0
Cloning into 'gir2swift'...
remote: Counting objects: 1280, done.
remote: Compressing objects: 100% (25/25), done.
remote: Total 1280 (delta 13), reused 0 (delta 0), pack-reused 1255
Receiving objects: 100% (1280/1280), 207.49 KiB | 157.00 KiB/s, done.
Resolving deltas: 100% (858/858), done.
Fetching https://github.com/rhx/SwiftLibXML.git
Fetching https://github.com/rhx/CLibXML2.git
Cloning https://github.com/rhx/SwiftLibXML.git
Resolving https://github.com/rhx/SwiftLibXML.git at 1.2.0
Cloning https://github.com/rhx/CLibXML2.git
Resolving https://github.com/rhx/CLibXML2.git at 1.0.1
Compile Swift Module 'SwiftLibXML' (6 sources)
Compile Swift Module 'gir2swift' (14 sources)
Linking ./.build/debug/gir2swift
which: no parallel in (/tmp/SwiftGtk/.build/gir2swift/.build/debug:/tmp/SwiftGtk/.build/gir2swift/.build/debug:/tmp/SwiftGtk/.build/gir2swift/.build/debug:/home/luis/.dropbox-bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl)
Generate Swift Wrapper for SwiftAtk.git
Generate Swift Wrapper for SwiftCairo.git
Generate Swift Wrapper for SwiftGdk.git
Generate Swift Wrapper for SwiftGdkPixbuf.git
Generate Swift Wrapper for SwiftGIO.git
Generate Swift Wrapper for SwiftGLib.git
Generate Swift Wrapper for SwiftGModule.git
Generate Swift Wrapper for SwiftGObject.git
Generate Swift Wrapper for SwiftPangoCairo.git
Generate Swift Wrapper for SwiftPango.git
Compile Swift Module 'GLib' (2 sources)
Compile Swift Module 'GLibObject' (2 sources)
Compile Swift Module 'GModule' (3 sources)
Compile Swift Module 'Cairo' (5 sources)
Compile Swift Module 'Pango' (2 sources)
Compile Swift Module 'GIO' (3 sources)
Compile Swift Module 'Atk' (2 sources)
Compile Swift Module 'GdkPixbuf' (3 sources)
Compile Swift Module 'PangoCairo' (2 sources)
<module-includes>:1:10: note: in file included from <module-includes>:1:
#include "gdk_pixbuf_bridging.h"
         ^
/tmp/SwiftGtk/.build/checkouts/CGdkPixbuf.git--5377732117889198272/gdk_pixbuf_bridging.h:11:10: note: in file included from /tmp/SwiftGtk/.build/checkouts/CGdkPixbuf.git--5377732117889198272/gdk_pixbuf_bridging.h:11:
#include <gdk-pixbuf/gdk-pixbuf.h>
         ^
/usr/include/gdk-pixbuf-2.0/gdk-pixbuf/gdk-pixbuf.h:29:10: note: in file included from /usr/include/gdk-pixbuf-2.0/gdk-pixbuf/gdk-pixbuf.h:29:
#include <glib.h>
         ^
/usr/include/glib-2.0/glib.h:37:10: note: in file included from /usr/include/glib-2.0/glib.h:37:
#include <glib/gbookmarkfile.h>
         ^
/usr/include/glib-2.0/glib/gbookmarkfile.h:172:11: error: declaration of 'time_t' must be imported from module 'SwiftGlibc.POSIX.sys.types' before it is required
                                                    time_t          stamp,
                                                    ^
/usr/include/bits/types/time_t.h:8:18: note: previous declaration is here
typedef __time_t time_t;
                 ^
/tmp/SwiftGtk/.build/checkouts/SwiftGdkPixbuf.git-571112705337756641/Sources/SwiftGdkPixbuf.swift:1:8: error: could not build Objective-C module 'CGdkPixbuf'
import CGdkPixbuf
       ^
<module-includes>:1:10: note: in file included from <module-includes>:1:
#include "gdk_pixbuf_bridging.h"
         ^
/tmp/SwiftGtk/.build/checkouts/CGdkPixbuf.git--5377732117889198272/gdk_pixbuf_bridging.h:11:10: note: in file included from /tmp/SwiftGtk/.build/checkouts/CGdkPixbuf.git--5377732117889198272/gdk_pixbuf_bridging.h:11:
#include <gdk-pixbuf/gdk-pixbuf.h>
         ^
/usr/include/gdk-pixbuf-2.0/gdk-pixbuf/gdk-pixbuf.h:29:10: note: in file included from /usr/include/gdk-pixbuf-2.0/gdk-pixbuf/gdk-pixbuf.h:29:
#include <glib.h>
         ^
/usr/include/glib-2.0/glib.h:37:10: note: in file included from /usr/include/glib-2.0/glib.h:37:
#include <glib/gbookmarkfile.h>
         ^
/usr/include/glib-2.0/glib/gbookmarkfile.h:172:11: error: declaration of 'time_t' must be imported from module 'SwiftGlibc.POSIX.sys.types' before it is required
                                                    time_t          stamp,
                                                    ^
/usr/include/bits/types/time_t.h:8:18: note: previous declaration is here
typedef __time_t time_t;
                 ^
/tmp/SwiftGtk/.build/checkouts/SwiftGdkPixbuf.git-571112705337756641/Sources/SwiftGdkPixbuf.swift:1:8: error: could not build Objective-C module 'CGdkPixbuf'
import CGdkPixbuf
       ^
<module-includes>:1:10: note: in file included from <module-includes>:1:
#include "gdk_pixbuf_bridging.h"
         ^
/tmp/SwiftGtk/.build/checkouts/CGdkPixbuf.git--5377732117889198272/gdk_pixbuf_bridging.h:11:10: note: in file included from /tmp/SwiftGtk/.build/checkouts/CGdkPixbuf.git--5377732117889198272/gdk_pixbuf_bridging.h:11:
#include <gdk-pixbuf/gdk-pixbuf.h>
         ^
/usr/include/gdk-pixbuf-2.0/gdk-pixbuf/gdk-pixbuf.h:29:10: note: in file included from /usr/include/gdk-pixbuf-2.0/gdk-pixbuf/gdk-pixbuf.h:29:
#include <glib.h>
         ^
/usr/include/glib-2.0/glib.h:37:10: note: in file included from /usr/include/glib-2.0/glib.h:37:
#include <glib/gbookmarkfile.h>
         ^
/usr/include/glib-2.0/glib/gbookmarkfile.h:172:11: error: declaration of 'time_t' must be imported from module 'SwiftGlibc.POSIX.sys.types' before it is required
                                                    time_t          stamp,
                                                    ^
/usr/include/bits/types/time_t.h:8:18: note: previous declaration is here
typedef __time_t time_t;
                 ^
/tmp/SwiftGtk/.build/checkouts/SwiftGdkPixbuf.git-571112705337756641/Sources/SwiftGdkPixbuf.swift:1:8: error: could not build Objective-C module 'CGdkPixbuf'
import CGdkPixbuf
       ^
<unknown>:0: error: build had 1 command failures

What am I doing wrong?

rhx commented 7 years ago

It looks like on ArchLinux #include <sys/types.h> is required in the bridging headers. I have added this to CGdkPixBuf and the other C* wrappers now. Could you run ./distclean.sh and then check if ./build.sh and ./test.sh work for you now?

lf-araujo commented 7 years ago

Lovely,

Thanks for your time, it now goes further but stops at:

Fetching https://github.com/rhx/CGtk.git
Fetching https://github.com/rhx/SwiftGdk.git
Fetching https://github.com/rhx/SwiftAtk.git
Fetching https://github.com/rhx/CGdk.git
Fetching https://github.com/rhx/SwiftGdkPixbuf.git
Fetching https://github.com/rhx/SwiftPangoCairo.git
Fetching https://github.com/rhx/CGdkPixbuf.git
Fetching https://github.com/rhx/SwiftGIO.git
Fetching https://github.com/rhx/SwiftGModule.git
Fetching https://github.com/rhx/SwiftGObject.git
Fetching https://github.com/rhx/SwiftGLib.git
Fetching https://github.com/rhx/CGLib.git
Fetching https://github.com/rhx/SwiftCairo.git
Fetching https://github.com/rhx/SwiftPango.git
Fetching https://github.com/rhx/CCairo.git
Fetching https://github.com/rhx/CPango.git
Fetching https://github.com/rhx/CAtk.git
Cloning https://github.com/rhx/CGdk.git
Resolving https://github.com/rhx/CGdk.git at 1.0.6
Cloning https://github.com/rhx/SwiftGModule.git
Resolving https://github.com/rhx/SwiftGModule.git at 2.52.0
Cloning https://github.com/rhx/SwiftGLib.git
Resolving https://github.com/rhx/SwiftGLib.git at 2.52.0
Cloning https://github.com/rhx/CAtk.git
Resolving https://github.com/rhx/CAtk.git at 1.0.1
Cloning https://github.com/rhx/SwiftGObject.git
Resolving https://github.com/rhx/SwiftGObject.git at 2.52.0
Cloning https://github.com/rhx/SwiftGdkPixbuf.git
Resolving https://github.com/rhx/SwiftGdkPixbuf.git at 2.52.0
Cloning https://github.com/rhx/CGLib.git
Resolving https://github.com/rhx/CGLib.git at 1.0.17
Cloning https://github.com/rhx/SwiftPango.git
Resolving https://github.com/rhx/SwiftPango.git at 2.52.0
Cloning https://github.com/rhx/CGtk.git
Resolving https://github.com/rhx/CGtk.git at 1.0.15
Cloning https://github.com/rhx/CGdkPixbuf.git
Resolving https://github.com/rhx/CGdkPixbuf.git at 1.0.2
Cloning https://github.com/rhx/CPango.git
Resolving https://github.com/rhx/CPango.git at 1.0.3
Cloning https://github.com/rhx/SwiftGIO.git
Resolving https://github.com/rhx/SwiftGIO.git at 2.52.0
Cloning https://github.com/rhx/SwiftCairo.git
Resolving https://github.com/rhx/SwiftCairo.git at 2.52.0
Cloning https://github.com/rhx/SwiftPangoCairo.git
Resolving https://github.com/rhx/SwiftPangoCairo.git at 2.52.0
Cloning https://github.com/rhx/SwiftGdk.git
Resolving https://github.com/rhx/SwiftGdk.git at 3.22.0
Cloning https://github.com/rhx/CCairo.git
Resolving https://github.com/rhx/CCairo.git at 1.0.2
Cloning https://github.com/rhx/SwiftAtk.git
Resolving https://github.com/rhx/SwiftAtk.git at 2.52.0
Cloning into 'gir2swift'...
remote: Counting objects: 1280, done.
remote: Compressing objects: 100% (25/25), done.
remote: Total 1280 (delta 13), reused 0 (delta 0), pack-reused 1255
Receiving objects: 100% (1280/1280), 207.49 KiB | 176.00 KiB/s, done.
Resolving deltas: 100% (858/858), done.
Fetching https://github.com/rhx/SwiftLibXML.git
Fetching https://github.com/rhx/CLibXML2.git
Cloning https://github.com/rhx/SwiftLibXML.git
Resolving https://github.com/rhx/SwiftLibXML.git at 1.2.0
Cloning https://github.com/rhx/CLibXML2.git
Resolving https://github.com/rhx/CLibXML2.git at 1.0.1
Compile Swift Module 'SwiftLibXML' (6 sources)
Compile Swift Module 'gir2swift' (14 sources)
Linking ./.build/debug/gir2swift
which: no parallel in (/tmp/SwiftGtk/.build/gir2swift/.build/debug:/tmp/SwiftGtk/.build/gir2swift/.build/debug:/tmp/SwiftGtk/.build/gir2swift/.build/debug:/home/luis/.dropbox-bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl)
Generate Swift Wrapper for SwiftAtk.git
Generate Swift Wrapper for SwiftCairo.git
Generate Swift Wrapper for SwiftGdk.git
Generate Swift Wrapper for SwiftGdkPixbuf.git
Generate Swift Wrapper for SwiftGIO.git
Generate Swift Wrapper for SwiftGLib.git
Generate Swift Wrapper for SwiftGModule.git
Generate Swift Wrapper for SwiftGObject.git
Generate Swift Wrapper for SwiftPangoCairo.git
Generate Swift Wrapper for SwiftPango.git
Compile Swift Module 'GLib' (2 sources)
Compile Swift Module 'GLibObject' (2 sources)
Compile Swift Module 'GModule' (3 sources)
Compile Swift Module 'Atk' (2 sources)
Compile Swift Module 'Cairo' (5 sources)
Compile Swift Module 'GIO' (3 sources)
Compile Swift Module 'Pango' (2 sources)
Compile Swift Module 'GdkPixbuf' (3 sources)
Compile Swift Module 'PangoCairo' (2 sources)
Compile Swift Module 'Gdk' (2 sources)
Compile Swift Module 'Gtk' (2 sources)
/tmp/SwiftGtk/Sources/Gtk-3.0.swift:6468:14: warning: 'gtk_show_uri' is deprecated
    let rv = gtk_show_uri(cast(screen.ptr), uri, guint32(timestamp), &error)
             ^

Seems like it is not compatible with latest gtk??

rhx commented 7 years ago

Which version of gtk are you using?

(this is only a warning, though - so maybe see if the compiled "SwiftHelloGtk" from the other repository runs - it should open an empty window)

lf-araujo commented 7 years ago

My bad, my bad... Working great here! Thank you!

lf-araujo commented 7 years ago

My bad, my bad... Working great here! Thank you!