about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAnton Schirg <anton.schirg@posteo.de>2017-05-06 14:55:13 +0200
committerAnton Schirg <anton.schirg@posteo.de>2017-05-08 23:03:39 +0200
commit7a9efec8edd064dec5fbd08bb3fa358a4844d746 (patch)
treedfb415cdb50be4b92b35dbb7ae5daeaf42f9ffd4
parenta4a63800c858767971b696a856f1565807862f8a (diff)
downloadnixlib-7a9efec8edd064dec5fbd08bb3fa358a4844d746.tar
nixlib-7a9efec8edd064dec5fbd08bb3fa358a4844d746.tar.gz
nixlib-7a9efec8edd064dec5fbd08bb3fa358a4844d746.tar.bz2
nixlib-7a9efec8edd064dec5fbd08bb3fa358a4844d746.tar.lz
nixlib-7a9efec8edd064dec5fbd08bb3fa358a4844d746.tar.xz
nixlib-7a9efec8edd064dec5fbd08bb3fa358a4844d746.tar.zst
nixlib-7a9efec8edd064dec5fbd08bb3fa358a4844d746.zip
lightworks: init at 14.0.0
-rw-r--r--lib/maintainers.nix1
-rw-r--r--pkgs/applications/video/lightworks/default.nix87
-rw-r--r--pkgs/top-level/all-packages.nix2
3 files changed, 90 insertions, 0 deletions
diff --git a/lib/maintainers.nix b/lib/maintainers.nix
index ee0697ed6e42..72090dbdc4af 100644
--- a/lib/maintainers.nix
+++ b/lib/maintainers.nix
@@ -43,6 +43,7 @@
   andsild = "Anders Sildnes <andsild@gmail.com>";
   aneeshusa = "Aneesh Agrawal <aneeshusa@gmail.com>";
   antono = "Antono Vasiljev <self@antono.info>";
+  antonxy = "Anton Schirg <anton.schirg@posteo.de>";
   apeschar = "Albert Peschar <albert@peschar.net>";
   apeyroux = "Alexandre Peyroux <alex@px.io>";
   ardumont = "Antoine R. Dumont <eniotna.t@gmail.com>";
diff --git a/pkgs/applications/video/lightworks/default.nix b/pkgs/applications/video/lightworks/default.nix
new file mode 100644
index 000000000000..9c6a49c55136
--- /dev/null
+++ b/pkgs/applications/video/lightworks/default.nix
@@ -0,0 +1,87 @@
+{ stdenv, fetchurl, dpkg, makeWrapper, patchelf, buildFHSUserEnv
+, gtk3, gnome3, gdk_pixbuf, cairo, libjpeg_original, glib, gnome2, mesa_glu
+, nvidia_cg_toolkit, zlib, openssl, portaudio
+}:
+let
+  fullPath = stdenv.lib.makeLibraryPath [
+    stdenv.cc.cc
+    gnome3.gtk
+    gdk_pixbuf
+    cairo
+    libjpeg_original
+    glib
+    gnome2.pango
+    mesa_glu
+    nvidia_cg_toolkit
+    zlib
+    openssl
+    portaudio
+  ];
+
+  lightworks = stdenv.mkDerivation rec {
+    version = "14.0.0";
+    name = "lightworks-${version}";
+    
+    src =
+      if stdenv.system == "x86_64-linux" then
+        fetchurl {
+          url = "http://downloads.lwks.com/v14/lwks-14.0.0-amd64.deb";
+          sha256 = "66eb9f9678d979db76199f1c99a71df0ddc017bb47dfda976b508849ab305033";
+        }
+      else throw "${name} is not supported on ${stdenv.system}";
+
+    buildInputs = [ dpkg makeWrapper ];
+
+    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 'fonts.dtd'>
+      <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;
+
+    meta = {
+      description = "Professional Non-Linear Video Editor";
+      homepage = "https://www.lwks.com/";
+      license = stdenv.lib.licenses.unfree;
+      maintainers = [ stdenv.lib.maintainers.antonxy ];
+      platforms = [ "x86_64-linux" ];
+    };
+  };
+
+# Lightworks expects some files in /usr/share/lightworks
+in buildFHSUserEnv rec {
+  name = "lightworks";
+
+  targetPkgs = pkgs: [
+      lightworks
+  ];
+
+  runScript = "lightworks";
+}
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 944db15e148a..508eb96b15a9 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -14611,6 +14611,8 @@ with pkgs;
     inherit (gnome3) libpeas gsettings_desktop_schemas dconf;
   };
 
+  lightworks = callPackage ../applications/video/lightworks { };
+
   lingot = callPackage ../applications/audio/lingot {
     inherit (gnome2) libglade;
   };