diff options
author | Robert Scott <code@humanleg.org.uk> | 2023-01-04 22:49:47 +0000 |
---|---|---|
committer | Robert Scott <code@humanleg.org.uk> | 2023-01-05 21:38:04 +0000 |
commit | ef4d0b8c26236377b7650ee08a19a7dc8dda20c2 (patch) | |
tree | d33c295522ff857f7d778d9f0d4f11282bddb526 /pkgs/development/libraries | |
parent | 2de41666301f3e370c7b6ed736d0a1f5238d7122 (diff) |
openimageio, openimageio_1: move to pkgs/development/libraries
it's a library
Diffstat (limited to 'pkgs/development/libraries')
-rw-r--r-- | pkgs/development/libraries/openimageio/1.x.nix | 77 | ||||
-rw-r--r-- | pkgs/development/libraries/openimageio/2539_backport.patch | 31 | ||||
-rw-r--r-- | pkgs/development/libraries/openimageio/default.nix | 76 |
3 files changed, 184 insertions, 0 deletions
diff --git a/pkgs/development/libraries/openimageio/1.x.nix b/pkgs/development/libraries/openimageio/1.x.nix new file mode 100644 index 0000000000000..62dd3f4cc2c92 --- /dev/null +++ b/pkgs/development/libraries/openimageio/1.x.nix @@ -0,0 +1,77 @@ +{ lib, stdenv, fetchFromGitHub, boost, cmake, ilmbase, libjpeg, libpng, libtiff +, opencolorio_1, openexr, unzip +}: + +stdenv.mkDerivation rec { + pname = "openimageio"; + version = "1.8.17"; + + src = fetchFromGitHub { + owner = "OpenImageIO"; + repo = "oiio"; + rev = "Release-${version}"; + sha256 = "0zq34szprgkrrayg5sl3whrsx2l6lr8nw4hdrnwv2qhn70jbi2w2"; + }; + + outputs = [ "bin" "out" "dev" "doc" ]; + + nativeBuildInputs = [ cmake unzip ]; + buildInputs = [ + boost ilmbase libjpeg libpng + libtiff opencolorio_1 openexr + ]; + + cmakeFlags = [ + "-DUSE_PYTHON=OFF" + ]; + + makeFlags = [ + "ILMBASE_HOME=${ilmbase.dev}" + "OPENEXR_HOME=${openexr.dev}" + "USE_PYTHON=0" + "INSTALLDIR=${placeholder "out"}" + "dist_dir=" + ]; + + patches = [ + # Backported from https://github.com/OpenImageIO/oiio/pull/2539 for 1.8.17 + ./2539_backport.patch + ]; + + meta = with lib; { + homepage = "http://www.openimageio.org"; + description = "A library and tools for reading and writing images"; + license = licenses.bsd3; + maintainers = [ maintainers.goibhniu ]; + platforms = platforms.unix; + knownVulnerabilities = [ + # all discovered in 2.x but there is no reason to + # believe that these or similar vulnerabilties aren't + # present in the totally unmaintained 1.x branch + "CVE-2022-36354" + "CVE-2022-38143" + "CVE-2022-41639" + "CVE-2022-41649" + "CVE-2022-41684" + "CVE-2022-41794" + "CVE-2022-41837" + "CVE-2022-41838" + "CVE-2022-41977" + "CVE-2022-41981" + "CVE-2022-41988" + "CVE-2022-41999" + "CVE-2022-43592" + "CVE-2022-43593" + "CVE-2022-43594" + "CVE-2022-43595" + "CVE-2022-43596" + "CVE-2022-43597" + "CVE-2022-43598" + "CVE-2022-43599" + "CVE-2022-43600" + "CVE-2022-43601" + "CVE-2022-43602" + "CVE-2022-43603" + ]; + }; +} diff --git a/pkgs/development/libraries/openimageio/2539_backport.patch b/pkgs/development/libraries/openimageio/2539_backport.patch new file mode 100644 index 0000000000000..c484b2ef9cf98 --- /dev/null +++ b/pkgs/development/libraries/openimageio/2539_backport.patch @@ -0,0 +1,31 @@ +diff --git a/src/libOpenImageIO/exif.cpp b/src/libOpenImageIO/exif.cpp +index 10b75c21..0287d9c5 100644 +--- a/src/libOpenImageIO/exif.cpp ++++ b/src/libOpenImageIO/exif.cpp +@@ -213,6 +213,9 @@ static const EXIF_tag_info exif_tag_table[] = { + + + ++// libtiff > 4.1.0 defines these in tiff.h. For older libtiff, let's define ++// them ourselves. ++#ifndef GPSTAG_VERSIONID + enum GPSTag { + GPSTAG_VERSIONID = 0, + GPSTAG_LATITUDEREF = 1, GPSTAG_LATITUDE = 2, +@@ -237,6 +240,7 @@ enum GPSTag { + GPSTAG_DIFFERENTIAL = 30, + GPSTAG_HPOSITIONINGERROR = 31 + }; ++#endif + + static const EXIF_tag_info gps_tag_table[] = { + { GPSTAG_VERSIONID, "GPS:VersionID", TIFF_BYTE, 4 }, +@@ -270,7 +274,7 @@ static const EXIF_tag_info gps_tag_table[] = { + { GPSTAG_AREAINFORMATION, "GPS:AreaInformation", TIFF_UNDEFINED, 1 }, + { GPSTAG_DATESTAMP, "GPS:DateStamp", TIFF_ASCII, 0 }, + { GPSTAG_DIFFERENTIAL, "GPS:Differential", TIFF_SHORT, 1 }, +- { GPSTAG_HPOSITIONINGERROR, "GPS:HPositioningError",TIFF_RATIONAL, 1 }, ++ { GPSTAG_GPSHPOSITIONINGERROR, "GPS:HPositioningError",TIFF_RATIONAL, 1 }, + { -1, NULL } // signal end of table + }; + diff --git a/pkgs/development/libraries/openimageio/default.nix b/pkgs/development/libraries/openimageio/default.nix new file mode 100644 index 0000000000000..88d99a0fae76e --- /dev/null +++ b/pkgs/development/libraries/openimageio/default.nix @@ -0,0 +1,76 @@ +{ lib, stdenv +, fetchFromGitHub +, fetchpatch +, boost +, cmake +, giflib +, ilmbase +, libjpeg +, libpng +, libtiff +, opencolorio +, openexr +, robin-map +, unzip +, fmt +}: + +stdenv.mkDerivation rec { + pname = "openimageio"; + version = "2.4.6.1"; + + src = fetchFromGitHub { + owner = "OpenImageIO"; + repo = "oiio"; + rev = "v${version}"; + sha256 = "sha256-oBICukkborxXFHXyM2rIn5qSbCWECjwDQI9MUg13IRU="; + }; + + patches = [ + (fetchpatch { + name = "arm-fix-signed-unsigned-simd-mismatch.patch"; + url = "https://github.com/OpenImageIO/oiio/commit/726c51181a2888b0bd1edbef5ac8451e9cc3f893.patch"; + hash = "sha256-G4vexf0OHZ/sbcRob5X92tajkmAv72ok8rcVQtIE9XE="; + }) + ]; + + outputs = [ "bin" "out" "dev" "doc" ]; + + nativeBuildInputs = [ + cmake + unzip + ]; + + buildInputs = [ + boost + giflib + ilmbase + libjpeg + libpng + libtiff + opencolorio + openexr + robin-map + fmt + ]; + + cmakeFlags = [ + "-DUSE_PYTHON=OFF" + "-DUSE_QT=OFF" + # GNUInstallDirs + "-DCMAKE_INSTALL_LIBDIR=lib" # needs relative path for pkg-config + ]; + + postFixup = '' + substituteInPlace $dev/lib/cmake/OpenImageIO/OpenImageIOTargets-*.cmake \ + --replace "\''${_IMPORT_PREFIX}/lib/lib" "$out/lib/lib" + ''; + + meta = with lib; { + homepage = "https://openimageio.org"; + description = "A library and tools for reading and writing images"; + license = licenses.bsd3; + maintainers = with maintainers; [ goibhniu ]; + platforms = platforms.unix; + }; +} |