FILE_LIST= PATCH_LIST="0001-xdr-rpc-fix.patch" # rpcgen is required on the host SRC_FETCH_METHOD=http # retrieval method : # can be svn, git, http, ftp, filesystem # SRC_FETCH_METHOD=http SRC_FETCH_PATH="https://github.com/vmware/open-vm-tools/archive/stable-${PKGVER}.tar.gz" # Use FLXHOSTOS, FLXHOSTARCH, HOSTCC, HOSTCXX for the machine used to build. # Use FLXTARGOS, FLXTARGARCH, CC, CXX, LD, for the target machine. # FLXMAKE usually is 'make', FLXPMAKE usually is 'make -j 2' # Build tools are in /$FLXTOOLDIR, toolchain root dir is /$FLXROOTDIR. # Current dir is /$CURDIR, package dir is /$PKGDIR, dest root dir is /$ROOTDIR. # Package name is $PKGRADIX-$PKGVER-$DISTVER # optimize for size #FLXARCH=$FLX_ARCH_SMALL MAKEDEPENDS= MAKEDEPENDS=( 'glib-2.*:::*.so.* *.so *.h */glib-genmarshal' 'libdnet-1.*:::*.a *.h' 'libtirpc-1.*:::*.a' ) # This package only builds on x86_64 and i[3456]86, and is never used on # other platforms, so silently avoid them. # Here are the components/plugins used in open-vm-tools: # See https://github.com/vmware/open-vm-tools # # Linux, Solaris and FreeBSD drivers for various devices and file system access. # The memory balloon driver for reclaiming memory from guests. # The PowerOps plugin to perform graceful power operation and run power scripts. # The VIX plugin to run programs and commands, and perform file system operations in guests. # The GuestInfo plugin to periodically collect various statistics from guests. # The TimeSync plugin to perform time synchronization. # The dndcp plugin to support drag and drop, and text and file copy/paste operations. # The ResolutionSet plugin to adjust guest screen resolutions automatically based on window sizes. # The guest authentication service. # The toolbox command to perform disk wiping and shrinking, manage power scripts, and time synchronization. # The guest SDK libraries to provide information about virtual machines to guests. # Clients and servers for shared folders support. # Multiple monitor support. # The GTK Toolbox UI. if [ -n "${FLXARCH##i?86*}" -a "${FLXARCH}" != x86_64 ]; then echo "Unsupported architecture, ignoring package $EXACTPKG." function do_compile { :; } return 0 fi function do_config { if ! [ -e "./open-vm-tools/configure" ] ; then ( cd "open-vm-tools" && \ autoreconf -i && \ automake ) fi for i in GCC_ARCH_SMALL GCC_CPU_SMALL GCC_OPT_SMALL; do if eval echo "x\$$i" | \grep -q "x-mtune=x86-64"; then eval $i="-mtune=k8" fi done # --disable-glibc-check otherwise the script fails on Alpine Linux (it tries to detect the HOST glibc !!) # add a fake pkg-config that always returns true except for fuse and libtirpc cp ${CURDIR}/.flxpkg/add-ons/fake-pkg-config ${CURDIR}/pkg-config && chmod +x $CURDIR/pkg-config cd $CURDIR/open-vm-tools CXXCPP="$CC -E -x c" CC="$CC" CXX="$CXX" LD="$LD" \ RANLIB="$RANLIB" AR="$AR" AS="$AS" NM="$NM" OBJDUMP="$OBJDUMP" \ CFLAGS="$GCC_ARCH_SMALL $GCC_CPU_SMALL $GCC_OPT_SMALL -Wno-implicit-function-declaration -Wno-unused-local-typedefs" \ PATH=$CURDIR:$PATH HAVE_PKG_CONFIG="yes" \ CUSTOM_DNET_LIBS="-L$FLXROOTDIR/usr/lib/" CUSTOM_GTHREAD_LIBS="-L$FLXROOTDIR/usr/lib/" \ CUSTOM_GMODULE_LIBS="-L$FLXROOTDIR/usr/lib/" CUSTOM_GOBJECT_LIBS="-L$FLXROOTDIR/usr/lib/" \ CUSTOM_GLIB2_LIBS="-L$FLXROOTDIR/usr/lib/" CUSTOM_GLIB2_CPPFLAGS="-I$FLXROOTDIR/usr/lib/glib-2.0/include/ -I$FLXROOTDIR/usr/include/glib-2.0/ -lgmodule-2.0" \ CUSTOM_GOBJECT_CPPFLAGS=$CUSTOM_GLIB2_CPPFLAGS CUSTOM_GMODULE_CPPFLAGS=$CUSTOM_GLIB2_CPPFLAGS CUSTOM_GTHREAD_CPPFLAGS=$CUSTOM_GLIB2_CPPFLAGS \ ac_vmw_custom_libs="$CUSTOM_GLIB2_LIBS $CUSTOM_GMODULE_LIBS $CUSTOM_GOBJECT_LIBS $CUSTOM_GMODULE_LIBS $CUSTOM_DNET_LIBS $CUSTOM_GTHREAD_LIBS" \ ac_cv_header_fuse_h=no \ ac_cv_prog_have_genmarshal=yes \ ./configure --build=${FLXHOST} --host=${FLXTARG} --with-sysroot=$FLXROOTDIR \ --prefix=/usr --sysconfdir=/etc \ --disable-glibc-check --without-pam --without-x --without-icu --without-kernel-modules --without-gtkmm --without-gtk2 --disable-multimon --disable-docs --disable-tests --disable-deploypkg --disable-grabbitmqproxy --disable-vgauth --disable-resolutionkms --with-tirpc } function do_compile_only { # - parallel make cause error # - we need glib-genmarshal tool during the build # so we could require glib on the host. glib-genmarshall is written in python... # Instead, use the glib-genmarshall binary we built ourselves when building glib # couldn't find a cleaner way... sed -i -e 's#^LIBS = $#LIBS = -Wl,-Bstatic ${FLXROOTDIR}/usr/lib/libtirpc.a -Wl,-Bdynamic#' open-vm-tools/services/plugins/guestInfo/Makefile ( cd open-vm-tools && PATH="$FLXROOTDIR/usr/bin:$PATH" $FLXMAKE ) } function do_prepack { cd "$CURDIR/open-vm-tools" $FLXMAKE install DESTDIR=$ROOTDIR set_default_perm $ROOTDIR }