# how to prevent  ports from installing x11?



## Prezadent (Mar 12, 2011)

I ran [cmd=]make install[/cmd] on phpadmin and it looks like it is installing all of x11.  I really don't want x11 and am kind of ticked that this cascade of x11 crap is non stop installing itself on my computer, for a port that shouldn't require it. 

How can I prevent a port from contaminating my server with x11?  I don't want any part of x11.


----------



## mamalos (Mar 12, 2011)

If I am not mistaken you can put:


```
WITHOUT_X11=yes
```

in your /etc/make.conf and everything will work as you wish.


----------



## ckester (Mar 12, 2011)

If the port explicitly checks for and respects WITHOUT_X11, that's the best solution.  But there's no guarantee that every port does this.

Prezadent, which port were you installing that you think shouldn't require X11?  If we knew which one you're talking about, we could look at its Makefile (and also its dependencies) to see why it is pulling in the stuff you don't want.


----------



## Prezadent (Mar 12, 2011)

Thanks for the info on WITHOUT_X11.



			
				ckester said:
			
		

> If the port explicitly checks for and respects WITHOUT_X11, that's the best solution.  But there's no guarantee that every port does this.
> 
> Prezadent, which port were you installing that you think shouldn't require X11?  If we knew which one you're talking about, we could look at its Makefile (and also its dependencies) to see why it is pulling in the stuff you don't want.



It was phpmyadmin.  Very simple to install on WAMP.  But here it ended up auto dl'ing and installing a lot of stuff for a long time and I already had Apache, PHP and MySQL working.

Thanks


----------



## ckester (Mar 12, 2011)

Of the dependencies listed for databases/phpmyadmin, there are only two that pull in libX11:  graphics/php5-gd and print/pecl-pdflib.  

By default, the options related to these dependencies are set to ON.  You can disable them via the options dialog, or put something like the following in your /etc/make.conf:


```
.if ${.CURDIR:M*/databases/phpmyadmin}
WITHOUT_GD=yes
WITHOUT_PDF=yes
.endif
```


----------



## SirDice (Mar 14, 2011)

ckester said:
			
		

> there are only two that pull in libX11:  graphics/php5-gd and print/pecl-pdflib.


GD can be built without X11. Not sure about the other one.


----------



## ckester (Mar 14, 2011)

SirDice said:
			
		

> GD can be built without X11. Not sure about the other one.



As the options dialog states, pecl-pdflib implies php5-gd.

Yes, you could probably disable X11 at the level of php5-gd instead of phpmyadmin.  But after taking an admittedly quick look at the Makefiles, I couldn't see any way to do it that was as easy as setting the phpmyadmin options.


----------



## SirDice (Mar 14, 2011)

I like my server to be free of any X11 stuff :e


```
dice@williscorto:/usr/ports/graphics/php5-gd>make -DWITHOUT_X11 all-depends-list
/usr/ports/lang/php5
/usr/ports/devel/autoconf
/usr/ports/print/freetype2
/usr/ports/graphics/png
/usr/ports/graphics/jpeg
/usr/ports/devel/t1lib
/usr/ports/devel/pkg-config
/usr/ports/devel/pcre
/usr/ports/textproc/libxml2
/usr/ports/lang/perl5.10
/usr/ports/devel/m4
/usr/ports/misc/help2man
/usr/ports/devel/gmake
/usr/ports/devel/autoconf-wrapper
/usr/ports/devel/libtool
/usr/ports/converters/libiconv
/usr/ports/devel/p5-Locale-gettext
/usr/ports/devel/gettext
dice@williscorto:/usr/ports/graphics/php5-gd>
```

The port respects WITHOUT_X11 nicely.


----------



## ckester (Mar 14, 2011)

Thanks, SirDice, for confirming that WITHOUT_X11 will work in this particular case.  

As I said above, that wasn't immediately obvious to me.


----------



## Prezadent (Apr 6, 2011)

I get the message


```
Clearing /tmp (X related)
```

on bootup.  Why?  I'm almost sure X isn't on my machine.


----------



## DutchDaemon (Apr 6, 2011)

It's a default in /etc/defaults/rc.conf


```
clear_tmp_X="YES" 	# Clear and recreate X11-related directories in /tmp
```

Set it to NO in /etc/rc.conf is you lose sleep over it.


----------



## Prezadent (Apr 7, 2011)

Shouldn't the default be no?  Why would FreeBSD assume I have X installed?


----------



## wblock@ (Apr 7, 2011)

Because it's helpful if you have X installed and harmless if you don't.


----------



## Prezadent (Apr 7, 2011)

So X can't modify this file upon installation?

Also, are there any links to show usage stats of FreeBSD on desktop vs. server


----------



## wblock@ (Apr 7, 2011)

X isn't going to be modifying anything if it's not even installed.

A fair point can be made that a script which cleans up for X should come from the xorg ports and be in /usr/local/etc/rc.d.  I like that idea, it helps clean up the base and the port.  But there might be a good reason clear_tmp_X is still in the base, like timing.  Please post on the freebsd-x11 mailing list, or I can.  But I'm probably less motivated than you.


----------



## Prezadent (Apr 7, 2011)

wblock said:
			
		

> But I'm probably less motivated than you.



Do you have a pulse?  Got me beat.


----------

