Re: How to get a static binary from ports

2007-09-07 Thread Karol Kwiatkowski
Karol Kwiatkowski wrote:
 Hi all,
 
 to keep it short:
 
 is there any ports knob to statically link binaries?
 If not, what steps should I take to modify a port?
 
 longer version:
 
 I'm trying to get a static binary out of the port. I thought it should
 be straight and easy, but I'm lost right now.
 
 The port in question is databases/rrdtool, uses libtool:15, gnu
 configure, gmake, etc.
 
 Normally, this port builds rrdtool binary which is dynamically linked
 (full path removed for brevity):
 
 # ldd (...)/work/rrdtool-1.2.23/src/.libs/rrdtool
 (...)/work/rrdtool-1.2.23/src/.libs/rrdtool:
 librrd.so.2 = not found (0x0)
 libfreetype.so.9 = /usr/local/lib/libfreetype.so.9 (0x28085000)
 libpng.so.5 = /usr/local/lib/libpng.so.5 (0x280ef000)
 libz.so.4 = /lib/libz.so.4 (0x28115000)
 libart_lgpl_2.so.5 = /usr/local/lib/libart_lgpl_2.so.5 (0x28127000)
 libm.so.5 = /lib/libm.so.5 (0x2813c000)
 libc.so.7 = /lib/libc.so.7 (0x28151000)
 
 With 'make CFLAGS+=-static' I get:
 
 # ldd (...)/work/rrdtool-1.2.23/src/rrdtool
 (...)/work/rrdtool-1.2.23/src/rrdtool:
 libfreetype.so.9 = /usr/local/lib/libfreetype.so.9 (0x280cb000)
 libpng.so.5 = /usr/local/lib/libpng.so.5 (0x28135000)
 libz.so.4 = /lib/libz.so.4 (0x2815b000)
 libart_lgpl_2.so.5 = /usr/local/lib/libart_lgpl_2.so.5 (0x2816d000)
 libm.so.5 = /lib/libm.so.5 (0x28182000)
 libc.so.7 = /lib/libc.so.7 (0x28197000)
 
 librrd.so.2 is now included statically, but the rest is not. I tried
 various configure options like --enable-static, --disable-shared, also
 added '-static' to CFLAGS and/or LDFLAGS in Makefile plus various
 combinations of the above but that doesn't make a difference.
 
 How can I include the rest of the libraries in the binary?

OK, it seems it's a problem with rrdtool's build suite, and not only
I've got problems with it[1].

