Giter VIP home page Giter VIP logo

Comments (18)

athas avatar athas commented on June 16, 2024 2

komposition is now in Homebrew

from komposition.

athas avatar athas commented on June 16, 2024 1

Yes, that's the one.

from komposition.

owickstrom avatar owickstrom commented on June 16, 2024

Indeed, it would be awesome! I haven't written such formulas before, but maybe someone with experience would like to help. Could be done from precompiled binaries from CI.

from komposition.

2mol avatar 2mol commented on June 16, 2024

I've done it before, the base case is very easy. You basically create a generic repo that contains homebrew formulas that look like this: https://github.com/2mol/homebrew-tools/blob/master/pboy.rb.

In your case installation would then be brew install owickstrom/tools/komposition ("tools" can also be something else of your choosing).

Two things for your case that I see as potential roadblocks:

  1. From CI like you said won't work, since you point to a download URL in the homebrew formula. I see you don't have releases yet.
  2. I'd check how to get the dependencies defined properly, especially if passing the flag in gst-plugins-good --with-gtk+3 works out of the box. Similar with exporting PKG_CONFIG_PATH from within the formula. The stack install happy might be even a bigger problem.

from komposition.

owickstrom avatar owickstrom commented on June 16, 2024

@2mol Thank for the feedback!

  1. I was thinking of setting up releases, or maybe an S3 bucket for those binaries, that the Homebrew script could download. Having the Homebrew formula compile from source seems like a bigger rabbit hole. With Homebrew, I suppose the executable would be dynamically linked, and not be a package including any other libraries, because Homebrew would supply the .dylibs through depends_on rules. Do you know if Homebrew sets up something like DYLD_LIBRARY_PATH such that libraries are found automatically, or do we need to mess around with rpaths?

  2. If we don't compile from source in the formula, as mentioned above, those things shouldn't be problems. Only the runtime libraries will be needed (GTK, Gstreamer + plugins, FFmpeg, and maybe something else). But as you say, somehow passing the --with-gtk+3 would still be needed.

from komposition.

athas avatar athas commented on June 16, 2024

I have written a Homebrew formula that seems to work fine:

require "language/haskell"

class Komposition < Formula
  include Language::Haskell::Cabal

  desc "Video editor built for screencasters"
  homepage "https://github.com/owickstrom/komposition"
#  url "https://github.com/owickstrom/komposition/archive/.tar.gz"
#  sha256 ""
  head "https://github.com/owickstrom/komposition.git"

  depends_on "cabal-install" => :build
  depends_on "ffmpeg"
  depends_on "ghc" => :build
  depends_on "gobject-introspection"
  depends_on "gst-libav"
  depends_on "gst-plugins-base"
  depends_on "gst-plugins-good"
  depends_on "gstreamer"
  depends_on "gtk+3"
  depends_on "gstreamer"
  depends_on "libffi"
  depends_on "pkg-config" => :build
  depends_on "sox"

  def install
    # The --allow-newer-base may be removed if the ffmpeg-light bound
    # is relaxed, or when Homebrew moves to Cabal 3 builds.
    install_cabal_package "--allow-newer=base", :using => ["alex", "happy"]
  end

  test do

  end
end

The missing points are:

  1. Komposition must have a release tagged before this formula will be accepted in Homebrew-core. This is just a matter of tagging some commit vX.Y.Z and doesn't have to imply anything about stability or release announcements or whatnot. GitHub will generate the tarball and such. The nice thing is that as subsequent tags are made, there's tooling to update the formula as well.

  2. I'm not sure what the test block should contain. Homebrew insists on something more than running --version, but can komposition do anything interesting on the command line? Maybe I should read up on how Homebrew normally handles GUI applications.

  3. Some of the dependencies may in fact just be build dependencies.

from komposition.

athas avatar athas commented on June 16, 2024

Note that if the formula gets put in Homebrew-core, they will take care of all the bottling and updates.

from komposition.

owickstrom avatar owickstrom commented on June 16, 2024

Regarding (2), I previously had a command line tool for splitting up videos, but it's no longer part of the codebase, IIRC. If you find some guidelines for GUI apps, that would be nice.

from komposition.

athas avatar athas commented on June 16, 2024

All I can find is this:

If the formula is for a GUI program, try to find some function that runs as command-line only, like a format conversion, reading or displaying a config file, etc.

However, I also find:

foo --version and foo --help are bad tests. However, a bad test is better than no test at all.

So I don't think it's a deal-breaker.

from komposition.

owickstrom avatar owickstrom commented on June 16, 2024

Sounds OK, then. 👍

from komposition.

athas avatar athas commented on June 16, 2024

I'll still need you to tag a release before I can move this further.

from komposition.

owickstrom avatar owickstrom commented on June 16, 2024

Of course, here it is: https://github.com/owickstrom/komposition/releases/tag/v0.2.0

from komposition.

athas avatar athas commented on June 16, 2024

Thanks! I'll submit a Homebrew formula soon-ish, and then we'll see what they say.

from komposition.

owickstrom avatar owickstrom commented on June 16, 2024

@athas Great, thanks!

from komposition.

owickstrom avatar owickstrom commented on June 16, 2024

Awesome work, @athas !

from komposition.

owickstrom avatar owickstrom commented on June 16, 2024

The nice thing is that as subsequent tags are made, there's tooling to update the formula as well.

@athas how do we publish new versions in the future?

from komposition.

athas avatar athas commented on June 16, 2024

@owickstrom you just tag another release on GitHub. The formula must be updated, which you or I or someone else can submit a pull request for, but there are a bunch of people running scripts that look for new versions, so it usually happens automatically within a day or so. Those scripts just bump the tarball and hash though, so manual modification may be necessary if more non-Haskell dependencies are added.

from komposition.

owickstrom avatar owickstrom commented on June 16, 2024

Sounds good. And I suppose it's this file: https://github.com/Homebrew/homebrew-core/blob/7557e86f658cc3ae4abe627b92919538388c098d/Formula/komposition.rb ?

from komposition.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.