Advertisement
Guest User

Untitled

a guest
Apr 26th, 2017
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.32 KB | None | 0 0
  1. { stdenv, fetchurl, dpkg, makeWrapper, patchelf,
  2. gtk3, gnome3, gdk_pixbuf, cairo, libjpeg }:
  3. let
  4. fullPath = stdenv.lib.makeLibraryPath [
  5. stdenv.cc.cc
  6. gnome3.gtk
  7. gdk_pixbuf
  8. cairo
  9. libjpeg
  10. ];
  11. in
  12. stdenv.mkDerivation rec {
  13. version = "14.0.0";
  14. name = "lightworks-${version}";
  15.  
  16. src =
  17. if stdenv.system == "x86_64-linux" then
  18. fetchurl {
  19. url = "http://downloads.lwks.com/v14/lwks-14.0.0-amd64.deb";
  20. sha256 = "66eb9f9678d979db76199f1c99a71df0ddc017bb47dfda976b508849ab305033";
  21. }
  22. else throw "${name} is not supported on ${stdenv.system}";
  23.  
  24. buildInputs = [ dpkg makeWrapper ];
  25.  
  26. phases = [ "unpackPhase" "installPhase" ];
  27. unpackPhase = "dpkg-deb -x ${src} ./";
  28.  
  29. installPhase = ''
  30. mkdir -p $out/bin
  31. cp usr/bin/lightworks $out/bin
  32. sed -i "s|/usr/lib/lightworks|$out/lib/lightworks|g" $out/bin/lightworks
  33.  
  34. cp -r usr/lib $out
  35.  
  36. echo "${fullPath}" > $out/fullpath
  37.  
  38. ${patchelf}/bin/patchelf \
  39. --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
  40. --set-rpath "${fullPath}:\$ORIGIN" \
  41. $out/lib/lightworks/ntcardvt
  42.  
  43. ${patchelf}/bin/patchelf \
  44. --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
  45. --set-rpath "${fullPath}:\$ORIGIN" \
  46. $out/lib/lightworks/spawn
  47.  
  48. cp -r usr/share $out/share
  49. '';
  50.  
  51. dontPatchELF = true;
  52.  
  53. meta = {
  54. description = "Lightworks Video Editor";
  55. homepage = "https://www.lwks.com/";
  56. license = stdenv.lib.licenses.unfree;
  57. };
  58. }
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66. ldd result/lib/lightworks/ntcardvt
  67. linux-vdso.so.1 (0x00007fff64f47000)
  68. ...
  69. libm.so.6 => /nix/store/78w6a8zinhp7awdmrh5qbvxyci2pb8b4-glibc-2.25/lib/libm.so.6 (0x00007fee31721000)
  70. libOSPrivate.so => not found
  71. libgtk-3.so.0 => not found
  72. libgdk-3.so.0 => not found
  73.  
  74.  
  75. Content of fullPath which goes in rpath:
  76. /nix/store/av675477wjr9hipa4mi0h44hpkihmdk2-gcc-5.4.0-lib/lib:/nix/store/m81sajnj84r3ciq4nkh2xvqncv92nm73-gtk+3-3.22.12/lib:/nix/store/7p7xgwgylaq6ck1ifwj1y372kchmjqiy-gdk-pixbuf-2.36.6/lib:/nix/store/axvlnhh23w7iqnqn36xg6igwjllijx6v-cairo-1.14.8/lib:/nix/store/4rvvsdvnl4cwjw7nhs4krr21n48wg355-libjpeg-turbo-1.5.1/lib
  77.  
  78. ls /nix/store/m81sajnj84r3ciq4nkh2xvqncv92nm73-gtk+3-3.22.12/lib/libgtk-3.so.0
  79. /nix/store/m81sajnj84r3ciq4nkh2xvqncv92nm73-gtk+3-3.22.12/lib/libgtk-3.so.0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement