1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 dbus,
6 fpc,
7 getopt,
8 glib,
9 lazarus,
10 libX11,
11 libsForQt5,
12 writableTmpDirAsHomeHook,
13}:
14
15stdenv.mkDerivation (finalAttrs: {
16 pname = "doublecmd";
17 version = "1.1.26";
18
19 src = fetchFromGitHub {
20 owner = "doublecmd";
21 repo = "doublecmd";
22 tag = "v${finalAttrs.version}";
23 hash = "sha256-1rUAyI+Qe4I6F1T9KxMxHxedcARav6CE8W5qvWLu8Y0=";
24 };
25
26 nativeBuildInputs = [
27 fpc
28 getopt
29 lazarus
30 libsForQt5.wrapQtAppsHook
31 writableTmpDirAsHomeHook
32 ];
33
34 buildInputs = [
35 dbus
36 glib
37 libX11
38 libsForQt5.libqtpas
39 ];
40
41 env.NIX_LDFLAGS = "--as-needed -rpath ${lib.makeLibraryPath finalAttrs.buildInputs}";
42
43 postPatch = ''
44 patchShebangs build.sh install/linux/install.sh
45 substituteInPlace build.sh \
46 --replace-warn '$(which lazbuild)' '"${lazarus}/bin/lazbuild --lazarusdir=${lazarus}/share/lazarus"'
47 substituteInPlace install/linux/install.sh \
48 --replace-warn '$DC_INSTALL_PREFIX/usr' '$DC_INSTALL_PREFIX'
49 '';
50
51 buildPhase = ''
52 runHook preBuild
53
54 ./build.sh release qt5
55
56 runHook postBuild
57 '';
58
59 installPhase = ''
60 runHook preInstall
61
62 install/linux/install.sh -I $out
63
64 runHook postInstall
65 '';
66
67 meta = {
68 homepage = "https://doublecmd.sourceforge.io/";
69 description = "Two-panel graphical file manager written in Pascal";
70 license = lib.licenses.gpl2Plus;
71 mainProgram = "doublecmd";
72 maintainers = with lib.maintainers; [ ];
73 platforms = lib.platforms.linux;
74 };
75})
76# TODO: deal with other platforms too