make it crates.io-friendly

This commit is contained in:
Michael Zhang 2018-09-30 07:40:02 -05:00
parent 7ae9b26728
commit 368e5e2e3c
No known key found for this signature in database
GPG key ID: A1B65B603268116B
4 changed files with 30 additions and 22 deletions

30
Cargo.lock generated
View file

@ -364,6 +364,21 @@ dependencies = [
"version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "leanshot"
version = "0.3.0"
dependencies = [
"failure 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"gl 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)",
"glutin 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)",
"imlib2 0.1.0",
"nanovg 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
"png 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)",
"structopt 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)",
"time 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)",
"xlib 0.1.0",
]
[[package]]
name = "libc"
version = "0.2.43"
@ -668,21 +683,6 @@ name = "scopeguard"
version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "screenshot"
version = "0.3.0"
dependencies = [
"failure 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"gl 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)",
"glutin 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)",
"imlib2 0.1.0",
"nanovg 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
"png 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)",
"structopt 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)",
"time 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)",
"xlib 0.1.0",
]
[[package]]
name = "semver"
version = "0.9.0"

View file

@ -2,6 +2,8 @@
name = "leanshot"
description = "Screenshot capture for Linux."
version = "0.3.0"
repository = "https://github.com/iptq/leanshot"
license-file = "LICENSE"
authors = ["Michael Zhang <failed.down@gmail.com>"]
[workspace]
@ -11,9 +13,9 @@ members = [".", "imlib2", "imlib2/imlib2-sys", "xlib"]
failure = "0.1"
gl = "0.10"
glutin = "0.18"
imlib2 = { path = "imlib2" }
imlib2 = { version = "0.1", path = "imlib2" }
nanovg = { version = "1.0.2", features = ["gl3"] }
png = "0.12"
structopt = "0.2"
time = "0.1"
xlib = { path = "xlib" }
xlib = { version = "0.1", path = "xlib" }

View file

@ -1,6 +1,12 @@
FROM ekidd/rust-musl-builder
RUN sudo apt-get update -y && sudo apt-get install -y libmesa-dev mesa-common-dev libx11-dev libimlib2-dev
RUN sudo apt-get update -y && sudo apt-get install -y\
libgl1-mesa-dri \
libglu1-mesa-dev \
libgl1-mesa-dev \
libglu1-mesa-dev \
libx11-dev \
libimlib2-dev
COPY . ./
RUN sudo chown -R rust:rust .

View file

@ -23,16 +23,16 @@ VOLUMES="-v $2-target:/home/rust/src/target -v $2-registry:/home/rust/.cargo/reg
case $1 in
check)
echo "Building static binaries using rust-musl-builder"
docker build --build-arg TOOLCHAIN="nightly" -f Dockerfile -t build-"$2"-image .
echo "Checking using rust-musl-builder"
docker build -f Dockerfile -t build-"$2"-image .
docker rm -f build-"$2" || true
docker run -it --name build-"$2" $VOLUMES build-"$2"-image bash -c 'cargo build --all'
docker run -it --name build-"$2" $VOLUMES build-"$2"-image bash -c 'cargo check --all'
docker rm build-"$2"
docker rmi build-"$2"-image
;;
build)
echo "Building static binaries using rust-musl-builder"
docker build --build-arg TOOLCHAIN="nightly" -t build-"$2"-image .
docker build -t build-"$2"-image .
docker rm -f build-"$2" || true
docker run -it --name build-"$2" $VOLUMES build-"$2"-image bash -c 'cargo build --release --all'
docker cp build-"$2":/home/rust/src/target/x86_64-unknown-linux-musl/release/"$2" "$2"