Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 13 Feb 2019 13:52:54 +0000 (UTC)
From:      Alexey Dokuchaev <danfe@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r492857 - in head/editors: . wxhexeditor wxhexeditor/files
Message-ID:  <201902131352.x1DDqsEx019707@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: danfe
Date: Wed Feb 13 13:52:53 2019
New Revision: 492857
URL: https://svnweb.freebsd.org/changeset/ports/492857

Log:
  - Add a port of wxHexEditor, an advanced graphical (wxWidgets) hex editor
    focused on editing of very large files and with x86 disassembly support
  - Ignore bundled copies of `devel/udis86' and `security/mhash' libraries,
    use the ones provided in the ports (also better for security reasons)
  - Disable OpenMP support for now because apparently it requires GCC while
    the port builds just fine with the system compiler (Clang)
  
  WWW: http://www.wxhexeditor.org/

Added:
  head/editors/wxhexeditor/
  head/editors/wxhexeditor/Makefile   (contents, props changed)
  head/editors/wxhexeditor/distinfo   (contents, props changed)
  head/editors/wxhexeditor/files/
  head/editors/wxhexeditor/files/patch-Makefile   (contents, props changed)
  head/editors/wxhexeditor/files/patch-src_FAL.cpp   (contents, props changed)
  head/editors/wxhexeditor/files/patch-src_HexDialogs.cpp   (contents, props changed)
  head/editors/wxhexeditor/files/patch-src_HexEditor.h   (contents, props changed)
  head/editors/wxhexeditor/files/patch-src_HexEditorCtrl_wxHexCtrl_main.cpp   (contents, props changed)
  head/editors/wxhexeditor/files/patch-src_HexEditorCtrl_wxHexCtrl_wxHexCtrl.cpp   (contents, props changed)
  head/editors/wxhexeditor/files/patch-src_HexPanels.h   (contents, props changed)
  head/editors/wxhexeditor/pkg-descr   (contents, props changed)
  head/editors/wxhexeditor/pkg-plist   (contents, props changed)
Modified:
  head/editors/Makefile

Modified: head/editors/Makefile
==============================================================================
--- head/editors/Makefile	Wed Feb 13 12:39:47 2019	(r492856)
+++ head/editors/Makefile	Wed Feb 13 13:52:53 2019	(r492857)
@@ -38,7 +38,7 @@
     SUBDIR += emacs
     SUBDIR += emacs-devel
     SUBDIR += encryptpad
-    SUBDIR += featherpad 
+    SUBDIR += featherpad
     SUBDIR += fileobj
     SUBDIR += flim
     SUBDIR += focuswriter
@@ -251,6 +251,7 @@
     SUBDIR += web-mode
     SUBDIR += with-editor
     SUBDIR += wordgrinder
+    SUBDIR += wxhexeditor
     SUBDIR += xcoral
     SUBDIR += xed
     SUBDIR += xi-core

Added: head/editors/wxhexeditor/Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/editors/wxhexeditor/Makefile	Wed Feb 13 13:52:53 2019	(r492857)
@@ -0,0 +1,31 @@
+# Created by: Alexey Dokuchaev <danfe@FreeBSD.org>
+# $FreeBSD$
+
+PORTNAME=	wxhexeditor
+PORTVERSION=	0.24
+CATEGORIES=	editors
+MASTER_SITES=	SF/${PORTNAME}/wxHexEditor/v${PORTVERSION}%20Beta/
+DISTNAME=	wxHexEditor-v${PORTVERSION}-src
+
+MAINTAINER=	danfe@FreeBSD.org
+COMMENT=	Graphical hex editor for big files with x86 disassembly support
+
+LICENSE=	GPLv2
+
+LIB_DEPENDS=	libudis86.so:devel/udis86 \
+		libmhash.so:security/mhash
+
+USES=		gettext-tools gmake tar:xz
+USE_WX=		3.0+
+MAKE_ARGS=	WXCONFIG="${WX_CONFIG}"
+
+WRKSRC=		${WRKDIR}/wxHexEditor
+
+# Follow the ${MTREE_FILE} which specifies simple, unsuffixed names
+# for these particular locales
+post-patch:
+	@${MV} ${WRKSRC}/locale/hu_HU ${WRKSRC}/locale/hu
+	@${MV} ${WRKSRC}/locale/ja_JP ${WRKSRC}/locale/ja
+	@${MV} ${WRKSRC}/locale/nl_NL ${WRKSRC}/locale/nl
+
+.include <bsd.port.mk>

