about summary refs log tree commit diff
path: root/pkgs/tools
diff options
context:
space:
mode:
authorMarius Bakke <m.bakke@warwick.ac.uk>2016-01-16 00:36:34 +0000
committerMarius Bakke <m.bakke@warwick.ac.uk>2016-01-23 04:08:28 +0000
commitc1eec0017957e22468454e7a703ff6bbbe3a6d91 (patch)
tree8cdb5c505a8abaea7238ea76c5985def3cc48091 /pkgs/tools
parent2d6420289555b22009eafb01ac850ee66c05afe0 (diff)
downloadnixlib-c1eec0017957e22468454e7a703ff6bbbe3a6d91.tar
nixlib-c1eec0017957e22468454e7a703ff6bbbe3a6d91.tar.gz
nixlib-c1eec0017957e22468454e7a703ff6bbbe3a6d91.tar.bz2
nixlib-c1eec0017957e22468454e7a703ff6bbbe3a6d91.tar.lz
nixlib-c1eec0017957e22468454e7a703ff6bbbe3a6d91.tar.xz
nixlib-c1eec0017957e22468454e7a703ff6bbbe3a6d91.tar.zst
nixlib-c1eec0017957e22468454e7a703ff6bbbe3a6d91.zip
heimdall: 1.4.1 -> 1.4.2pre
Diffstat (limited to 'pkgs/tools')
-rw-r--r--pkgs/tools/misc/heimdall/default.nix61
1 files changed, 25 insertions, 36 deletions
diff --git a/pkgs/tools/misc/heimdall/default.nix b/pkgs/tools/misc/heimdall/default.nix
index 17689a4848ae..e82f61e69f5b 100644
--- a/pkgs/tools/misc/heimdall/default.nix
+++ b/pkgs/tools/misc/heimdall/default.nix
@@ -1,54 +1,43 @@
-{ stdenv, fetchFromGitHub, pkgconfig, libusb1, udev
-, enableGUI ? true, qt4 ? null
-}:
+{ stdenv, fetchFromGitHub, zlib, libusb1, cmake, qt5
+, enableGUI ? false }:
+
+let version = "d0526a3"; in
+let verName = "1.4.2pre"; in
 
 stdenv.mkDerivation rec {
-  version = "1.4.1";
-  name = "heimdall-${version}";
+  name = "heimdall-${verName}";
 
   src = fetchFromGitHub {
     owner  = "Benjamin-Dobell";
     repo   = "Heimdall";
-    rev    = "v${version}";
-    sha256 = "1b7xpamwvw5r2d9yf73f0axv35vg8zaz1345xs3lmsr105phnnp4";
+    rev    = "${version}";
+    sha256 = "1y8gvqprajlml1z6mjcrlj54m9xsr8691nqagakkkis7hs1lgzmp";
   };
 
-  buildInputs =
-    [ pkgconfig libusb1 udev ]
-    ++ stdenv.lib.optional enableGUI qt4 ;
-
-  makeFlags = "udevrulesdir=$(out)/lib/udev/rules.d";
+  buildInputs = [ zlib libusb1 cmake ];
+  patchPhase = stdenv.lib.optional (!enableGUI) ''
+    sed -i '/heimdall-frontend/d' CMakeLists.txt
+  '';
+  enableParallelBuilding = true;
+  cmakeFlags = ["-DQt5Widgets_DIR=${qt5.qtbase}/lib/cmake/Qt5Widgets"
+                "-DQt5Gui_DIR=${qt5.qtbase}/lib/cmake/Qt5Gui"
+                "-DQt5Core_DIR=${qt5.qtbase}/lib/cmake/Qt5Core"
+                "-DBUILD_TYPE=Release"];
 
   preConfigure =
     ''
-      pushd libpit
-      ./configure
-      make
-      popd
-
-      cd heimdall
-      substituteInPlace Makefile.in --replace sudo true
-
-      # Give ownership of the Galaxy S USB device to the logged in
-      # user.
-      substituteInPlace 60-heimdall-galaxy-s.rules --replace 'MODE="0666"' 'TAG+="udev-acl"'
-    '';
-
-  postBuild = stdenv.lib.optionalString enableGUI
-    ''
-      pushd ../heimdall-frontend
-      substituteInPlace Source/mainwindow.cpp --replace /usr/bin $out/bin
-      qmake heimdall-frontend.pro OUTPUTDIR=$out/bin
-      make
-      popd
+      # Give ownership of the Galaxy S USB device to the logged in user.
+      substituteInPlace heimdall/60-heimdall.rules --replace 'MODE="0666"' 'TAG+="uaccess"'
     '';
 
-  postInstall =
+  installPhase =
     ''
-      mkdir -p $out/share/doc/heimdall
-      cp ../Linux/README $out/share/doc/heimdall/
+      mkdir -p $out/bin $out/share/doc/heimdall $out/lib/udev/rules.d
+      cp bin/heimdall $out/bin
+      cp ../Linux/README $out/share/doc/heimdall
+      cp ../heimdall/60-heimdall.rules $out/lib/udev/rules.d
     '' + stdenv.lib.optionalString enableGUI ''
-      make -C ../heimdall-frontend install
+      cp bin/heimdall-frontend $out/bin
     '';
 
   meta = {