Skip to content

Commit

Permalink
libfm: fetch gcc 14 patch and refactor
Browse files Browse the repository at this point in the history
- instead of vendoring patches, fetch from lxde

- use `finalAttrs` pattern and remove `with lib;`

Co-authored-by: Jan Tojnar <jtojnar@gmail.com>
  • Loading branch information
stepbrobd and jtojnar committed Jan 8, 2025
1 parent d17d7cc commit 0eb0361
Showing 1 changed file with 18 additions and 11 deletions.
29 changes: 18 additions & 11 deletions pkgs/by-name/li/libfm/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
lib,
stdenv,
fetchurl,
fetchpatch,
glib,
intltool,
menu-cache,
Expand All @@ -18,20 +19,21 @@ let
gtk = if withGtk3 then gtk3 else gtk2;
inherit (lib) optional optionalString;
in
stdenv.mkDerivation rec {
stdenv.mkDerivation (finalAttrs: {
pname = if extraOnly then "libfm-extra" else "libfm";
version = "1.3.2";

src = fetchurl {
url = "mirror://sourceforge/pcmanfm/libfm-${version}.tar.xz";
url = "mirror://sourceforge/pcmanfm/libfm-${finalAttrs.version}.tar.xz";
sha256 = "sha256-pQQmMDBM+OXYz/nVZca9VG8ii0jJYBU+02ajTofK0eU=";
};

patches = [
./0001-fm-load-all-actions.patch
./0002-exo-icon-view-key-press-event.patch
./0003-ask-action-on-drop.patch
./0004-create-icon-view.patch
# Add casts to fix -Werror=incompatible-pointer-types
(fetchpatch {
url = "https://github.com/lxde/libfm/commit/fbcd183335729fa3e8dd6a837c13a23ff3271000.patch";
hash = "sha256-RbX8jkP/5ao6NWEnv8Pgy4zwZaiDsslGlRRWdoV3enA=";
})
];

nativeBuildInputs = [
Expand All @@ -52,19 +54,24 @@ stdenv.mkDerivation rec {

installFlags = [ "sysconfdir=${placeholder "out"}/etc" ];

postPatch = ''
# Ensure the files are re-generated from Vala sources.
rm src/actions/*.c
'';

# libfm-extra is pulled in by menu-cache and thus leads to a collision for libfm
postInstall = optionalString (!extraOnly) ''
rm $out/lib/libfm-extra.so $out/lib/libfm-extra.so.* $out/lib/libfm-extra.la $out/lib/pkgconfig/libfm-extra.pc
'';

enableParallelBuilding = true;

meta = with lib; {
meta = {
broken = stdenv.hostPlatform.isDarwin;
homepage = "https://blog.lxde.org/category/pcmanfm/";
license = licenses.lgpl21Plus;
license = lib.licenses.lgpl21Plus;
description = "Glib-based library for file management";
maintainers = [ maintainers.ttuegel ];
platforms = platforms.linux ++ platforms.darwin;
maintainers = with lib.maintainers; [ ttuegel ];
platforms = lib.platforms.linux ++ lib.platforms.darwin;
};
}
})

0 comments on commit 0eb0361

Please sign in to comment.