Index: head/Mk/Scripts/rust-compat11-canary.sh =================================================================== --- head/Mk/Scripts/rust-compat11-canary.sh (nonexistent) +++ head/Mk/Scripts/rust-compat11-canary.sh (revision 522968) @@ -0,0 +1,27 @@ +#!/bin/sh +# MAINTAINER: rust@FreeBSD.org +# $FreeBSD$ +set -eu + +if [ "${OPSYS}" != FreeBSD ] || [ "${OSVERSION}" -lt 1200000 ]; then + exit 0 +fi + +cat < +#include +#include + +int +main(void) +{ + return syscall(SYS_freebsd11_mknod, "", 0, 0) < 0 && errno == ENOSYS; +} +EOF +# Canary might be aborted with SIGSYS +ulimit -c 0 +if ! "${WRKDIR}/compat11_canary"; then + echo "=> Sanity check failed: kernel is missing COMPAT_FREEBSD11" + echo "=> Aborting build" + exit 1 +fi Property changes on: head/Mk/Scripts/rust-compat11-canary.sh ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/Mk/Uses/cargo.mk =================================================================== --- head/Mk/Uses/cargo.mk (revision 522967) +++ head/Mk/Uses/cargo.mk (revision 522968) @@ -1,320 +1,323 @@ # $FreeBSD$ # # This file contains logic to ease porting of Rust packages or # binaries using the `cargo` command. # # Feature: cargo # Usage: USES=cargo # Valid ARGS: none # # MAINTAINER: rust@FreeBSD.org .if !defined(_INCLUDE_USES_CARGO_MK) _INCLUDE_USES_CARGO_MK= yes .if !empty(cargo_ARGS) IGNORE+= USES=cargo takes no arguments .endif # List of static dependencies. The format is cratename-version. # CARGO_CRATES will be downloaded from MASTER_SITES_CRATESIO. CARGO_CRATES?= # List of features to build (space separated list). CARGO_FEATURES?= # Name of the local directory for vendoring crates. CARGO_VENDOR_DIR?= ${WRKSRC}/cargo-crates # Default path for cargo manifest. CARGO_CARGOTOML?= ${WRKSRC}/Cargo.toml CARGO_CARGOLOCK?= ${WRKSRC}/Cargo.lock # Save crates inside ${DISTDIR}/rust/crates by default. CARGO_DIST_SUBDIR?= rust/crates # Generate list of DISTFILES. .for _crate in ${CARGO_CRATES} MASTER_SITES+= CRATESIO/${_crate:C/^(.*)-[0-9].*/\1/}/${_crate:C/^.*-([0-9].*)/\1/}:cargo_${_crate:C/[^a-zA-Z0-9_]//g} DISTFILES+= ${CARGO_DIST_SUBDIR}/${_crate}.tar.gz:cargo_${_crate:C/[^a-zA-Z0-9_]//g} .endfor # Build dependencies. CARGO_BUILDDEP?= yes .if ${CARGO_BUILDDEP:tl} == "yes" BUILD_DEPENDS+= ${RUST_DEFAULT}>=1.40.0:lang/${RUST_DEFAULT} .endif # Location of cargo binary (default to lang/rust's Cargo binary) CARGO_CARGO_BIN?= ${LOCALBASE}/bin/cargo # Location of the cargo output directory. CARGO_TARGET_DIR?= ${WRKDIR}/target # Environment for cargo # - CARGO_HOME: local cache of the registry index # - CARGO_BUILD_JOBS: configure number of jobs to run # - CARGO_TARGET_DIR: location of where to place all generated artifacts # - RUSTC: path of rustc binary (default to lang/rust) # - RUSTDOC: path of rustdoc binary (default to lang/rust) # - RUSTFLAGS: custom flags to pass to all compiler invocations that Cargo performs CARGO_ENV+= \ CARGO_HOME=${WRKDIR}/cargo-home \ CARGO_BUILD_JOBS=${MAKE_JOBS_NUMBER} \ CARGO_TARGET_DIR=${CARGO_TARGET_DIR} \ RUSTC=${LOCALBASE}/bin/rustc \ RUSTDOC=${LOCALBASE}/bin/rustdoc \ RUSTFLAGS="${RUSTFLAGS} -C linker=${CC:Q} ${LDFLAGS:C/.+/-C link-arg=&/}" # Adjust -C target-cpu if -march/-mcpu is set by bsd.cpu.mk .if ${ARCH} == amd64 || ${ARCH} == i386 RUSTFLAGS+= ${CFLAGS:M-march=*:S/-march=/-C target-cpu=/} .else RUSTFLAGS+= ${CFLAGS:M-mcpu=*:S/-mcpu=/-C target-cpu=/} .endif .if defined(PPC_ABI) && ${PPC_ABI} == ELFv1 USE_GCC?= yes .endif # Helper to shorten cargo calls. CARGO_CARGO_RUN= \ cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${CARGO_ENV} \ ${CARGO_CARGO_BIN} # User arguments for cargo targets. CARGO_BUILD_ARGS?= CARGO_INSTALL_ARGS?= CARGO_INSTALL_PATH?= . CARGO_TEST_ARGS?= CARGO_UPDATE_ARGS?= # Use module targets ? CARGO_BUILD?= yes CARGO_CONFIGURE?= yes CARGO_INSTALL?= yes CARGO_TEST?= yes # Set CARGO_USE_GIT{HUB,LAB} to yes if your application requires # some dependencies from git repositories hosted on GitHub or # GitLab instances. All Cargo.toml files will be patched to point # to the right offline sources based on what is defined in # {GH,GL}_TUPLE. This makes sure that cargo does not attempt to # access the network during the build. CARGO_USE_GITHUB?= no CARGO_USE_GITLAB?= no # Manage crate features. .if !empty(CARGO_FEATURES) CARGO_BUILD_ARGS+= --features='${CARGO_FEATURES}' CARGO_INSTALL_ARGS+= --features='${CARGO_FEATURES}' CARGO_TEST_ARGS+= --features='${CARGO_FEATURES}' .endif .if !defined(WITH_DEBUG) CARGO_BUILD_ARGS+= --release CARGO_TEST_ARGS+= --release .else CARGO_INSTALL_ARGS+= --debug .endif .if ${CARGO_CRATES:Mcmake-[0-9]*} BUILD_DEPENDS+= cmake:devel/cmake .endif .if ${CARGO_CRATES:Mgettext-sys-[0-9]*} CARGO_ENV+= GETTEXT_BIN_DIR=${LOCALBASE}/bin \ GETTEXT_INCLUDE_DIR=${LOCALBASE}/include \ GETTEXT_LIB_DIR=${LOCALBASE}/lib .endif .if ${CARGO_CRATES:Mjemalloc-sys-[0-9]*} BUILD_DEPENDS+= gmake:devel/gmake .endif .for libc in ${CARGO_CRATES:Mlibc-[0-9]*} # FreeBSD 12.0 changed ABI: r318736 and r320043 # https://github.com/rust-lang/libc/commit/78f93220d70e # https://github.com/rust-lang/libc/commit/969ad2b73cdc _libc_VER= ${libc:C/.*-//} . if ${_libc_VER:R:R} == 0 && (${_libc_VER:R:E} < 2 || ${_libc_VER:R:E} == 2 && ${_libc_VER:E} < 38) DEV_ERROR+= "CARGO_CRATES=${libc} may be unstable on FreeBSD 12.0. Consider updating to the latest version \(higher than 0.2.37\)." . endif . if ${_libc_VER:R:R} == 0 && (${_libc_VER:R:E} < 2 || ${_libc_VER:R:E} == 2 && ${_libc_VER:E} < 49) DEV_ERROR+= "CARGO_CRATES=${libc} may be unstable on aarch64 or not build on armv6, armv7, powerpc64. Consider updating to the latest version \(higher than 0.2.49\)." . endif .undef _libc_VER .endfor .if ${CARGO_CRATES:Mlibgit2-sys-[0-9]*} # Use the system's libgit2 instead of building the bundled version CARGO_ENV+= LIBGIT2_SYS_USE_PKG_CONFIG=1 .endif .if ${CARGO_CRATES:Mlibssh2-sys-[0-9]*} # Use the system's libssh2 instead of building the bundled version CARGO_ENV+= LIBSSH2_SYS_USE_PKG_CONFIG=1 .endif .if ${CARGO_CRATES:Monig_sys-[0-9]*} # onig_sys always prefers the system library but will try to link # statically with it. Since devel/oniguruma doesn't provide a static # library it'll link to libonig.so instead. Strictly speaking setting # RUSTONIG_SYSTEM_LIBONIG is not necessary, but will force onig_sys to # always use the system's libonig as returned by `pkg-config oniguruma`. CARGO_ENV+= RUSTONIG_SYSTEM_LIBONIG=1 .endif .if ${CARGO_CRATES:Mopenssl-0.[0-9].*} # FreeBSD 12.0 updated base OpenSSL in r339270: # https://github.com/sfackler/rust-openssl/commit/276577553501 . if !exists(${PATCHDIR}/patch-openssl-1.1.1) # skip if backported _openssl_VER= ${CARGO_CRATES:Mopenssl-0.[0-9].*:C/.*-//} . if ${_openssl_VER:R:R} == 0 && (${_openssl_VER:R:E} < 10 || ${_openssl_VER:R:E} == 10 && ${_openssl_VER:E} < 4) DEV_WARNING+= "CARGO_CRATES=openssl-0.10.3 or older do not support OpenSSL 1.1.1. Consider updating to the latest version." . endif . endif .undef _openssl_VER .endif .if ${CARGO_CRATES:Mopenssl-sys-[0-9]*} # Make sure that openssl-sys can find the correct version of OpenSSL CARGO_ENV+= OPENSSL_LIB_DIR=${OPENSSLLIB} \ OPENSSL_INCLUDE_DIR=${OPENSSLINC} .endif .if ${CARGO_CRATES:Mpkg-config-[0-9]*} .include "${USESDIR}/pkgconfig.mk" .endif _USES_extract+= 600:cargo-extract cargo-extract: # target for preparing crates directory. It will put all crates in # the local crates directory. @${ECHO_MSG} "===> Moving crates to ${CARGO_VENDOR_DIR}" @${MKDIR} ${CARGO_VENDOR_DIR} .for _crate in ${CARGO_CRATES} @${MV} ${WRKDIR}/${_crate} ${CARGO_VENDOR_DIR}/${_crate} @${PRINTF} '{"package":"%s","files":{}}' \ $$(${SHA256} -q ${DISTDIR}/${CARGO_DIST_SUBDIR}/${_crate}.tar.gz) \ > ${CARGO_VENDOR_DIR}/${_crate}/.cargo-checksum.json @if [ -r ${CARGO_VENDOR_DIR}/${_crate}/Cargo.toml.orig ]; then \ ${MV} ${CARGO_VENDOR_DIR}/${_crate}/Cargo.toml.orig \ ${CARGO_VENDOR_DIR}/${_crate}/Cargo.toml.orig-cargo; \ fi .endfor _CARGO_GIT_PATCH_CARGOTOML= .if ${CARGO_USE_GITHUB:tl} == "yes" . for _group in ${GH_TUPLE:C@^[^:]*:[^:]*:[^:]*:(([^:/]*)?)((/.*)?)@\2@} . if empty(CARGO_GIT_SUBDIR:M${_group}\:*) _CARGO_GIT_PATCH_CARGOTOML:= ${_CARGO_GIT_PATCH_CARGOTOML} \ -e "s@git = ['\"](https|http|git)://github.com/${GH_ACCOUNT_${_group}}/${GH_PROJECT_${_group}}(\.git)?/?[\"']@path = \"${WRKSRC_${_group}}\"@" . else . for _group2 _crate _subdir in ${CARGO_GIT_SUBDIR:M${_group}\:*:S,:, ,g} _CARGO_GIT_PATCH_CARGOTOML:= ${_CARGO_GIT_PATCH_CARGOTOML} \ -e "/^${_crate} =/ s@git = ['\"](https|http|git)://github.com/${GH_ACCOUNT_${_group}}/${GH_PROJECT_${_group}}(\.git)?/?[\"']@path = \"${WRKSRC_${_group}}/${_subdir}\"@" . endfor . endif . endfor .endif .if ${CARGO_USE_GITLAB:tl} == "yes" . for _group in ${GL_TUPLE:C@^(([^:]*://[^:/]*(:[0-9]{1,5})?(/[^:]*[^/])?:)?)([^:]*):([^:]*):([^:]*)(:[^:/]*)((/.*)?)@\8@:S/^://} . if empty(CARGO_GIT_SUBDIR:M${_group}\:*) _CARGO_GIT_PATCH_CARGOTOML:= ${_CARGO_GIT_PATCH_CARGOTOML} \ -e "s@git = ['\"]${GL_SITE_${_group}}/${GL_ACCOUNT_${_group}}/${GL_PROJECT_${_group}}(\.git)?/?['\"]@path = \"${WRKSRC_${_group}}\"@" . else . for _group2 _crate _subdir in ${CARGO_GIT_SUBDIR:M${_group}\:*:S,:, ,g} _CARGO_GIT_PATCH_CARGOTOML:= ${_CARGO_GIT_PATCH_CARGOTOML} \ -e "/^${_crate} = / s@git = ['\"]${GL_SITE_${_group}}/${GL_ACCOUNT_${_group}}/${GL_PROJECT_${_group}}(\.git)?/?['\"]@path = \"${WRKSRC_${_group}}/${_subdir}\"@" . endfor . endif . endfor .endif .if !empty(_CARGO_GIT_PATCH_CARGOTOML) _USES_patch+= 600:cargo-patch-git cargo-patch-git: @${FIND} ${WRKDIR} -name Cargo.toml -type f -exec \ ${SED} -i.dist -E ${_CARGO_GIT_PATCH_CARGOTOML} {} + .endif .if ${CARGO_CONFIGURE:tl} == "yes" _USES_configure+= 250:cargo-configure # configure hook. Place a config file for overriding crates-io index # by local source directory. cargo-configure: +# Check that the running kernel has COMPAT_FREEBSD11 required by lang/rust post-ino64 + @${SETENV} CC="${CC}" OPSYS="${OPSYS}" OSVERSION="${OSVERSION}" WRKDIR="${WRKDIR}" \ + ${SH} ${SCRIPTSDIR}/rust-compat11-canary.sh @${MKDIR} ${WRKDIR}/.cargo @${ECHO_CMD} "[source.cargo]" > ${WRKDIR}/.cargo/config @${ECHO_CMD} "directory = '${CARGO_VENDOR_DIR}'" >> ${WRKDIR}/.cargo/config @${ECHO_CMD} "[source.crates-io]" >> ${WRKDIR}/.cargo/config @${ECHO_CMD} "replace-with = 'cargo'" >> ${WRKDIR}/.cargo/config @if ! ${GREP} -qF '[profile.release]' ${CARGO_CARGOTOML}; then \ ${ECHO_CMD} "" >> ${CARGO_CARGOTOML}; \ ${ECHO_CMD} "[profile.release]" >> ${CARGO_CARGOTOML}; \ ${ECHO_CMD} "opt-level = 2" >> ${CARGO_CARGOTOML}; \ ${ECHO_CMD} "debug = false" >> ${CARGO_CARGOTOML}; \ fi @${CARGO_CARGO_RUN} update \ --manifest-path ${CARGO_CARGOTOML} \ --verbose \ ${CARGO_UPDATE_ARGS} .endif .if !target(do-build) && ${CARGO_BUILD:tl} == "yes" do-build: @${CARGO_CARGO_RUN} build \ --manifest-path ${CARGO_CARGOTOML} \ --verbose \ ${CARGO_BUILD_ARGS} .endif .if !target(do-install) && ${CARGO_INSTALL:tl} == "yes" do-install: . for path in ${CARGO_INSTALL_PATH} @${CARGO_CARGO_RUN} install \ --path "${path}" \ --root "${STAGEDIR}${PREFIX}" \ --verbose \ ${CARGO_INSTALL_ARGS} @${RM} -- "${STAGEDIR}${PREFIX}/.crates.toml" . endfor .endif .if !target(do-test) && ${CARGO_TEST:tl} == "yes" do-test: @${CARGO_CARGO_RUN} test \ --manifest-path ${CARGO_CARGOTOML} \ --verbose \ ${CARGO_TEST_ARGS} .endif # # Helper targets for port maintainers # # cargo-crates will output the crates list from Cargo.lock. If there # is no Cargo.lock for some reason, try and generate it first. cargo-crates: extract @if [ ! -r "${CARGO_CARGOLOCK}" ]; then \ ${ECHO_MSG} "===> ${CARGO_CARGOLOCK} not found. Trying to generate it..."; \ ${CARGO_CARGO_RUN} generate-lockfile \ --manifest-path ${CARGO_CARGOTOML} \ --verbose; \ fi @${SETENV} USE_GITHUB=${USE_GITHUB} USE_GITLAB=${USE_GITLAB} GL_SITE=${GL_SITE} \ ${AWK} -f ${SCRIPTSDIR}/cargo-crates.awk ${CARGO_CARGOLOCK} # cargo-crates-licenses will try to grab license information from # all downloaded crates. cargo-crates-licenses: configure @${FIND} ${CARGO_VENDOR_DIR} -name 'Cargo.toml' -maxdepth 2 \ -exec ${GREP} -H '^license' {} \; \ | ${SED} \ -e 's@^${CARGO_VENDOR_DIR}/@@' \ -e 's@/Cargo.toml:license.*= *"@|@' \ -e 's@"$$@@g' | sort | /usr/bin/column -t -s '|' .endif Index: head/Mk/bsd.gecko.mk =================================================================== --- head/Mk/bsd.gecko.mk (revision 522967) +++ head/Mk/bsd.gecko.mk (revision 522968) @@ -1,392 +1,397 @@ #-*- tab-width: 4; -*- # ex:ts=4 # # Date created: 12 Nov 2005 # Whom: Michael Johnson # # $FreeBSD$ # # 4 column tabs prevent hair loss and tooth decay! # bsd.gecko.mk abstracts the selection of gecko-based backends. It allows users # and porters to support any available gecko backend without needing to build # many conditional tests. ${USE_GECKO} is the list of backends that your port # can handle, and ${GECKO} is set by bsd.gecko.mk to be the chosen backend. # Users set ${WITH_GECKO} to the list of gecko backends they want on their # system. .if defined(USE_GECKO) .if !defined(_POSTMKINCLUDED) && !defined(Gecko_Pre_Include) Gecko_Pre_Include= bsd.gecko.mk # This file contains some reusable components for mozilla ports. It's of # use primarily to apps from the mozilla project itself (such as Firefox, # Thunderbird, etc.), and probably won't be of use for gecko-based ports # like epiphany, galeon, etc. # # You need to make sure to add USE_GECKO=gecko to for your port can uses # one of these options below. # # Ports can use the following: # # USE_MOZILLA By default, it enables every system dependency # listed in '_ALL_DEPENDS'. If your port doesn't # need one of those then you can use '-' like # 'USE_MOZILLA= -png -vpx' to subtract the # dependencies. Experimental deps use '+' like # 'USE_MOZILLA= +speex +theora'. # # MOZILLA_PLIST_DIRS List of directories to descend into when installing # and creating the plist # # MOZ_OPTIONS configure arguments (added to .mozconfig). If # NOMOZCONFIG is defined, you probably want to set # CONFIGURE_ARGS+=${MOZ_OPTIONS} # # MOZ_MK_OPTIONS The make(1) arguments (added to .mozconfig). If # NOMOZCONFIG is defined, you probably want to set # MAKE_ARGS+=${MOZ_MK_OPTIONS} # # MOZ_EXPORT Environment variables for the build process (added # to .mozconfig). If NOMOZCONFIG is defined, you # probably want to set MAKE_ENV+=${MOZ_EXPORT} # # NOMOZCONFIG Don't drop a customized .mozconfig into the build # directory. Options will have to be specified in # CONFIGURE_ARGS instead # MAINTAINER?= gecko@FreeBSD.org MOZILLA?= ${PORTNAME} MOZILLA_VER?= ${PORTVERSION} MOZILLA_BIN?= ${PORTNAME}-bin MOZILLA_EXEC_NAME?=${MOZILLA} USES+= compiler:c++17-lang cpe gl gmake gnome iconv localbase perl5 pkgconfig \ python:2.7,build desktop-file-utils CPE_VENDOR?=mozilla USE_GL= gl USE_GNOME= cairo gdkpixbuf2 gtk20 gtk30 USE_PERL5= build USE_XORG= x11 xcb xcomposite xdamage xext xfixes xrender xt HAS_CONFIGURE= yes CONFIGURE_OUTSOURCE= yes LDFLAGS+= -Wl,--as-needed BUNDLE_LIBS= yes BUILD_DEPENDS+= llvm${LLVM_DEFAULT}>0:devel/llvm${LLVM_DEFAULT} \ rust-cbindgen>=0.8.7:devel/rust-cbindgen \ ${RUST_DEFAULT}>=1.35:lang/${RUST_DEFAULT} \ ${LOCALBASE}/bin/python${PYTHON3_DEFAULT}:lang/python${PYTHON3_DEFAULT:S/.//g} \ node:www/node MOZ_EXPORT+= ${CONFIGURE_ENV} \ LLVM_CONFIG=llvm-config${LLVM_DEFAULT} \ PERL="${PERL}" \ PYTHON3="${LOCALBASE}/bin/python${PYTHON3_DEFAULT}" \ RUSTFLAGS="${RUSTFLAGS}" MOZ_OPTIONS+= --prefix="${PREFIX}" MOZ_MK_OPTIONS+=MOZ_OBJDIR="${BUILD_WRKSRC}" # Require newer Clang than what's in base system unless user opted out . if ${CC} == cc && ${CXX} == c++ && exists(/usr/lib/libc++.so) BUILD_DEPENDS+= ${LOCALBASE}/bin/clang${LLVM_DEFAULT}:devel/llvm${LLVM_DEFAULT} CPP= ${LOCALBASE}/bin/clang-cpp${LLVM_DEFAULT} CC= ${LOCALBASE}/bin/clang${LLVM_DEFAULT} CXX= ${LOCALBASE}/bin/clang++${LLVM_DEFAULT} USES:= ${USES:Ncompiler\:*} # XXX avoid warnings . endif MOZSRC?= ${WRKSRC} PLISTF?= ${WRKDIR}/plist_files MOZCONFIG?= ${WRKSRC}/.mozconfig MOZILLA_PLIST_DIRS?= bin lib share/pixmaps share/applications # Adjust -C target-cpu if -march/-mcpu is set by bsd.cpu.mk .if ${ARCH} == amd64 || ${ARCH} == i386 RUSTFLAGS+= ${CFLAGS:M-march=*:S/-march=/-C target-cpu=/} .else RUSTFLAGS+= ${CFLAGS:M-mcpu=*:S/-mcpu=/-C target-cpu=/} .endif # Standard depends _ALL_DEPENDS= av1 event ffi graphite harfbuzz icu jpeg nspr nss png pixman sqlite vpx webp .if exists(${FILESDIR}/patch-bug1559213) av1_LIB_DEPENDS= libaom.so:multimedia/aom libdav1d.so:multimedia/dav1d av1_MOZ_OPTIONS= --with-system-av1 .endif event_LIB_DEPENDS= libevent.so:devel/libevent event_MOZ_OPTIONS= --with-system-libevent ffi_LIB_DEPENDS= libffi.so:devel/libffi ffi_MOZ_OPTIONS= --enable-system-ffi .if exists(${FILESDIR}/patch-bug847568) graphite_LIB_DEPENDS= libgraphite2.so:graphics/graphite2 graphite_MOZ_OPTIONS= --with-system-graphite2 harfbuzz_LIB_DEPENDS= libharfbuzz.so:print/harfbuzz harfbuzz_MOZ_OPTIONS= --with-system-harfbuzz .endif icu_LIB_DEPENDS= libicui18n.so:devel/icu icu_MOZ_OPTIONS= --with-system-icu --with-intl-api -jpeg_BUILD_DEPENDS=yasm:devel/yasm jpeg_USES= jpeg jpeg_MOZ_OPTIONS= --with-system-jpeg=${LOCALBASE} nspr_LIB_DEPENDS= libnspr4.so:devel/nspr nspr_MOZ_OPTIONS= --with-system-nspr nss_LIB_DEPENDS= libnss3.so:security/nss nss_MOZ_OPTIONS= --with-system-nss pixman_LIB_DEPENDS= libpixman-1.so:x11/pixman pixman_MOZ_OPTIONS= --enable-system-pixman png_LIB_DEPENDS= libpng.so:graphics/png png_MOZ_OPTIONS= --with-system-png=${LOCALBASE} sqlite_LIB_DEPENDS= libsqlite3.so:databases/sqlite3 sqlite_MOZ_OPTIONS= --enable-system-sqlite -vpx_BUILD_DEPENDS= yasm:devel/yasm vpx_LIB_DEPENDS= libvpx.so:multimedia/libvpx vpx_MOZ_OPTIONS= --with-system-libvpx webp_LIB_DEPENDS= libwebp.so:graphics/webp webp_MOZ_OPTIONS= --with-system-webp .for use in ${USE_MOZILLA} ${use:S/-/_WITHOUT_/}= ${TRUE} .endfor LIB_DEPENDS+= libfontconfig.so:x11-fonts/fontconfig \ libfreetype.so:print/freetype2 .for dep in ${_ALL_DEPENDS} ${USE_MOZILLA:M+*:S/+//} .if !defined(_WITHOUT_${dep}) BUILD_DEPENDS+= ${${dep}_BUILD_DEPENDS} LIB_DEPENDS+= ${${dep}_LIB_DEPENDS} RUN_DEPENDS+= ${${dep}_RUN_DEPENDS} USES+= ${${dep}_USES} MOZ_OPTIONS+= ${${dep}_MOZ_OPTIONS} .else BUILD_DEPENDS+= ${-${dep}_BUILD_DEPENDS} .endif .endfor # Standard options MOZ_OPTIONS+= \ --enable-update-channel=${PKGNAMESUFFIX:Urelease:S/^-//} \ --disable-updater \ --with-system-zlib \ --with-system-bz2 # API keys from www/chromium # http://www.chromium.org/developers/how-tos/api-keys # Note: these are for FreeBSD use ONLY. For your own distribution, # please get your own set of keys. MOZ_EXPORT+= MOZ_GOOGLE_LOCATION_SERVICE_API_KEY=AIzaSyBsp9n41JLW8jCokwn7vhoaMejDFRd1mp8 MOZ_EXPORT+= MOZ_GOOGLE_SAFEBROWSING_API_KEY=AIzaSyBsp9n41JLW8jCokwn7vhoaMejDFRd1mp8 .if ${PORT_OPTIONS:MOPTIMIZED_CFLAGS} CFLAGS+= -O3 MOZ_EXPORT+= MOZ_OPTIMIZE_FLAGS="${CFLAGS:M-O*}" MOZ_OPTIONS+= --enable-optimize .else MOZ_OPTIONS+= --disable-optimize . if ${/usr/bin/ld:L:tA} != /usr/bin/ld.lld # ld 2.17 barfs on Stylo built with -C opt-level=0 USE_BINUTILS= yes LDFLAGS+= -B${LOCALBASE}/bin . endif .endif .if ${PORT_OPTIONS:MCANBERRA} RUN_DEPENDS+= libcanberra>0:audio/libcanberra .endif .if ${PORT_OPTIONS:MDBUS} BUILD_DEPENDS+= libnotify>0:devel/libnotify LIB_DEPENDS+= libdbus-1.so:devel/dbus \ libdbus-glib-1.so:devel/dbus-glib \ libstartup-notification-1.so:x11/startup-notification MOZ_OPTIONS+= --enable-startup-notification .else MOZ_OPTIONS+= --disable-dbus .endif .if ${PORT_OPTIONS:MFFMPEG} # dom/media/platforms/ffmpeg/FFmpegRuntimeLinker.cpp RUN_DEPENDS+= ffmpeg>=0.8,1:multimedia/ffmpeg .endif .if ${PORT_OPTIONS:MGCONF} # XXX USE_GNOME+=gconf2:build is not supported BUILD_DEPENDS+= ${LOCALBASE}/lib/libgconf-2.so:devel/gconf2 MOZ_OPTIONS+= --enable-gconf .else MOZ_OPTIONS+= --disable-gconf .endif .if ${PORT_OPTIONS:MLIBPROXY} LIB_DEPENDS+= libproxy.so:net/libproxy MOZ_OPTIONS+= --enable-libproxy .else MOZ_OPTIONS+= --disable-libproxy .endif .if ${PORT_OPTIONS:MALSA} BUILD_DEPENDS+= ${LOCALBASE}/include/alsa/asoundlib.h:audio/alsa-lib RUN_DEPENDS+= ${LOCALBASE}/lib/alsa-lib/libasound_module_pcm_oss.so:audio/alsa-plugins RUN_DEPENDS+= alsa-lib>=1.1.1_1:audio/alsa-lib MOZ_OPTIONS+= --enable-alsa .endif .if ${PORT_OPTIONS:MJACK} BUILD_DEPENDS+= ${LOCALBASE}/include/jack/jack.h:audio/jack MOZ_OPTIONS+= --enable-jack .endif .if ${PORT_OPTIONS:MPULSEAUDIO} BUILD_DEPENDS+= ${LOCALBASE}/include/pulse/pulseaudio.h:audio/pulseaudio MOZ_OPTIONS+= --enable-pulseaudio .else MOZ_OPTIONS+= --disable-pulseaudio .endif .if ${PORT_OPTIONS:MSNDIO} BUILD_DEPENDS+= ${LOCALBASE}/include/sndio.h:audio/sndio post-patch-SNDIO-on: @${REINPLACE_CMD} -e 's|OpenBSD|${OPSYS}|g' \ -e '/DISABLE_LIBSNDIO_DLOPEN/d' \ ${MOZSRC}/media/libcubeb/src/moz.build .endif .if ${PORT_OPTIONS:MDEBUG} MOZ_OPTIONS+= --enable-debug --disable-release STRIP= # ports/184285 .else MOZ_OPTIONS+= --disable-debug --disable-debug-symbols --enable-release . if ${ARCH:Maarch64} || ${MACHINE_CPU:Msse2} MOZ_OPTIONS+= --enable-rust-simd . endif .endif .if ${PORT_OPTIONS:MPROFILE} MOZ_OPTIONS+= --enable-profiling STRIP= .else MOZ_OPTIONS+= --disable-profiling .endif .if ${PORT_OPTIONS:MTEST} USE_XORG+= xscrnsaver MOZ_OPTIONS+= --enable-tests .else MOZ_OPTIONS+= --disable-tests .endif .if !defined(STRIP) || ${STRIP} == "" MOZ_OPTIONS+= --disable-strip --disable-install-strip .else MOZ_OPTIONS+= --enable-strip --enable-install-strip .endif # _MAKE_JOBS is only available after bsd.port.post.mk, thus cannot be # used in .mozconfig. And client.mk automatically uses -jN where N # is what multiprocessing.cpu_count() returns. .if defined(DISABLE_MAKE_JOBS) || defined(MAKE_JOBS_UNSAFE) MAKE_JOBS_NUMBER= 1 .endif .if defined(MAKE_JOBS_NUMBER) MOZ_MAKE_FLAGS+=-j${MAKE_JOBS_NUMBER} .endif .if defined(MOZ_MAKE_FLAGS) MOZ_MK_OPTIONS+=MOZ_MAKE_FLAGS="${MOZ_MAKE_FLAGS}" .endif .if ${ARCH} == amd64 . if ${USE_MOZILLA:M-nss} USE_BINUTILS= # intel-gcm.s CFLAGS+= -B${LOCALBASE}/bin LDFLAGS+= -B${LOCALBASE}/bin . endif .elif ${ARCH:Mpowerpc*} . if ${ARCH} == "powerpc64" MOZ_EXPORT+= UNAME_m="${ARCH}" . endif .elif ${ARCH} == "sparc64" # Work around miscompilation/mislinkage of the sCanonicalVTable hacks. MOZ_OPTIONS+= --disable-v1-string-abi .endif .else # bsd.port.post.mk post-patch: gecko-post-patch gecko-post-patch: @${RM} ${MOZCONFIG} .if !defined(NOMOZCONFIG) .for arg in ${MOZ_OPTIONS} @${ECHO_CMD} ac_add_options ${arg:Q} >> ${MOZCONFIG} .endfor .for arg in ${MOZ_MK_OPTIONS} @${ECHO_CMD} mk_add_options ${arg:Q} >> ${MOZCONFIG} .endfor .for var in ${MOZ_EXPORT} @${ECHO_CMD} export ${var:Q} >> ${MOZCONFIG} .endfor .endif # .if !defined(NOMOZCONFIG) .if ${USE_MOZILLA:M-nspr} @${ECHO_MSG} "===> Applying NSPR patches" @for i in ${.CURDIR}/../../devel/nspr/files/patch-*; do \ ${PATCH} ${PATCH_ARGS} -d ${MOZSRC}/nsprpub < $$i; \ done .endif .if ${USE_MOZILLA:M-nss} @${ECHO_MSG} "===> Applying NSS patches" @for i in ${.CURDIR}/../../security/nss/files/patch-*; do \ ${PATCH} ${PATCH_ARGS} -d ${MOZSRC}/security/nss < $$i; \ done .endif @if [ -f ${WRKSRC}/config/baseconfig.mk ] ; then \ ${REINPLACE_CMD} -e 's|%%MOZILLA%%|${MOZILLA}|g' \ ${WRKSRC}/config/baseconfig.mk; \ fi @${REINPLACE_CMD} -e 's|%%MOZILLA%%|${MOZILLA}|g' \ ${MOZSRC}/config/baseconfig.mk @${REINPLACE_CMD} -e 's|/usr/local/netscape|${LOCALBASE}|g ; \ s|/usr/local/lib/netscape|${LOCALBASE}/lib|g' \ ${MOZSRC}/xpcom/io/SpecialSystemDirectory.cpp @${REINPLACE_CMD} -e 's|/etc|${PREFIX}&|g' \ ${MOZSRC}/xpcom/build/nsXPCOMPrivate.h @${REINPLACE_CMD} -e 's|/usr/local|${LOCALBASE}|g' \ -e 's|mozilla/plugins|browser_plugins|g' \ -e 's|share/mozilla/extensions|lib/xpi|g' \ ${MOZSRC}/xpcom/io/nsAppFileLocationProvider.cpp \ ${MOZSRC}/toolkit/xre/nsXREDirProvider.cpp # Disable vendor checksums like lang/rust @${REINPLACE_CMD} 's,"files":{[^}]*},"files":{},' \ ${MOZSRC}/third_party/rust/*/.cargo-checksum.json +pre-configure-script: +# Check that the running kernel has COMPAT_FREEBSD11 required by lang/rust post-ino64 + @${SETENV} CC="${CC}" OPSYS="${OPSYS}" OSVERSION="${OSVERSION}" WRKDIR="${WRKDIR}" \ + ${SH} ${SCRIPTSDIR}/rust-compat11-canary.sh + post-install-script: gecko-create-plist gecko-create-plist: # Create the plist ${RM} ${PLISTF} .for dir in ${MOZILLA_PLIST_DIRS} @cd ${STAGEDIR}${PREFIX}/${dir} && ${FIND} -H -s * ! -type d | \ ${SED} -e 's|^|${dir}/|' >> ${PLISTF} .endfor ${CAT} ${PLISTF} | ${SORT} >> ${TMPPLIST} .endif .endif # HERE THERE BE TACOS -- adamw Index: head/lang/rust/Makefile =================================================================== --- head/lang/rust/Makefile (revision 522967) +++ head/lang/rust/Makefile (revision 522968) @@ -1,269 +1,272 @@ # Created by: Jyun-Yan You # $FreeBSD$ PORTNAME= rust PORTVERSION?= 1.40.0 PORTREVISION?= 0 CATEGORIES= lang MASTER_SITES= https://static.rust-lang.org/dist/:src \ https://static.rust-lang.org/dist/:rust_bootstrap \ LOCAL/tobik/rust:rust_bootstrap \ https://static.rust-lang.org/dist/:cargo_bootstrap \ LOCAL/tobik/rust:cargo_bootstrap \ https://releases.llvm.org/${COMPILER_RT_VERSION}/:compiler_rt \ https://github.com/llvm/llvm-project/releases/download/llvmorg-${COMPILER_RT_VERSION}/:compiler_rt DISTNAME?= ${PORTNAME}c-${PORTVERSION}-src DISTFILES?= ${NIGHTLY_SUBDIR}${DISTNAME}${EXTRACT_SUFX}:src \ ${_RUSTC_BOOTSTRAP}${BOOTSTRAPS_SUFFIX}${EXTRACT_SUFX}:rust_bootstrap \ ${_RUST_STD_BOOTSTRAP}${BOOTSTRAPS_SUFFIX}${EXTRACT_SUFX}:rust_bootstrap \ ${_CARGO_BOOTSTRAP}${BOOTSTRAPS_SUFFIX}${EXTRACT_SUFX}:cargo_bootstrap \ ${DISTFILES_${ARCH}} DISTFILES_armv6= compiler-rt-${COMPILER_RT_VERSION}.src.tar.xz:compiler_rt DISTFILES_armv7= compiler-rt-${COMPILER_RT_VERSION}.src.tar.xz:compiler_rt DIST_SUBDIR?= rust EXTRACT_ONLY?= ${DISTFILES:N*\:*bootstrap:C/:.*//} MAINTAINER= rust@FreeBSD.org COMMENT= Language with a focus on memory safety and concurrency LICENSE= APACHE20 MIT LICENSE_COMB= dual LICENSE_FILE_APACHE20= ${WRKSRC}/LICENSE-APACHE LICENSE_FILE_MIT= ${WRKSRC}/LICENSE-MIT IGNORE_FreeBSD_11_powerpc64= is missing a bootstrap for FreeBSD 11.x powerpc64 ONLY_FOR_ARCHS?= aarch64 amd64 armv6 armv7 i386 powerpc64 ONLY_FOR_ARCHS_REASON= requires prebuilt bootstrap compiler BUILD_DEPENDS= cmake:devel/cmake LIB_DEPENDS= libcurl.so:ftp/curl \ libgit2.so:devel/libgit2 \ libssh2.so:security/libssh2 USES= pkgconfig python:3.3+,build ssl tar:xz CONFLICTS_INSTALL?= rust-nightly PLIST_FILES= lib/rustlib/components \ lib/rustlib/rust-installer-version OPTIONS_DEFINE= DOCS GDB SOURCES GDB_DESC= Install ports gdb (necessary for debugging rust programs) SOURCES_DESC= Install source files DOCS_VARS_OFF= _RUST_BUILD_DOCS=false DOCS_VARS= _RUST_BUILD_DOCS=true GDB_RUN_DEPENDS= ${LOCALBASE}/bin/gdb:devel/gdb # See WRKSRC/src/stage0.txt for the date and version values. BOOTSTRAPS_DATE?= 2019-11-07 RUST_BOOTSTRAP_VERSION?= 1.39.0 CARGO_BOOTSTRAP_VERSION?= 0.40.0 COMPILER_RT_VERSION?= 9.0.0 BOOTSTRAPS_SUFFIX?= ${BOOTSTRAPS_SUFFIX_${ARCH}} BOOTSTRAPS_SUFFIX_powerpc64?= -${PPC_ABI:tl} CARGO_VENDOR_DIR?= ${WRKSRC}/vendor # Rust's target arch string might be different from *BSD arch strings _RUST_ARCH_amd64= x86_64 _RUST_ARCH_i386= i686 _RUST_TARGET= ${_RUST_ARCH_${ARCH}:U${ARCH}}-unknown-${OPSYS:tl} _LLVM_TARGET= ${ARCH:C/armv.*/ARM/:S/aarch64/AArch64/:S/powerpc64/PowerPC/} _RUSTC_BOOTSTRAP= ${BOOTSTRAPS_DATE_${ARCH}:U${BOOTSTRAPS_DATE}}/rustc-${RUST_BOOTSTRAP_VERSION_${ARCH}:U${RUST_BOOTSTRAP_VERSION}}-${_RUST_TARGET} _RUST_STD_BOOTSTRAP= ${BOOTSTRAPS_DATE_${ARCH}:U${BOOTSTRAPS_DATE}}/rust-std-${RUST_BOOTSTRAP_VERSION_${ARCH}:U${RUST_BOOTSTRAP_VERSION}}-${_RUST_TARGET} _CARGO_BOOTSTRAP= ${BOOTSTRAPS_DATE_${ARCH}:U${BOOTSTRAPS_DATE}}/cargo-${CARGO_BOOTSTRAP_VERSION_${ARCH}:U${CARGO_BOOTSTRAP_VERSION}}-${_RUST_TARGET} .include .if exists(${PATCHDIR}/${ARCH}${BOOTSTRAPS_SUFFIX}) EXTRA_PATCHES+= ${PATCHDIR}/${ARCH}${BOOTSTRAPS_SUFFIX} .endif .if ${ARCH} == powerpc64 && ${PPC_ABI} == ELFv1 # The bootstrap is hardcoded to use gcc9 # but we can build with a newer or older compiler as provided by USE_GCC=yes BUILD_DEPENDS+= gcc9:lang/gcc9 USE_GCC= yes .endif .if ${ARCH} == aarch64 && ${OSVERSION} < 1200502 IGNORE= fails to run due to a bug in rtld, update to 12-STABLE r342847 or 13-CURRENT r342113 .endif .ifdef QEMU_EMULATING IGNORE= fails to build with qemu-user-static .endif X_PY_ENV= HOME="${WRKDIR}" \ LIBGIT2_SYS_USE_PKG_CONFIG=1 \ LIBSSH2_SYS_USE_PKG_CONFIG=1 \ OPENSSL_DIR="${OPENSSLBASE}" X_PY_CMD= ${PYTHON_CMD} ${WRKSRC}/x.py post-extract: @${MKDIR} ${WRKSRC}/build/cache/${BOOTSTRAPS_DATE_${ARCH}:U${BOOTSTRAPS_DATE}} ${LN} -sf ${DISTDIR}/${DIST_SUBDIR}/${_RUSTC_BOOTSTRAP}${BOOTSTRAPS_SUFFIX}${EXTRACT_SUFX} \ ${WRKSRC}/build/cache/${_RUSTC_BOOTSTRAP}${EXTRACT_SUFX} ${LN} -sf ${DISTDIR}/${DIST_SUBDIR}/${_RUST_STD_BOOTSTRAP}${BOOTSTRAPS_SUFFIX}${EXTRACT_SUFX} \ ${WRKSRC}/build/cache/${_RUST_STD_BOOTSTRAP}${EXTRACT_SUFX} ${LN} -sf ${DISTDIR}/${DIST_SUBDIR}/${_CARGO_BOOTSTRAP}${BOOTSTRAPS_SUFFIX}${EXTRACT_SUFX} \ ${WRKSRC}/build/cache/${_CARGO_BOOTSTRAP}${EXTRACT_SUFX} .if ${ARCH} == armv6 || ${ARCH} == armv7 ${LN} -sf ${WRKDIR}/compiler-rt-${COMPILER_RT_VERSION}.src ${WRKSRC}/src/llvm-project/compiler-rt .endif post-patch: @${REINPLACE_CMD} 's,gdb,${LOCALBASE}/bin/gdb,' ${WRKSRC}/src/etc/rust-gdb @${ECHO_MSG} "Canonical bootstrap date and version before patching:" @${GREP} -E '^(date|rustc|cargo)' ${WRKSRC}/src/stage0.txt # If we override the versions and date of the bootstraps (for instance # on aarch64 where we provide our own bootstraps), we need to update # places where they are recorded. @${REINPLACE_CMD} -e 's,^date:.*,date: ${BOOTSTRAPS_DATE_${ARCH}:U${BOOTSTRAPS_DATE}},' \ -e 's,^rustc:.*,rustc: ${RUST_BOOTSTRAP_VERSION_${ARCH}:U${RUST_BOOTSTRAP_VERSION}},' \ -e 's,^cargo:.*,cargo: ${CARGO_BOOTSTRAP_VERSION_${ARCH}:U${CARGO_BOOTSTRAP_VERSION}},' \ ${WRKSRC}/src/stage0.txt @${ECHO_MSG} "Bootstrap date and version after patching:" @${GREP} -E '^(date|rustc|cargo)' ${WRKSRC}/src/stage0.txt .if ${ARCH} == powerpc64 @${REINPLACE_CMD} -e 's,powerpc64-unknown-freebsd,powerpc64-unknown-freebsd${OSREL},' \ ${WRKSRC}/src/librustc_target/spec/powerpc64_unknown_freebsd.rs .endif # Disable vendor checksums @${REINPLACE_CMD} 's,"files":{[^}]*},"files":{},' \ ${CARGO_VENDOR_DIR}/*/.cargo-checksum.json post-patch-SOURCES-off: # Mimic tools in config.toml with just src excluded @${REINPLACE_CMD} -e 's/config.tools.*"src".*/false;/' \ ${WRKSRC}/src/bootstrap/install.rs do-configure: +# Check that the running kernel has COMPAT_FREEBSD11 required by lang/rust post-ino64 + @${SETENV} CC="${CC}" OPSYS="${OPSYS}" OSVERSION="${OSVERSION}" WRKDIR="${WRKDIR}" \ + ${SH} ${SCRIPTSDIR}/rust-compat11-canary.sh @${ECHO_CMD} '[build]' > ${WRKSRC}/config.toml @${ECHO_CMD} 'vendor=true' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'extended=true' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'python="${PYTHON_CMD}"' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'docs=${_RUST_BUILD_DOCS}' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'verbose=2' >> ${WRKSRC}/config.toml @${ECHO_CMD} '[install]' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'prefix="${PREFIX}"' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'sysconfdir="${PREFIX}/etc"' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'mandir="${MANPREFIX}/man"' >> ${WRKSRC}/config.toml @${ECHO_CMD} '[rust]' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'channel="${PKGNAMESUFFIX:Ustable:S/^-//}"' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'default-linker="${CC}"' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'verbose-tests=true' >> ${WRKSRC}/config.toml @${ECHO_CMD} '[llvm]' >> ${WRKSRC}/config.toml .if defined(WITH_CCACHE_BUILD) && !defined(NO_CCACHE) @${ECHO_CMD} 'ccache="${CCACHE_BIN}"' >> ${WRKSRC}/config.toml .else @${ECHO_CMD} 'ccache=false' >> ${WRKSRC}/config.toml .endif # no need to build a crosscompiler for these targets .if ${ARCH} == aarch64 || ${ARCH} == armv6 || ${ARCH} == armv7 || ${ARCH} == powerpc64 @${ECHO_CMD} 'targets="${_LLVM_TARGET}"' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'experimental-targets=""' >> ${WRKSRC}/config.toml .endif @${ECHO_CMD} '[target.${_RUST_TARGET}]' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'cc="${CC}"' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'cxx="${CXX}"' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'linker="${CC}"' >> ${WRKSRC}/config.toml @${ECHO_CMD} '[dist]' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'src-tarball=false' >> ${WRKSRC}/config.toml @${REINPLACE_CMD} -e 's,%CC%,${CC},g' \ ${WRKSRC}/src/librustc_llvm/build.rs \ ${WRKSRC}/src/bootstrap/native.rs do-build: cd ${WRKSRC} && \ ${SETENV} ${X_PY_ENV} \ ${X_PY_CMD} build \ --config ./config.toml \ --jobs ${MAKE_JOBS_NUMBER} do-install: cd ${WRKSRC} && \ ${SETENV} ${X_PY_ENV} \ DESTDIR=${STAGEDIR} \ ${X_PY_CMD} 'install' \ --config ./config.toml \ --jobs ${MAKE_JOBS_NUMBER} # In post-install, we use the manifests generated during Rust install # to in turn generate the PLIST. We do that, instead of the regular # `pkg-plist`, because several libraries have a computed filename based # on the absolute path of the source files. As it is user-specific, we # can't know their filename in advance. # # Both rustc and Cargo components install the same README.md and LICENSE # files. The install process backs up the first copy to install the # second. Thus here, we need to remove those backups. We also need to # dedup the entries in the generated PLIST, because both components' # manifests list them. # # We fix manpage entries in the generated manifests because Rust # installs them uncompressed but the Ports framework compresses them. post-install: for f in ${STAGEDIR}${PREFIX}/lib/rustlib/manifest-*; do \ ${REINPLACE_CMD} -i '' -E \ -e 's|:${STAGEDIR}|:|' \ -e 's|(man/man[1-9]/.*\.[0-9])|\1.gz|' \ "$$f"; \ ${ECHO_CMD} "$${f#${STAGEDIR}}" >> ${TMPPLIST}; \ ${AWK} '\ /^file:/ { \ file=$$0; \ sub(/^file:/, "", file); \ print file; \ } \ /^dir:/ { \ dir=$$0; \ sub(/^dir:/, "", dir); \ system("find ${STAGEDIR}" dir " -type f | ${SED} -E -e \"s|${STAGEDIR}||\""); \ }' \ "$$f" >> ${TMPPLIST}; \ done ${RM} -r ${STAGEDIR}${PREFIX}/share/doc/rust/*.old ${SORT} -u < ${TMPPLIST} > ${TMPPLIST}.uniq ${MV} ${TMPPLIST}.uniq ${TMPPLIST} @${RM} \ ${STAGEDIR}${PREFIX}/lib/rustlib/install.log \ ${STAGEDIR}${PREFIX}/lib/rustlib/uninstall.sh # FIXME: Static libraries in lib/rustlib/*/lib/*.rlib are not stripped, # but they contain non-object files which make strip(1) unhappy. @${FIND} ${STAGEDIR}${PREFIX}/bin -exec ${FILE} -i {} + | ${AWK} -F: \ '/executable|sharedlib/ { print $$1 }' | ${XARGS} ${STRIP_CMD} # Note that make test does not work when rust is already installed. do-test: cd ${WRKSRC} && \ ${SETENV} ${X_PY_ENV} \ ALLOW_NONZERO_RLIMIT_CORE=1 \ ${X_PY_CMD} test \ --config ./config.toml \ --jobs ${MAKE_JOBS_NUMBER} .if !defined(_RUST_MAKESUM_GUARD) makesum: ${MAKE} -D_RUST_MAKESUM_GUARD makesum ARCH=${ONLY_FOR_ARCHS:O:[1]} DISTINFO_FILE=${DISTINFO_FILE}.tmp .for arch in ${ONLY_FOR_ARCHS:O:[2..-1]} ${MAKE} -D_RUST_MAKESUM_GUARD makesum PPC_ABI=ELFv1 ARCH=${arch} DISTINFO_FILE=${DISTINFO_FILE}.${arch} ${GREP} ${_RUST_ARCH_${arch}:U${arch}} ${DISTINFO_FILE}.${arch} >> ${DISTINFO_FILE}.tmp .for file in ${DISTFILES_${arch}} ${GREP} ${file:S,:, ,:[1]} ${DISTINFO_FILE}.${arch} >> ${DISTINFO_FILE}.tmp .endfor ${RM} ${DISTINFO_FILE}.${arch} .endfor .if ${ONLY_FOR_ARCHS:Mpowerpc64} ${MAKE} -D_RUST_MAKESUM_GUARD makesum PPC_ABI=ELFv2 ARCH=powerpc64 DISTINFO_FILE=${DISTINFO_FILE}.powerpc64-elfv2 ${GREP} ${_RUST_ARCH_powerpc64:Upowerpc64} ${DISTINFO_FILE}.powerpc64-elfv2 >> ${DISTINFO_FILE}.tmp ${RM} ${DISTINFO_FILE}.powerpc64-elfv2 .endif ${AWK} '!seen[$$0]++' ${DISTINFO_FILE}.tmp > ${DISTINFO_FILE} ${RM} ${DISTINFO_FILE}.tmp .endif .include