Skip to content

Commit

Permalink
x11-fm/4pane: new port had been added (+)
Browse files Browse the repository at this point in the history
4Pane is a multi-pane, detailed-list file manager for Unix-like
systems.  It is designed to be fully-featured without bloat, and
aims for speed rather than visual effects.

The program relies on some GNU/Linux utilities and API to manage
disks and mounts.  Non-portable calls to getmntent(3) et al. had
been replaced with our native getmntinfo(3) ones.  However, full
storage support is still lacking, owing to limited blkid(8) and
lsblk(8) functionality and inconsistent naming of different file
systems between GNU/Linux and FreeBSD.
  • Loading branch information
Alexey Dokuchaev authored and Alexey Dokuchaev committed Nov 15, 2022
1 parent d7ab8a1 commit 7863be8
Show file tree
Hide file tree
Showing 9 changed files with 732 additions and 0 deletions.
23 changes: 23 additions & 0 deletions x11-fm/4pane/Makefile
@@ -0,0 +1,23 @@
PORTNAME= 4pane
PORTVERSION= 7.0
CATEGORIES= x11-fm
MASTER_SITES= SF/fourpane/${PORTVERSION}

MAINTAINER= danfe@FreeBSD.org
COMMENT= Multi-pane, detailed-list graphical file manager
WWW= http://www.4pane.co.uk/

LICENSE= GPLv3

USES= pkgconfig
USE_WX= 3.0+
GNU_CONFIGURE= yes
CONFIGURE_ARGS= --with-wx-config="${WX_CONFIG}"

OPTIONS_DEFINE= NLS
OPTIONS_SUB= yes

NLS_USES= gettext
NLS_CONFIGURE_OFF= --disable-locale

.include <bsd.port.mk>
3 changes: 3 additions & 0 deletions x11-fm/4pane/distinfo
@@ -0,0 +1,3 @@
TIMESTAMP = 1607257783
SHA256 (4pane-7.0.tar.gz) = 09716c4000ba193db128d97d04e6bc8c9dfebf11e2755bfc071ce1db339d8b80
SIZE (4pane-7.0.tar.gz) = 2113199
342 changes: 342 additions & 0 deletions x11-fm/4pane/files/patch-Devices.cpp

Large diffs are not rendered by default.

26 changes: 26 additions & 0 deletions x11-fm/4pane/files/patch-Devices.h
@@ -0,0 +1,26 @@
--- Devices.h.orig 2020-11-22 11:43:42 UTC
+++ Devices.h
@@ -13,7 +13,11 @@
#include "wx/config.h"

#include <fstab.h>
+#ifdef __linux__
#include <mntent.h>
+#else
+#include <sys/mount.h>
+#endif

#include "Externs.h"

@@ -310,7 +314,11 @@ void OnUnMountNetwork();
void OnMountSshfs();
void OnMountSamba();
void OnUnMountNetwork();
+#ifdef __linux__
static struct mntent* ReadMtab(const wxString& partition, bool DvdRamFS=false); // Goes thru mtab, to find if 'partition' currently mounted. If DvdRamFS, ignores eg subfs mounts (used for DVD-RAM)
+#else
+static struct statfs* ReadMtab(const wxString& partition, bool DvdRamFS=false);
+#endif
static struct fstab* ReadFstab(const wxString& dev, const wxString& uuid = "", const wxString& label = ""); // Search fstab for a line for this device
static struct fstab* ReadFstab(const PartitionStruct* ps) { return ReadFstab(ps->device, ps->uuid, ps->label); }
static bool FindUnmountedFstabEntry(wxString& dev, wxArrayString& answerarray); // Ditto but only returning Unmounted entries. Used for DVD-RAM
33 changes: 33 additions & 0 deletions x11-fm/4pane/files/patch-Misc.cpp
@@ -0,0 +1,33 @@
--- Misc.cpp.orig 2020-11-19 18:24:13 UTC
+++ Misc.cpp
@@ -511,7 +511,7 @@ wxArrayString output, errors;
wxCHECK_MSG(!lib.empty(), "", "Empty parameter");