For the archives, in case of rrdtool's port, a simple workaround is to
patch src/Makefile (exists after 'configure' part, so those patches are
host's dependent):

# cat src_Makefile.patch
--- src/Makefile.orig   2007-09-06 14:01:07.0 +0200
+++ src/Makefile2007-09-06 15:13:15.0 +0200
@@ -183,7 +183,7 @@
 INSTALL_PROGRAM = install  -s -o root -g wheel -m 555
 INSTALL_SCRIPT = install  -o root -g wheel -m 555
 INSTALL_STRIP_PROGRAM = ${SHELL} $(install_sh) -c -s
-LDFLAGS = -L/usr/local/lib
+LDFLAGS = -all-static -L/usr/local/lib
 LIBOBJS =
 LIBS =
 LIBTOOL = $(SHELL) /usr/local/bin/libtool


And while we're here it might be worth changing path to default font so
the binary can work as a 'standalone' (here to 'current'):

@@ -301,7 +301,7 @@
 #
 #ACLOCAL_M4   = $(top_srcdir)/config/aclocal.m4
 #AUTOHEADER = ${SHELL}
/mnt/big/FreeBSD/work/usr/ports/databases/rrdtool/work/rrdtool-1.2.23/missing
--run autoheader --localdir=$(top_srcdir)/config
-fontsdir = $(datadir)/rrdtool/fonts
+fontsdir = .
 fonts_DATA = DejaVuSansMono-Roman.ttf
 AM_CPPFLAGS = -DRRD_DEFAULT_FONT=\$(RRD_DEFAULT_FONT)\ -DNUMVERS=1.2023
 UPD_C_FILES = \


Cheers and thanks for the pointers.

Karol

[1] http://ramblingfoo.blogspot.com/2007/08/softfloat-rrdtool-sequel.html

-- 
Karol Kwiatkowski   karol.kwiat at gmail dot com
OpenPGP 0x06E09309



signature.asc
Description: OpenPGP digital signature


Re: How to get a static binary from ports

2007-09-06 Thread Karol Kwiatkowski
Jeremy Chadwick wrote:
 On Wed, Sep 05, 2007 at 08:45:15PM +0200, Karol Kwiatkowski wrote:
 Hi all,

 to keep it short:

 is there any ports knob to statically link binaries?
 If not, what steps should I take to modify a port?

 # ldd (...)/work/rrdtool-1.2.23/src/rrdtool
 (...)/work/rrdtool-1.2.23/src/rrdtool:
 libfreetype.so.9 = /usr/local/lib/libfreetype.so.9 (0x280cb000)
 libpng.so.5 = /usr/local/lib/libpng.so.5 (0x28135000)
 libz.so.4 = /lib/libz.so.4 (0x2815b000)
 libart_lgpl_2.so.5 = /usr/local/lib/libart_lgpl_2.so.5 (0x2816d000)
 libm.so.5 = /lib/libm.so.5 (0x28182000)
 libc.so.7 = /lib/libc.so.7 (0x28197000)

 librrd.so.2 is now included statically, but the rest is not. I tried
 various configure options like --enable-static, --disable-shared, also
 added '-static' to CFLAGS and/or LDFLAGS in Makefile plus various
 combinations of the above but that doesn't make a difference.

 How can I include the rest of the libraries in the binary?
 
 Why do you need this suite of applications statically-linked?  There
 are many downsides to using statically-linked binaries, and many
 positives to using shared libraries.  If you want to know the pros and
 cons to static (the cons outweigh the pros), I will be more than happy
 to provide you a detailed explanation.

Yes, I'm aware of this. I was asked to do that so that the binary can be
run on other systems. That's not my idea but as I understand, they can
use only static binaries on some hosts.

 To directly answer your question: you need to build all the rest of
 those libraries as static as well; that is to say, you need
 libfreetype.a, libpng.a, libart_lgpl_2.a and so on.

As Scot pointed in another email, I've already got them (.a files)
The only step I'm missing is hot to include them in final binary instead
of linking to .so libraries.

 AFAIK, there is no easy way to do this.  Each port has to be built
 with static capabilities.  I believe an example port which does this
 is net/cvsup, using either the STATIC or WITH_STATIC knob.

Hmm... I've looked at cvsup but it's using M3FLAGS. I'll take a look at
other ports, thanks for the tip!

Cheers,

Karol

-- 
Karol Kwiatkowski   karol.kwiat at gmail dot com
OpenPGP 0x06E09309



signature.asc
Description: OpenPGP digital signature


How to get a static binary from ports

2007-09-05 Thread Karol Kwiatkowski
Hi all,

to keep it short:

is there any ports knob to statically link binaries?
If not, what steps should I take to modify a port?

longer version:

I'm trying to get a static binary out of the port. I thought it should
be straight and easy, but I'm lost right now.

The port in question is databases/rrdtool, uses libtool:15, gnu
configure, gmake, etc.

Normally, this port builds rrdtool binary which is dynamically linked
(full path removed for brevity):

# ldd (...)/work/rrdtool-1.2.23/src/.libs/rrdtool
(...)/work/rrdtool-1.2.23/src/.libs/rrdtool:
librrd.so.2 = not found (0x0)
libfreetype.so.9 = /usr/local/lib/libfreetype.so.9 (0x28085000)
libpng.so.5 = /usr/local/lib/libpng.so.5 (0x280ef000)
libz.so.4 = /lib/libz.so.4 (0x28115000)
libart_lgpl_2.so.5 = /usr/local/lib/libart_lgpl_2.so.5 (0x28127000)
libm.so.5 = /lib/libm.so.5 (0x2813c000)
libc.so.7 = /lib/libc.so.7 (0x28151000)

With 'make CFLAGS+=-static' I get:

# ldd (...)/work/rrdtool-1.2.23/src/rrdtool
(...)/work/rrdtool-1.2.23/src/rrdtool:
libfreetype.so.9 = /usr/local/lib/libfreetype.so.9 (0x280cb000)
libpng.so.5 = /usr/local/lib/libpng.so.5 (0x28135000)
libz.so.4 = /lib/libz.so.4 (0x2815b000)
libart_lgpl_2.so.5 = /usr/local/lib/libart_lgpl_2.so.5 (0x2816d000)
libm.so.5 = /lib/libm.so.5 (0x28182000)
libc.so.7 = /lib/libc.so.7 (0x28197000)

librrd.so.2 is now included statically, but the rest is not. I tried
various configure options like --enable-static, --disable-shared, also
added '-static' to CFLAGS and/or LDFLAGS in Makefile plus various
combinations of the above but that doesn't make a difference.

How can I include the rest of the libraries in the binary?

Thanks in advance.

Karol

-- 
Karol Kwiatkowski   karol.kwiat at gmail dot com
OpenPGP 0x06E09309



signature.asc
Description: OpenPGP digital signature


error installing xorg-libraries in /usr/local

2007-03-30 Thread Karol Kwiatkowski
Hello all,

maybe it's a classic PBKAC but I can't figure it out. Anyone
successfully installed xorg-libraries with X11BASE=/usr/local?

I get 'make: don't know how to make
/usr/local/include/X11/fonts/fontmisc.h' error while installing. The
command is 'portupgrade -fRp xorg-libraries'. I'm using gcc41, but with
default gcc it doesn't make any difference. Details below.

Thanks,

Karol


environment:
FreeBSD i386 7.0-CURRENT, xorg-server-6.9.0_6

make.conf [1]:

---%
WRKDIRPREFIX=/mnt/big/FreeBSD/work
DISTDIR=/mnt/big/FreeBSD/distfiles
PACKAGES=/mnt/big/FreeBSD/packages
X11BASE=/usr/local

# compiler (use gcc41, except for...)
.if ! ( ${.CURDIR:M/usr/src*} || ${.CURDIR:M/usr/obj*} \
 || ${.CURDIR:M/mnt/big/FreeBSD/obj*} \
 || ${.CURDIR:M/usr/ports/lang/gcc41*} \
 || ${.CURDIR:M/usr/ports/net/wireshark*} )
CC=/usr/local/bin/gcc41
CXX=/usr/local/bin/g++41
.endif
---%

install error [2]:

---%
install in lib/Xcursor done
installing in lib/Xcomposite...
+ /usr/bin/install -c -m 0755 libXcomposite.so.1 /usr/local/lib
+ rm -f /usr/local/lib/libXcomposite.so
+ ln -s libXcomposite.so.1 /usr/local/lib/libXcomposite.so
/usr/bin/install -c -m 0644 libXcomposite.a /usr/local/lib
ranlib  /usr/local/lib/libXcomposite.a
+ /usr/bin/install -c -m 0444 Xcomposite.h
/usr/local/include/X11/extensions
/usr/bin/install -c -m 0444 xcomposite.pc
/usr/local/libdata/pkgconfig/xcomposite.pc
install in lib/Xcomposite done
installing in lib/font...
making all in lib/font/bitmap...
making all in lib/font/fontfile...
making all in lib/font/fc...
making all in lib/font/Type1...
making all in lib/font/FreeType...
make: don't know how to make /usr/local/include/X11/fonts/fontmisc.h. Stop
*** Error code 2

Stop in
/mnt/big/FreeBSD/work/usr/ports/x11/xorg-libraries/work/xc/lib/font.
*** Error code 1
---  Restoring the old version
! x11/xorg-libraries (xorg-libraries-6.9.0_1)   (install error)
---  Packages processed: 0 done, 0 ignored, 0 skipped and 1 failed
---%

[1] full make.conf:
http://www.orchid.homeunix.org/freebsd/config/persephone/CURRENT-make.conf
[2] full install log:
http://www.orchid.homeunix.org/freebsd/logs/xorg-libraries.install-error

-- 
Karol Kwiatkowski   karol.kwiat at gmail dot com
OpenPGP 0x06E09309



signature.asc
Description: OpenPGP digital signature


Re: enlightenment-devel does not compile

2007-03-15 Thread Karol Kwiatkowski
Laganakos Vassilis wrote:
 Hi,
 
 I've got a problem compiling enlightenment-devel after the port's
 upgrade. I get the following error:
 
 
 ===  Building for enlightenment-20070223,1
 gmake  all-recursive
 gmake[1]: Entering directory 
 `/usr/ports/x11-wm/enlightenment-devel/work/e-20070223'
 Making all in src
 gmake[2]: Entering directory 
 `/usr/ports/x11-wm/enlightenment-devel/work/e-20070223/src'
 Making all in bin
 gmake[3]: Entering directory 
 `/usr/ports/x11-wm/enlightenment-devel/work/e-20070223/src/bin'
 cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../../src/bin -I../../src/lib
 -DUSE_E_CONFIG_H -I/usr/local/include -I/usr/local/include
 -I/usr/local/include -I/usr/local/include -I/usr/local/include
 -I/usr/local/include -I/usr/local/include -I/usr/X11R6/include
 -DLOWRES_PDA=1 -DMEDIUMRES_PDA=2 -DHIRES_PDA=3 -DSLOW_PC=4 -DMEDIUM_PC=5
 -DFAST_PC=6 -DE17_PROFILE=SLOW_PC -DPACKAGE_BIN_DIR=\/usr/local/bin\
 -DPACKAGE_LIB_DIR=\/usr/local/lib\
 -DPACKAGE_DATA_DIR=\/usr/local/share/enlightenment\
 -DLOCALE_DIR=\/usr/local/share/locale\
 -DPACKAGE_SYSCONF_DIR=\/usr/local/etc\  -I/usr/local/include
 -I/usr/X11R6/include  -I/usr/local/include -I/usr/X11R6/include -O -pipe
 -MT e_main.o -MD -MP -MF .deps/e_main.Tpo -c -o e_main.o e_main.c
 
 In file included from e_main.c:4:
 e.h:66:24: Ecore_DBus.h: No such file or directory
 gmake[3]: *** [e_main.o] Error 1
 gmake[3]: Leaving directory 
 `/usr/ports/x11-wm/enlightenment-devel/work/e-20070223/src/bin'
 gmake[2]: *** [all-recursive] Error 1
 gmake[2]: Leaving directory 
 `/usr/ports/x11-wm/enlightenment-devel/work/e-20070223/src'
 gmake[1]: *** [all-recursive] Error 1
 gmake[1]: Leaving directory 
 `/usr/ports/x11-wm/enlightenment-devel/work/e-20070223'
 gmake: *** [all] Error 2
 *** Error code 2
 
 Stop in /usr/ports/x11-wm/enlightenment-devel.
 
 I use freebsd6-stable.
 
 Any ideas about this?

Yeah, I had this too. You'll need to recompile x11/ecore with dbus support.

HTH,

Karol

-- 
Karol Kwiatkowski   karol.kwiat at gmail dot com
OpenPGP 0x06E09309



signature.asc
Description: OpenPGP digital signature


Re: PHP 5.2.1

2007-03-12 Thread Karol Kwiatkowski
gareth wrote:
 On Sun 2007-03-04 (19:26), Uwe Grohnwaldt wrote:
 For the error lookbehind assertion is not fixed length or
 lookahead... this will work again after deleting devel/pcre and
 installing devel/pcre-utf8 instead, afterwards recompile php5-pcre and
 other dependencies.
 I have found that afterwards the pcre-functions in php work fine, this
 also occures in some pear-libs, and hit my Horde installation...

 For Wordpress with php5.2.1 I suggest you take also a look at
 http://trac.wordpress.org/ticket/3886, which is a bug that shows up in
 wordpress after upgrading to php5.2.1 for all web visitors behind
 proxies (like squid).
 Hi,
 good hint. a portupgrade -frR pcre-utf8-7.0 and portupgrade -frR
 php5-pcre-5.2.1_3 later, my problems are blown away :)
 
 hi, i've just run into this too. what if devel/pcre-utf8 has now been removed?

