Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions recipe/activate.bat
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ set CARGO_HOME=%CONDA_PREFIX%\.cargo
set CARGO_CONFIG=%CARGO_HOME%\config
set RUSTUP_HOME=%CARGO_HOME%\rustup
set PATH=%CARGO_HOME%\bin:%PATH%
set "CARGO=cargo-auditable-wrapper.bat"

if not exist "%CARGO_HOME%" mkdir "%CARGO_HOME%"

Expand Down
1 change: 1 addition & 0 deletions recipe/activate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

export CARGO_HOME=${CONDA_PREFIX}/.cargo
export CARGO_CONFIG=${CARGO_HOME}/config
export CARGO="cargo-auditable-wrapper"
export RUSTUP_HOME=${CARGO_HOME}/rustup

[[ -d ${CARGO_HOME} ]] || mkdir -p ${CARGO_HOME}
Expand Down
2 changes: 0 additions & 2 deletions recipe/bld.bat

This file was deleted.

13 changes: 13 additions & 0 deletions recipe/build-activation.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
@echo on

mkdir %PREFIX%\etc\conda\activate.d
if %ERRORLEVEL% neq 0 exit 1

copy %RECIPE_DIR%\activate.bat %PREFIX%\etc\conda\activate.d\activate-%PKG_NAME%.bat
if %ERRORLEVEL% neq 0 exit 1

md %LIBRARY_PREFIX%\bin
if %ERRORLEVEL% neq 0 exit 1

copy %RECIPE_DIR%\cargo-auditable-wrapper.bat %LIBRARY_PREFIX%\bin\cargo-auditable-wrapper.bat
if %ERRORLEVEL% neq 0 exit 1
4 changes: 3 additions & 1 deletion recipe/build.sh → recipe/build-activation.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

set -x
set -exuo pipefail

mkdir -p ${PREFIX}/etc/conda/{de,}activate.d
cp "${RECIPE_DIR}"/activate.sh activate.sh
Expand All @@ -13,3 +13,5 @@ sed -i.bak "s/@cross_target_platform@/$cross_target_platform/g" activate.sh
sed -i.bak "s/@CONDA_RUST_HOST_LOWER@/$(echo $rust_arch_env_build | tr '[:upper:]' '[:lower:]')/g" activate.sh
sed -i.bak "s/@CONDA_RUST_TARGET_LOWER@/$(echo $rust_arch_env | tr '[:upper:]' '[:lower:]')/g" activate.sh
cp activate.sh ${PREFIX}/etc/conda/activate.d/activate_${PKG_NAME}.sh
mkdir -p ${PREFIX}/bin
cp ${RECIPE_DIR}/cargo-auditable-wrapper.sh $PREFIX/bin/cargo-auditable-wrapper
1 change: 1 addition & 0 deletions recipe/cargo-auditable-wrapper.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
cargo auditable %*
2 changes: 2 additions & 0 deletions recipe/cargo-auditable-wrapper.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
exec cargo auditable $*
12 changes: 7 additions & 5 deletions recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ package:
version: {{ version }}

build:
number: 1
number: 2

outputs:
- name: rust_{{ cross_target_platform }}
script: build.sh # [unix]
script: bld.bat # [win]
script: build-activation.sh # [unix]
script: build-activation.bat # [win]
build:
skip: True # [win and vc<14]
run_exports:
Expand Down Expand Up @@ -48,6 +48,7 @@ outputs:
- vs_{{ cross_target_platform }} >=2019 # [win]
{% endif %}
- ld64_{{ target_platform }} # [osx]
- cargo-auditable
test:
requires:
- file # [unix]
Expand All @@ -60,7 +61,8 @@ outputs:
- rustc --help
- rustdoc --help
- cargo --help
- cargo install --force xsv
- "%CARGO% install --force xsv" # [win]
- $CARGO install --force xsv # [unix]
- file $PREFIX/.cargo/bin/xsv # [unix and cross_target_platform != "win-64" and cross_target_platform != "win-arm64"]
- file $PREFIX/.cargo/bin/xsv | grep "Mach-O 64-bit arm64 executable" # [unix and cross_target_platform == "osx-arm64"]
- file $PREFIX/.cargo/bin/xsv | grep "Mach-O 64-bit x86_64 executable" # [unix and cross_target_platform == "osx-64"]
Expand All @@ -71,7 +73,7 @@ outputs:
- file $PREFIX/.cargo/bin/xsv.exe | grep "PE32+ executable for MS Windows" | grep x86-64 # [unix and cross_target_platform == "win-64"]

- name: rust-gnu_{{ target_platform }}
script: bld.bat
script: build-activation.bat
build:
skip: True # [not win]
skip: True
Expand Down