Added: head/editors/wxhexeditor/distinfo
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/editors/wxhexeditor/distinfo	Wed Feb 13 13:52:53 2019	(r492857)
@@ -0,0 +1,3 @@
+TIMESTAMP = 1514687038
+SHA256 (wxHexEditor-v0.24-src.tar.xz) = a1b893fcc5b2a6e5e971b5fe4116b65f9fed6d317e8cdc6cb9219a0a609fd5ab
+SIZE (wxHexEditor-v0.24-src.tar.xz) = 900868

Added: head/editors/wxhexeditor/files/patch-Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/editors/wxhexeditor/files/patch-Makefile	Wed Feb 13 13:52:53 2019	(r492857)
@@ -0,0 +1,60 @@
+--- Makefile.orig	2017-12-31 02:15:18 UTC
++++ Makefile
+@@ -1,9 +1,9 @@
+ WXCONFIG ?= wx-config
+ HOST=
+-WXCXXFLAGS= `$(WXCONFIG) --cxxflags` -Iudis86 -Imhash/include -MMD -fopenmp -Wall -O2
++WXCXXFLAGS= `$(WXCONFIG) --cxxflags` -MMD -Wall -I$(LOCALBASE)/include
+ WXLDFLAGS = `$(WXCONFIG) --libs` `$(WXCONFIG) --libs aui` `$(WXCONFIG) --libs core`
+-WXCXXFLAGS += -fopenmp
+-LDFLAGS += -lgomp
++#WXCXXFLAGS += -fopenmp
++#LDFLAGS += -lgomp
+ #add this ldflags for WinConsole  "-Wl,--subsystem,console -mconsole" for win-debug
+ #LDFLAGS += -Wl,--subsystem,console -mconsole
+ RC = `$(WXCONFIG) --rescomp`
+@@ -22,7 +22,7 @@ SOURCES= src/HexEditorGui.cpp \
+ 			src/HexEditorCtrl/wxHexCtrl/Tag.cpp\
+ 			src/HexEditorCtrl/HexEditorCtrlGui.cpp\
+ 			src/HexEditorFrame.cpp
+-LIBS = udis86/libudis86/.libs/libudis86.a mhash/lib/.libs/libmhash.a
++LIBS = -ludis86 -lmhash
+ OBJECTS=$(SOURCES:.cpp=.o)
+ DEPENDS=$(OBJECTS:.o=.d)
+ LANGUAGEDIRS=`ls -l ./locale | grep ^d | sed s/.*\ //g;`
+@@ -33,7 +33,7 @@ EXECUTABLE=wxHexEditor
+ EXECUTABLE_WIN=$(EXECUTABLE).exe
+ EXECUTABLE_DIR_MAC=$(EXECUTABLE).app
+ 
+-PREFIX      = /usr
++PREFIX     ?= /usr
+ BINDIR      = $(PREFIX)/bin
+ DATADIR     = $(PREFIX)/share
+ LOCALEDIR   = $(DATADIR)/locale
+@@ -47,7 +47,7 @@ clang: all
+ 
+ all:$(EXECUTABLE) langs
+ 
+-$(OBJECTS): $(LIBS) $(SOURCES)
++$(OBJECTS): $(SOURCES)
+ 
+ MOBJECTS=$(LANGUAGES:.po=.mo)
+ 
+@@ -169,12 +169,12 @@ prepmacdir: langs
+ 		cp locale/$$i/wxHexEditor.mo $(EXECUTABLE_DIR_MAC)/Contents/Resources/locale/$$i/; done
+ 
+ install:
+-	install -D -m 755 $(EXECUTABLE) $(DESTDIR)/$(BINDIR)/$(EXECUTABLE)
+-	install -D -m 644 resources/wxHexEditor.png $(DESTDIR)/$(DATADIR)/pixmaps/wxHexEditor.png
+-	install -D -m 644 resources/wxHexEditor.desktop $(DESTDIR)/$(DATADIR)/applications/wxHexEditor.desktop
++	install -m 755 $(EXECUTABLE) $(DESTDIR)$(BINDIR)/$(EXECUTABLE)
++	install -m 644 resources/wxHexEditor.png $(DESTDIR)$(DATADIR)/pixmaps/wxHexEditor.png
++	install -m 644 resources/wxHexEditor.desktop $(DESTDIR)$(DATADIR)/applications/wxHexEditor.desktop
+ 	@for i in $(LANGUAGEDIRS); do \
+-	   echo "install -D -m 644 locale/$$i/wxHexEditor.mo $(DESTDIR)/$(LOCALEDIR)/$$i/LC_MESSAGES/wxHexEditor.mo"; \
+-	   install -D -m 644 locale/$$i/wxHexEditor.mo $(DESTDIR)/$(LOCALEDIR)/$$i/LC_MESSAGES/wxHexEditor.mo; done
++	   echo "install -m 644 locale/$$i/wxHexEditor.mo $(DESTDIR)$(LOCALEDIR)/$$i/LC_MESSAGES/wxHexEditor.mo"; \
++	   install -m 644 locale/$$i/wxHexEditor.mo $(DESTDIR)$(LOCALEDIR)/$$i/LC_MESSAGES/wxHexEditor.mo; done
+ 
+ uninstall:
+ 	rm -f $(DESTDIR)/$(BINDIR)/$(EXECUTABLE)

