summary refs log tree commit diff
path: root/pkgs/applications
diff options
context:
space:
mode:
authorAnonymous <anon@localhost>2014-09-24 12:13:54 +0200
committerEdward Tjörnhammar <ed@cflags.cc>2014-09-24 12:13:54 +0200
commita3b565f7a302a615069e6ee90ba026cab2383ae8 (patch)
tree3813e2b2f9be015204dc996f9e4736a495e0acdd /pkgs/applications
parent8eed86fba9d5dea89a0ead255b47842e9e1c5050 (diff)
downloadnixlib-a3b565f7a302a615069e6ee90ba026cab2383ae8.tar
nixlib-a3b565f7a302a615069e6ee90ba026cab2383ae8.tar.gz
nixlib-a3b565f7a302a615069e6ee90ba026cab2383ae8.tar.bz2
nixlib-a3b565f7a302a615069e6ee90ba026cab2383ae8.tar.lz
nixlib-a3b565f7a302a615069e6ee90ba026cab2383ae8.tar.xz
nixlib-a3b565f7a302a615069e6ee90ba026cab2383ae8.tar.zst
nixlib-a3b565f7a302a615069e6ee90ba026cab2383ae8.zip
idea: hack to get fsnotifier working
      more information: https://bugs.archlinux.org/task/34703
Diffstat (limited to 'pkgs/applications')
-rw-r--r--pkgs/applications/editors/idea/default.nix17
1 files changed, 17 insertions, 0 deletions
diff --git a/pkgs/applications/editors/idea/default.nix b/pkgs/applications/editors/idea/default.nix
index ab0d5fea018f..5727cd12dc77 100644
--- a/pkgs/applications/editors/idea/default.nix
+++ b/pkgs/applications/editors/idea/default.nix
@@ -27,16 +27,33 @@ let
     buildInputs = [ makeWrapper patchelf p7zip ];
 
     patchPhase = ''
+
+      get_file_size() {
+          local fname="$1"
+          echo $(ls -l $fname | cut -d ' ' -f5)
+      }
+
+      munge_size_hack() {
+          local fname="$1"
+          local size="$2"
+          strip $fname
+          truncate --size=$size $fname
+      }
+
       interpreter=$(echo ${stdenv.glibc}/lib/ld-linux*.so.2)
       snappyPath="lib/snappy-java-1.0.5"
 
       7z x -o"$snappyPath" "$snappyPath.jar"
       if [ "${stdenv.system}" == "x86_64-linux" ]; then
+        target_size=$(get_file_size bin/fsnotifier64)
         patchelf --set-interpreter "$interpreter" bin/fsnotifier64
         patchelf --set-rpath ${stdenv.gcc.gcc}/lib64/ "$snappyPath/org/xerial/snappy/native/Linux/amd64/libsnappyjava.so"
+        munge_size_hack bin/fsnotifier64 $target_size
       else
+        target_size=$(get_file_size bin/fsnotifier)
         patchelf --set-interpreter "$interpreter" bin/fsnotifier
         patchelf --set-rpath ${stdenv.gcc.gcc}/lib/ "$snappyPath/org/xerial/snappy/native/Linux/i386/libsnappyjava.so"
+        munge_size_hack bin/fsnotifier $target_size
       fi
       7z a -tzip "$snappyPath.jar" ./"$snappyPath"/*
       rm -vr "$snappyPath"