-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rusty-keys is now well supported on windows
- Loading branch information
1 parent
f7afe19
commit 4554e19
Showing
4 changed files
with
101 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
target | ||
.idea/ | ||
*.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/bin/sh | ||
set -euxo pipefail | ||
|
||
target="${1-x86_64-pc-windows-gnu}" | ||
|
||
cargo build --target "$target" --release | ||
|
||
cp keymap.toml target/"$target"/release/ | ||
cd target/"$target"/release/ | ||
strip rusty-keys.exe | ||
zip -9 rusty-keys-"$target".zip rusty-keys.exe keymap.toml | ||
mv rusty-keys-"$target".zip ../../.. | ||
|
||
exit 0 | ||
|
||
# on arch linux, run these to enable cross compiling to win64: | ||
|
||
pacman -S mingw-w64-gcc | ||
|
||
# you can change these, if you want | ||
CHANNEL=stable | ||
ARCH=x86_64 | ||
|
||
rustup install $CHANNEL-$ARCH-pc-windows-gnu && rustup target add $ARCH-pc-windows-gnu | ||
|
||
for lib in crt2.o dllcrt2.o libmsvcrt.a; do cp -v /usr/x86_64-w64-mingw32/lib/$lib $HOME/.rustup/toolchains/$CHANNEL-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-pc-windows-gnu/lib/; done | ||
|
||
cat >> ~/.cargo/config <<EOF | ||
[target.$ARCH-pc-windows-gnu] | ||
linker = "/usr/bin/$ARCH-w64-mingw32-gcc" | ||
ar = "/usr/$ARCH-w64-mingw32/bin/ar" | ||
EOF |