@@ -0,0 +1,63 @@
1+{ stdenv, fetchurl, gnustep, unzip, bzip2, zlib, icu, openssl }:
2+
3+stdenv.mkDerivation rec {
4+ name = "${pname}-${version}";
5+ pname = "unar";
6+ version = "1.10.1";
7+
8+ src = fetchurl {
9+ url = "http://unarchiver.c3.cx/downloads/${pname}${version}_src.zip";
10+ sha256 = "0aq9zlar5vzr5qxphws8dm7ax60bsfsw77f4ciwa5dq5lla715j0";
11+ };
12+
13+ buildInputs = [
14+ gnustep.make unzip gnustep.base bzip2.dev
15+ zlib.dev icu.dev openssl.dev
16+ ];
17+
18+ postPatch = ''
19+ substituteInPlace Makefile.linux \
20+ --replace "CC = gcc" "CC=cc" \
21+ --replace "CXX = g++" "CXX=c++" \
22+ --replace "OBJCC = gcc" "OBJCC=cc" \
23+ --replace "OBJCXX = g++" "OBJCXX=c++"
24+
25+ substituteInPlace ../UniversalDetector/Makefile.linux \
26+ --replace "CC = gcc" "CC=cc" \
27+ --replace "CXX = g++" "CXX=c++" \
28+ --replace "OBJCC = gcc" "OBJCC=c" \
29+ --replace "OBJCXX = g++" "OBJCXX=c++"
30+ '';
31+
32+ makefile = "Makefile.linux";
33+
34+ sourceRoot = "./The Unarchiver/XADMaster";
35+
36+ installPhase = ''
37+ mkdir -p $out/bin
38+ cp lsar $out/bin
39+ cp unar $out/bin
40+
41+ mkdir -p $out/share/man/man1
42+ cp ../Extra/lsar.1 $out/share/man/man1
43+ cp ../Extra/unar.1 $out/share/man/man1
44+
45+ mkdir -p $out/etc/bash_completion.d
46+ cp ../Extra/lsar.bash_completion $out/etc/bash_completion.d/lsar
47+ cp ../Extra/unar.bash_completion $out/etc/bash_completion.d/unar
48+ '';
49+
50+ meta = with stdenv.lib; {
51+ homepage = http://unarchiver.c3.cx/unarchiver;
52+ description = "An archive unpacker program";
53+ longDescription = ''
54+ The Unarchiver is an archive unpacker program with support for the popular \
55+ zip, RAR, 7z, tar, gzip, bzip2, LZMA, XZ, CAB, MSI, NSIS, EXE, ISO, BIN, \
56+ and split file formats, as well as the old Stuffit, Stuffit X, DiskDouble, \
57+ Compact Pro, Packit, cpio, compress (.Z), ARJ, ARC, PAK, ACE, ZOO, LZH, \
58+ ADF, DMS, LZX, PowerPacker, LBR, Squeeze, Crunch, and other old formats.
59+ '';
60+ license = with licenses; [ lgpl21Plus ];
61+ platforms = with platforms; linux;
62+ };
63+}