openexr: 2.4.1 -> 2.5.2

Needed to apply patch to fix pkg-config files so also removed patch that is unused since the switch to CMake during patches refactoring.
This commit is contained in:
Jan Tojnar 2020-08-11 20:13:48 +02:00
parent 0c46d8f140
commit e4eb966875
3 changed files with 29 additions and 73 deletions

View File

@ -1,35 +0,0 @@
From: Helmut Grohne <>
Subject: compile build tools with the build architecture compiler
Patch-Source: https://github.com/openexr/openexr/issues/221
Index: ilmbase-2.2.0/configure.ac
===================================================================
--- ilmbase-2.2.0.orig/configure.ac
+++ ilmbase-2.2.0/configure.ac
@@ -28,6 +28,7 @@
AC_PROG_LN_S
AC_PROG_LIBTOOL
AC_PROG_MAKE_SET
+AX_PROG_CXX_FOR_BUILD
dnl
dnl PKGCONFIG preparations
Index: ilmbase-2.2.0/Half/Makefile.am
===================================================================
--- ilmbase-2.2.0.orig/Half/Makefile.am
+++ ilmbase-2.2.0/Half/Makefile.am
@@ -17,9 +17,11 @@
CLEANFILES = eLut eLut.h toFloat toFloat.h
-eLut_SOURCES = eLut.cpp
+eLut$(EXEEXT): eLut.cpp
+ $(CXX_FOR_BUILD) $(CXXFLAGS_FOR_BUILD) $< -o $@
-toFloat_SOURCES = toFloat.cpp
+toFloat$(EXEEXT): toFloat.cpp
+ $(CXX_FOR_BUILD) $(CXXFLAGS_FOR_BUILD) $< -o $@
eLut.h: eLut
./eLut > eLut.h

View File

@ -12,26 +12,23 @@ stdenv.mkDerivation rec {
# the project no longer provides separate tarballs. We may even want to merge
# the ilmbase package into openexr in the future.
src = openexr.src;
sourceRoot = "source/IlmBase";
inherit (openexr) src patches;
outputs = [ "out" "dev" ];
nativeBuildInputs = [ cmake libtool ];
depsBuildBuild = [ buildPackages.stdenv.cc ];
patches = [
./cross.patch
] ++ lib.optionals (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.libc != "glibc") [
openexr.non_glibc_fpstate_patch # see description of this patch in `openexr`
];
# fails 1 out of 1 tests with
# "lt-ImathTest: testBoxAlgo.cpp:892: void {anonymous}::boxMatrixTransform(): Assertion `b21 == b2' failed"
# at least on i686. spooky!
doCheck = stdenv.isx86_64;
preConfigure = ''
# Need to cd after patches for openexr patches to apply.
cd IlmBase
'';
meta = with stdenv.lib; {
description = " A library for 2D/3D vectors and matrices and other mathematical objects, functions and data types for computer graphics";
homepage = "https://www.openexr.com/";

View File

@ -9,49 +9,43 @@
, libtool
}:
let
non_glibc_fpstate_patch =
# Fix ilmbase/openexr using glibc-only fpstate.
# Found via https://git.alpinelinux.org/aports/tree/community/openexr/10-musl-_fpstate.patch?id=80d9611b7b8e406a554c6f511137e03ff26acbae,
# TODO Remove when https://github.com/AcademySoftwareFoundation/openexr/pull/798 is merged and available.
# Remove it from `ilmbase` as well then.
(fetchpatch {
name = "ilmbase-musl-_fpstate.patch.patch";
url = "https://raw.githubusercontent.com/void-linux/void-packages/80bbc168faa25448bd3399f4df331b836e74b85c/srcpkgs/ilmbase/patches/musl-_fpstate.patch";
sha256 = "0appzbs9pd6dia5pzxmrs9ww35shlxi329ks6lchwzw4f2a81arz";
});
in
stdenv.mkDerivation rec {
pname = "openexr";
version = "2.4.1";
version = "2.5.2";
outputs = [ "bin" "dev" "out" "doc" ];
src = fetchFromGitHub {
owner = "AcademySoftwareFoundation";
repo = "openexr";
rev = "v${version}";
sha256 = "020gyl8zv83ag6gbcchmqiyx9rh2jca7j8n52zx1gk4rck7kwc01";
sha256 = "dtVoXA3JdmNs1iqu7cZlAdxt/CAgL5lSbOwu0SheyO0=";
};
outputs = [ "bin" "dev" "out" "doc" ];
patches = [
# Fix pkg-config paths
(fetchpatch {
url = "https://github.com/AcademySoftwareFoundation/openexr/commit/6442fb71a86c09fb0a8118b6dbd93bcec4883a3c.patch";
sha256 = "bwD5WTKPT4DjOJDnPXIvT5hJJkH0b71Vo7qupWO9nPA=";
})
] ++ lib.optionals (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.libc != "glibc") [
# Fix ilmbase/openexr using glibc-only fpstate.
# Found via https://git.alpinelinux.org/aports/tree/community/openexr/10-musl-_fpstate.patch?id=80d9611b7b8e406a554c6f511137e03ff26acbae,
# TODO Remove when https://github.com/AcademySoftwareFoundation/openexr/pull/798 is merged and available.
(fetchpatch {
name = "ilmbase-musl-_fpstate.patch.patch";
url = "https://raw.githubusercontent.com/void-linux/void-packages/80bbc168faa25448bd3399f4df331b836e74b85c/srcpkgs/ilmbase/patches/musl-_fpstate.patch";
sha256 = "1bmyg4qfbz2p5iflrakbj8jzs85s1cf4cpfyclycnnqqi45j8m8d";
# The patch's files are written as `IlmBase/...`, this turns it into
# `a/IlmBase/...`, so that the `patch -p1` that `patches` does works.
extraPrefix = ""; # Changing this requires changing the `sha256` (fixed-output)!
})
];
nativeBuildInputs = [ cmake libtool ];
propagatedBuildInputs = [ ilmbase zlib ];
postPatch =
if (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.libc != "glibc")
then
''
patch -p0 < ${non_glibc_fpstate_patch}
''
else null; # `null` avoids rebuild on glibc
enableParallelBuilding = true;
passthru = {
# So that ilmbase (sharing the same source code) can re-use this patch.
inherit non_glibc_fpstate_patch;
};
meta = with stdenv.lib; {
description = "A high dynamic-range (HDR) image file format";
homepage = "https://www.openexr.com/";