Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

New Formula: avidemux #8429

Closed
wants to merge 1 commit into from
Closed

New Formula: avidemux #8429

wants to merge 1 commit into from

Conversation

2bits
Copy link
Contributor

@2bits 2bits commented Nov 3, 2011

Avidemux is a popular video editor, actively developed since 2001.
Working with their lead engineer, the OSX code has been corrected,
and now the formula will build avidemux2_cli, the command line
version, with every video filter, encoder, and decoder available.

In addition, if the user has Qt installed, this will automatically
build the Qt gui, avidemux2. Several weeks of work also gets us a
new CoreAudio output device for Qt, a feature missing since 2008.

Macports has a portfile for 2.5.3, a very buggy version.
The latest stable is 2.5.6. This formula will build stable or
2.5svn, which today is 2.5.6 r7750.

The 2.5 branch, called avidemux2, is being finalized.
The 2.6 branch, called avidemux3, is being very actively developed.

EDIT: removed patches merged upstream
EDIT: now compiles against r7668 on Lion.
EDIT: fixes indentation, removes some debug commands
EDIT: put two patches inline not on fileden
EDIT: remove patches merged upstream, inline variable 'a'
EDIT: add patch for ffmpeg compiling on 32bit OSX,
switch url to 2.5.6 stable, add head (tested at r7724)
EDIT: remove dep on libvpx that fails with XCode-4.3.
EDIT: add back in the libvpx, it's fixed. Fix svn revision patch.
EDIT: Make svn rev patch apply only to head. Use cached_download
EDIT: Change head url to use http not svn. Berlios svn offline.
EDIT: Install app to prefix not bin by Homebrew convention.
EDIT: Build verbose if brewed --with-debug.
EDIT: Fix optimization: O3 for regular, -g -O0 for clang debug,
and -ggdb3 -O2 for llvm or gcc debug.
EDIT: shorten inreplaces, use buildpath, make test work w/head.
EDIT: remove cd, use mkdir do. use interpolated array style.
EDIT: Revert to allowing HB to use -Os.
EDIT: Add a patch for 32bit Snow Lep. fixes missing symbols

# Only builds with gcc. With llvm, a fix for us breaks the win64 compilation.
# With clang, inline asm needs work. All these issues are being forwarded
# to the developers, but their main focus is on avidemux3 (svn branch 2.6).
ENV.gcc
Copy link
Member

Choose a reason for hiding this comment

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

This should be a fails_with_llvm outside of def install. ENV.gcc will fail for Xcode 4.2 users.

@2bits
Copy link
Contributor Author

2bits commented Nov 3, 2011

When I posted this I didn't know that gcc and g++ had been removed. I thought Apple had taken off
the version numbers from gcc-4.2 and g++-4.2, not removed the compilers entirely. So basically the
new Lion only has one compiler, what we call clang, but is really llvm-clang, using llvm as the backend,
and clang as the frontend rather than gcc. Is that correct? And Apple calls it LLVM Compiler 2.0?
Would someone please ls -l the compilers in /usr/bin on Lion for me?

@jacknagel
Copy link
Contributor

XCode 4.2 has llvm-gcc and clang.

@mistydemeo
Copy link
Member

Xcode 4.2 has both llvm-gcc and clang. /usr/bin/gcc has been a symlink for some time now, which used to point to /usr/bin/gcc-4.2 but started pointing to /usr/bin/llvm-gcc-4.2 instead as of Xcode 4.0. Xcode 4.2 removed the gcc-4.2 and g++-4.2 executables.

@2bits
Copy link
Contributor Author

2bits commented Nov 5, 2011

Ok so there are two compilers, llvm-gcc, and llvm-clang otherwise known as clang or Apple Complier 2.0 or whatever, but I crafted the only formula out of 1700 that needs gcc. So I'd actually have gotten more accomplished if I'd uninstalled. Impressive.

@mistydemeo
Copy link
Member

This wouldn't be the only formula that only works with GCC right now; mplayer's another example. It's definitely a mess for Xcode 4.2 users.

