Date: Thu, 2 Nov 2006 02:00:31 +0900 From: KATO Tsuguru <tkato432@yahoo.com> To: FreeBSD-gnats-submit@FreeBSD.org Subject: ports/105035: Update port: science/gdis to 0.89 Message-ID: <20061102020031.8034f804.tkato432@yahoo.com> Resent-Message-ID: <200611011710.kA1HAUfS022938@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 105035 >Category: ports >Synopsis: Update port: science/gdis to 0.89 >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Wed Nov 01 17:10:29 GMT 2006 >Closed-Date: >Last-Modified: >Originator: KATO Tsuguru >Release: FreeBSD 4.11-RELEASE-p22 i386 >Organization: >Environment: >Description: - Update to veresion 0.89 New file: files/patch-crystal_graph.c files/patch-file_bgf.c files/patch-file_cgf.c files/patch-gui_monty.c files/patch-gui_siesta.c files/patch-molsurf.c >How-To-Repeat: >Fix: diff -urN /usr/ports/science/gdis/Makefile science/gdis/Makefile --- /usr/ports/science/gdis/Makefile Wed Jul 19 13:50:10 2006 +++ science/gdis/Makefile Thu Nov 2 00:31:58 2006 @@ -7,8 +7,7 @@ # PORTNAME= gdis -PORTVERSION= 0.86 -PORTREVISION= 3 +PORTVERSION= 0.89 CATEGORIES= science MASTER_SITES= ${MASTER_SITE_SOURCEFORGE} MASTER_SITE_SUBDIR= ${PORTNAME} @@ -21,36 +20,27 @@ USE_GL= yes USE_GNOME= gtk20 +USE_GMAKE= yes +MAKEFILE= makefile +MAKE_ARGS= CC="${CC}" CFLAGS="${CFLAGS}" +ALL_TARGET= ${PORTNAME} CFLAGS+= -DINSTALL=\"\\\"${DATADIR}\\\"\" -PORTDOCS= CHANGELOG README TODO gdis_manual.txt -PLIST_FILES= bin/gdis %%DATADIR%%/gdis.elements +PORTDOCS= CHANGELOG README TODO +PLIST_FILES= bin/gdis %%DATADIR%%/gdis.elements %%DATADIR%%/gdis.library \ + %%DATADIR%%/gdis.manual PLIST_DIRS= %%DATADIR%% -post-patch: - @${FIND} ${WRKSRC} -name "*.c" | ${XARGS} ${REINPLACE_CMD} -e \ - 's|<sys/dir.h>|<dirent.h>|g ; \ - s|struct direct|struct dirent|g' - -do-configure: - @${SED} 's|SRC.*=|SRCS=|g' < ${WRKSRC}/makefile.src > ${WRKSRC}/Makefile - @${ECHO_CMD} 'PROG=gdis' >> ${WRKSRC}/Makefile - @${ECHO_CMD} 'CFLAGS+=`pkg-config --cflags gtk+-2.0 gthread-2.0 gtkglext-1.0`' >> ${WRKSRC}/Makefile - @${ECHO_CMD} 'LDADD=`pkg-config --libs gtk+-2.0 gthread-2.0 gtkglext-1.0`' >> ${WRKSRC}/Makefile - @${ECHO_CMD} 'PREFIX?=/usr/local' >> ${WRKSRC}/Makefile - @${ECHO_CMD} 'DESTDIR=$${PREFIX}' >> ${WRKSRC}/Makefile - @${ECHO_CMD} 'BINDIR=/bin' >> ${WRKSRC}/Makefile - @${ECHO_CMD} 'NOMAN=true' >> ${WRKSRC}/Makefile - @${ECHO_CMD} '.include <bsd.prog.mk>' >> ${WRKSRC}/Makefile - do-install: ${INSTALL_PROGRAM} ${WRKSRC}/gdis ${PREFIX}/bin @${MKDIR} ${DATADIR} - ${INSTALL_DATA} ${WRKSRC}/gdis.elements ${DATADIR} +.for file in gdis.elements gdis.library gdis.manual + ${INSTALL_DATA} ${WRKSRC}/${file} ${DATADIR} +.endfor .if !defined(NOPORTDOCS) @${MKDIR} ${DOCSDIR} -.for file in CHANGELOG README TODO gdis_manual.txt +.for file in CHANGELOG README TODO ${INSTALL_DATA} ${WRKSRC}/${file} ${DOCSDIR} .endfor .endif diff -urN /usr/ports/science/gdis/distinfo science/gdis/distinfo --- /usr/ports/science/gdis/distinfo Sat Nov 26 19:30:46 2005 +++ science/gdis/distinfo Wed Nov 1 21:37:36 2006 @@ -1,3 +1,3 @@ -MD5 (gdis-0.86-source.tgz) = 55d3db8b382001300abe1795b1320a4b -SHA256 (gdis-0.86-source.tgz) = 1348b6f151e532852743ce4d0fc528efacbc500bef1f5d27c0b0fc6f1e290840 -SIZE (gdis-0.86-source.tgz) = 649570 +MD5 (gdis-0.89-source.tgz) = 81da7f83b5eb8b7fc6c6a66416221373 +SHA256 (gdis-0.89-source.tgz) = 594e9c199d1911e2b3d4da0a704e8cf14e7813c099e1bfdde294abb4895dfcec +SIZE (gdis-0.89-source.tgz) = 829113 diff -urN /usr/ports/science/gdis/files/patch-crystal_graph.c science/gdis/files/patch-crystal_graph.c --- /usr/ports/science/gdis/files/patch-crystal_graph.c Thu Jan 1 09:00:00 1970 +++ science/gdis/files/patch-crystal_graph.c Thu Nov 2 00:00:39 2006 @@ -0,0 +1,71 @@ +--- crystal_graph.c.orig Thu Nov 24 15:07:31 2005 ++++ crystal_graph.c Thu Nov 2 00:00:23 2006 +@@ -110,6 +110,9 @@ + gdouble run_gulp(GSList *cores, gchar *species) + { + struct model_pak *new_model, *result_model; ++ gchar *cmd; ++ gdouble result; ++ + new_model = g_malloc(sizeof(struct model_pak)); + result_model = g_malloc(sizeof(struct model_pak)); + +@@ -128,13 +131,13 @@ + new_model->periodic = 0; + + write_gulp(new_model->gulp.temp_file, new_model); +- gchar * cmd = g_strdup_printf("%s < %s > %s", sysenv.gulp_path, ++ cmd = g_strdup_printf("%s < %s > %s", sysenv.gulp_path, + new_model->gulp.temp_file, new_model->gulp.out_file); + system(cmd); + g_free(cmd); + + read_gulp_output(new_model->gulp.out_file, result_model); +- gdouble result = result_model->gulp.energy; ++ result = result_model->gulp.energy; + model_free(new_model); + model_free(result_model); + +@@ -156,6 +159,9 @@ + gint b_images =(gint) model->monty.image_y + 0.5; + gint c_images =(gint) model->monty.image_z + 0.5; + ++ gint nr_molecules; ++ gdouble * single_energies; ++ + /* checks */ + g_return_val_if_fail(sysenv.gulp_path != NULL, 4); + g_return_val_if_fail(model != NULL, 1); +@@ -165,7 +171,7 @@ + gui_text_show(ERROR, "Can not calculate a crystal graph for non crystalline models"); + return 3; + } +- gint nr_molecules = g_slist_length(model->moles); ++ nr_molecules = g_slist_length(model->moles); + /* initialize the key chunk to hold the maximum number of */ + key_chunk = g_mem_chunk_create(gint, + nr_molecules * nr_molecules *(2*a_images+1)*(2*b_images+1)*(2*c_images+1), +@@ -180,7 +186,7 @@ + type_dreiding_gasteiger(model, DREIDING); + + /* calculate the single energies */ +- gdouble * single_energies = g_new0(gdouble, nr_molecules); ++ single_energies = g_new0(gdouble, nr_molecules); + + for (mol_iter = model->moles; mol_iter; mol_iter = mol_iter->next) + { +@@ -218,12 +224,13 @@ + if (pair != NULL) + { + gdouble *key_ptr; ++ gchar * combination; + key_ptr = g_chunk_new(gdouble, key_chunk); + *key_ptr = run_gulp(pair, model->gulp.species); + *key_ptr *= 96.48474; //eV --> kJ / mol + *key_ptr -= single_energies[m1]; + *key_ptr -= single_energies[m2]; +- gchar * combination = g_strdup_printf(" %i - %i [ %i %i %i ]", m1+1, m2+1, x,y,z); ++ combination = g_strdup_printf(" %i - %i [ %i %i %i ]", m1+1, m2+1, x,y,z); + g_tree_insert(tree, key_ptr, combination); + } + } diff -urN /usr/ports/science/gdis/files/patch-file_bgf.c science/gdis/files/patch-file_bgf.c --- /usr/ports/science/gdis/files/patch-file_bgf.c Thu Jan 1 09:00:00 1970 +++ science/gdis/files/patch-file_bgf.c Thu Nov 2 00:04:26 2006 @@ -0,0 +1,20 @@ +--- file_bgf.c.orig Thu Nov 24 13:58:48 2005 ++++ file_bgf.c Thu Nov 2 00:04:15 2006 +@@ -140,7 +140,7 @@ + gint read_bgf(gchar *filename, struct model_pak *data) + { + gint n=0, w, i, num_tokens; +- gchar **buff, **buff2, line[LINELEN]; ++ gchar **buff, **buff2, line[LINELEN], *species_string; + struct core_pak *core, *core_bond_to; + + GHashTable * atom_types_and_labels = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free); +@@ -278,7 +278,7 @@ + } + + /* allocate 25 characters for each species line, that should be enough */ +- gchar * species_string = g_new(gchar, g_hash_table_size(atom_types_and_labels) * 25 ); ++ species_string = g_new(gchar, g_hash_table_size(atom_types_and_labels) * 25 ); + /* get all species from the hash table */ + g_hash_table_foreach(atom_types_and_labels, species_line_from_hash_table, &species_string); + diff -urN /usr/ports/science/gdis/files/patch-file_cgf.c science/gdis/files/patch-file_cgf.c --- /usr/ports/science/gdis/files/patch-file_cgf.c Thu Jan 1 09:00:00 1970 +++ science/gdis/files/patch-file_cgf.c Thu Nov 2 00:10:57 2006 @@ -0,0 +1,69 @@ +--- file_cgf.c.orig Thu Nov 24 13:58:48 2005 ++++ file_cgf.c Thu Nov 2 00:10:25 2006 +@@ -188,7 +188,7 @@ + GSList *core_iter, *bond_iter;//, + GSList *primary_cores = NULL; + FILE *fp; +- gint nr_primary_cores = 0, max_bonds = 0, bond_counter = 0, num_tokens = 0, offset_counter = 0; ++ gint nr_primary_cores = 0, max_bonds = 0, bond_counter = 0, num_tokens = 0, offset_counter = 0, total_bonds = 0; + + gint *nr_bonds = g_new(gint, g_slist_length(data->cores)); + +@@ -197,6 +197,9 @@ + + gchar **buff; + ++ gdouble *bond_strengths; ++ gint *bond_to_values, *bond_offsets; ++ + /* checks and open file */ + g_return_val_if_fail(data != NULL, 1); + fp = fopen(filename, "wt"); +@@ -208,8 +211,6 @@ + fprintf(fp, "alpha= %3.5f beta= %3.5f gamma= %3.5f\n", data->pbc[3] * R2D, data->pbc[4] * R2D, data->pbc[5] * R2D); + fprintf(fp, "Spacegroup information: SPGR = %-24s OPT = %i\n", data->sginfo.spacename, data->sginfo.cellchoice); + +- gint total_bonds = 0; +- + for (core_iter = data->cores; core_iter; core_iter = core_iter->next) + { + core = (struct core_pak *)core_iter->data; +@@ -229,9 +230,9 @@ + } + } + +- gdouble * bond_strengths = g_new0(gdouble, total_bonds); +- gint * bond_to_values = g_new0(gint, total_bonds); +- gint * bond_offsets = g_new0(gint, total_bonds * 3); ++ bond_strengths = g_new0(gdouble, total_bonds); ++ bond_to_values = g_new0(gint, total_bonds); ++ bond_offsets = g_new0(gint, total_bonds * 3); + + fprintf(fp, "Nr of centres of mass: %i\n", nr_primary_cores); + fprintf(fp, "Maximum connectivity: %i\n", max_bonds); +@@ -280,6 +281,8 @@ + gint *bondto; + gdouble *bond_offsets; + gdouble *bond_strengths; ++ ++ gint bondto_counter = 0, bond_offsets_counter = 0, total_bonds = 0; + + /* checks */ + g_return_val_if_fail(data != NULL, 1); +@@ -366,8 +369,6 @@ + bond_offsets = g_new(gdouble, nr_bond_lines * num_gu * 15); + //bond_strengths = g_new(gdouble, nr_bond_lines * num_gu * 5); + +- gint bondto_counter = 0, bond_offsets_counter = 0; +- + /* create GUs a priori */ + for (n = 0; n < num_gu; ++n) + { +@@ -442,7 +443,6 @@ + fgetline(fp, line); + } + +- gint total_bonds = 0; + /* now we create new cores for each bond */ + w = 0; + for (n = 0; n < num_gu; ++n) diff -urN /usr/ports/science/gdis/files/patch-gui_monty.c science/gdis/files/patch-gui_monty.c --- /usr/ports/science/gdis/files/patch-gui_monty.c Thu Jan 1 09:00:00 1970 +++ science/gdis/files/patch-gui_monty.c Thu Nov 2 00:13:49 2006 @@ -0,0 +1,37 @@ +--- gui_monty.c.orig Thu Nov 24 13:58:48 2005 ++++ gui_monty.c Thu Nov 2 00:13:29 2006 +@@ -492,6 +492,7 @@ + FILE *fp; + struct model_pak *model = data; + gchar *last_dirsep, *yes, *no; ++ gchar **hkls, **supersats, **out_dirs; + gint i; + + yes = g_strdup("yes"); +@@ -513,7 +514,7 @@ + g_strstrip(model->monty.hkls); + + /* split the string by endline characters */ +- gchar **hkls = g_strsplit(model->monty.hkls, "\n", INT_MAX); ++ hkls = g_strsplit(model->monty.hkls, "\n", INT_MAX); + + /* print all hkl values to the file */ + for (i = 0; *(hkls+i); ++i) +@@ -523,7 +524,7 @@ + + /* remove any whitespace, this also includes trailing \n characters */ + g_strstrip(model->monty.supersaturations); +- gchar **supersats = g_strsplit(model->monty.supersaturations, "\n", INT_MAX); ++ supersats = g_strsplit(model->monty.supersaturations, "\n", INT_MAX); + for (i = 0; *(supersats+i); ++i) + { + fprintf(fp, " -supersat %s\n", *(supersats +i)); +@@ -551,7 +552,7 @@ + + /* remove any whitespace, this also includes trailing \n characters */ + g_strstrip(model->monty.output_dirs); +- gchar **out_dirs = g_strsplit(model->monty.output_dirs, "\n", INT_MAX); ++ out_dirs = g_strsplit(model->monty.output_dirs, "\n", INT_MAX); + for (i = 0; *(out_dirs + i); ++i) + { + fprintf(fp, " -directory %s %s\n", *(hkls + i), *(out_dirs + i)); diff -urN /usr/ports/science/gdis/files/patch-gui_siesta.c science/gdis/files/patch-gui_siesta.c --- /usr/ports/science/gdis/files/patch-gui_siesta.c Thu Jan 1 09:00:00 1970 +++ science/gdis/files/patch-gui_siesta.c Thu Nov 2 00:31:13 2006 @@ -0,0 +1,113 @@ +--- gui_siesta.c.orig Mon Oct 16 10:59:37 2006 ++++ gui_siesta.c Thu Nov 2 00:30:56 2006 +@@ -58,10 +58,10 @@ + /*************************/ + void gui_siesta_dialog(void) + { +- siestafileWRITE = FALSE; + GtkWidget *window; + gpointer dialog; + struct model_pak *model; ++ siestafileWRITE = FALSE; + + model = sysenv.active_model; + +@@ -797,6 +797,8 @@ + struct model_pak * model; + struct core_pak *core_i; + struct core_pak *core_j; ++GtkWidget *hbox, *vbox, *vbox2, *window; ++GtkWidget *dialog, *frame; + + + model = sysenv.active_model; +@@ -826,8 +828,6 @@ + + num_lines = 3*2*num_atoms*num_atoms; + +- GtkWidget *hbox, *vbox, *vbox2, *window; +- GtkWidget *dialog, *frame; + /* Create the widgets */ + + /* request a dialog */ +@@ -844,6 +844,10 @@ + FILE *fp, *matout; + + gchar * modelFCname, *modelFCnameCSV; ++ gdouble correction; ++ gint temp_int; ++ gdouble freq_i, freq_ii; ++ gint sizeofeig; + + modelFCname = g_strdup_printf("%s/%s.FC", sysenv.cwd, model->basename); + modelFCnameCSV = g_strdup_printf("%s.csv", modelFCname); +@@ -1102,7 +1106,6 @@ + // enddo + // enddo + +- gdouble correction; + for (i=0; i<num_atoms; i++) + { + for (j=0; j<num_atoms; j++) +@@ -1219,13 +1222,11 @@ + model->siesta.sorted_eig_values[i] = i; + } + +- gint temp_int; +- gdouble freq_i, freq_ii; + + /* + gint sizeofeig = model->siesta.eigen_values->dim; + */ +- gint sizeofeig = mesch_dim_get(model->siesta.eigen_values); ++ sizeofeig = mesch_dim_get(model->siesta.eigen_values); + + + for (j=sizeofeig-1; j>1; j--) +@@ -1350,10 +1351,10 @@ + { + //evil active model call - evil evil evil + struct model_pak *model; +- model = sysenv.active_model; +- + gchar *buff; + ++ model = sysenv.active_model; ++ + buff = g_strdup(gtk_entry_get_text(GTK_ENTRY(GTK_COMBO(data)->entry))); + if (g_ascii_strncasecmp("Verlet", buff, 6) == 0) + model->siesta.md_type_of_run = VERLET_MDRUN; +@@ -1747,6 +1748,9 @@ + + for (i=0; i<total_files; i++) + { ++ //grab current grid_config_pak ++ struct grid_config_pak * grid_pak; ++ + //set the range for md_fc_first, and md_fc_last + model->siesta.md_fc_first = i* model->siesta.atoms_per_job + 1; + model->siesta.md_fc_last = i * model->siesta.atoms_per_job + model->siesta.atoms_per_job; +@@ -1763,9 +1767,6 @@ + // call the fdf save bit.... + file_save_as(filename, model); + +- //grab current grid_config_pak +- struct grid_config_pak * grid_pak; +- + //get job directory + siesta_make_runscript(model->basename, sysenv.cwd, grid_pak); + +@@ -1851,12 +1852,11 @@ + int i, jobID; + int total_files; + gchar * filename, * orig_basename, *queuepath, *jobID_string; ++ struct grid_config_pak * grid_pak; + + total_files = model->num_atoms / model->siesta.atoms_per_job +1; + + orig_basename = g_strdup(model->basename); +- +- struct grid_config_pak * grid_pak; + + //default jobstorage dir?? + //"$homedir/.gdis_jobs/ ? diff -urN /usr/ports/science/gdis/files/patch-main.c science/gdis/files/patch-main.c --- /usr/ports/science/gdis/files/patch-main.c Tue Jan 6 02:01:08 2004 +++ science/gdis/files/patch-main.c Wed Nov 1 23:53:21 2006 @@ -1,15 +1,32 @@ ---- main.c.orig Tue Nov 4 15:08:29 2003 -+++ main.c Wed Dec 31 02:11:54 2003 -@@ -433,6 +433,12 @@ - } - } +--- main.c.orig Wed Jul 26 15:15:28 2006 ++++ main.c Wed Nov 1 23:53:11 2006 +@@ -364,7 +364,7 @@ + void sys_init(gint argc, gchar *argv[]) + { + gchar *temp; +-const gchar *ctemp; ++const gchar *envdir, *ctemp; + struct light_pak *light; + FILE *fp; +@@ -500,7 +500,7 @@ + + /* setup directory and file pointers */ + sysenv.cwd = g_get_current_dir(); +-const gchar *envdir = g_getenv("GDIS_START_DIR"); ++envdir = g_getenv("GDIS_START_DIR"); + if (envdir) + sysenv.cwd = (gchar *) envdir; + +@@ -510,7 +510,11 @@ + + /* generate element file full pathname */ + /* sometimes this returns the program name, and sometimes it doesn't */ +#ifdef INSTALL -+strcpy(sysenv.elem_file, INSTALL); -+strcat(sysenv.elem_file, DIR_SEP); -+strcat(sysenv.elem_file, ELEM_FILE); ++temp = g_strdup(INSTALL); ++#else + temp = g_find_program_in_path(argv[0]); +#endif -+ - /* defaults */ - sysenv.povray_exe = g_strdup("povray"); - sysenv.convert_exe = g_strdup("convert"); + /* remove program name (if attached) */ + if (g_file_test(temp, G_FILE_TEST_IS_DIR)) + sysenv.gdis_path = temp; diff -urN /usr/ports/science/gdis/files/patch-molsurf.c science/gdis/files/patch-molsurf.c --- /usr/ports/science/gdis/files/patch-molsurf.c Thu Jan 1 09:00:00 1970 +++ science/gdis/files/patch-molsurf.c Wed Nov 1 23:56:08 2006 @@ -0,0 +1,22 @@ +--- molsurf.c.orig Mon Jun 19 17:42:29 2006 ++++ molsurf.c Wed Nov 1 23:55:43 2006 +@@ -745,7 +745,7 @@ + gdouble Dx, Dy, Dz; /* gradient */ + gdouble temp[3]; /* the dreaded temporary variable */ + gdouble theta, sinTheta, cosTheta; +-gfloat hue, red, green, blue; ++gfloat hue, red, green, blue, colourRange, hueStep; + time_t jobStartTime; + + #if DEBUG_SHAPE +@@ -761,9 +761,7 @@ + #endif + + /* setup for colours */ +- gfloat colourRange= 256; +- gfloat hueStep; +- ++ colourRange= 256; + hueStep = 240/colourRange; + + >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20061102020031.8034f804.tkato432>