Index: head/Mk/Uses/cargo.mk =================================================================== --- head/Mk/Uses/cargo.mk (revision 518677) +++ head/Mk/Uses/cargo.mk (revision 518678) @@ -1,322 +1,318 @@ # $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.39.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:Mbacktrace-sys-[0-9]*} -BUILD_DEPENDS+= gmake:devel/gmake -.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 !target(do-configure) && ${CARGO_CONFIGURE:tl} == "yes" # configure hook. Place a config file for overriding crates-io index # by local source directory. do-configure: @${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/lang/rust/Makefile =================================================================== --- head/lang/rust/Makefile (revision 518677) +++ head/lang/rust/Makefile (revision 518678) @@ -1,268 +1,267 @@ # Created by: Jyun-Yan You # $FreeBSD$ PORTNAME= rust PORTVERSION?= 1.39.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 \ - gmake:devel/gmake +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-09-26 RUST_BOOTSTRAP_VERSION?= 1.38.0 CARGO_BOOTSTRAP_VERSION?= 0.39.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 # Drop after D22039 lands PPC_ABI?= ELFv1 .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 .if defined(WITH_CCACHE_BUILD) && !defined(NO_CCACHE) CCACHE_VALUE= "${CCACHE_BIN}" .else CCACHE_VALUE= false .endif do-configure: ${SED} -E \ -e 's,%PREFIX%,${PREFIX},' \ -e 's,%SYSCONFDIR%,${PREFIX}/etc,' \ -e 's,%MANDIR%,${MANPREFIX}/man,' \ -e 's,%PYTHON_CMD%,${PYTHON_CMD},' \ -e 's,%CHANNEL%,${PKGNAMESUFFIX:Ustable:S/^-//},' \ -e 's,%TARGET%,${_RUST_TARGET},' \ -e 's,%CCACHE%,${CCACHE_VALUE},' \ -e 's,%CC%,${CC},' \ -e 's,%CXX%,${CXX},' \ -e 's,%DOCS%,${_RUST_BUILD_DOCS},' \ < ${FILESDIR}/config.toml \ > ${WRKSRC}/config.toml # no need to build a crosscompiler for these targets .if ${ARCH} == aarch64 || ${ARCH} == armv6 || ${ARCH} == armv7 || ${ARCH} == powerpc64 @${REINPLACE_CMD} -e 's,^#targets =.*,targets = "${_LLVM_TARGET}",' \ -e 's,^#experimental-targets =.*,experimental-targets = "",' \ ${WRKSRC}/config.toml .endif @${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 \ --verbose \ --config ./config.toml \ --jobs ${MAKE_JOBS_NUMBER} do-install: cd ${WRKSRC} && \ ${SETENV} ${X_PY_ENV} \ DESTDIR=${STAGEDIR} \ ${X_PY_CMD} 'install' \ --verbose \ --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 \ --verbose \ --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 ${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 ${AWK} '!seen[$$0]++' ${DISTINFO_FILE}.tmp > ${DISTINFO_FILE} ${RM} ${DISTINFO_FILE}.tmp .endif .include Index: head/net-im/fractal/Makefile =================================================================== --- head/net-im/fractal/Makefile (revision 518677) +++ head/net-im/fractal/Makefile (revision 518678) @@ -1,45 +1,45 @@ # $FreeBSD$ PORTNAME= fractal DISTVERSION= 4.0.0 PORTREVISION= 7 CATEGORIES= net-im MASTER_SITES= https://gitlab.gnome.org/World/fractal/uploads/${GL_HASH}/ MAINTAINER= greg@unrelenting.technology COMMENT= GTK+ Matrix IM client LICENSE= GPLv3+ LICENSE_FILE= ${WRKSRC}/LICENSE.txt -# gmake for the backtrace-sys crate +# gmake for the gettext-sys crate BUILD_DEPENDS= cargo:lang/${RUST_DEFAULT} \ gmake:devel/gmake LIB_DEPENDS= libdbus-1.so:devel/dbus \ libgmp.so:math/gmp \ libgspell-1.so:textproc/gspell \ libhandy-0.0.so:x11-toolkits/libhandy USES= gettext gnome meson pkgconfig python:3.5+,build ssl tar:xz USE_GNOME= cairo gtk30 gtksourceview3 USE_GSTREAMER1= bad GL_HASH= ad6a483327c3e9ef5bb926b89fb26e2b BINARY_ALIAS= python3=${PYTHON_CMD} GLIB_SCHEMAS= org.gnome.Fractal.gschema.xml INSTALLS_ICONS= yes # for the gettext-sys crate MAKE_ENV+= GETTEXT_BIN_DIR=${LOCALBASE}/bin \ GETTEXT_LIB_DIR=${LOCALBASE}/lib \ GETTEXT_INCLUDE_DIR=${LOCALBASE}/include post-patch: # Disable vendor checksums @${REINPLACE_CMD} -e 's/"files":{[^}]*}/"files":{}/' \ ${WRKSRC}/vendor/*/.cargo-checksum.json post-install: ${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/fractal .include Index: head/sysutils/flowgger/Makefile =================================================================== --- head/sysutils/flowgger/Makefile (revision 518677) +++ head/sysutils/flowgger/Makefile (revision 518678) @@ -1,128 +1,131 @@ # $FreeBSD$ PORTNAME= flowgger DISTVERSION= 0.2.6-28 DISTVERSIONSUFFIX= -gab572a0 PORTREVISION= 16 CATEGORIES= sysutils MAINTAINER= ports@FreeBSD.org COMMENT= Fast data collector LICENSE= MPL20 LICENSE_FILE= ${WRKSRC}/LICENSE +# for backtrace-sys < 0.1.24 +BUILD_DEPENDS= gmake:devel/gmake + USES= cargo ssl USE_GITHUB= yes GH_ACCOUNT= jedisct1 GH_TUPLE= Manishearth:rust-clippy:387efd459c0ad3db7af15f1a573057b8587f9748:clippy \ zonyitoo:coio-rs:f5f6f4044a7cceff387ace0f04ffeb3bc3ab979a:coio \ spicavigo:kafka-rust:9a3b427bd702810bcd13cf60e58cb18d5f403c1a:kafka # Bumped openssl crates to 0.9.21 manually to support LibreSSL 2.6.x CARGO_CRATES= ansi_term-0.9.0 \ atty-0.2.2 \ backtrace-0.3.3 \ backtrace-sys-0.1.14 \ bitflags-0.7.0 \ bitflags-0.9.1 \ build_const-0.2.0 \ byteorder-0.5.3 \ byteorder-1.1.0 \ capnp-0.8.11 \ capnpc-0.8.7 \ cargo_metadata-0.2.3 \ cc-1.0.0 \ cfg-if-0.1.2 \ chrono-0.4.0 \ clap-2.26.2 \ context-2.0.0 \ conv-0.3.3 \ crc-1.5.0 \ crc-core-0.1.0 \ custom_derive-0.1.7 \ dbghelp-sys-0.2.0 \ deque-0.3.2 \ dtoa-0.2.2 \ dtoa-0.4.2 \ either-1.1.0 \ error-chain-0.10.0 \ flate2-0.2.20 \ fnv-1.0.5 \ foreign-types-0.3.2 \ foreign-types-shared-0.1.1 \ gcc-0.3.54 \ getopts-0.2.15 \ idna-0.1.4 \ iovec-0.1.0 \ itertools-0.6.3 \ itoa-0.1.1 \ itoa-0.3.4 \ kernel32-sys-0.2.2 \ lazy_static-0.2.8 \ lazy_static-1.2.0 \ lazycell-0.5.1 \ libc-0.2.49 \ linked-hash-map-0.4.2 \ log-0.3.8 \ magenta-0.1.1 \ magenta-sys-0.1.1 \ matches-0.1.6 \ miniz-sys-0.1.10 \ mio-0.6.10 \ miow-0.2.1 \ net2-0.2.31 \ num-0.1.40 \ num-integer-0.1.35 \ num-iter-0.1.34 \ num-traits-0.1.40 \ openssl-0.9.24 \ openssl-sys-0.9.39 \ percent-encoding-1.0.0 \ pkg-config-0.3.9 \ pulldown-cmark-0.0.15 \ quine-mc_cluskey-0.2.4 \ quote-0.3.15 \ rand-0.3.16 \ redis-0.8.0 \ redox_syscall-0.1.31 \ ref_slice-1.1.1 \ regex-syntax-0.4.1 \ rustc-demangle-0.1.5 \ rustc-serialize-0.3.24 \ semver-0.6.0 \ semver-parser-0.7.0 \ serde-0.8.23 \ serde-1.0.15 \ serde_derive-1.0.15 \ serde_derive_internals-0.16.0 \ serde_json-0.8.6 \ serde_json-1.0.3 \ sha1-0.2.0 \ slab-0.3.0 \ snap-0.2.2 \ strsim-0.6.0 \ syn-0.11.11 \ synom-0.11.3 \ term_size-0.3.0 \ textwrap-0.8.0 \ time-0.1.38 \ toml-0.2.1 \ toml-0.4.5 \ twox-hash-1.1.0 \ unicode-bidi-0.3.4 \ unicode-normalization-0.1.5 \ unicode-width-0.1.4 \ unicode-xid-0.0.4 \ url-1.5.1 \ vcpkg-0.2.2 \ vec_map-0.8.0 \ winapi-0.2.8 \ winapi-build-0.1.1 \ ws2_32-sys-0.2.1 CARGO_USE_GITHUB= yes post-install: ${INSTALL_DATA} ${WRKSRC}/flowgger.toml ${STAGEDIR}${PREFIX}/etc/flowgger.toml.sample .include