14 pname = "heimdall${lib.optionalString enableGUI "-gui"}";
17 src = fetchFromGitHub {
18 owner = "Benjamin-Dobell";
21 sha256 = "1ygn4snvcmi98rgldgxf5hwm7zzi1zcsihfvm6awf9s6mpcjzbqz";
27 ] ++ lib.optional enableGUI qtbase;
28 nativeBuildInputs = [ cmake ];
31 "-DDISABLE_FRONTEND=${if enableGUI then "OFF" else "ON"}"
32 "-DLIBUSB_LIBRARY=${libusb1}"
37 # Give ownership of the Galaxy S USB device to the logged in user.
38 substituteInPlace heimdall/60-heimdall.rules --replace 'MODE="0666"' 'TAG+="uaccess"'
40 + lib.optionalString stdenv.hostPlatform.isDarwin ''
41 substituteInPlace libpit/CMakeLists.txt --replace "-std=gnu++11" ""
45 lib.optionalString (stdenv.hostPlatform.isDarwin && enableGUI) ''
46 mkdir -p $out/Applications
47 mv bin/heimdall-frontend.app $out/Applications/heimdall-frontend.app
48 wrapQtApp $out/Applications/heimdall-frontend.app/Contents/MacOS/heimdall-frontend
51 mkdir -p $out/{bin,share/doc/heimdall,lib/udev/rules.d}
52 install -m755 -t $out/bin bin/*
53 install -m644 -t $out/lib/udev/rules.d ../heimdall/60-heimdall.rules
54 install -m644 ../Linux/README $out/share/doc/heimdall/README.linux
55 install -m644 ../OSX/README.txt $out/share/doc/heimdall/README.osx
59 broken = stdenv.hostPlatform.isDarwin;
60 homepage = "http://www.glassechidna.com.au/products/heimdall/";
61 description = "Cross-platform tool suite to flash firmware onto Samsung Galaxy S devices";
62 license = licenses.mit;
63 maintainers = with maintainers; [ peterhoeg ];
64 platforms = platforms.unix;
65 mainProgram = "heimdall";