chiark / gitweb /
Added support for Atk and GInterface
[clg] / clg.system
index 654557dd5e457582c841e6c7f31b25adb1650492..eeafe11c43695f811ff567c120b5544584a9d243 100644 (file)
@@ -1,8 +1,17 @@
 ;;; -*- Mode: lisp -*-
 
-(setf
- (logical-pathname-translations "clg")
- '(("**;*.*.*" "/home/espen/src/clg/**/*.*.*")))
+(defpackage "CLG-SYSTEM"
+  (:use "COMMON-LISP" "EXTENSIONS" "ALIEN")
+  (:export "*GTK-LIBRARY-PATH*"))
+
+(in-package "CLG-SYSTEM")
+
+;; We used to do this, but I think it's better if everybody puts such
+;; definitions in his/her own Lisp startup files so that clg.system
+;; can be used without local modifications.
+;(setf
+; (logical-pathname-translations "clg")
+; '(("**;*.*.*" "/home/espen/src/clg/**/*.*.*")))
 
 ;; Uncomment and edit the next line if pkg-config needs to search for
 ;; .pc files in directories other than the default (/usr/lib/pkgconfig)
 (load "clg:tools;config")
 (load "clg:tools;sharedlib")
 
-(import 'alien:load-shared-library)
-
-(defvar gtk-library-path (pkg-variable "gtk+-2.0" "libdir"))
-(defvar cmucl-include-path "/usr/src/cmucl-2.4.20/src/lisp")
-
-
-;; A hack to get around a bug in gdk's init code
-(defvar argc (alien:make-alien c-call:int))
-(defvar progname (alien:make-alien c-call:char))
-(defvar argv0 (alien:make-alien (* c-call:char)))
-(defvar argv (alien:make-alien (* (* c-call:char))))
-(setf (alien:deref argc) 1)
-(setf (alien:deref progname) 0)
-(setf (alien:deref argv0) progname)
-(setf (alien:deref argv) argv0)
+(defvar *gtk-library-path* (pkg-variable "gtk+-2.0" "libdir"))
+(defvar *cmucl-include-path* (ext:unix-namestring "target:lisp"))
 
+;; Without this, MAKE uses "CLG:glib;.err" as a namestring, which fails.
+;; TODO: Find and fix the bug, then remove this.
 (setq mk::*cmu-errors-to-file* nil)
 
 (eval
  `(mk:defsystem clg
     :initially-do
     (progn
-      (pkg-exists-p "glib-2.0" :atleast-version "1.3.9")
-      (pkg-exists-p "pango" :atleast-version "0.20")
-      (pkg-exists-p "gtk+-2.0" :atleast-version "1.3.9"))
+      (pkg-exists-p "glib-2.0" :atleast-version "1.3.12")
+      (pkg-exists-p "pango" :atleast-version "0.23")
+      (pkg-exists-p "atk" :atleast-version "0.8")
+      (pkg-exists-p "gtk+-2.0" :atleast-version "1.3.12"))
     :source-pathname "clg:"
     :binary-pathname "clg:"
     :components
@@ -56,7 +55,7 @@
        (:cflags ,(pkg-cflags "glib-2.0")
                 :optimize 2
                 :definitions (#+cmu CMUCL)
-                :include-paths (,cmucl-include-path)))
+                :include-paths (,*cmucl-include-path*)))
        (:file "glib-package")
        (:file "gutils" :depends-on ("glib-package"))
        (:file "gforeign" :depends-on ("gutils"))
@@ -66,6 +65,7 @@
        (:file "gboxed" :depends-on ("gtype"))
        (:file "genums" :depends-on ("gtype"))
        (:file "gparam" :depends-on ("genums"))
+       (:file "ginterface" :depends-on ("gtype"))
        (:file "gobject" :depends-on ("gparam"))
        (:file "gcallback" :depends-on ("gtype" "gparam" "gobject" "callback"))
        (:file "glib-export"
        (load-shared-library "libgdk-x11-1.3.so"
         :init "gdk_init"
         :prototype '(function
-                     c-call:void (* c-call:int) (* (* (* char))))
-        :initargs (list argc argv)))
+                     c-call:void
+                     system-area-pointer
+                     system-area-pointer)
+        :initargs (list (system:int-sap 0) (system:int-sap 0))))
       :language :c
       :source-extension "c"
       :binary-extension "o"
         (:file "pango" :depends-on ("pango-package"))
         (:file "pango-export" :depends-on ("pango")))
        :depends-on (glib))
+     (:module atk
+      :initially-do (load-shared-library "libatk.so")
+       :components
+       ((:file "atk-package")
+        (:file "atk" :depends-on ("atk-package"))
+        (:file "atk-export" :depends-on ("atk")))
+       :depends-on (glib))
      (:file "gtkglue"
       :source-pathname "gtk;"
       :binary-pathname "gtk;"
         :init "gtk_init"
         :prototype '(function
                      c-call:void
-                     alien:system-area-pointer
-                     alien:system-area-pointer)
+                     system-area-pointer
+                     system-area-pointer)
         :initargs (list (system:int-sap 0) (system:int-sap 0))))
       :language :c
       :source-extension "c"
       :compiler-options (:cflags ,(pkg-cflags "gtk+-2.0")
                         :optimize 2
                         :definitions (#+cmu CMUCL)
-                        :include-paths (,cmucl-include-path)))
+                        :include-paths (,*cmucl-include-path*)))
      (:module gtk
       :components
       ((:file "gtk-package")
        (:file "gtkcontainer" :depends-on ("gtktypes"))
        (:file "gtk" :depends-on ("gtktypes"))
        (:file "gtkutils" :depends-on ("gtk")))
-      :depends-on (glib gdk pango "gtkglue")))))
-
-
-
+      :depends-on (glib gdk pango atk "gtkglue")))))