at v192 43 lines 1.4 kB view raw
1{ stdenv, fetchurl, fetchpatch, xz }: 2 3stdenv.mkDerivation rec { 4 name = "libunwind-1.1"; 5 6 src = fetchurl { 7 url = "mirror://savannah/libunwind/${name}.tar.gz"; 8 sha256 = "16nhx2pahh9d62mvszc88q226q5lwjankij276fxwrm8wb50zzlx"; 9 }; 10 11 patches = [ ./libunwind-1.1-lzma.patch ./cve-2015-3239.patch 12 # https://lists.nongnu.org/archive/html/libunwind-devel/2014-04/msg00000.html 13 (fetchpatch { 14 url = "https://raw.githubusercontent.com/dropbox/pyston/1b2e676417b0f5f17526ece0ed840aa88c744145/libunwind_patches/0001-Change-the-RBP-validation-heuristic-to-allow-size-0-.patch"; 15 sha256 = "1a0fsgfxmgd218nscswx7pgyb7rcn2gh6566252xhfvzhgn5i4ha"; 16 }) 17 ]; 18 19 postPatch = '' 20 sed -i -e '/LIBLZMA/s:-lzma:-llzma:' configure 21 ''; 22 23 propagatedBuildInputs = [ xz ]; 24 25 NIX_CFLAGS_COMPILE = if stdenv.system == "x86_64-linux" then "-fPIC" else ""; 26 preInstall = '' 27 mkdir -p "$out/lib" 28 touch "$out/lib/libunwind-generic.so" 29 ''; 30 31 postInstall = '' 32 find $out -name \*.la | while read file; do 33 sed -i 's,-llzma,${xz}/lib/liblzma.la,' $file 34 done 35 ''; 36 37 meta = with stdenv.lib; { 38 homepage = http://www.nongnu.org/libunwind; 39 description = "A portable and efficient API to determine the call-chain of a program"; 40 platforms = platforms.linux; 41 license = licenses.gpl2; 42 }; 43}