From 91505fae8e493161a8aa1b15cf80d0ab73155406 Mon Sep 17 00:00:00 2001
From: Bill Kendrick
Date: Thu, 2 Apr 2020 22:15:13 -0700
Subject: [PATCH 1/9] Debug output clean-up
Wrapped some debug output in "#ifdef DEBUG" tests,
and made sure some warnings and errors were going to
STDERR, rather than STDOUT.
Motivation: Less noise while launching/using Tux Paint,
unless it matters.
---
docs/CHANGES.txt | 4 ++
src/fonts.c | 10 ++--
src/i18n.c | 4 +-
src/onscreen_keyboard.c | 42 +++++++++++----
src/parse.gperf | 24 ++++-----
src/tuxpaint.c | 115 ++++++++++++++++++++++++++--------------
6 files changed, 131 insertions(+), 68 deletions(-)
diff --git a/docs/CHANGES.txt b/docs/CHANGES.txt
index 5390a6a59..405419ea7 100644
--- a/docs/CHANGES.txt
+++ b/docs/CHANGES.txt
@@ -31,6 +31,10 @@ $Id$
* macOS build documentation updates.
Mark K. Kim
+ * Wrapped some debug output in "#ifdef DEBUG" tests,
+ and made sure some warnings and errors were going to
+ STDERR, rather than STDOUT.
+
* Other Improvements
------------------
* Added ability to move color palette options to the end of
diff --git a/src/fonts.c b/src/fonts.c
index f7290e95b..3b02dc32e 100644
--- a/src/fonts.c
+++ b/src/fonts.c
@@ -1,7 +1,7 @@
/*
fonts.c
- Copyright (c) 2009-2017
+ Copyright (c) 2009-2020
http://www.tuxpaint.org/
This program is free software; you can redistribute it and/or modify
@@ -901,7 +901,7 @@ static void groupfonts(void)
//printf("groupfonts() qsort(user_font_families 2...)\n");
//fflush(stdout);
if (num_font_families > 0 && user_font_families[0]->score < 0)
- printf("sorted the wrong way, or all fonts were unusable\n");
+ fprintf(stderr, "sorted the wrong way, or all fonts were unusable\n");
#if 0
// THREADED_FONTS
printf("Trim starting with %d families\n", num_font_families);
@@ -1219,7 +1219,7 @@ void receive_some_font_info(SDL_Surface * screen)
waitpid(font_scanner_pid, &status, 0);
if (WIFSIGNALED(status) || font_thread_aborted)
{
- printf("child killed by signal %u\n", WTERMSIG(status));
+ fprintf(stderr, "child killed by signal %u\n", WTERMSIG(status));
user_font_families = NULL;
num_font_families = 0;
font_thread_done = 1;
@@ -1451,7 +1451,7 @@ static int do_surfcmp(const SDL_Surface * const *const v1, const SDL_Surface * c
if (s1 == s2)
{
- printf("s1==s2?\n");
+ fprintf(stderr, "s1==s2?\n");
return 0;
}
if (!s1 || !s2 || !s1->w || !s2->w || !s1->h || !s2->h || !s1->format || !s2->format)
@@ -1557,7 +1557,7 @@ out:
while (count--)
{
if (surfs[count] == NULL)
- printf("TRYING TO RE-FREE!");
+ fprintf(stderr, "TRYING TO RE-FREE!");
else
{
SDL_FreeSurface(surfs[count]);
diff --git a/src/i18n.c b/src/i18n.c
index ce94092dc..55727f3c1 100644
--- a/src/i18n.c
+++ b/src/i18n.c
@@ -4,7 +4,7 @@
For Tux Paint
Language-related functions
- Copyright (c) 2002-2019 by Bill Kendrick and others
+ Copyright (c) 2002-2020 by Bill Kendrick and others
bill@newbreedsoftware.com
http://www.tuxpaint.org/
@@ -25,7 +25,7 @@
$Id$
- June 14, 2002 - August 29, 2019
+ June 14, 2002 - April 2, 2020
*/
#include
diff --git a/src/onscreen_keyboard.c b/src/onscreen_keyboard.c
index c0674cebe..af39544c2 100644
--- a/src/onscreen_keyboard.c
+++ b/src/onscreen_keyboard.c
@@ -1,3 +1,25 @@
+/*
+ onscreen_keyboard.c
+
+ Copyright (c) 2020
+ http://www.tuxpaint.org/
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ (See COPYING.txt)
+*/
+
#include "onscreen_keyboard.h"
//#define DEBUG_OSK_COMPOSEMAP
@@ -79,14 +101,14 @@ struct osk_keyboard *osk_create(char *layout_name, SDL_Surface * canvas, SDL_Sur
layout = load_layout(keyboard, layout_name);
if (!layout)
{
- printf("Error trying to load the required layout %s\n", layout_name);
+ fprintf(stderr, "Error trying to load the required layout %s\n", layout_name);
layout = load_layout(keyboard, strdup("default.layout"));
if (!layout)
{
- printf("Error trying to load the default layout\n");
+ fprintf(stderr, "Error trying to load the default layout\n");
return NULL;
}
- printf("Loaded the default layout instead.\n");
+ fprintf(stderr, "Loaded the default layout instead.\n");
}
#ifdef DEBUG
@@ -100,7 +122,7 @@ struct osk_keyboard *osk_create(char *layout_name, SDL_Surface * canvas, SDL_Sur
canvas->format->Rmask, canvas->format->Gmask, canvas->format->Bmask, 0);
if (!surface)
{
- printf("Error creating the onscreen keyboard surface\n");
+ fprintf(stderr, "Error creating the onscreen keyboard surface\n");
return NULL;
}
// keyboard->name = layout_name;
@@ -177,7 +199,7 @@ static struct osk_layout *load_layout(on_screen_keyboard * keyboard, char *layou
fi = fopen(filename, "r");
if (fi == NULL)
{
- printf("Can't open either %s nor %s\n", layout_name, filename);
+ fprintf(stderr, "Can't open either %s nor %s\n", layout_name, filename);
/* Fallback to default */
snprintf(filename, 255, "%sosk/default.layout", DATA_PREFIX);
fi = fopen(filename, "r");
@@ -195,7 +217,7 @@ static struct osk_layout *load_layout(on_screen_keyboard * keyboard, char *layou
free(filename);
if (fi == NULL)
{
- printf("Can't load the on screen keyboard layout\n");
+ fprintf(stderr, "Can't load the on screen keyboard layout\n");
return NULL;
}
@@ -297,7 +319,7 @@ void load_hlayout(osk_layout * layout, char *hlayout_name)
fi = fopen(filename, "r");
if (fi == NULL)
{
- printf("Can't open either %s nor %s\n", hlayout_name, filename);
+ fprintf(stderr, "Can't open either %s nor %s\n", hlayout_name, filename);
layout->keys = NULL;
free(filename);
return;
@@ -482,7 +504,7 @@ void load_keymap(osk_layout * layout, char *keymap_name)
fi = fopen(filename, "r");
if (fi == NULL)
{
- printf("Can't open either %s nor %s\n", keymap_name, filename);
+ fprintf(stderr, "Can't open either %s nor %s\n", keymap_name, filename);
layout->keys = NULL;
free(filename);
return;
@@ -670,7 +692,7 @@ static void load_composemap(osk_layout * layout, char *composemap_name)
fi = fopen(filename, "r");
if (fi == NULL)
{
- printf("Can't open either %s nor %s\n", composemap_name, filename);
+ fprintf(stderr, "Can't open either %s nor %s\n", composemap_name, filename);
layout->keys = NULL;
free(filename);
return;
@@ -778,7 +800,7 @@ static void load_keysymdefs(osk_layout * layout, char *keysymdefs_name)
fi = fopen(filename, "r");
if (fi == NULL)
{
- printf("Can't open either %s nor %s\n", keysymdefs_name, filename);
+ fprintf(stderr, "Can't open either %s nor %s\n", keysymdefs_name, filename);
layout->keysymdefs = NULL;
free(filename);
return;
diff --git a/src/parse.gperf b/src/parse.gperf
index 916701295..371b58ea3 100644
--- a/src/parse.gperf
+++ b/src/parse.gperf
@@ -221,9 +221,9 @@ void parse_one_option(struct cfginfo *restrict tmpcfg, const char *str, const ch
opt = "yes";
} else if (strcmp(opt, "yes")) {
if(src)
- printf("Option '%s' in config file '%s' is yes/ask/new only, but got '%s'\n",str,src,opt);
+ fprintf(stderr, "Option '%s' in config file '%s' is yes/ask/new only, but got '%s'\n",str,src,opt);
else
- printf("Command line option '--%s' is yes/ask/new only, but got '%s'\n",str,opt);
+ fprintf(stderr, "Command line option '--%s' is yes/ask/new only, but got '%s'\n",str,opt);
exit(51);
}
}
@@ -237,9 +237,9 @@ void parse_one_option(struct cfginfo *restrict tmpcfg, const char *str, const ch
if(!cfg || (!(flags & BOOLMASK) && noflag) )
{
if(src)
- printf("Unknown option '%s' in config file '%s'\n",str,src);
+ fprintf(stderr, "Unknown option '%s' in config file '%s'\n",str,src);
else
- printf("Unknown command line option '--%s'\n",str);
+ fprintf(stderr, "Unknown command line option '--%s'\n",str);
exit(47);
}
@@ -248,12 +248,12 @@ void parse_one_option(struct cfginfo *restrict tmpcfg, const char *str, const ch
if(src)
{
// immediate options are only for the command line
- printf("Unknown option '%s' in config file '%s'\n",str,src);
+ fprintf(stderr, "Unknown option '%s' in config file '%s'\n",str,src);
exit(49);
}
if(opt)
{
- printf("Command line option '--%s' doesn't take a value.\n",str);
+ fprintf(stderr, "Command line option '--%s' doesn't take a value.\n",str);
exit(50);
}
cfg->val();
@@ -272,18 +272,18 @@ void parse_one_option(struct cfginfo *restrict tmpcfg, const char *str, const ch
else
{
if(src)
- printf("Option '%s' in config file '%s' is yes/no only, but got '%s'\n",str,src,opt);
+ fprintf(stderr, "Option '%s' in config file '%s' is yes/no only, but got '%s'\n",str,src,opt);
else
- printf("Command line option '--%s' is yes/no only, but got '%s'\n",str,opt);
+ fprintf(stderr, "Command line option '--%s' is yes/no only, but got '%s'\n",str,opt);
exit(51);
}
}
else if(!opt || !*opt)
{
if(src)
- printf("Option '%s' in config file '%s' needs a value\n",str,src);
+ fprintf(stderr, "Option '%s' in config file '%s' needs a value\n",str,src);
else
- printf("Command line option '--%s' needs a value\n",str);
+ fprintf(stderr, "Command line option '--%s' needs a value\n",str);
exit(52);
}
@@ -293,9 +293,9 @@ void parse_one_option(struct cfginfo *restrict tmpcfg, const char *str, const ch
if(dupecheck)
{
if(src)
- printf("Option '%s' in config file '%s' sets '%s' again.\n",str,src,cfg->name);
+ fprintf(stderr, "Option '%s' in config file '%s' sets '%s' again.\n",str,src,cfg->name);
else
- printf("Command line option '--%s' sets '%s' again.\n",str,cfg->name);
+ fprintf(stderr, "Command line option '--%s' sets '%s' again.\n",str,cfg->name);
exit(53);
}
diff --git a/src/tuxpaint.c b/src/tuxpaint.c
index 5d598ce63..d6f950845 100644
--- a/src/tuxpaint.c
+++ b/src/tuxpaint.c
@@ -22,7 +22,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
(See COPYING.txt)
- June 14, 2002 - April 1, 2020
+ June 14, 2002 - April 2, 2020
*/
@@ -1477,7 +1477,7 @@ static SDL_Surface *render_text(TuxPaint_Font * restrict font, const char *restr
if (font == NULL)
{
- printf("render_text() received a NULL font!\n");
+ fprintf(stderr, "render_text() received a NULL font!\n");
fflush(stdout);
return NULL;
}
@@ -2360,7 +2360,9 @@ static void mainloop(void)
#ifndef NOSOUND
if (use_sound)
{
+#ifdef DEBUG
printf("modstate at mainloop %d, mod %d\n", SDL_GetModState(), mod);
+#endif
mute = !mute;
Mix_HaltChannel(-1);
@@ -3103,7 +3105,9 @@ static void mainloop(void)
onscreen_keyboard_disable_change);
}
if (kbd == NULL)
- printf("kbd = NULL\n");
+ {
+ fprintf(stderr, "kbd = NULL\n");
+ }
else
{
kbd_rect.x = button_w * 2 + (canvas->w - kbd->surface->w) / 2;
@@ -7702,7 +7706,7 @@ int generate_fontconfig_cache_spinner(SDL_Surface * screen)
{
if (event.type == SDL_QUIT || (event.type == SDL_KEYDOWN && event.key.keysym.sym == SDLK_ESCAPE))
{
- printf("Aborting!\n");
+ fprintf(stderr, "Aborting!\n");
fflush(stdout);
return (1);
}
@@ -8579,7 +8583,7 @@ static void draw_fonts(void)
if (tmp_surf_1 == NULL)
{
- printf("render_text() returned NULL!\n");
+ fprintf(stderr, "render_text() returned NULL!\n");
return;
}
@@ -11372,8 +11376,9 @@ static void load_starter_id(char *saved_id, FILE * fil)
tmp_ptr = fgets(template_id, sizeof(template_id), fi);
template_id[strlen(template_id) - 1] = '\0';
tmp = fscanf(fi, "%d", &template_personal);
- /* FIXME: Debug only? */
+#ifdef DEBUG
printf("template = %s\n (Personal=%d)", template_id, template_personal);
+#endif
}
if (!feof(fi) && color_tag == 'M')
{
@@ -13440,13 +13445,17 @@ static void do_png_embed_data(png_structp png_ptr)
if (SDL_MUSTLOCK(img_starter_bkgd))
SDL_UnlockSurface(img_starter_bkgd);
+#ifdef DEBUG
printf("%d \n", (int)compressedLen);
+#endif
compress(compressed_data, &compressedLen, sbk_pixs, img_starter_bkgd->h * img_starter_bkgd->w * 3);
set_chunk_data(&chunk_data, &chunk_data_len, img_starter_bkgd->w * img_starter_bkgd->h * 3, compressed_data,
compressedLen);
+#ifdef DEBUG
printf("%d \n", (int)compressedLen);
+#endif
tuxpaint_chunks[2].data = (png_byte *) chunk_data;
@@ -13627,7 +13636,9 @@ static void do_png_embed_data(png_structp png_ptr)
fprintf(lfi, "\n\n");
}
current_node = current_node->next_to_up_label_node;
+#ifdef DEBUG
printf("cur %p, red %p\n", current_node, first_label_node_in_redo_stack);
+#endif
}
#ifdef fmemopen_alternative
@@ -21365,7 +21376,9 @@ static void load_info_about_label_surface(FILE * lfi)
new_node->save_y = tmp_pos;
}
+#ifdef DEBUG
printf("Original label size %dx%d\n", new_node->save_width, new_node->save_height);
+#endif
tmp_fscanf_return = fscanf(lfi, "%d\n", &new_node->save_cur_font);
new_node->save_cur_font = 0;
@@ -21824,7 +21837,7 @@ Bytef *get_chunk_data(FILE * fp, char *fname, png_structp png_ptr,
if (f > 3)
{
comp_buff[i - count] = unknown.data[i];
- // printf("%d, %d, %d ",i-count, comp_buff[i - count], unknown.data[i]);
+ // printf("%d, %d, %d ",i-count, comp_buff[i - count], unknown.data[i]);
}
if (unknown.data[i] == '\n' && f < 4)
@@ -21870,13 +21883,13 @@ Bytef *get_chunk_data(FILE * fp, char *fname, png_structp png_ptr,
if (unc_err != Z_STREAM_END)
{
- printf("\n error %d, unc %d, comp %d\n", unc_err, *unc_size, comp);
+ fprintf(stderr, "\n error %d, unc %d, comp %d\n", unc_err, *unc_size, comp);
fclose(fp);
png_destroy_read_struct(&png_ptr, &info_ptr, (png_infopp) NULL);
free(comp_buff);
free(unc_buff);
- printf("Can't recover the embedded data in %s, error in uncompressing data from %s\n\n", fname, chunk_name);
+ fprintf(stderr, "Can't recover the embedded data in %s, error in uncompressing data from %s\n\n", fname, chunk_name);
draw_tux_text(TUX_OOPS, strerror(errno), 0);
return (NULL);
}
@@ -21910,8 +21923,10 @@ void load_embedded_data(char *fname, SDL_Surface * org_surf)
png_uint_32 ww, hh;
png_uint_32 i, j;
+#ifdef DEBUG
printf("Loading embedded data...\n");
printf("%s\n", fname);
+#endif
fp = fopen(fname, "rb");
if (!fp)
@@ -21933,7 +21948,9 @@ void load_embedded_data(char *fname, SDL_Surface * org_surf)
}
else
{
+#ifdef DEBUG
printf("%s\n", fname);
+#endif
info_ptr = png_create_info_struct(png_ptr);
if (info_ptr == NULL)
@@ -21958,7 +21975,9 @@ void load_embedded_data(char *fname, SDL_Surface * org_surf)
num_unknowns = (int)png_get_unknown_chunks(png_ptr, info_ptr, &unknowns);
+#ifdef DEBUG
printf("num_unknowns %i\n", num_unknowns);
+#endif
if (num_unknowns)
{
have_label_delta = have_label_data = have_background = have_foreground = FALSE;
@@ -21972,11 +21991,15 @@ void load_embedded_data(char *fname, SDL_Surface * org_surf)
blured when scaled one) */
for (u = 0; u < num_unknowns; u++)
{
+#ifdef DEBUG
printf("%s, %d\n", unknowns[u].name, (int)unknowns[u].size);
+#endif
if (chunk_is_valid("tpDT", unknowns[u]))
{
+#ifdef DEBUG
printf("Valid tpDT\n");
+#endif
fi = fmemopen(unknowns[u].data, unknowns[u].size, "r");
if (fi == NULL)
{
@@ -22037,7 +22060,9 @@ void load_embedded_data(char *fname, SDL_Surface * org_surf)
{
if (chunk_is_valid("tpLD", unknowns[u]))
{
+#ifdef DEBUG
printf("Valid tpLD\n");
+#endif
unc_buff = get_chunk_data(fp, fname, png_ptr, info_ptr, "tpLD", unknowns[u], &unc_size);
if (unc_buff == NULL)
@@ -22076,7 +22101,9 @@ void load_embedded_data(char *fname, SDL_Surface * org_surf)
/* Label Data */
if (!disable_label && chunk_is_valid("tpLL", unknowns[u]))
{
+#ifdef DEBUG
printf("Valid tpLL\n");
+#endif
unc_buff = get_chunk_data(fp, fname, png_ptr, info_ptr, "tpLL", unknowns[u], &unc_size);
if (unc_buff == NULL)
@@ -22089,7 +22116,7 @@ void load_embedded_data(char *fname, SDL_Surface * org_surf)
fi = fmemopen(unc_buff, unc_size, "rb");
if (fi == NULL)
{
- printf("Can't recover the label data embedded in %s, error in create file stream\n\n",
+ fprintf(stderr, "Can't recover the label data embedded in %s, error in create file stream\n\n",
fname);
fclose(fp);
png_destroy_read_struct(&png_ptr, &info_ptr, (png_infopp) NULL);
@@ -22105,7 +22132,9 @@ void load_embedded_data(char *fname, SDL_Surface * org_surf)
free(unc_buff);
ldata = TRUE;
+#ifdef DEBUG
printf("Out of label data\n");
+#endif
}
}
}
@@ -22130,8 +22159,10 @@ void load_embedded_data(char *fname, SDL_Surface * org_surf)
canvas->format->Rmask, canvas->format->Gmask, canvas->format->Gmask, 0);
if (aux_surf == NULL)
{
- printf("Can't recover the background data embedded in %s, error in create aux image\n\n",
+#ifdef DEBUG
+ fprintf(stderr, "Can't recover the background data embedded in %s, error in create aux image\n\n",
fname);
+#endif
fclose(fp);
png_destroy_read_struct(&png_ptr, &info_ptr, (png_infopp) NULL);
free(unc_buff);
@@ -22143,7 +22174,9 @@ void load_embedded_data(char *fname, SDL_Surface * org_surf)
}
SDL_LockSurface(aux_surf);
+#ifdef DEBUG
printf("Bkgd!!!\n");
+#endif
for (j = 0; j < hh; j++)
for (i = 0; i < ww; i++)
putpixels[aux_surf->format->BytesPerPixel] (aux_surf, i, j,
@@ -22173,7 +22206,9 @@ void load_embedded_data(char *fname, SDL_Surface * org_surf)
if ((starter_modified || !img_starter) && chunk_is_valid("tpFG", unknowns[u]))
{
+#ifdef DEBUG
printf("Frgd!!!\n");
+#endif
unc_buff = get_chunk_data(fp, fname, png_ptr, info_ptr, "tpFG", unknowns[u], &unc_size);
if (unc_buff == NULL)
@@ -22185,7 +22220,7 @@ void load_embedded_data(char *fname, SDL_Surface * org_surf)
canvas->format->Gmask, canvas->format->Gmask, TPAINT_AMASK);
if (aux_surf == NULL)
{
- printf("Can't recover the foreground data embedded in %s, error in create aux image\n\n",
+ fprintf(stderr, "Can't recover the foreground data embedded in %s, error in create aux image\n\n",
fname);
fclose(fp);
png_destroy_read_struct(&png_ptr, &info_ptr, (png_infopp) NULL);
@@ -22691,7 +22726,7 @@ static void setup_config(char *argv[])
{
if (strtof(tmpcfg.joystick_dev, NULL) < 0 || strtof(tmpcfg.joystick_dev, NULL) > 100)
{
- printf("Joystick dev (now %s) must be between 0 and 100.\n", tmpcfg.joystick_dev);
+ fprintf(stderr, "Joystick dev (now %s) must be between 0 and 100.\n", tmpcfg.joystick_dev);
exit(1);
}
joystick_dev = strtof(tmpcfg.joystick_dev, NULL);
@@ -22701,7 +22736,7 @@ static void setup_config(char *argv[])
{
if (strtof(tmpcfg.joystick_slowness, NULL) < 0 || strtof(tmpcfg.joystick_slowness, NULL) > 500)
{
- printf("Joystick slowness (now %s) must be between 0 and 500.\n", tmpcfg.joystick_slowness);
+ fprintf(stderr, "Joystick slowness (now %s) must be between 0 and 500.\n", tmpcfg.joystick_slowness);
exit(1);
}
joystick_slowness = strtof(tmpcfg.joystick_slowness, NULL);
@@ -22711,7 +22746,7 @@ static void setup_config(char *argv[])
if (strtof(tmpcfg.joystick_lowthreshold, NULL) < 0 || strtof(tmpcfg.joystick_lowthreshold, NULL) > 32766)
{
/* FIXME: Find better exit code */
- printf("Joystick lower threshold (now %s) must be between 0 and 32766", tmpcfg.joystick_lowthreshold);
+ fprintf(stderr, "Joystick lower threshold (now %s) must be between 0 and 32766", tmpcfg.joystick_lowthreshold);
exit(1);
}
joystick_low_threshold = strtof(tmpcfg.joystick_lowthreshold, NULL);
@@ -22721,7 +22756,7 @@ static void setup_config(char *argv[])
if (strtof(tmpcfg.joystick_maxsteps, NULL) < 1 || strtof(tmpcfg.joystick_maxsteps, NULL) > 7)
{
/* FIXME: Find better exit code */
- printf("Joystick max steps (now %s) must be between 1 and 7", tmpcfg.joystick_maxsteps);
+ fprintf(stderr, "Joystick max steps (now %s) must be between 1 and 7", tmpcfg.joystick_maxsteps);
exit(1);
}
joystick_maxsteps = strtof(tmpcfg.joystick_maxsteps, NULL);
@@ -22730,7 +22765,7 @@ static void setup_config(char *argv[])
{
if (strtof(tmpcfg.joystick_hat_slowness, NULL) < 0 || strtof(tmpcfg.joystick_hat_slowness, NULL) > 500)
{
- printf("Joystick hat slowness (now %s) must be between 0 and 500.\n", tmpcfg.joystick_hat_slowness);
+ fprintf(stderr, "Joystick hat slowness (now %s) must be between 0 and 500.\n", tmpcfg.joystick_hat_slowness);
exit(1);
}
joystick_hat_slowness = strtof(tmpcfg.joystick_hat_slowness, NULL);
@@ -22740,7 +22775,7 @@ static void setup_config(char *argv[])
if (strtof(tmpcfg.joystick_hat_timeout, NULL) < 0 || strtof(tmpcfg.joystick_hat_timeout, NULL) > 3000)
{
/* FIXME: Find better exit code */
- printf("Joystick hat timeout (now %s) must be between 0 and 3000", tmpcfg.joystick_hat_timeout);
+ fprintf(stderr, "Joystick hat timeout (now %s) must be between 0 and 3000", tmpcfg.joystick_hat_timeout);
exit(1);
}
joystick_hat_timeout = strtof(tmpcfg.joystick_hat_timeout, NULL);
@@ -22750,7 +22785,7 @@ static void setup_config(char *argv[])
if (strtof(tmpcfg.joystick_button_escape, NULL) < 0 || strtof(tmpcfg.joystick_button_escape, NULL) > 254)
{
/* FIXME: Find better exit code */
- printf("Joystick button escape shortcurt (now %s) must be between 0 and 254", tmpcfg.joystick_button_escape);
+ fprintf(stderr, "Joystick button escape shortcurt (now %s) must be between 0 and 254", tmpcfg.joystick_button_escape);
exit(1);
}
joystick_button_escape = strtof(tmpcfg.joystick_button_escape, NULL);
@@ -22761,7 +22796,7 @@ static void setup_config(char *argv[])
|| strtof(tmpcfg.joystick_button_selectbrushtool, NULL) > 254)
{
/* FIXME: Find better exit code */
- printf("Joystick button brush tool shortcurt (now %s) must be between 0 and 254",
+ fprintf(stderr, "Joystick button brush tool shortcurt (now %s) must be between 0 and 254",
tmpcfg.joystick_button_selectbrushtool);
exit(1);
}
@@ -22773,7 +22808,7 @@ static void setup_config(char *argv[])
|| strtof(tmpcfg.joystick_button_selectstamptool, NULL) > 254)
{
/* FIXME: Find better exit code */
- printf("Joystick button stamp tool shortcurt (now %s) must be between 0 and 254",
+ fprintf(stderr, "Joystick button stamp tool shortcurt (now %s) must be between 0 and 254",
tmpcfg.joystick_button_selectstamptool);
exit(1);
}
@@ -22785,7 +22820,7 @@ static void setup_config(char *argv[])
|| strtof(tmpcfg.joystick_button_selectlinestool, NULL) > 254)
{
/* FIXME: Find better exit code */
- printf("Joystick button lines tool shortcurt (now %s) must be between 0 and 254",
+ fprintf(stderr, "Joystick button lines tool shortcurt (now %s) must be between 0 and 254",
tmpcfg.joystick_button_selectlinestool);
exit(1);
}
@@ -22797,7 +22832,7 @@ static void setup_config(char *argv[])
|| strtof(tmpcfg.joystick_button_selectshapestool, NULL) > 254)
{
/* FIXME: Find better exit code */
- printf("Joystick button shapes tool shortcurt (now %s) must be between 0 and 254",
+ fprintf(stderr, "Joystick button shapes tool shortcurt (now %s) must be between 0 and 254",
tmpcfg.joystick_button_selectshapestool);
exit(1);
}
@@ -22809,7 +22844,7 @@ static void setup_config(char *argv[])
|| strtof(tmpcfg.joystick_button_selecttexttool, NULL) > 254)
{
/* FIXME: Find better exit code */
- printf("Joystick button text tool shortcurt (now %s) must be between 0 and 254",
+ fprintf(stderr, "Joystick button text tool shortcurt (now %s) must be between 0 and 254",
tmpcfg.joystick_button_selecttexttool);
exit(1);
}
@@ -22821,7 +22856,7 @@ static void setup_config(char *argv[])
|| strtof(tmpcfg.joystick_button_selectlabeltool, NULL) > 254)
{
/* FIXME: Find better exit code */
- printf("Joystick button label tool shortcurt (now %s) must be between 0 and 254",
+ fprintf(stderr, "Joystick button label tool shortcurt (now %s) must be between 0 and 254",
tmpcfg.joystick_button_selectlabeltool);
exit(1);
}
@@ -22833,7 +22868,7 @@ static void setup_config(char *argv[])
|| strtof(tmpcfg.joystick_button_selectmagictool, NULL) > 254)
{
/* FIXME: Find better exit code */
- printf("Joystick button magic tool shortcurt (now %s) must be between 0 and 254",
+ fprintf(stderr, "Joystick button magic tool shortcurt (now %s) must be between 0 and 254",
tmpcfg.joystick_button_selectmagictool);
exit(1);
}
@@ -22844,7 +22879,7 @@ static void setup_config(char *argv[])
if (strtof(tmpcfg.joystick_button_undo, NULL) < 0 || strtof(tmpcfg.joystick_button_undo, NULL) > 254)
{
/* FIXME: Find better exit code */
- printf("Joystick button undo shortcurt (now %s) must be between 0 and 254", tmpcfg.joystick_button_undo);
+ fprintf(stderr, "Joystick button undo shortcurt (now %s) must be between 0 and 254", tmpcfg.joystick_button_undo);
exit(1);
}
joystick_button_undo = strtof(tmpcfg.joystick_button_undo, NULL);
@@ -22854,7 +22889,7 @@ static void setup_config(char *argv[])
if (strtof(tmpcfg.joystick_button_redo, NULL) < 0 || strtof(tmpcfg.joystick_button_redo, NULL) > 254)
{
/* FIXME: Find better exit code */
- printf("Joystick button redo shortcurt (now %s) must be between 0 and 254", tmpcfg.joystick_button_redo);
+ fprintf(stderr, "Joystick button redo shortcurt (now %s) must be between 0 and 254", tmpcfg.joystick_button_redo);
exit(1);
}
joystick_button_redo = strtof(tmpcfg.joystick_button_redo, NULL);
@@ -22865,7 +22900,7 @@ static void setup_config(char *argv[])
|| strtof(tmpcfg.joystick_button_selecterasertool, NULL) > 254)
{
/* FIXME: Find better exit code */
- printf("Joystick button eraser tool shortcurt (now %s) must be between 0 and 254",
+ fprintf(stderr, "Joystick button eraser tool shortcurt (now %s) must be between 0 and 254",
tmpcfg.joystick_button_selecterasertool);
exit(1);
}
@@ -22876,7 +22911,7 @@ static void setup_config(char *argv[])
if (strtof(tmpcfg.joystick_button_new, NULL) < 0 || strtof(tmpcfg.joystick_button_new, NULL) > 254)
{
/* FIXME: Find better exit code */
- printf("Joystick button new shortcurt (now %s) must be between 0 and 254", tmpcfg.joystick_button_new);
+ fprintf(stderr, "Joystick button new shortcurt (now %s) must be between 0 and 254", tmpcfg.joystick_button_new);
exit(1);
}
joystick_button_new = strtof(tmpcfg.joystick_button_new, NULL);
@@ -22886,7 +22921,7 @@ static void setup_config(char *argv[])
if (strtof(tmpcfg.joystick_button_open, NULL) < 0 || strtof(tmpcfg.joystick_button_open, NULL) > 254)
{
/* FIXME: Find better exit code */
- printf("Joystick button open shortcurt (now %s) must be between 0 and 254", tmpcfg.joystick_button_open);
+ fprintf(stderr, "Joystick button open shortcurt (now %s) must be between 0 and 254", tmpcfg.joystick_button_open);
exit(1);
}
joystick_button_open = strtof(tmpcfg.joystick_button_open, NULL);
@@ -22896,7 +22931,7 @@ static void setup_config(char *argv[])
if (strtof(tmpcfg.joystick_button_save, NULL) < 0 || strtof(tmpcfg.joystick_button_save, NULL) > 254)
{
/* FIXME: Find better exit code */
- printf("Joystick button save shortcurt (now %s) must be between 0 and 254", tmpcfg.joystick_button_save);
+ fprintf(stderr, "Joystick button save shortcurt (now %s) must be between 0 and 254", tmpcfg.joystick_button_save);
exit(1);
}
joystick_button_save = strtof(tmpcfg.joystick_button_save, NULL);
@@ -22906,7 +22941,7 @@ static void setup_config(char *argv[])
if (strtof(tmpcfg.joystick_button_pagesetup, NULL) < 0 || strtof(tmpcfg.joystick_button_pagesetup, NULL) > 254)
{
/* FIXME: Find better exit code */
- printf("Joystick button page setup shortcurt (now %s) must be between 0 and 254",
+ fprintf(stderr, "Joystick button page setup shortcurt (now %s) must be between 0 and 254",
tmpcfg.joystick_button_pagesetup);
exit(1);
}
@@ -22917,7 +22952,7 @@ static void setup_config(char *argv[])
if (strtof(tmpcfg.joystick_button_print, NULL) < 0 || strtof(tmpcfg.joystick_button_print, NULL) > 254)
{
/* FIXME: Find better exit code */
- printf("Joystick button print shortcurt (now %s) must be between 0 and 254", tmpcfg.joystick_button_print);
+ fprintf(stderr, "Joystick button print shortcurt (now %s) must be between 0 and 254", tmpcfg.joystick_button_print);
exit(1);
}
joystick_button_print = strtof(tmpcfg.joystick_button_print, NULL);
@@ -22932,7 +22967,7 @@ static void setup_config(char *argv[])
if (strtof(token, NULL) < 0 || strtof(token, NULL) > 254)
{
/* FIXME: Find better exit code */
- printf("Joystick buttons must be between 0 and 254 (don't like %s)", tmpcfg.joystick_buttons_ignore);
+ fprintf(stderr, "Joystick buttons must be between 0 and 254 (don't like %s)", tmpcfg.joystick_buttons_ignore);
exit(1);
}
joystick_buttons_ignore[joystick_buttons_ignore_len++] = strtof(token, NULL);
@@ -23418,11 +23453,11 @@ static void setup(void)
if (joystick_dev == -1)
{
- printf("%i joystick(s) were found:\n", SDL_NumJoysticks());
+ fprintf(stderr, "%i joystick(s) were found:\n", SDL_NumJoysticks());
for (i = 0; i < SDL_NumJoysticks(); i++)
{
- printf(" %d: %s\n", i, SDL_JoystickName(i));
+ fprintf(stderr, " %d: %s\n", i, SDL_JoystickName(i));
}
SDL_Quit();
@@ -23718,8 +23753,8 @@ static void setup(void)
#endif
if (generate_fontconfig_cache_spinner(screen)) /* returns 1 if aborted */
{
- printf("Pango thread aborted!\n");
- fflush(stdout);
+ fprintf(stderr, "Pango thread aborted!\n");
+ fflush(stderr);
SDL_KillThread(fontconfig_thread);
SDL_Quit();
exit(0);
@@ -24525,7 +24560,9 @@ static int trash(char *path)
return (unlink(path));
}
+#ifdef DEBUG
printf("trash: basename=%s", basename(path)); /* EP */
+#endif
strcpy(fname, basename(path));
if (!file_exists(path))
From d172f38d4d2976d20c9596e9a7eb59b521283cf7 Mon Sep 17 00:00:00 2001
From: Bill Kendrick
Date: Fri, 10 Apr 2020 19:05:52 -0700
Subject: [PATCH 2/9] Win32 build (& doc) tweaks
TOYAMA Shin-ichi noticed that when building for Win32 under mingw/msys,
an #include of "librsvg-cairo.h" was also necessary.
He also bumped the version # in win32/resources.rc
(and I put his credit in there).
I updated docs/RELEASE.txt to mention that .rc file also needing
updated when preparing a new release.
---
docs/CHANGES.txt | 5 ++++-
docs/RELEASE.txt | 3 ++-
docs/en/README.txt | 2 +-
docs/en/html/README.html | 2 +-
src/manpage/tuxpaint.1 | 4 ++--
src/tuxpaint.c | 5 ++++-
win32/resources.rc | 12 ++++++------
7 files changed, 20 insertions(+), 13 deletions(-)
diff --git a/docs/CHANGES.txt b/docs/CHANGES.txt
index 405419ea7..e3dab3147 100644
--- a/docs/CHANGES.txt
+++ b/docs/CHANGES.txt
@@ -8,7 +8,7 @@ http://www.tuxpaint.org/
$Id$
-2020.April.1 (0.9.24)
+2020.April.10 (0.9.24)
* New tools
---------
* Fill
@@ -35,6 +35,9 @@ $Id$
and made sure some warnings and errors were going to
STDERR, rather than STDOUT.
+ * Updates to build for Windows (using mingw/msys)
+ TOYAMA Shin-ichi
+
* Other Improvements
------------------
* Added ability to move color palette options to the end of
diff --git a/docs/RELEASE.txt b/docs/RELEASE.txt
index f4ec34219..0da1f6661 100644
--- a/docs/RELEASE.txt
+++ b/docs/RELEASE.txt
@@ -7,8 +7,9 @@ cutting a release (tagging in the source code repository, and running
* Makefile
* Build description files:
- * tuxpaint.spec (RPM package)
+ * tuxpaint.spec (Linux RPM package)
* macos/Info.plist (macOS build)
+ * win32/resources.rc (Windows mingw/msys build)
* Documentation
(For HTML variants, be sure to run "make" in "docs/", to
diff --git a/docs/en/README.txt b/docs/en/README.txt
index 5e9038382..8d1204558 100644
--- a/docs/en/README.txt
+++ b/docs/en/README.txt
@@ -6,7 +6,7 @@
Copyright 2002-2020 by various contributors; see AUTHORS.txt
http://www.tuxpaint.org/
- June 14, 2002 - April 1, 2020
+ June 14, 2002 - April 10, 2020
----------------------------------------------------------------------
diff --git a/docs/en/html/README.html b/docs/en/html/README.html
index a1d2c1099..b09d64c77 100644
--- a/docs/en/html/README.html
+++ b/docs/en/html/README.html
@@ -22,7 +22,7 @@ version
June 14, 2002 -
- April 1, 2020
+ April 10, 2020
diff --git a/src/manpage/tuxpaint.1 b/src/manpage/tuxpaint.1
index 6a25a976b..01bb92acd 100644
--- a/src/manpage/tuxpaint.1
+++ b/src/manpage/tuxpaint.1
@@ -1,5 +1,5 @@
-.\" tuxpaint.1 - 2020.03.28
-.TH TUXPAINT 1 "28 March 2020" "0.9.24" "Tux Paint"
+.\" tuxpaint.1 - 2020.04.10
+.TH TUXPAINT 1 "10 April 2020" "0.9.24" "Tux Paint"
.SH NAME
tuxpaint -- "Tux Paint", a drawing program for young children.
diff --git a/src/tuxpaint.c b/src/tuxpaint.c
index d6f950845..9e9e96a0c 100644
--- a/src/tuxpaint.c
+++ b/src/tuxpaint.c
@@ -22,7 +22,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
(See COPYING.txt)
- June 14, 2002 - April 2, 2020
+ June 14, 2002 - April 10, 2020
*/
@@ -457,6 +457,9 @@ static void mtw(wchar_t * wtok, char *tok)
#else
#include
+#ifdef WIN32
+#include
+#endif
#if !defined(RSVG_H) || !defined(RSVG_CAIRO_H)
#error "---------------------------------------------------"
diff --git a/win32/resources.rc b/win32/resources.rc
index 077655e41..2579cc0f8 100644
--- a/win32/resources.rc
+++ b/win32/resources.rc
@@ -26,8 +26,8 @@ IDI_ICON1 ICON DISCARDABLE "data/images/icon-win32.ico"
//
VS_VERSION_INFO VERSIONINFO
- FILEVERSION 0,9,23,0
- PRODUCTVERSION 0,9,23,0
+ FILEVERSION 0,9,24,0
+ PRODUCTVERSION 0,9,24,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x21L
@@ -45,15 +45,15 @@ BEGIN
VALUE "Comments", "\0"
VALUE "CompanyName", "New Breed Software\0"
VALUE "FileDescription", "Tux Paint - Interactive Paint Program.\0"
- VALUE "FileVersion", "0.9.23\0"
+ VALUE "FileVersion", "0.9.24\0"
VALUE "InternalName", "Tux Paint\0"
- VALUE "LegalCopyright", "Copyright (C) 2008 by Bill Kendrick\0"
+ VALUE "LegalCopyright", "Copyright (C) 2008-2020 by Bill Kendrick, et al\0"
VALUE "LegalTrademarks", "\0"
VALUE "OriginalFilename", "TuxPaint.exe\0"
VALUE "PrivateBuild", "\0"
VALUE "ProductName", "Tux Paint\0"
- VALUE "ProductVersion", "0.9.23\0"
- VALUE "SpecialBuild", "win32 build by John Popplewell\0"
+ VALUE "ProductVersion", "0.9.24\0"
+ VALUE "SpecialBuild", "win32 build by TOYAMA Shin-ichi\0"
END
END
BLOCK "VarFileInfo"
From b0dda9ac2642103003a5d75a15020f1b780411df Mon Sep 17 00:00:00 2001
From: Bill Kendrick
Date: Sun, 26 Apr 2020 21:19:33 -0700
Subject: [PATCH 3/9] Updates to RPM .spec file
Disable target "install-xdg". Add ImageMagick for BuildReq.
(From Shin-Ichi)
---
docs/CHANGES.txt | 5 ++++-
tuxpaint.spec | 18 +++++++++++++++---
2 files changed, 19 insertions(+), 4 deletions(-)
diff --git a/docs/CHANGES.txt b/docs/CHANGES.txt
index e3dab3147..d468088ba 100644
--- a/docs/CHANGES.txt
+++ b/docs/CHANGES.txt
@@ -8,7 +8,7 @@ http://www.tuxpaint.org/
$Id$
-2020.April.10 (0.9.24)
+2020.April.24 (0.9.24)
* New tools
---------
* Fill
@@ -38,6 +38,9 @@ $Id$
* Updates to build for Windows (using mingw/msys)
TOYAMA Shin-ichi
+ * Updates to 'spec' file for Linux RPM builds
+ TOYAMA Shin-ichi
+
* Other Improvements
------------------
* Added ability to move color palette options to the end of
diff --git a/tuxpaint.spec b/tuxpaint.spec
index dd11fadeb..5bf297cd9 100644
--- a/tuxpaint.spec
+++ b/tuxpaint.spec
@@ -12,7 +12,7 @@ Requires: SDL >= 1.2.4 SDL_image SDL_mixer SDL_ttf SDL_Pango
Requires: libpng librsvg2 cairo libpaper fribidi
BuildRequires: SDL-devel >= 1.2.4 SDL_image-devel SDL_mixer-devel SDL_ttf-devel SDL_Pango-devel
BuildRequires: libpng-devel librsvg2-devel cairo-devel libpaper-devel fribidi-devel
-BuildRequires: libgsf-devel libxml2-devel gtk2-devel gperf gettext
+BuildRequires: gperf gettext ImageMagick
%description
"Tux Paint" is a drawing program for young children.
@@ -31,7 +31,7 @@ Group: Development/Libraries
Requires: tuxpaint = %{version}
Requires: SDL-devel >= 1.2.4 SDL_image-devel SDL_mixer-devel SDL_ttf-devel SDL_Pango-devel
Requires: libpng-devel librsvg2-devel cairo-devel libpaper-devel fribidi-devel
-Requires: libgsf-devel libxml2-devel gtk2-devel gperf gettext
+Requires: gperf gettext
%description devel
development files for tuxpaint plugins.
@@ -49,7 +49,16 @@ mkdir -p $RPM_BUILD_ROOT/%{_bindir}
mkdir -p $RPM_BUILD_ROOT/%{_datadir}
mkdir -p $RPM_BUILD_ROOT/%{_mandir}
-make PREFIX=%{_prefix} DESTDIR=$RPM_BUILD_ROOT install
+make PREFIX=%{_prefix} DESTDIR=$RPM_BUILD_ROOT \
+ install-bin install-data install-man install-doc \
+ install-magic-plugins \
+ install-magic-plugin-dev \
+ install-icon install-gettext install-im install-importscript \
+ install-default-config install-example-stamps \
+ install-example-starters install-example-templates \
+ install-thumb-starters install-thumb-templates \
+ install-bash-completion \
+ install-osk
find $RPM_BUILD_ROOT -name tuxpaint.desktop | sort | \
sed -e "s@$RPM_BUILD_ROOT@@g" > filelist.icons
@@ -89,6 +98,9 @@ rm -rf $RPM_BUILD_ROOT
%{_prefix}/bin/tp-magic-config
%changelog
+* Thu Mar 14 2020 -
+- Disable target "install-xdg". Add ImageMagick for BuildReq.
+
* Thu Sep 26 2019 -
- Set version number 0.9.24
From 99fb3f7dce62383a491420ba9ca172379c481080 Mon Sep 17 00:00:00 2001
From: dolphin6k
Date: Fri, 1 May 2020 14:51:10 +0900
Subject: [PATCH 4/9] Some systems require inluding librsvg-cairo.h explicitly.
---
src/tuxpaint.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/src/tuxpaint.c b/src/tuxpaint.c
index 9e9e96a0c..486ebe83b 100644
--- a/src/tuxpaint.c
+++ b/src/tuxpaint.c
@@ -457,9 +457,7 @@ static void mtw(wchar_t * wtok, char *tok)
#else
#include
-#ifdef WIN32
#include
-#endif
#if !defined(RSVG_H) || !defined(RSVG_CAIRO_H)
#error "---------------------------------------------------"
From 8a271b6a4e92cbece2b7e56bfd22a12196ab795e Mon Sep 17 00:00:00 2001
From: dolphin6k
Date: Fri, 1 May 2020 14:54:46 +0900
Subject: [PATCH 5/9] SPEC file to use xdg-utils to install icons.
---
tuxpaint.spec | 86 +++++++++++++++++++++++++--------------------------
1 file changed, 43 insertions(+), 43 deletions(-)
diff --git a/tuxpaint.spec b/tuxpaint.spec
index 5bf297cd9..e49aaa5c5 100644
--- a/tuxpaint.spec
+++ b/tuxpaint.spec
@@ -2,17 +2,14 @@ Summary: A drawing program for young children
Name: tuxpaint
Version: 0.9.24
Release: 1
-Epoch: 1
License: GPL
Group: Multimedia/Graphics
URL: http://www.tuxpaint.org/
Source0: %{name}-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
-Requires: SDL >= 1.2.4 SDL_image SDL_mixer SDL_ttf SDL_Pango
-Requires: libpng librsvg2 cairo libpaper fribidi
+Requires: SDL >= 1.2.4 SDL_image SDL_mixer SDL_ttf SDL_Pango libpaper fribidi xdg-utils
BuildRequires: SDL-devel >= 1.2.4 SDL_image-devel SDL_mixer-devel SDL_ttf-devel SDL_Pango-devel
-BuildRequires: libpng-devel librsvg2-devel cairo-devel libpaper-devel fribidi-devel
-BuildRequires: gperf gettext ImageMagick
+BuildRequires: librsvg2-devel libpaper-devel fribidi-devel gperf gettext ImageMagick xdg-utils
%description
"Tux Paint" is a drawing program for young children.
@@ -30,8 +27,7 @@ Summary: development files for tuxpaint plugins.
Group: Development/Libraries
Requires: tuxpaint = %{version}
Requires: SDL-devel >= 1.2.4 SDL_image-devel SDL_mixer-devel SDL_ttf-devel SDL_Pango-devel
-Requires: libpng-devel librsvg2-devel cairo-devel libpaper-devel fribidi-devel
-Requires: gperf gettext
+Requires: librsvg2-devel libpaper-devel fribidi-devel gperf
%description devel
development files for tuxpaint plugins.
@@ -44,60 +40,64 @@ make PREFIX=%{_prefix}
%install
rm -rf $RPM_BUILD_ROOT
-mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}
-mkdir -p $RPM_BUILD_ROOT/%{_bindir}
-mkdir -p $RPM_BUILD_ROOT/%{_datadir}
-mkdir -p $RPM_BUILD_ROOT/%{_mandir}
+make ARCH_INSTALL="" PREFIX=%{_prefix} DESTDIR=$RPM_BUILD_ROOT install
-make PREFIX=%{_prefix} DESTDIR=$RPM_BUILD_ROOT \
- install-bin install-data install-man install-doc \
- install-magic-plugins \
- install-magic-plugin-dev \
- install-icon install-gettext install-im install-importscript \
- install-default-config install-example-stamps \
- install-example-starters install-example-templates \
- install-thumb-starters install-thumb-templates \
- install-bash-completion \
- install-osk
+export XDG_DATA_DIRS=$RPM_BUILD_ROOT%{_datadir}
+mkdir -p $RPM_BUILD_ROOT%{_datadir}/{icons/hicolor,applications,desktop-directories}
-find $RPM_BUILD_ROOT -name tuxpaint.desktop | sort | \
- sed -e "s@$RPM_BUILD_ROOT@@g" > filelist.icons
-find $RPM_BUILD_ROOT -name tuxpaint.png | sort | \
- sed -e "s@$RPM_BUILD_ROOT@@g" >> filelist.icons
-find $RPM_BUILD_ROOT -name tuxpaint.svg | sort | \
- sed -e "s@$RPM_BUILD_ROOT@@g" >> filelist.icons
-find $RPM_BUILD_ROOT -name tuxpaint.xpm | sort | \
- sed -e "s@$RPM_BUILD_ROOT@@g" >> filelist.icons
+xdg-icon-resource install --mode system --noupdate --size 192 data/images/icon192x192.png tux4kids-tuxpaint
+xdg-icon-resource install --mode system --noupdate --size 128 data/images/icon128x128.png tux4kids-tuxpaint
+xdg-icon-resource install --mode system --noupdate --size 96 data/images/icon96x96.png tux4kids-tuxpaint
+xdg-icon-resource install --mode system --noupdate --size 64 data/images/icon64x64.png tux4kids-tuxpaint
+xdg-icon-resource install --mode system --noupdate --size 48 data/images/icon48x48.png tux4kids-tuxpaint
+xdg-icon-resource install --mode system --noupdate --size 32 data/images/icon32x32.png tux4kids-tuxpaint
+xdg-icon-resource install --mode system --noupdate --size 22 data/images/icon22x22.png tux4kids-tuxpaint
+xdg-icon-resource install --mode system --noupdate --size 16 data/images/icon16x16.png tux4kids-tuxpaint
-rm -rf $RPM_BUILD_ROOT/usr/share/doc/tuxpaint*
+cp src/tuxpaint.desktop ./tux4kids-tuxpaint.desktop
+xdg-desktop-menu install --mode system --noupdate tux4kids-tuxpaint.desktop
+rm ./tux4kids-tuxpaint.desktop
+
+rm -rf $RPM_BUILD_ROOT/%{_datadir}/doc/tuxpaint-dev
+mv magic/magic-docs docs
+
+%post
+update-desktop-database
+
+%postun
+update-desktop-database
%clean
rm -rf $RPM_BUILD_ROOT
-%files -f filelist.icons
-%defattr(-,root,root,-)
+%files
+%defattr(755,root,root,755)
+%{_bindir}/tuxpaint
+%{_bindir}/tuxpaint-import
+%{_prefix}/lib/tuxpaint/*
+
+%defattr(644,root,root,755)
%config(noreplace) %{_sysconfdir}/tuxpaint/tuxpaint.conf
%doc docs/*
%{_datadir}/tuxpaint/*
+%{_datadir}/pixmaps/tuxpaint.*
+%{_datadir}/applications/tux4kids-tuxpaint.desktop
+%{_datadir}/icons/hicolor/*/apps/tux4kids-tuxpaint.png
%{_sysconfdir}/bash_completion.d/tuxpaint-completion.bash
-
-%defattr(0755, root, root)
-%{_bindir}/tuxpaint
-%{_bindir}/tuxpaint-import
-
-%{_prefix}/lib/tuxpaint/plugins/*.so
-
-%defattr(0644, root, root)
%{_datadir}/locale/*/LC_MESSAGES/tuxpaint.mo
%{_datadir}/man/man1/*
-%{_datadir}/man/*/man1/tuxpaint.1.*
+%{_datadir}/man/*/man1/*
%files devel
+%attr(755,root,root) %{_bindir}/tp-magic-config
+%defattr(644,root,root,755)
%doc magic/docs/*
-%{_prefix}/include/tuxpaint/tp_magic_api.h
-%{_prefix}/bin/tp-magic-config
+%{_includedir}/tuxpaint/tp_magic_api.h
%changelog
+* Fri May 1 2020 -
+- Enabled using xdg-utils for installing icons.
+
* Thu Mar 14 2020 -
- Disable target "install-xdg". Add ImageMagick for BuildReq.
From 0580897a26e2791b9dce219e71c50c2f01189042 Mon Sep 17 00:00:00 2001
From: dolphin6k
Date: Fri, 1 May 2020 16:11:17 +0900
Subject: [PATCH 6/9] Wrong change log date in spec file.
---
tuxpaint.spec | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tuxpaint.spec b/tuxpaint.spec
index e49aaa5c5..fcb9ca115 100644
--- a/tuxpaint.spec
+++ b/tuxpaint.spec
@@ -98,7 +98,7 @@ rm -rf $RPM_BUILD_ROOT
* Fri May 1 2020 -
- Enabled using xdg-utils for installing icons.
-* Thu Mar 14 2020 -
+* Sat Mar 14 2020 -
- Disable target "install-xdg". Add ImageMagick for BuildReq.
* Thu Sep 26 2019 -
@@ -137,7 +137,7 @@ rm -rf $RPM_BUILD_ROOT
- Included magic tools
- Separated devel package
-* Sat Jun 01 2007 -
+* Fri Jun 01 2007 -
- Requires librsvg2 and libpaper
* Fri Sep 08 2006 -
From fe57108f2f6edbdcc57151096471c42db2a5dc2f Mon Sep 17 00:00:00 2001
From: dolphin6k
Date: Fri, 1 May 2020 17:45:41 +0900
Subject: [PATCH 7/9] Re-organized %files section and correct path for
'tp-magic-config --plugindocprefix'
---
tuxpaint.spec | 27 +++++++++++++++++----------
1 file changed, 17 insertions(+), 10 deletions(-)
diff --git a/tuxpaint.spec b/tuxpaint.spec
index fcb9ca115..3fa074e75 100644
--- a/tuxpaint.spec
+++ b/tuxpaint.spec
@@ -36,11 +36,14 @@ development files for tuxpaint plugins.
%setup -q
%build
-make PREFIX=%{_prefix}
+make PREFIX=%{_prefix} DOC_PREFIX=%{_docdir}/tuxpaint/en
%install
rm -rf $RPM_BUILD_ROOT
-make ARCH_INSTALL="" PREFIX=%{_prefix} DESTDIR=$RPM_BUILD_ROOT install
+make ARCH_INSTALL="" PREFIX=%{_prefix} DESTDIR=$RPM_BUILD_ROOT \
+ DOC_PREFIX=$RPM_BUILD_ROOT%{_docdir}/tuxpaint \
+ DEVDOC_PREFIX=$RPM_BUILD_ROOT%{_docdir}/tuxpaint/devel \
+ install
export XDG_DATA_DIRS=$RPM_BUILD_ROOT%{_datadir}
mkdir -p $RPM_BUILD_ROOT%{_datadir}/{icons/hicolor,applications,desktop-directories}
@@ -58,9 +61,6 @@ cp src/tuxpaint.desktop ./tux4kids-tuxpaint.desktop
xdg-desktop-menu install --mode system --noupdate tux4kids-tuxpaint.desktop
rm ./tux4kids-tuxpaint.desktop
-rm -rf $RPM_BUILD_ROOT/%{_datadir}/doc/tuxpaint-dev
-mv magic/magic-docs docs
-
%post
update-desktop-database
@@ -78,25 +78,32 @@ rm -rf $RPM_BUILD_ROOT
%defattr(644,root,root,755)
%config(noreplace) %{_sysconfdir}/tuxpaint/tuxpaint.conf
-%doc docs/*
+%{_sysconfdir}/bash_completion.d/tuxpaint-completion.bash
+%{_docdir}/tuxpaint/*
%{_datadir}/tuxpaint/*
%{_datadir}/pixmaps/tuxpaint.*
%{_datadir}/applications/tux4kids-tuxpaint.desktop
%{_datadir}/icons/hicolor/*/apps/tux4kids-tuxpaint.png
-%{_sysconfdir}/bash_completion.d/tuxpaint-completion.bash
%{_datadir}/locale/*/LC_MESSAGES/tuxpaint.mo
-%{_datadir}/man/man1/*
-%{_datadir}/man/*/man1/*
+%{_mandir}/man1/tuxpaint*.*
+%{_mandir}/*/man1/tuxpaint*.*
+%exclude %{_docdir}/tuxpaint/devel
+%exclude %{_docdir}/tuxpaint/Makefile
%files devel
%attr(755,root,root) %{_bindir}/tp-magic-config
%defattr(644,root,root,755)
-%doc magic/docs/*
%{_includedir}/tuxpaint/tp_magic_api.h
+%{_docdir}/tuxpaint/devel/*
+%{_docdir}/tuxpaint/Makefile
+%{_mandir}/man1/tp-magic-config.*
%changelog
* Fri May 1 2020 -
- Enabled using xdg-utils for installing icons.
+- Wrong date in %changelog
+- Re-organized %files section
+- Correct path for 'tp-magic-config --plugindocprefix'
* Sat Mar 14 2020 -
- Disable target "install-xdg". Add ImageMagick for BuildReq.
From 10c833e565b4c9903afe908c76c0f3d97c430f1b Mon Sep 17 00:00:00 2001
From: Bill Kendrick
Date: Sat, 23 May 2020 23:32:49 -0700
Subject: [PATCH 8/9] Bump version date -> 2020-05-23
---
docs/en/EXTENDING.txt | 2 +-
docs/en/FAQ.txt | 2 +-
docs/en/OPTIONS.txt | 2 +-
docs/en/README.txt | 2 +-
docs/en/html/EXTENDING.html | 3 ++-
docs/en/html/FAQ.html | 4 +++-
docs/en/html/OPTIONS.html | 2 +-
docs/en/html/README.html | 2 +-
src/manpage/tuxpaint.1 | 4 ++--
src/tuxpaint.c | 4 ++--
10 files changed, 15 insertions(+), 12 deletions(-)
diff --git a/docs/en/EXTENDING.txt b/docs/en/EXTENDING.txt
index 31ead65f0..aebb2b836 100644
--- a/docs/en/EXTENDING.txt
+++ b/docs/en/EXTENDING.txt
@@ -5,7 +5,7 @@
Copyright (c) 2002-2020 by various contributors; see AUTHORS.txt
http://www.tuxpaint.org/
- June 14, 2002 - March 28, 2020
+ June 14, 2002 - May 23, 2020
----------------------------------------------------------------------
diff --git a/docs/en/FAQ.txt b/docs/en/FAQ.txt
index 2afac793e..4add80349 100644
--- a/docs/en/FAQ.txt
+++ b/docs/en/FAQ.txt
@@ -5,7 +5,7 @@
Copyright (c) 2002-2020 by various contributors; see AUTHORS.txt
http://www.tuxpaint.org/
- September 14, 2002 - March 28, 2020
+ September 14, 2002 - May 23, 2020
Drawing-related
diff --git a/docs/en/OPTIONS.txt b/docs/en/OPTIONS.txt
index 9472404ad..ed595f227 100644
--- a/docs/en/OPTIONS.txt
+++ b/docs/en/OPTIONS.txt
@@ -6,7 +6,7 @@ Options Documentation
Copyright (c) 2002-2020 by various contributors; see AUTHORS.txt
http://www.tuxpaint.org/
- March 28, 2020
+ May 23, 2020
----------------------------------------------------------------------
diff --git a/docs/en/README.txt b/docs/en/README.txt
index 8d1204558..bc5b3b9d2 100644
--- a/docs/en/README.txt
+++ b/docs/en/README.txt
@@ -6,7 +6,7 @@
Copyright 2002-2020 by various contributors; see AUTHORS.txt
http://www.tuxpaint.org/
- June 14, 2002 - April 10, 2020
+ June 14, 2002 - May 23, 2020
----------------------------------------------------------------------
diff --git a/docs/en/html/EXTENDING.html b/docs/en/html/EXTENDING.html
index 5fe31ea5a..ebdeb02c4 100644
--- a/docs/en/html/EXTENDING.html
+++ b/docs/en/html/EXTENDING.html
@@ -20,7 +20,8 @@ Extending Tux Paint
Copyright (c) 2002-2020 by various contributors; see AUTHORS.txt
http://www.tuxpaint.org/
-June 14, 2002 - March 28, 2020
+June 14, 2002 -
+ May 23, 2020
diff --git a/docs/en/html/FAQ.html b/docs/en/html/FAQ.html
index afadcaa54..82d948adf 100644
--- a/docs/en/html/FAQ.html
+++ b/docs/en/html/FAQ.html
@@ -19,7 +19,9 @@ Frequently Asked Questions
Copyright (c) 2002-2020 by various contributors; see AUTHORS.txt
http://www.tuxpaint.org/
-September 14, 2002 - March 28, 2020
+September 14, 2002 -
+
+ May 23, 2020
Drawing-related
diff --git a/docs/en/html/OPTIONS.html b/docs/en/html/OPTIONS.html
index c225d1fee..52a0380f9 100644
--- a/docs/en/html/OPTIONS.html
+++ b/docs/en/html/OPTIONS.html
@@ -19,7 +19,7 @@ version
Copyright (c) 2002-2020 by various contributors; see AUTHORS.txt
http://www.tuxpaint.org/
-March 28, 2020
+May 23, 2020
diff --git a/docs/en/html/README.html b/docs/en/html/README.html
index b09d64c77..c55c33144 100644
--- a/docs/en/html/README.html
+++ b/docs/en/html/README.html
@@ -22,7 +22,7 @@ version
June 14, 2002 -
- April 10, 2020
+ May 23, 2020
diff --git a/src/manpage/tuxpaint.1 b/src/manpage/tuxpaint.1
index 01bb92acd..b91a4d4ef 100644
--- a/src/manpage/tuxpaint.1
+++ b/src/manpage/tuxpaint.1
@@ -1,5 +1,5 @@
-.\" tuxpaint.1 - 2020.04.10
-.TH TUXPAINT 1 "10 April 2020" "0.9.24" "Tux Paint"
+.\" tuxpaint.1 - 2020.05.23
+.TH TUXPAINT 1 "23 May 2020" "0.9.24" "Tux Paint"
.SH NAME
tuxpaint -- "Tux Paint", a drawing program for young children.
diff --git a/src/tuxpaint.c b/src/tuxpaint.c
index 486ebe83b..60b1495da 100644
--- a/src/tuxpaint.c
+++ b/src/tuxpaint.c
@@ -22,7 +22,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
(See COPYING.txt)
- June 14, 2002 - April 10, 2020
+ June 14, 2002 - May 23, 2020
*/
@@ -457,7 +457,7 @@ static void mtw(wchar_t * wtok, char *tok)
#else
#include
-#include
+/* #include -- Deprecated */
#if !defined(RSVG_H) || !defined(RSVG_CAIRO_H)
#error "---------------------------------------------------"
From 90871308ef9dfe9ae89190b2af1c1f252653923a Mon Sep 17 00:00:00 2001
From: Bill Kendrick
Date: Fri, 29 May 2020 20:15:45 -0700
Subject: [PATCH 9/9] Bump release date to today (2020-05-29)
---
docs/en/EXTENDING.txt | 2 +-
docs/en/FAQ.txt | 2 +-
docs/en/OPTIONS.txt | 2 +-
docs/en/README.txt | 2 +-
docs/en/html/EXTENDING.html | 2 +-
docs/en/html/FAQ.html | 2 +-
docs/en/html/OPTIONS.html | 2 +-
docs/en/html/README.html | 2 +-
src/manpage/tuxpaint.1 | 4 ++--
9 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/docs/en/EXTENDING.txt b/docs/en/EXTENDING.txt
index aebb2b836..ac6a81079 100644
--- a/docs/en/EXTENDING.txt
+++ b/docs/en/EXTENDING.txt
@@ -5,7 +5,7 @@
Copyright (c) 2002-2020 by various contributors; see AUTHORS.txt
http://www.tuxpaint.org/
- June 14, 2002 - May 23, 2020
+ June 14, 2002 - May 29, 2020
----------------------------------------------------------------------
diff --git a/docs/en/FAQ.txt b/docs/en/FAQ.txt
index 4add80349..7995448e8 100644
--- a/docs/en/FAQ.txt
+++ b/docs/en/FAQ.txt
@@ -5,7 +5,7 @@
Copyright (c) 2002-2020 by various contributors; see AUTHORS.txt
http://www.tuxpaint.org/
- September 14, 2002 - May 23, 2020
+ September 14, 2002 - May 29, 2020
Drawing-related
diff --git a/docs/en/OPTIONS.txt b/docs/en/OPTIONS.txt
index ed595f227..919915b08 100644
--- a/docs/en/OPTIONS.txt
+++ b/docs/en/OPTIONS.txt
@@ -6,7 +6,7 @@ Options Documentation
Copyright (c) 2002-2020 by various contributors; see AUTHORS.txt
http://www.tuxpaint.org/
- May 23, 2020
+ May 29, 2020
----------------------------------------------------------------------
diff --git a/docs/en/README.txt b/docs/en/README.txt
index bc5b3b9d2..1fa6329b5 100644
--- a/docs/en/README.txt
+++ b/docs/en/README.txt
@@ -6,7 +6,7 @@
Copyright 2002-2020 by various contributors; see AUTHORS.txt
http://www.tuxpaint.org/
- June 14, 2002 - May 23, 2020
+ June 14, 2002 - May 29, 2020
----------------------------------------------------------------------
diff --git a/docs/en/html/EXTENDING.html b/docs/en/html/EXTENDING.html
index ebdeb02c4..bf9d9d26b 100644
--- a/docs/en/html/EXTENDING.html
+++ b/docs/en/html/EXTENDING.html
@@ -21,7 +21,7 @@ Extending Tux Paint
http://www.tuxpaint.org/
June 14, 2002 -
- May 23, 2020
+ May 29, 2020
diff --git a/docs/en/html/FAQ.html b/docs/en/html/FAQ.html
index 82d948adf..ec54c1c0e 100644
--- a/docs/en/html/FAQ.html
+++ b/docs/en/html/FAQ.html
@@ -21,7 +21,7 @@ Frequently Asked Questions
September 14, 2002 -
- May 23, 2020
+ May 29, 2020
Drawing-related
diff --git a/docs/en/html/OPTIONS.html b/docs/en/html/OPTIONS.html
index 52a0380f9..9a0eee1be 100644
--- a/docs/en/html/OPTIONS.html
+++ b/docs/en/html/OPTIONS.html
@@ -19,7 +19,7 @@ version
Copyright (c) 2002-2020 by various contributors; see AUTHORS.txt
http://www.tuxpaint.org/
-May 23, 2020
+May 29, 2020
diff --git a/docs/en/html/README.html b/docs/en/html/README.html
index c55c33144..2efcdd287 100644
--- a/docs/en/html/README.html
+++ b/docs/en/html/README.html
@@ -22,7 +22,7 @@ version
June 14, 2002 -
- May 23, 2020
+ May 29, 2020
diff --git a/src/manpage/tuxpaint.1 b/src/manpage/tuxpaint.1
index b91a4d4ef..02db3cd01 100644
--- a/src/manpage/tuxpaint.1
+++ b/src/manpage/tuxpaint.1
@@ -1,5 +1,5 @@
-.\" tuxpaint.1 - 2020.05.23
-.TH TUXPAINT 1 "23 May 2020" "0.9.24" "Tux Paint"
+.\" tuxpaint.1 - 2020.05.29
+.TH TUXPAINT 1 "29 May 2020" "0.9.24" "Tux Paint"
.SH NAME
tuxpaint -- "Tux Paint", a drawing program for young children.