Date: Thu, 11 Dec 2008 01:35:22 +0300 From: Dmitry Marakasov <amdmi3@amdmi3.ru> To: Ashish Shukla =?utf-8?B?4KSG4KS24KWA4KS3IOCktuClgeCkleCljeCksg==?= <wahjava.ml@gmail.com> Cc: FreeBSD Ports Mailing List <freebsd-ports@freebsd.org> Subject: Re: [PROPOSAL] Ports using SCM repositories as source instead of distfiles Message-ID: <20081210223522.GA6367@hades.panopticon> In-Reply-To: <87zlj3heor.fsf@chateau.d.lf> 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>
next in thread | previous in thread | raw e-mail | index | archive | help
* 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 <stdlib.h> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20081210223522.GA6367>