devel/pcre now has UTF-8 support enabled by default. Use devel/pcre or,
if you already have devel/pcre-utf-8 installed, 'portupgrade -o
devel/pcre pcre-utf8' should take care of that (add '-f' if necessary).

HTH,

Karol

-- 
Karol Kwiatkowski   karol.kwiat at gmail dot com
OpenPGP 0x06E09309



signature.asc
Description: OpenPGP digital signature


Re: portupgrade-2.2.2_1,2 corrupts portsdb

2007-01-31 Thread Karol Kwiatkowski
Csaba Molnar wrote:
 I deleted /var/db/pkg/pkgdb.db, then rebuilt it with pkgdb -u I think, and 
 that seems to have worked. 
 
 While I was updating ports before this error showed up, the options screen 
 for 
 portupgrade showed up - and option WITH_BDB4 was unchecked. I changed that 
 (so portupgrade was now built with bdb4) - and the problems began right after 
 this update. 

To help to narrow the problem (both using portsnap and today's ports tree):

FreeBSD 6.2-STABLE
portupgrade-2.2.2_1,2
ruby18-bdb-0.5.9_2
db44-4.4.20.4
format:bdb_btree
= problem

FreeBSD 6.2-RELEASE
portupgrade-2.2.2_1,2
ruby18-bdb-0.5.9_2
db44-4.4.20.4
format:dbm_hash
= no problem

HTH,

Karol

-- 
Karol Kwiatkowski   karol.kwiat at gmail dot com
OpenPGP 0x06E09309



signature.asc
Description: OpenPGP digital signature


bsdstats 5.3 on 6-STABLE and netcat weirdness

2006-12-06 Thread Karol Kwiatkowski
Hello,

I'm not sure what's to blame here: bsdstats port, ports, portupgrade
or me :)

