2021-01-15 06:42:41 +01:00
|
|
|
{ lib, stdenv, fetchurl, dpkg, makeWrapper, buildFHSUserEnv
|
2020-10-25 20:38:25 +01:00
|
|
|
, gtk3, gdk-pixbuf, cairo, libjpeg_original, glib, pango, libGLU
|
2021-06-05 10:32:59 +02:00
|
|
|
, libGL, nvidia_cg_toolkit, zlib, openssl, libuuid , alsaLib, udev, libjack2
|
2017-05-06 14:55:13 +02:00
|
|
|
}:
|
|
|
|
let
|
2021-01-15 06:42:41 +01:00
|
|
|
fullPath = lib.makeLibraryPath [
|
2017-05-06 14:55:13 +02:00
|
|
|
stdenv.cc.cc
|
2019-03-09 12:41:12 +01:00
|
|
|
gtk3
|
2019-05-22 13:03:39 +02:00
|
|
|
gdk-pixbuf
|
2017-05-06 14:55:13 +02:00
|
|
|
cairo
|
|
|
|
libjpeg_original
|
|
|
|
glib
|
2020-10-25 20:38:25 +01:00
|
|
|
pango
|
2021-05-04 09:14:37 +02:00
|
|
|
libGL
|
2018-02-24 13:59:47 +01:00
|
|
|
libGLU
|
2017-05-06 14:55:13 +02:00
|
|
|
nvidia_cg_toolkit
|
|
|
|
zlib
|
|
|
|
openssl
|
2021-05-04 09:14:37 +02:00
|
|
|
libuuid
|
|
|
|
alsaLib
|
2021-06-05 10:32:59 +02:00
|
|
|
libjack2
|
2021-05-04 09:14:37 +02:00
|
|
|
udev
|
2017-05-06 14:55:13 +02:00
|
|
|
];
|
|
|
|
|
|
|
|
lightworks = stdenv.mkDerivation rec {
|
2021-05-26 11:23:44 +02:00
|
|
|
version = "2021.2.1";
|
|
|
|
rev = "128456";
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "lightworks";
|
2019-03-09 12:41:12 +01:00
|
|
|
|
2017-05-06 14:55:13 +02:00
|
|
|
src =
|
2018-08-20 21:11:29 +02:00
|
|
|
if stdenv.hostPlatform.system == "x86_64-linux" then
|
2017-05-06 14:55:13 +02:00
|
|
|
fetchurl {
|
2021-05-26 11:23:44 +02: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 14:55:13 +02:00
|
|
|
}
|
2019-08-15 14:41:18 +02:00
|
|
|
else throw "${pname}-${version} is not supported on ${stdenv.hostPlatform.system}";
|
2017-05-06 14:55:13 +02:00
|
|
|
|
2021-02-07 10:17:39 +01:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
buildInputs = [ dpkg ];
|
2017-05-06 14:55:13 +02: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'?>
|
2020-09-03 06:38:22 +02:00
|
|
|
<!DOCTYPE fontconfig SYSTEM 'urn:fontconfig:fonts.dtd'>
|
2017-05-06 14:55:13 +02: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 13:03:39 +02:00
|
|
|
|
2017-05-06 14:55:13 +02:00
|
|
|
cp -r usr/share $out/share
|
|
|
|
'';
|
|
|
|
|
|
|
|
dontPatchELF = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
# Lightworks expects some files in /usr/share/lightworks
|
2019-08-13 23:52:01 +02:00
|
|
|
in buildFHSUserEnv {
|
2018-05-28 14:59:57 +02:00
|
|
|
name = lightworks.name;
|
2017-05-06 14:55:13 +02:00
|
|
|
|
|
|
|
targetPkgs = pkgs: [
|
|
|
|
lightworks
|
|
|
|
];
|
|
|
|
|
|
|
|
runScript = "lightworks";
|
2020-04-12 17:29:30 +02:00
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Professional Non-Linear Video Editor";
|
|
|
|
homepage = "https://www.lwks.com/";
|
2021-01-15 06:42:41 +01:00
|
|
|
license = lib.licenses.unfree;
|
2021-05-04 09:14:45 +02:00
|
|
|
maintainers = with lib.maintainers; [ antonxy vojta001 ];
|
2020-04-12 17:29:30 +02:00
|
|
|
platforms = [ "x86_64-linux" ];
|
|
|
|
};
|
2017-05-06 14:55:13 +02:00
|
|
|
}
|