diff --git a/Cargo.lock b/Cargo.lock index d42ef69..171371e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -659,6 +659,15 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" +[[package]] +name = "openssl-src" +version = "111.22.0+1.1.1q" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f31f0d509d1c1ae9cada2f9539ff8f37933831fd5098879e482aa687d659853" +dependencies = [ + "cc", +] + [[package]] name = "openssl-sys" version = "0.9.75" @@ -668,6 +677,7 @@ dependencies = [ "autocfg", "cc", "libc", + "openssl-src", "pkg-config", "vcpkg", ] @@ -730,6 +740,7 @@ dependencies = [ "lazy_static", "lettre", "log", + "openssl", "regex", "reqwest", "serde", diff --git a/Cargo.toml b/Cargo.toml index 852a0a2..3e2ceb7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,3 +17,5 @@ serde_json = "1.0.85" slice-deque = "0.3.0" lazy_static = "1.4.0" regex = "1.6.0" +# Cross removed openssl from their docker: https://github.com/cross-rs/cross/issues/510. This is a workaround. +openssl = { version = "0.10", features = ["vendored"] } diff --git a/bin/reddit_notifier b/bin/reddit_notifier new file mode 100644 index 0000000..53331ed Binary files /dev/null and b/bin/reddit_notifier differ diff --git a/bin/reddit_notifier.exe b/bin/reddit_notifier.exe new file mode 100644 index 0000000..67ac942 Binary files /dev/null and b/bin/reddit_notifier.exe differ diff --git a/devtool b/devtool new file mode 100644 index 0000000..261361b --- /dev/null +++ b/devtool @@ -0,0 +1,30 @@ +#!/usr/bin/env bash + +# Note: If developing on windows, you might need to run this command to get rid of /r in this script file: +# sed -i 's/\r$//' devtool +# Or make sure your git has autocrlf off: https://stackoverflow.com/questions/29045140/env-bash-r-no-such-file-or-directory + +set -euo pipefail +set -x + +install_cross() { + cargo install cross +} + +build() { + install_cross + + # TODO: Once output-dir is in stable release, use that instead of copying over binaries/executables + # Linux + cross build --release --target x86_64-unknown-linux-gnu + mv target/x86_64-unknown-linux-gnu/release/reddit_notifier bin/ + + # Windows + rustup target add x86_64-pc-windows-msvc # Installs the target + cross build --release --target x86_64-pc-windows-gnu + mv target/x86_64-pc-windows-gnu/release/reddit_notifier.exe bin/ +} + +# Comment set +x out to show commands run +set +x +$@ \ No newline at end of file