1{ stdenv, fetchurl, glib, intltool, menu-cache, pango, pkgconfig, vala
2, extraOnly ? false
3, withGtk3 ? false, gtk2, gtk3 }:
4let
5 gtk = if withGtk3 then gtk3 else gtk2;
6 inherit (stdenv.lib) optional;
7in
8stdenv.mkDerivation rec {
9 name = if extraOnly
10 then "libfm-extra-${version}"
11 else "libfm-${version}";
12 version = "1.3.1";
13
14 src = fetchurl {
15 url = "mirror://sourceforge/pcmanfm/libfm-${version}.tar.xz";
16 sha256 = "1r6gl49xrykldwz8y4h2s7gjarxigg3bbkrj0gphxjj1vr5j9ccn";
17 };
18
19 nativeBuildInputs = [ vala pkgconfig intltool ];
20 buildInputs = [ glib gtk pango ] ++ optional (!extraOnly) menu-cache;
21
22 configureFlags = [
23 "--sysconfdir=/etc"
24 ] ++ optional extraOnly "--with-extra-only"
25 ++ optional withGtk3 "--with-gtk=3";
26
27 installFlags = [
28 "sysconfdir=${placeholder "out"}/etc"
29 ];
30
31 enableParallelBuilding = true;
32
33 meta = with stdenv.lib; {
34 homepage = https://blog.lxde.org/category/pcmanfm/;
35 license = licenses.lgpl21Plus;
36 description = "A glib-based library for file management";
37 maintainers = [ maintainers.ttuegel ];
38 platforms = platforms.linux ++ platforms.darwin;
39 };
40}