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

89 lines
2.4 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
2017-05-06 13:55:13 +01:00
, nvidia_cg_toolkit, zlib, openssl, portaudio
}:
let
2021-01-15 05:42:41 +00:00
fullPath = lib.makeLibraryPath [
2017-05-06 13:55:13 +01:00
stdenv.cc.cc
gtk3
2019-05-22 12:03:39 +01:00
gdk-pixbuf
2017-05-06 13:55:13 +01:00
cairo
libjpeg_original
glib
2020-10-25 19:38:25 +00:00
pango
libGLU
2017-05-06 13:55:13 +01:00
nvidia_cg_toolkit
zlib
openssl
portaudio
];
lightworks = stdenv.mkDerivation rec {
version = "14.0.0";
pname = "lightworks";
2017-05-06 13:55:13 +01:00
src =
if stdenv.hostPlatform.system == "x86_64-linux" then
2017-05-06 13:55:13 +01:00
fetchurl {
url = "http://downloads.lwks.com/v14/lwks-14.0.0-amd64.deb";
sha256 = "66eb9f9678d979db76199f1c99a71df0ddc017bb47dfda976b508849ab305033";
}
else throw "${pname}-${version} is not supported on ${stdenv.hostPlatform.system}";
2017-05-06 13:55:13 +01:00
nativeBuildInputs = [ makeWrapper ];
buildInputs = [ dpkg ];
2017-05-06 13:55:13 +01: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 13:55:13 +01: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 12:03:39 +01:00
2017-05-06 13:55:13 +01:00
cp -r usr/share $out/share
'';
dontPatchELF = true;
};
# Lightworks expects some files in /usr/share/lightworks
2019-08-13 22:52:01 +01:00
in buildFHSUserEnv {
2018-05-28 13:59:57 +01:00
name = lightworks.name;
2017-05-06 13:55:13 +01: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;
maintainers = [ lib.maintainers.antonxy ];
platforms = [ "x86_64-linux" ];
};
2017-05-06 13:55:13 +01:00
}