Merge pull request #41190 from puffnfresh/package/obs-linuxbrowser

obs-linuxbrowser: init at 0.3.1
This commit is contained in:
Matthew Justin Bauer 2018-06-06 21:24:03 -04:00 committed by GitHub
commit dc82e3efc5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 97 additions and 0 deletions

View File

@ -0,0 +1,48 @@
# We don't have a wrapper which can supply obs-studio plugins so you have to
# somewhat manually install this:
# nix-env -f . -iA obs-linuxbrowser
# mkdir -p ~/.config/obs-studio/plugins
# ln -s ~/.nix-profile/share/obs/obs-plugins/obs-linuxbrowser ~/.config/obs-studio/plugins/
{ stdenv, fetchFromGitHub, obs-studio, cmake, libcef
}:
stdenv.mkDerivation rec {
name = "obs-linuxbrowser-${version}";
version = "0.3.1";
src = fetchFromGitHub {
owner = "bazukas";
repo = "obs-linuxbrowser";
rev = version;
sha256 = "0dql7wxyhksqa08j1dn5d09v2jwhgywc1p7psifhhvh97rkp4z7j";
};
nativeBuildInputs = [ cmake ];
buildInputs = [ obs-studio ];
postUnpack = ''
mkdir -p cef/Release cef/Resources cef/libcef_dll_wrapper/
for i in ${libcef}/share/cef/*; do
ln -s $i cef/Release/
ln -s $i cef/Resources/
done
ln -s ${libcef}/lib/libcef.so cef/Release/
ln -s ${libcef}/lib/libcef_dll_wrapper.a cef/libcef_dll_wrapper/
ln -s ${libcef}/include cef/
'';
cmakeFlags = [
"-DCEF_DIR=../../cef"
"-DOBS_INCLUDE=${obs-studio}/include/obs"
];
installPhase = ''
mkdir -p $out/share/obs/obs-plugins
cp -r build/obs-linuxbrowser $out/share/obs/obs-plugins/
'';
meta = with stdenv.lib; {
description = "Browser source plugin for obs-studio based on Chromium Embedded Framework";
homepage = https://github.com/bazukas/obs-linuxbrowser;
maintainers = with maintainers; [ puffnfresh ];
license = licenses.gpl2;
platforms = with platforms; linux;
};
}

View File

@ -0,0 +1,45 @@
{ stdenv, fetchurl, cmake, alsaLib, atk, cairo, cups, dbus, expat, fontconfig
, GConf, gdk_pixbuf, glib, gtk2, libX11, libxcb, libXcomposite, libXcursor
, libXdamage, libXext, libXfixes, libXi, libXrandr, libXrender, libXScrnSaver
, libXtst, nspr, nss, pango, libpulseaudio, systemd }:
let
libPath =
stdenv.lib.makeLibraryPath [
alsaLib atk cairo cups dbus expat fontconfig GConf gdk_pixbuf glib gtk2
libX11 libxcb libXcomposite libXcursor libXdamage libXext libXfixes libXi
libXrandr libXrender libXScrnSaver libXtst nspr nss pango libpulseaudio
systemd
];
in
stdenv.mkDerivation rec {
name = "cef-binary-${version}";
# Not very recent but more recent versions have problems:
# https://github.com/bazukas/obs-linuxbrowser/issues/63
version = "3.3325.1750.gaabe4c4";
src = fetchurl {
url = "http://opensource.spotify.com/cefbuilds/cef_binary_${version}_linux64.tar.bz2";
sha256 = "06pj1ci1lwammz1vwmbgw2fri7gkvbpv4iw67pqckd9xz0cfhwzr";
};
nativeBuildInputs = [ cmake ];
makeFlags = "libcef_dll_wrapper";
dontStrip = true;
dontPatchELF = true;
installPhase = ''
mkdir -p $out/lib/ $out/share/cef/
cp libcef_dll_wrapper/libcef_dll_wrapper.a $out/lib/
cp ../Release/libcef.so $out/lib/
patchelf --set-rpath "${libPath}" $out/lib/libcef.so
cp ../Release/*.bin $out/share/cef/
cp -r ../Resources/* $out/share/cef/
cp -r ../include $out/
'';
meta = with stdenv.lib; {
description = "Simple framework for embedding Chromium-based browsers in other applications";
homepage = http://opensource.spotify.com/cefbuilds/index.html;
maintainers = with maintainers; [ puffnfresh ];
license = licenses.bsd3;
platforms = with platforms; linux;
};
}

View File

@ -9798,6 +9798,8 @@ with pkgs;
libcec = callPackage ../development/libraries/libcec { };
libcec_platform = callPackage ../development/libraries/libcec/platform.nix { };
libcef = callPackage ../development/libraries/libcef { inherit (gnome2) GConf; };
libcello = callPackage ../development/libraries/libcello {};
libcerf = callPackage ../development/libraries/libcerf {};
@ -17270,6 +17272,8 @@ with pkgs;
oblogout = callPackage ../tools/X11/oblogout { };
obs-linuxbrowser = callPackage ../applications/video/obs-studio/linuxbrowser.nix { };
obs-studio = libsForQt5.callPackage ../applications/video/obs-studio {
alsaSupport = stdenv.isLinux;
pulseaudioSupport = config.pulseaudio or true;