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