Import of pkgsrc-2016Q3

This commit is contained in:
2016-10-14 07:49:11 +02:00
committed by Lionel Sambuc
parent 9d819b6d54
commit 1242aa1e36
35952 changed files with 949749 additions and 377083 deletions

View File

@@ -1,6 +1,6 @@
#! /bin/sh
# $NetBSD: bootstrap,v 1.218 2015/06/13 13:15:39 tron Exp $
# $NetBSD: bootstrap,v 1.232 2016/06/22 11:40:16 joerg Exp $
#
# Copyright (c) 2001-2011 Alistair Crooks <agc@NetBSD.org>
# All rights reserved.
@@ -77,10 +77,6 @@ usage="Usage: $0 "'
[ --workdir <workdir> ]
'
# this replicates some of the logic in bsd.prefs.mk. until
# bootstrap-pkgsrc is merged into pkgsrc, we need to determine the
# right value for OPSYS and MACHINE_ARCH.
# strip / for BSD/OS, strip - for HP-UX
opsys=`uname -s | tr -d /-`
@@ -175,7 +171,11 @@ get_abi()
abi_opsys=$@
if [ -n "$abi" ]; then
die "ERROR: $abi_opsys has special ABI handling, --abi not supported (yet)."
case "$abi_opsys" in
IRIX)
die "ERROR: $abi_opsys has special ABI handling, --abi not supported (yet)."
;;
esac
fi
case "$abi_opsys" in
@@ -213,6 +213,24 @@ get_machine_arch_aix()
fi
}
get_machine_arch_darwin()
{
case `uname -p` in
i386)
# Returns "i386" or "x86_64" depending on CPU
echo `uname -m`
;;
powerpc)
# sysctl mib exists on 64-bit hardware
if [ -n "`sysctl -n hw.optional.64bitops 2>/dev/null`" ]; then
echo "powerpc64"
else
echo "powerpc"
fi
;;
esac
}
check_prog()
{
_var="$1"; _name="$2"
@@ -490,7 +508,6 @@ overpath=""
root_user=root
bmakexargs=
need_extras=no
set_machine_arch=no
use_bsdinstall=
case "$opsys" in
AIX)
@@ -509,7 +526,7 @@ Bitrig)
need_awk=no
need_sed=no
set_opsys=no
machine_arch=`uname -m`
machine_arch=`arch -s`
check_compiler=yes
;;
CYGWIN_*)
@@ -537,7 +554,7 @@ Darwin)
need_awk=no
need_sed=no
set_opsys=no
machine_arch=`uname -p`
machine_arch=`get_machine_arch_darwin`
CC=${CC:-"cc -isystem /usr/include"}; export CC
check_compiler=yes
osrev=`uname -r`
@@ -554,7 +571,7 @@ Darwin)
;;
esac
case "$macosx_version" in
10.[8-9]|10.10)
10.[8-9]|10.1[01])
need_awk=yes
need_sed=yes
;;
@@ -676,7 +693,6 @@ IRIX*)
need_sed=yes
set_opsys=yes
machine_arch=mipseb
bmakexargs="MACHINE_ARCH=$machine_arch"
check_compiler=yes
if [ `uname -r` -lt 6 ]; then
# IRIX 5's mkdir bails out with an error when trying to create with the -p
@@ -701,12 +717,6 @@ Linux)
need_sed=no
set_opsys=no
machine_arch=`uname -m | sed -e 's/i.86/i386/'`
# Support multiarch systems.
if [ "$machine_arch" = "x86_64" -a "$abi" = "32" ]; then
machine_arch=i386
set_machine_arch=yes
bmakexargs="MACHINE_ARCH=$machine_arch"
fi
;;
Minix)
root_group=operator
@@ -759,7 +769,7 @@ OpenBSD)
need_awk=no
need_sed=no
set_opsys=no
machine_arch=`uname -m`
machine_arch=`arch -s`
;;
OSF1)
root_group=system
@@ -838,6 +848,34 @@ UnixWare)
;;
esac
# Fixup MACHINE_ARCH to use canonical pkgsrc variants, and support multiarch
# systems via --abi, setting a default $abi based on MACHINE_ARCH if not set.
#
case "$machine_arch/$abi" in
# "amd64" translates to "x86_64", defaults to 64-bit
amd64/32) abi=32 machine_arch=i386 ;;
amd64/*) abi=64 machine_arch=x86_64 ;;
# XXX: hppa untested
hppa/64) abi=64 machine_arch=hppa64 ;;
hppa/*) abi=32 machine_arch=hppa ;;
hppa64/32) abi=32 machine_arch=hppa ;;
hppa64/*) abi=64 machine_arch=hppa64 ;;
# "i386" can support 64-bit, e.g. SunOS, defaults to 32-bit.
i386/64) abi=64 machine_arch=x86_64 ;;
i386/*) abi=32 machine_arch=i386 ;;
# XXX: powerpc untested
powerpc/64) abi=64 machine_arch=powerpc64 ;;
powerpc/*) abi=32 machine_arch=powerpc ;;
powerpc64/32) abi=32 machine_arch=powerpc ;;
powerpc64/*) abi=64 machine_arch=powerpc64 ;;
# "sparc" can support 64-bit, e.g. SunOS, defaults to 32-bit.
sparc/64) abi=64 machine_arch=sparc64 ;;
sparc/*) abi=32 machine_arch=sparc ;;
# x86_64 supports 32-bit/64-bit, defaults to 64-bit.
x86_64/32) abi=32 machine_arch=i386 ;;
x86_64/*) abi=64 machine_arch=x86_64 ;;
esac
# If "--full" is specified, then install all of the platform-independent
# bootstrap software.
#
@@ -865,14 +903,9 @@ if [ $? -ne 0 ]; then
die "ERROR: --make-jobs must be a positive integer argument"
fi
# export OPSYS and MACHINE_ARCH for pkg_install. we only set
# MACHINE_ARCH on platforms where we override bmake's value.
OPSYS=${opsys}
export OPSYS
if [ "${machine_arch}" != "" ]; then
MACHINE_ARCH=${machine_arch}
export MACHINE_ARCH
fi
# export MACHINE_ARCH and OPSYS for bmake and pkg_install.
MACHINE_ARCH=${machine_arch}; export MACHINE_ARCH
OPSYS=${opsys}; export OPSYS
if [ "x$preserve_path" != "xyes" ]; then
PATH="$overpath:$PATH"
@@ -988,9 +1021,6 @@ fi
if [ -n "$abi" ]; then
echo "ABI= $abi" >> ${TARGET_MKCONF}
fi
if [ "$set_machine_arch" = "yes" ]; then
echo "MACHINE_ARCH= $machine_arch" >> ${TARGET_MKCONF}
fi
if [ "$compiler" != "" ]; then
echo "PKGSRC_COMPILER= $compiler" >> ${TARGET_MKCONF}
fi
@@ -1107,25 +1137,25 @@ $shprog ./bootstrap.sh)"
bootstrap_bmake() {
echo_msg "Bootstrapping bmake"
copy_src $pkgsrcdir/devel/bmake/files bmake
run_cmd "(cd $wrkdir/bmake && $shprog configure $configure_quiet_flags --with-default-sys-path=$wrkdir/share/mk --prefix=$wrkdir $bmakexargs)"
run_cmd "(cd $wrkdir/bmake && $shprog configure $configure_quiet_flags --prefix=$wrkdir --with-default-sys-path=$wrkdir/share/mk --with-machine-arch=${machine_arch} $bmakexargs)"
run_cmd "(cd $wrkdir/bmake && $shprog make-bootstrap.sh)"
run_cmd "$install_sh -c -o $user -g $group -m 755 $wrkdir/bmake/bmake $wrkdir/bin/bmake"
}
bootstrap_bmake
bmake="$wrkdir/bin/bmake $make_quiet_flags"
bmake="$wrkdir/bin/bmake"
# build libnbcompat
echo_msg "Building libnbcompat"
copy_src $pkgsrcdir/pkgtools/libnbcompat/files libnbcompat
run_cmd "(cd $wrkdir/libnbcompat; $shprog ./configure $configure_quiet_flags -C --prefix=$prefix --infodir=$infodir --mandir=$mandir --sysconfdir=$sysconfdir --enable-bsd-getopt --enable-db && $bmake -j$make_jobs)"
run_cmd "(cd $wrkdir/libnbcompat; $shprog ./configure $configure_quiet_flags -C --prefix=$prefix --infodir=$infodir --mandir=$mandir --sysconfdir=$sysconfdir --enable-bsd-getopt --enable-db && $bmake $make_quiet_flags -j$make_jobs)"
# bootstrap ksh if necessary
case "$need_ksh" in
yes) echo_msg "Bootstrapping ksh"
copy_src $pkgsrcdir/shells/pdksh/files ksh
test -n "$CC" || CC=gcc # default to gcc if no compiler is specified
run_cmd "(cd $wrkdir/ksh && env $BSTRAP_ENV $shprog ./configure $configure_quiet_flags --prefix=$prefix --infodir=$infodir --mandir=$mandir --sysconfdir=$sysconfdir && $bmake -j$make_jobs)"
run_cmd "(cd $wrkdir/ksh && env $BSTRAP_ENV $shprog ./configure $configure_quiet_flags --prefix=$prefix --infodir=$infodir --mandir=$mandir --sysconfdir=$sysconfdir && $bmake $make_quiet_flags -j$make_jobs)"
run_cmd "$install_sh -c -o $user -g $group -m 755 $wrkdir/ksh/ksh $wrkdir/bin/pdksh"
echo "TOOLS_PLATFORM.sh?= $prefix/bin/pdksh" >> ${TARGET_MKCONF}
echo "TOOLS_PLATFORM.sh?= $wrkdir/bin/pdksh" >> ${BOOTSTRAP_MKCONF}
@@ -1143,7 +1173,7 @@ case "$need_awk" in
yes) echo_msg "Bootstrapping awk"
copy_src $pkgsrcdir/lang/nawk/files awk
test -n "$CC" || CC=gcc # default to gcc if no compiler is specified
run_cmd "(cd $wrkdir/awk && $bmake -j$make_jobs -f Makefile CC=\"${CC}\" CFLAGS=\"${CFLAGS}\")"
run_cmd "(cd $wrkdir/awk && $bmake $make_quiet_flags -j$make_jobs -f Makefile CC=\"${CC}\" CFLAGS=\"${CFLAGS}\")"
run_cmd "$install_sh -c -o $user -g $group -m 755 $wrkdir/awk/a.out $wrkdir/bin/nawk"
echo "TOOLS_PLATFORM.awk?= $prefix/bin/nawk" >> ${TARGET_MKCONF}
echo "TOOLS_PLATFORM.awk?= $wrkdir/bin/nawk" >> ${BOOTSTRAP_MKCONF}
@@ -1154,7 +1184,7 @@ esac
case "$need_sed" in
yes) echo_msg "Bootstrapping sed"
copy_src $pkgsrcdir/textproc/nbsed/files sed
run_cmd "(cd $wrkdir/sed; env $BSTRAP_ENV CPPFLAGS='$CPPFLAGS -I../libnbcompat' LDFLAGS='$LDFLAGS -L../libnbcompat' LIBS='$LIBS -lnbcompat' $shprog ./configure $configure_quiet_flags -C --prefix=$prefix --infodir=$infodir --mandir=$mandir --sysconfdir=$sysconfdir --program-transform-name='s,sed,nbsed,' && $bmake -j$make_jobs)"
run_cmd "(cd $wrkdir/sed; env $BSTRAP_ENV CPPFLAGS='$CPPFLAGS -I../libnbcompat' LDFLAGS='$LDFLAGS -L../libnbcompat' LIBS='$LIBS -lnbcompat' $shprog ./configure $configure_quiet_flags -C --prefix=$prefix --infodir=$infodir --mandir=$mandir --sysconfdir=$sysconfdir --program-transform-name='s,sed,nbsed,' && $bmake $make_quiet_flags -j$make_jobs)"
run_cmd "$install_sh -c -o $user -g $group -m 755 $wrkdir/sed/sed $wrkdir/bin/sed"
echo "TOOLS_PLATFORM.sed?= $prefix/bin/nbsed" >> ${TARGET_MKCONF}
echo "TOOLS_PLATFORM.sed?= $wrkdir/bin/sed" >> ${BOOTSTRAP_MKCONF}
@@ -1163,16 +1193,29 @@ esac
# bootstrap pkg_install
echo_msg "Bootstrapping pkgtools"
copy_src $pkgsrcdir/archivers/libarchive/files libarchive
run_cmd "(cd $wrkdir/libarchive; env $BSTRAP_ENV \
$shprog ./configure $configure_quiet_flags --enable-static --disable-shared \
--disable-bsdtar --disable-bsdcpio --disable-posix-regex-lib --disable-xattr \
--disable-maintainer-mode --disable-acl --without-zlib --without-bz2lib \
--without-lzmadec --without-iconv --without-lzma --without-lzo2 \
--without-nettle --without-openssl --without-xml2 --without-expat \
MAKE=$bmake && $bmake $make_quiet_flags -j$make_jobs)"
copy_src $pkgsrcdir/pkgtools/pkg_install/files pkg_install
run_cmd "(cd $wrkdir/pkg_install; env $BSTRAP_ENV \
CPPFLAGS='$CPPFLAGS -I../libnbcompat -I../../libnbcompat' \
LDFLAGS='$LDFLAGS -L../libnbcompat -L../../libnbcompat' \
CPPFLAGS='$CPPFLAGS -I${wrkdir}/libnbcompat -I${wrkdir}/libarchive/libarchive' \
LDFLAGS='$LDFLAGS -L${wrkdir}/libnbcompat' \
LIBS='$LIBS -lnbcompat' $shprog ./configure $configure_quiet_flags -C \
--enable-bootstrap --prefix=$prefix --sysconfdir=$sysconfdir \
--with-pkgdbdir=$pkgdbdir --infodir=$infodir --mandir=$mandir $pkg_install_args && $bmake -j$make_jobs)"
--with-pkgdbdir=$pkgdbdir --infodir=$infodir \
--mandir=$mandir $pkg_install_args && \
STATIC_LIBARCHIVE=$wrkdir/libarchive/.libs/libarchive.a \
PKGSRC_MACHINE_ARCH="$machine_arch" $bmake $make_quiet_flags -j$make_jobs)"
run_cmd "$install_sh -c -o $user -g $group -m 755 $wrkdir/pkg_install/add/pkg_add $wrkdir/sbin/pkg_add"
run_cmd "$install_sh -c -o $user -g $group -m 755 $wrkdir/pkg_install/admin/pkg_admin $wrkdir/sbin/pkg_admin"
run_cmd "$install_sh -c -o $user -g $group -m 755 $wrkdir/pkg_install/create/pkg_create $wrkdir/sbin/pkg_create"
run_cmd "$install_sh -c -o $user -g $group -m 755 $wrkdir/pkg_install/info/pkg_info $wrkdir/sbin/pkg_info"
echo "PKG_ADD_CMD?= $wrkdir/sbin/pkg_add" >> ${BOOTSTRAP_MKCONF}
echo "PKG_ADMIN_CMD?= $wrkdir/sbin/pkg_admin" >> ${BOOTSTRAP_MKCONF}
echo "PKG_CREATE_CMD?= $wrkdir/sbin/pkg_create" >> ${BOOTSTRAP_MKCONF}
echo "PKG_INFO_CMD?= $wrkdir/sbin/pkg_info" >> ${BOOTSTRAP_MKCONF}
@@ -1246,7 +1289,7 @@ echo ".endif # end pkgsrc settings" >> ${BOOTSTRAP_MKCONF}
# build and register packages
# usage: build_package <packagedirectory> [additional arguments]
build_package() {
run_cmd "(cd $pkgsrcdir/$1 && $bmake MAKE_JOBS=${make_jobs} USE_DESTDIR=no -DPKG_PRESERVE MAKECONF=${BOOTSTRAP_MKCONF} install)"
run_cmd "(cd $pkgsrcdir/$1 && $bmake $make_quiet_flags MAKE_JOBS=${make_jobs} PKG_COMPRESSION=none -DPKG_PRESERVE MAKECONF=${BOOTSTRAP_MKCONF} install)"
}
#