biglybt: 3.5.0.0 -> 3.6.0.0
[NixPkgs.git] / pkgs / applications / version-management / bcompare / default.nix
blob33b4cb0f90b544b974e989b5bdbb486296fb357b
1 { lib, autoPatchelfHook, bzip2, cairo, fetchurl, gdk-pixbuf, glibc, pango, gtk2, kcoreaddons, ki18n, kio, kservice
2 , stdenv, runtimeShell, unzip
3 }:
5 let
6   pname = "bcompare";
7   version = "4.4.6.27483";
9   throwSystem = throw "Unsupported system: ${stdenv.hostPlatform.system}";
11   srcs = {
12     x86_64-linux = fetchurl {
13       url = "https://www.scootersoftware.com/${pname}-${version}_amd64.deb";
14       sha256 = "sha256-1+f/AfyJ8Z80WR4cs1JDjTquTR1mGAUOd27vniSeA0k=";
15     };
17     x86_64-darwin = fetchurl {
18       url = "https://www.scootersoftware.com/BCompareOSX-${version}.zip";
19       sha256 = "sha256-hUzJfUgfCuvB6ADHbsgmEXXgntm01hPnfSjwl7jI70c=";
20     };
22     aarch64-darwin = srcs.x86_64-darwin;
23   };
25   src = srcs.${stdenv.hostPlatform.system} or throwSystem;
27   linux = stdenv.mkDerivation {
28     inherit pname version src meta;
29     unpackPhase = ''
30       ar x $src
31       tar xfz data.tar.gz
32     '';
34     installPhase = ''
35       mkdir -p $out/{bin,lib,share}
37       cp -R usr/{bin,lib,share} $out/
39       # Remove library that refuses to be autoPatchelf'ed
40       rm $out/lib/beyondcompare/ext/bcompare_ext_kde.amd64.so
42       substituteInPlace $out/bin/${pname} \
43         --replace "/usr/lib/beyondcompare" "$out/lib/beyondcompare" \
44         --replace "ldd" "${glibc.bin}/bin/ldd" \
45         --replace "/bin/bash" "${runtimeShell}"
47       # Create symlink bzip2 library
48       ln -s ${bzip2.out}/lib/libbz2.so.1 $out/lib/beyondcompare/libbz2.so.1.0
49     '';
51     nativeBuildInputs = [ autoPatchelfHook ];
53     buildInputs = [
54       stdenv.cc.cc.lib
55       gtk2
56       pango
57       cairo
58       kio
59       kservice
60       ki18n
61       kcoreaddons
62       gdk-pixbuf
63       bzip2
64     ];
66     dontBuild = true;
67     dontConfigure = true;
68     dontWrapQtApps = true;
69   };
71   darwin = stdenv.mkDerivation {
72     inherit pname version src meta;
73     nativeBuildInputs = [ unzip ];
75     installPhase = ''
76       mkdir -p $out/Applications/BCompare.app
77       cp -R . $out/Applications/BCompare.app
78     '';
79   };
81   meta = with lib; {
82     description = "GUI application that allows to quickly and easily compare files and folders";
83     longDescription = ''
84       Beyond Compare is focused. Beyond Compare allows you to quickly and easily compare your files and folders.
85       By using simple, powerful commands you can focus on the differences you're interested in and ignore those you're not.
86       You can then merge the changes, synchronize your files, and generate reports for your records.
87     '';
88     homepage = "https://www.scootersoftware.com";
89     sourceProvenance = with sourceTypes; [ binaryNativeCode ];
90     license = licenses.unfree;
91     maintainers = with maintainers; [ ktor arkivm ];
92     platforms = builtins.attrNames srcs;
93     mainProgram = "bcompare";
94   };
96 if stdenv.isDarwin
97 then darwin
98 else linux