Browse Source

security/clamav: fix build on big-endian architectures

Backport ed8337afc7
to fix build.

Approved by:	Tier 2 blanket
2022Q3
Piotr Kubaj 2 weeks ago
parent
commit
b9e905d147
  1. 6
      security/clamav/files/patch-libclamav__rust_.cargo_vendor_image_.cargo-checksum.json
  2. 11
      security/clamav/files/patch-libclamav__rust_.cargo_vendor_image_Cargo.toml
  3. 16
      security/clamav/files/patch-libclamav__rust_.cargo_vendor_image_Cargo.toml.public-private-dependencies
  4. 11
      security/clamav/files/patch-libclamav__rust_.cargo_vendor_image_src_codecs_openexr.rs
  5. 22
      security/clamav/files/patch-libclamav__rust_.cargo_vendor_image_src_image.rs
  6. 22
      security/clamav/files/patch-libclamav__rust_.cargo_vendor_image_src_io_free__functions.rs
  7. 12
      security/clamav/files/patch-libclamav__rust_.cargo_vendor_image_src_lib.rs

6
security/clamav/files/patch-libclamav__rust_.cargo_vendor_image_.cargo-checksum.json

File diff suppressed because one or more lines are too long

11
security/clamav/files/patch-libclamav__rust_.cargo_vendor_image_Cargo.toml

@ -0,0 +1,11 @@
--- libclamav_rust/.cargo/vendor/image/Cargo.toml.orig 2022-06-23 23:56:41 UTC
+++ libclamav_rust/.cargo/vendor/image/Cargo.toml
@@ -60,7 +60,7 @@ optional = true
version = "0.4.0"
optional = true
-[dependencies.exr]
+[target.'cfg(target_endian = "little")'.dependencies.exr]
version = "1.4.2"
optional = true

16
security/clamav/files/patch-libclamav__rust_.cargo_vendor_image_Cargo.toml.public-private-dependencies

@ -0,0 +1,16 @@
--- libclamav_rust/.cargo/vendor/image/Cargo.toml.public-private-dependencies.orig 2022-06-23 21:35:47 UTC
+++ libclamav_rust/.cargo/vendor/image/Cargo.toml.public-private-dependencies
@@ -44,8 +44,12 @@ rgb = { version = "0.8.25", optional = true }
mp4parse = { version = "0.12.0", optional = true }
dav1d = { version = "0.6.0", optional = true }
dcv-color-primitives = { version = "0.4.0", optional = true }
-exr = { version = "1.4.1", optional = true }
color_quant = { version = "1.1", public = true }
+
+# These appear as an empty dependency on other platforms.
+# See: <https://github.com/rust-lang/cargo/issues/1197#issuecomment-901794879>
+[target.'cfg(target_endian = "little")'.dependencies]
+exr = { version = "1.4.1", optional = true }
[dev-dependencies]
crc32fast = "1.2.0"

11
security/clamav/files/patch-libclamav__rust_.cargo_vendor_image_src_codecs_openexr.rs

@ -0,0 +1,11 @@
--- libclamav_rust/.cargo/vendor/image/src/codecs/openexr.rs.orig 2022-05-02 16:48:17 UTC
+++ libclamav_rust/.cargo/vendor/image/src/codecs/openexr.rs
@@ -20,8 +20,6 @@
//! - meta data is lost
//! - dwaa/dwab compressed images not supported yet by the exr library
//! - (chroma) subsampling not supported yet by the exr library
-
-extern crate exr;
use exr::prelude::*;
use crate::error::{DecodingError, EncodingError, ImageFormatHint};

22
security/clamav/files/patch-libclamav__rust_.cargo_vendor_image_src_image.rs

@ -0,0 +1,22 @@
--- libclamav_rust/.cargo/vendor/image/src/image.rs.orig 2022-05-02 16:48:17 UTC
+++ libclamav_rust/.cargo/vendor/image/src/image.rs
@@ -290,7 +290,8 @@ pub enum ImageOutputFormat {
/// An Image in TGA Format
Tga,
- #[cfg(feature = "openexr")]
+ #[cfg(feature = "exr")]
+ #[cfg(target_endian = "little")]
/// An Image in OpenEXR Format
OpenExr,
@@ -327,7 +328,8 @@ impl From<ImageFormat> for ImageOutputFormat {
ImageFormat::Farbfeld => ImageOutputFormat::Farbfeld,
#[cfg(feature = "tga")]
ImageFormat::Tga => ImageOutputFormat::Tga,
- #[cfg(feature = "openexr")]
+ #[cfg(feature = "exr")]
+ #[cfg(target_endian = "little")]
ImageFormat::OpenExr => ImageOutputFormat::OpenExr,
#[cfg(feature = "tiff")]
ImageFormat::Tiff => ImageOutputFormat::Tiff,

22
security/clamav/files/patch-libclamav__rust_.cargo_vendor_image_src_io_free__functions.rs

@ -0,0 +1,22 @@
--- libclamav_rust/.cargo/vendor/image/src/io/free_functions.rs.orig 2022-05-02 16:48:17 UTC
+++ libclamav_rust/.cargo/vendor/image/src/io/free_functions.rs
@@ -72,7 +72,8 @@ pub(crate) fn load_decoder<R: BufRead + Seek, V: Decod
image::ImageFormat::Ico => visitor.visit_decoder(ico::IcoDecoder::new(r)?),
#[cfg(feature = "hdr")]
image::ImageFormat::Hdr => visitor.visit_decoder(hdr::HdrAdapter::new(BufReader::new(r))?),
- #[cfg(feature = "openexr")]
+ #[cfg(feature = "exr")]
+ #[cfg(target_endian = "little")]
image::ImageFormat::OpenExr => visitor.visit_decoder(openexr::OpenExrDecoder::new(r)?),
#[cfg(feature = "pnm")]
image::ImageFormat::Pnm => visitor.visit_decoder(pnm::PnmDecoder::new(r)?),
@@ -230,7 +231,8 @@ pub(crate) fn write_buffer_impl<W: std::io::Write + Se
ImageOutputFormat::Tga => {
tga::TgaEncoder::new(buffered_write).write_image(buf, width, height, color)
}
- #[cfg(feature = "openexr")]
+ #[cfg(feature = "exr")]
+ #[cfg(target_endian = "little")]
ImageOutputFormat::OpenExr => {
openexr::OpenExrEncoder::new(buffered_write).write_image(buf, width, height, color)
}

12
security/clamav/files/patch-libclamav__rust_.cargo_vendor_image_src_lib.rs

@ -0,0 +1,12 @@
--- libclamav_rust/.cargo/vendor/image/src/lib.rs.orig 2022-05-02 16:48:17 UTC
+++ libclamav_rust/.cargo/vendor/image/src/lib.rs
@@ -234,7 +234,8 @@ pub mod codecs {
pub mod ico;
#[cfg(feature = "jpeg")]
pub mod jpeg;
- #[cfg(feature = "openexr")]
+ #[cfg(feature = "exr")]
+ #[cfg(target_endian = "little")]
pub mod openexr;
#[cfg(feature = "png")]
pub mod png;
Loading…
Cancel
Save