From c1eec0017957e22468454e7a703ff6bbbe3a6d91 Mon Sep 17 00:00:00 2001 From: Marius Bakke Date: Sat, 16 Jan 2016 00:36:34 +0000 Subject: [PATCH] heimdall: 1.4.1 -> 1.4.2pre --- pkgs/tools/misc/heimdall/default.nix | 61 ++++++++++++---------------- 1 file changed, 25 insertions(+), 36 deletions(-) diff --git a/pkgs/tools/misc/heimdall/default.nix b/pkgs/tools/misc/heimdall/default.nix index 17689a4848a..e82f61e69f5 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"' + # Give ownership of the Galaxy S USB device to the logged in user. + substituteInPlace heimdall/60-heimdall.rules --replace 'MODE="0666"' 'TAG+="uaccess"' ''; - postBuild = stdenv.lib.optionalString enableGUI + installPhase = '' - pushd ../heimdall-frontend - substituteInPlace Source/mainwindow.cpp --replace /usr/bin $out/bin - qmake heimdall-frontend.pro OUTPUTDIR=$out/bin - make - popd - ''; - - postInstall = - '' - 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 = {