2023-04-29 16:46:19 +00:00
|
|
|
{ lib, stdenv, fetchurl, dpkg, makeWrapper, buildFHSEnv
|
2020-10-27 00:29:36 +00:00
|
|
|
, gtk3, gdk-pixbuf, cairo, libjpeg_original, glib, pango, libGLU
|
2021-06-28 23:13:55 +00:00
|
|
|
, libGL, nvidia_cg_toolkit, zlib, openssl, libuuid , alsa-lib, udev, libjack2
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
let
|
2021-01-15 22:18:51 +00:00
|
|
|
fullPath = lib.makeLibraryPath [
|
2020-04-24 23:36:52 +00:00
|
|
|
stdenv.cc.cc
|
|
|
|
gtk3
|
|
|
|
gdk-pixbuf
|
|
|
|
cairo
|
|
|
|
libjpeg_original
|
|
|
|
glib
|
2020-10-27 00:29:36 +00:00
|
|
|
pango
|
2021-06-06 07:54:09 +00:00
|
|
|
libGL
|
2020-04-24 23:36:52 +00:00
|
|
|
libGLU
|
|
|
|
nvidia_cg_toolkit
|
|
|
|
zlib
|
|
|
|
openssl
|
2021-06-06 07:54:09 +00:00
|
|
|
libuuid
|
2021-06-28 23:13:55 +00:00
|
|
|
alsa-lib
|
2021-06-06 07:54:09 +00:00
|
|
|
libjack2
|
|
|
|
udev
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
lightworks = stdenv.mkDerivation rec {
|
2022-04-27 09:35:20 +00:00
|
|
|
version = "2022.1.1";
|
|
|
|
rev = "132926";
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "lightworks";
|
|
|
|
|
|
|
|
src =
|
|
|
|
if stdenv.hostPlatform.system == "x86_64-linux" then
|
|
|
|
fetchurl {
|
2022-04-27 09:35:20 +00:00
|
|
|
url = "https://cdn.lwks.com/releases/${version}/lightworks_${version}_r${rev}.deb";
|
|
|
|
sha256 = "sha256-f2lxfv0sFESpDnINDKlfVcR0pySAueMeOMbkgBWzz7Q=";
|
2020-04-24 23:36:52 +00:00
|
|
|
}
|
|
|
|
else throw "${pname}-${version} is not supported on ${stdenv.hostPlatform.system}";
|
|
|
|
|
2021-03-09 03:18:52 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
buildInputs = [ dpkg ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
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'?>
|
2020-09-25 04:45:31 +00:00
|
|
|
<!DOCTYPE fontconfig SYSTEM 'urn:fontconfig:fonts.dtd'>
|
2020-04-24 23:36:52 +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
|
|
|
|
|
|
|
|
cp -r usr/share $out/share
|
|
|
|
'';
|
|
|
|
|
|
|
|
dontPatchELF = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
# Lightworks expects some files in /usr/share/lightworks
|
2023-04-29 16:46:19 +00:00
|
|
|
in buildFHSEnv {
|
2020-04-24 23:36:52 +00:00
|
|
|
name = lightworks.name;
|
|
|
|
|
|
|
|
targetPkgs = pkgs: [
|
|
|
|
lightworks
|
|
|
|
];
|
|
|
|
|
|
|
|
runScript = "lightworks";
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Professional Non-Linear Video Editor";
|
|
|
|
homepage = "https://www.lwks.com/";
|
2022-06-26 10:26:21 +00:00
|
|
|
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
|
2021-01-15 22:18:51 +00:00
|
|
|
license = lib.licenses.unfree;
|
2021-06-06 07:54:09 +00:00
|
|
|
maintainers = with lib.maintainers; [ antonxy vojta001 ];
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = [ "x86_64-linux" ];
|
|
|
|
};
|
|
|
|
}
|