From 02dd1b69ba7d9f687315b6893c3dbf4c0b127ee7 Mon Sep 17 00:00:00 2001 From: Alessio Sergi Date: Sat, 29 Aug 2015 12:39:56 +0200 Subject: [PATCH] spacefm: update to 1.0.3; musl support --- srcpkgs/spacefm/patches/portability.patch | 98 +++++++++++++++++++++++ srcpkgs/spacefm/template | 4 +- 2 files changed, 100 insertions(+), 2 deletions(-) create mode 100644 srcpkgs/spacefm/patches/portability.patch diff --git a/srcpkgs/spacefm/patches/portability.patch b/srcpkgs/spacefm/patches/portability.patch new file mode 100644 index 00000000000..7caac16878d --- /dev/null +++ b/srcpkgs/spacefm/patches/portability.patch @@ -0,0 +1,98 @@ +From 0a36100d556c2ff0cab394616b87b4105d6728fd Mon Sep 17 00:00:00 2001 +From: Stuart Cardall +Date: Sat, 29 Aug 2015 00:36:23 +0000 +Subject: [PATCH] fix malloc_trim for non GlibC libraries + +--- + src/main-window.c | 4 +++- + src/ptk/ptk-file-browser.c | 20 +++++++++++++------- + src/vfs/vfs-dir.c | 8 +++++++- + 3 files changed, 23 insertions(+), 9 deletions(-) + +diff --git src/main-window.c src/main-window.c +index 016d070..908c788 100644 +--- src/main-window.c ++++ src/main-window.c +@@ -1216,7 +1216,9 @@ void main_window_toggle_thumbnails_all_windows() + /* Ensuring free space at the end of the heap is freed to the OS, + * mainly to deal with the possibility thousands of large thumbnails + * have been freed but the memory not actually released by SpaceFM */ +- malloc_trim(0); ++ #if defined (__GLIBC__) ++ malloc_trim(0); ++ #endif + } + + void focus_panel( GtkMenuItem* item, gpointer mw, int p ) +diff --git src/ptk/ptk-file-browser.c src/ptk/ptk-file-browser.c +index ac898d0..ccbd282 100644 +--- src/ptk/ptk-file-browser.c ++++ src/ptk/ptk-file-browser.c +@@ -1513,7 +1513,9 @@ void ptk_file_browser_finalize( GObject *obj ) + * mainly to deal with the possibility that killing the browser results in + * thousands of large thumbnails being freed, but the memory not actually + * released by SpaceFM */ +- malloc_trim(0); ++ #if defined (__GLIBC__) ++ malloc_trim(0); ++ #endif + } + + void ptk_file_browser_get_property ( GObject *obj, +@@ -2703,11 +2705,13 @@ void on_dir_file_listed( VFSDir* dir, + ptk_file_browser_update_model( file_browser ); + file_browser->busy = FALSE; + +- /* Ensuring free space at the end of the heap is freed to the OS, +- * mainly to deal with the possibility that changing the directory results in +- * thousands of large thumbnails being freed, but the memory not actually +- * released by SpaceFM */ +- malloc_trim(0); ++ /* Ensuring free space at the end of the heap is freed to the OS, ++ * mainly to deal with the possibility that changing the directory results in ++ * thousands of large thumbnails being freed, but the memory not actually ++ * released by SpaceFM */ ++ #if defined (__GLIBC__) ++ malloc_trim(0); ++ #endif + + g_signal_emit( file_browser, signals[ AFTER_CHDIR_SIGNAL ], 0 ); + //g_signal_emit( file_browser, signals[ CONTENT_CHANGE_SIGNAL ], 0 ); +@@ -4556,7 +4560,9 @@ void ptk_file_browser_refresh( GtkWidget* item, PtkFileBrowser* file_browser ) + /* Ensuring free space at the end of the heap is freed to the OS, + * mainly to deal with the possibility thousands of large thumbnails + * have been freed but the memory not actually released by SpaceFM */ +- malloc_trim(0); ++ #if defined (__GLIBC__) ++ malloc_trim(0); ++ #endif + + // begin load dir + file_browser->busy = TRUE; +diff --git src/vfs/vfs-dir.c src/vfs/vfs-dir.c +index 9546713..555ad00 100644 +--- src/vfs/vfs-dir.c ++++ src/vfs/vfs-dir.c +@@ -21,7 +21,11 @@ + #include + + #include /* for open() */ ++ ++#if defined (__GLIBC__) + #include /* for malloc_trim */ ++#endif ++ + #include /* for read */ + #include "vfs-volume.h" + +@@ -1193,7 +1197,9 @@ void vfs_dir_unload_thumbnails( VFSDir* dir, gboolean is_big ) + /* Ensuring free space at the end of the heap is freed to the OS, + * mainly to deal with the possibility thousands of large thumbnails + * have been freed but the memory not actually released by SpaceFM */ +- malloc_trim(0); ++ #if defined (__GLIBC__) ++ malloc_trim(0); ++ #endif + } + + //sfm added mime change timer diff --git a/srcpkgs/spacefm/template b/srcpkgs/spacefm/template index e463192ef89..1c25303fe19 100644 --- a/srcpkgs/spacefm/template +++ b/srcpkgs/spacefm/template @@ -1,6 +1,6 @@ # Template file for 'spacefm' pkgname=spacefm -version=1.0.2 +version=1.0.3 revision=1 build_style=gnu-configure hostmakedepends="pkg-config intltool" @@ -11,4 +11,4 @@ maintainer="Juan RP " license="GPL-3" homepage="http://ignorantguru.github.com/spacefm/" distfiles="https://github.com/IgnorantGuru/spacefm/raw/pkg/${version}/spacefm-${version}.tar.xz" -checksum=e7d0c5c034b68b7e3f74b14758b751051a7abd4fa7c65d29cfb9598a965f5b33 +checksum=1599a4556df4b7b1fd20a59aeffdabee990cc102b5cbed0846201f0345863279