Opened 11 years ago
Closed 9 years ago
#43195 closed request (duplicate)
cmake guru required so I can finish x265 Portfile
Reported by: | davidfavor (David Favor) | Owned by: | macports-tickets@… |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | |
Keywords: | Cc: | cooljeanius (Eric Gallager), jaminmc@…, ays388@… | |
Port: | x265 |
Description (last modified by ryandesign (Ryan Carsten Schmidt))
When building libx264, -install_name $PREFIX/lib/libx264.142.dylib is used when generating the dylib.
The x265 cmake project targets Linux, so there's no addition of this ld directive.
My question is this...
Let me know the best way to add this directive to the cmake project.
I'm using the MultiCoreWare code base.
hg clone https://bitbucket.org/multicoreware/x265 x265.hg
Thanks.
Attachments (2)
Change History (18)
comment:1 Changed 11 years ago by davidfavor (David Favor)
comment:2 Changed 11 years ago by davidfavor (David Favor)
This works as a temp fix.
install_name_tool -id $PREFIX/lib/libx265.13.dylib libx265.13.dylib
Maybe best way to do this in Portfile is to just run this command, rather than add some patch file for the cmake project.
Suggestions welcome.
comment:3 Changed 11 years ago by davidfavor (David Favor)
Hum... This approach works for programs like ffmpeg that link the library, after the library is built.
Problem is the x265 program fails, because the shared object file has no rpath at build time, so running install_name_tool at the end of the build still leaves an unusable x265 CLI program.
So a better solution is required.
comment:4 Changed 11 years ago by mf2k (Frank Schima)
Port: | x265 added |
---|---|
Version: | 2.2.1 |
comment:5 Changed 11 years ago by neverpanic (Clemens Lang)
CMake supports that out of the box by setting the INSTALL_NAME_DIR
property in CMakeLists.txt
for the target that builds the library.
See http://cmake.org/cmake/help/v2.8.10/cmake.html#prop_tgt:INSTALL_NAME_DIR.
If the upstream CMakeLists.txt
doesn't do that, you should probably make a patch and submit it there.
comment:6 Changed 11 years ago by davidfavor (David Favor)
Every time I start digging into cmake, I start thinking about eating my gun...
Let me know if there is a way to set the INSTALL_NAME_DIR as an environment variable to test this...
Maybe export=CMAKE_INSTALL_NAME_DIR=$prefix
or such...
Thanks for your assistance. I will get in touch with upstream + open a ticket.
comment:7 Changed 11 years ago by davidfavor (David Favor)
I ask about the environment variable because there are 5 different CMakeLists.txt files in this project. Ugh...
comment:8 Changed 11 years ago by davidfavor (David Favor)
https://bitbucket.org/multicoreware/x265/issue/46 is the ticket open with upstream.
comment:9 Changed 11 years ago by neverpanic (Clemens Lang)
I think you can add -DCMAKE_INSTALL_NAME_DIR=$prefix/lib
to configure.args
, but that's only good for the libraries. The correct way to fix that really is going through each add_library target and adding something along the lines of
set_target_properties(libname PROPERTIES INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/${LIB_INSTALL_DIR}" BUILD_WITH_INSTALL_RPATH 1)
comment:12 Changed 10 years ago by jaminmc@…
Ok, it only works with x265 directly. ffmpeg with x265 enabled still fails.
Changed 10 years ago by jaminmc@…
Attachment: | Portfile.2 added |
---|
Ok, this one doesn't create symbolic links anymore, and delete it if it exists. I added the Varriant of "highbitdepth" if you want to do higher than 8bit videos. X265 cli and ffmpeg both work correctly with this....
Changed 10 years ago by jaminmc@…
Disreguard Portfile.2 This one is the current commit of f26e81e and has the Varient in it for highbitrate
comment:14 Changed 9 years ago by dbevans (David B. Evans)
Cc: | ays388@… added |
---|
comment:15 Changed 9 years ago by ryandesign (Ryan Carsten Schmidt)
Description: | modified (diff) |
---|
comment:16 Changed 9 years ago by neverpanic (Clemens Lang)
Resolution: | → duplicate |
---|---|
Status: | new → closed |
#48306 is fixed, so there now is a x265 port. Let me know if you want any changes in addition to that.
Tried install_name_tool -add_rpath $PREFIX/lib libx265.dylib with no effect.