wxArrayString output, errors;
-long ans = wxExecute("sh -c \"/sbin/ldconfig -p | grep " + lib + '\"', output,errors);
+long ans = wxExecute("sh -c \"/sbin/ldconfig -r | grep " + lib + '\"', output,errors);
if (ans != 0 || output.IsEmpty()) return "";

wxString fpath = output.Item(0).AfterLast(' ');
@@ -666,7 +666,12 @@ if (clientDC) delete clientDC;
#endif
//-----------------------------------------------------------------------------------------------------------------------

+#ifdef __linux__
#include <pty.h>
+#else
+#include <termios.h>
+#include <libutil.h>
+#endif
#include <errno.h>
#include <sys/wait.h>

@@ -779,7 +784,7 @@ if (cmd.empty()) return ERROR_RETURN_CODE;
{
if (cmd.empty()) return ERROR_RETURN_CODE;

-if (wxGetOsDescription().Contains(wxT("kFreeBSD"))) // The kFreeBSD forkpty hangs
+if (wxGetOsDescription().Contains(wxT("FreeBSD"))) // FreeBSD's forkpty() hangs
{ if (GetCallerTextCtrl())
InformCallerOnTerminate();
return ERROR_RETURN_CODE;
102 changes: 102 additions & 0 deletions x11-fm/4pane/files/patch-Mounts.cpp
@@ -0,0 +1,102 @@
--- Mounts.cpp.orig 2020-11-22 11:42:50 UTC
+++ Mounts.cpp
@@ -866,8 +866,13 @@ for (size_t n=0; n < parent->PartitionArray->GetCount(
if (parent->PartitionArray->Item(n)->device == dev.BeforeFirst(' ')) // BeforeFirst in case of "/dev/sda1 $UUID/$LABEL"
{ if (GetDataFromMtab) // If we're unmounting, we can't rely on the PartitionArray info: the partition may not have been mounted where fstab intended
{ FstabMountptTxt->Clear();
+#ifdef __linux__
struct mntent* mnt = parent->ReadMtab(dev.BeforeFirst(' ')); // So see where it really is
if (mnt != NULL) FstabMountptTxt->ChangeValue(wxString(mnt->mnt_dir, wxConvUTF8));
+#else
+ struct statfs* mnt = parent->ReadMtab(dev.BeforeFirst(' '));
+ if (mnt != NULL) FstabMountptTxt->ChangeValue(wxString(mnt->f_mntonname, wxConvUTF8));
+#endif
return;
}
else
@@ -968,10 +973,18 @@ FstabMt = (InFstab ? wxString(fs->fs_file, wxConvUTF8)
InFstab = (fs != NULL); // Store or null the data according to the result
FstabMt = (InFstab ? wxString(fs->fs_file, wxConvUTF8) : wxT(""));

+#ifdef __linux__
struct mntent* mnt = DeviceAndMountManager::ReadMtab(Image); // Now read mtab to see if the share's already mounted
+#else
+struct statfs* mnt = DeviceAndMountManager::ReadMtab(Image);
+#endif
IsMounted = (mnt != NULL);
AlreadyMounted->Show(IsMounted); GetSizer()->Layout(); // If it is mounted, expose the wxStaticTxt that says so (and Layout, else 2.8.0 displays it in top left corner!)
+#ifdef __linux__
AtMountPt = (IsMounted ? wxString(mnt->mnt_dir, wxConvUTF8) : wxT("")); // Store any mountpt, or delete any previous entry
+#else
+AtMountPt = (IsMounted ? wxString(mnt->f_mntonname, wxConvUTF8) : wxT(""));
+#endif
if (IsMounted)
MountptCombo->SetValue(AtMountPt); // Put any mountpt in the combobox
else if (InFstab)
@@ -1209,11 +1222,19 @@ FstabMt = (InFstab ? wxString(fs->fs_file, wxConvUTF8)
InFstab = (fs != NULL); // Store or null the data according to the result
FstabMt = (InFstab ? wxString(fs->fs_file, wxConvUTF8) : wxT(""));

+#ifdef __linux__
struct mntent* mnt = DeviceAndMountManager::ReadMtab(device1); // Now read mtab to see if the share's already mounted
+#else
+struct statfs* mnt = DeviceAndMountManager::ReadMtab(device1);
+#endif
if (mnt == NULL) mnt = DeviceAndMountManager::ReadMtab(device2); // Null means not found, so try again with the IP version
IsMounted = (mnt != NULL);
AlreadyMounted->Show(IsMounted); GetSizer()->Layout(); // If it is mounted, expose the wxStaticTxt that says so (and Layout, else 2.8.0 displays it in top left corner!)
+#ifdef __linux__
AtMountPt = (IsMounted ? wxString(mnt->mnt_dir, wxConvUTF8) : wxT("")); // Store any mountpt, or delete any previous entry
+#else
+AtMountPt = (IsMounted ? wxString(mnt->f_mntonname, wxConvUTF8) : wxT(""));
+#endif
if (IsMounted)
MountptCombo->SetValue(AtMountPt);
else if (InFstab)
@@ -1503,10 +1524,18 @@ FstabMt = (InFstab ? wxString(fs->fs_file, wxConvUTF8)
InFstab = (fs != NULL); // Store or null the data according to the result
FstabMt = (InFstab ? wxString(fs->fs_file, wxConvUTF8) : wxT(""));

+#ifdef __linux__
mntent* mnt = DeviceAndMountManager::ReadMtab(device); // Now read mtab to see if the share's already mounted
+#else
+struct statfs* mnt = DeviceAndMountManager::ReadMtab(device);
+#endif
IsMounted = (mnt != NULL);
AlreadyMounted->Show(IsMounted); GetSizer()->Layout(); // If it is mounted, expose the wxStaticTxt that says so (and Layout, else 2.8.0 displays it in top left corner!)
+#ifdef __linux__
AtMountPt = (IsMounted ? wxString(mnt->mnt_dir, wxConvUTF8) : wxT("")); // Store any mountpt, or delete any previous entry
+#else
+AtMountPt = (IsMounted ? wxString(mnt->f_mntonname, wxConvUTF8) : wxT(""));
+#endif

if (IsMounted)
MountptCombo->SetValue(AtMountPt);
@@ -1736,6 +1765,7 @@ void UnMountSambaDialog::SearchForNetworkMounts() //

void UnMountSambaDialog::SearchForNetworkMounts() // Scans mtab for established NFS & samba mounts
{
+#ifdef __linux__
FILE* fmp = setmntent (_PATH_MOUNTED, "r"); // Get a file* to (probably) /etc/mtab
if (fmp==NULL) return;

@@ -1749,6 +1779,19 @@ while (1)
{ struct PartitionStruct* newmnt = new struct PartitionStruct;
newmnt->device = wxString(mnt->mnt_fsname, wxConvUTF8);
newmnt->mountpt = wxString(mnt->mnt_dir, wxConvUTF8);
+#else
+struct statfs *fslist;
+
+int numfs = getmntinfo(&fslist, MNT_NOWAIT);
+if (numfs < 1) return;
+
+for (int i = 0; i < numfs; ++i)
+ { wxString type(fslist[i].f_fstypename, wxConvUTF8);
+ if (ParseNetworkFstype(type) != MT_invalid)
+ { struct PartitionStruct* newmnt = new struct PartitionStruct;
+ newmnt->device = wxString(fslist[i].f_mntfromname, wxConvUTF8);
+ newmnt->mountpt = wxString(fslist[i].f_mntonname, wxConvUTF8);
+#endif
newmnt->type = type;
Mntarray.Add(newmnt);
}
6 changes: 6 additions & 0 deletions x11-fm/4pane/pkg-descr
@@ -0,0 +1,6 @@
4Pane is a multi-pane, detailed-list file manager for Unix-like systems.
It is designed to be fully-featured without bloat, and aims for speed
rather than visual effects. In addition to standard file manager things,
it offers multiple undo and redo of most operations (including deletions),
archive management including "virtual browsing" inside archives, multiple
renaming/duplication of files, terminal emulator, and user-defined tools.
196 changes: 196 additions & 0 deletions x11-fm/4pane/pkg-plist
@@ -0,0 +1,196 @@
bin/4Pane
bin/4pane
share/4Pane/bitmaps/4Pane.png
share/4Pane/bitmaps/4PaneIcon16.xpm
share/4Pane/bitmaps/4PaneIcon32.xpm
share/4Pane/bitmaps/4PaneIcon40x32.xpm
share/4Pane/bitmaps/4PaneIcon48.png
share/4Pane/bitmaps/4PaneIcon48.xpm
share/4Pane/bitmaps/DelTab.png
share/4Pane/bitmaps/DnDSelectedCursor.png
share/4Pane/bitmaps/DnDStdCursor.png
share/4Pane/bitmaps/MyDocuments.xpm
share/4Pane/bitmaps/NewTab.png
share/4Pane/bitmaps/Preview.png
share/4Pane/bitmaps/UsbMem.xpm
share/4Pane/bitmaps/UsbMulticard.xpm
share/4Pane/bitmaps/UsbPen.xpm
share/4Pane/bitmaps/abiword.png
share/4Pane/bitmaps/back.xpm
share/4Pane/bitmaps/bm1_button.xpm
share/4Pane/bitmaps/bm2_button.xpm
share/4Pane/bitmaps/bm3_button.xpm
share/4Pane/bitmaps/cdda.png
share/4Pane/bitmaps/cdr.xpm
share/4Pane/bitmaps/cdrom.xpm
share/4Pane/bitmaps/chrome-chromium.png
share/4Pane/bitmaps/clear_right.xpm
share/4Pane/bitmaps/connect_no.xpm
share/4Pane/bitmaps/dir_up.xpm
share/4Pane/bitmaps/down.xpm
share/4Pane/bitmaps/dragicon.png
share/4Pane/bitmaps/evince.xpm
share/4Pane/bitmaps/featherpad.png
share/4Pane/bitmaps/fileopen.xpm
share/4Pane/bitmaps/firefox.png
share/4Pane/bitmaps/floppy.xpm
share/4Pane/bitmaps/forward.xpm
share/4Pane/bitmaps/gedit.xpm
share/4Pane/bitmaps/gjots.png
share/4Pane/bitmaps/gohome.xpm
share/4Pane/bitmaps/gphoto2.png
share/4Pane/bitmaps/harddisk-usb.xpm
share/4Pane/bitmaps/harddisk.xpm
share/4Pane/bitmaps/hardlink.png
share/4Pane/bitmaps/help.png
share/4Pane/bitmaps/iceweasel.png
share/4Pane/bitmaps/kedit.xpm
share/4Pane/bitmaps/kwrite.xpm
share/4Pane/bitmaps/largedropdown.png
share/4Pane/bitmaps/largedropdown.xpm
share/4Pane/bitmaps/libreoffice.png
share/4Pane/bitmaps/mate-text-editor.png
share/4Pane/bitmaps/mousepad.png
share/4Pane/bitmaps/mozillacrystal.png
share/4Pane/bitmaps/mtp.png
share/4Pane/bitmaps/new_dir.xpm
share/4Pane/bitmaps/openoffice.png
share/4Pane/bitmaps/palemoon.png
share/4Pane/bitmaps/photocopier_0.png
share/4Pane/bitmaps/photocopier_1.png
share/4Pane/bitmaps/photocopier_10.png
share/4Pane/bitmaps/photocopier_11.png
share/4Pane/bitmaps/photocopier_12.png
share/4Pane/bitmaps/photocopier_13.png
share/4Pane/bitmaps/photocopier_14.png
share/4Pane/bitmaps/photocopier_15.png
share/4Pane/bitmaps/photocopier_16.png
share/4Pane/bitmaps/photocopier_17.png
share/4Pane/bitmaps/photocopier_18.png
share/4Pane/bitmaps/photocopier_19.png
share/4Pane/bitmaps/photocopier_2.png
share/4Pane/bitmaps/photocopier_20.png
share/4Pane/bitmaps/photocopier_21.png
share/4Pane/bitmaps/photocopier_22.png
share/4Pane/bitmaps/photocopier_23.png
share/4Pane/bitmaps/photocopier_24.png
share/4Pane/bitmaps/photocopier_25.png
share/4Pane/bitmaps/photocopier_26.png
share/4Pane/bitmaps/photocopier_27.png
share/4Pane/bitmaps/photocopier_28.png
share/4Pane/bitmaps/photocopier_29.png
share/4Pane/bitmaps/photocopier_3.png
share/4Pane/bitmaps/photocopier_30.png
share/4Pane/bitmaps/photocopier_31.png
share/4Pane/bitmaps/photocopier_32.png
share/4Pane/bitmaps/photocopier_33.png
share/4Pane/bitmaps/photocopier_34.png
share/4Pane/bitmaps/photocopier_35.png
share/4Pane/bitmaps/photocopier_36.png
share/4Pane/bitmaps/photocopier_37.png
share/4Pane/bitmaps/photocopier_38.png
share/4Pane/bitmaps/photocopier_39.png
share/4Pane/bitmaps/photocopier_4.png
share/4Pane/bitmaps/photocopier_40.png
share/4Pane/bitmaps/photocopier_41.png
share/4Pane/bitmaps/photocopier_42.png
share/4Pane/bitmaps/photocopier_43.png
share/4Pane/bitmaps/photocopier_5.png
share/4Pane/bitmaps/photocopier_6.png
share/4Pane/bitmaps/photocopier_7.png
share/4Pane/bitmaps/photocopier_8.png
share/4Pane/bitmaps/photocopier_9.png
share/4Pane/bitmaps/seamonkey.png
share/4Pane/bitmaps/smalldropdown.png
share/4Pane/bitmaps/smalldropdown.xpm
share/4Pane/bitmaps/softlink.png
share/4Pane/bitmaps/toparent.xpm
share/4Pane/bitmaps/unknown.xpm
share/4Pane/rc/4Pane.desktop
share/4Pane/rc/configuredialogs.xrc
share/4Pane/rc/dialogs.xrc
share/4Pane/rc/moredialogs.xrc
share/doc/4Pane/About.htm
share/doc/4Pane/Archive.htm
share/doc/4Pane/ArchiveBrowse.htm
share/doc/4Pane/Bookmarks.htm
share/doc/4Pane/Chapt.con
share/doc/4Pane/Chapt.hhc
share/doc/4Pane/Chapt.hhk
share/doc/4Pane/Chapt.hhp
share/doc/4Pane/Configure.htm
share/doc/4Pane/ConfigureUserDefTools.htm
share/doc/4Pane/ConfiguringDevices.htm
share/doc/4Pane/ConfiguringDisplay.htm
share/doc/4Pane/ConfiguringMisc.htm
share/doc/4Pane/ConfiguringNetworks.htm
share/doc/4Pane/ConfiguringShortcuts.htm
share/doc/4Pane/ConfiguringTerminals.htm
share/doc/4Pane/Contents.htm
share/doc/4Pane/ContextMenu.htm
share/doc/4Pane/Copier.png
share/doc/4Pane/Devices.htm
share/doc/4Pane/Display.htm
share/doc/4Pane/DnD.htm
share/doc/4Pane/DnDSelectedCursor.png
share/doc/4Pane/DnDStdCursor.png
share/doc/4Pane/Edit.htm
share/doc/4Pane/Editors.htm
share/doc/4Pane/Export.htm
share/doc/4Pane/FAQ.htm
share/doc/4Pane/Features.htm
share/doc/4Pane/FileviewCols.htm
share/doc/4Pane/Filter.htm
share/doc/4Pane/Hardlink.png
share/doc/4Pane/Introduction.htm
share/doc/4Pane/KeyboardNavigation.htm
share/doc/4Pane/Licence.htm
share/doc/4Pane/Menu.htm
share/doc/4Pane/Mount.htm
share/doc/4Pane/Move.png
share/doc/4Pane/MultipleRenDup.htm
share/doc/4Pane/Open.htm
share/doc/4Pane/OpenWith.htm
share/doc/4Pane/Options.htm
share/doc/4Pane/Previews.htm
share/doc/4Pane/Properties.htm
share/doc/4Pane/Quickstart.htm
share/doc/4Pane/RAQ.htm
share/doc/4Pane/RegExpHelp.htm
share/doc/4Pane/Running.htm
share/doc/4Pane/Softlink.png
share/doc/4Pane/Statusbar.htm
share/doc/4Pane/Tabs.htm
share/doc/4Pane/TerminalEm.htm
share/doc/4Pane/Toolbar.htm
share/doc/4Pane/Tools.htm
share/doc/4Pane/UnRedo.htm
share/doc/4Pane/Using4Pane.htm
share/doc/4Pane/View.htm
share/doc/4Pane/back.gif
share/doc/4Pane/forward.gif
share/doc/4Pane/up.gif
share/icons/hicolor/48x48/apps/4Pane.png
share/icons/hicolor/scalable/apps/4Pane.svg
%%NLS%%share/locale/ar/LC_MESSAGES/4Pane.mo
%%NLS%%share/locale/ca/LC_MESSAGES/4Pane.mo
%%NLS%%share/locale/da/LC_MESSAGES/4Pane.mo
%%NLS%%share/locale/de/LC_MESSAGES/4Pane.mo
%%NLS%%share/locale/el/LC_MESSAGES/4Pane.mo
%%NLS%%share/locale/es/LC_MESSAGES/4Pane.mo
%%NLS%%share/locale/et/LC_MESSAGES/4Pane.mo
%%NLS%%share/locale/fa/LC_MESSAGES/4Pane.mo
%%NLS%%share/locale/fi_FI/LC_MESSAGES/4Pane.mo
%%NLS%%share/locale/fr/LC_MESSAGES/4Pane.mo
%%NLS%%share/locale/fr_FR/LC_MESSAGES/4Pane.mo
%%NLS%%share/locale/it/LC_MESSAGES/4Pane.mo
%%NLS%%share/locale/ja/LC_MESSAGES/4Pane.mo
%%NLS%%share/locale/nl/LC_MESSAGES/4Pane.mo
%%NLS%%share/locale/pl/LC_MESSAGES/4Pane.mo
%%NLS%%share/locale/pt_BR/LC_MESSAGES/4Pane.mo
%%NLS%%share/locale/ru/LC_MESSAGES/4Pane.mo
%%NLS%%share/locale/tr/LC_MESSAGES/4Pane.mo
%%NLS%%share/locale/uk_UA/LC_MESSAGES/4Pane.mo
%%NLS%%share/locale/vi/LC_MESSAGES/4Pane.mo
%%NLS%%share/locale/zh_CN/LC_MESSAGES/4Pane.mo
share/metainfo/4Pane.appdata.xml

0 comments on commit 7863be8

Please sign in to comment.