Checking/updating ports dependencies:
TAKE CARE! Make backups/copies from existing recipes before you start with this!
For instance:
Bump osl from osl-1.11.14.2.recipe
to osl-1.11.17.0.recipe
.
Checking the recipe I saw dependencies for:
`devel:libboost_system$secondaryArchSuffix >= 1.70.0` (and related boost libraries)
Our current version is 1.83.0, so this would be a first dependency bump
Change the required version in the osl-1.11.17.0.recipe from:
`devel:libboost_system$secondaryArchSuffix >= 1.70.0`
to
`devel:libboost_system$secondaryArchSuffix >= 1.83.0` (and the related boost libraries mentioned in there)
This is the easy part.
Next thing I see in dependencies is:
`devel:libOpenEXR_3_0$secondaryArchSuffix`
Our latest version is 3.2.2 and provides another version for the library
Change that line from:
`devel:libOpenEXR_3_0$secondaryArchSuffix`
to
devel:libOpenEXR_3_2$secondaryArchSuffix
This one is a bit more tricky as not all provide the _3.2 suffix, for this, check the openexr32.3.2.2.recipe
To ease the process I commented out the other openexr dependencies in BUILD_REQUIRES as:
# devel:libIex_3_0$secondaryArchSuffix
# devel:libIlmThread_3_0$secondaryArchSuffix
# devel:libImath_3_0$secondaryArchSuffix
devel:libLLVM_12$secondaryArchSuffix
devel:libOpenEXR_3_2$secondaryArchSuffix
# devel:libOpenEXRUtil_3_0$secondaryArchSuffix
devel:libOpenImageIO$secondaryArchSuffix >= 2.2
# devel:libpartio$secondaryArchSuffix
This will still pick up the openexr32_devel package with the needed parts.
Next problem is that openimageio also needs dependency update:
First one is:
`devel:libboost_system$secondaryArchSuffix >= 1.69.0`
Change this in the openimageio-2.3.10.0.recipe to:
`devel:libboost_system$secondaryArchSuffix >= 1.83.0`
Simular thing as with osl, change the dependencies for openimageio, make a REVISION bump (+1)
And rebuild, you should get POLICY WARNINGS/ERRORS depending if you run haikuporter in strict mode or not about missing or wrong dependencies (same goes for osl once openimage is done)
Make the adjustments in REQUIRES
and BUILD_REQUIRES
for openexr.
Like in REQUIRES:
Change from:
lib:libIex_3_0$secondaryArchSuffix
lib:libIlmThread_3_0$secondaryArchSuffix
lib:libImath_3_0$secondaryArchSuffix
lib:libjpeg$secondaryArchSuffix
lib:libOpenColorIO$secondaryArchSuffix
lib:libOpenEXR_3_0$secondaryArchSuffix
lib:libOpenEXRUtil_3_0$secondaryArchSuffix
to
lib:libIex_3_2$secondaryArchSuffix
lib:libIlmThread_3_2$secondaryArchSuffix
lib:libImath_3_1$secondaryArchSuffix
lib:libjpeg$secondaryArchSuffix
lib:libOpenColorIO$secondaryArchSuffix
lib:libOpenEXR_3_2$secondaryArchSuffix
lib:libOpenEXRUtil_3_2$secondaryArchSuffix
OK, think you’re done? Nope.
Checking the devel package for openimgeio I see it provides:
libOpenImageIO.so.2.3.10
libOpenImageIO.so.2.3
libOpenImageIO.so
Our libVersionCompat declares this as:
`libOpenImageIO.so.2` which should be `2.3.10 compat = 2.3`
So change the libVersionCompat from:
`libVersionCompat="$libVersion compat >= ${libVersion%%.*}"`
to
`libVersionCompat="$libVersion compat >= ${libVersion%.*}"`
This fixes the provides, and takes care it doesn’t interfere with other available versions.
OK, rebuild openimageio should go well.
A quick check with the tools provided by openimageio revealed that libnetwork is not used/linked in:
Run one of the tools in Terminal showed us:
~> oiiotool
runtime_loader: /boot/system/lib/libOpenImageIO.so.2.3.10: Could not resolve symbol 'connect'
resolve symbol "connect" returned: -2147478780
runtime_loader: /boot/system/lib/libOpenImageIO.so.2.3.10: Troubles relocating: Symbol not found
So updating that part in the patchset (showing the diff for it here) fixed that:
-if (__HAIKU__)
- target_link_libraries (OpenImageIO network)
+if (HAIKU)
+ target_link_libraries (OpenImageIO PRIVATE network)
+endif()
Time to finish up on osl.
Taking in considerations mentioned above, launch a build.
The initial thought of updating osl was to bump the LLVM version used in there, which is still LLVM 9
We want to bump this to LLVM 12
, so adjust the references in the new recipe for this like:
Change:
`devel:libLLVM_9$secondaryArchSuffix`
to
`devel:libLLVM_12$secondaryArchSuffix`
and
`cmd:clang_9`
to
`cmd:clang_12`
OpenImageIO version requested is still 2.2 which has been obsoleted
Change:
`devel:libOpenImageIO$secondaryArchSuffix >= 2.2`
to
`devel:libOpenImageIO$secondaryArchSuffix`
cmd:python is still used in there, we don’t use that and take the default one:
Change:
`cmd:python`
to
`cmd:python3`
Comment out PATCHES for now
Set REVISION="1"
(it’s a new version)
Checksum has changed and SOURCE_DIR, adjust accordingly.
You can see the checkum after haikuporter finishes the download and gives an error on the expected one versus the found one, use the found one.
For SOURCE_URI open the downloaded archive in Expander and check it’s content, this will show you it’s SOURCE_DIR
Time to build:
Cmake throws the first error:
`error: invoking cmake without CMAKE_BUILD_TYPE specified!`
add
`-DCMAKE_BUILD_TYPE=Release \`
to the recipe just after $cmakeDirArgs
cmake throws the second error LLVM 10+ requires C++14 or higher (was 11)., luckaly this is a known thing and fixes can be found through repology.
Like I found for this one at Fedora:
Then understanding what happened, add the next in your recipe:
in BUILD()
add to the cmake command:
`-DCMAKE_CXX_STANDARD=17 \`
after CMAKE_BUILD_TYPE
Next error “/bin/sh: line 1: python: command not found”
Add a PATCH() function (found at Fedora) to fix the python versioning:
PATCH()
{
# Use python3 binary instead of unversioned python
sed -i -e "s|COMMAND python|COMMAND python3|" $(find . -iname CMakeLists.txt)
}
Running the final INSTALL part will show an error that the libVersion for the debug package is wrong
Change:
`libVersion="1.11.14"`
to
`libVersion="1.11.17"`
Change the requirements in REQUIRES
according to the correct versions for LLVM 12
and EXR
This should get you both an updated openimageio and osl package.
PS, PR for OIIO is already filed, and OSL is in the making, this could serve as an example for some that would like to check existing recipes and eventually try to update their packages to a new version, being local or as a preparation to upstream this to haikuports.
WIP, so comments welcome.