Bug 202577 - graphics/opencolorio: force to use Python 2.x
Summary: graphics/opencolorio: force to use Python 2.x
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Kurt Jaeger
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2015-08-22 17:22 UTC by Roman Bogorodskiy
Modified: 2016-02-13 22:00 UTC (History)
3 users (show)

See Also:
pi: maintainer-feedback+


Attachments
opencolorio: fix Python depencency (505 bytes, patch)
2015-08-22 17:22 UTC, Roman Bogorodskiy
no flags Details | Diff
Maintainer update for graphics/opencolorio (26.90 KB, patch)
2015-08-29 14:20 UTC, Shane
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Roman Bogorodskiy freebsd_committer 2015-08-22 17:22:25 UTC
Created attachment 160219 [details]
opencolorio: fix Python depencency

graphics/opencolorio doesn't work properly with Python 3.x:

-- Setting python bin to: /usr/local/bin/python3.4
  File "<string>", line 1
    from distutils import sysconfig; print sysconfig.get_python_version()
                                                   ^
SyntaxError: invalid syntax
  File "<string>", line 1
    import sys; print sys.maxunicode > 65536 and 'ucs4' or 'ucs2'
                        ^
SyntaxError: invalid syntax
  File "<string>", line 1
    from distutils import sysconfig; print ':'.join(set(sysconfig.get_config_var('INCLDIRSTOMAKE').split()))
                                             ^
SyntaxError: invalid syntax
  File "<string>", line 1
    from distutils import sysconfig; print ':'.join(set(sysconfig.get_config_var('LIBPL').split()))
                                             ^
SyntaxError: invalid syntax

...

-- Python bindings will not be built: /usr/local/bin/python3.4 returned 1 trying to determine library path.

As Python 3.x doesn't allow print statements by default.

As a result we have:

pkg-static: Unable to access file /usr/ports/graphics/opencolorio/work/stage/usr/local/include/PyOpenColorIO/PyOpenColorIO.h: No such file or directory

Attaching a patch with the following changes:
 - Force using Python 2.x
 - Drop python from BUILD_DEPENDS as it's already done by adding python to USES
Comment 1 Shane 2015-08-29 14:19:04 UTC
While limiting to python 2 is valid, removing python from BUILD_DEPENDS would also need use of shebangfix

The build issues existing in 1.0.9 release have been fixed for a while and I don't expect a new release anytime soon, so I got around to updating graphics/opencolorio to a commit in master. This update creates a new port for the python bindings to allow multiple installs, ocio 1.0.9 also includes support for python 3.3+


For commit message --

Update graphics/opencolorio to commit a557a85454 on the master branch. This is the 1.0.9 release plus some fixes needed to resolve some build issues.

Add new port graphics/py-opencolorio to allow concurrent python module installs. Python 2.7 and 3.3+ is supported. py3.2 fails

graphics/opencolorio uses python2 to generate documentation, using python3 fails to find the python module in the build dir, as this only relates to generating the docs we can limit the master port to py2.7 while there is no issue with py-opencolorio using python 2.7 or 3.3+
Comment 2 Shane 2015-08-29 14:20:48 UTC
Created attachment 160484 [details]
Maintainer update for graphics/opencolorio

includes new port graphics/py-opencolorio
Comment 3 Roman Bogorodskiy freebsd_committer 2015-09-03 19:57:22 UTC
I tried to test your patch, but it fails at the patching stage:

(22:55) novel@kloomba:~/ports_stuff/graphics/opencolorio %> make
===>  License BSD3CLAUSE accepted by the user
===>  Found saved configuration for opencolorio-1.0.8_3
===>   opencolorio-1.0.9 depends on file: /usr/local/sbin/pkg - found
===> Fetching all distfiles required by opencolorio-1.0.9 for building
===>  Extracting for opencolorio-1.0.9
=> SHA256 Checksum OK for imageworks-OpenColorIO-1.0.9-a557a85454_GH0.tar.gz.
===>  Patching for opencolorio-1.0.9
===>  Applying extra patch /usr/home/novel/ports_stuff/graphics/opencolorio/files/extra-patch-src_core_CMakeLists.txt
===>  Applying FreeBSD patches for opencolorio-1.0.9
  I can't seem to find a patch in there anywhere.
=> Patch patch-docs__CMakeLists.txt failed to apply cleanly.
=> Patch(es) patch-docs_CMakeLists.txt applied cleanly.
*** Error code 1