@2bits
Copy link
Contributor Author

2bits commented Nov 29, 2011

EDIT: removed patches merged upstream.
EDIT: now compiles on Lion too.

@2bits
Copy link
Contributor Author

2bits commented Nov 29, 2011

EDIT: removes dev code like system "exit 1" and fixes indentation. Build on Lion and SL version @ r7670

Atm, fileden is offline for the third day, making the patches unavailable. I may have to inline them, or hopefully
they will get merged in the next day or two. My apologies to anyone trying to build this now.

@mistydemeo
Copy link
Member

Inline is fine for patches that aren't huge.

gist is usually preferred for linked patches, unless they're coming from a primary source like the developer's site or Macports.

@2bits
Copy link
Contributor Author

2bits commented Nov 30, 2011

I can't seem to gist mixed line endings. Web browsers filter those out. Small caveat there :-)
I'll make them inline for a week or two until they get merged upstream, thanks.

@2bits
Copy link
Contributor Author

2bits commented Dec 1, 2011

Patches now inline. Version is r7666. Compiles on Lion & SL, but not with Clang due to backend llvm bug being researched.

@mistydemeo
Copy link
Member

Compiles great for me on Lion with LLVM. Both GUI and console apps work like a charm.

@adamv
Copy link
Contributor

adamv commented Dec 1, 2011

Is the url a stable point?

nonver = ffpref+fflib+ffsuff
nonver = lib+nonver
hasver = Dir[ffpat]
ln_sf "#{hasver}", "#{nonver}" # Has to be quoted or get ENOENT
Copy link
Member

Choose a reason for hiding this comment

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

Just as a note, that's because your hasver and nonver objects are Pathname objects, and #ln_sf takes strings as arguments. The "#{hasver}" string insertion is doing an automatic #to_s conversion. It's equivalent to doing ln_sf hasver.to_s nonver.to_s.

Not that what you did is wrong, just explaining why the quotes were necessary.

@2bits
Copy link
Contributor Author

2bits commented Dec 1, 2011

Last update removes inline patches merged upstream, removes the 'a' variable for code cleanup.

@mistydemeo Thanks for helping me understand that Ruby conversion. I was wondering if I'd ever use a to_s.
@adamv The url points to an unstable repo that gets updated frequently with my fixes and whenever there is a new ffmpeg version. There will very likely be an Avidemux-2.5.6 in a month or so, but in the meantime I've got a plugin parsing issue that's a bad thing (wrong configure dialog boxes appear, partially named codecs, general havoc) that needs to be solved. Until the plugins all load correctly, it's has runtime errors (that don't exist on Linux).

@mistydemeo
Copy link
Member

If that's the case, I think it's best to wait on the stable release. A month isn't that long, all things considered. Since you have some patches in here, it could break anytime whenever upstream makes a change to the source.

@mistydemeo
Copy link
Member

I noticed that Avidemux 2.5.6 is out now, with OS X fixes in the release notes.

@MikeMcQuaid
Copy link
Member

Sorry, didn't mean to include this. Pushed a bunch of changes and didn't mean to add this one.

@2bits
Copy link
Contributor Author

2bits commented Jan 23, 2012

Thanks for the comments. I received a helpful patch in the Avidemux forums that I merged in the above commit.
Apparently we already do this patch in Homebrew's ffmpeg formula, but this fellow who posted the patch in the other forums adjusted it to the internal ffmpeg inside the Avidemux tarball.

The above commit also:

  • switches the url to 2.5.6 stable tar.gz
  • adds a sha1
  • adds head

