git: 7d9649083431 - main - graphics/geomorph: update 0.60.1 → 0.63

From: Dmitry Marakasov <amdmi3_at_FreeBSD.org>
Date: Wed, 16 Mar 2022 13:22:42 UTC
The branch main has been updated by amdmi3:

URL: https://cgit.FreeBSD.org/ports/commit/?id=7d96490834314e7e5853222464b25c792a46789c

commit 7d96490834314e7e5853222464b25c792a46789c
Author:     Dmitry Marakasov <amdmi3@FreeBSD.org>
AuthorDate: 2022-03-15 18:57:10 +0000
Commit:     Dmitry Marakasov <amdmi3@FreeBSD.org>
CommitDate: 2022-03-16 12:52:06 +0000

    graphics/geomorph: update 0.60.1 → 0.63
---
 graphics/geomorph/Makefile                         | 23 +++---
 graphics/geomorph/distinfo                         |  5 +-
 graphics/geomorph/files/patch-src-hf-view__area.c  | 10 ---
 .../{patch-src-app-main.c => patch-src_app_main.c} | 83 ++++++++++++----------
 4 files changed, 59 insertions(+), 62 deletions(-)

diff --git a/graphics/geomorph/Makefile b/graphics/geomorph/Makefile
index f3b3ad68fa96..2b69e28970d4 100644
--- a/graphics/geomorph/Makefile
+++ b/graphics/geomorph/Makefile
@@ -1,8 +1,7 @@
 PORTNAME=	geomorph
-PORTVERSION=	0.60.1
-PORTREVISION=	12
+PORTVERSION=	0.63
 CATEGORIES=	graphics
-MASTER_SITES=	SF/${PORTNAME}/${PORTNAME}/0.60/
+MASTER_SITES=	SF
 
 MAINTAINER=	amdmi3@FreeBSD.org
 COMMENT=	Height field generator and editor
@@ -10,31 +9,33 @@ COMMENT=	Height field generator and editor
 LIB_DEPENDS=	libgtkglext-x11-1.0.so:x11-toolkits/gtkglext \
 		libpng.so:graphics/png
 
-USES=		compiler:c++11-lang desktop-file-utils gl gmake pkgconfig \
-		shebangfix
+USES=		autoreconf compiler:c++11-lang desktop-file-utils \
+		gl gmake gnome libtool pkgconfig shebangfix
 SHEBANG_FILES=	update-rc
+USE_GNOME=	gtk20
 USE_GL=		gl glu
 GNU_CONFIGURE=	yes
-CONFIGURE_ARGS=	--with-libintl-prefix="${LOCALBASE}"
-USE_GCC=	yes # lots of severely broken code
 CFLAGS+=	-fcommon
 
-PLIST_SUB=	PORTVERSION=${PORTVERSION}
 PORTDATA=	*
 
 OPTIONS_DEFINE=	NLS
 OPTIONS_SUB=	yes
 
 NLS_USES=		gettext
+NLS_USES_OFF=		gettext-tools
 NLS_CONFIGURE_ENABLE=	nls
 
+pre-build:
+# rebuild bundled linux binary
+	cd ${WRKSRC}/scenes && ${RM} colman && ${CC} ${CFLAGS} ${LDFLAGS} -o colmap colmap.c
+
 post-patch:
 	@${FIND} ${WRKSRC} -type f -exec ${REINPLACE_CMD} -i '' -e 's|/usr/local/share/geomorph|${DATADIR}|' {} \;
-	@${REINPLACE_CMD} -e 's|\$$HOME/geomorph|\$$HOME/.geomorph|' \
+	@${REINPLACE_CMD} -i '' -e 's|\$$HOME/geomorph|\$$HOME/.geomorph|' \
 		${WRKSRC}/install-step* ${WRKSRC}/install-user ${WRKSRC}/update-rc
-	@${REINPLACE_CMD} -e '/DEF_DIR_NAME/ s|geomorph|.geomorph|' \
+	@${REINPLACE_CMD} -i '' -e '/DEF_DIR_NAME/ s|geomorph|.geomorph|' \
 		${WRKSRC}/src/app/globals.h ${WRKSRC}/src/hf/globals.h
