From 368e5e2e3cc300f3c5e0be2cbc55077ae707c39f Mon Sep 17 00:00:00 2001 From: Michael Zhang Date: Sun, 30 Sep 2018 07:40:02 -0500 Subject: [PATCH] make it crates.io-friendly --- Cargo.lock | 30 +++++++++++++++--------------- Cargo.toml | 6 ++++-- Dockerfile | 8 +++++++- ci/run.sh | 8 ++++---- 4 files changed, 30 insertions(+), 22 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 79066e8..7c4afb4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -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" diff --git a/Cargo.toml b/Cargo.toml index 5c3d443..f5ae029 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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 "] [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" } diff --git a/Dockerfile b/Dockerfile index 0db7bc4..7739df6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 . diff --git a/ci/run.sh b/ci/run.sh index 4a1182a..a2d2075 100755 --- a/ci/run.sh +++ b/ci/run.sh @@ -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"