From owner-freebsd-ports@FreeBSD.ORG Fri Feb 9 13:52:05 2007 Return-Path: X-Original-To: freebsd-ports@freebsd.org Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 20E1D16A401 for ; Fri, 9 Feb 2007 13:52:05 +0000 (UTC) (envelope-from molnarcs@gmail.com) Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.190]) by mx1.freebsd.org (Postfix) with ESMTP id A6EE613C4B5 for ; Fri, 9 Feb 2007 13:52:02 +0000 (UTC) (envelope-from molnarcs@gmail.com) Received: by nf-out-0910.google.com with SMTP id m19so1101018nfc for ; Fri, 09 Feb 2007 05:51:59 -0800 (PST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:from:reply-to:to:subject:date:user-agent:mime-version:content-type:content-transfer-encoding:content-disposition:message-id; b=azxzfRubJsNZ6eNmjLGpbmJXD+gAeryEkvjxpIuFy6YHL+8gpzxp4LBH/sCZ11JHCLtXpN1cYkubeV5C1B6lH8yv6U129h1Y7DcH+TbJVoKk+MSMBdRjEAjjKyLIerJ3RKAGuGD6EZXGuET8mSouUtIT514ER3p0+zX4kYJflIo= Received: by 10.49.93.4 with SMTP id v4mr1413106nfl.1171029119375; Fri, 09 Feb 2007 05:51:59 -0800 (PST) Received: from mcsaba.ch.sh.unideb.hu ( [193.6.168.4]) by mx.google.com with ESMTP id l32sm15871294nfa.2007.02.09.05.51.58; Fri, 09 Feb 2007 05:51:58 -0800 (PST) From: Csaba Molnar To: freebsd-ports@freebsd.org Date: Fri, 9 Feb 2007 14:51:55 +0100 User-Agent: KMail/1.9.5 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-2" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200702091451.56124.molnarcs@gmail.com> Subject: learning about building ports - please help X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: molnarcs@gmail.com List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Feb 2007 13:52:05 -0000 Hello list! I'm trying to learn how to build a port from scratch - and need some help. I successfully built a port for aquamarine (a window decorator for beryl) - but I don't understand half of what I did, but I want to :) I'm also curious about the skills needed for maintaining/building ports - do I need to be a programmer? Because I am not - I'm a scholar in cultural studies (but my area of interest is gift economy in general and the free software movement in particular). I've been using FreeBSD since 5.1. So here is what I did - and my questions. I used the port command (from the porttools-0.77 package) to create the Makefile template, and filling in the first part of the Makefile was fairly obvious. For the rest, I made certain assumption that I want to verify if they are correct: BUILD_DEPENDS= ${LOCALBASE}/libdata/pkgconfig/beryl.pc: ${PORTSDIR}/x11-wm/beryl-core RUN_DEPENDS+= ${BUILD_DEPENDS} This is obvious with aquamarine (I copied this line from the emerald Makefile) - because it is developed for beryl, and I understand what this line means (the porters handbook explained it). But generally, if documentation for a project is poor, how do I find out about dependencies? I was thinking about looking at the ./configure output... # These three were fairly obvious: USE_BZIP2= yes GNU_CONFIGURE= yes USE_GMAKE= yes # I assume this one is needed because aquamarine provides KDE integration USE_KDELIBS_VER=3 # If I gather correctly, this is needed because aquamarine installs shared libraries USE_LDCONFIG= yes # Just like with BUILD_DEPENDS, I'm not sure how I would have figured the next one out on my own - I was looking at the emerald makefile for clues. I think I understand the first two (use opengl for rendering, and the xrender extension?) - but I'm not sure about gettext. I saw USE_GETTEXT is most of the ports I looked at - can I assume that it is almost always needed (and even it is isn't, it won't hurt)? USE_GL= gl USE_XORG= xrender USE_GETTEXT= yes # I figured the next one out on my own, while I encountered an error (see later): USE_AUTOTOOLS= libtool:15 # and finally, the mandatory line: .include While building this port, it errored out at an early stage with this message: libtool: link: cannot find the library `' gmake[2]: *** [kcm_beryl.la] Error 1 Google turned up this solution: http://people.fruitsalad.org/lauri/krazykiwi/index.php?/archives/175-Libtool-nutso-insanity.html After editing libtool in work/aquamarine, it turned out that the problem lies with libkdefx.la. As suggested in the above blog post, I removed -pthread from the dependency_libs line of libkdefx.la (after making a backup of this file first). The port still failed to build after this, but mucking around in work/aquamarine, trying make in various subdirectories, I noticed that it complains about outdated libtool - so after looking at other kde ports (deskutils/katapult) I figured that I need the USE_AUTOTOOLS= libtool:15 line). After doing all this, the port built fine, and I've been using aquamarine for days now. I'm absolutely clueless though as to how to deal with the situation described above (removing -pthread from the dependency_libs of libkdefx.la). Can this be done in the Makefile? Will removing -pthread from libkdefx.la have any adverse effects (didn't notice any so far)? For the rest of the port, I followed the instructions in the Porter's Handbook - make makesum for distinfo, and I put the lines for generating a pkg-plist in a script: # Store the directory structure in a new file. (cd /mnt/ad0s3/port_development/installtmp/$portname && find -d * -type d) | sort > OLD-DIRS # Create an empty pkg-plist file: touch pkg-plist # If your port honors PREFIX (which it should) you can then install the port # and create the package list. make install PREFIX=/mnt/ad0s3/port_development/installtmp/$portname (cd /mnt/ad0s3/port_development/installtmp/$portname && find -d * \! -type d) | sort > pkg-plist # You must also add any newly created directories to the packing list. (cd /mnt/ad0s3/port_development/installtmp/$portname && find -d * -type d) | sort | comm -13 OLD-DIRS - | sort -r | sed -e 's#^#@dirrm #' >> pkg-plist I edited pkg-plist manually afterwards, replaced dirrm with dirrmtry (again, clue comes from the emerald port). The port is here: ftp://hatvani.unideb.hu/pub/FreeBSD/ports/aquamarine.tar.gz Is this a correct procedure? Final question - I noticed these lines in the emerald Makefile: CONFIGURE_TARGET= --build=${ARCH}-portbld-freebsd${OSREL} CONFIGURE_ARGS+= --mandir="${PREFIX}/man" CONFIGURE_ENV= CPPFLAGS="-I${LOCALBASE}/include -I${X11BASE}/include" \ LDFLAGS="-L${LOCALBASE}/lib -L${X11BASE}/lib ${PTHREAD_LIBS}" Do I need those? Can you refer me to further readings to help me understand the meaning of these lines (and whether I need similar lines or not). --mandir I understand (aquamarine doesn't have any manpages, so I'm usre I don't need that) - but the rest I don't. Thank you for your patience for reading this long post :)