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

OpenSSL #68

Closed
peregilk opened this issue Dec 3, 2018 · 13 comments · Fixed by #276
Closed

OpenSSL #68

peregilk opened this issue Dec 3, 2018 · 13 comments · Fixed by #276

Comments

@peregilk
Copy link

peregilk commented Dec 3, 2018

Could you build this with -enable-openssl

@sdvillal
Copy link
Contributor

sdvillal commented Dec 3, 2018

We briefly discussed it in #45 (which points to #43 (comment)).

Why do you need it?

@peregilk
Copy link
Author

peregilk commented Dec 3, 2018 via email

@sdvillal
Copy link
Contributor

sdvillal commented Dec 4, 2018

I personally think that, for the default version of ffmpeg, we should not compile against openssl until openssl version 3 gets released with the new apache license. ffmpeg is already a patent minefield as it is, adding yet more mines and changing the license on the way is, in my opinion, not a good idea. I think this is shared, at least in my linux distro, the official ffmpeg package does not compile against openssl.

Having said that, compiling against openssl used to be trivial: just add openssl to the dependencies, add the compilation flag and change the package license accordingly. So for the time being I would suggest for you to build your openssl-enabled version and upload it to your own channel. I can try to give a hand if you decide to go that way and find any problem.

@peregilk
Copy link
Author

peregilk commented Dec 4, 2018 via email

@sdvillal
Copy link
Contributor

sdvillal commented Dec 4, 2018

It should be enough to rebuild the ffmpeg package. We just need to make sure we compile the right version - one that is compatible with the version used to build conda-forge opencv. Latest opencv builds pin ffmpeg like ffmpeg >=4.0.2,<4.1. That unfortunately is not the latest version we ship of ffmpeg, which is 4.1 - conda-forge runs a little wild with a kind of rolling distro spirit were individual packages get upgraded as their maintainers see fit without necessarily rebuilding downstream packages. But this is just a small inconvenience with two easy workarounds: open a PR to opencv simply bumping its build number, so it gets the latest pinning, or simply checkout the conda-forge recipe for the old ffmpeg version (see below).

You might even decide to run your build against public CIs, but I feel that might be overkill. A quick linux recipe for building ffmpeg locally :

# prepare your tools:

#  1) install docker (e.g. in arch linux: https://wiki.archlinux.org/index.php/docker#Installation)

#  2) in your conda base environment, install conda-smithy and conda-forge-pinning
#      you might want to actually have a separated miniconda install just for that
conda install conda-smithy conda-forge-pinning

# 3) clone conda-forge ffmpeg recipe (perhaps you could use your own fork instead)
git clone git@github.com:conda-forge/ffmpeg-feedstock.git
cd ffmpeg-feedstock

# 4) latest conda-forge opencv needs ffmpeg >=4.0.2,<4.1
#     a quick look at ffmpeg recipe history tells us to checkout this commit
git checkout 06ff602d4942 -b with-openssl-4.0

# 5) make the needed changes to the recipe. In this case:
#        - in build.sh:
#            * change "disable-openssl" to "enable-openssl"
#            * remove "--enable-gnutls"
#            * add "--enable-nonfree"
#        - in meta.yaml:
#            * add "- openssl  # [not win]" to the host and run sections
#            * remove all references to gnutls
#            * change LICENSE, as we are not anymore GPL (optional but advisable)
#              for example, "custom: nonfree and unredistributable "
#              See: https://www.ffmpeg.org/legal.html
#           * bump build number; 
#             since this is for "internal use", I would put it to something like 2000

# 6) rerender the recipe
conda-smithy rerender

# 7) build (run and go have a coffee, it that is your thing)
#     note that this could change with future versions of smithy 
#    (it evolves as our usage of the CIs change)
CONFIG="linux_" .circleci/run_docker_build.sh

# 8) if all went well, your package is in "build_artifacts/linux-64/ffmpeg*"
# now you have a few options and will likely need to play with 
# channels and channel priorities:
#   - install manually from that file
#   - put it in a local repository, install 
#   - upload to your channel in anaconda.org.
#     I think the "unredistibutable" might not apply to you depending on where do you live.
#     But with #legalities I cannot really help much.
conda install anaconda-client
anaconda upload -u peregilk build_artifacts/linux-64/ffmpeg*

Note that right now conda-forge is still in between a rather large change of the compiler infrastructure. I do not know how this will play, but if there is any problem we can ask the conda-forge team (or simply wait until migration is done, a horizon that seems relatively close now).

HTH

@peregilk
Copy link
Author

peregilk commented Dec 4, 2018 via email

@peregilk
Copy link
Author

peregilk commented Dec 7, 2018 via email

@sdvillal
Copy link
Contributor

sdvillal commented Dec 7, 2018

I think the problem might be on how you have bumped the build number. You do not need to touch the version in meta.yaml. It should look something like this:

{% set version = "4.0.2" %}

...

build:
  number: 2000

@peregilk
Copy link
Author

peregilk commented Dec 7, 2018 via email

@sdvillal
Copy link
Contributor

sdvillal commented Dec 7, 2018

Cool, I have updated the instructions with your fixes and I will close the issue.

Just a last thought, it could be great if conda would allow "source packages" (ala gentoo, arch AUR and the like) that get built upon installation. It could make for a nice solution for this kind of situations.

@jakirkham
Copy link
Member

Given OpenSSL 3 has since shipped and conda-forge has migrated to it, maybe we can revisit this?

Reopening so we can discuss

@jakirkham jakirkham reopened this Jul 10, 2024
@hmaarrfk
Copy link
Contributor

@conda-forge-admin please rerender

@conda-forge-webservices
Copy link
Contributor

Hi! This is the friendly automated conda-forge-webservice.

I just wanted to let you know that I started rerendering the recipe in #276.

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 a pull request may close this issue.

4 participants