nixpkgs-suyu/pkgs/applications/version-management/bcompare/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

98 lines
2.7 KiB
Nix
Raw Normal View History

2021-11-13 23:28:25 +01:00
{ lib, autoPatchelfHook, bzip2, cairo, fetchurl, gdk-pixbuf, glibc, pango, gtk2, kcoreaddons, ki18n, kio, kservice
, stdenv, runtimeShell, unzip
}:
2019-07-30 22:01:59 +02:00
let
2019-07-30 22:01:59 +02:00
pname = "bcompare";
2022-03-17 17:23:49 +01:00
version = "4.4.2.26348";
2019-07-30 22:01:59 +02:00
throwSystem = throw "Unsupported system: ${stdenv.hostPlatform.system}";
srcs = {
x86_64-linux = fetchurl {
url = "https://www.scootersoftware.com/${pname}-${version}_amd64.deb";
2022-03-17 17:23:49 +01:00
sha256 = "sha256-GotORErgPs7IPXATbBfIisDCNwp8csl7pDSwV77FylA=";
};
x86_64-darwin = fetchurl {
url = "https://www.scootersoftware.com/BCompareOSX-${version}.zip";
2022-03-17 17:23:49 +01:00
sha256 = "sha256-XqmtW2EGyFmOzCooXczP3mtMN5UVQCCx7DJnVDlzAko=";
};
aarch64-darwin = srcs.x86_64-darwin;
};
src = srcs.${stdenv.hostPlatform.system} or throwSystem;
linux = stdenv.mkDerivation {
inherit pname version src meta;
unpackPhase = ''
ar x $src
tar xfz data.tar.gz
'';
installPhase = ''
mkdir -p $out/{bin,lib,share}
cp -R usr/{bin,lib,share} $out/
# Remove library that refuses to be autoPatchelf'ed
rm $out/lib/beyondcompare/ext/bcompare_ext_kde.amd64.so
substituteInPlace $out/bin/${pname} \
--replace "/usr/lib/beyondcompare" "$out/lib/beyondcompare" \
--replace "ldd" "${glibc.out}/bin/ldd" \
--replace "/bin/bash" "${runtimeShell}"
# Create symlink bzip2 library
ln -s ${bzip2.out}/lib/libbz2.so.1 $out/lib/beyondcompare/libbz2.so.1.0
'';
nativeBuildInputs = [ autoPatchelfHook ];
buildInputs = [
stdenv.cc.cc.lib
gtk2
pango
cairo
kio
kservice
ki18n
kcoreaddons
gdk-pixbuf
bzip2
];
dontBuild = true;
dontConfigure = true;
dontWrapQtApps = true;
2019-07-30 22:01:59 +02:00
};
darwin = stdenv.mkDerivation {
inherit pname version src meta;
nativeBuildInputs = [ unzip ];
installPhase = ''
mkdir -p $out/Applications/BCompare.app
cp -R . $out/Applications/BCompare.app
'';
};
2019-07-30 22:01:59 +02:00
meta = with lib; {
2019-07-30 22:01:59 +02:00
description = "GUI application that allows to quickly and easily compare files and folders";
longDescription = ''
Beyond Compare is focused. Beyond Compare allows you to quickly and easily compare your files and folders.
By using simple, powerful commands you can focus on the differences you're interested in and ignore those you're not.
You can then merge the changes, synchronize your files, and generate reports for your records.
'';
homepage = "https://www.scootersoftware.com";
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
2019-07-30 22:01:59 +02:00
license = licenses.unfree;
maintainers = with maintainers; [ ktor arkivm ];
platforms = builtins.attrNames srcs;
2019-07-30 22:01:59 +02:00
};
in
if stdenv.isDarwin
then darwin
else linux