Stop.
make[1]: stopped in /usr/home/novel/ports_stuff/graphics/opencolorio
*** Error code 1

Stop.
make: stopped in /usr/home/novel/ports_stuff/graphics/opencolorio
(22:55) novel@kloomba:~/ports_stuff/graphics/opencolorio %> 

Am I missing something?
Comment 4 Shane 2015-09-04 05:24:26 UTC
=> Patch patch-docs__CMakeLists.txt failed to apply cleanly.
=> Patch(es) patch-docs_CMakeLists.txt applied cleanly.

notice the two filenames one '_' and two '__' - one will be left from the old version, must have been missed when applying the patch. You may get the same thing with patch-share_cmake_OCIOMacros.cmake

I count 9 patch files. I see 5 files removed with two renamed that also have altered content.

The double underline is the old naming while makepatch now creates them with one. I renamed the docs_CMakeLists.txt patch some time ago (shortly after the makepatch change), while the cmake_OCIOMacros I had delete some time back and created the new one just recently when getting the python module working.
Comment 5 Kurt Jaeger freebsd_committer 2016-02-12 20:26:11 UTC
There is a 1.0.9 release at github, would that help ?
Comment 6 Kurt Jaeger freebsd_committer 2016-02-12 20:36:51 UTC
Got it, the patch from 20150829 has 1.0.9.
Comment 7 commit-hook freebsd_committer 2016-02-13 21:59:19 UTC
A commit references this bug:

Author: pi
Date: Sat Feb 13 21:58:40 UTC 2016
New revision: 408830
URL: https://svnweb.freebsd.org/changeset/ports/408830

Log:
  graphics/opencolorio: 1.0.8 -> 1.0.9

  - Updating to a557a85454 on the master branch.
    This is the 1.0.9 release plus some fixes needed to resolve
    some build issues.
  - Updating slave port graphics/opencolorio-tools
  - Adding new slave port graphics/py-opencolorio to allow concurrent
    python module installs. Python 2.7 and 3.3+ is supported. py3.2 fails
  - graphics/opencolorio uses python2 to generate documentation, using
    python3 fails to find the python module in the build dir, as this
    only relates to generating the docs we can limit the master port
    to py2.7 while there is no issue with py-opencolorio using python
    2.7 or 3.3+

  PR:		202577
  Submitted by:	FreeBSD@ShaneWare.Biz (maintainer)

Changes:
  head/graphics/Makefile
  head/graphics/opencolorio/Makefile
  head/graphics/opencolorio/distinfo
  head/graphics/opencolorio/files/extra-patch-CMakeLists.txt
  head/graphics/opencolorio/files/extra-patch-src_core_CMakeLists.txt
  head/graphics/opencolorio/files/extra-tools-patch-src_core_CMakeLists.txt
  head/graphics/opencolorio/files/patch-docs_CMakeLists.txt
  head/graphics/opencolorio/files/patch-docs__CMakeLists.txt
  head/graphics/opencolorio/files/patch-export__OpenColorIO__OpenColorABI.h.in
  head/graphics/opencolorio/files/patch-share__cmake__OCIOMacros.cmake
  head/graphics/opencolorio/files/patch-share_cmake_OCIOMacros.cmake
  head/graphics/opencolorio/files/patch-share_sphinx_ExtractRstFromSourceCPP.py
  head/graphics/opencolorio/files/patch-src__apps__ocioconvert__CMakeLists.txt
  head/graphics/opencolorio/files/patch-src__apps__ociolutimage__CMakeLists.txt
  head/graphics/opencolorio/files/patch-src__core__CMakeLists.txt
  head/graphics/opencolorio/files/patch-src__core__Platform.h
  head/graphics/opencolorio/files/patch-src_core__tests_CMakeLists.txt
  head/graphics/opencolorio/files/patch-src_jniglue_CMakeLists.txt
  head/graphics/opencolorio/files/patch-src_pyglue_CMakeLists.txt
  head/graphics/opencolorio/pkg-plist
  head/graphics/opencolorio/pkg-plist-pyglue
  head/graphics/opencolorio-tools/Makefile
  head/graphics/py-opencolorio/
  head/graphics/py-opencolorio/Makefile
Comment 8 Kurt Jaeger freebsd_committer 2016-02-13 22:00:43 UTC
Testbuilds all fine, committed, thanks for your patience!