Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lightworks: init at 14.0.0 #25552

Merged
merged 2 commits into from
Nov 5, 2017
Merged

lightworks: init at 14.0.0 #25552

merged 2 commits into from
Nov 5, 2017

Conversation

antonxy
Copy link
Contributor

@antonxy antonxy commented May 6, 2017

Motivation for this change

add Lightworks (Commercial Video Editor)

Things done
  • Tested using sandboxing
    (nix.useSandbox on NixOS,
    or option build-use-sandbox in nix.conf
    on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • Linux
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

This is my first PR so please let me know if anything does not fit.
Especially: Is it ok to add --enable-cxx in portaudio? According to nox-review 40 packages are affected

@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
buildInputs = [ pkgconfig ]
++ stdenv.lib.optional (!stdenv.isDarwin) alsaLib;

configureFlags = [ "--disable-mac-universal" ];
configureFlags = [ "--disable-mac-universal --enable-cxx" ];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change should go in a separate commit.

@@ -0,0 +1,90 @@
{ stdenv, fetchurl, dpkg, makeWrapper, patchelf, buildFHSUserEnv,
gtk3, gnome3, gdk_pixbuf, cairo, libjpeg_original, glib, gnome2, mesa_glu, nvidia_cg_toolkit, zlib, openssl, portaudio }:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please break overlong lines (>80 chars) like this:

{ stdenv ...
, gtk3 ...
}:

Note the placement of comma.


cp -r usr/lib $out

# /usr/share/fonts is not normally searched
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing indentation.

@antonxy
Copy link
Contributor Author

antonxy commented May 6, 2017

Thanks for the review, should be fixed

--set FONTCONFIG_FILE $out/lib/lightworks/fonts.conf

wrapProgram $out/lib/lightworks/spawn \
--prefix LD_LIBRARY_PATH : ${fullPath}:$out/lib/lightworks
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this wrapper can be replaced by using the rpath option of patchelf:

 patchelf \
    --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
    --set-rpath "$out/lib/lightworks:${fullPath}" \
    $out/lib/lightworks/spawn

<include>/etc/fonts/fonts.conf</include>
</fontconfig>" > $out/lib/lightworks/fonts.conf

${patchelf}/bin/patchelf \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can just use patchelf directly as it is in the search path of stdenv

installPhase = ''
mkdir -p $out/bin
cp usr/bin/lightworks $out/bin
sed -i "s|/usr/lib/lightworks|$out/lib/lightworks|g" $out/bin/lightworks
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cp usr/bin/lightworks $out/bin
sed -i "s|/usr/lib/lightworks|$out/lib/lightworks|g" $out/bin/lightworks

can be replaced by a single:

substitute usr/bin/lightworks $out/bin/lightworks \
   --replace "/usr/lib/lightworks" "$out/lib/lightworks" 

@antonxy
Copy link
Contributor Author

antonxy commented May 8, 2017

Thanks, I updated that.
The --set-rpath option did not seem to work, the program did not find the libraries in the $out/lib/lightworks folder.
But I noticed that the spawn binary is not used anyway, so I removed it (it spawns ntcardvt and displays a loading bar, but the lightworks script in bin calls ntcardvt directly).

@7c6f434c
Copy link
Member

7c6f434c commented Nov 4, 2017

@GrahamcOfBorg sample 3

@7c6f434c 7c6f434c merged commit 7be7698 into NixOS:master Nov 5, 2017
@rfhayashi
Copy link

@antonxy, I'm getting /nix/store/z68sscqishcgpag75y8l0n0bi8ghcfk9-lightworks-14.0.0/lib/lightworks/ntcardvt: /nix/store/fapd1dnr70w57sd7lp5zzmzml6km9037-openssl-1.0.2n/lib/libcrypto.so.1.0.0: no version information available (required by /nix/store/z68sscqishcgpag75y8l0n0bi8ghcfk9-lightworks-14.0.0/lib/lightworks/libOSPrivate.so) when running lightworks using this package. Do you know how to fix it? Let me know if I should report that somewhere else.

@antonxy
Copy link
Contributor Author

antonxy commented Jan 11, 2018

Hm, I can reproduce the crash. It does not crash on the last commit before the merge, but crashes on the commit of the merge. But the "no version information available" message also appears on the working build so that does not seem to be the issue.

strace -f -s 900 lightworks outputs somwhere near the crash

write(2, "/nix/store/gbdjahb5rwbl45a18xpqrq6z83c4zhgh-lightworks-14.0.0/lib/lightworks/ntcardvt: symbol lookup error: /nix/store/gbdjahb5rwbl45a18xpqrq6z83c4zhgh-lightworks-14.0.0/lib/lightworks/PortAudio.lwd: undefined symbol: _ZN9portaudio6System14DeviceIteratorneERKS1_\n", 263) = 263

so it seems there has been some change in portaudio causing this.

Indeed if I override portaudio with the version from the working commit lightworks starts again.

The reason seems to be that System::DeviceIterator::operator!= ( System::DeviceIterator const& rhs ) was made const.

https://abi-laboratory.pro/tracker/compat_report/portaudio/19_20140130/190600_20161030/b4bea/abi_compat_report.html

The best solution I can think of would be to create a new package of portaudio for the old version and use that until a newer version of lightworks is released which will hopefully use the new version of portaudio. I will prepare a pull request for that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants