Ticket #18537: haiku_exr_4.patch

File haiku_exr_4.patch, 5.0 KB (added by Begasus, 5 months ago)

This should be the correct (slimmed down) patch, that worked here.

  • build/jam/BuildFeatures

    diff --git a/build/jam/BuildFeatures b/build/jam/BuildFeatures
    index 323d2c0d..dbbe86c0 100644
    a b if [ IsPackageAvailable tiff4_devel ] {  
    566566
    567567
    568568# openexr
    569 if [ IsPackageAvailable openexr_devel ] {
     569if [ IsPackageAvailable openexr30_devel ] {
    570570       ExtractBuildFeatureArchives openexr :
    571                file: base openexr
     571               file: base openexr30
    572572                       runtime: lib
    573                file: devel openexr_devel
     573               file: devel openexr30_devel
    574574                       depends: base
    575575                       libraries:
    576                                $(developLibDir)/libIlmImf.so
    577                                $(developLibDir)/libIlmImfUtil.so
    578                                $(developLibDir)/libHalf.so
    579576                               $(developLibDir)/libIex.so
    580                                $(developLibDir)/libIexMath.so
    581577                               $(developLibDir)/libIlmThread.so
    582578                               $(developLibDir)/libImath.so
    583                        headers: $(developHeadersDir) $(developHeadersDir)/OpenEXR
     579                               $(developLibDir)/libOpenEXR.so
     580                               $(developLibDir)/libOpenEXRUtil.so
     581                       headers: $(developHeadersDir) $(developHeadersDir)/OpenEXR $(developHeadersDir)/Imath
    584582               ;
    585583
    586584       EnableBuildFeatures openexr ;
  • build/jam/repositories/HaikuPorts/x86_64

    diff --git a/build/jam/repositories/HaikuPorts/x86_64 b/build/jam/repositories/HaikuPorts/x86_64
    index b81791a9..82a91b76 100644
    a b RemotePackageRepository HaikuPorts  
    201201       openexr-2.4.1-1
    202202       openexr_devel-2.4.1-1
    203203       openexr30-3.0.5-1
     204       openexr30_devel-3.0.5-1
    204205       openjpeg-2.4.0-2
    205206       openjpeg_devel-2.4.0-2
    206207       openssh-9.3p1-1
  • src/add-ons/translators/exr/EXRGamma.cpp

    diff --git a/src/add-ons/translators/exr/EXRGamma.cpp b/src/add-ons/translators/exr/EXRGamma.cpp
    index cd5384fd..33516c1e 100644
    a b using namespace std;  
    1616float
    1717knee(double x, double f)
    1818{
    19        return float (Imath::Math<double>::log (x * f + 1) / f);
     19       return float (log (x * f + 1) / f);
    2020}
    2121
    2222
    Gamma::Gamma(float gamma,  
    5454       float kneeHigh)
    5555:
    5656       g (gamma),
    57        m (Imath::Math<float>::pow(2, exposure + 2.47393)),
     57       m (pow(2, exposure + 2.47393)),
    5858       d (defog),
    59        kl (Imath::Math<float>::pow(2, kneeLow)),
    60        f (findKneeF (Imath::Math<float>::pow(2, kneeHigh) - kl,
    61                Imath::Math<float>::pow(2, 3.5) - kl)),
    62        s (255.0 * Imath::Math<float>::pow(2, -3.5 * g))
     59       kl (pow(2, kneeLow)),
     60       f (findKneeF (pow(2, kneeHigh) - kl,
     61               pow(2, 3.5) - kl)),
     62       s (255.0 * pow(2, -3.5 * g))
    6363{
    6464}
    6565
    Gamma::operator() (half h)  
    9090       // Gamma
    9191       //
    9292       
    93        x = Imath::Math<float>::pow (x, g);
     93       x = pow (x, g);
    9494       
    9595       //
    9696       // Scale and clamp
  • src/add-ons/translators/exr/IStreamWrapper.cpp

    diff --git a/src/add-ons/translators/exr/IStreamWrapper.cpp b/src/add-ons/translators/exr/IStreamWrapper.cpp
    index 137e13c8..a06c31d0 100644
    a b IStreamWrapper::read(char c[/*n*/], int n)  
    2929}
    3030
    3131
    32 Int64
     32uint64_t
    3333IStreamWrapper::tellg()
    3434{
    3535       return fStream.Position();
    IStreamWrapper::tellg()  
    3737
    3838
    3939void
    40 IStreamWrapper::seekg(Int64 pos)
     40IStreamWrapper::seekg(uint64_t pos)
    4141{
    4242       fStream.Seek(pos, SEEK_SET);
    4343}
  • src/add-ons/translators/exr/IStreamWrapper.h

    diff --git a/src/add-ons/translators/exr/IStreamWrapper.h b/src/add-ons/translators/exr/IStreamWrapper.h
    index be2abbda..f13d93b9 100644
    a b class IStreamWrapper : public IStream {  
    1818               virtual ~IStreamWrapper();
    1919
    2020               virtual bool        read(char c[/*n*/], int n);
    21                virtual Int64       tellg();
    22                virtual void        seekg(Int64 pos);
     21               virtual uint64_t    tellg();
     22               virtual void        seekg(uint64_t pos);
    2323               
    2424       private:
    2525               StreamBuffer fStream;
  • src/data/package_infos/generic/haiku_datatranslators

    diff --git a/src/data/package_infos/generic/haiku_datatranslators b/src/data/package_infos/generic/haiku_datatranslators
    index b345a4f3..c15a00e2 100644
    a b requires {  
    2828#ifdef HAIKU_BUILD_FEATURE_%HAIKU_PACKAGING_ARCH%_libicns_ENABLED
    2929       lib:libicns
    3030#endif
    31 #ifdef HAIKU_BUILD_FEATURE_%HAIKU_PACKAGING_ARCH%_openexr_ENABLED
     31#ifdef HAIKU_BUILD_FEATURE_%HAIKU_PACKAGING_ARCH%_openexr30_ENABLED
    3232#ifdef HAIKU_PACKAGING_ARCH_x86_gcc2
    3333       lib:libilmimf
    3434       lib:libilmimfutil
    3535#else
    36        lib:libilmimf_2_4
    37        lib:libilmimfutil_2_4
     36       lib:libOpenEXR_3_0
    3837#endif
    3938#endif
    4039#ifdef HAIKU_BUILD_FEATURE_%HAIKU_PACKAGING_ARCH%_jasper_ENABLED