Ticket #19241: Portfile-lablgtk2.diff.2

File Portfile-lablgtk2.diff.2, 2.5 KB (added by thomas.hutchinson@…, 15 years ago)

patch to portfile

Line 
1--- Portfile.orig       2009-04-08 16:49:45.000000000 +0200
2+++ Portfile    2009-04-08 17:37:28.000000000 +0200
3@@ -3,7 +3,7 @@
4 PortSystem                     1.0
5 
6 name                           lablgtk2
7-version                                2.10.1
8+version                                2.12.0
9 categories                     x11
10 maintainers                    pguyot@kallisys.net openmaintainer
11 description                    Objective Caml interface to gtk+ 2.x
12@@ -16,9 +16,9 @@
13 platforms                      darwin
14 master_sites           http://wwwfun.kurims.kyoto-u.ac.jp/soft/olabl/dist/
15 distname                       lablgtk-${version}
16-checksums                      md5 bd7073ca05e684e5d5a3d553371fd6e5 \
17-          sha1 6c6f273951059fc86b89337a5b10dfb866ca5f87 \
18-          rmd160 5dda1a7d5438ae57fb8c170b6459393c4af872a2
19+checksums                      md5 0e253128afee3cdc6e9b43c34b35984d \
20+          sha1 fe3a6499bf28be21d723e379e2e9a4d7b4798baa \
21+          rmd160 b64f17545e797d5b94e7d23ed02d6ef751485803
22 depends_lib                    bin:camlp4:ocaml \
23                                        lib:libgtk.2:gtk2 \
24                                        lib:libglade-2:libglade2 \
25@@ -26,9 +26,34 @@
26                                        lib:libgnomeui:libgnomeui
27 configure.args         --without-gl --without-rsvg --with-glade \
28                                        --with-gnomecanvas --with-gnomeui --without-panel \
29-                                       --without-gtkspell --without-gtksourceview
30+                                       --without-gtkspell --without-gtksourceview \
31+                                       --without-quartz
32 build.target           world
33 
34+if {![variant_isset quartz]} {
35+    default_variants    +x11
36+}
37+
38+pre-fetch {
39+    if {![variant_isset quartz] && ![variant_isset x11]} {
40+        error "Either +x11 or +quartz is required"
41+    }
42+}
43+
44+pre-configure {
45+    if {[file exists ${prefix}/lib/gtk-2.0/include/gdkconfig.h]} {
46+        set gtk_not_quartz [catch {exec grep -q GDK_WINDOWING_QUARTZ ${prefix}/lib/gtk-2.0/include/gdkconfig.h}]
47+        set gtk_not_x11 [catch {exec grep -q GDK_WINDOWING_X11 ${prefix}/lib/gtk-2.0/include/gdkconfig.h}]
48+        if {[variant_isset quartz] && ${gtk_not_quartz}} {
49+            error "+quartz variant selected, but gtk2+x11 is installed"
50+        } elseif {[variant_isset x11] && ${gtk_not_x11}} {
51+            error "+x11 variant selected, but gtk2+quartz is installed"
52+        }
53+    } else {
54+        error "Cannot find gdkconfig.h"
55+    }
56+}
57+
58 variant rsvg description "enable rsvg support" {
59        configure.args-delete   --without-rsvg
60        configure.args-append   --with-rsvg
61@@ -41,5 +66,13 @@
62        depends_lib-append              port:gtksourceview
63 }
64 
65+variant x11 conflicts quartz description {Enable rendering in X11 (default)} {
66+}
67+
68+variant quartz conflicts x11 description "Enable Quartz rendering" {
69+       configure.args-delete   --without-quartz
70+       configure.args-append   --with-quartz
71+}
72+
73 livecheck.check        regex
74 livecheck.regex        {<DT> <a href="dist/lablgtk-(2.*?).tar.gz">lablgtk-\1.tar.gz</a>}