Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libx264: conan v2, and to make it work on Windows msys (build for msvc) #15353

Merged
merged 15 commits into from
Mar 30, 2023

Conversation

paulharris
Copy link
Contributor

I started upgrading this recipe, but have got stuck on the parts related to MacOS and nasm...

example, the only example I could see to replace apple_deployment_target_flag() was from the Boost recipe upgrade, and it looks different.

Could I please get some assistance? Or perhaps someone else lead this PR?

My goal is to allow this recipe to build nicely for MSVC from within my msys shell.

@paulharris paulharris marked this pull request as draft January 19, 2023 00:27
@paulharris paulharris marked this pull request as ready for review February 2, 2023 03:30
@paulharris
Copy link
Contributor Author

Can I please get some guidance on this PR ?
The apple_deployment_target_flag() is something I have no idea about ...

@paulharris
Copy link
Contributor Author

I've done some more, but I really don't know what to do with the compiler_wrapper and other such things that other recipes seem to perform.

@conan-center-bot

This comment has been minimized.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 3, 2023

Hooks produced the following warnings for commit 7b7a9bb
libx264/20191217
post_package(): WARN: [SHORT_PATHS USAGE (KB-H066)] The file './home/conan/w/prod/BuildSingleReference/.conan/data/libx264/20191217/_/_/package/88afa90131970fa8c89c3d86dda39233cf00f89e/include/x264.h' has a very long path and may exceed Windows max path length. Add 'short_paths = True' in your recipe.
post_package(): WARN: [SHORT_PATHS USAGE (KB-H066)] The file './home/conan/w/prod/BuildSingleReference/.conan/data/libx264/20191217/_/_/package/88afa90131970fa8c89c3d86dda39233cf00f89e/lib/libx264.a' has a very long path and may exceed Windows max path length. Add 'short_paths = True' in your recipe.
post_package(): WARN: [SHORT_PATHS USAGE (KB-H066)] The file './home/conan/w/prod/BuildSingleReference/.conan/data/libx264/20191217/_/_/package/88afa90131970fa8c89c3d86dda39233cf00f89e/lib/pkgconfig/x264.pc' has a very long path and may exceed Windows max path length. Add 'short_paths = True' in your recipe.
post_package(): WARN: [SHORT_PATHS USAGE (KB-H066)] The file './home/conan/w/prod/BuildSingleReference/.conan/data/libx264/20191217/_/_/package/6ad5477442f8b835700b5367bb2b153ff457b6ff/include/x264.h' has a very long path and may exceed Windows max path length. Add 'short_paths = True' in your recipe.
post_package(): WARN: [SHORT_PATHS USAGE (KB-H066)] The file './home/conan/w/prod/BuildSingleReference/.conan/data/libx264/20191217/_/_/package/6ad5477442f8b835700b5367bb2b153ff457b6ff/lib/libx264.a' has a very long path and may exceed Windows max path length. Add 'short_paths = True' in your recipe.
post_package(): WARN: [SHORT_PATHS USAGE (KB-H066)] The file './home/conan/w/prod/BuildSingleReference/.conan/data/libx264/20191217/_/_/package/6ad5477442f8b835700b5367bb2b153ff457b6ff/lib/pkgconfig/x264.pc' has a very long path and may exceed Windows max path length. Add 'short_paths = True' in your recipe.
post_package(): WARN: [SHORT_PATHS USAGE (KB-H066)] The file './home/conan/w/prod/BuildSingleReference/.conan/data/libx264/20191217/_/_/package/64fe53fcd76779db6bec7f39f30490163f1eecc2/include/x264.h' has a very long path and may exceed Windows max path length. Add 'short_paths = True' in your recipe.
post_package(): WARN: [SHORT_PATHS USAGE (KB-H066)] The file './home/conan/w/prod/BuildSingleReference/.conan/data/libx264/20191217/_/_/package/64fe53fcd76779db6bec7f39f30490163f1eecc2/lib/libx264.so.157' has a very long path and may exceed Windows max path length. Add 'short_paths = True' in your recipe.
post_package(): WARN: [SHORT_PATHS USAGE (KB-H066)] The file './home/conan/w/prod/BuildSingleReference/.conan/data/libx264/20191217/_/_/package/64fe53fcd76779db6bec7f39f30490163f1eecc2/lib/pkgconfig/x264.pc' has a very long path and may exceed Windows max path length. Add 'short_paths = True' in your recipe.
post_package(): WARN: [SHORT_PATHS USAGE (KB-H066)] The file './home/conan/w/prod/BuildSingleReference/.conan/data/libx264/20191217/_/_/package/0f27bd2b91f81907d4edf51e5fcff0e8060e4f0e/include/x264.h' has a very long path and may exceed Windows max path length. Add 'short_paths = True' in your recipe.
post_package(): WARN: [SHORT_PATHS USAGE (KB-H066)] The file './home/conan/w/prod/BuildSingleReference/.conan/data/libx264/20191217/_/_/package/0f27bd2b91f81907d4edf51e5fcff0e8060e4f0e/lib/libx264.a' has a very long path and may exceed Windows max path length. Add 'short_paths = True' in your recipe.
post_package(): WARN: [SHORT_PATHS USAGE (KB-H066)] The file './home/conan/w/prod/BuildSingleReference/.conan/data/libx264/20191217/_/_/package/0f27bd2b91f81907d4edf51e5fcff0e8060e4f0e/lib/pkgconfig/x264.pc' has a very long path and may exceed Windows max path length. Add 'short_paths = True' in your recipe.
post_package(): WARN: [SHORT_PATHS USAGE (KB-H066)] The file './home/conan/w/prod/BuildSingleReference/.conan/data/libx264/20191217/_/_/package/5e17c62f3092a16710b6eafa1e435b02c2917f1d/include/x264.h' has a very long path and may exceed Windows max path length. Add 'short_paths = True' in your recipe.
post_package(): WARN: [SHORT_PATHS USAGE (KB-H066)] The file './home/conan/w/prod/BuildSingleReference/.conan/data/libx264/20191217/_/_/package/5e17c62f3092a16710b6eafa1e435b02c2917f1d/lib/libx264.so.157' has a very long path and may exceed Windows max path length. Add 'short_paths = True' in your recipe.
post_package(): WARN: [SHORT_PATHS USAGE (KB-H066)] The file './home/conan/w/prod/BuildSingleReference/.conan/data/libx264/20191217/_/_/package/5e17c62f3092a16710b6eafa1e435b02c2917f1d/lib/pkgconfig/x264.pc' has a very long path and may exceed Windows max path length. Add 'short_paths = True' in your recipe.
post_package(): WARN: [SHORT_PATHS USAGE (KB-H066)] The file './home/conan/w/prod/BuildSingleReference/.conan/data/libx264/20191217/_/_/package/52bfaf5780e9ee7fba3fa4a492156dbcf0dff057/include/x264.h' has a very long path and may exceed Windows max path length. Add 'short_paths = True' in your recipe.
post_package(): WARN: [SHORT_PATHS USAGE (KB-H066)] The file './home/conan/w/prod/BuildSingleReference/.conan/data/libx264/20191217/_/_/package/52bfaf5780e9ee7fba3fa4a492156dbcf0dff057/lib/libx264.a' has a very long path and may exceed Windows max path length. Add 'short_paths = True' in your recipe.
post_package(): WARN: [SHORT_PATHS USAGE (KB-H066)] The file './home/conan/w/prod/BuildSingleReference/.conan/data/libx264/20191217/_/_/package/52bfaf5780e9ee7fba3fa4a492156dbcf0dff057/lib/pkgconfig/x264.pc' has a very long path and may exceed Windows max path length. Add 'short_paths = True' in your recipe.

