From 55a4f64b3afed802d101b734abec13b974422657 Mon Sep 17 00:00:00 2001
From: Antoine Gersant <antoine.gersant@lesforges.org>
Date: Tue, 8 Dec 2020 00:14:16 -0800
Subject: [PATCH] Bundle SQLite (#109)

---
 .github/workflows/build.yml    |  3 ---
 .github/workflows/coverage.yml |  2 --
 Cargo.lock                     | 46 ++++++++++++++++------------------
 Cargo.toml                     | 10 ++++----
 docs/SETUP.md                  |  2 +-
 src/artwork.rs                 |  2 +-
 6 files changed, 28 insertions(+), 37 deletions(-)

diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 4925ee1..f200cc8 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -14,9 +14,6 @@ jobs:
         os: [ubuntu-latest, windows-latest, macOS-latest]
 
     steps:
-    - name: Install libsqlite3-dev
-      if: matrix.os == 'ubuntu-latest'
-      run: sudo apt-get update && sudo apt-get install libsqlite3-dev
     - uses: actions/checkout@v1
     - uses: actions-rs/toolchain@v1
       with:
diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml
index 08aadcd..7a4db5d 100644
--- a/.github/workflows/coverage.yml
+++ b/.github/workflows/coverage.yml
@@ -14,8 +14,6 @@ jobs:
     runs-on: ubuntu-latest
 
     steps:
-    - name: Install libsqlite3-dev
-      run: sudo apt-get update && sudo apt-get install libsqlite3-dev
     - name: Checkout Polaris
       uses: actions/checkout@v1
     - uses: actions-rs/toolchain@v1
diff --git a/Cargo.lock b/Cargo.lock
index 68d36f4..1ebdd86 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -87,9 +87,9 @@ dependencies = [
 
 [[package]]
 name = "anyhow"
-version = "1.0.34"
+version = "1.0.35"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bf8dcb5b4bbaa28653b647d8c77bd4ed40183b48882e130c1f1ffb73de069fd7"
+checksum = "2c0df63cb2955042487fad3aefd2c6e3ae7389ac5dc1beb28921de0b69f779d4"
 
 [[package]]
 name = "ape"
@@ -168,6 +168,12 @@ version = "0.12.3"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff"
 
+[[package]]
+name = "base64"
+version = "0.13.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd"
+
 [[package]]
 name = "bitflags"
 version = "1.2.1"
@@ -400,16 +406,6 @@ dependencies = [
  "cfg-if 1.0.0",
 ]
 
-[[package]]
-name = "crossbeam-channel"
-version = "0.4.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b153fe7cbef478c567df0f972e02e6d736db11affe43dfc9c56a9374d1adfb87"
-dependencies = [
- "crossbeam-utils 0.7.2",
- "maybe-uninit",
-]
-
 [[package]]
 name = "crossbeam-channel"
 version = "0.5.0"
@@ -517,9 +513,9 @@ dependencies = [
 
 [[package]]
 name = "crypto-mac"
-version = "0.8.0"
+version = "0.10.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeab"
+checksum = "4857fd85a0c34b3c3297875b747c1e02e06b6a0ea32dd892d8192b9ce0813ea6"
 dependencies = [
  "generic-array 0.14.4",
  "subtle 2.3.0",
@@ -1014,11 +1010,11 @@ dependencies = [
 
 [[package]]
 name = "hmac"
-version = "0.8.1"
+version = "0.10.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "126888268dcc288495a26bf004b38c5fdbb31682f992c84ceb046a1f0fe38840"
+checksum = "c1441c6b1e930e2817404b5046f1f989899143a12bf92de603b69f4e0aee1e15"
 dependencies = [
- "crypto-mac 0.8.0",
+ "crypto-mac 0.10.0",
  "digest 0.9.0",
 ]
 
@@ -1726,13 +1722,13 @@ dependencies = [
 
 [[package]]
 name = "pbkdf2"
-version = "0.4.0"
+version = "0.6.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "216eaa586a190f0a738f2f918511eecfa90f13295abec0e457cdebcceda80cbd"
+checksum = "b3b8c0d71734018084da0c0354193a5edfb81b20d2d57a92c5b154aefc554a4a"
 dependencies = [
- "base64 0.12.3",
- "crypto-mac 0.8.0",
- "hmac 0.8.1",
+ "base64 0.13.0",
+ "crypto-mac 0.10.0",
+ "hmac 0.10.1",
  "rand 0.7.3",
  "rand_core 0.5.1",
  "sha2 0.9.2",
@@ -1797,9 +1793,9 @@ version = "0.12.4"
 dependencies = [
  "anyhow",
  "ape",
- "base64 0.12.3",
+ "base64 0.13.0",
  "cookie 0.14.3",
- "crossbeam-channel 0.4.4",
+ "crossbeam-channel",
  "diesel",
  "diesel_migrations",
  "getopts",
@@ -2091,7 +2087,7 @@ version = "1.9.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "9ab346ac5921dc62ffa9f89b7a773907511cdfa5490c572ae9be1be33e8afa4a"
 dependencies = [
- "crossbeam-channel 0.5.0",
+ "crossbeam-channel",
  "crossbeam-deque 0.8.0",
  "crossbeam-utils 0.8.0",
  "lazy_static",
diff --git a/Cargo.toml b/Cargo.toml
index 40ae541..6b94340 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -10,14 +10,14 @@ ui = ["uuid", "winapi"]
 service-rocket = ["rocket", "rocket_contrib"]
 
 [dependencies]
-anyhow = "1.0.31"
+anyhow = "1.0.35"
 ape = "0.3.0"
-base64 = "0.12.1"
-crossbeam-channel = "0.4"
+base64 = "0.13"
+crossbeam-channel = "0.5"
 diesel_migrations = { version = "1.4", features = ["sqlite"] }
 getopts = "0.2.15"
 id3 = "0.5.1"
-libsqlite3-sys = { version = "0.16", features = ["bundled-windows"] }
+libsqlite3-sys = { version = "*", features = ["bundled", "bundled-windows"] }
 rustfm-scrobble = "^1"
 lewton = "0.10.1"
 log = "0.4.5"
@@ -26,7 +26,7 @@ mp3-duration = "0.1.9"
 mp4ameta = "0.7.1"
 num_cpus = "1.13.0"
 opus_headers = "0.1.2"
-pbkdf2 = "0.4"
+pbkdf2 = "0.6"
 rand = "0.7"
 rayon = "1.3"
 regex = "1.3.9"
diff --git a/docs/SETUP.md b/docs/SETUP.md
index 9ba5d69..458fc48 100644
--- a/docs/SETUP.md
+++ b/docs/SETUP.md
@@ -17,7 +17,7 @@ You can now start Polaris from the start menu or from your desktop, Polaris will
 
 #### Dependencies
 
-1. Install OpenSSL, SQLite and their headers, and some development tools. These are available from your distribution's package manager. For instance on Ubuntu, execute `sudo apt-get install binutils pkg-config libssl-dev libsqlite3-dev`
+1. Install OpenSSL, SQLite and their headers, and some development tools. These are available from your distribution's package manager. For instance on Ubuntu, execute `sudo apt-get install binutils pkg-config libssl-dev`
 2. Install the Rust compiler by executing `curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh` or using an [alternative method](https://www.rust-lang.org/en-US/install.html)
 
 #### Polaris installation
diff --git a/src/artwork.rs b/src/artwork.rs
index bf8d6e2..4b370a7 100644
--- a/src/artwork.rs
+++ b/src/artwork.rs
@@ -73,7 +73,7 @@ fn read_opus(_: &Path) -> Result<DynamicImage> {
 }
 
 #[test]
-fn test_read_artowork() {
+fn test_read_artwork() {
 	let ext_img = image::open("test-data/artwork/Folder.png")
 		.unwrap()
 		.to_rgb8();