1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-29 17:10:48 +00:00
nixpkgs/pkgs/tools/compression/bzip2/default.nix
aszlig 423be7712b
bzip2/cross: Patch out erroneous path separator.
Not sure why this even got into the upstream release, as _all_ other
includes use forward slashes.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
2014-02-24 07:26:23 +01:00

43 lines
1.1 KiB
Nix

{ stdenv, fetchurl, linkStatic ? false }:
let version = "1.0.6"; in
stdenv.mkDerivation {
name = "bzip2-${version}";
builder = ./builder.sh;
src = fetchurl {
url = "http://www.bzip.org/${version}/bzip2-${version}.tar.gz";
sha256 = "1kfrc7f0ja9fdn6j1y6yir6li818npy6217hvr3wzmnmzhs8z152";
};
crossAttrs = {
patchPhase = ''
sed -i -e '/<sys\\stat\.h>/s|\\|/|' bzip2.c
sed -i -e 's/CC=gcc/CC=${stdenv.cross.config}-gcc/' \
-e 's/AR=ar/AR=${stdenv.cross.config}-ar/' \
-e 's/RANLIB=ranlib/RANLIB=${stdenv.cross.config}-ranlib/' \
-e 's/bzip2recover test/bzip2recover/' \
Makefile*
'';
};
sharedLibrary =
!stdenv.isDarwin && !(stdenv ? isDietLibC) && !(stdenv ? isStatic) && stdenv.system != "i686-cygwin" && !linkStatic;
preConfigure = "substituteInPlace Makefile --replace '$(PREFIX)/man' '$(PREFIX)/share/man'";
makeFlags = if linkStatic then "LDFLAGS=-static" else "";
inherit linkStatic;
meta = {
homepage = "http://www.bzip.org";
description = "high-quality data compression program";
platforms = stdenv.lib.platforms.all;
maintainers = [];
};
}