-	@${FIND} ${WRKSRC} -name "*.bak" -delete
 
 post-install:
 	${INSTALL_DATA} ${WRKSRC}/geomorph.desktop ${STAGEDIR}${PREFIX}/share/applications/
diff --git a/graphics/geomorph/distinfo b/graphics/geomorph/distinfo
index 839d16259076..4a4cf3f7fd24 100644
--- a/graphics/geomorph/distinfo
+++ b/graphics/geomorph/distinfo
@@ -1,2 +1,3 @@
-SHA256 (geomorph-0.60.1.tar.gz) = 47cdda8c778d5260362d71adfa52eaf556b4f0dfc169c65fa6c809e216c5d572
-SIZE (geomorph-0.60.1.tar.gz) = 749579
+TIMESTAMP = 1647369368
+SHA256 (geomorph-0.63.tar.gz) = 2ec33e57cb75d830a4da75f706dc275c72faf03b2422c841d5845c8adefde904
+SIZE (geomorph-0.63.tar.gz) = 983783
diff --git a/graphics/geomorph/files/patch-src-hf-view__area.c b/graphics/geomorph/files/patch-src-hf-view__area.c
deleted file mode 100644
index d17e1b570a2d..000000000000
--- a/graphics/geomorph/files/patch-src-hf-view__area.c
+++ /dev/null
@@ -1,10 +0,0 @@
---- src/hf/view_area.c.orig	2010-07-31 07:31:37.000000000 +0400
-+++ src/hf/view_area.c	2013-12-24 08:09:42.420751997 +0400
-@@ -20,6 +20,7 @@
- 
-  //	Modified 2005-01-09 for removing double buffering (now auto with GTK2) PSTG
-  
-+#include "../utils/x_alloc.h"
- #include "view_area.h"
- #include <stdlib.h>
- #include <stdio.h>
diff --git a/graphics/geomorph/files/patch-src-app-main.c b/graphics/geomorph/files/patch-src_app_main.c
similarity index 61%
rename from graphics/geomorph/files/patch-src-app-main.c
rename to graphics/geomorph/files/patch-src_app_main.c
index f2efd5de2a6d..c45affce21f6 100644
--- a/graphics/geomorph/files/patch-src-app-main.c
+++ b/graphics/geomorph/files/patch-src_app_main.c
@@ -1,46 +1,50 @@
---- src/app/main.c.orig	2010-10-30 08:17:00.000000000 +0400
-+++ src/app/main.c	2013-08-28 03:51:05.535226256 +0400
-@@ -18,6 +18,7 @@
-  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-  */
+--- src/app/main.c.orig	2021-01-31 03:36:55 UTC
++++ src/app/main.c
+@@ -75,87 +75,22 @@ gchar *find_config_file() {
+ 	gboolean shortcuts;
+ 	glong pathmax;
  
-+#include <sys/param.h>
- #include "./main.h"
- #include "./globals.h"
- #include "./app.h"
-@@ -68,6 +69,12 @@
- 	if (command) x_free(command);
- }
- 
-+char *get_current_dir_name() {
-+	char *buf = malloc(MAXPATHLEN);
-+	getwd(buf);
-+	return buf;
-+}
-+
- gchar *find_config_file() {
- //	Returns the config file name (name OPTION_FILE, defined in globals.h),
- //	with its full path
-@@ -83,59 +90,23 @@
- //	if $HOME/DEF_DIR_NAME doesn't exist, we create the required files
- //	The directory where OPTION_FILE is found becomes the default one (DEF_DIR)
+-//	We try:
+-//	1. in the current directory. (./OPTION_FILE = ./geomorphrc)
+-//	2. if not found, we try ./DEF_DIR_NAME/OPTION_FILE (./geomorph/geomorphrc)
+-//	3. if not found, we try $HOME/OPTION_FILE (~/geomorphrc)
+-//	4. if not found, we try in $HOME/DEF_DIR_NAME (~/geomorph/geomorphrc) 
+-//	--> if OPTION_FILE was not found, and 
+-//	if $HOME/DEF_DIR_NAME doesn't exist, we create the required files
+-//	The directory where OPTION_FILE is found becomes the default one (DEF_DIR)
++	default_dir = concat_dname_fname(getenv("HOME"), DEF_DIR_NAME);
++	path_n_file = path_n_file = concat_dname_fname(default_dir, OPTION_FILE);
  
 -	// Try ./OPTION_FILE
--	default_dir = (gchar *) get_current_dir_name();
--	path_n_file = concat_dname_fname(default_dir,OPTION_FILE);
+-	pathmax = get_pathmax();
+-	default_dir = (gchar *) x_malloc(pathmax*sizeof(gchar),"gchar - default_dir in main.c");
+-	dummy = (gchar *) getcwd(default_dir,pathmax);
+-// printf("Dummy: %p; Current dir name for config file: %p;\n", dummy, default_dir);
+-	path_n_file = concat_dname_fname(dummy,OPTION_FILE);
 -	if (!filexists(path_n_file)) { // Try ./DEF_DIR_NAME/OPTION_FILE
--		default_dir = concat_dname_fname(default_dir,DEF_DIR_NAME);
+-		dummy = default_dir;
+-		default_dir = concat_dname_fname(dummy,DEF_DIR_NAME);
+-		x_free(dummy);
+-		dummy = NULL;
 -		if (path_n_file)
 -			x_free(path_n_file);
 -		path_n_file = concat_dname_fname(default_dir,OPTION_FILE);
 -		if (!filexists(path_n_file)) { // Try in the home directory - ~/OPTION_FILE
+-			x_free(default_dir);
+-#ifdef _WIN32
+-			default_dir = get_windows_home();
+-#else
 -			default_dir = getenv("HOME");
+-#endif
 -			if (path_n_file)
 -				x_free(path_n_file);
 -			path_n_file = concat_dname_fname(default_dir, OPTION_FILE);
 -			if (!filexists(path_n_file)) { // Try ~/DEFAULT_DIR/OPTION_FILE
--				default_dir = concat_dname_fname(default_dir,DEF_DIR_NAME);
--				if (path_n_file) x_free(path_n_file);
+-				dummy = default_dir;				
+-				default_dir = concat_dname_fname(dummy,DEF_DIR_NAME);
+-				// Here we don't free dummy because it comes from getenv
+-				if (path_n_file) 
+-					x_free(path_n_file);
 -				path_n_file = concat_dname_fname(default_dir, OPTION_FILE);
 -				if (directory_exists(default_dir)) {
 -					if (!filexists(path_n_file)) {
@@ -52,7 +56,7 @@
 -					// Geomorph directory ("default_dir") doesn't exist
 -					// Create one with default scenes and rc file
 -					buf = (gchar *) x_malloc(strlen(_("Creation of the default working directory?"))+1+strlen(default_dir), "const gchar (buf - Creation of the default working directory MSG)");
--					sprintf(buf,_("Creation of the default working directory?"),default_dir);
+-					sprintf(buf,_("Creation of the default working directory %s?"),default_dir);
 -					if (!yes_no(buf,TRUE))
 -						exit(0);
 -//					if (buf) x_free(buf);
@@ -76,23 +80,24 @@
 -				if (path_n_file) x_free(path_n_file);
 -				}
 -			}
-+	default_dir = concat_dname_fname(getenv("HOME"), DEF_DIR_NAME);
-+	path_n_file = path_n_file = concat_dname_fname(default_dir, OPTION_FILE);
-+
 +	if (directory_exists(default_dir)) {
 +		if (!filexists(path_n_file)) {
-+			// Big problem, create a default rc file
 +			create_config_file(path_n_file);
  		}
- 	}
-+	else {
++	} else {
 +		command = concat_dname_fname(get_data_dir(),"install-step1-dir");
 +		if (system(command))
 +			my_msg(_("Fatal error during the creation of the default working directory"),ABORT);
 +		if (command) free(command);
 +		create_config_file(path_n_file);
-+	}
+ 	}
+-	dummy = default_dir;
+-	default_dir = add_filesep(dummy);
+-	if (dummy != default_dir)
+-		x_free(dummy);
+-	return default_dir;
 +	if (path_n_file) free(path_n_file);
- 	return add_filesep(default_dir);
++	return add_filesep(default_dir);
  }
  
+ int main( int   argc,