Changeset View
Changeset View
Standalone View
Standalone View
lang/rust/Makefile
Show All 38 Lines | MAKE_ENV= LIBGIT2_SYS_USE_PKG_CONFIG=1 \ | ||||
LIBSSH2_SYS_USE_PKG_CONFIG=1 \ | LIBSSH2_SYS_USE_PKG_CONFIG=1 \ | ||||
OPENSSL_DIR="${OPENSSLBASE}" \ | OPENSSL_DIR="${OPENSSLBASE}" \ | ||||
RUST_BACKTRACE=1 | RUST_BACKTRACE=1 | ||||
TEST_ENV= ${MAKE_ENV} \ | TEST_ENV= ${MAKE_ENV} \ | ||||
ALLOW_NONZERO_RLIMIT_CORE=1 | ALLOW_NONZERO_RLIMIT_CORE=1 | ||||
CONFLICTS_INSTALL?= rust-nightly | CONFLICTS_INSTALL?= rust-nightly | ||||
PLIST_FILES= lib/rustlib/components \ | |||||
lib/rustlib/rust-installer-version | |||||
OPTIONS_DEFINE= DOCS GDB SOURCES WASM | OPTIONS_DEFINE= DOCS GDB SOURCES WASM | ||||
GDB_DESC= Install ports gdb (necessary for debugging rust programs) | GDB_DESC= Install ports gdb (necessary for debugging rust programs) | ||||
SOURCES_DESC= Install source files | SOURCES_DESC= Install source files | ||||
WASM_DESC= Build the WebAssembly target (wasm32-unknown-unknown) | WASM_DESC= Build the WebAssembly target (wasm32-unknown-unknown) | ||||
DOCS_VARS_OFF= _RUST_BUILD_DOCS=false | DOCS_VARS_OFF= _RUST_BUILD_DOCS=false | ||||
DOCS_VARS= _RUST_BUILD_DOCS=true | DOCS_VARS= _RUST_BUILD_DOCS=true | ||||
GDB_RUN_DEPENDS= ${LOCALBASE}/bin/gdb:devel/gdb | GDB_RUN_DEPENDS= ${LOCALBASE}/bin/gdb:devel/gdb | ||||
▲ Show 20 Lines • Show All 134 Lines • ▼ Show 20 Lines | |||||
do-install: | do-install: | ||||
# DESTDIR not in MAKE_ENV as it would cause the bundled LLVM to be | # DESTDIR not in MAKE_ENV as it would cause the bundled LLVM to be | ||||
# staged into it during do-build. | # staged into it during do-build. | ||||
@cd ${WRKSRC} && \ | @cd ${WRKSRC} && \ | ||||
${SETENV} ${MAKE_ENV} DESTDIR=${STAGEDIR} ${PYTHON_CMD} \ | ${SETENV} ${MAKE_ENV} DESTDIR=${STAGEDIR} ${PYTHON_CMD} \ | ||||
x.py install --config=config.toml --jobs=${MAKE_JOBS_NUMBER} | x.py install --config=config.toml --jobs=${MAKE_JOBS_NUMBER} | ||||
# In post-install, we use the manifests generated during Rust install | # In post-install, we autogenerate the plist file. | ||||
tobik: ~~file~~ | |||||
# to in turn generate the PLIST. We do that, instead of the regular | # We do that, instead of the regular | ||||
# `pkg-plist`, because several libraries have a computed filename based | # `pkg-plist`, because several libraries have a computed filename based | ||||
# on the absolute path of the source files. As it is user-specific, we | # on the absolute path of the source files. As it is user-specific, we | ||||
# can't know their filename in advance. | # can't know their filename in advance. | ||||
# | # | ||||
# Both rustc and Cargo components install the same README.md and LICENSE | # Both rustc and Cargo components install the same README.md and LICENSE | ||||
# files. The install process backs up the first copy to install the | # 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 | # second. Thus here, we need to remove those backups. We also need to | ||||
# dedup the entries in the generated PLIST, because both components' | # dedup the entries in the generated PLIST, because both components' | ||||
# manifests list them. | # manifests list them. | ||||
# | # | ||||
# We fix manpage entries in the generated manifests because Rust | # We fix manpage entries in the generated manifests because Rust | ||||
# installs them uncompressed but the Ports framework compresses them. | # installs them uncompressed but the Ports framework compresses them. | ||||
tobikUnsubmitted Not Done Inline ActionsOnly the first paragraph is interesting now. tobik: Only the first paragraph is interesting now. | |||||
mikaelAuthorUnsubmitted Done Inline Actionsthe last one also? mikael: the last one also? | |||||
tobikUnsubmitted Not Done Inline Actions¯\_(ツ)_/¯ tobik: ¯\_(ツ)_/¯
| |||||
post-install: | post-install: | ||||
for f in ${STAGEDIR}${PREFIX}/lib/rustlib/manifest-*; do \ | ${RM} -r ${STAGEDIR}${PREFIX}/share/doc/rust/*.old \ | ||||
${REINPLACE_CMD} -i '' -E \ | ${STAGEDIR}${PREFIX}/lib/rustlib/uninstall.sh \ | ||||
-e 's,:${STAGEDIR},:,' \ | |||||
-e 's,(share/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/install.log \ | ||||
${STAGEDIR}${PREFIX}/lib/rustlib/uninstall.sh | ${STAGEDIR}${PREFIX}/lib/rustlib/manifest-* | ||||
@${FIND} ${STAGEDIR}${PREFIX}/bin -exec ${FILE} -i {} + | ${AWK} -F: \ | @${FIND} ${STAGEDIR}${PREFIX}/bin -exec ${FILE} -i {} + | ${AWK} -F: \ | ||||
'/executable|sharedlib/ { print $$1 }' | ${XARGS} ${STRIP_CMD} | '/executable|sharedlib/ { print $$1 }' | ${XARGS} ${STRIP_CMD} | ||||
@${FIND} ${STAGEDIR}${INSTALLDIR} -not -type d | ${SORT} | \ | |||||
tobikUnsubmitted Not Done Inline ActionsWhat is INSTALLDIR? tobik: What is INSTALLDIR? | |||||
mikaelAuthorUnsubmitted Done Inline Actionsshould be PREFIX mikael: should be PREFIX | |||||
${SED} -e 's,^${STAGEDIR}${PREFIX}/,,' >> ${TMPPLIST} | |||||
${REINPLACE_CMD} -i '' -E \ | |||||
-e 's,(share/man/man[1-9]/.*\.[0-9]),\1.gz,' ${TMPPLIST} | |||||
tobikUnsubmitted Not Done Inline ActionsCould this not be merged into the previous sed? tobik: Could this not be merged into the previous sed? | |||||
mikaelAuthorUnsubmitted Done Inline ActionsI'm not able to merge the two SED mikael: I'm not able to merge the two SED | |||||
tobikUnsubmitted Not Done Inline ActionsUntested with lang/rust but ${FIND} ${STAGEDIR}${PREFIX} -not -type d | \ ${SED} -E -e 's,^${STAGEDIR}${PREFIX}/,,' -e 's,(share/man/man[1-9]/.*\.[0-9]),\1.gz,' should work. tobik: Untested with lang/rust but
```
${FIND} ${STAGEDIR}${PREFIX} -not -type d | \
${SED} -E -e 's… | |||||
mikaelAuthorUnsubmitted Done Inline ActionsThanks, I got confused with REINPLACE_CMD vs SED mikael: Thanks, I got confused with REINPLACE_CMD vs SED | |||||
post-install-SOURCES-on: | post-install-SOURCES-on: | ||||
# Silence stage-qa warnings by sanitizing permissions on sources | # Silence stage-qa warnings by sanitizing permissions on sources | ||||
@${FIND} ${STAGEDIR}${PREFIX}/lib/rustlib/src -type f -exec ${CHMOD} \ | @${FIND} ${STAGEDIR}${PREFIX}/lib/rustlib/src -type f -exec ${CHMOD} \ | ||||
${SHAREMODE} {} + | ${SHAREMODE} {} + | ||||
# Note that make test does not work when rust is already installed. | # Note that make test does not work when rust is already installed. | ||||
do-test: | do-test: | ||||
Show All 22 Lines |
file