Skip to content

Instantly share code, notes, and snippets.

@aleb aleb/pitivi.rb
Last active Nov 8, 2019

What would you like to do?
Homebrew formula for building Pitivi
class Pitivi < Formula
# Required to create a virtualenv with Matplotlib.
include Language::Python::Virtualenv
desc "Powerful and easy to use video editor"
homepage ""
url ""
sha256 "cb6f8a831383e698c2117ca7caec77b8167a6b2e2b0fb9c375e6a4f7c815b757"
head do
url "", :branch => "1.0"
# Required because we use 'msgfmt' in
depends_on "gettext" => :build
# Required because we use 'intltool-merge' in
depends_on "intltool" => :build
# Required because we use 'itstool' in
depends_on "itstool" => :build
# Pitivi's build system.
depends_on "meson-internal" => :build
# Mesonbuild's backend.
depends_on "ninja" => :build
# Required by gst-transcoder.
depends_on "libffi"
# Required because Pitivi is written in Python3. :)
depends_on "python"
# Required because without this installing pygobject3 fails with:
# Error: /usr/local/opt/py3cairo not present or broken
# Please reinstall py3cairo. Sorry :(
depends_on "py3cairo"
depends_on "pygobject3"
# Provides the GTK+ UI.
depends_on "gtk+3"
# Allows our SVG icons to be loaded.
depends_on "librsvg"
# Provides the GTK icons.
depends_on "adwaita-icon-theme"
# Provides gi.repository.Notify.
depends_on "libnotify"
# Required for building pitivi/coptimizations/renderer.c
depends_on "py3cairo"
# Required to be able to use GStreamer in Python.
depends_on "gst-python"
depends_on "gst-plugins-base" => ["with-libogg", # For the Ogg muxer.
"with-opus", # For the Opus audio codec.
"with-libvorbis", # For the Vorbis audio codec.
"with-theora"] # For the Theora video codec.
depends_on "gst-plugins-good" => ["with-gdk-pixbuf", # Required by the previewers.
"with-gtk+3", # For the video output sink (gstgtk).
"with-libpng", # For PNG images.
"with-libvpx"] # For the VP8 codec.
depends_on "gst-plugins-bad" => ["with-libvo-aacenc"] # For the AAC audio codec
depends_on "gst-plugins-ugly" => ["with-lame", # For the mp3 audio codec.
"with-x264"] # For the x264 video codec.
# Provides the video editing functionality.
depends_on "gst-editing-services"
# Additional codecs through the GStreamer Libav library backed by FFmpeg.
depends_on "gst-libav" => :recommended
# Matplotlib is used for drawing the keyframe lines.
depends_on "numpy"
resource "Cycler" do
url ""
sha256 "cd7b2d1018258d7247a71425e9f26463dfb444d411c39569972f4ce586b0c9d8"
resource "kiwisolver" do
url ""
sha256 "ce3be5d520b4d2c3e5eeb4cd2ef62b9b9ab8ac6b6fedbaa0e39cdb6f50644278"
resource "matplotlib" do
url ""
sha256 "7355bf757ecacd5f0ac9dd9523c8e1a1103faadf8d33c22664178e17533f8ce5"
resource "pyparsing" do
url ""
sha256 "0832bcf47acd283788593e7a0f542407bd9550a55a8a8435214a1960e04bcb04"
resource "python-dateutil" do
url ""
sha256 "e27001de32f627c22380a688bcc43ce83504a7bc5da472209b4c70f02829f0b8"
resource "pytz" do
url ""
sha256 "ffb9ef1de172603304d9d2819af6f5ece76f2e85ec10692a524dd876e72bf277"
resource "six" do
url ""
sha256 "70e8a77beed4562e7f14fe23a786b54f6296e34344c23bc42f07b15018ff98e9"
# Required to be able to run the tests in tests/
depends_on "gst-validate" => :test
def install
# According to
venv = virtualenv_create(libexec, "python3")
venv.pip_install resources
# We have everything and we don't need a PYTHONPATH.
mkdir "build" do
system "meson", "--prefix=#{prefix}", ".."
system "ninja"
system "ninja", "install"
mv "#{lib}/pitivi/python/pitivi/timeline/renderer.dylib", "#{lib}/pitivi/python/pitivi/timeline/"
xy = Language::Python.major_minor_version "python3"
inreplace bin/"pitivi",
"CONFIGURED_PYTHONPATH = '#{libexec}/lib/python#{xy}/site-packages'"
# Install also the tests, to be able to run them in the test method below.
(pkgshare/"pitivi-tests").install "tests"
(pkgshare/"pitivi-tests").install "data"
inreplace pkgshare/"pitivi-tests/tests/",
"return os.path.abspath(pitivi_dir)",
"return '#{lib}/pitivi/python'"
test do
File.exist? bin/"pitivi"
system Formula["gstreamer"].opt_bin/"gst-inspect-1.0", "gtksink"
xy = Language::Python.major_minor_version "python3"
ENV.prepend_create_path "PYTHONPATH", "#{libexec}/lib/python#{xy}/site-packages"
ENV.prepend_create_path "PYTHONPATH", lib/"pitivi/python"
cd pkgshare/"pitivi-tests" do
system "gst-validate-launcher", "tests/"

This comment has been minimized.

Copy link

rnkn commented Jan 30, 2019

This installed successfully, but upon launching pitivi I got:

Python(9820,0x10fd0b5c0) malloc: *** error for object 0x7f87efa36c18: pointer being freed was not allocated
Python(9820,0x10fd0b5c0) malloc: *** set a breakpoint in malloc_error_break to debug
Abort trap: 6

This comment has been minimized.

Copy link

Murazaki commented Nov 8, 2019

Hello @aleb,
Pitivi docs recommends to use brew aleb/gui/pitivi to get it on Mac, however there is no such repo on your github.
Has the process changed lately ?


This comment has been minimized.

Copy link
Owner Author

aleb commented Nov 8, 2019

Sorry, I should update the page. Homebrew is not actually good for this because they focus on supporting old Macs, and we don't care about that because we don't even have the time for supporting the latest.

In you can see the discussion about using Cerbero to build Pitivi for Mac. This was being worked on in by @sprhawk. Then once Pitivi runs with no major issues on Mac we have to see how to package it in a DMG.

If you can help with any of that, or are interested in testing, drop us a line how to reach you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.