@paulharris paulharris closed this Feb 4, 2023
@paulharris paulharris reopened this Feb 4, 2023
@conan-center-bot

This comment has been minimized.

@paulharris paulharris closed this Feb 8, 2023
@paulharris paulharris reopened this Feb 8, 2023
@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 9, 2023

Hooks produced the following warnings for commit 26c59d8
libx264/20191217
post_package(): WARN: [APPLE RELOCATABLE SHARED LIBS (KB-H077)] install_name dir of these shared libs is not @rpath: libx264.dylib, libx264.157.dylib
libx264/cci.20220602
post_package(): WARN: [APPLE RELOCATABLE SHARED LIBS (KB-H077)] install_name dir of these shared libs is not @rpath: libx264.164.dylib, libx264.dylib
libx264/20190605
post_package(): WARN: [APPLE RELOCATABLE SHARED LIBS (KB-H077)] install_name dir of these shared libs is not @rpath: libx264.dylib, libx264.157.dylib

@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

recipes/libx264/all/conanfile.py Outdated Show resolved Hide resolved
recipes/libx264/all/conanfile.py Outdated Show resolved Hide resolved
recipes/libx264/all/conanfile.py Outdated Show resolved Hide resolved
@franramirez688 franramirez688 self-requested a review February 10, 2023 12:44
Thanks to StellaSmith!

Co-authored-by: Stella Smith <40411082+StellaSmith@users.noreply.github.com>
@conan-center-bot

This comment has been minimized.

