nokangaroo |
12-27-2013 01:43 PM |
Building avidemux-2.6.7 in Mac OS X Snow Leopard using Macports
How to build avidemux-2.6.7 in Mac OS X Snow Leopard using MacPorts
1. Uninstall any previous versions of avidemux and upgrade:
Code:
sudo port uninstall avidemux
sudo port selfupdate
sudo port upgrade outdated
2. Create local port repository:
Code:
sudo mkdir -p /Users/ports/multimedia/avidemux
sudo chown -R <yourusername>:staff /Users/ports
3. Edit /opt/local/etc/macports/sources.conf:
Code:
file:///Users/ports
rsync://rsync.macports.org/release/tarballs/ports.tar [default]
4. copy and modify the files:
Code:
cp /opt/local/var/macports/sources/rsync.macports.org/release/tarballs/ports/multimedia/avidemux/Portfile /Users/ports/multimedia/avidemux
cp -R /opt/local/var/macports/sources/rsync.macports.org/release/tarballs/ports/multimedia/avidemux/files /Users/ports/multimedia/avidemux
Modify the Portfile:
Code:
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
# $Id: Portfile 112717 2013-10-29 22:34:02Z devans@macports.org $
PortSystem 1.0
PortGroup cmake 1.0
PortGroup app 1.0
name avidemux
version 2.6.7
revision 1
categories multimedia
platforms macosx
license GPL-2
maintainers nomaintainer
homepage http://avidemux.sourceforge.net/
description Avidemux is a free video editor.
long_description Avidemux is a free video editor designed for simple cutting, \
filtering and encoding tasks. It supports many file types, \
including AVI, DVD compatible MPEG files, MP4 and ASF, using \
a variety of codecs. Tasks can be automated using projects, \
job queue and powerful scripting capabilities.
master_sites sourceforge:project/avidemux/avidemux/${version}
distname avidemux_${version}
checksums rmd160 42080542aea07f91aa3e867f1c87b89dd6017910 \
sha256 d28202273d23be85c748c12d6e4df5e013bb861ea52b9bac7e0f90ba3d23249f
patchfiles patch-cmake-ffmpeg_make.sh.cmake.diff \
myOwnMenu.h.diff
depends_build-append port:pkgconfig \
port:yasm
depends_lib-append port:qt4-mac
default_variants +aac +gettext +lame +sqlite +twolame +x264
# no automatic configure step, everything is done inside build
use_configure no
# only build with one job (otherwise it fails in avidemux_core)
use_parallel_build no
configure.args-append -DCMAKE_C_COMPILER=${configure.cc} \
-DCMAKE_C_FLAGS=${configure.cflags} \
-DCMAKE_CXX_COMPILER=${configure.cxx} \
-DCMAKE_CXX_FLAGS=${configure.cxxflags} \
-DFAKEROOT=${workpath}/destroot \
-DAVIDEMUX_SOURCE_DIR=${worksrcpath} \
-G \"Unix Makefiles\"
# some default settings
configure.args-append -DSDL=OFF \
-DGTK=OFF -DQT4=ON
# disable all options, enable them in variants
configure.args-append -DFONTCONFIG=OFF -DFREETYPE2=OFF \
-DFRIDIBI=OFF \
-DGETTEXT=OFF \
-DALSA=OFF \
-DARTS=OFF \
-DESD=OFF \
-DJACK=OFF \
-DOSS=OFF \
-DPULSEAUDIOSIMPLE=OFF \
-DAFTEN=OFF \
-DDCAENC=OFF -DLIBDCA=OFF \
-DFAAC=OFF -DFAAD=OFF \
-DLAME=OFF \
-DLIBVORBIS=OFF -DVORBIS=OFF \
-DOPENCORE_AMRNB=OFF -DOPENCORE_AMRWB=OFF \
-DTWOLAME=OFF \
-DVPXDEC=OFF \
-DX264=OFF \
-DXVID=OFF
build {
# mimic bootStrap.bash Process() behaviour
proc process {work src module build extra} {
# make build dir
file mkdir ${work}/${build}
# configure
configure.post_args ${extra} ${src}/${module}
configure.dir ${work}/${build}
command_exec configure
# build
build.dir ${work}/${build}
command_exec build
# install to destroot
destroot.dir ${work}/${build}
command_exec destroot
}
# build avidemux core
process ${workpath} ${worksrcpath} avidemux_core build_core ""
# build avidemux GTK UI
#process ${workpath} ${worksrcpath} avidemux/gtk build_gtk "-DCMAKE_EXE_LINKER_FLAGS=-Wl,-framework,Cocoa"
# build avidemux QT UI
process ${workpath} ${worksrcpath} avidemux/qt4 build_qt4 ""
# build avidemux cli UI
process ${workpath} ${worksrcpath} avidemux/cli build_cli ""
# build common plugins
process ${workpath} ${worksrcpath} avidemux_plugins build_pluginsCommon "-DPLUGIN_UI=COMMON -DCMAKE_CXX_COMPILER=${configure.cxx}"
# build gtk plugins
#process ${workpath} ${worksrcpath} avidemux_plugins build_pluginsGtk "-DPLUGIN_UI=GTK"
# build QT plugins
process ${workpath} ${worksrcpath} avidemux_plugins build_pluginsQt4 "-DPLUGIN_UI=QT4"
# build cli plugins
process ${workpath} ${worksrcpath} avidemux_plugins build_pluginsCli "-DPLUGIN_UI=CLI"
}
# destroot is handled by build
destroot {}
variant aac description {Support for faac/faad audio codecs} {
depends_lib-append port:faac
depends_lib-append port:faad2
configure.args-strsed s/-DFAAC=OFF/-DFAAC=ON/
configure.args-strsed s/-DFAAD=OFF/-DFAAD=ON/
}
variant amr description {Support for AMR speech audio codec} {
depends_lib-append port:opencore-amr
configure.args-strsed s/-DOPENCORE_AMRNB=OFF/-DOPENCORE_AMRNB=ON/
configure.args-strsed s/-DOPENCORE_AMRWB=OFF/-DOPENCORE_AMRWB=ON/
}
variant dts description {Support for DTS (libdca) audio codec} {
depends_lib-append port:libdca
configure.args-strsed s/-DDCAENC=OFF/-DDCAENC=ON/
configure.args-strsed s/-DLIBDCA=OFF/-DLIBDCA=ON/
}
variant esound description {Support for ESD audio device} {
depends_lib-append port:esound
configure.args-strsed s/-DESD=OFF/-DESD=ON/
}
variant fribidi description {Support for FriBidi} {
depends_lib-append port:fribidi
configure.args-strsed s/-DFRIDIBI=OFF/-DFRIDIBI=ON/
}
variant gettext description {Support for gettext} {
depends_lib-append port:gettext
configure.args-strsed s/-DGETTEXT=OFF/-DGETTEXT=ON/
}
variant jack description {Support for Jack audio device} {
depends_lib-append port:jack
configure.args-strsed s/-DJACK=OFF/-DJACK=ON/
}
variant lame description {Support for LAME audio codec} {
depends_lib-append port:lame
configure.args-strsed s/-DLAME=OFF/-DLAME=ON/
}
variant sqlite description {Support for SQLite3} {
depends_lib-append port:sqlite3
}
variant truetype description {Support for FreeType2} {
depends_lib-append port:freetype
depends_lib-append port:fontconfig
configure.args-strsed s/-DFREETYPE2=OFF/-DFREETYPE2=ON/
configure.args-strsed s/-DFONTCONFIG=OFF/-DFONTCONFIG=ON/
}
variant twolame description {Support for TwoLAME audio codec} {
depends_lib-append port:twolame
configure.args-strsed s/-DTWOLAME=OFF/-DTWOLAME=ON/
}
variant vorbis description {Support for Vorbis audio codec} {
depends_lib-append port:libvorbis
configure.args-strsed s/-DVORBIS=OFF/-DVORBIS=ON/
configure.args-strsed s/-DLIBVORBIS=OFF/-DLIBVORBIS=ON/
}
variant vpx description {Support for VP8 video codec} {
depends_lib-append port:libvpx
configure.args-strsed s/-DVPXDEC=OFF/-DVPXDEC=ON/
}
variant x264 description {Support for x264 video codec} {
depends_lib-append port:x264
configure.args-strsed s/-DX264=OFF/-DX264=ON/
}
variant xvid description {Support for XviD MPEG-4 video codec} {
depends_lib-append port:XviD
configure.args-strsed s/-DXVID=OFF/-DXVID=ON/
}
# .app stuff
app.name Avidemux-2.6.7
app.executable avidemux
app.icon avidemux_icon.png
Note that I added a patch that changes some shortcuts in order to be able to copy timestamps out of avidemux without excessive right-clicking. If you don't want that, delete the reference to myOwnMenu.h.diff in the "patchfiles" section. If you want the patch, paste the following into /Users/ports/multimedia/avidemux/files/myOwnMenu.h.diff:
myOwnMenu.h.diff:
Code:
--- avidemux/common/ADM_commonUI/myOwnMenu.h.orig 2013-05-01 12:28:17.000000000 +0200
+++ avidemux/common/ADM_commonUI/myOwnMenu.h 2013-12-27 01:03:43.000000000 +0100
@@ -33,7 +33,7 @@
#ifdef MENU_DECLARE
static const MenuEntry _myMenuFile[] = {
{MENU_ACTION,QT_TRANSLATE_NOOP("adm","Open"), NULL,ACT_OPEN_VIDEO, MKICON(fileopen), "Ctrl+O"},
- {MENU_ACTION,QT_TRANSLATE_NOOP("adm","Append"), NULL,ACT_APPEND_VIDEO ,NULL, "Ctrl+A"},
+ {MENU_ACTION,QT_TRANSLATE_NOOP("adm","Append"), NULL,ACT_APPEND_VIDEO ,NULL, "Shift+Ctrl+A"},
{MENU_ACTION,QT_TRANSLATE_NOOP("adm","Save"), NULL,ACT_SAVE_VIDEO ,MKICON(filesaveas),"Ctrl+S"},
{MENU_ACTION,QT_TRANSLATE_NOOP("adm","Queue"), NULL,ACT_SAVE_QUEUE ,NULL ,"Ctrl+U"},
{MENU_SUBMENU,QT_TRANSLATE_NOOP("adm","Save as Image"), NULL,ACT_DUMMY ,NULL,NULL},
@@ -53,10 +53,10 @@
static const MenuEntry _myMenuEdit[] = {
{MENU_ACTION,QT_TRANSLATE_NOOP("adm","Undo"), NULL,ACT_Undo ,NULL,"Ctrl+Z"},
{MENU_ACTION,QT_TRANSLATE_NOOP("adm","Reset Edit"), NULL,ACT_ResetSegments,NULL,NULL},
- {MENU_ACTION,QT_TRANSLATE_NOOP("adm","Cut"), NULL,ACT_Cut ,NULL,"Ctrl+X"},
- {MENU_ACTION,QT_TRANSLATE_NOOP("adm","Copy"), NULL,ACT_Copy ,NULL,"Ctrl+C"},
- {MENU_ACTION,QT_TRANSLATE_NOOP("adm","Paste"), NULL,ACT_Paste ,NULL,"Ctrl+V"},
- {MENU_ACTION,QT_TRANSLATE_NOOP("adm","Delete"), NULL,ACT_Delete ,NULL,"Delete"},
+ {MENU_ACTION,QT_TRANSLATE_NOOP("adm","Cut"), NULL,ACT_Cut ,NULL,"Shift+Ctrl+X"},
+ {MENU_ACTION,QT_TRANSLATE_NOOP("adm","Copy"), NULL,ACT_Copy ,NULL,"Shift+Ctrl+C"},
+ {MENU_ACTION,QT_TRANSLATE_NOOP("adm","Paste"), NULL,ACT_Paste ,NULL,"Shift+Ctrl+V"},
+ {MENU_ACTION,QT_TRANSLATE_NOOP("adm","Delete"), NULL,ACT_Delete ,NULL,"Ctrl+D"},
{MENU_SEPARATOR,"-",NULL,ACT_DUMMY ,NULL,NULL},
{MENU_ACTION,QT_TRANSLATE_NOOP("adm","Set Marker A"),NULL,ACT_MarkA ,NULL,"["},
{MENU_ACTION,QT_TRANSLATE_NOOP("adm","Set Marker B"),NULL,ACT_MarkB ,NULL,"]"},
5. Activate the repository:
Code:
cd /Users/ports
portindex
This will deactivate (but not delete) your existing port; it is possible to rename the local repository, but then fetching may not work; download avidemux_2.6.7.tar.gz manually and put it in /opt/local/var/macports/distfiles/<avidemux-renamed>.
6. Install:
Code:
sudo port -v install avidemux
7. Replace the link in /Applications/MacPorts/Avidemux-2.6.7.app/Contents/MacOS with an executable file that says:
Code:
#!/bin/sh
/opt/local/bin/avidemux
This will open avidemux correctly, with plugins and without a green Terminal.
|