Added: head/editors/wxhexeditor/files/patch-src_FAL.cpp
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/editors/wxhexeditor/files/patch-src_FAL.cpp	Wed Feb 13 13:52:53 2019	(r492857)
@@ -0,0 +1,53 @@
+--- src/FAL.cpp.orig	2017-12-31 02:15:18 UTC
++++ src/FAL.cpp
+@@ -39,10 +39,10 @@
+ 	#define PTRACE_POKETEXT PT_WRITE_I
+ #endif
+ 
+-//#if defined BSD
+-//	#define DKIOCGETBLOCKSIZE DIOCGSECTORSIZE	/* Get the sector size of the device in bytes */
+-//	#define DKIOCGETBLOCKCOUNT DIOCGMEDIASIZE	/* Get media size in bytes */
+-//#endif
++#if defined BSD
++	#define DKIOCGETBLOCKSIZE DIOCGSECTORSIZE	/* Get the sector size of the device in bytes */
++	#define DKIOCGETBLOCKCOUNT DIOCGMEDIASIZE	/* Get media size in bytes */
++#endif
+ 
+ 
+ WX_DEFINE_OBJARRAY(ArrayOfNode);
+@@ -208,7 +208,7 @@ bool FAL::OSDependedOpen(wxFileName& myfilename, FileA
+ 		myfilename.GetFullPath().Mid(5).ToLong(&a);
+ 		ProcessID=a;
+ 		RAMProcess=true;
+-		if((ptrace(PTRACE_ATTACH, ProcessID, NULL, NULL)) < 0 ){
++		if((ptrace(PTRACE_ATTACH, ProcessID, NULL, 0)) < 0 ){
+ 			wxMessageBox( _("Process cannot open."),_("Error"), wxOK|wxICON_ERROR );
+ 			ProcessID=-1;
+ 			return false;
+@@ -326,7 +326,7 @@ bool FAL::FALOpen(wxFileName& myfilename, FileAccessMo
+ bool FAL::Close(){
+ 			#ifndef __WXMSW__
+ 			if( ProcessID >=0 )
+-				return ((ptrace(PTRACE_DETACH, ProcessID, NULL, NULL)) >= 0 );
++				return ((ptrace(PTRACE_DETACH, ProcessID, NULL, 0)) >= 0 );
+ 			#endif
+ 			#ifdef __WXMSW__
+ 			if(IsWinDevice( the_file ) ){
+@@ -521,7 +521,7 @@ bool FAL::Apply( void ){
+ 						long word=0;
+ 						//unsigned long *ptr = (unsigned long *) buffer;
+ 						while (rd < rd_size) {
+-							word = ptrace(PTRACE_PEEKTEXT, ProcessID, reinterpret_cast<char*>(StartSector*BlockRWSize+rd), NULL);
++							word = ptrace(PTRACE_PEEKTEXT, ProcessID, reinterpret_cast<char*>(StartSector*BlockRWSize+rd), 0);
+ 							memcpy( bfr+rd , &word, 4);
+ 							rd += 4;
+ 							}
+@@ -803,7 +803,7 @@ long FAL::ReadR( unsigned char* buffer, unsigned size,
+ 				//unsigned long *ptr = (unsigned long *) buffer;
+ 				#ifndef __WXMSW__
+ 				while (rd < rd_size) {
+-					word = ptrace(PTRACE_PEEKTEXT, ProcessID, reinterpret_cast<char*>(StartSector*BlockRWSize+rd), NULL);
++					word = ptrace(PTRACE_PEEKTEXT, ProcessID, reinterpret_cast<char*>(StartSector*BlockRWSize+rd), 0);
+ 					memcpy( bfr+rd , &word, 4);
+ 					rd += 4;
+ 					}

Added: head/editors/wxhexeditor/files/patch-src_HexDialogs.cpp
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/editors/wxhexeditor/files/patch-src_HexDialogs.cpp	Wed Feb 13 13:52:53 2019	(r492857)
@@ -0,0 +1,12 @@
+--- src/HexDialogs.cpp.orig	2017-12-31 02:15:18 UTC
++++ src/HexDialogs.cpp
+@@ -24,7 +24,8 @@
+ #define NANINT 0xFFFFFFFFFFFFFFFFLL
+ #include "HexDialogs.h"
+ #include <wx/progdlg.h>
+-#include "../mhash/include/mhash.h"
++typedef bool _Bool;
++#include <mhash.h>
+ 
+ #ifdef __SSE2__
+ 	#include <emmintrin.h>

Added: head/editors/wxhexeditor/files/patch-src_HexEditor.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/editors/wxhexeditor/files/patch-src_HexEditor.h	Wed Feb 13 13:52:53 2019	(r492857)
@@ -0,0 +1,12 @@
+--- src/HexEditor.h.orig	2017-12-31 02:15:18 UTC
++++ src/HexEditor.h
+@@ -25,7 +25,8 @@
+ #ifndef _wxHexEditor_h_
+ #define _wxHexEditor_h_
+ 
+-#include "../mhash/include/mhash.h"
++typedef bool _Bool;
++#include <mhash.h>
+ 
+ #include <wx/ffile.h>
+ #include <wx/clipbrd.h>

Added: head/editors/wxhexeditor/files/patch-src_HexEditorCtrl_wxHexCtrl_main.cpp
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/editors/wxhexeditor/files/patch-src_HexEditorCtrl_wxHexCtrl_main.cpp	Wed Feb 13 13:52:53 2019	(r492857)
@@ -0,0 +1,11 @@
+--- src/HexEditorCtrl/wxHexCtrl/main.cpp.orig	2017-12-31 02:15:18 UTC
++++ src/HexEditorCtrl/wxHexCtrl/main.cpp
+@@ -60,7 +60,7 @@ MyFrame::MyFrame(wxFrame *frame, const wxString& title
+ #endif // wxUSE_STATUSBAR
+ 
+ 	wxString ch;
+-	for(int j=0 ; j < 90 ; j++ ){
++	for(char j=0 ; j < 90 ; j++ ){
+ 			ch.Append(j);
+ 	hex_ctrl->SetBinValue( ch.char_str(),90,true );
+ 	}

Added: head/editors/wxhexeditor/files/patch-src_HexEditorCtrl_wxHexCtrl_wxHexCtrl.cpp
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/editors/wxhexeditor/files/patch-src_HexEditorCtrl_wxHexCtrl_wxHexCtrl.cpp	Wed Feb 13 13:52:53 2019	(r492857)
@@ -0,0 +1,20 @@
+--- src/HexEditorCtrl/wxHexCtrl/wxHexCtrl.cpp.orig	2017-12-31 02:15:18 UTC
++++ src/HexEditorCtrl/wxHexCtrl/wxHexCtrl.cpp
+@@ -557,7 +557,7 @@ inline wxDC* wxHexCtrl::UpdateDC(wxDC *xdc ){
+ 
+ 					//First half of byte
+ 					RenderedHexByte += CharAt(textLenghtLimit++);
+-					chr = RenderedHexByte.ToAscii()[0];
++					chr = RenderedHexByte.ToAscii()[static_cast<size_t>(0)];
+ 					chrC = atoh( chr ) << 4;
+ 
+ 					//Space could be here
+@@ -569,7 +569,7 @@ inline wxDC* wxHexCtrl::UpdateDC(wxDC *xdc ){
+ 
+ 					//Second half of byte.
+ 					RenderedHexByte += CharAt(textLenghtLimit++);
+-					chr = RenderedHexByte.ToAscii()[1];
++					chr = RenderedHexByte.ToAscii()[static_cast<size_t>(1)];
+ 					chrC |= atoh( chr );
+ 					//chrC = (atoh( RenderedHexByte.ToAscii()[0] ) << 4) | atoh( RenderedHexByte.ToAscii()[1] );
+ 

Added: head/editors/wxhexeditor/files/patch-src_HexPanels.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/editors/wxhexeditor/files/patch-src_HexPanels.h	Wed Feb 13 13:52:53 2019	(r492857)
@@ -0,0 +1,11 @@
+--- src/HexPanels.h.orig	2017-12-31 02:15:18 UTC
++++ src/HexPanels.h
+@@ -27,7 +27,7 @@
+ #include "HexEditorFrame.h"
+ #include "HexEditorCtrl/HexEditorCtrl.h"
+ #include "HexEditorCtrl/wxHexCtrl/wxHexCtrl.h"
+-#include "../udis86/udis86.h"
++#include <udis86.h>
+ 
+ #ifdef WX_GCH
+ #include <wx_pch.h>

Added: head/editors/wxhexeditor/pkg-descr
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/editors/wxhexeditor/pkg-descr	Wed Feb 13 13:52:53 2019	(r492857)
@@ -0,0 +1,4 @@
+Advanced graphical (wxWidgets) hex editor focused on editing of very large
+files and with x86 disassembly support.
+
+WWW: http://www.wxhexeditor.org/

Added: head/editors/wxhexeditor/pkg-plist
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/editors/wxhexeditor/pkg-plist	Wed Feb 13 13:52:53 2019	(r492857)
@@ -0,0 +1,18 @@
+bin/wxHexEditor
+share/applications/wxHexEditor.desktop
+share/locale/ar/LC_MESSAGES/wxHexEditor.mo
+share/locale/cs/LC_MESSAGES/wxHexEditor.mo
+share/locale/de/LC_MESSAGES/wxHexEditor.mo
+share/locale/es/LC_MESSAGES/wxHexEditor.mo
+share/locale/fr/LC_MESSAGES/wxHexEditor.mo
+share/locale/hu/LC_MESSAGES/wxHexEditor.mo
+share/locale/it/LC_MESSAGES/wxHexEditor.mo
+share/locale/ja/LC_MESSAGES/wxHexEditor.mo
+share/locale/nl/LC_MESSAGES/wxHexEditor.mo
+share/locale/pl/LC_MESSAGES/wxHexEditor.mo
+share/locale/pt_BR/LC_MESSAGES/wxHexEditor.mo
+share/locale/ro/LC_MESSAGES/wxHexEditor.mo
+share/locale/ru/LC_MESSAGES/wxHexEditor.mo
+share/locale/tr/LC_MESSAGES/wxHexEditor.mo
+share/locale/zh_CN/LC_MESSAGES/wxHexEditor.mo
+share/pixmaps/wxHexEditor.png



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201902131352.x1DDqsEx019707>