Drop unwanted formatting changes from patch
authorVasudev Kamath <vasudev@copyninja.info>
Sun, 29 Jul 2018 12:50:13 +0000 (18:20 +0530)
committerVasudev Kamath <vasudev@copyninja.info>
Sun, 29 Jul 2018 12:50:24 +0000 (18:20 +0530)
debian/patches/2003_force-use-system-libssh2.patch

index 8294f5695cc5145920451c66afe62009eeae35f2..c091fe902044e29a85954ea339ab9e063cac5455 100644 (file)
@@ -6,22 +6,6 @@ Last-Update: 2018-07-28
 
 --- a/vendor/libssh2-sys-0.2.8/build.rs
 +++ b/vendor/libssh2-sys-0.2.8/build.rs
-@@ -1,5 +1,5 @@
--extern crate pkg_config;
- extern crate cmake;
-+extern crate pkg_config;
- #[cfg(target_env = "msvc")]
- extern crate vcpkg;
-@@ -7,7 +7,7 @@
- use std::env;
- use std::fs::File;
- use std::io::prelude::*;
--use std::path::{PathBuf, Path};
-+use std::path::{Path, PathBuf};
- use std::process::Command;
- fn main() {
 @@ -21,19 +21,20 @@
      // The system copy of libssh2 is not used by default because it
      // can lead to having two copies of libssl loaded at once.
@@ -53,118 +37,3 @@ Last-Update: 2018-07-28
  
      let mut cfg = cmake::Config::new("libssh2");
  
-@@ -50,7 +51,9 @@
-     // link to it, and for MinGW targets we just pass a dummy include dir to
-     // ensure it's detected (apparently it isn't otherwise?)
-     match env::var_os("DEP_Z_INCLUDE") {
--        Some(path) => { cfg.define("ZLIB_INCLUDE_DIR", path); }
-+        Some(path) => {
-+            cfg.define("ZLIB_INCLUDE_DIR", path);
-+        }
-         None if target.contains("windows-gnu") => {
-             cfg.define("ZLIB_INCLUDE_DIR", "/");
-         }
-@@ -68,18 +71,20 @@
-     }
-     // Homebrew deprecated OpenSSL and deliberately hides it from cmake, requiring such opt-in
--    if target.contains("darwin") && Path::new("/usr/local/opt/openssl/include/openssl/ssl.h").exists() {
-+    if target.contains("darwin")
-+        && Path::new("/usr/local/opt/openssl/include/openssl/ssl.h").exists()
-+    {
-         cfg.define("OPENSSL_ROOT_DIR", "/usr/local/opt/openssl/");
-     }
-     let dst = cfg.define("BUILD_SHARED_LIBS", "OFF")
--                 .define("ENABLE_ZLIB_COMPRESSION", "ON")
--                 .define("CMAKE_INSTALL_LIBDIR", "lib")
--                 .define("BUILD_EXAMPLES", "OFF")
--                 .define("BUILD_TESTING", "OFF")
--                 .register_dep("OPENSSL")
--                 .register_dep("Z")
--                 .build();
-+        .define("ENABLE_ZLIB_COMPRESSION", "ON")
-+        .define("CMAKE_INSTALL_LIBDIR", "lib")
-+        .define("BUILD_EXAMPLES", "OFF")
-+        .define("BUILD_TESTING", "OFF")
-+        .register_dep("OPENSSL")
-+        .register_dep("Z")
-+        .build();
-     // Unfortunately the pkg-config file generated for libssh2 indicates
-     // that it depends on zlib, but most systems don't actually have a
-@@ -115,7 +120,7 @@
- fn register_dep(dep: &str) {
-     if let Some(s) = env::var_os(&format!("DEP_{}_ROOT", dep)) {
-         prepend("PKG_CONFIG_PATH", Path::new(&s).join("lib/pkgconfig"));
--        return
-+        return;
-     }
-     if let Some(s) = env::var_os(&format!("DEP_{}_INCLUDE", dep)) {
-         let root = Path::new(&s).parent().unwrap();
-@@ -123,7 +128,7 @@
-         let path = root.join("lib/pkgconfig");
-         if path.exists() {
-             prepend("PKG_CONFIG_PATH", path);
--            return
-+            return;
-         }
-     }
- }
-@@ -136,28 +141,37 @@
- }
- #[cfg(not(target_env = "msvc"))]
--fn try_vcpkg() -> bool { false }
-+fn try_vcpkg() -> bool {
-+    false
-+}
- #[cfg(target_env = "msvc")]
- fn try_vcpkg() -> bool {
-     vcpkg::Config::new()
-         .emit_includes(true)
--        .probe("libssh2").map(|_| {
--
--        // found libssh2 which depends on openssl and zlib
--        vcpkg::Config::new()
--            .lib_name("libeay32")
--            .lib_name("ssleay32")
--            .probe("openssl").expect("configured libssh2 from vcpkg but could not \
--                                      find openssl libraries that it depends on");
--
--        vcpkg::Config::new()
--            .lib_names("zlib", "zlib1")
--            .probe("zlib").expect("configured libssh2 from vcpkg but could not \
--                                   find the zlib library that it depends on");
--
--        println!("cargo:rustc-link-lib=crypt32");
--        println!("cargo:rustc-link-lib=gdi32");
--        println!("cargo:rustc-link-lib=user32");
--    }).is_ok()
-+        .probe("libssh2")
-+        .map(|_| {
-+            // found libssh2 which depends on openssl and zlib
-+            vcpkg::Config::new()
-+                .lib_name("libeay32")
-+                .lib_name("ssleay32")
-+                .probe("openssl")
-+                .expect(
-+                    "configured libssh2 from vcpkg but could not \
-+                     find openssl libraries that it depends on",
-+                );
-+
-+            vcpkg::Config::new()
-+                .lib_names("zlib", "zlib1")
-+                .probe("zlib")
-+                .expect(
-+                    "configured libssh2 from vcpkg but could not \
-+                     find the zlib library that it depends on",
-+                );
-+
-+            println!("cargo:rustc-link-lib=crypt32");
-+            println!("cargo:rustc-link-lib=gdi32");
-+            println!("cargo:rustc-link-lib=user32");
-+        })
-+        .is_ok()
- }