The changes have been tested on 64bit Lion and Snow Lep using llvm and gcc from the latest XCodes, plus the patch author tested it on 32bit Leopard. Some change upstream in ffmpeg in December went and b0rked the compilation with Clang (during ffmpeg configure it can't find config.h lol). 98% glory is not what I was trying to achieve, but there it is.

@2bits
Copy link
Contributor Author

2bits commented Feb 17, 2012

The above commit removes the dep on libvpx-1.0.0 because it fails_with_XCode-4.3 on Lion 10.7.3.

@2bits
Copy link
Contributor Author

2bits commented Feb 27, 2012

The above commit returns the dep on libvpx, because Jack fixed it. It is rebased. The inreplace to fix finding .svn was fixed to take into account the new Homebrew cache naming scheme, i.e. avidemux--svn-HEAD.

@2bits
Copy link
Contributor Author

2bits commented Mar 17, 2012

@jacknagel rebased, and cleaned up the code. Removes the skip clean that's not needed, sets the correct optimization for each compiler when building debug, restested against r7750, and moves the app to prefix not bin per convention. It fails_with_clang. I have a bug report open with llvm about that.

@jacknagel
Copy link
Contributor

Getting late here, but ping me again tomorrow and I'll give it a proper review.

gettext = Formula.factory('gettext')
stagedir = Pathname.pwd # Keep track of where we are staged.
mkdir 'corebuild' # The formula needs corebuild to persist.
cd 'corebuild' # So please no do block.
Copy link
Contributor

Choose a reason for hiding this comment

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

The block form mkdir doesn't remove the directory when it returns, does it?

Copy link
Contributor

Choose a reason for hiding this comment

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

it sticks around; mktemp removes it.

@jacknagel
Copy link
Contributor

# http://trac.macports.org/ticket/20938#comment:22
if MacOS.leopard? or Hardware.is_32_bit?
inreplace 'cmake/admFFmpegBuild.cmake', '--enable-runtime-cpudetect --disable-network --disable-ffplay --disable-ffprobe --prefix=${CMAKE_INSTALL_PREFIX})',
'--enable-runtime-cpudetect --disable-network --disable-ffplay --disable-ffprobe --prefix=${CMAKE_INSTALL_PREFIX} --extra-cflags=-mdynamic-no-pic)'
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit, but can we shorten these lines up at all (without matching incorrect things, of course)?

@2bits
Copy link
Contributor Author

2bits commented Apr 7, 2012

@jacknagel The above commit bc30bda contains a patch I crafted to try to fix your build error on 32bit SL. Please try it when you have a few minutes.

@jacknagel
Copy link
Contributor

==> Summary
/usr/local/Cellar/avidemux/2.5.6: 325 files, 29M, built in 10.8 minutes

Builds fine, and the cli tool seems to work correctly.

@2bits
Copy link
Contributor Author

2bits commented Apr 8, 2012

Thanks I submitted a patch: http://www.avidemux.org/smf/index.php?topic=10526.0

@MikeMcQuaid
Copy link
Member

Thanks @2bits

@2bits
Copy link
Contributor Author

2bits commented Apr 22, 2012

I'm about to pass 11,500 views of my Howto build Avidemux using Homebrew on Snow Leopard or Lion. If you divide that by a conserative 10 for the people who go back to read it a few times while building it, still that's a good number of installs. It's probably better if the patch gets approved upstream before there's a pull. The two developers are busy working on the devel version, 2.6, for which I crafted a separate avidemux3.rb. I might add it as a devel block, but you'd laugh. It would look so gory.

@ghost ghost assigned adamv Apr 25, 2012
@adamv
Copy link
Contributor

adamv commented Apr 25, 2012

Taking at look at this probably this weekend, sorry for the delay. A quick test ran into the cmake 2.8.8/pkg-config issue that you've reported separately. Cmake 2.8.8 seems more buggy than 2.8.7.

@2bits
Copy link
Contributor Author

2bits commented Apr 25, 2012

Same issue here. I can't build avidemux stable or head atm because of the cmake-2.8.8 bug. Let's postpone the review for a week or two, and I'll research the various ways to fix this.

@MikeMcQuaid
Copy link
Member

The MySQL stuff isn't a CMake bug but an upstream one. Let's try and workaround this.

@2bits
Copy link
Contributor Author

2bits commented Apr 26, 2012

@MikeMcQuaid I'm confused. This is the error Adam and I get:

-- Check if the system is big endian - little endian

-- Checking for pkg-config
-- ***********************
-- Found PkgConfig: /usr/local/bin/pkg-config (found version "0.25") 
CMake Error at cmake/admCheckRequiredLibs.cmake:10 (MESSAGE):
  Could not find pkg-config
Call Stack (most recent call first):
  CMakeLists.txt:127 (INCLUDE)

@MikeMcQuaid
Copy link
Member

I'll have a look later.

@2bits
Copy link
Contributor Author

2bits commented Apr 26, 2012

Thanks. It worked until I installed cmake-2.8.8. So if you're busy, you can skip this, as I can patch this 2.5 branch like the developers patched the 2.6 branch. I was hoping you would patch CMake itself, though, because I can't figure how to make their git repo give me the diffs. I think @dlrdave just committed the pkg-config patch on GitHub today if that helps.

@MikeMcQuaid
Copy link
Member

Yeh, I'm hoping to patch CMake itself.



# Force llvm if clang on a normal build, fails_with_clang (being sovled).
ENV.llvm if ENV.compiler == :clang and not ARGV.include? '--with-debug'
Copy link
Contributor

Choose a reason for hiding this comment

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

This can be converted into a fails_with :clang now

@MikeMcQuaid
Copy link
Member

This looks like it is a avidemux CMake bug. Check on cmake/admCheckRequiredLibs.cmake:10 what variable it is checking for pkg-config to be found and compare that to the variables here: http://www.cmake.org/cmake/help/cmake-2-8-docs.html#module:FindPkgConfig (as I think they may have changed).

CMake 2.8.8 doesn't seem to be buggy as much as it has become stricter at matching behaviour to documentation.

Sorry, I would check this myself but currently don't have the bandwidth to download avidemux and all the dependencies :(

@MikeMcQuaid
Copy link
Member

Actually this could be a CMake issue.
@2bits try this patch (with --build-from-source obviously) and see if it fixes the issue: https://github.com/mikemcquaid/homebrew/commit/130f27

@2bits
Copy link
Contributor Author

2bits commented Apr 28, 2012

Thanks @MikeMcQuaid your patch mikemcquaid/homebrew@130f2729722de81432b9d8a4e4368cbe56c51fa6 works for both stable and head of avidemux. Even better is that it doesn't break the workaround they already applied upstream to Avidemux3. I'll go ahead and make the change to this formula that Jack pointed out about switching compilers.

@MikeMcQuaid
Copy link
Member

Pushed in d9764e1. We'll need a new bottle at some point for CMake.

@adamv adamv closed this in 2123f58 Apr 28, 2012
@MikeMcQuaid
Copy link
Member

Uploaded a new CMake bottle.

rohansingh pushed a commit to rohansingh/homebrew that referenced this pull request May 7, 2012
Avidemux is a popular video editor, actively developed since 2001.
Working with their lead engineer, the OSX code has been corrected,
and now the formula will build avidemux2_cli, the command line
version, with every video filter, encoder, and decoder available.

In addition, if the user has Qt installed, this will automatically
build the Qt gui, avidemux2.  Several weeks of work also gets us a
new CoreAudio output device for Qt, a feature missing since 2008.

Macports has a portfile for 2.5.3, a very buggy version.
The latest stable is 2.5.6. This formula will build stable or
2.5svn, which today is 2.5.6 r7750.

The 2.5 branch, called avidemux2, is being finalized.
The 2.6 branch, called avidemux3, is being very actively developed.

EDIT: removed patches merged upstream
EDIT: now compiles against r7668 on Lion.
EDIT: fixes indentation, removes some debug commands
EDIT: put two patches inline not on fileden
EDIT: remove patches merged upstream, inline variable 'a'
EDIT: add patch for ffmpeg compiling on 32bit OSX,
      switch url to 2.5.6 stable, add head (tested at r7724)
EDIT: remove dep on libvpx that fails with XCode-4.3.
EDIT: add back in the libvpx, it's fixed. Fix svn revision patch.
EDIT: Make svn rev patch apply only to head. Use cached_download
EDIT: Change head url to use http not svn.  Berlios svn offline.
EDIT: Install app to prefix not bin by Homebrew convention.
EDIT: Build verbose if brewed --with-debug.
EDIT: Fix optimization: O3 for regular, -g -O0 for clang debug,
      and -ggdb3 -O2 for llvm or gcc debug.
EDIT: shorten inreplaces, use buildpath, make test work w/head.
EDIT: remove cd, use mkdir do. use interpolated array style.
EDIT: Revert to allowing HB to use -Os.
EDIT: Add a patch for Jack's 32bit Snow Lep.

Closes Homebrew#8429.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
Sharpie pushed a commit to Sharpie/homebrew that referenced this pull request Sep 12, 2012
Avidemux is a popular video editor, actively developed since 2001.
Working with their lead engineer, the OSX code has been corrected,
and now the formula will build avidemux2_cli, the command line
version, with every video filter, encoder, and decoder available.

In addition, if the user has Qt installed, this will automatically
build the Qt gui, avidemux2.  Several weeks of work also gets us a
new CoreAudio output device for Qt, a feature missing since 2008.

Macports has a portfile for 2.5.3, a very buggy version.
The latest stable is 2.5.5, and that builds but has no OSX fixes.
All the work done with their devs is in svn on the 2.5 branch.
This formula will build 2.5svn, which today is 2.5.5 r7644.

The 2.5 branch, called avidemux2, is being finalized.
The 2.6 branch, called avidemux3, is being very actively developed.

EDIT: removed patches merged upstream
EDIT: now compiles against r7668 on Lion.
EDIT: fixes indentation, removes some debug commands
EDIT: put two patches inline not on fileden
EDIT: remove patches merged upstream, inline variable 'a'

Closes Homebrew#8429.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Sharpie pushed a commit to Sharpie/homebrew that referenced this pull request Sep 12, 2012
Avidemux is a popular video editor, actively developed since 2001.
Working with their lead engineer, the OSX code has been corrected,
and now the formula will build avidemux2_cli, the command line
version, with every video filter, encoder, and decoder available.

In addition, if the user has Qt installed, this will automatically
build the Qt gui, avidemux2.  Several weeks of work also gets us a
new CoreAudio output device for Qt, a feature missing since 2008.

Macports has a portfile for 2.5.3, a very buggy version.
The latest stable is 2.5.6. This formula will build stable or
2.5svn, which today is 2.5.6 r7750.

The 2.5 branch, called avidemux2, is being finalized.
The 2.6 branch, called avidemux3, is being very actively developed.

EDIT: removed patches merged upstream
EDIT: now compiles against r7668 on Lion.
EDIT: fixes indentation, removes some debug commands
EDIT: put two patches inline not on fileden
EDIT: remove patches merged upstream, inline variable 'a'
EDIT: add patch for ffmpeg compiling on 32bit OSX,
      switch url to 2.5.6 stable, add head (tested at r7724)
EDIT: remove dep on libvpx that fails with XCode-4.3.
EDIT: add back in the libvpx, it's fixed. Fix svn revision patch.
EDIT: Make svn rev patch apply only to head. Use cached_download
EDIT: Change head url to use http not svn.  Berlios svn offline.
EDIT: Install app to prefix not bin by Homebrew convention.
EDIT: Build verbose if brewed --with-debug.
EDIT: Fix optimization: O3 for regular, -g -O0 for clang debug,
      and -ggdb3 -O2 for llvm or gcc debug.
EDIT: shorten inreplaces, use buildpath, make test work w/head.
EDIT: remove cd, use mkdir do. use interpolated array style.
EDIT: Revert to allowing HB to use -Os.
EDIT: Add a patch for Jack's 32bit Snow Lep.

Closes Homebrew#8429.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
@ghost
Copy link

ghost commented Nov 23, 2012

I'm still getting this message every time "Error: No available formula for avidemux3"
I'm completely new to using terminal and I'm not sure what I'm doing wrong. I already used the guide on installing homebrew and everything went well.

@mistydemeo
Copy link
Member

@animedude3000 avidemux3 was never merged, I'm afraid. I don't remember if @2bits felt it was mature enough to submit.

@2bits
Copy link
Contributor Author

2bits commented Nov 23, 2012

I thought it would be rude to ask for avidemux and avidemux3, especially when the version numbers are 2.5 and 2.6 :-)

