mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-05-24 02:02:36 -04:00
Create a transcoder crate
This commit is contained in:
parent
a7d8863998
commit
bc6fdec360
26
shell.nix
26
shell.nix
@ -1,4 +1,5 @@
|
||||
{pkgs ? import <nixpkgs> {}}: let
|
||||
pwd = ./.;
|
||||
venvDir = "./scanner/.venv";
|
||||
pythonPkgs = ./scanner/requirements.txt;
|
||||
in
|
||||
@ -13,18 +14,23 @@ in
|
||||
])
|
||||
python3
|
||||
python3Packages.pip
|
||||
cargo
|
||||
rustfmt
|
||||
rustc
|
||||
];
|
||||
|
||||
RUST_SRC_PATH = "${pkgs.rust.packages.stable.rustPlatform.rustLibSrc}";
|
||||
|
||||
shellHook = ''
|
||||
# Install python modules
|
||||
SOURCE_DATE_EPOCH=$(date +%s)
|
||||
if [ ! -d "${venvDir}" ]; then
|
||||
${pkgs.python3}/bin/python3 -m venv ${venvDir}
|
||||
source ${venvDir}/bin/activate
|
||||
export PIP_DISABLE_PIP_VERSION_CHECK=1
|
||||
pip install -r ${pythonPkgs} >&2
|
||||
else
|
||||
source ${venvDir}/bin/activate
|
||||
fi
|
||||
# Install python modules
|
||||
SOURCE_DATE_EPOCH=$(date +%s)
|
||||
if [ ! -d "${venvDir}" ]; then
|
||||
${pkgs.python3}/bin/python3 -m venv ${pwd}/${venvDir}
|
||||
source ${venvDir}/bin/activate
|
||||
export PIP_DISABLE_PIP_VERSION_CHECK=1
|
||||
pip install -r ${pythonPkgs} >&2
|
||||
else
|
||||
source ${venvDir}/bin/activate
|
||||
fi
|
||||
'';
|
||||
}
|
||||
|
1
transcoder/.gitignore
vendored
Normal file
1
transcoder/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
/target
|
1435
transcoder/Cargo.lock
generated
Normal file
1435
transcoder/Cargo.lock
generated
Normal file
File diff suppressed because it is too large
Load Diff
7
transcoder/Cargo.toml
Normal file
7
transcoder/Cargo.toml
Normal file
@ -0,0 +1,7 @@
|
||||
[package]
|
||||
name = "transcoder"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
rocket = "=0.5.0-rc.3"
|
1
transcoder/rustfmt.toml
Normal file
1
transcoder/rustfmt.toml
Normal file
@ -0,0 +1 @@
|
||||
hard_tabs = true
|
12
transcoder/src/main.rs
Normal file
12
transcoder/src/main.rs
Normal file
@ -0,0 +1,12 @@
|
||||
#[macro_use]
|
||||
extern crate rocket;
|
||||
|
||||
#[get("/")]
|
||||
fn index() -> &'static str {
|
||||
"Hello, world!"
|
||||
}
|
||||
|
||||
#[launch]
|
||||
fn rocket() -> _ {
|
||||
rocket::build().mount("/", routes![index])
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user