nixpkgs/pkgs/applications/video/lightworks/default.nix

94 lines
2.5 KiB
Nix
Raw Normal View History

2021-01-15 05:42:41 +00:00
{ lib, stdenv, fetchurl, dpkg, makeWrapper, buildFHSUserEnv
2020-10-25 19:38:25 +00:00
, gtk3, gdk-pixbuf, cairo, libjpeg_original, glib, pango, libGLU
, libGL, nvidia_cg_toolkit, zlib, openssl, libuuid , alsa-lib, udev, libjack2
2017-05-06 12:55:13 +00:00
}:
let
2021-01-15 05:42:41 +00:00
fullPath = lib.makeLibraryPath [
2017-05-06 12:55:13 +00:00
stdenv.cc.cc
gtk3
2019-05-22 11:03:39 +00:00
gdk-pixbuf
2017-05-06 12:55:13 +00:00
cairo
libjpeg_original
glib
2020-10-25 19:38:25 +00:00
pango
2021-05-04 07:14:37 +00:00
libGL
libGLU
2017-05-06 12:55:13 +00:00
nvidia_cg_toolkit
zlib
openssl
2021-05-04 07:14:37 +00:00
libuuid
alsa-lib
2021-06-05 08:32:59 +00:00
libjack2
2021-05-04 07:14:37 +00:00
udev
2017-05-06 12:55:13 +00:00
];
lightworks = stdenv.mkDerivation rec {
2021-05-26 09:23:44 +00:00
version = "2021.2.1";
rev = "128456";
pname = "lightworks";
2017-05-06 12:55:13 +00:00
src =
if stdenv.hostPlatform.system == "x86_64-linux" then
2017-05-06 12:55:13 +00:00
fetchurl {
2021-05-26 09:23:44 +00:00
url = "https://cdn.lwks.com/releases/${version}/lightworks_${lib.versions.majorMinor version}_r${rev}.deb";
sha256 = "sha256-GkTg43IUF1NgEm/wT9CZw68Dw/R2BYBU/F4bsCxQowQ=";
2017-05-06 12:55:13 +00:00
}
else throw "${pname}-${version} is not supported on ${stdenv.hostPlatform.system}";
2017-05-06 12:55:13 +00:00
nativeBuildInputs = [ makeWrapper ];
buildInputs = [ dpkg ];
2017-05-06 12:55:13 +00:00
phases = [ "unpackPhase" "installPhase" ];
unpackPhase = "dpkg-deb -x ${src} ./";
installPhase = ''
mkdir -p $out/bin
substitute usr/bin/lightworks $out/bin/lightworks \
--replace "/usr/lib/lightworks" "$out/lib/lightworks"
chmod +x $out/bin/lightworks
cp -r usr/lib $out
# /usr/share/fonts is not normally searched
# This adds it to lightworks' search path while keeping the default
# using the FONTCONFIG_FILE env variable
echo "<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'urn:fontconfig:fonts.dtd'>
2017-05-06 12:55:13 +00:00
<fontconfig>
<dir>/usr/share/fonts/truetype</dir>
<include>/etc/fonts/fonts.conf</include>
</fontconfig>" > $out/lib/lightworks/fonts.conf
patchelf \
--interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
$out/lib/lightworks/ntcardvt
wrapProgram $out/lib/lightworks/ntcardvt \
--prefix LD_LIBRARY_PATH : ${fullPath}:$out/lib/lightworks \
--set FONTCONFIG_FILE $out/lib/lightworks/fonts.conf
2019-05-22 11:03:39 +00:00
2017-05-06 12:55:13 +00:00
cp -r usr/share $out/share
'';
dontPatchELF = true;
};
# Lightworks expects some files in /usr/share/lightworks
2019-08-13 21:52:01 +00:00
in buildFHSUserEnv {
2018-05-28 12:59:57 +00:00
name = lightworks.name;
2017-05-06 12:55:13 +00:00
targetPkgs = pkgs: [
lightworks
];
runScript = "lightworks";
meta = {
description = "Professional Non-Linear Video Editor";
homepage = "https://www.lwks.com/";
2021-01-15 05:42:41 +00:00
license = lib.licenses.unfree;
2021-05-04 07:14:45 +00:00
maintainers = with lib.maintainers; [ antonxy vojta001 ];
platforms = [ "x86_64-linux" ];
};
2017-05-06 12:55:13 +00:00
}