1 { lib, stdenv, fetchFromGitHub, cmake, zlib, libpng, bzip2, libusb-compat-0_1, openssl }:
3 stdenv.mkDerivation rec {
7 src = fetchFromGitHub {
10 rev = "ac362d4ffe4d0489a26144a1483ebf3b431da899";
11 sha256 = "1qw9vbk463fpnvvvfgzxmn9add2p30k832s09mlycr7z1hrh3wyf";
14 # Workaround build failure on -fno-common toolchains:
15 # ld: ../ipsw-patch/libxpwn.a(libxpwn.c.o):(.bss+0x4): multiple definition of
16 # `endianness'; CMakeFiles/xpwn-bin.dir/src/xpwn.cpp.o:(.bss+0x0): first defined here
17 env.NIX_CFLAGS_COMPILE = "-fcommon";
20 rm BUILD # otherwise `mkdir build` fails on case insensitive file systems
22 -e 's/(install.*TARGET.*DESTINATION )\.\)/\1bin)/' \
23 -e 's!(install.*(FILE|DIR).*DESTINATION )([^)]*)!\1share/xpwn/\3!' \
25 sed -i -e '/install/d' CMakeLists.txt
29 nativeBuildInputs = [ cmake ];
30 buildInputs = [ zlib libpng bzip2 libusb-compat-0_1 openssl ];
33 broken = stdenv.hostPlatform.isDarwin;
34 homepage = "http://planetbeing.lighthouseapp.com/projects/15246-xpwn";
35 description = "Custom NOR firmware loader/IPSW generator for the iPhone";
36 license = licenses.gpl3Plus;
37 platforms = with platforms; linux ++ darwin;