Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: b8e21e1d75b1
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 388076f98548
Choose a head ref
  • 2 commits
  • 2 files changed
  • 1 contributor

Commits on Aug 2, 2020

  1. openexr, ilmbase: Fix compilation on non-glibc.

    Tested with musl.
    
    I PRd the patch upstream: AcademySoftwareFoundation/openexr#798
    nh2 committed Aug 2, 2020
    Copy the full SHA
    d939373 View commit details

Commits on Aug 10, 2020

  1. Merge pull request #94205 from nh2/ilmbase-non-glibc-fpstate

    openexr, ilmbase: Fix compilation on non-glibc.
    nh2 authored Aug 10, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    388076f View commit details
Showing with 34 additions and 2 deletions.
  1. +6 −1 pkgs/development/libraries/ilmbase/default.nix
  2. +28 −1 pkgs/development/libraries/openexr/default.nix
7 changes: 6 additions & 1 deletion pkgs/development/libraries/ilmbase/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{ stdenv
, lib
, buildPackages
, cmake
, libtool
@@ -20,7 +21,11 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ cmake libtool ];
depsBuildBuild = [ buildPackages.stdenv.cc ];

patches = [ ./cross.patch ];
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"
29 changes: 28 additions & 1 deletion pkgs/development/libraries/openexr/default.nix
Original file line number Diff line number Diff line change
@@ -4,10 +4,24 @@
, fetchFromGitHub
, zlib
, ilmbase
, fetchpatch
, fetchpatch
, cmake
, 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";
@@ -23,8 +37,21 @@ stdenv.mkDerivation rec {
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/";