1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-20 04:02:27 +00:00

Uses/cargo: Unbreak ports with CARGO_BUILD_TARGET set

While here fix their WITH_DEBUG builds too.
This commit is contained in:
Tobias Kortkamp 2021-09-08 17:29:00 +02:00
parent 93924a20b3
commit eeb4b50dde
No known key found for this signature in database
GPG Key ID: A4F09FB73CC51F61
16 changed files with 91 additions and 20 deletions

View File

@ -0,0 +1,8 @@
--- scripts/cargo.sh.orig 2021-09-08 13:34:20 UTC
+++ scripts/cargo.sh
@@ -22,4 +22,4 @@ if test -d vendor; then
fi
cargo build ${ARGS[@]} --manifest-path="$1"/Cargo.toml -p podcasts-gtk
-cp "$CARGO_TARGET_DIR"/${TARGET}/podcasts-gtk "$OUTPUT"
+cp "$CARGO_TARGET_DIR"/${CARGO_BUILD_TARGET}/${TARGET}/podcasts-gtk "$OUTPUT"

View File

@ -0,0 +1,15 @@
--- build-aux/cargo.sh.orig 2021-09-08 13:22:45 UTC
+++ build-aux/cargo.sh
@@ -17,10 +17,10 @@ then
echo "** DEBUG MODE **"
cargo build --manifest-path \
"$MESON_SOURCE_ROOT"/Cargo.toml && \
- cp "$CARGO_TARGET_DIR"/debug/shortwave $APP_OUTPUT
+ cp "$CARGO_TARGET_DIR"/$CARGO_BUILD_TARGET/debug/shortwave $APP_OUTPUT
else
echo "** RELEASE MODE **"
cargo build --manifest-path \
"$MESON_SOURCE_ROOT"/Cargo.toml --release && \
- cp "$CARGO_TARGET_DIR"/release/shortwave $APP_OUTPUT
+ cp "$CARGO_TARGET_DIR"/$CARGO_BUILD_TARGET/release/shortwave $APP_OUTPUT
fi

View File

@ -110,6 +110,6 @@ WRKSRC= ${WRKDIR}/RedisJSON-90bc4a0
PLIST_FILES= lib/librejson.so PLIST_FILES= lib/librejson.so
do-install: do-install:
${INSTALL_LIB} ${WRKDIR}/target/release/librejson.so ${STAGEDIR}${PREFIX}/lib ${INSTALL_LIB} ${CARGO_TARGET_DIR}/${CARGO_BUILD_TARGET}/*/librejson.so ${STAGEDIR}${PREFIX}/lib
.include <bsd.port.mk> .include <bsd.port.mk>

View File

@ -0,0 +1,16 @@
--- build-aux/cargo.sh.orig 2021-09-08 15:16:18 UTC
+++ build-aux/cargo.sh
@@ -14,11 +14,11 @@ then
echo "RELEASE MODE"
cargo build --manifest-path \
"$MESON_SOURCE_ROOT"/Cargo.toml --release && \
- cp "$CARGO_TARGET_DIR"/release/"$APP_BIN" "$OUTPUT"
+ cp "$CARGO_TARGET_DIR"/$CARGO_BUILD_TARGET/release/"$APP_BIN" "$OUTPUT"
else
echo "DEBUG MODE"
cargo build --manifest-path \
"$MESON_SOURCE_ROOT"/Cargo.toml --verbose && \
- cp "$CARGO_TARGET_DIR"/debug/"$APP_BIN" "$OUTPUT"
+ cp "$CARGO_TARGET_DIR"/$CARGO_BUILD_TARGET/debug/"$APP_BIN" "$OUTPUT"
fi

View File

@ -283,7 +283,7 @@ post-patch:
${MV} ${WRKSRC}/cargo-crates/pijul-1.0.0-alpha.54/* ${WRKSRC}/ ${MV} ${WRKSRC}/cargo-crates/pijul-1.0.0-alpha.54/* ${WRKSRC}/
do-install: do-install:
${INSTALL_SCRIPT} ${WRKDIR}/target/release/pijul ${STAGEDIR}${PREFIX}/bin/pijul ${INSTALL_SCRIPT} ${CARGO_TARGET_DIR}/${CARGO_BUILD_TARGET}/*/pijul ${STAGEDIR}${PREFIX}/bin/pijul
post-install: post-install:
${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/pijul ${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/pijul

View File

@ -115,7 +115,7 @@ PLIST_FILES= bin/parinfer-rust \
post-install: post-install:
${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/parinfer-rust ${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/parinfer-rust
${INSTALL_LIB} ${CARGO_TARGET_DIR}/*/libparinfer_rust.so \ ${INSTALL_LIB} ${CARGO_TARGET_DIR}/${CARGO_BUILD_TARGET}/*/libparinfer_rust.so \
${STAGEDIR}${PREFIX}/lib ${STAGEDIR}${PREFIX}/lib
@${MKDIR} ${STAGEDIR}${PREFIX}/share/kak/rc/extra \ @${MKDIR} ${STAGEDIR}${PREFIX}/share/kak/rc/extra \
${STAGEDIR}${PREFIX}/share/vim/vimfiles/doc \ ${STAGEDIR}${PREFIX}/share/vim/vimfiles/doc \

View File

@ -474,7 +474,7 @@ update-data: configure
${ECHO} "Please upload the file ${DISTDIR}/${PORTNAME}-data-${DISTVERSION}.tgz" ${ECHO} "Please upload the file ${DISTDIR}/${PORTNAME}-data-${DISTVERSION}.tgz"
do-install: do-install:
${INSTALL_PROGRAM} ${WRKDIR}/target/release/game ${STAGEDIR}${PREFIX}/bin/${PORTNAME}-game ${INSTALL_PROGRAM} ${CARGO_TARGET_DIR}/${CARGO_BUILD_TARGET}/*/game ${STAGEDIR}${PREFIX}/bin/${PORTNAME}-game
cd ${WRKSRC}/data && ${COPYTREE_SHARE} . ${STAGEDIR}${DATADIR} cd ${WRKSRC}/data && ${COPYTREE_SHARE} . ${STAGEDIR}${DATADIR}
cd ${WRKDIR}/data && ${COPYTREE_SHARE} . ${STAGEDIR}${DATADIR} cd ${WRKDIR}/data && ${COPYTREE_SHARE} . ${STAGEDIR}${DATADIR}

View File

@ -0,0 +1,18 @@
--- build-aux/cargo.sh.orig 2021-09-10 08:14:31 UTC
+++ build-aux/cargo.sh
@@ -8,13 +8,13 @@ export CARGO_HOME="$MESON_BUILD_ROOT"/cargo-home
if [ "$4" = "Devel" ]
then
echo "DEBUG MODE"
cargo build --manifest-path \
"$MESON_SOURCE_ROOT"/Cargo.toml && \
- cp "$CARGO_TARGET_DIR"/debug/$5 $3
+ cp "$CARGO_TARGET_DIR"/$CARGO_BUILD_TARGET/debug/$5 $3
else
echo "RELEASE MODE"
cargo build --manifest-path \
"$MESON_SOURCE_ROOT"/Cargo.toml --release && \
- cp "$CARGO_TARGET_DIR"/release/$5 $3
+ cp "$CARGO_TARGET_DIR"/$CARGO_BUILD_TARGET/release/$5 $3
fi

View File

@ -234,7 +234,7 @@ MAKE_ENV= CARGO_PROFILE_RELEASE_LTO=thin \
PLIST_FILES= lib/libsignal_jni.so PLIST_FILES= lib/libsignal_jni.so
do-install: do-install:
${INSTALL_LIB} ${CARGO_TARGET_DIR}/release/libsignal_jni.so \ ${INSTALL_LIB} ${CARGO_TARGET_DIR}/${CARGO_BUILD_TARGET}/*/libsignal_jni.so \
${STAGEDIR}${PREFIX}/lib/ ${STAGEDIR}${PREFIX}/lib/
.include <bsd.port.mk> .include <bsd.port.mk>

View File

@ -134,7 +134,7 @@ CARGO_USE_GITHUB= yes
PLIST_FILES= lib/lib${PORTNAME}.so PLIST_FILES= lib/lib${PORTNAME}.so
do-install: do-install:
${INSTALL_LIB} ${WRKDIR}/target/release/lib${PORTNAME}.so \ ${INSTALL_LIB} ${CARGO_TARGET_DIR}/${CARGO_BUILD_TARGET}/*/lib${PORTNAME}.so \
${STAGEDIR}${PREFIX}/lib/ ${STAGEDIR}${PREFIX}/lib/
.include <bsd.port.mk> .include <bsd.port.mk>

View File

@ -148,10 +148,10 @@ do-build:
# install quiche apps and libquiche # install quiche apps and libquiche
do-install: do-install:
${INSTALL_DATA} ${WRKSRC}/include/quiche.h ${STAGEDIR}${PREFIX}/include ${INSTALL_DATA} ${WRKSRC}/include/quiche.h ${STAGEDIR}${PREFIX}/include
${INSTALL_LIB} ${CARGO_TARGET_DIR}/release/libquiche.so ${STAGEDIR}${PREFIX}/lib ${INSTALL_LIB} ${CARGO_TARGET_DIR}/${CARGO_BUILD_TARGET}/*/libquiche.so ${STAGEDIR}${PREFIX}/lib
${INSTALL_LIB} ${CARGO_TARGET_DIR}/release/libquiche.a ${STAGEDIR}${PREFIX}/lib ${INSTALL_LIB} ${CARGO_TARGET_DIR}/${CARGO_BUILD_TARGET}/*/libquiche.a ${STAGEDIR}${PREFIX}/lib
${INSTALL_PROGRAM} ${CARGO_TARGET_DIR}/release/quiche-server ${STAGEDIR}${PREFIX}/bin ${INSTALL_PROGRAM} ${CARGO_TARGET_DIR}/${CARGO_BUILD_TARGET}/*/quiche-server ${STAGEDIR}${PREFIX}/bin
${INSTALL_PROGRAM} ${CARGO_TARGET_DIR}/release/quiche-client ${STAGEDIR}${PREFIX}/bin ${INSTALL_PROGRAM} ${CARGO_TARGET_DIR}/${CARGO_BUILD_TARGET}/*/quiche-client ${STAGEDIR}${PREFIX}/bin
do-install-DOCS-on: do-install-DOCS-on:
@${MKDIR} ${STAGEDIR}${DOCSDIR} @${MKDIR} ${STAGEDIR}${DOCSDIR}

View File

@ -288,7 +288,7 @@ CARGO_CRATES= adler-1.0.2 \
PLIST_FILES= bin/arti PLIST_FILES= bin/arti
do-install: do-install:
${INSTALL_SCRIPT} ${WRKDIR}/target/release/arti ${STAGEDIR}${PREFIX}/bin/arti ${INSTALL_SCRIPT} ${CARGO_TARGET_DIR}/${CARGO_BUILD_TARGET}/*/arti ${STAGEDIR}${PREFIX}/bin/arti
post-install: post-install:
${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/arti ${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/arti

View File

@ -0,0 +1,15 @@
--- build-aux/cargo.sh.orig 2021-09-08 15:33:49 UTC
+++ build-aux/cargo.sh
@@ -12,10 +12,10 @@ if [ "$BUILDTYPE" = "release" ]; then
echo "RELEASE MODE"
cargo build --manifest-path \
"$MESON_SOURCE_ROOT"/Cargo.toml --release &&
- cp "$CARGO_TARGET_DIR"/release/"$APP_BIN" "$OUTPUT"
+ cp "$CARGO_TARGET_DIR"/$CARGO_BUILD_TARGET/release/"$APP_BIN" "$OUTPUT"
else
echo "DEBUG MODE"
cargo build --manifest-path \
"$MESON_SOURCE_ROOT"/Cargo.toml &&
- cp "$CARGO_TARGET_DIR"/debug/"$APP_BIN" "$OUTPUT"
+ cp "$CARGO_TARGET_DIR"/$CARGO_BUILD_TARGET/debug/"$APP_BIN" "$OUTPUT"
fi

View File

@ -309,17 +309,16 @@ do-install:
${STAGEDIR}${PREFIX}/etc/bash_completion.d \ ${STAGEDIR}${PREFIX}/etc/bash_completion.d \
${STAGEDIR}${PREFIX}/share/fish/completions \ ${STAGEDIR}${PREFIX}/share/fish/completions \
${STAGEDIR}${PREFIX}/share/zsh/site-functions ${STAGEDIR}${PREFIX}/share/zsh/site-functions
.for f in ffi ffi_macros openpgp_ffi .for f in ffi openpgp_ffi
${STRIP_CMD} ${CARGO_TARGET_DIR}/release/libsequoia_${f}.so ${INSTALL_LIB} ${CARGO_TARGET_DIR}/${CARGO_BUILD_TARGET}/*/libsequoia_${f}.so ${STAGEDIR}${PREFIX}/lib/libsequoia_${f}.so.${SOVERS}
${INSTALL_LIB} ${CARGO_TARGET_DIR}/release/libsequoia_${f}.so ${STAGEDIR}${PREFIX}/lib/libsequoia_${f}.so.${SOVERS}
${LN} -sf libsequoia_${f}.so.${SOVERS} ${STAGEDIR}${PREFIX}/lib/libsequoia_${f}.so ${LN} -sf libsequoia_${f}.so.${SOVERS} ${STAGEDIR}${PREFIX}/lib/libsequoia_${f}.so
.endfor .endfor
${INSTALL_LIB} ${CARGO_TARGET_DIR}/*/libsequoia_ffi_macros.so ${STAGEDIR}${PREFIX}/lib/libsequoia_ffi_macros.so.${SOVERS}
${LN} -sf libsequoia_ffi_macros.so.${SOVERS} ${STAGEDIR}${PREFIX}/lib/libsequoia_ffi_macros.so
.for f in sq sqop sqv .for f in sq sqop sqv
${STRIP_CMD} ${CARGO_TARGET_DIR}/release/${f} ${INSTALL_PROGRAM} ${CARGO_TARGET_DIR}/${CARGO_BUILD_TARGET}/*/${f} ${STAGEDIR}${PREFIX}/bin
${INSTALL_PROGRAM} ${CARGO_TARGET_DIR}/release/${f} ${STAGEDIR}${PREFIX}/bin
.endfor .endfor
${STRIP_CMD} ${CARGO_TARGET_DIR}/release/sequoia-public-key-store ${INSTALL_PROGRAM} ${CARGO_TARGET_DIR}/${CARGO_BUILD_TARGET}/*/sequoia-public-key-store ${STAGEDIR}${PREFIX}/lib/sequoia/sequoia-public-key-store
${INSTALL_PROGRAM} ${CARGO_TARGET_DIR}/release/sequoia-public-key-store ${STAGEDIR}${PREFIX}/lib/sequoia/sequoia-public-key-store
(cd ${WRKSRC}/ffi/include && ${COPYTREE_SHARE} . ${STAGEDIR}${PREFIX}/include) (cd ${WRKSRC}/ffi/include && ${COPYTREE_SHARE} . ${STAGEDIR}${PREFIX}/include)
(cd ${WRKSRC}/openpgp-ffi/include/sequoia && ${COPYTREE_SHARE} . ${STAGEDIR}${PREFIX}/include/sequoia) (cd ${WRKSRC}/openpgp-ffi/include/sequoia && ${COPYTREE_SHARE} . ${STAGEDIR}${PREFIX}/include/sequoia)

View File

@ -566,7 +566,7 @@ LLVM_VERSION= 12
BINARY_ALIAS= llvm-config=${PREFIX}/bin/llvm-config${LLVM_VERSION} BINARY_ALIAS= llvm-config=${PREFIX}/bin/llvm-config${LLVM_VERSION}
do-install: do-install:
for f in ${WRKDIR}/target/release/${PORTNAME}*; do \ for f in ${CARGO_TARGET_DIR}/${CARGO_BUILD_TARGET}/*/${PORTNAME}*; do \
if [ -f $$f -a -x $$f ]; then \ if [ -f $$f -a -x $$f ]; then \
${INSTALL_PROGRAM} $$f ${STAGEDIR}${PREFIX}/bin; \ ${INSTALL_PROGRAM} $$f ${STAGEDIR}${PREFIX}/bin; \
fi \ fi \

View File

@ -462,6 +462,6 @@ post-patch:
${WRKSRC}/cargo-crates/rusty_v8-${RUSTY_VERS}/buildtools/third_party/libc++/BUILD.gn ${WRKSRC}/cargo-crates/rusty_v8-${RUSTY_VERS}/buildtools/third_party/libc++/BUILD.gn
do-install: do-install:
${INSTALL_PROGRAM} ${WRKDIR}/target/release/deno ${STAGEDIR}${LOCALBASE}/bin ${INSTALL_PROGRAM} ${CARGO_TARGET_DIR}/${CARGO_BUILD_TARGET}/*/deno ${STAGEDIR}${LOCALBASE}/bin
.include <bsd.port.mk> .include <bsd.port.mk>