@@ -1,10 +1,10 @@
1−{ stdenv, requireFile, dpkg, makeWrapper, gcc, libGLU_combined, xdg_utils,
1+{ stdenv, fetchurl, dpkg, makeWrapper, gcc, libGLU_combined, xdg_utils,
22 dbus_tools, alsaLib, cups, fontconfig, glib, icu, libpng12,
3− xkeyboard_config, gstreamer, zlib, libxslt, libxml2, sqlite, orc,
3+ xkeyboard_config, zlib, libxslt, libxml2, sqlite, orc,
44 libX11, libXcursor, libXrandr, libxcb, libXi, libSM, libICE,
55 libXrender, libXcomposite }:
66
7−let version = "2017-SP2"; in
7+let version = "2018SP2"; in
88stdenv.mkDerivation {
99 name = "draftsight-${version}";
1010
@@ -31,7 +31,7 @@ stdenv.mkDerivation {
3131 $out/bin/$exe \
3232 --prefix "QT_XKB_CONFIG_ROOT" ":" "${xkeyboard_config}/share/X11/xkb"
3333 done
34− for lib in $out/draftsight/opt/dassault-systemes/DraftSight/Libraries/*.so; do
34+ for lib in $out/draftsight/opt/dassault-systemes/DraftSight/Libraries/*.so*; do
3535 # DraftSight ships with broken symlinks for some reason
3636 if [ -f $(readlink -f $lib) ]
3737 then
@@ -41,6 +41,19 @@ stdenv.mkDerivation {
4141 echo "Ignoring broken link $lib"
4242 fi
4343 done
44+ for lib in $out/draftsight/opt/dassault-systemes/DraftSight/APISDK/lib/cpp/*.so*; do
45+ if [ -f $(readlink $lib) ]
46+ then
47+ echo "Patching $lib..."
48+ chmod u+w $lib
49+ patchelf --set-rpath $libPath:\$ORIGIN/../Libraries $lib
50+ else
51+ echo "Ignoring broken link $lib"
52+ fi
53+ done
54+ # These libraries shouldn't really be here anyway:
55+ find $out/draftsight/opt/dassault-systemes/DraftSight/APISDK/Samples/C++ \
56+ -type d -name _lib | xargs rm -r
4457 '';
4558
4659 # TODO: Figure out why HelpGuide segfaults at startup.
@@ -51,15 +64,15 @@ stdenv.mkDerivation {
5164 # that it dlopen()'s libraries in paths removed by shrinking RPATH.
5265 dontPatchELF = true;
5366
54− src = requireFile {
67+ src = fetchurl {
5568 name = "draftSight.deb";
56− url = "https://www.3ds.com/?eID=3ds_brand_download&uid=41&pidDown=13426&L=0";
57− sha256 = "04i3dqza6y4p2059pqg5inp3qzr5jmiqplzzk7h1a6gh380v1rbr";
69+ url = "http://dl-ak.solidworks.com/nonsecure/draftsight/${version}/draftSight.deb";
70+ sha256 = "05lrvml0zkzqg0sj6sj2h8h66hxdmsw5fg9fwz923r1y8j48qxdx";
5871 };
5972
6073 libPath = stdenv.lib.makeLibraryPath [ gcc.cc libGLU_combined xdg_utils
6174 dbus_tools alsaLib cups.lib fontconfig glib icu libpng12
62− xkeyboard_config gstreamer zlib libxslt libxml2 sqlite orc libX11
75+ xkeyboard_config zlib libxslt libxml2 sqlite orc libX11
6376 libXcursor libXrandr libxcb libXi libSM libICE libXrender
6477 libXcomposite ];
6578