for avidemux 2.5svn

brew install --HEAD avidemux

for avidemux3, now at 2.6

brew install https://raw.github.com/2bits/homebrew/newAdm3/Library/Formula/avidemux3.rb

@ghost
Copy link

ghost commented Nov 24, 2012

Thanks!

snakeyroc3 pushed a commit to snakeyroc3/homebrew that referenced this pull request Dec 17, 2012
Avidemux is a popular video editor, actively developed since 2001.
Working with their lead engineer, the OSX code has been corrected,
and now the formula will build avidemux2_cli, the command line
version, with every video filter, encoder, and decoder available.

In addition, if the user has Qt installed, this will automatically
build the Qt gui, avidemux2.  Several weeks of work also gets us a
new CoreAudio output device for Qt, a feature missing since 2008.

Macports has a portfile for 2.5.3, a very buggy version.
The latest stable is 2.5.5, and that builds but has no OSX fixes.
All the work done with their devs is in svn on the 2.5 branch.
This formula will build 2.5svn, which today is 2.5.5 r7644.

The 2.5 branch, called avidemux2, is being finalized.
The 2.6 branch, called avidemux3, is being very actively developed.

EDIT: removed patches merged upstream
EDIT: now compiles against r7668 on Lion.
EDIT: fixes indentation, removes some debug commands
EDIT: put two patches inline not on fileden
EDIT: remove patches merged upstream, inline variable 'a'

Closes Homebrew#8429.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
snakeyroc3 pushed a commit to snakeyroc3/homebrew that referenced this pull request Dec 17, 2012
Avidemux is a popular video editor, actively developed since 2001.
Working with their lead engineer, the OSX code has been corrected,
and now the formula will build avidemux2_cli, the command line
version, with every video filter, encoder, and decoder available.

In addition, if the user has Qt installed, this will automatically
build the Qt gui, avidemux2.  Several weeks of work also gets us a
new CoreAudio output device for Qt, a feature missing since 2008.

Macports has a portfile for 2.5.3, a very buggy version.
The latest stable is 2.5.6. This formula will build stable or
2.5svn, which today is 2.5.6 r7750.

The 2.5 branch, called avidemux2, is being finalized.
The 2.6 branch, called avidemux3, is being very actively developed.

EDIT: removed patches merged upstream
EDIT: now compiles against r7668 on Lion.
EDIT: fixes indentation, removes some debug commands
EDIT: put two patches inline not on fileden
EDIT: remove patches merged upstream, inline variable 'a'
EDIT: add patch for ffmpeg compiling on 32bit OSX,
      switch url to 2.5.6 stable, add head (tested at r7724)
EDIT: remove dep on libvpx that fails with XCode-4.3.
EDIT: add back in the libvpx, it's fixed. Fix svn revision patch.
EDIT: Make svn rev patch apply only to head. Use cached_download
EDIT: Change head url to use http not svn.  Berlios svn offline.
EDIT: Install app to prefix not bin by Homebrew convention.
EDIT: Build verbose if brewed --with-debug.
EDIT: Fix optimization: O3 for regular, -g -O0 for clang debug,
      and -ggdb3 -O2 for llvm or gcc debug.
EDIT: shorten inreplaces, use buildpath, make test work w/head.
EDIT: remove cd, use mkdir do. use interpolated array style.
EDIT: Revert to allowing HB to use -Os.
EDIT: Add a patch for Jack's 32bit Snow Lep.

Closes Homebrew#8429.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
@Homebrew Homebrew locked and limited conversation to collaborators Feb 16, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants