Skip to content
Open
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
46 changes: 42 additions & 4 deletions recipe/install-gnu.bat
Original file line number Diff line number Diff line change
@@ -1,4 +1,42 @@
pushd gnu
FOR /F "delims=" %%i in ('cygpath.exe -u "%PREFIX%"') DO set "pfx=%%i"
bash install.sh --prefix=%pfx%/Library
if errorlevel 1 exit 1
@echo off
setlocal enabledelayedexpansion

set "DESTDIR=%LIBRARY_PREFIX%"
set "SRCDIR=%SRC_DIR%\gnu"

echo Installing Rust GNU from %SRCDIR% to %DESTDIR%

REM Read components and install each one
for /f "usebackq tokens=*" %%c in ("%SRCDIR%\components") do (
echo Installing component: %%c
set "COMPDIR=%SRCDIR%\%%c"

REM Copy bin directory if exists
if exist "!COMPDIR!\bin" (
xcopy /E /I /Y "!COMPDIR!\bin" "%DESTDIR%\bin\"
)

REM Copy lib directory if exists
if exist "!COMPDIR!\lib" (
xcopy /E /I /Y "!COMPDIR!\lib" "%DESTDIR%\lib\"
)

REM Copy share directory if exists
if exist "!COMPDIR!\share" (
xcopy /E /I /Y "!COMPDIR!\share" "%DESTDIR%\share\"
)

REM Copy etc directory if exists
if exist "!COMPDIR!\etc" (
xcopy /E /I /Y "!COMPDIR!\etc" "%DESTDIR%\etc\"
)
)

REM Remove documentation to reduce package size (docs available online)
if exist "%DESTDIR%\share\doc" (
echo Removing documentation...
rmdir /S /Q "%DESTDIR%\share\doc"
)

echo Rust GNU installation complete.
exit /b 0
46 changes: 42 additions & 4 deletions recipe/install-msvc.bat
Original file line number Diff line number Diff line change
@@ -1,4 +1,42 @@
pushd msvc
FOR /F "delims=" %%i in ('cygpath.exe -u "%PREFIX%"') DO set "pfx=%%i"
bash install.sh --prefix=%pfx%/Library
if errorlevel 1 exit 1
@echo off
setlocal enabledelayedexpansion

set "DESTDIR=%LIBRARY_PREFIX%"
set "SRCDIR=%SRC_DIR%\msvc"

echo Installing Rust from %SRCDIR% to %DESTDIR%

REM Read components and install each one
for /f "usebackq tokens=*" %%c in ("%SRCDIR%\components") do (
echo Installing component: %%c
set "COMPDIR=%SRCDIR%\%%c"

REM Copy bin directory if exists
if exist "!COMPDIR!\bin" (
xcopy /E /I /Y "!COMPDIR!\bin" "%DESTDIR%\bin\"
)

REM Copy lib directory if exists
if exist "!COMPDIR!\lib" (
xcopy /E /I /Y "!COMPDIR!\lib" "%DESTDIR%\lib\"
)

REM Copy share directory if exists
if exist "!COMPDIR!\share" (
xcopy /E /I /Y "!COMPDIR!\share" "%DESTDIR%\share\"
)

REM Copy etc directory if exists
if exist "!COMPDIR!\etc" (
xcopy /E /I /Y "!COMPDIR!\etc" "%DESTDIR%\etc\"
)
)

REM Remove documentation to reduce package size (docs available online)
if exist "%DESTDIR%\share\doc" (
echo Removing documentation...
rmdir /S /Q "%DESTDIR%\share\doc"
)

echo Rust installation complete.
exit /b 0
33 changes: 24 additions & 9 deletions recipe/install-rust-std-extra.bat
Original file line number Diff line number Diff line change
@@ -1,13 +1,28 @@
@echo off
setlocal enabledelayedexpansion

cd rust-std-%rust_std_extra%
set "DESTDIR=%LIBRARY_PREFIX%"
set "SRCDIR=%SRC_DIR%\rust-std-%rust_std_extra%"

FOR /F "delims=" %%i in ('cygpath.exe -u "%PREFIX%"') DO set "pfx=%%i"
bash install.sh --prefix=%pfx%/Library
if errorlevel 1 exit 1
echo Installing rust-std-%rust_std_extra% from %SRCDIR% to %DESTDIR%

del /f /q %PREFIX%\Library\lib\rustlib\manifest-rust-std-%rust_std_extra%
del /f /q %PREFIX%\Library\lib\rustlib\rust-installer-version
del /f /q %PREFIX%\Library\lib\rustlib\install.log
del /f /q %PREFIX%\Library\lib\rustlib\components
del /f /q %PREFIX%\Library\lib\rustlib\uninstall.sh
REM Read components and install each one
for /f "usebackq tokens=*" %%c in ("%SRCDIR%\components") do (
echo Installing component: %%c
set "COMPDIR=%SRCDIR%\%%c"

REM Copy lib directory if exists
if exist "!COMPDIR!\lib" (
xcopy /E /I /Y "!COMPDIR!\lib" "%DESTDIR%\lib\"
)
)

REM Clean up installer metadata files
del /f /q "%DESTDIR%\lib\rustlib\manifest-rust-std-%rust_std_extra%" 2>nul
del /f /q "%DESTDIR%\lib\rustlib\rust-installer-version" 2>nul
del /f /q "%DESTDIR%\lib\rustlib\install.log" 2>nul
del /f /q "%DESTDIR%\lib\rustlib\components" 2>nul
del /f /q "%DESTDIR%\lib\rustlib\uninstall.sh" 2>nul

echo rust-std-%rust_std_extra% installation complete.
exit /b 0
44 changes: 20 additions & 24 deletions recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,15 @@ source:
sha256: bbe822f0aae2c1d31fa950a78446d4749e07ed67e974f87bf0c69146df2a9d9c # [aarch64]
- url: https://static.rust-lang.org/dist/rust-{{ version }}-aarch64-apple-darwin.tar.gz # [osx and arm64]
sha256: 6bafa3b5367019c576751741295e06717f8f28c9d0e6631dcb9496cd142a386a # [osx and arm64]
- url: https://static.rust-lang.org/dist/rust-{{ version }}-x86_64-pc-windows-msvc.tar.gz # [win]
sha256: 08656839d486c823ea8ff59fc61aa7a7eae6600fa38fa7d9b426544cb7761eaf # [win]
folder: msvc # [win]
- url: https://static.rust-lang.org/dist/rust-{{ version }}-x86_64-pc-windows-gnu.tar.gz # [win]
sha256: 38a90e59750595bfceaa62f65d791032554bf5d1bc3ebe4fd83fe2140967d9f9 # [win]
folder: gnu # [win]
- url: https://static.rust-lang.org/dist/rust-{{ version }}-x86_64-pc-windows-msvc.tar.gz # [win and x86_64]
sha256: 08656839d486c823ea8ff59fc61aa7a7eae6600fa38fa7d9b426544cb7761eaf # [win and x86_64]
folder: msvc # [win and x86_64]
- url: https://static.rust-lang.org/dist/rust-{{ version }}-aarch64-pc-windows-msvc.tar.gz # [win and arm64]
sha256: a6a7461370fd8632f3f94d558375f3ec8b45ac3c65f54f7e96367e52e17c956f # [win and arm64]
folder: msvc # [win and arm64]
- url: https://static.rust-lang.org/dist/rust-{{ version }}-x86_64-pc-windows-gnu.tar.gz # [win and x86_64]
sha256: 38a90e59750595bfceaa62f65d791032554bf5d1bc3ebe4fd83fe2140967d9f9 # [win and x86_64]
folder: gnu # [win and x86_64]
#### end of main rust toolchain sources
#### start of rust-std-extra toolchain sources
- url: https://static.rust-lang.org/dist/rust-std-{{ version }}-wasm32-wasip1.tar.gz
Expand Down Expand Up @@ -82,7 +85,6 @@ outputs:
build:
- {{ stdlib('c') }} # [osx]
- {{ compiler('c') }} # [osx]
- posix # [win]
test:
requires:
- {{ stdlib('c') }}
Expand All @@ -98,21 +100,18 @@ outputs:
- rustdoc --help
- time bash ./forge_test.sh # [not win]

- name: rust-gnu # [win]
script: install-gnu.bat # [win]
build: # [win]
- name: rust-gnu # [win64]
script: install-gnu.bat # [win64]
build: # [win64]
# the distributed binaries are already relocatable
binary_relocation: False # [win]
requirements: # [win]
build: # [win]
- posix # [win]
test: # [win]
commands: # [win]
- rustc --version # [win]
- cargo --help # [win]
- rustc --help # [win]
- rustdoc --help # [win]
- if exist %LIBRARY_PREFIX%\share\doc\rust\html\sysroot exit 1 # [win]
binary_relocation: False # [win64]
test: # [win64]
commands: # [win64]
- rustc --version # [win64]
- cargo --help # [win64]
- rustc --help # [win64]
- rustdoc --help # [win64]
- if exist %LIBRARY_PREFIX%\share\doc\rust\html\sysroot exit 1 # [win64]

- name: rust-std-{{ rust_std_extra }}
build:
Expand All @@ -131,9 +130,6 @@ outputs:
- {{ pin_subpackage("rust", exact=True) }}
script: install-rust-std-extra.sh # [unix]
script: install-rust-std-extra.bat # [win]
requirements:
build:
- posix # [win]
test:
commands:
- echo ON # [win]
Expand Down