tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

pkgsrc on FreeBSD 10 natively, without bootstrapping



  Hello!

It turns out that it is possible indeed to use pkgsrc on FreeBSD 10
without bootstrapping. After applying a patch as attached and passing
PKGSRC_COMPILER=clang on command line, I am able to build simple package
like pkgtools/digest (it is one of central packages in infrastructure,
one have to build it very soon anyway).

First of all, I have to setup compiler, because pkgsrc doesn't detect
the system one. I can do it either passing the setting on command line
or putting it into /etc/make.conf (more on "make.conf" later).
pkgsrc machinery correctly determines that pkg_install is "obsolete"
(sort of, because it doesn't exist obviously) and tries to install a new one.

Here comes the next problem: pkg_install uses net/libfetch which uses
BSD build system. Of course, it uses the one that comes from the host,
that is FreeBSD. FreeBSD's build system doesn't make distinction between
CPPFLAGS and CFLAGS, when coming to FreeBSD from NetBSD you have to add
lines like "CFLAGS+= $(CPPFLAGS)" all over your makefiles. This is what
the patch essentially does: it circumvents the lack of CPPFLAGS in
FreeBSD by duplicating necessary flag in CFLAGS.

FreeBSD has different meaning for WARNS levels too. Thus I have reset it
to zero. Of course, some higher level(s) probably work too, I haven't
tried yet.

The next problem is that for some reason I have to repeat "make install"
command twice because the first one fails (it reports failing licence check
for reasons yet to be determined).

When trying to build another package (I used lang/sbcl) it becomes clear
that CPPFLAGS problem is pervasive one. In particular, it triggers failure
in nbpatch which is another central package in pkgsrc infrastructure.

All this prompts that while it might be possible to use pkgsrc natively
on FreeBSD 10, there're many things to think about. One of them is
whether it all pays off.

Index: pkgtools/pkg_install/Makefile
===================================================================
RCS file: /usr/home/aleksej/bsd/netbsd/pkgsrc/pkgtools/pkg_install/Makefile,v
retrieving revision 1.203
diff -u -r1.203 Makefile
--- pkgtools/pkg_install/Makefile       14 Mar 2014 22:09:04 -0000      1.203
+++ pkgtools/pkg_install/Makefile       9 Apr 2014 11:53:56 -0000
@@ -81,6 +81,10 @@
 MAKE_ENV+=             OPSYS=${OPSYS:Q}
 MAKE_ENV+=             CATMAN_SECTION_SUFFIX=${CATMAN_SECTION_SUFFIX:Q}
 MAKE_ENV+=             MANINSTALL=${MANINSTALL:Q}
+.if $(OPSYS) == "FreeBSD"
+MAKE_ENV+=             WARNS=0
+.endif
+CFLAGS.FreeBSD+=       -I$(WRKDIR)/libnbcompat
 
 PKG_DBDIR?=            /var/db/pkg
 EGDIR=                 ${PREFIX}/share/examples/pkg_install
-- 
HE CE3OH...


Home | Main Index | Thread Index | Old Index