2021-01-17 17:28:51 +00:00
|
|
|
{ stdenv, lib, requireFile, p7zip, jre, libusb1, platform-tools, gtk2, glib, libXtst }:
|
2014-02-28 11:13:29 +00:00
|
|
|
|
2014-02-28 10:02:31 +00:00
|
|
|
# TODO:
|
|
|
|
#
|
|
|
|
# The FlashTool and FlashToolConsole scripts are messy and should probably we
|
|
|
|
# replaced entirely. All these scripts do is try to guess the environment in
|
|
|
|
# which to run the Java binary (and they guess wrong on NixOS).
|
|
|
|
#
|
|
|
|
# The FlashTool scripts run 'chmod' on the binaries installed in the Nix
|
|
|
|
# store. These commands fail, naturally, because the Nix story is (hopefully)
|
|
|
|
# mounted read-only. This doesn't matter, though, because the build
|
|
|
|
# instructions fix the executable bits already.
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "flashtool-0.9.14.0";
|
|
|
|
|
|
|
|
src = requireFile {
|
|
|
|
url = "http://dfiles.eu/files/n8c1c3pgc";
|
|
|
|
name = "flashtool-0.9.14.0-linux.tar.7z";
|
|
|
|
sha256 = "0mfjdjj7clz2dhkg7lzy1m8hk8ngla7zgcryf51aki1gnpbb2zc1";
|
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [ p7zip jre ];
|
|
|
|
|
|
|
|
unpackPhase = ''
|
|
|
|
7z e ${src}
|
|
|
|
tar xf ${name}-linux.tar
|
|
|
|
sourceRoot=FlashTool
|
|
|
|
'';
|
|
|
|
|
|
|
|
buildPhase = ''
|
2018-11-18 12:51:06 +00:00
|
|
|
ln -s ${platform-tools}/libexec/android-sdk/platform-tools/adb x10flasher_lib/adb.linux
|
|
|
|
ln -s ${platform-tools}/libexec/android-sdk/platform-tools/fastboot x10flasher_lib/fastboot.linux
|
2016-01-24 07:29:44 +00:00
|
|
|
ln -s ${libusb1.out}/lib/libusb-1.0.so.0 ./x10flasher_lib/linux/lib32/libusbx-1.0.so
|
2014-02-28 11:13:29 +00:00
|
|
|
|
|
|
|
chmod +x x10flasher_lib/unyaffs.linux.x86 x10flasher_lib/bin2elf x10flasher_lib/bin2sin
|
2014-12-17 18:11:30 +00:00
|
|
|
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" x10flasher_lib/unyaffs.linux.x86
|
2014-02-28 11:13:29 +00:00
|
|
|
ln -sf unyaffs.linux.x86 x10flasher_lib/unyaffs.linux
|
|
|
|
|
|
|
|
ln -s swt32.jar x10flasher_lib/swtlin/swt.jar
|
|
|
|
|
2014-02-28 10:02:31 +00:00
|
|
|
sed -i \
|
2014-02-28 11:13:29 +00:00
|
|
|
-e 's|$(uname -m)|i686|' \
|
2014-02-28 10:02:31 +00:00
|
|
|
-e 's|export JAVA_HOME=.*|export JAVA_HOME=${jre}|' \
|
2021-01-17 17:28:51 +00:00
|
|
|
-e 's|export LD_LIBRARY_PATH=.*|export LD_LIBRARY_PATH=${lib.makeLibraryPath [ libXtst glib gtk2 ]}:./x10flasher_lib/linux/lib32|' \
|
2014-02-28 10:02:31 +00:00
|
|
|
FlashTool FlashToolConsole
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out
|
|
|
|
mv * $out/
|
|
|
|
'';
|
|
|
|
|
2021-01-17 17:28:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "http://www.flashtool.net/";
|
2014-02-28 10:02:31 +00:00
|
|
|
description = "S1 flashing software for Sony phones from X10 to Xperia Z Ultra";
|
2021-01-17 17:28:51 +00:00
|
|
|
license = licenses.unfreeRedistributableFirmware;
|
2018-05-03 05:58:11 +00:00
|
|
|
platforms = [ "i686-linux" ];
|
2021-01-17 17:28:51 +00:00
|
|
|
hydraPlatforms = platforms.none;
|
2017-12-23 22:54:31 +00:00
|
|
|
broken = true;
|
2014-02-28 10:02:31 +00:00
|
|
|
};
|
|
|
|
}
|