recipes/libx264/all/conanfile.py Outdated Show resolved Hide resolved
recipes/libx264/all/conanfile.py Outdated Show resolved Hide resolved
recipes/libx264/all/conanfile.py Outdated Show resolved Hide resolved
recipes/libx264/all/conanfile.py Outdated Show resolved Hide resolved
recipes/libx264/all/conanfile.py Outdated Show resolved Hide resolved
recipes/libx264/all/conanfile.py Outdated Show resolved Hide resolved
recipes/libx264/all/conanfile.py Outdated Show resolved Hide resolved
recipes/libx264/all/test_v1_package/conanfile.py Outdated Show resolved Hide resolved
recipes/libx264/all/test_package/conanfile.py Outdated Show resolved Hide resolved
recipes/libx264/all/conanfile.py Outdated Show resolved Hide resolved
@paulharris
Copy link
Contributor Author

Thanks @SpaceIm, I've been buried in other things recently, I'll get back to this soon.

@SpaceIm
Copy link
Contributor

SpaceIm commented Mar 28, 2023

@paulharris Could you close/open this PR to see whether it passes CI? libx264 is a dependency of ffmpeg and it would be nice to have a conan v2 compatible recipe for this one ;)

Comment on lines 85 to 90
if self.options.shared:
args.append("--enable-shared")
args["--enable-shared"] = ""
args["--disable-static"] = None # --disable-static is not understood
else:
args.append("--enable-static")
args["--enable-static"] = ""
args["--disable-shared"] = None # --disable-shared is not understood
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--disable-static can be moved outside this branching I think, otherwise it' a little bit confusing I think.

Comment on lines 119 to 120
env.define("AS", os.environ["CC"])
ndk_root = unix_path(self, os.environ["NDK_ROOT"])
Copy link
Contributor

@SpaceIm SpaceIm Mar 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CC should come from tools.build:compiler_executables config and fallback eventually to CC from VirtualBuildEnv, not os.environ

Same for NDK_ROOT, I think there is tools.android:ndk_path config for this one.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I gave it a try but I don't build Android so hard to test.
I referred to git log -p for hints on usage patterns.

@SpaceIm SpaceIm mentioned this pull request Mar 29, 2023
3 tasks
@conan-center-bot
Copy link
Collaborator

Conan v1 pipeline ✔️

All green in build 17 (92cfbc1be089ae7d980946bd55599d6637c213d2):

  • libx264/cci.20220602@:
    All packages built successfully! (All logs)

  • libx264/20191217@:
    All packages built successfully! (All logs)

  • libx264/20190605@:
    All packages built successfully! (All logs)


Conan v2 pipeline (informative, not required for merge) ✔️

Note: Conan v2 builds are informative and they are not required for the PR to be merged.

All green in build 18 (92cfbc1be089ae7d980946bd55599d6637c213d2):

  • libx264/20190605@:
    All packages built successfully! (All logs)

  • libx264/cci.20220602@:
    All packages built successfully! (All logs)

  • libx264/20191217@:
    All packages built successfully! (All logs)

Copy link
Contributor

@SpaceIm SpaceIm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's good enough. Let's move forward.

@SpaceIm
Copy link
Contributor

SpaceIm commented Mar 29, 2023

@prince-chrismc @uilianries could you review please? This PR is mandatory to get a chance to pass ffmpeg builds in v2 pipeline (which is mandatory for opencv 4.x with its current default options).

Copy link
Member

@uilianries uilianries left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@property
def _source_subfolder(self):
return "source_subfolder"
# otherwise build fails with: ln: failed to create symbolic link './Makefile' -> '../../../../../../../../../../../../../j/w/prod/buildsinglereference@2/.conan/data/libx264/cci.20220602/_/_/build/622692a7dbc145becf87f01b017e2a0d93cc644e/src/Makefile': File name too long
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding comments !!!

@conan-center-bot conan-center-bot merged commit c647b15 into conan-io:master Mar 30, 2023
@paulharris paulharris deleted the libx264-for-msvc branch March 31, 2023 01:37
0xFireWolf pushed a commit to 0xFireWolf/conan-center-index that referenced this pull request Apr 2, 2023
…ys (build for msvc)

* First attempt to upgrade for conan v2 compatibility

* Fixup tests, try and fix compiler_wrapper etc

* Fix up linter

* Fixup configure --prefix

* Use AutotoolsToolchain.update_configure_args()

* Attempt to fix File-name-too-long error on Windows

* Avoid one bit of the recipe for conan v2

* Fix typo

* Fix for apple rpaths

* Apply suggestions from code review

Thanks to StellaSmith!

Co-authored-by: Stella Smith <40411082+StellaSmith@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: SpaceIm <30052553+SpaceIm@users.noreply.github.com>

* Remove unused vars: build_canonical_name host_canonical_name

* Fixes as suggested by SpaceIM

---------

Co-authored-by: Stella Smith <40411082+StellaSmith@users.noreply.github.com>
Co-authored-by: SpaceIm <30052553+SpaceIm@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants