[MacPorts] #53339: OpenCV 3.2.0 fails building bundled freetype

MacPorts noreply at macports.org
Sat Jan 28 10:01:55 UTC 2017


#53339: OpenCV 3.2.0 fails building bundled freetype
----------------------+----------------------
  Reporter:  BSeppke  |      Owner:  stromnov
      Type:  defect   |     Status:  closed
  Priority:  Normal   |  Milestone:
 Component:  ports    |    Version:  2.3.5
Resolution:  fixed    |   Keywords:
      Port:  opencv   |
----------------------+----------------------

Comment (by RJVB):

 That's a bit of a tricky hack which wouldn't work with all `patch`
 implementations; on Linux patch typically refuses to patch files with a
 symlink in their path and that seems to apply here. Patching files outside
 of the current working directory also doesn't work reliably (otherwise one
 could do `--- ../opencv_contrib-3.2.0/foo.orig` etc.).

 2 safe solutions:

 {{{
 post-patch {
     system -W ${workpath}/opencv_contrib-${version} "patch -p1 -i
 ${filespath}/patch-freetype.diff"
 }
 }}}

 but that would defeat my proposed enhancement of storing applied
 patchfiles in the statefile, or

 {{{
 post-extract {
     file rename ${workpath}/opencv_contrib-${version}
 ${worksrcpath}/opencv_contrib
 }
 post-patch {
     file rename ${worksrcpath}/opencv_contrib
 ${workpath}/opencv_contrib-${version}
 }
 }}}

 Both are kludgy, but MacPorts hasn't really been conceived for ports that
 get additional sources from outside ${worksrcpath}.

 @stromnov : if you have time you could try looking into getting everything
 to unpack into a parent directory so you get something like

 {{{
 > ls -R `port work opencv`
 build
 opencv/opencv-3.2.0
 opencv/opencv_contrib-3.2.0
 }}}

 The idea is to redefine the work directory structure such that the patch
 command will be invoked in `opencv`, not in the actual directory holding
 the sources. This could (but may well not) be as simple as adding a line

 {{{
 worksrcdir opencv
 }}}

 but you could also do the re-arranging in a post-extract step (that will
 probably have less unforeseen side-effects).
 You'd have to add the appropriate directory to the patchfiles and add a
 configure.args argument so that CMake finds the correct CMakeLists.txt .

 Like this the port will also be ready for using the muniversal PG if and
 when a simple +universal build no longer works.

--
Ticket URL: <https://trac.macports.org/ticket/53339#comment:4>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list