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

draftsight: 2018SP2 -> 2019SP0 #65065

Closed
wants to merge 2 commits into from

Conversation

r-ryantm
Copy link
Contributor

Semi-automatic update generated by https://github.com/ryantm/nixpkgs-update tools. This update was made based on information from https://repology.org/metapackage/draftsight/versions.

meta.description for draftsight is: '"2D design & drafting application, meant to be similar to AutoCAD"'.

meta.homepage for draftsight is: '"https://www.3ds.com/products-services/draftsight-cad-software/"

Checks done (click to expand)
Rebuild report (if merged into master) (click to expand)

1 total rebuild path(s)

1 package rebuild(s)

1 x86_64-linux rebuild(s)
0 i686-linux rebuild(s)
0 x86_64-darwin rebuild(s)
0 aarch64-linux rebuild(s)

First fifty rebuilds by attrpath
draftsight

Instructions to test this update (click to expand)

Either download from Cachix:

nix-store -r /nix/store/piwhbaa0f565milf6kmm917amsjmm9yf-draftsight-2019SP0 \
  --option binary-caches 'https://cache.nixos.org/ https://r-ryantm.cachix.org/' \
  --option trusted-public-keys '
  r-ryantm.cachix.org-1:gkUbLkouDAyvBdpBX0JOdIiD2/DP1ldF3Z3Y6Gqcc4c=
  cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
  '