I've got two problems - 'make clean' is cleaning net/netcat work
directory (even though on 6-STABLE nc is a part of base system) and,
more importantly, pkgdb reports stale dependency.

That started after adding this line to the Makefile (ports/106373):
RUN_DEPENDS=nc:${PORTSDIR}/net/netcat

I haven't seen any problem reports, is it just me? Details below.

Best regards,

Karol


# uname -srp
FreeBSD 6.2-PRERELEASE i386
# which nc
/usr/bin/nc

# pkgdb -F
---  Checking the package registry database
# cd /usr/ports/sysutils/bsdstats/
# make install clean
===  Extracting for bsdstats-5.3
===  Patching for bsdstats-5.3
===  Configuring for bsdstats-5.3
===  Installing for bsdstats-5.3
===   bsdstats-5.3 depends on executable in : nc - found
===   Generating temporary packing list
[ snipped ]
===   Registering installation for bsdstats-5.3
===  Cleaning for netcat-1.10_2
===  Cleaning for bsdstats-5.3
# pkgdb -F
---  Checking the package registry database
[Updating the pkgdb format:bdb_btree in /var/db/pkg ... - 640
packages found (-0 +1) . done]
Stale dependency: bsdstats-5.3 - netcat-1.10_2 (net/netcat):
netpbm-10.26.34 (score:17%) ? ([y]es/[n]o/[a]ll) [no]

-- 
Karol Kwiatkowski  freebsd at orchid dot homeunix dot org
OpenPGP: http://www.orchid.homeunix.org/carlos/gpg/0x06E09309.asc



signature.asc
Description: OpenPGP digital signature


Re: fetch info

2006-11-09 Thread Karol Kwiatkowski
On 09/11/2006 15:15, gareth wrote:
 hey guys, i'm struggling to find out how to do this, for example from
 the help page:
 
 http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/ports-using.html
 
 # cd /usr/ports/sysutils/lsof
 # make
 lsof_4.57D.freebsd.tar.gz doesn't seem to exist in /usr/ports/distfiles/.
 Attempting to fetch from ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/.
 ===  Extracting for lsof-4.57
 
 
 how do i figure out before typing make what that url is? (the filename
 part seems to be under 'distinfo'). for instance i'd like to download
 all the necessary tarballs before running 'portupgrade' to make the
 actual upgrade quicker.

Have a look at 'man 7 ports', especially fetch, fetch-recursive,
fetch-list and fetch-recursive-list targets.

As for portupgrade, it has a -F (--fetch-only) option to do just that.

HTH

Karol

-- 
Karol Kwiatkowski  freebsd at orchid dot homeunix dot org
OpenPGP: http://www.orchid.homeunix.org/carlos/gpg/0x06E09309.asc



signature.asc
Description: OpenPGP digital signature