From owner-freebsd-ports@FreeBSD.ORG Wed Dec 10 22:35:46 2008 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9D8641065676 for ; Wed, 10 Dec 2008 22:35:46 +0000 (UTC) (envelope-from amdmi3@amdmi3.ru) Received: from smtp.timeweb.ru (smtp.timeweb.ru [217.170.79.85]) by mx1.freebsd.org (Postfix) with ESMTP id 17F428FC27 for ; Wed, 10 Dec 2008 22:35:46 +0000 (UTC) (envelope-from amdmi3@amdmi3.ru) Received: from [213.148.20.85] (helo=hive.panopticon) by smtp.timeweb.ru with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.69) (envelope-from ) id 1LAXeh-0004U9-QY; Thu, 11 Dec 2008 01:35:43 +0300 Received: from hades.panopticon (hades.panopticon [192.168.0.32]) by hive.panopticon (Postfix) with ESMTP id 8FA3DAE3D; Thu, 11 Dec 2008 01:34:30 +0300 (MSK) Received: by hades.panopticon (Postfix, from userid 1000) id 5F70E1702D; Thu, 11 Dec 2008 01:35:22 +0300 (MSK) Date: Thu, 11 Dec 2008 01:35:22 +0300 From: Dmitry Marakasov To: Ashish Shukla =?utf-8?B?4KSG4KS24KWA4KS3IOCktuClgeCkleCljeCksg==?= Message-ID: <20081210223522.GA6367@hades.panopticon> References: <87fxkxjywk.fsf@chateau.d.lf> <20081209143052.GA29817@hades.panopticon> <873agxjn1x.fsf@chateau.d.lf> <20081209181354.GB29817@hades.panopticon> <87tz9di38u.fsf@chateau.d.lf> <20081209222042.GC29817@hades.panopticon> <8763lsi10m.fsf@chateau.d.lf> <20081210181125.GA86341@hades.panopticon> <87zlj3heor.fsf@chateau.d.lf> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <87zlj3heor.fsf@chateau.d.lf> User-Agent: Mutt/1.5.18 (2008-05-17) Content-Transfer-Encoding: quoted-printable Cc: FreeBSD Ports Mailing List Subject: Re: [PROPOSAL] Ports using SCM repositories as source instead of distfiles X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Dec 2008 22:35:46 -0000 * Ashish Shukla =E0=A4=86=E0=A4=B6=E0=A5=80=E0=A4=B7 =E0=A4=B6=E0=A5=81=E0= =A4=95=E0=A5=8D=E0=A4=B2 (wahjava.ml@gmail.com) wrote: > > How do you expect all ports to respect DESTDIR in their Makefiles, > > while many ports don't even use make? As I've said, that will require > > tremendous amount of hacking and is not even possible sometimes. >=20 > How about adding a variable like REQUIRES_DYNAMIC_INSTALLATION=3Dyes, > which will then generate a plist on the basis of "/var/tmp/${PORTNAME}"= , > so now it is the port's responsibility to install all contents to > "/var/tmp/${PORTNAME}" either by "make install DESTDIR=3D..." or by som= e > other way. Having that REQUIRES_DYNAMIC_INSTALLATION also includes a > 'post-install' target which will copy all files from > /var/tmp/${PORTNAME} to ${PREFIX}. You do not understand the basic thing. The PROBLEM is to make all ports install into one dir, but be runnable from another. As simple as that. Imagine a software like that: --- foo.c #include int main() { return system("cat "DATAFILE); } --- datafile.dat Hello, world! --- Makefile PREFIX?=3D /usr/local DATADIR?=3D ${PREFIX}/share/foo all: foo foo: foo.c cc -DDATAFILE=3D\"${DATADIR}/datafile.dat\" foo.c -o foo install: foo datafile.dat install -s foo ${PREFIX}/bin install -d ${DATADIR} install datafile.dat ${DATADIR} --- As you can see, if this is installed with PREFIX=3D/var/tmp/foobar, then moved to /usr and ran, it won't work, as it has DATAFILE compiled in as "/var/tmp/foobar/share/foo/datafile.dat" instead of "/usr/local/share/foo/datafile.dat". To make it behave as we indend, you'll have to either hack Makefile to distinguish DESTDIR and PREFIX, or do all installation in port's Makefile by yourself. We have around 20k ports, and it will be extremely hard task to convert them all to such scheme (though afaik configure-based ones should support this without modifications). The example above is quite simple, the real life can be much more ugly, I assure. The worst thing is that we won't be able to test ports automatically, as the fact the port builds and installs successfully won't mean that it will run without problems. I wonder how debian and gentoo get around this problem... --=20 Dmitry Marakasov . 55B5 0596 FF1E 8D84 5F56 9510 D35A 80DD F9D2 F77D amdmi3@amdmi3.ru ..: jabber: amdmi3@jabber.ru http://www.amdmi3.ru