git: 6ba80078eaaf - main - graphics/fotoxx: the port had been updated to version 21.60
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sat, 25 Dec 2021 19:40:48 UTC
The branch main has been updated by danfe:
URL: https://cgit.FreeBSD.org/ports/commit/?id=6ba80078eaafc974c2e210065d09e6538090720d
commit 6ba80078eaafc974c2e210065d09e6538090720d
Author: Alexey Dokuchaev <danfe@FreeBSD.org>
AuthorDate: 2021-12-25 19:38:32 +0000
Commit: Alexey Dokuchaev <danfe@FreeBSD.org>
CommitDate: 2021-12-25 19:38:32 +0000
graphics/fotoxx: the port had been updated to version 21.60
This includes trimming MASTER_SITES, adjusting the LICENSE,
amending LIB_DEPENDS, USES, USE_GNOME, and fixing a bunch of
disgusting linuxisms.
---
graphics/fotoxx/Makefile | 36 +++---
graphics/fotoxx/distinfo | 6 +-
graphics/fotoxx/files/patch-Makefile | 45 +++++++
graphics/fotoxx/files/patch-f.combine.cc | 11 --
graphics/fotoxx/files/patch-f.enhance.cc | 29 +++++
graphics/fotoxx/files/patch-f.file.cc | 26 ++--
graphics/fotoxx/files/patch-f.metadata.cc | 50 --------
graphics/fotoxx/files/patch-f.repair.cc | 11 --
graphics/fotoxx/files/patch-fotoxx-15.05.cc | 51 --------
graphics/fotoxx/files/patch-zfuncs.cc | 180 ++++++++++++++++++++++++++--
graphics/fotoxx/files/patch-zfuncs.h | 28 +++--
11 files changed, 305 insertions(+), 168 deletions(-)
diff --git a/graphics/fotoxx/Makefile b/graphics/fotoxx/Makefile
index 595be66094e8..52f71293f067 100644
--- a/graphics/fotoxx/Makefile
+++ b/graphics/fotoxx/Makefile
@@ -1,43 +1,49 @@
# Created by: Rod Person <rodperson@rodperson.com>
PORTNAME= fotoxx
-PORTVERSION= 15.05
+PORTVERSION= 21.60
CATEGORIES= graphics
-MASTER_SITES= http://freebsd.nsu.ru/distfiles/ \
- http://fossies.org/linux/misc/legacy/ \
- http://www.kornelix.com/uploads/1/3/0/3/13035936/
+MASTER_SITES= https://kornelix.net/downloads/downloads/
MAINTAINER= danfe@FreeBSD.org
COMMENT= Application to organize and edit image collections
-LICENSE= GPLv3
+LICENSE= GPLv3+
-LIB_DEPENDS= libtiff.so:graphics/tiff
+LIB_DEPENDS= libchamplain-gtk-0.12.so:graphics/libchamplain \
+ libclutter-gtk-1.0.so:graphics/clutter-gtk3 \
+ liblcms2.so:graphics/lcms2 \
+ libpng.so:graphics/png \
+ libtiff.so:graphics/tiff
RUN_DEPENDS= xdg-open:devel/xdg-utils \
exiftool:graphics/p5-Image-ExifTool \
ufraw-batch:graphics/ufraw
-USES= desktop-file-utils gmake gnome pkgconfig
-USE_GNOME= gtk30
+USES= desktop-file-utils gmake gnome jpeg pkgconfig
+USE_GNOME= cairo glib20 gdkpixbuf2 gtk30
ALL_TARGET= fotoxx
+WRKSRC= ${WRKDIR}/${PORTNAME}
+
PORTDOCS= *
PORTDATA= *
PLIST_FILES= bin/fotoxx \
- man/man1/fotoxx.1.gz \
- share/appdata/fotoxx.appdata.xml \
+ share/man/man1/fotoxx.1.gz \
share/applications/fotoxx.desktop
OPTIONS_DEFINE= DOCS
post-patch:
@${REINPLACE_CMD} -e \
- 's|-ggdb|| ; \
- s|-rdynamic|-Wl,-export-dynamic| ; \
- s|share/man|man| ; \
- s|-lpthread|-lexecinfo|' ${WRKSRC}/Makefile
+ 's,= thread,= cartoon::thread,' ${WRKSRC}/f.effects.cc
+ @${REINPLACE_CMD} -e \
+ '/#include <sys\/prctl\.h>/d' ${WRKSRC}/f.meta.cc
+ @${REINPLACE_CMD} -e \
+ 's,pidof,pgrep -d\\\\ ,' ${WRKSRC}/fotoxx.cc
+ @${REINPLACE_CMD} -e \
+ '/#include/s,wait\.h,sys/&,' ${WRKSRC}/fotoxx.h
@${REINPLACE_CMD} -e \
- 's|/usr/share/fotoxx|${DATADIR}|' ${WRKSRC}/desktop
+ 's|/usr/share/fotoxx|${DATADIR}|' ${WRKSRC}/fotoxx.desktop
post-install:
${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/fotoxx
diff --git a/graphics/fotoxx/distinfo b/graphics/fotoxx/distinfo
index 542a7f21292b..00f4dfcba873 100644
--- a/graphics/fotoxx/distinfo
+++ b/graphics/fotoxx/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1430473829
-SHA256 (fotoxx-15.05.tar.gz) = 65567adc86087a3a8acdebcb0f15ec299cf690a869129825e3d32da7e50c4604
-SIZE (fotoxx-15.05.tar.gz) = 3573278
+TIMESTAMP = 1634502156
+SHA256 (fotoxx-21.60.tar.gz) = 2973e967b04b79ed85ec4dc9ed77d78cd5881340dfc976a61ba85dcbeb4b0dfd
+SIZE (fotoxx-21.60.tar.gz) = 8679841
diff --git a/graphics/fotoxx/files/patch-Makefile b/graphics/fotoxx/files/patch-Makefile
new file mode 100644
index 000000000000..52f516de635d
--- /dev/null
+++ b/graphics/fotoxx/files/patch-Makefile
@@ -0,0 +1,45 @@
+--- Makefile.orig 2021-10-17 20:02:26 UTC
++++ Makefile
+@@ -1,40 +1,12 @@
+ # fotoxx Makefile
+-#
+-# export CXX=g++ gnu compiler
+-# export CXX=clang++ clang compiler
+-# export DEBUG=x debug build with address checking
+
+-ifeq ($(CXX), clang++) # CLANG
+- ifdef DEBUG
+- CXXFLAGS += -Wall -g -O0 -fsanitize=address -Wno-stringop-truncation
+- LDFLAGS += -fsanitize=address
+- else
+- CXXFLAGS += -Wall -g -O2
+- endif
+-else # GCC
+- ifdef DEBUG
+- CXXFLAGS += -Wall -g -rdynamic -O0 -fsanitize=address -Wno-format-truncation -Wno-stringop-truncation
+- LDFLAGS += -fsanitize=address
+- else
+- CXXFLAGS += -Wall -g -rdynamic -O2 -Wno-format-truncation -Wno-stringop-truncation
+- endif
+-endif
+-
+ PKG_CONFIG ?= pkg-config
+
+ CFLAGS = $(CXXFLAGS) $(CPPFLAGS) -c \
+- `$(PKG_CONFIG) --cflags gtk+-3.0` \
+- -I/usr/include/clutter-1.0/ \
+- -I/usr/include/clutter-gtk-1.0/ \
+- -I/usr/include/champlain-gtk-0.12/ \
+- -I/usr/include/champlain-0.12/ \
+- -I/usr/include/libchamplain-gtk-0.12/ \
+- -I/usr/include/libchamplain-0.12/ \
+- -I/usr/include/cogl/ \
+- -I/usr/include/json-glib-1.0/ \
++ `$(PKG_CONFIG) pkgconf --cflags champlain-gtk-0.12`
+
+ LIBS = `$(PKG_CONFIG) --libs gtk+-3.0` \
+- -lrt -lpthread -llcms2 -ltiff -lpng -ljpeg \
++ -lrt -lexecinfo -llcms2 -ltiff -lpng -ljpeg \
+ -lclutter-1.0 -lclutter-gtk-1.0 -lchamplain-0.12 -lchamplain-gtk-0.12
+
+ ALLFILES = fotoxx.o f.widgets.o f.file.o f.gallery.o f.albums.o f.area.o f.meta.o \
diff --git a/graphics/fotoxx/files/patch-f.combine.cc b/graphics/fotoxx/files/patch-f.combine.cc
deleted file mode 100644
index b19d19fbf3f0..000000000000
--- a/graphics/fotoxx/files/patch-f.combine.cc
+++ /dev/null
@@ -1,11 +0,0 @@
---- f.combine.cc.orig 2015-05-01 09:40:38 UTC
-+++ f.combine.cc
-@@ -6475,7 +6475,7 @@ void m_pano_PT(GtkWidget *, cchar *)
- goto cleanup;
- }
-
-- olddir = get_current_dir_name(); // save curr. directory
-+ olddir = getcwd(NULL,PATH_MAX); // save curr. directory
-
- err = chdir(tempdir); // use /tmp/fotoxx-xxxxx
- if (err) {
diff --git a/graphics/fotoxx/files/patch-f.enhance.cc b/graphics/fotoxx/files/patch-f.enhance.cc
new file mode 100644
index 000000000000..51a2cc8cd300
--- /dev/null
+++ b/graphics/fotoxx/files/patch-f.enhance.cc
@@ -0,0 +1,29 @@
+--- f.enhance.cc.orig 2021-10-17 20:02:26 UTC
++++ f.enhance.cc
+@@ -224,7 +224,7 @@ void m_editBD(GtkWidget *, cchar *menu)
+ EFeditBD.Farea = 2; // select area usable
+ EFeditBD.Frestart = 1; // restart allowed
+ EFeditBD.Fscript = 1; // scripting supported
+- EFeditBD.threadfunc = thread;
++ EFeditBD.threadfunc = editBD_names::thread;
+ if (! edit_setup(EFeditBD)) return; // setup edit
+
+ /***
+@@ -590,7 +590,7 @@ void m_flattenBD(GtkWidget *, cchar *menu)
+ EFflattenBD.Frestart = 1; // restartable
+ EFflattenBD.Fpaintedits = 1; // use with paint edits OK
+ EFflattenBD.Fscript = 1; // scripting supported
+- EFflattenBD.threadfunc = thread;
++ EFflattenBD.threadfunc = flattenBD_names::thread;
+ if (! edit_setup(EFflattenBD)) return; // setup edit
+
+ Eww = E0pxm->ww;
+@@ -1067,7 +1067,7 @@ void flattenBDfunc(int _NZ, int _flatten, int _deband1
+ EFflattenBD.menufunc = m_flattenBD;
+ EFflattenBD.Farea = 2; // select area usable
+ EFflattenBD.Frestart = 1; // restartable
+- EFflattenBD.threadfunc = thread;
++ EFflattenBD.threadfunc = flattenBD_names::thread;
+
+ if (! edit_setup(EFflattenBD)) return; // setup edit
+
diff --git a/graphics/fotoxx/files/patch-f.file.cc b/graphics/fotoxx/files/patch-f.file.cc
index 003f8847e350..fe32d1f6e592 100644
--- a/graphics/fotoxx/files/patch-f.file.cc
+++ b/graphics/fotoxx/files/patch-f.file.cc
@@ -1,10 +1,20 @@
---- f.file.cc.orig 2015-05-01 09:40:38 UTC
+--- f.file.cc.orig 2021-10-17 20:02:26 UTC
+++ f.file.cc
-@@ -74,6 +74,7 @@
-
- #define EX extern // disable extern declarations
- #include "fotoxx.h" // (variables in fotoxx.h are refs)
-+#include <sys/wait.h>
-
- /**************************************************************************/
+@@ -3687,13 +3687,17 @@ int find_imagefiles(cchar *folder, int flags, char **&
+
+ if (flags & 1) Fimages = 1;
+ if (flags & 2) Fthumbs = 1;
++#ifdef GLOB_PERIOD
+ if (flags & 4) globflags += GLOB_PERIOD;
++#endif
+ if (flags & 8) Fdirs = 1;
+ if (flags & 16) Frecurse = 1;
+ if (flags & 32) Fnolinks = 1;
+
++#ifdef GLOB_ONLYDIR
+ if (Fdirs && ! Fimages && ! Fthumbs)
+ globflags += GLOB_ONLYDIR;
++#endif
+ globdata.gl_pathc = 0; // glob() setup
+ globdata.gl_offs = 0;
diff --git a/graphics/fotoxx/files/patch-f.metadata.cc b/graphics/fotoxx/files/patch-f.metadata.cc
deleted file mode 100644
index 223e9b48a66b..000000000000
--- a/graphics/fotoxx/files/patch-f.metadata.cc
+++ /dev/null
@@ -1,50 +0,0 @@
---- f.metadata.cc.orig 2015-05-01 09:40:38 UTC
-+++ f.metadata.cc
-@@ -92,6 +92,11 @@
-
- #define EX extern // enable extern declarations
- #include "fotoxx.h" // (variables in fotoxx.h are refs)
-+#include <sys/wait.h>
-+
-+#ifndef ECOMM
-+#define ECOMM EIO
-+#endif
-
- /**************************************************************************/
-
-@@ -5911,7 +5917,7 @@ int get_sxrec(sxrec_t &sxrec, cchar *fil
- strcpy(sxrec.size,"null");
-
- if (! sxrec.tags)
-- sxrec.tags = zstrdup("null"tagdelimB);
-+ sxrec.tags = zstrdup("null" tagdelimB);
-
- if (! sxrec.capt)
- sxrec.capt = zstrdup("null");
-@@ -6118,7 +6124,7 @@ int put_sxrec(sxrec_t *sxrec, cchar *fil
-
- if (sxrec->tags)
- nn = fprintf(fid2,"tags: %s\n",sxrec->tags); // tags rec.
-- else nn = fprintf(fid2,"tags: null"tagdelimB"\n");
-+ else nn = fprintf(fid2,"tags: null" tagdelimB"\n");
- if (! nn) goto file_err;
-
- if (sxrec->capt)
-@@ -6270,7 +6276,7 @@ int read_sxrec_seq(sxrec_t &sxrec, int &
- strcpy(sxrec.size,"null");
-
- if (! sxrec.tags)
-- sxrec.tags = zstrdup("null"tagdelimB);
-+ sxrec.tags = zstrdup("null" tagdelimB);
-
- if (! sxrec.capt)
- sxrec.capt = zstrdup("null");
-@@ -6381,7 +6387,7 @@ int write_sxrec_seq(sxrec_t *sxrec, int
-
- if (sxrec->tags)
- nn = fprintf(fid,"tags: %s\n",sxrec->tags); // tags rec.
-- else nn = fprintf(fid,"tags: null"tagdelimB"\n");
-+ else nn = fprintf(fid,"tags: null" tagdelimB"\n");
- if (! nn) goto file_err;
-
- if (sxrec->capt)
diff --git a/graphics/fotoxx/files/patch-f.repair.cc b/graphics/fotoxx/files/patch-f.repair.cc
deleted file mode 100644
index b7b073846439..000000000000
--- a/graphics/fotoxx/files/patch-f.repair.cc
+++ /dev/null
@@ -1,11 +0,0 @@
---- f.repair.cc.orig 2015-05-01 09:40:38 UTC
-+++ f.repair.cc
-@@ -2055,7 +2055,7 @@ void m_smart_erase(GtkWidget *, const ch
- int smart_erase_dialog_event(zdialog *zd, const char *event) // overhauled
- {
- void smart_erase_func(int mode);
-- void smart_erase_blur(float radius);
-+ int smart_erase_blur(float radius);
-
- float radius;
- int cc;
diff --git a/graphics/fotoxx/files/patch-fotoxx-15.05.cc b/graphics/fotoxx/files/patch-fotoxx-15.05.cc
deleted file mode 100644
index 73eaa585bfc1..000000000000
--- a/graphics/fotoxx/files/patch-fotoxx-15.05.cc
+++ /dev/null
@@ -1,51 +0,0 @@
---- fotoxx-15.05.cc.orig 2015-05-01 09:40:38 UTC
-+++ fotoxx-15.05.cc
-@@ -139,6 +139,8 @@
-
- #define EX // disable extern declarations
- #include "fotoxx.h" // (variables in fotoxx.h are defined)
-+#include <sys/types.h>
-+#include <sys/sysctl.h>
-
- /**************************************************************************/
-
-@@ -335,7 +337,9 @@ int initzfunc(void *)
- char procfile[20], buff[200];
- char KBshortsU[200], KBshortsI[200];
- char tonefile[200], badnews[200];
-+#ifdef __linux__
- double freememory, cachememory;
-+#endif
- float exifver = 0;
- FILE *fid;
- STATB statb;
-@@ -445,6 +449,7 @@ int initzfunc(void *)
-
- // check free memory and suggest image size limits
-
-+#ifdef __linux__
- parseprocfile("/proc/meminfo","MemFree:",&freememory,0); // get amount of free memory
- parseprocfile("/proc/meminfo","Cached:",&cachememory,0);
- freememory = (freememory + cachememory) / 1024; // megabytes
-@@ -452,6 +457,7 @@ int initzfunc(void *)
- printz("image size limits for good performance: \n");
- printz(" view: %.0f megapixels \n",(freememory-100)/6); // F + preview, 3 bytes/pixel each
- printz(" edit: %.0f megapixels \n",(freememory-100)/54); // + E0/E1/E3/ER, 12 bytes/pixel each
-+#endif
-
- // update KB shortcuts if needed
-
-@@ -531,7 +537,13 @@ int initzfunc(void *)
- screenhh = gdk_screen_get_height(screen);
- printz("screen width: %d height: %d \n",screenww,screenhh);
-
-+#ifdef __linux__
- NWT = get_nprocs(); // get SMP CPU count
-+#endif
-+#ifdef __FreeBSD__
-+ size_t len = sizeof(NWT);
-+ sysctlbyname("hw.ncpu",&NWT,&len,NULL,0);
-+#endif
- if (NWT <= 0) NWT = 2;
- if (NWT > max_threads) NWT = max_threads; // compile time limit
- printz("using %d threads \n",NWT);
diff --git a/graphics/fotoxx/files/patch-zfuncs.cc b/graphics/fotoxx/files/patch-zfuncs.cc
index 55efd163c701..68438dff0c73 100644
--- a/graphics/fotoxx/files/patch-zfuncs.cc
+++ b/graphics/fotoxx/files/patch-zfuncs.cc
@@ -1,18 +1,180 @@
---- zfuncs.cc.orig 2015-05-01 09:40:38 UTC
+--- zfuncs.cc.orig 2021-10-17 20:02:26 UTC
+++ zfuncs.cc
-@@ -262,6 +262,7 @@ char *zstrdup(cchar *string, int addcc)
+@@ -551,6 +551,7 @@ int zmalloc_test(int64 cc)
- void zmalloc_report()
+ double realmemory() // 21.55
{
-+#ifdef __linux__
- using namespace zfuncs;
++#if defined(__linux__)
+ FILE *fid;
+ char buff[100], *pp;
+ double rmem = 0;
+@@ -569,15 +570,45 @@ double realmemory()
+ }
- static double ptime = 0;
-@@ -282,6 +283,7 @@ void zmalloc_report()
+ fclose(fid);
++#elif defined(__FreeBSD__)
++ long rmem;
++ rmem = sysconf(_SC_PAGESIZE) / 1024 * sysconf(_SC_PHYS_PAGES) / 1024;
++#endif
+ return rmem;
+ }
+
++#ifdef __FreeBSD__
++static int
++freeswap() // return total free swap space in megabytes
++{
++ struct xswdev xsw;
++ size_t mibsize, size;
++ int mib[16], n, total;
- ptime = jobtime(); // reset some counters
- Nmalloc = Nstrdup = Nfree = 0;
++ mibsize = sizeof mib / sizeof mib[0];
++ if (sysctlnametomib("vm.swap_info", mib, &mibsize) == -1) {
++ perror("sysctlnametomib()");
++ return -1;
++ }
++
++ int pagesize = getpagesize() / 1024;
++ for (total = n = 0; ; ++n) {
++ mib[mibsize] = n;
++ size = sizeof xsw;
++ if (sysctl(mib, mibsize + 1, &xsw, &size, NULL, 0) == -1)
++ break;
++ total += pagesize * (xsw.xsw_nblks - xsw.xsw_used) / 1024;
++ }
++ return total;
++}
+#endif
++
+ // get available memory in MB units
+ // typical < 0.1 milliseconds
+
+ double availmemory()
+ {
++#if defined(__linux__)
+ FILE *fid;
+ char buff[100], *pp;
+ double avmem = 0;
+@@ -602,6 +633,11 @@ double availmemory()
+ }
+
+ fclose(fid);
++#elif defined(__FreeBSD__)
++ double avmem;
++ avmem = realmemory();
++ avmem += freeswap();
++#endif
+ return avmem;
+ }
+
+@@ -996,7 +1032,7 @@ double get_seconds()
+ timespec time1;
+ double time2;
+
+- clock_gettime(CLOCK_MONOTONIC_RAW,&time1);
++ clock_gettime(CLOCK_MONOTONIC,&time1);
+ time2 = time1.tv_sec;
+ time2 += time1.tv_nsec * 0.000000001;
+ return time2;
+@@ -1020,7 +1056,7 @@ void logtime_init(cchar *text)
+ using namespace logtime_names;
+ printf("logtime init: %s\n",text);
+- clock_gettime(CLOCK_MONOTONIC_RAW,&time1);
++ clock_gettime(CLOCK_MONOTONIC,&time1);
return;
}
+
+@@ -1028,7 +1064,7 @@ void logtime(cchar *text)
+ {
+ using namespace logtime_names;
+
+- clock_gettime(CLOCK_MONOTONIC_RAW,&time2);
++ clock_gettime(CLOCK_MONOTONIC,&time2);
+ elapsed = time2.tv_sec - time1.tv_sec;
+ elapsed += 0.000000001 * (time2.tv_nsec - time1.tv_nsec);
+ time1 = time2;
+@@ -1432,7 +1468,7 @@ void zloop(double dsecs)
+ // ... protected code // only one thread at a time can be in here
+ // spinlock(0);
+
+-pthread_mutex_t spinmutex = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP; // 21.44
++pthread_mutex_t spinmutex = PTHREAD_MUTEX_INITIALIZER;
+
+ void spinlock(int lock)
+ {
+@@ -1649,6 +1685,10 @@ int main_thread()
+ return 0;
+ }
+
++int get_nprocs()
++{
++ return sysconf(_SC_NPROCESSORS_ONLN);
++}
+
+ /********************************************************************************/
+
+@@ -1659,7 +1699,7 @@ void set_cpu_affinity(int cpu)
+ {
+ int err;
+ static int ftf = 1, Nsmp;
+- cpu_set_t cpuset;
++ cpuset_t cpuset;
+
+ if (ftf) { // first call
+ ftf = 0;
+@@ -1670,7 +1710,8 @@ void set_cpu_affinity(int cpu)
+
+ CPU_ZERO(&cpuset);
+ CPU_SET(cpu,&cpuset);
+- err = sched_setaffinity(0,sizeof(cpuset),&cpuset);
++ err = cpuset_setaffinity(CPU_LEVEL_WHICH,CPU_WHICH_PID,0,
++ sizeof(cpuset),&cpuset);
+ if (err) Plog(1,"set_cpu_affinity() %s \n",strerror(errno));
+ return;
+ }
+@@ -2234,7 +2275,7 @@ int diskspace(cchar *file)
+ int avail;
+ FILE *fid;
+
+- snprintf(command,200,"df --output=avail \"%s\" ",file);
++ snprintf(command,200,"df -k '%s' | awk '{print $4}'",file);
+ pp = strchr(command,'/');
+ if (! pp) return 0;
+
+@@ -4115,14 +4156,18 @@ cchar * SearchWildCase(cchar *wpath, int &uflag)
+ flist and flist[*] are subjects for zfree().
+
+ zfind() works for files containing quotes (")
+- dotfiles (/. and /..) are not included
++ dotfiles (/. and /..) are not included, if possible
+
+ *********************************************************************************/
+
+ int zfind(cchar *pattern, char **&flist, int &NF)
+ {
+ char **zfind_filelist = 0; // list of filespecs returned
++#ifdef GLOB_PERIOD
+ int globflags = GLOB_PERIOD; // include dotfiles
++#else
++ int globflags = 0;;
++#endif
+ int ii, jj, err, cc;
+ glob_t globdata;
+ char *pp;
+@@ -5805,9 +5850,16 @@ int zinitapp(cchar *appvers, int argc, char *argv[])
+ if (argc > 1 && strmatchV(argv[1],"-ver","-v",0)) exit(0); // exit if nothing else wanted
+
+ progexe = 0;
++#if defined(__linux__)
+ cc = readlink("/proc/self/exe",buff,300); // get my executable program path
+ if (cc <= 0) zexit("readlink() /proc/self/exe) failed");
+ buff[cc] = 0; // readlink() quirk
++#elif defined(__FreeBSD__)
++ const int mib[4] = { CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, -1 };
++ size_t len = sizeof(buff);
++ cc = sysctl(mib, 4, buff, &len, 0x0, 0);
++ if (cc == -1) zexit("sysctl(KERN_PROC_PATHNAME) failed");
++#endif
+ progexe = zstrdup(buff,"zinitapp");
+
+ err = appimage_install(zappname); // if appimage, menu integration
diff --git a/graphics/fotoxx/files/patch-zfuncs.h b/graphics/fotoxx/files/patch-zfuncs.h
index b8f37f435ee6..e020ff283690 100644
--- a/graphics/fotoxx/files/patch-zfuncs.h
+++ b/graphics/fotoxx/files/patch-zfuncs.h
@@ -1,23 +1,31 @@
---- zfuncs.h.orig 2015-05-01 09:40:38 UTC
+--- zfuncs.h.orig 2021-10-17 20:02:26 UTC
+++ zfuncs.h
-@@ -22,17 +22,18 @@
+@@ -17,14 +17,17 @@
- // zfuncs.h version v.6.1
+ *********************************************************************************/
-#include <sys/sysinfo.h>
-+//#include <sys/sysinfo.h>
++#include <sys/param.h>
++#include <sys/cpuset.h>
++#include <sys/sysctl.h>
#include <sys/time.h>
+ #include <sys/timeb.h>
#include <sys/stat.h>
#include <sys/resource.h>
#include <sys/file.h>
#include <sys/utsname.h>
-#include <malloc.h>
-+//#include <malloc.h>
++#include <sys/wait.h>
++#include <vm/vm_param.h>
#include <errno.h>
#include <unistd.h>
#include <stdlib.h>
- #include <stdio.h>
-+#include <sys/wait.h>
- #include <string.h>
- #include <ctype.h>
- #include <math.h>
+@@ -130,6 +133,8 @@ pthread_t start_Jthread(void * threadfunc(void *), voi
+ int wait_Jthread(pthread_t tid); // wait for completion (join thread)
+ void synch_threads(int NT = 0); // synchronize NT threads
+ int main_thread(); // return 1 if main() thread, else 0
++int get_nprocs();
++ // get number of CPUs in the system
+ void set_cpu_affinity(int cpu); // set cpu affinity for calling thread
+ int zshell(cchar *options, cchar *command, ...); // do shell command and get status
+ int zshell_gtk(cchar *options, cchar *command, ...); // same, with parallel gtk mainloop