Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#43582 closed defect (fixed)

surf: variant without x11 doesn't build

Reported by: mojca (Mojca Miklavec) Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc: shreevatsa.public@…, dbevans (David B. Evans)
Port:

Description

Based on the ticket #39383 I tried to patch surf:

  • Portfile

     
    2626                    port:flex \
    2727                    port:xorg-libXmu \
    2828                    port:jpeg \
    29                     port:tiff \
    30                     port:gtk1
     29                    port:tiff
    3130
    32 variant no_x11 {
    33     depends_lib-delete port:gtk1
    34     configure.args-append --disable-gui
     31configure.args      --disable-gui
     32
     33# remove this in May 2015
     34variant no_x11 conflicts x11 description {legacy compatibility variant} {}
     35variant x11 conflicts no_x11 description {} {
     36    depends_lib-append      port:gtk1
     37    configure.args-delete   --disable-gui
    3538}
     39if {[variant_isset no_x11]} {
     40    default_variants        -x11
     41} else {
     42    default_variants        +x11
     43}
    3644
    3745post-destroot {
    3846    copy ${worksrcpath}/examples ${destroot}${prefix}/share/${name}/

But the problem seems to be that surf fails to build without x11:

make[1]: *** No rule to make target `gtkgui/start.o', needed by `surf'.  Stop.

so I'm wondering whether it makes any sense to provide x11 as an option if building without gui support is broken anyway.

I have a few other questions:

  • Is flex a build or a runtime dependency?
  • If building without gtk1 would actually work
    • Is xorg-libXmu still needed?
    • Would it be better to call the variant gtk or x11?
  • The binary depends on a few other libraries here, but I'm not sure if those are true dependencies because I never rebuilt all the ports:
    • glib1
    • libiconv
    • zlib
    • xorg-libX11
    • xorg-libice
    • xorg-libsm
    • xorg-lbXt
    • xorg-libXext
  • Is it possible to build the port against gtk2 or gtk3?

Change History (7)

comment:1 Changed 10 years ago by dbevans (David B. Evans)

Referring to Makefile.am the --disable-gui directive will not be honored unless --disable-cups is also asserted. Having done this and deleting the dependency xorg-libXmu, the +no_x11 build still fails with this error

xwd.cc:54:10: fatal error: 'X11/Xlib.h' file not found
#include <X11/Xlib.h>
         ^
2 warnings generated.
1 error generated.
make[1]: *** [xwd.o] Error 1
make[1]: Leaving directory `/opt/local/var/macports/build/_opt_macports_trunk_dports_math_surf/surf/work/surf-1.0.6/image-formats'

So this shows that disabling the gui (gtk1) does not completely eliminate dependencies on X11. It's also needed to support X11 image file formats. To completely disable the need for X11 one would have to disable this support (via a patch) as well. See

image-formats/Makefile.am
image-formats/xbitmap.cc
image-formats/xbitmap.h
image-formats/xwd.cc
image-formats/xwd.h
Last edited 10 years ago by dbevans (David B. Evans) (previous) (diff)

comment:2 Changed 10 years ago by dbevans (David B. Evans)

Cc: devans@… added

Cc Me!

comment:3 Changed 10 years ago by dbevans (David B. Evans)

Given these results, I think I would add a +gui default variant instead of +x11 or +gtk and just drop the broken +no_x11 without any legacy variant.

Last edited 10 years ago by dbevans (David B. Evans) (previous) (diff)

comment:4 Changed 10 years ago by dbevans (David B. Evans)

To answer another question, to use gtk2 or gtk3 the gui code would undoubtedly need to be rewritten (redesigned?) due to significant API and HIG differences between gtk1 and the later versions.

comment:5 Changed 10 years ago by mojca (Mojca Miklavec)

Can you please add a patch or commit this? (I'm not sure that I understood what exactly you meant.)

The other ticket has been open for almost a year without any maintainer feedback, so committing a change should be ok.

gtk: thanks for clarification. I wasn't sure how much the code has changed in the meantime and wasn't sure whether the author actually took a look into this changes already.

comment:6 Changed 10 years ago by dbevans (David B. Evans)

Resolution: fixed
Status: newclosed

Committed in r119755. Added default variant +gui (to allow disabling with -gui) and removed +no_x11 because it was a misnomer and didn't work anyway. So no need for a legacy variant. xorg-libXmu is required only for +gui and the other X11 ports you mentioned are dependencies of xorg-libX11. A patch to configure was required to correctly allow disabling cups support (required to disable the GUI).

comment:7 Changed 10 years ago by mojca (Mojca Miklavec)

Thanks a lot for taking care of this. We're almost done with getting rid of no_x11.

Note: See TracTickets for help on using tickets.