(r-ryantm's Cachix cache is only trusted for this store-path realization.)

Or, build yourself:

nix-build -A draftsight https://github.com/r-ryantm/nixpkgs/archive/f389d2b0a1ecfd3b616a05abb55a566bb3676bd6.tar.gz

After you've downloaded or built it, look at the files and if there are any, run the binaries:

ls -la /nix/store/piwhbaa0f565milf6kmm917amsjmm9yf-draftsight-2019SP0
ls -la /nix/store/piwhbaa0f565milf6kmm917amsjmm9yf-draftsight-2019SP0/bin

cc @Hodapp87 for testing.

Semi-automatic update generated by
https://github.com/ryantm/nixpkgs-update tools. This update was made
based on information from
https://repology.org/metapackage/draftsight/versions
@mmahut
Copy link
Member

mmahut commented Aug 10, 2019

@worldofpeace can you please assist with this package? It fails with following:

This application failed to start because it could not find or load the Qt platform plugin "xcb"
in "".

I did try to wrap it around with QT_PLUGIN_PATH and moving it to LibsForQT5's mkDerivation, but I cannot make it work. Do you mind looking at it?

@worldofpeace
Copy link
Contributor

That's weird. I don't see it using anything qt related anywhere in the expression.
Then I noticed that it bundles everything lots of things, included qt libraries and that includes its plugins.

The reason wrapping had no effect is because it's already wrapped and wrapQtAppsHook ignores this.

So to fix this we should probably

  • use qt5's mkDerivation
  • drop manual wrapping in installPhase (note the symlinks to bin still need to be made)
  • add the args makeWrapper was already given to qtWrapperArgs

Then you have to set qtPluginPrefix to the appropriate directories in the output.
I think that's

  • draftsight/opt/dassault-systemes/DraftSight/PlugIns/QtPlugIns

cc @Hodapp87

@mmahut
Copy link
Member

mmahut commented Oct 4, 2019

ping @Hodapp87 do you mind looking at this?

@Hodapp87
Copy link
Contributor

Hodapp87 commented Oct 4, 2019

@mmahut I am going to look at it a little today as time permits

@Hodapp87
Copy link
Contributor

Hodapp87 commented Oct 4, 2019

@worldofpeace I am trying to follow your directions here, but I am still stuck at:

[nix-shell:~]$ DraftSight 
terminate called after throwing an instance of 'std::runtime_error'
  what():  This application failed to start because it could not find or load the Qt platform plugin "xcb"
in "".

Available platform plugins are: linuxfb, minimal, offscreen, vnc, xcb.

Reinstalling the application may fix this problem.
Aborted

Below is the patch for what I'm trying from draftsight-update/auto-update/draftsight:

diff --git a/pkgs/applications/graphics/draftsight/default.nix b/pkgs/applications/graphics/draftsight/default.nix
index 0314168431a..3e500b28000 100644
--- a/pkgs/applications/graphics/draftsight/default.nix
+++ b/pkgs/applications/graphics/draftsight/default.nix
@@ -27,9 +27,7 @@ stdenv.mkDerivation {
       patchelf --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
                --set-rpath $libPath:\$ORIGIN/../Libraries \
                $out/draftsight/opt/dassault-systemes/DraftSight/Linux/$exe
-      makeWrapper $out/draftsight/opt/dassault-systemes/DraftSight/Linux/$exe \
-          $out/bin/$exe \
-          --prefix "QT_XKB_CONFIG_ROOT" ":" "${xkeyboard_config}/share/X11/xkb"
+      ln -s $out/draftsight/opt/dassault-systemes/DraftSight/Linux/$exe $out/bin/$exe
     done
     for lib in $out/draftsight/opt/dassault-systemes/DraftSight/Libraries/*.so*; do
       # DraftSight ships with broken symlinks for some reason
@@ -55,6 +53,8 @@ stdenv.mkDerivation {
     find $out/draftsight/opt/dassault-systemes/DraftSight/APISDK/Samples/C++ \
          -type d -name _lib | xargs rm -r
   '';
+  qtWrapperArgs = [ "--prefix" "QT_XKB_CONFIG_ROOT" ":" "${xkeyboard_config}/share/X11/xkb" ];
+  qtPluginPrefix = "$out/draftsight/opt/dassault-systemes/DraftSight/PlugIns/QtPlugIns";
 
   # TODO: Figure out why HelpGuide segfaults at startup.
 
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index f642f9e1832..5b8ce6df559 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -17459,7 +17459,7 @@ in
 
   dr14_tmeter = callPackage ../applications/audio/dr14_tmeter { };
 
-  draftsight = callPackage ../applications/graphics/draftsight { };
+  draftsight = qt5.callPackage ../applications/graphics/draftsight { };
 
   dragonfly-reverb = callPackage ../applications/audio/dragonfly-reverb { };
 

@worldofpeace
Copy link
Contributor

worldofpeace commented Oct 5, 2019

qtWrapperArgs needs to be one string.

- "--prefix" "QT_XKB_CONFIG_ROOT" ":" "${xkeyboard_config}/share/X11/xkb"
+ "--prefix QT_XKB_CONFIG_ROOT : ${xkeyboard_config}/share/X11/xkb"

and I think you should be using libsForQt5.callPackage

- draftsight = qt5.callPackage ../applications/graphics/draftsight { };
+ draftsight = libsForQt5.callPackage ../applications/graphics/draftsight { };

Can you also check if the executable at $out/bin is a script and not a wrapper?

Also, there was a regression on 19.09 and master recently that prevent wrapGAppsHook from following symlinks and wrapping the binaries. 15e99a0
Do you have ^ commit in your branch? (i.e rebase?)

@Hodapp87
Copy link
Contributor

Hodapp87 commented Oct 5, 2019

I'm now at the below diff and having the same errors. The hash was identical, so I don't think it changed anything. $out/bin/DraftSight is just a symlink to the binary draftsight/opt/dassault-systemes/DraftSight/Linux/DraftSight (it's not a script).

draftsight-update/auto-update/draftsight was branched awhile ago, so I don't expect that the most recent regression is in it.

diff --git a/pkgs/applications/graphics/draftsight/default.nix b/pkgs/applications/graphics/draftsight/default.nix
index 0314168431a..e9f2e0be189 100644
--- a/pkgs/applications/graphics/draftsight/default.nix
+++ b/pkgs/applications/graphics/draftsight/default.nix
@@ -27,9 +27,7 @@ stdenv.mkDerivation {
       patchelf --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
                --set-rpath $libPath:\$ORIGIN/../Libraries \
                $out/draftsight/opt/dassault-systemes/DraftSight/Linux/$exe
-      makeWrapper $out/draftsight/opt/dassault-systemes/DraftSight/Linux/$exe \
-          $out/bin/$exe \
-          --prefix "QT_XKB_CONFIG_ROOT" ":" "${xkeyboard_config}/share/X11/xkb"
+      ln -s $out/draftsight/opt/dassault-systemes/DraftSight/Linux/$exe $out/bin/$exe
     done
     for lib in $out/draftsight/opt/dassault-systemes/DraftSight/Libraries/*.so*; do
       # DraftSight ships with broken symlinks for some reason
@@ -55,6 +53,8 @@ stdenv.mkDerivation {
     find $out/draftsight/opt/dassault-systemes/DraftSight/APISDK/Samples/C++ \
          -type d -name _lib | xargs rm -r
   '';
+  qtWrapperArgs = [ "--prefix QT_XKB_CONFIG_ROOT : ${xkeyboard_config}/share/X11/xkb" ];
+  qtPluginPrefix = "$out/draftsight/opt/dassault-systemes/DraftSight/PlugIns/QtPlugIns";
 
   # TODO: Figure out why HelpGuide segfaults at startup.
 
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index f642f9e1832..2f7d8b26475 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -17459,7 +17459,7 @@ in
 
   dr14_tmeter = callPackage ../applications/audio/dr14_tmeter { };
 
-  draftsight = callPackage ../applications/graphics/draftsight { };
+  draftsight = libsForQt5.callPackage ../applications/graphics/draftsight { };
 
   dragonfly-reverb = callPackage ../applications/audio/dragonfly-reverb { };

@bennofs
Copy link
Contributor

bennofs commented Jan 20, 2020

@Hodapp87 what's the status of this PR? Does it make sense to keep this open?

@Hodapp87
Copy link
Contributor

@bennofs I'm still stuck at trying to follow what @worldofpeace said. I'm guessing DraftSight has seen updates since then, but the issue here probably persists.

@r-ryantm r-ryantm closed this Jun 11, 2020
@r-ryantm r-ryantm deleted the auto-update/draftsight branch June 11, 2020 04:54
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

5 participants