2022-04-20 14:31:17 +00:00
|
|
|
{
|
|
|
|
stdenv,
|
|
|
|
lib,
|
|
|
|
fetchFromGitHub,
|
2024-10-27 16:44:22 +00:00
|
|
|
libsForQt5,
|
2022-04-20 14:31:17 +00:00
|
|
|
fpc,
|
|
|
|
lazarus,
|
|
|
|
xorg,
|
|
|
|
libqt5pas,
|
2024-03-28 16:56:52 +00:00
|
|
|
runCommand,
|
2022-04-20 14:31:17 +00:00
|
|
|
_7zz,
|
|
|
|
archiver,
|
|
|
|
brotli,
|
|
|
|
upx,
|
|
|
|
zpaq,
|
|
|
|
zstd,
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "peazip";
|
2024-12-07 05:44:10 +00:00
|
|
|
version = "10.1.0";
|
2022-04-20 14:31:17 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "peazip";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2024-12-07 05:44:10 +00:00
|
|
|
hash = "sha256-jYm3Ngwby75eUFM59tCQ7KWVywQOj+IzuPpATD+QhLo=";
|
2022-04-20 14:31:17 +00:00
|
|
|
};
|
|
|
|
sourceRoot = "${src.name}/peazip-sources";
|
|
|
|
|
2024-03-28 16:56:52 +00:00
|
|
|
postPatch = ''
|
|
|
|
# set it to use compression programs from $PATH
|
|
|
|
substituteInPlace dev/peach.pas --replace " HSYSBIN = 0;" " HSYSBIN = 2;"
|
|
|
|
'';
|
|
|
|
|
2022-04-20 14:31:17 +00:00
|
|
|
nativeBuildInputs = [
|
2024-10-27 16:44:22 +00:00
|
|
|
libsForQt5.wrapQtAppsHook
|
2022-04-20 14:31:17 +00:00
|
|
|
lazarus
|
|
|
|
fpc
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
xorg.libX11
|
|
|
|
libqt5pas
|
|
|
|
];
|
|
|
|
|
|
|
|
NIX_LDFLAGS = "--as-needed -rpath ${lib.makeLibraryPath buildInputs}";
|
|
|
|
|
|
|
|
buildPhase = ''
|
2024-03-28 16:56:52 +00:00
|
|
|
# lazarus tries to create files in $HOME/.lazarus
|
2022-04-20 14:31:17 +00:00
|
|
|
export HOME=$(mktemp -d)
|
2024-03-28 16:56:52 +00:00
|
|
|
pushd dev
|
|
|
|
lazbuild --lazarusdir=${lazarus}/share/lazarus --add-package metadarkstyle/metadarkstyle.lpk
|
|
|
|
lazbuild --lazarusdir=${lazarus}/share/lazarus --widgetset=qt5 --build-all project_pea.lpi
|
|
|
|
lazbuild --lazarusdir=${lazarus}/share/lazarus --widgetset=qt5 --build-all project_peach.lpi
|
|
|
|
popd
|
|
|
|
'';
|
|
|
|
|
|
|
|
# peazip looks for the "7z", not "7zz"
|
|
|
|
_7z = runCommand "7z" { } ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
ln -s ${_7zz}/bin/7zz $out/bin/7z
|
2022-04-20 14:31:17 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
install -D dev/{pea,peazip} -t $out/lib/peazip
|
2024-03-28 16:56:52 +00:00
|
|
|
wrapProgram $out/lib/peazip/peazip --prefix PATH : ${
|
|
|
|
lib.makeBinPath [
|
|
|
|
_7z
|
|
|
|
archiver
|
|
|
|
brotli
|
|
|
|
upx
|
|
|
|
zpaq
|
|
|
|
zstd
|
|
|
|
]
|
|
|
|
}
|
2022-04-20 14:31:17 +00:00
|
|
|
mkdir -p $out/bin
|
|
|
|
ln -s $out/lib/peazip/{pea,peazip} $out/bin/
|
|
|
|
|
2024-03-28 16:56:52 +00:00
|
|
|
mkdir -p $out/share/peazip $out/lib/peazip/res/share
|
2022-04-20 14:31:17 +00:00
|
|
|
ln -s $out/share/peazip $out/lib/peazip/res/share
|
|
|
|
cp -r res/share/{icons,lang,themes,presets} $out/share/peazip/
|
2024-03-28 16:56:52 +00:00
|
|
|
# Install desktop entries
|
|
|
|
install -D res/share/batch/freedesktop_integration/*.desktop -t $out/share/applications
|
|
|
|
# Install desktop entries's icons
|
|
|
|
mkdir -p $out/share/icons/hicolor/256x256/apps
|
|
|
|
ln -s $out/share/peazip/icons/peazip.png -t $out/share/icons/hicolor/256x256/apps/
|
|
|
|
mkdir $out/share/icons/hicolor/256x256/mimetypes
|
|
|
|
ln -s $out/share/peazip/icons/peazip_{7z,zip,cd}.png $out/share/icons/hicolor/256x256/mimetypes/
|
|
|
|
mkdir $out/share/icons/hicolor/256x256/actions
|
|
|
|
ln -s $out/share/peazip/icons/peazip_{add,extract,convert}.png $out/share/icons/hicolor/256x256/actions/
|
2022-04-20 14:31:17 +00:00
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Cross-platform file and archive manager";
|
|
|
|
longDescription = ''
|
|
|
|
Free Zip / Unzip software and Rar file extractor. Cross-platform file and archive manager.
|
|
|
|
|
|
|
|
Features volume spanning, compression, authenticated encryption.
|
|
|
|
|
|
|
|
Supports 7Z, 7-Zip sfx, ACE, ARJ, Brotli, BZ2, CAB, CHM, CPIO, DEB, GZ, ISO, JAR, LHA/LZH, NSIS, OOo, PEA, RAR, RPM, split, TAR, Z, ZIP, ZIPX, Zstandard.
|
|
|
|
'';
|
|
|
|
license = licenses.gpl3Only;
|
|
|
|
homepage = "https://peazip.github.io";
|
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = with maintainers; [ annaaurora ];
|
2024-03-28 16:56:52 +00:00
|
|
|
mainProgram = "peazip";
|
2022-04-20 14:31:17 +00:00
|
|
|
};
|
|
|
|
}
|