summary refs log tree commit diff
path: root/pkgs/tools/archivers/unar
diff options
context:
space:
mode:
authorPeter Hoeg <peter@hoeg.com>2018-01-18 15:26:15 +0800
committerPeter Hoeg <peter@hoeg.com>2018-04-09 15:14:27 +0800
commit0e23e81cc09d25930dfc40fd5bc5269c2e2ec42b (patch)
tree60b2159989072d6208afda745de594c9e04379e9 /pkgs/tools/archivers/unar
parentea145b68a019f6fff89e772e9a6c5f0584acc02c (diff)
downloadnixpkgs-0e23e81cc09d25930dfc40fd5bc5269c2e2ec42b.tar
nixpkgs-0e23e81cc09d25930dfc40fd5bc5269c2e2ec42b.tar.gz
nixpkgs-0e23e81cc09d25930dfc40fd5bc5269c2e2ec42b.tar.bz2
nixpkgs-0e23e81cc09d25930dfc40fd5bc5269c2e2ec42b.tar.lz
nixpkgs-0e23e81cc09d25930dfc40fd5bc5269c2e2ec42b.tar.xz
nixpkgs-0e23e81cc09d25930dfc40fd5bc5269c2e2ec42b.tar.zst
nixpkgs-0e23e81cc09d25930dfc40fd5bc5269c2e2ec42b.zip
unar: minor cleanups
Diffstat (limited to 'pkgs/tools/archivers/unar')
-rw-r--r--pkgs/tools/archivers/unar/default.nix46
1 files changed, 22 insertions, 24 deletions
diff --git a/pkgs/tools/archivers/unar/default.nix b/pkgs/tools/archivers/unar/default.nix
index 520742a1b3c..1104548f77f 100644
--- a/pkgs/tools/archivers/unar/default.nix
+++ b/pkgs/tools/archivers/unar/default.nix
@@ -1,8 +1,10 @@
 { stdenv, fetchurl, gnustep, unzip, bzip2, zlib, icu, openssl }:
 
-stdenv.mkDerivation rec {
-  name = "${pname}-${version}";
+let
   pname = "unar";
+
+in stdenv.mkDerivation rec {
+  name = "${pname}-${version}";
   version = "1.10.1";
 
   src = fetchurl {
@@ -10,23 +12,20 @@ stdenv.mkDerivation rec {
     sha256 = "0aq9zlar5vzr5qxphws8dm7ax60bsfsw77f4ciwa5dq5lla715j0";
   };
 
-  buildInputs = [
-    gnustep.make unzip gnustep.base bzip2.dev
-    zlib.dev icu.dev openssl.dev
-  ];
+  buildInputs = [ gnustep.base bzip2 icu openssl zlib ];
+
+  nativeBuildInputs = [ gnustep.make unzip ];
+
+  enableParallelBuilding = true;
 
   postPatch = ''
-    substituteInPlace Makefile.linux \
-      --replace "CC = gcc" "CC=cc" \
-      --replace "CXX = g++" "CXX=c++" \
-      --replace "OBJCC = gcc" "OBJCC=cc" \
-      --replace "OBJCXX = g++" "OBJCXX=c++"
-
-    substituteInPlace ../UniversalDetector/Makefile.linux \
-      --replace "CC = gcc" "CC=cc" \
-      --replace "CXX = g++" "CXX=c++" \
-      --replace "OBJCC = gcc" "OBJCC=c" \
-      --replace "OBJCXX = g++" "OBJCXX=c++"
+    for f in Makefile.linux ../UniversalDetector/Makefile.linux ; do
+      substituteInPlace $f \
+        --replace "CC = gcc"     "CC=cc" \
+        --replace "CXX = g++"    "CXX=c++" \
+        --replace "OBJCC = gcc"  "OBJCC=cc" \
+        --replace "OBJCXX = g++" "OBJCXX=c++"
+    done
   '';
 
   makefile = "Makefile.linux";
@@ -34,17 +33,16 @@ stdenv.mkDerivation rec {
   sourceRoot = "./The Unarchiver/XADMaster";
 
   installPhase = ''
-    mkdir -p $out/bin
-    cp lsar $out/bin
-    cp unar $out/bin
+    runHook preInstall
 
-    mkdir -p $out/share/man/man1
-    cp ../Extra/lsar.1 $out/share/man/man1
-    cp ../Extra/unar.1 $out/share/man/man1
+    install -Dm755 -t $out/bin lsar unar
+    install -Dm644 -t $out/share/man/man1 ../Extra/{lsar,unar}.1
 
     mkdir -p $out/etc/bash_completion.d
     cp ../Extra/lsar.bash_completion $out/etc/bash_completion.d/lsar
     cp ../Extra/unar.bash_completion $out/etc/bash_completion.d/unar
+
+    runHook postInstall
   '';
 
   meta = with stdenv.lib; {
@@ -55,7 +53,7 @@ stdenv.mkDerivation rec {
       zip, RAR, 7z, tar, gzip, bzip2, LZMA, XZ, CAB, MSI, NSIS, EXE, ISO, BIN, \
       and split file formats, as well as the old Stuffit, Stuffit X, DiskDouble, \
       Compact Pro, Packit, cpio, compress (.Z), ARJ, ARC, PAK, ACE, ZOO, LZH, \
-      ADF, DMS, LZX, PowerPacker, LBR, Squeeze, Crunch, and other old formats. 
+      ADF, DMS, LZX, PowerPacker, LBR, Squeeze, Crunch, and other old formats.
     '';
     license = with licenses; [ lgpl21Plus ];
     platforms = with platforms; linux;