about summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorThomas Tuegel <ttuegel@mailbox.org>2017-03-29 07:36:52 -0500
committerThomas Tuegel <ttuegel@mailbox.org>2017-03-29 07:36:52 -0500
commit8ff4c7957a7624283884d6633715b78fea9cf8a0 (patch)
tree8f9e279fdbcd3699008193333cace89ab83ef2a5 /pkgs
parent72bb7b399ad4a4d6105cfa17f692ea69c2628bee (diff)
parent97518649fbd567a12a4cd54a10380fc45f3359be (diff)
downloadnixlib-8ff4c7957a7624283884d6633715b78fea9cf8a0.tar
nixlib-8ff4c7957a7624283884d6633715b78fea9cf8a0.tar.gz
nixlib-8ff4c7957a7624283884d6633715b78fea9cf8a0.tar.bz2
nixlib-8ff4c7957a7624283884d6633715b78fea9cf8a0.tar.lz
nixlib-8ff4c7957a7624283884d6633715b78fea9cf8a0.tar.xz
nixlib-8ff4c7957a7624283884d6633715b78fea9cf8a0.tar.zst
nixlib-8ff4c7957a7624283884d6633715b78fea9cf8a0.zip
Merge branch 'dropbox--xkbcommon'
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/applications/networking/dropbox/default.nix43
-rw-r--r--pkgs/top-level/all-packages.nix2
2 files changed, 17 insertions, 28 deletions
diff --git a/pkgs/applications/networking/dropbox/default.nix b/pkgs/applications/networking/dropbox/default.nix
index 028ca2e73977..097ff84a7046 100644
--- a/pkgs/applications/networking/dropbox/default.nix
+++ b/pkgs/applications/networking/dropbox/default.nix
@@ -3,6 +3,7 @@
 , libdrm, libffi, libICE, libSM
 , libX11, libXcomposite, libXext, libXmu, libXrender, libxcb
 , libxml2, libxslt, ncurses, zlib
+, qtbase, qtdeclarative, qtwebkit, makeQtWrapper
 }:
 
 # this package contains the daemon version of dropbox
@@ -43,6 +44,8 @@ let
       dbus_libs fontconfig freetype gcc.cc glib libdrm libffi libICE libSM
       libX11 libXcomposite libXext libXmu libXrender libxcb libxml2 libxslt
       ncurses zlib
+
+      qtbase qtdeclarative qtwebkit
     ];
 
   desktopItem = makeDesktopItem {
@@ -65,21 +68,24 @@ in stdenv.mkDerivation {
 
   sourceRoot = ".dropbox-dist";
 
-  nativeBuildInputs = [ makeWrapper patchelf ];
-  dontPatchELF = true; # patchelf invoked explicitly below
+  nativeBuildInputs = [ makeQtWrapper patchelf ];
   dontStrip = true; # already done
 
   installPhase = ''
-    runHook preInstall
-
     mkdir -p "$out/${appdir}"
     cp -r --no-preserve=mode "dropbox-lnx.${arch}-${version}"/* "$out/${appdir}/"
 
+    # Vendored libraries interact poorly with our graphics drivers
     rm "$out/${appdir}/libdrm.so.2"
     rm "$out/${appdir}/libffi.so.6"
     rm "$out/${appdir}/libGL.so.1"
     rm "$out/${appdir}/libX11-xcb.so.1"
 
+    # Cannot use vendored Qt libraries due to problem with xkbcommon
+    rm "$out/${appdir}/"libQt5*.so.5
+    rm "$out/${appdir}/qt.conf"
+    rm -fr "$out/${appdir}/plugins"
+
     mkdir -p "$out/share/applications"
     cp "${desktopItem}/share/applications/"* $out/share/applications
 
@@ -88,47 +94,32 @@ in stdenv.mkDerivation {
 
     mkdir -p "$out/bin"
     RPATH="${ldpath}:$out/${appdir}"
-    makeWrapper "$out/${appdir}/dropbox" "$out/bin/dropbox" \
+    makeQtWrapper "$out/${appdir}/dropbox" "$out/bin/dropbox" \
       --prefix LD_LIBRARY_PATH : "$RPATH"
 
     chmod 755 $out/${appdir}/dropbox
-
-    runHook postInstall
   '';
 
   fixupPhase = ''
-    runHook preFixup
-
     INTERP=$(cat $NIX_CC/nix-support/dynamic-linker)
     RPATH="${ldpath}:$out/${appdir}"
     getType='s/ *Type: *\([A-Z]*\) (.*/\1/'
-    find "$out/${appdir}" -type f -a -perm -0100 -print | while read obj; do
+    find "$out/${appdir}" -type f -print | while read obj; do
         dynamic=$(readelf -S "$obj" 2>/dev/null | grep "DYNAMIC" || true)
-
         if [[ -n "$dynamic" ]]; then
-            type=$(readelf -h "$obj" 2>/dev/null | grep 'Type:' | sed -e "$getType")
-
-            if [[ "$type" == "EXEC" ]]; then
 
+            if readelf -l "$obj" 2>/dev/null | grep "INTERP" >/dev/null; then
                 echo "patching interpreter path in $type $obj"
                 patchelf --set-interpreter "$INTERP" "$obj"
+            fi
 
-                echo "patching RPATH in $type $obj"
-                oldRPATH=$(patchelf --print-rpath "$obj")
-                patchelf --set-rpath "''${oldRPATH:+$oldRPATH:}$RPATH" "$obj"
-
-                echo "shrinking RPATH in $type $obj"
-                patchelf --shrink-rpath "$obj"
-
-            elif [[ "$type" == "DYN" ]]; then
+            type=$(readelf -h "$obj" 2>/dev/null | grep 'Type:' | sed -e "$getType")
+            if [ "$type" == "EXEC" ] || [ "$type" == "DYN" ]; then
 
                 echo "patching RPATH in $type $obj"
                 oldRPATH=$(patchelf --print-rpath "$obj")
                 patchelf --set-rpath "''${oldRPATH:+$oldRPATH:}$RPATH" "$obj"
 
-                echo "shrinking RPATH in $type $obj"
-                patchelf --shrink-rpath "$obj"
-
             else
 
                 echo "unknown ELF type \"$type\"; not patching $obj"
@@ -138,8 +129,6 @@ in stdenv.mkDerivation {
     done
 
     paxmark m $out/${appdir}/dropbox
-
-    runHook postFixup
   '';
 
   meta = {
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 61ff664d446d..a487579e41c3 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -15403,7 +15403,7 @@ with pkgs;
   bittorrentSync14 = callPackage ../applications/networking/bittorrentsync/1.4.x.nix { };
   bittorrentSync20 = callPackage ../applications/networking/bittorrentsync/2.0.x.nix { };
 
-  dropbox = callPackage ../applications/networking/dropbox { };
+  dropbox = libsForQt5.callPackage ../applications/networking/dropbox { };
 
   dropbox-cli = callPackage ../applications/networking/dropbox-cli { };