about summary refs log tree commit diff
path: root/pkgs/tools/archivers
diff options
context:
space:
mode:
authorPeter Hoeg <peter@hoeg.com>2020-05-03 20:51:29 +0800
committerGitHub <noreply@github.com>2020-05-03 20:51:29 +0800
commit5fda26c3d0ac3f14d884d81482bd75325db683ea (patch)
tree42de223a587d9c456320eb4efa0ee2891a6f80b8 /pkgs/tools/archivers
parent3c82dcca058deb4ebc13b842d4619eb5aeecdf26 (diff)
parent991c4d48db1d0917434633d28e13d54199abaea5 (diff)
downloadnixlib-5fda26c3d0ac3f14d884d81482bd75325db683ea.tar
nixlib-5fda26c3d0ac3f14d884d81482bd75325db683ea.tar.gz
nixlib-5fda26c3d0ac3f14d884d81482bd75325db683ea.tar.bz2
nixlib-5fda26c3d0ac3f14d884d81482bd75325db683ea.tar.lz
nixlib-5fda26c3d0ac3f14d884d81482bd75325db683ea.tar.xz
nixlib-5fda26c3d0ac3f14d884d81482bd75325db683ea.tar.zst
nixlib-5fda26c3d0ac3f14d884d81482bd75325db683ea.zip
Merge pull request #86628 from peterhoeg/f/unar
unar: 1.10.1 -> 1.10.7
Diffstat (limited to 'pkgs/tools/archivers')
-rw-r--r--pkgs/tools/archivers/unar/default.nix59
1 files changed, 31 insertions, 28 deletions
diff --git a/pkgs/tools/archivers/unar/default.nix b/pkgs/tools/archivers/unar/default.nix
index 259238cdec5e..9fdbada9ab8d 100644
--- a/pkgs/tools/archivers/unar/default.nix
+++ b/pkgs/tools/archivers/unar/default.nix
@@ -1,52 +1,54 @@
-{ stdenv, fetchurl, gnustep, unzip, bzip2, zlib, icu, openssl }:
+{ stdenv, fetchFromGitHub, installShellFiles, gnustep, bzip2, zlib, icu, openssl, wavpack }:
 
-let
+stdenv.mkDerivation rec {
   pname = "unar";
+  version = "1.10.7";
 
-in stdenv.mkDerivation rec {
-  name = "${pname}-${version}";
-  version = "1.10.1";
-
-  src = fetchurl {
-    url = "http://unarchiver.c3.cx/downloads/${pname}${version}_src.zip";
-    sha256 = "0aq9zlar5vzr5qxphws8dm7ax60bsfsw77f4ciwa5dq5lla715j0";
+  src = fetchFromGitHub {
+    owner = "MacPaw";
+    # the unar repo contains a shallow clone of both XADMaster and universal-detector
+    repo = "unar";
+    rev = "v${version}";
+    sha256 = "0p846q1l66k3rnd512sncp26zpv411b8ahi145sghfcsz9w8abc4";
   };
 
-  buildInputs = [ gnustep.base bzip2 icu openssl zlib ];
-
-  nativeBuildInputs = [ gnustep.make unzip ];
-
-  enableParallelBuilding = true;
-
   postPatch = ''
     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++"
+        --replace "= gcc" "=cc" \
+        --replace "= g++" "=c++"
     done
+
+    # we need to build inside this directory as well, so we have to make it writeable
+    chmod +w ../UniversalDetector -R
   '';
 
+  buildInputs = [ gnustep.base bzip2 icu openssl wavpack zlib ];
+
+  nativeBuildInputs = [ gnustep.make installShellFiles ];
+
+  enableParallelBuilding = true;
+
+  dontConfigure = true;
+
   makefile = "Makefile.linux";
 
-  sourceRoot = "./The Unarchiver/XADMaster";
+  sourceRoot = "./source/XADMaster";
 
   installPhase = ''
     runHook preInstall
 
-    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
+    install -Dm555 -t $out/bin lsar unar
+    for f in lsar unar; do
+      installManPage ./Extra/$f.?
+      installShellCompletion --bash --name $f ./Extra/$f.bash_completion
+    done
 
     runHook postInstall
   '';
 
   meta = with stdenv.lib; {
-    homepage = "http://unarchiver.c3.cx/unarchiver";
+    homepage = "https://theunarchiver.com";
     description = "An archive unpacker program";
     longDescription = ''
       The Unarchiver is an archive unpacker program with support for the popular \
@@ -55,7 +57,8 @@ in stdenv.mkDerivation rec {
       Compact Pro, Packit, cpio, compress (.Z), ARJ, ARC, PAK, ACE, ZOO, LZH, \
       ADF, DMS, LZX, PowerPacker, LBR, Squeeze, Crunch, and other old formats.
     '';
-    license = with licenses; [ lgpl21Plus ];
+    license = licenses.lgpl21Plus;
+    maintainers = with maintainers; [ peterhoeg ];
     platforms = with platforms; linux;
   };
 }