diff options
author | kleintux | 2022-09-01 09:00:21 +0200 |
---|---|---|
committer | kleintux | 2022-09-01 09:00:21 +0200 |
commit | 08cf8a36251fce07e0f1521d6b32ce69afdb05bc (patch) | |
tree | 44a29475a50d417c6a1d9da37e342508a4c357b8 | |
parent | 2cd7c84c1af3ae66f695358559c36bb43ccf69a1 (diff) | |
download | aur-fyre.tar.gz |
adopted. updated url. source changed. added debian patches. disabled openexr.
-rw-r--r-- | .SRCINFO | 12 | ||||
-rw-r--r-- | PKGBUILD | 25 | ||||
-rw-r--r-- | error-handling.patch | 136 | ||||
-rw-r--r-- | format-strings.patch | 14 |
4 files changed, 175 insertions, 12 deletions
@@ -1,18 +1,20 @@ pkgbase = fyre pkgdesc = Rendering of the Peter de Jong map pkgver = 1.0.1 - pkgrel = 13 - url = http://fyre.navi.cx/ + pkgrel = 14 + url = https://github.com/davidt/Fyre arch = x86_64 license = GPL - depends = openexr depends = libglade depends = gnet depends = shared-mime-info depends = hicolor-icon-theme depends = desktop-file-utils - source = http://releases.navi.cx/fyre/fyre-1.0.1.tar.bz2 + source = https://src.fedoraproject.org/repo/pkgs/fyre/fyre-1.0.1.tar.bz2/3058bb171f76ced74f79d876f296ac6f/fyre-1.0.1.tar.bz2 + source = error-handling.patch + source = format-strings.patch sha512sums = 8e65e6ef05c2919659e173b04815579cd550a5d98539860d600d2dd68561493badb98b3eff2cf131335aee9b8b848ceb30956c194a7a69b855e9397679c1c675 + sha512sums = 8736f05cf152bc10e1d4f5cdb0df2047d6d4cc2e6176c70e21504bb41b5bfe2ac5531ecf2197f02aecaea685de6bab94be400e8423efcae52472a5750bf09ab1 + sha512sums = 96e3736e32a8381d753a71a5869f6a2cea91bc73ec38859d24fcfc3dcfc55356cc5cee5a687e7085917a7793de2bf4cb483b6955921e4c7e4da52282df53270c pkgname = fyre - @@ -1,19 +1,30 @@ -# Maintainer: Eric Bélanger <eric@archlinux.org> +# Maintainer: kleintux <reg-archlinux AT klein DOT tuxli DOT ch> +# Contributor: Eric Bélanger <eric@archlinux.org> pkgname=fyre pkgver=1.0.1 -pkgrel=13 +pkgrel=14 pkgdesc="Rendering of the Peter de Jong map" arch=('x86_64') -url="http://fyre.navi.cx/" +url="https://github.com/davidt/Fyre" license=('GPL') -depends=('openexr' 'libglade' 'gnet' 'shared-mime-info' 'hicolor-icon-theme' 'desktop-file-utils') -source=(http://releases.navi.cx/fyre/fyre-${pkgver}.tar.bz2) -sha512sums=('8e65e6ef05c2919659e173b04815579cd550a5d98539860d600d2dd68561493badb98b3eff2cf131335aee9b8b848ceb30956c194a7a69b855e9397679c1c675') +depends=('libglade' 'gnet' 'shared-mime-info' 'hicolor-icon-theme' 'desktop-file-utils') +source=("https://src.fedoraproject.org/repo/pkgs/fyre/fyre-1.0.1.tar.bz2/3058bb171f76ced74f79d876f296ac6f/fyre-1.0.1.tar.bz2" + "error-handling.patch" + "format-strings.patch") +sha512sums=('8e65e6ef05c2919659e173b04815579cd550a5d98539860d600d2dd68561493badb98b3eff2cf131335aee9b8b848ceb30956c194a7a69b855e9397679c1c675' + '8736f05cf152bc10e1d4f5cdb0df2047d6d4cc2e6176c70e21504bb41b5bfe2ac5531ecf2197f02aecaea685de6bab94be400e8423efcae52472a5750bf09ab1' + '96e3736e32a8381d753a71a5869f6a2cea91bc73ec38859d24fcfc3dcfc55356cc5cee5a687e7085917a7793de2bf4cb483b6955921e4c7e4da52282df53270c') + +prepare() { + cd ${pkgname}-${pkgver}/ + patch -p1 < ../../error-handling.patch + patch -p1 < ../../format-strings.patch +} build() { cd "${srcdir}/${pkgname}-${pkgver}" - ./configure --prefix=/usr + ./configure --prefix=/usr --disable-openexr make } diff --git a/error-handling.patch b/error-handling.patch new file mode 100644 index 000000000000..9cc54a2c4993 --- /dev/null +++ b/error-handling.patch @@ -0,0 +1,136 @@ +Description: Fix a number of error handling issues +Author: Stephen Kitt <skitt@debian.org> + +* Avoid crashing when handling animation load errors. +* Correctly free current_filename in explorer-animation. +* Clarify if statements which were confusing the compiler's + diagnostics in histogram-imager. + +--- a/src/animation.c ++++ b/src/animation.c +@@ -376,19 +376,24 @@ + } + } + +-void animation_load_file(Animation *self, const gchar *filename) { ++gboolean animation_load_file(Animation *self, const gchar *filename) { + FILE *f; + AnimChunkState state; + +- g_return_if_fail((f = fopen(filename, "rb"))); +- g_return_if_fail(chunked_file_read_signature(f, FILE_SIGNATURE) || +- chunked_file_read_signature(f, OLD_FILE_SIGNATURE)); ++ if (!(f = fopen(filename, "rb"))) { ++ return FALSE; ++ } ++ if (!(chunked_file_read_signature(f, FILE_SIGNATURE) || ++ chunked_file_read_signature(f, OLD_FILE_SIGNATURE))) { ++ return FALSE; ++ } + + animation_clear(self); + state.self = self; + chunked_file_read_all(f, CHUNK_CALLBACK(animation_store_chunk), &state); + + fclose(f); ++ return TRUE; + } + + void animation_save_file(Animation *self, const gchar *filename) { +--- a/src/main.c ++++ b/src/main.c +@@ -134,10 +134,14 @@ + { + GtkTreeIter iter; + +- animation_load_file(animation, optarg); +- animate = TRUE; +- gtk_tree_model_get_iter_first(GTK_TREE_MODEL(animation->model), &iter); +- animation_keyframe_load(animation, &iter, PARAMETER_HOLDER(map)); ++ if (animation_load_file(animation, optarg)) { ++ animate = TRUE; ++ gtk_tree_model_get_iter_first(GTK_TREE_MODEL(animation->model), &iter); ++ animation_keyframe_load(animation, &iter, PARAMETER_HOLDER(map)); ++ } else { ++ fprintf(stderr, "Unable to load animation from %s\n", optarg); ++ return 1; ++ } + break; + } + +@@ -210,7 +214,10 @@ + break; + + case 1002: /* --chdir */ +- chdir(optarg); ++ if (!chdir(optarg)) { ++ perror("Error changing directory"); ++ return 1; ++ } + break; + + case 1003: /* --pidfile */ +@@ -241,10 +248,14 @@ + } else if (g_strcasecmp(ext, ".fa") == 0) { + GtkTreeIter iter; + +- animation_load_file(animation, argv[optind]); +- animate = TRUE; +- gtk_tree_model_get_iter_first(GTK_TREE_MODEL(animation->model), &iter); +- animation_keyframe_load(animation, &iter, PARAMETER_HOLDER(map)); ++ if (animation_load_file(animation, argv[optind])) { ++ animate = TRUE; ++ gtk_tree_model_get_iter_first(GTK_TREE_MODEL(animation->model), &iter); ++ animation_keyframe_load(animation, &iter, PARAMETER_HOLDER(map)); ++ } else { ++ fprintf(stderr, "Unable to load animation from %s\n", argv[optind]); ++ return 1; ++ } + } else { + usage(argv); + return 1; +--- a/src/animation.h ++++ b/src/animation.h +@@ -82,7 +82,7 @@ + void animation_clear (Animation *self); + + /* Persistence */ +-void animation_load_file (Animation *self, ++gboolean animation_load_file (Animation *self, + const gchar *filename); + void animation_save_file (Animation *self, + const gchar *filename); +--- a/src/explorer-animation.c ++++ b/src/explorer-animation.c +@@ -551,8 +551,9 @@ + filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog)); + animation_load_file (self->animation, filename); + explorer_update_animation_length (self); +- if (current_filename); ++ if (current_filename) { + g_free (current_filename); ++ } + current_filename = filename; + } + #else +--- a/src/histogram-imager.c ++++ b/src/histogram-imager.c +@@ -888,10 +888,14 @@ + current.a = ((int)(self->bgalpha * (1-luma) + self->fgalpha * luma)) >> 8; + + /* Always clamp color components */ +- if (current.r<0) current.r = 0; if (current.r>255) current.r = 255; +- if (current.g<0) current.g = 0; if (current.g>255) current.g = 255; +- if (current.b<0) current.b = 0; if (current.b>255) current.b = 255; +- if (current.a<0) current.a = 0; if (current.a>255) current.a = 255; ++ if (current.r<0) current.r = 0; ++ if (current.r>255) current.r = 255; ++ if (current.g<0) current.g = 0; ++ if (current.g>255) current.g = 255; ++ if (current.b<0) current.b = 0; ++ if (current.b>255) current.b = 255; ++ if (current.a<0) current.a = 0; ++ if (current.a>255) current.a = 255; + + /* Colors are always ARGB order in little endian */ + self->color_table.table[count] = IMAGEFU_COLOR(current.a, current.r, current.g, current.b); diff --git a/format-strings.patch b/format-strings.patch new file mode 100644 index 000000000000..f1263d91b39d --- /dev/null +++ b/format-strings.patch @@ -0,0 +1,14 @@ +Description: Ensure format strings are constants +Author: Stephen Kitt <skitt@debian.org> + +--- a/src/exr.cpp ++++ b/src/exr.cpp +@@ -42,7 +42,7 @@ + try { + exr_save_real (hi, filename); + } catch (const std::exception &exc) { +- GError *nerror = g_error_new (fyre_exr_error_quark(), FYRE_EXR_SAVE_FAILURE, exc.what()); ++ GError *nerror = g_error_new (fyre_exr_error_quark(), FYRE_EXR_SAVE_FAILURE, "%s", exc.what()); + *error = nerror; + } + } |