From 0d486909083c98d7c75cdfc027f89e69f9bf8f48 Mon Sep 17 00:00:00 2001 From: Tobias Geerinckx-Rice Date: Wed, 29 Jan 2020 22:42:12 +0100 Subject: gnu: opensmtpd-next: Promote to opensmtpd [fixes CVE-2020-7247]. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It's still unclear (to me) whether our opensmtpd package is affected, but this change has been delayed for long enough in any case. * gnu/packages/mail.scm (opensmtpd-next): Rename to… (opensmtpd): …this. * gnu/packages/patches/opensmtpd-fix-crash.patch: Delete file. * gnu/local.mk (dist_patch_DATA): Remove it. --- gnu/packages/patches/opensmtpd-fix-crash.patch | 44 -------------------------- 1 file changed, 44 deletions(-) delete mode 100644 gnu/packages/patches/opensmtpd-fix-crash.patch (limited to 'gnu/packages/patches') diff --git a/gnu/packages/patches/opensmtpd-fix-crash.patch b/gnu/packages/patches/opensmtpd-fix-crash.patch deleted file mode 100644 index 0030167533..0000000000 --- a/gnu/packages/patches/opensmtpd-fix-crash.patch +++ /dev/null @@ -1,44 +0,0 @@ -From 9b5f70b93e038df5446bd37a4adac5a0380748e7 Mon Sep 17 00:00:00 2001 -From: johannes -Date: Wed, 21 Feb 2018 23:57:11 +0100 -Subject: [PATCH] crypt_checkpass: include HAVE_CRYPT_H definition, add NULL - check - ---- - openbsd-compat/crypt_checkpass.c | 9 ++++++++- - 1 file changed, 8 insertions(+), 1 deletion(-) - -diff --git a/openbsd-compat/crypt_checkpass.c b/openbsd-compat/crypt_checkpass.c -index dafd2dae..d10b3a57 100644 ---- a/openbsd-compat/crypt_checkpass.c -+++ b/openbsd-compat/crypt_checkpass.c -@@ -1,5 +1,6 @@ - /* OPENBSD ORIGINAL: lib/libc/crypt/cryptutil.c */ - -+#include "includes.h" - #include - #ifdef HAVE_CRYPT_H - #include -@@ -10,6 +11,8 @@ - int - crypt_checkpass(const char *pass, const char *goodhash) - { -+ char *c; -+ - if (goodhash == NULL) - goto fail; - -@@ -17,7 +20,11 @@ crypt_checkpass(const char *pass, const char *goodhash) - if (strlen(goodhash) == 0 && strlen(pass) == 0) - return 0; - -- if (strcmp(crypt(pass, goodhash), goodhash) == 0) -+ c = crypt(pass, goodhash); -+ if (c == NULL) -+ goto fail; -+ -+ if (strcmp(c, goodhash) == 0) - return 0; - - fail: - -- cgit v1.2.3 From aa2e83cce2b4a4d20e1d68edaa1aaa0c590ad72e Mon Sep 17 00:00:00 2001 From: Eric Bavier Date: Fri, 31 Jan 2020 09:14:07 -0600 Subject: gnu: superlu-dist: Update to 6.2.0. * gnu/packages/maths.scm (superlu-dist): Update to 6.2.0. [source]: Update upstream url. Remove mpi deprecations patch. * gnu/packages/patches/superlu-dist-fix-mpi-deprecations.patch: Delete file. * gnu/local.mk (dist_patch_DATA): Remove it. --- gnu/local.mk | 1 - gnu/packages/maths.scm | 11 ++--- .../superlu-dist-fix-mpi-deprecations.patch | 57 ---------------------- 3 files changed, 5 insertions(+), 64 deletions(-) delete mode 100644 gnu/packages/patches/superlu-dist-fix-mpi-deprecations.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index aa8e6e0d0d..24ab39a6a8 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1394,7 +1394,6 @@ dist_patch_DATA = \ %D%/packages/patches/spice-fix-test-armhf.patch \ %D%/packages/patches/steghide-fixes.patch \ %D%/packages/patches/superlu-dist-awpm-grid.patch \ - %D%/packages/patches/superlu-dist-fix-mpi-deprecations.patch \ %D%/packages/patches/superlu-dist-scotchmetis.patch \ %D%/packages/patches/supertux-unbundle-squirrel.patch \ %D%/packages/patches/swig-guile-gc.patch \ diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm index 62f86ff13b..5ac3bd1403 100644 --- a/gnu/packages/maths.scm +++ b/gnu/packages/maths.scm @@ -2,7 +2,7 @@ ;;; Copyright © 2013, 2014, 2015, 2016, 2019 Andreas Enge ;;; Copyright © 2013 Nikita Karetnikov ;;; Copyright © 2014, 2016, 2017 John Darrington -;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Eric Bavier +;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2019, 2020 Eric Bavier ;;; Copyright © 2014 Federico Beffa ;;; Copyright © 2014 Mathieu Lirzin ;;; Copyright © 2015, 2016, 2017, 2018, 2019 Ricardo Wurmus @@ -2473,14 +2473,14 @@ also provides threshold-based ILU factorization preconditioners.") (define-public superlu-dist (package (name "superlu-dist") - (version "6.1.0") + (version "6.2.0") (source (origin (method url-fetch) - (uri (string-append "http://crd-legacy.lbl.gov/~xiaoye/SuperLU/" + (uri (string-append "https://portal.nersc.gov/project/sparse/superlu/" "superlu_dist_" version ".tar.gz")) (sha256 - (base32 "0pqgcgh1yxhfzs99fas3mggajzd5wca3nbyp878rziy74gfk03dl")) + (base32 "1ynmwqajc9sc3my2hssa5k9s58ggvizqv9rdss0j7w99pbh5mnvw")) (modules '((guix build utils))) (snippet ;; Replace the non-free implementation of MC64 with a stub @@ -2506,8 +2506,7 @@ void mc64ad_dist (int *a, int *b, int *c, int *d, int *e, double *f, int *g, "RowPerm = NOROWPERM;")) #t)) (patches (search-patches "superlu-dist-scotchmetis.patch" - "superlu-dist-awpm-grid.patch" - "superlu-dist-fix-mpi-deprecations.patch")))) + "superlu-dist-awpm-grid.patch")))) (build-system cmake-build-system) (native-inputs `(("tcsh" ,tcsh))) diff --git a/gnu/packages/patches/superlu-dist-fix-mpi-deprecations.patch b/gnu/packages/patches/superlu-dist-fix-mpi-deprecations.patch deleted file mode 100644 index 25f0aaf2f3..0000000000 --- a/gnu/packages/patches/superlu-dist-fix-mpi-deprecations.patch +++ /dev/null @@ -1,57 +0,0 @@ -From c9cbcf8730221e366c7495073f8f8d819ee8ce89 Mon Sep 17 00:00:00 2001 -From: Eric Bavier -Date: Wed, 6 Feb 2019 10:06:59 -0600 -Subject: [PATCH] Replace deprecated MPI_Attr_get. - -Fixes build with OpenMPI version 4.0. - -* SRC/pdgstrf.c, SRC/pdgstrf.c, SRC/superlu_grid.c: 'MPI_Attr_get' -> - 'MPI_Comm_get_attr'. ---- - SRC/pdgstrf.c | 2 +- - SRC/pzgstrf.c | 2 +- - SRC/superlu_grid.c | 2 +- - 3 files changed, 3 insertions(+), 3 deletions(-) - -diff --git a/SRC/pdgstrf.c b/SRC/pdgstrf.c -index 736ffa2..f92a1ba 100644 ---- a/SRC/pdgstrf.c -+++ b/SRC/pdgstrf.c -@@ -426,7 +426,7 @@ pdgstrf(superlu_dist_options_t * options, int m, int n, double anorm, - s_eps = smach_dist("Epsilon"); - thresh = s_eps * anorm; - -- MPI_Attr_get (MPI_COMM_WORLD, MPI_TAG_UB, &attr_val, &flag); -+ MPI_Comm_get_attr (MPI_COMM_WORLD, MPI_TAG_UB, &attr_val, &flag); - if (!flag) { - fprintf (stderr, "Could not get TAG_UB\n"); - return (-1); -diff --git a/SRC/pzgstrf.c b/SRC/pzgstrf.c -index 8896548..8800057 100644 ---- a/SRC/pzgstrf.c -+++ b/SRC/pzgstrf.c -@@ -426,7 +426,7 @@ pzgstrf(superlu_dist_options_t * options, int m, int n, double anorm, - s_eps = smach_dist("Epsilon"); - thresh = s_eps * anorm; - -- MPI_Attr_get (MPI_COMM_WORLD, MPI_TAG_UB, &attr_val, &flag); -+ MPI_Comm_get_attr (MPI_COMM_WORLD, MPI_TAG_UB, &attr_val, &flag); - if (!flag) { - fprintf (stderr, "Could not get TAG_UB\n"); - return (-1); -diff --git a/SRC/superlu_grid.c b/SRC/superlu_grid.c -index 1213d27..0c0fb90 100644 ---- a/SRC/superlu_grid.c -+++ b/SRC/superlu_grid.c -@@ -150,7 +150,7 @@ void superlu_gridmap( - { - int tag_ub; - if ( !grid->iam ) { -- MPI_Attr_get(Bcomm, MPI_TAG_UB, &tag_ub, &info); -+ MPI_Comm_get_attr(Bcomm, MPI_TAG_UB, &tag_ub, &info); - printf("MPI_TAG_UB %d\n", tag_ub); - /* returns 4295677672 - In reality it is restricted to no greater than 16384. */ --- -2.20.1 - -- cgit v1.2.3 From 1f9fae008d52a9901d016d418d3931f6e9ccbd00 Mon Sep 17 00:00:00 2001 From: Vagrant Cascadian Date: Sun, 2 Feb 2020 02:07:17 +0000 Subject: gnu: u-boot-qemu-riscv64-smode: Patch to fix boot menu. * gnu/packages/patches/u-boot-riscv64-fix-extlinux.patch: New patch. * gnu/local.mk (dist_patch_DATA): Update accordingly. * gnu/packages/bootloaders (u-boot-qemu-riscv64-smode): Add patch. --- gnu/local.mk | 1 + gnu/packages/bootloaders.scm | 8 +++- .../patches/u-boot-riscv64-fix-extlinux.patch | 54 ++++++++++++++++++++++ 3 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/u-boot-riscv64-fix-extlinux.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index 24ab39a6a8..42516544cc 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1430,6 +1430,7 @@ dist_patch_DATA = \ %D%/packages/patches/tomb-fix-errors-on-open.patch \ %D%/packages/patches/tuxpaint-stamps-path.patch \ %D%/packages/patches/txr-shell.patch \ + %D%/packages/patches/u-boot-riscv64-fix-extlinux.patch \ %D%/packages/patches/ucx-tcp-iface-ioctl.patch \ %D%/packages/patches/udiskie-no-appindicator.patch \ %D%/packages/patches/unzip-CVE-2014-8139.patch \ diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm index be5e4eebb1..63a88dd7ec 100644 --- a/gnu/packages/bootloaders.scm +++ b/gnu/packages/bootloaders.scm @@ -755,7 +755,13 @@ to Novena upstream, does not load u-boot.img from the first partition.") (make-u-boot-package "qemu-riscv64" "riscv64-linux-gnu")) (define-public u-boot-qemu-riscv64-smode - (make-u-boot-package "qemu-riscv64_smode" "riscv64-linux-gnu")) + (let ((base (make-u-boot-package "qemu-riscv64_smode" "riscv64-linux-gnu"))) + (package + (inherit base) + (source (origin + (inherit (package-source u-boot)) + (patches + (search-patches "u-boot-riscv64-fix-extlinux.patch"))))))) (define-public u-boot-sifive-fu540 (make-u-boot-package "sifive_fu540" "riscv64-linux-gnu")) diff --git a/gnu/packages/patches/u-boot-riscv64-fix-extlinux.patch b/gnu/packages/patches/u-boot-riscv64-fix-extlinux.patch new file mode 100644 index 0000000000..3feeb1dc5e --- /dev/null +++ b/gnu/packages/patches/u-boot-riscv64-fix-extlinux.patch @@ -0,0 +1,54 @@ +From 3fc056f0b9f7c26e58a1e947c8c0184e55919614 Mon Sep 17 00:00:00 2001 +From: David Abdurachmanov +Date: Wed, 21 Aug 2019 12:07:20 -0700 +Subject: [PATCH] qemu-riscv64_smode, sifive-fu540: fix extlinux (define + preboot) +Forwarded: https://patchwork.ozlabs.org/patch/1151125/ + +Commit 37304aaf60bf92a5dc3ef222ba520698bd862a44 removed preboot +commands in RISC-V targets and broke extlinux support as reported +by Fu Wei . + +The patch finishes migration of CONFIG_USE_PREBOOT and CONFIG_REBOOT +to Kconfig. + +Signed-off-by: David Abdurachmanov +--- + configs/qemu-riscv64_smode_defconfig | 2 ++ + configs/sifive_fu540_defconfig | 2 ++ + include/configs/sifive-fu540.h | 4 ---- + 3 files changed, 4 insertions(+), 4 deletions(-) + +Index: u-boot/configs/qemu-riscv64_smode_defconfig +=================================================================== +--- u-boot.orig/configs/qemu-riscv64_smode_defconfig ++++ u-boot/configs/qemu-riscv64_smode_defconfig +@@ -14,3 +14,5 @@ CONFIG_CMD_NVEDIT_EFI=y + CONFIG_OF_PRIOR_STAGE=y + CONFIG_SYS_RELOC_GD_ENV_ADDR=y + CONFIG_DM_MTD=y ++CONFIG_USE_PREBOOT=y ++CONFIG_PREBOOT="setenv fdt_addr ${fdtcontroladdr}; fdt addr ${fdtcontroladdr};" +Index: u-boot/configs/sifive_fu540_defconfig +=================================================================== +--- u-boot.orig/configs/sifive_fu540_defconfig ++++ u-boot/configs/sifive_fu540_defconfig +@@ -12,3 +12,5 @@ CONFIG_DISPLAY_BOARDINFO=y + CONFIG_DEFAULT_DEVICE_TREE="hifive-unleashed-a00" + CONFIG_SYS_RELOC_GD_ENV_ADDR=y + CONFIG_DM_MTD=y ++CONFIG_USE_PREBOOT=y ++CONFIG_PREBOOT="setenv fdt_addr ${fdtcontroladdr}; fdt addr ${fdtcontroladdr};" +Index: u-boot/include/configs/sifive-fu540.h +=================================================================== +--- u-boot.orig/include/configs/sifive-fu540.h ++++ u-boot/include/configs/sifive-fu540.h +@@ -40,8 +40,4 @@ + "ramdisk_addr_r=0x88300000\0" \ + BOOTENV + +-#define CONFIG_PREBOOT \ +- "setenv fdt_addr ${fdtcontroladdr};" \ +- "fdt addr ${fdtcontroladdr};" +- + #endif /* __CONFIG_H */ -- cgit v1.2.3 From f389c65dbbc4ed1802707aba709bef01bd315895 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Fri, 3 Jan 2020 17:20:27 +0100 Subject: gnu: Add sdl-pango. * gnu/packages/sdl.scm (sdl-pango): New variable. * gnu/packages/patches/sdl-pango-api_additions.patch: New file. * gnu/packages/patches/sdl-pango-blit_overflow.patch: New file. * gnu/packages/patches/sdl-pango-fillrect_crash.patch: New file. * gnu/packages/patches/sdl-pango-fix-explicit-SDLPango_CopyFTBitmapToSurface.patch: New file. * gnu/packages/patches/sdl-pango-matrix_declarations.patch: New file. * gnu/packages/patches/sdl-pango-sans-serif.patch: New file. * gnu/local.mk (sdl-pango): Reference patches. add --- gnu/local.mk | 6 + gnu/packages/patches/sdl-pango-api_additions.patch | 128 ++++++++++++++++++++ gnu/packages/patches/sdl-pango-blit_overflow.patch | 32 +++++ .../patches/sdl-pango-fillrect_crash.patch | 15 +++ ...x-explicit-SDLPango_CopyFTBitmapToSurface.patch | 20 ++++ .../patches/sdl-pango-matrix_declarations.patch | 131 +++++++++++++++++++++ gnu/packages/patches/sdl-pango-sans-serif.patch | 13 ++ gnu/packages/sdl.scm | 52 +++++++- 8 files changed, 396 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/sdl-pango-api_additions.patch create mode 100644 gnu/packages/patches/sdl-pango-blit_overflow.patch create mode 100644 gnu/packages/patches/sdl-pango-fillrect_crash.patch create mode 100644 gnu/packages/patches/sdl-pango-fix-explicit-SDLPango_CopyFTBitmapToSurface.patch create mode 100644 gnu/packages/patches/sdl-pango-matrix_declarations.patch create mode 100644 gnu/packages/patches/sdl-pango-sans-serif.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index 42516544cc..53d94ff1e7 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1248,6 +1248,12 @@ dist_patch_DATA = \ %D%/packages/patches/p7zip-CVE-2017-17969.patch \ %D%/packages/patches/p7zip-remove-unused-code.patch \ %D%/packages/patches/pam-mount-luks2-support.patch \ + %D%/packages/patches/sdl-pango-api_additions.patch \ + %D%/packages/patches/sdl-pango-blit_overflow.patch \ + %D%/packages/patches/sdl-pango-fillrect_crash.patch \ + %D%/packages/patches/sdl-pango-fix-explicit-SDLPango_CopyFTBitmapToSurface.patch \ + %D%/packages/patches/sdl-pango-matrix_declarations.patch \ + %D%/packages/patches/sdl-pango-sans-serif.patch \ %D%/packages/patches/patchutils-test-perms.patch \ %D%/packages/patches/patch-hurd-path-max.patch \ %D%/packages/patches/perl-autosplit-default-time.patch \ diff --git a/gnu/packages/patches/sdl-pango-api_additions.patch b/gnu/packages/patches/sdl-pango-api_additions.patch new file mode 100644 index 0000000000..5c02e79910 --- /dev/null +++ b/gnu/packages/patches/sdl-pango-api_additions.patch @@ -0,0 +1,128 @@ +Index: SDL_Pango-0.1.2/src/SDL_Pango.c +=================================================================== +--- SDL_Pango-0.1.2.orig/src/SDL_Pango.c 2004-12-10 10:06:33.000000000 +0100 ++++ SDL_Pango-0.1.2/src/SDL_Pango.c 2007-09-18 14:56:35.362379428 +0200 +@@ -723,13 +723,9 @@ + SDL_UnlockSurface(surface); + } + +-/*! +- Create a context which contains Pango objects. + +- @return A pointer to the context as a SDLPango_Context*. +-*/ + SDLPango_Context* +-SDLPango_CreateContext() ++SDLPango_CreateContext_GivenFontDesc(const char* font_desc) + { + SDLPango_Context *context = g_malloc(sizeof(SDLPango_Context)); + G_CONST_RETURN char *charset; +@@ -743,8 +739,7 @@ + pango_context_set_language (context->context, pango_language_from_string (charset)); + pango_context_set_base_dir (context->context, PANGO_DIRECTION_LTR); + +- context->font_desc = pango_font_description_from_string( +- MAKE_FONT_NAME (DEFAULT_FONT_FAMILY, DEFAULT_FONT_SIZE)); ++ context->font_desc = pango_font_description_from_string(font_desc); + + context->layout = pango_layout_new (context->context); + +@@ -762,6 +757,17 @@ + } + + /*! ++ Create a context which contains Pango objects. ++ ++ @return A pointer to the context as a SDLPango_Context*. ++*/ ++SDLPango_Context* ++SDLPango_CreateContext() ++{ ++ SDLPango_CreateContext_GivenFontDesc(MAKE_FONT_NAME(DEFAULT_FONT_FAMILY, DEFAULT_FONT_SIZE)); ++} ++ ++/*! + Free a context. + + @param *context [i/o] Context to be free +@@ -1053,6 +1059,20 @@ + pango_layout_set_font_description (context->layout, context->font_desc); + } + ++void ++SDLPango_SetText_GivenAlignment( ++ SDLPango_Context *context, ++ const char *text, ++ int length, ++ SDLPango_Alignment alignment) ++{ ++ pango_layout_set_attributes(context->layout, NULL); ++ pango_layout_set_text (context->layout, text, length); ++ pango_layout_set_auto_dir (context->layout, TRUE); ++ pango_layout_set_alignment (context->layout, alignment); ++ pango_layout_set_font_description (context->layout, context->font_desc); ++} ++ + /*! + Set plain text to context. + Text must be utf-8. +@@ -1067,11 +1087,7 @@ + const char *text, + int length) + { +- pango_layout_set_attributes(context->layout, NULL); +- pango_layout_set_text (context->layout, text, length); +- pango_layout_set_auto_dir (context->layout, TRUE); +- pango_layout_set_alignment (context->layout, PANGO_ALIGN_LEFT); +- pango_layout_set_font_description (context->layout, context->font_desc); ++ SDLPango_SetText_GivenAlignment(context, text, length, SDLPANGO_ALIGN_LEFT); + } + + /*! +Index: SDL_Pango-0.1.2/src/SDL_Pango.h +=================================================================== +--- SDL_Pango-0.1.2.orig/src/SDL_Pango.h 2004-12-10 10:06:33.000000000 +0100 ++++ SDL_Pango-0.1.2/src/SDL_Pango.h 2007-09-18 15:00:41.736419485 +0200 +@@ -26,6 +26,7 @@ + + #ifndef SDL_PANGO_H + #define SDL_PANGO_H ++#define SDL_PANGO_HAS_GC_EXTENSIONS + + #include "SDL.h" + +@@ -109,12 +110,20 @@ + SDLPANGO_DIRECTION_NEUTRAL /*! Neutral */ + } SDLPango_Direction; + +- ++/*! ++ Specifies alignment of text. See Pango reference for detail ++*/ ++typedef enum { ++ SDLPANGO_ALIGN_LEFT, ++ SDLPANGO_ALIGN_CENTER, ++ SDLPANGO_ALIGN_RIGHT ++} SDLPango_Alignment; + + extern DECLSPEC int SDLCALL SDLPango_Init(); + + extern DECLSPEC int SDLCALL SDLPango_WasInit(); + ++extern DECLSPEC SDLPango_Context* SDLCALL SDLPango_CreateContext_GivenFontDesc(const char* font_desc); + extern DECLSPEC SDLPango_Context* SDLCALL SDLPango_CreateContext(); + + extern DECLSPEC void SDLCALL SDLPango_FreeContext( +@@ -157,6 +166,12 @@ + const char *markup, + int length); + ++extern DECLSPEC void SDLCALL SDLPango_SetText_GivenAlignment( ++ SDLPango_Context *context, ++ const char *text, ++ int length, ++ SDLPango_Alignment alignment); ++ + extern DECLSPEC void SDLCALL SDLPango_SetText( + SDLPango_Context *context, + const char *markup, diff --git a/gnu/packages/patches/sdl-pango-blit_overflow.patch b/gnu/packages/patches/sdl-pango-blit_overflow.patch new file mode 100644 index 0000000000..411d066a74 --- /dev/null +++ b/gnu/packages/patches/sdl-pango-blit_overflow.patch @@ -0,0 +1,32 @@ +Index: sdlpango-0.1.2/src/SDL_Pango.c +=================================================================== +--- sdlpango-0.1.2.orig/src/SDL_Pango.c 2007-10-08 19:44:15.000000000 +0000 ++++ sdlpango-0.1.2/src/SDL_Pango.c 2007-10-08 19:45:27.000000000 +0000 +@@ -725,16 +725,23 @@ + int x = rect->x; + int y = rect->y; + ++ if(x < 0) { ++ width += x; x = 0; ++ } + if(x + width > surface->w) { + width = surface->w - x; +- if(width <= 0) +- return; ++ } ++ if(width <= 0) ++ return; ++ ++ if(y < 0) { ++ height += y; y = 0; + } + if(y + height > surface->h) { + height = surface->h - y; +- if(height <= 0) +- return; + } ++ if(height <= 0) ++ return; + + if(SDL_LockSurface(surface)) { + SDL_SetError("surface lock failed"); diff --git a/gnu/packages/patches/sdl-pango-fillrect_crash.patch b/gnu/packages/patches/sdl-pango-fillrect_crash.patch new file mode 100644 index 0000000000..7a41bbf2fe --- /dev/null +++ b/gnu/packages/patches/sdl-pango-fillrect_crash.patch @@ -0,0 +1,15 @@ +Index: SDL_Pango-0.1.2/src/SDL_Pango.c +=================================================================== +--- SDL_Pango-0.1.2.orig/src/SDL_Pango.c 2007-09-18 15:56:12.406223540 +0200 ++++ SDL_Pango-0.1.2/src/SDL_Pango.c 2007-09-18 15:57:27.986530616 +0200 +@@ -932,7 +932,9 @@ + width = PANGO_PIXELS (logical_rect.width); + height = PANGO_PIXELS (logical_rect.height); + +- SDL_FillRect(surface, NULL, SDL_MapRGBA(surface->format, 0, 0, 0, 0)); ++ if (width && height) { ++ SDL_FillRect(surface, NULL, SDL_MapRGBA(surface->format, 0, 0, 0, 0)); ++ } + + if((! context->tmp_ftbitmap) || context->tmp_ftbitmap->width < width + || context->tmp_ftbitmap->rows < height) diff --git a/gnu/packages/patches/sdl-pango-fix-explicit-SDLPango_CopyFTBitmapToSurface.patch b/gnu/packages/patches/sdl-pango-fix-explicit-SDLPango_CopyFTBitmapToSurface.patch new file mode 100644 index 0000000000..3d4b10cc10 --- /dev/null +++ b/gnu/packages/patches/sdl-pango-fix-explicit-SDLPango_CopyFTBitmapToSurface.patch @@ -0,0 +1,20 @@ +--- a/src/SDL_Pango.h ++++ b/src/SDL_Pango.h +@@ -171,7 +171,7 @@ + SDLPango_Direction direction); + + +-#ifdef __FT2_BUILD_UNIX_H__ ++#ifdef FT2BUILD_H_ + + extern DECLSPEC void SDLCALL SDLPango_CopyFTBitmapToSurface( + const FT_Bitmap *bitmap, +@@ -179,7 +179,7 @@ + const SDLPango_Matrix *matrix, + SDL_Rect *rect); + +-#endif /* __FT2_BUILD_UNIX_H__ */ ++#endif + + + #ifdef __PANGO_H__ diff --git a/gnu/packages/patches/sdl-pango-matrix_declarations.patch b/gnu/packages/patches/sdl-pango-matrix_declarations.patch new file mode 100644 index 0000000000..c35d0a708d --- /dev/null +++ b/gnu/packages/patches/sdl-pango-matrix_declarations.patch @@ -0,0 +1,131 @@ +Index: SDL_Pango-0.1.2/src/SDL_Pango.c +=================================================================== +--- SDL_Pango-0.1.2.orig/src/SDL_Pango.c 2007-09-18 15:03:10.732910311 +0200 ++++ SDL_Pango-0.1.2/src/SDL_Pango.c 2007-09-18 15:04:41.970109622 +0200 +@@ -286,6 +286,59 @@ + } contextImpl; + + ++const SDLPango_Matrix _MATRIX_WHITE_BACK ++ = {255, 0, 0, 0, ++ 255, 0, 0, 0, ++ 255, 0, 0, 0, ++ 255, 255, 0, 0,}; ++ ++/*! ++ Specifies white back and black letter. ++*/ ++const SDLPango_Matrix *MATRIX_WHITE_BACK = &_MATRIX_WHITE_BACK; ++ ++const SDLPango_Matrix _MATRIX_BLACK_BACK ++ = {0, 255, 0, 0, ++ 0, 255, 0, 0, ++ 0, 255, 0, 0, ++ 255, 255, 0, 0,}; ++/*! ++ Specifies black back and white letter. ++*/ ++const SDLPango_Matrix *MATRIX_BLACK_BACK = &_MATRIX_BLACK_BACK; ++ ++const SDLPango_Matrix _MATRIX_TRANSPARENT_BACK_BLACK_LETTER ++ = {0, 0, 0, 0, ++ 0, 0, 0, 0, ++ 0, 0, 0, 0, ++ 0, 255, 0, 0,}; ++/*! ++ Specifies transparent back and black letter. ++*/ ++const SDLPango_Matrix *MATRIX_TRANSPARENT_BACK_BLACK_LETTER = &_MATRIX_TRANSPARENT_BACK_BLACK_LETTER; ++ ++const SDLPango_Matrix _MATRIX_TRANSPARENT_BACK_WHITE_LETTER ++ = {255, 255, 0, 0, ++ 255, 255, 0, 0, ++ 255, 255, 0, 0, ++ 0, 255, 0, 0,}; ++/*! ++ Specifies transparent back and white letter. ++*/ ++const SDLPango_Matrix *MATRIX_TRANSPARENT_BACK_WHITE_LETTER = &_MATRIX_TRANSPARENT_BACK_WHITE_LETTER; ++ ++const SDLPango_Matrix _MATRIX_TRANSPARENT_BACK_TRANSPARENT_LETTER ++ = {255, 255, 0, 0, ++ 255, 255, 0, 0, ++ 255, 255, 0, 0, ++ 0, 0, 0, 0,}; ++/*! ++ Specifies transparent back and transparent letter. ++ This is useful for KARAOKE like rendering. ++*/ ++const SDLPango_Matrix *MATRIX_TRANSPARENT_BACK_TRANSPARENT_LETTER = &_MATRIX_TRANSPARENT_BACK_TRANSPARENT_LETTER; ++ ++ + /*! + Initialize the Glib and Pango API. + This must be called before using other functions in this library, +Index: SDL_Pango-0.1.2/src/SDL_Pango.h +=================================================================== +--- SDL_Pango-0.1.2.orig/src/SDL_Pango.h 2007-09-18 15:03:10.732910311 +0200 ++++ SDL_Pango-0.1.2/src/SDL_Pango.h 2007-09-18 15:06:24.919976401 +0200 +@@ -47,57 +47,27 @@ + Uint8 m[4][4]; /*! Matrix variables */ + } SDLPango_Matrix; + +-const SDLPango_Matrix _MATRIX_WHITE_BACK +- = {255, 0, 0, 0, +- 255, 0, 0, 0, +- 255, 0, 0, 0, +- 255, 255, 0, 0,}; +- + /*! + Specifies white back and black letter. + */ +-const SDLPango_Matrix *MATRIX_WHITE_BACK = &_MATRIX_WHITE_BACK; +- +-const SDLPango_Matrix _MATRIX_BLACK_BACK +- = {0, 255, 0, 0, +- 0, 255, 0, 0, +- 0, 255, 0, 0, +- 255, 255, 0, 0,}; ++extern const SDLPango_Matrix *MATRIX_WHITE_BACK; + /*! + Specifies black back and white letter. + */ +-const SDLPango_Matrix *MATRIX_BLACK_BACK = &_MATRIX_BLACK_BACK; +- +-const SDLPango_Matrix _MATRIX_TRANSPARENT_BACK_BLACK_LETTER +- = {0, 0, 0, 0, +- 0, 0, 0, 0, +- 0, 0, 0, 0, +- 0, 255, 0, 0,}; ++extern const SDLPango_Matrix *MATRIX_BLACK_BACK; + /*! + Specifies transparent back and black letter. + */ +-const SDLPango_Matrix *MATRIX_TRANSPARENT_BACK_BLACK_LETTER = &_MATRIX_TRANSPARENT_BACK_BLACK_LETTER; +- +-const SDLPango_Matrix _MATRIX_TRANSPARENT_BACK_WHITE_LETTER +- = {255, 255, 0, 0, +- 255, 255, 0, 0, +- 255, 255, 0, 0, +- 0, 255, 0, 0,}; ++extern const SDLPango_Matrix *MATRIX_TRANSPARENT_BACK_BLACK_LETTER; + /*! + Specifies transparent back and white letter. + */ +-const SDLPango_Matrix *MATRIX_TRANSPARENT_BACK_WHITE_LETTER = &_MATRIX_TRANSPARENT_BACK_WHITE_LETTER; +- +-const SDLPango_Matrix _MATRIX_TRANSPARENT_BACK_TRANSPARENT_LETTER +- = {255, 255, 0, 0, +- 255, 255, 0, 0, +- 255, 255, 0, 0, +- 0, 0, 0, 0,}; ++extern const SDLPango_Matrix *MATRIX_TRANSPARENT_BACK_WHITE_LETTER; + /*! + Specifies transparent back and transparent letter. + This is useful for KARAOKE like rendering. + */ +-const SDLPango_Matrix *MATRIX_TRANSPARENT_BACK_TRANSPARENT_LETTER = &_MATRIX_TRANSPARENT_BACK_TRANSPARENT_LETTER; ++extern const SDLPango_Matrix *MATRIX_TRANSPARENT_BACK_TRANSPARENT_LETTER; + + /*! + Specifies direction of text. See Pango reference for detail diff --git a/gnu/packages/patches/sdl-pango-sans-serif.patch b/gnu/packages/patches/sdl-pango-sans-serif.patch new file mode 100644 index 0000000000..ccdc8150a7 --- /dev/null +++ b/gnu/packages/patches/sdl-pango-sans-serif.patch @@ -0,0 +1,13 @@ +Index: SDL_Pango-0.1.2/src/SDL_Pango.c +=================================================================== +--- SDL_Pango-0.1.2.orig/src/SDL_Pango.c 2007-09-18 15:12:20.736253215 +0200 ++++ SDL_Pango-0.1.2/src/SDL_Pango.c 2007-09-18 15:12:44.621614364 +0200 +@@ -234,7 +234,7 @@ + //! non-zero if initialized + static int IS_INITIALIZED = 0; + +-#define DEFAULT_FONT_FAMILY "Sans" ++#define DEFAULT_FONT_FAMILY "sans-serif" + #define DEFAULT_FONT_SIZE 12 + #define DEFAULT_DPI 96 + #define _MAKE_FONT_NAME(family, size) family " " #size diff --git a/gnu/packages/sdl.scm b/gnu/packages/sdl.scm index a01cafb34a..26c9bd5eb3 100644 --- a/gnu/packages/sdl.scm +++ b/gnu/packages/sdl.scm @@ -8,7 +8,7 @@ ;;; Copyright © 2018, 2019 Tobias Geerinckx-Rice ;;; Copyright © 2018, 2019 Ricardo Wurmus ;;; Copyright © 2019 Kei Kebreau -;;; Copyright © 2019 Nicolas Goaziou +;;; Copyright © 2019, 2020 Nicolas Goaziou ;;; Copyright © 2019 Marius Bakke ;;; Copyright © 2019 Pierre Neidhardt ;;; Copyright © 2020 Timotej Lazar @@ -42,10 +42,12 @@ #:use-module (guix build-system gnu) #:use-module (guix build-system trivial) #:use-module (gnu packages audio) + #:use-module (gnu packages autotools) #:use-module (gnu packages fcitx) #:use-module (gnu packages fontutils) #:use-module (gnu packages freedesktop) #:use-module (gnu packages glib) + #:use-module (gnu packages gtk) #:use-module (gnu packages guile) #:use-module (gnu packages ibus) #:use-module (gnu packages image) @@ -326,6 +328,54 @@ SDL.") (home-page "https://www.libsdl.org/projects/SDL_net/") (license zlib))) +(define-public sdl-pango + (package + (name "sdl-pango") + (version "0.1.2") + (source + (origin + (method url-fetch) + (uri (string-append + "mirror://sourceforge/sdlpango/SDL_Pango/" version "/" + "SDL_Pango-" version ".tar.gz")) + (sha256 + (base32 "197baw1dsg0p4pljs5k0fshbyki00r4l49m1drlpqw6ggawx6xbz")) + (patches + (search-patches + "sdl-pango-api_additions.patch" + "sdl-pango-blit_overflow.patch" + "sdl-pango-fillrect_crash.patch" + "sdl-pango-fix-explicit-SDLPango_CopyFTBitmapToSurface.patch" + "sdl-pango-matrix_declarations.patch" + "sdl-pango-sans-serif.patch")))) + (build-system gnu-build-system) + (arguments + `(#:configure-flags (list "--disable-static") + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'autogen + ;; Force reconfiguration because the included libtool + ;; generates linking errors. + (lambda _ (invoke "autoreconf" "-vif")))))) + (native-inputs + `(("autoconf" ,autoconf) + ("automake" ,automake) + ("libtool" ,libtool) + ("pkg-config" ,pkg-config))) + (inputs + `(("fontconfig" ,fontconfig) + ("freetype" ,freetype) + ("glib" ,glib) + ("harfbuzz" ,harfbuzz) + ("pango" ,pango) + ("sdl" ,sdl))) + (home-page "http://sdlpango.sourceforge.net") + (synopsis "Pango SDL binding") + (description "This library is a wrapper around the Pango library. +It allows you to use TrueType fonts to render internationalized and +tagged text in SDL applications.") + (license lgpl2.1))) + (define-public sdl-ttf (package (name "sdl-ttf") -- cgit v1.2.3 From e1026ba70138f105ebc95281d22c09241feee9d5 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Sun, 2 Feb 2020 17:46:37 +0100 Subject: gnu: t4k-common: Add missing patch. * gnu/packages/patches/t4k-common-libpng16.patch: Add file. * gnu/local.mk (dist_patch_DATA): Reference it here. --- gnu/local.mk | 1 + gnu/packages/patches/t4k-common-libpng16.patch | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 gnu/packages/patches/t4k-common-libpng16.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index 53d94ff1e7..941b8125b8 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1412,6 +1412,7 @@ dist_patch_DATA = \ %D%/packages/patches/t1lib-CVE-2010-2642.patch \ %D%/packages/patches/t1lib-CVE-2011-0764.patch \ %D%/packages/patches/t1lib-CVE-2011-1552+.patch \ + %D%/packages/patches/t4k-common-libpng16.png \ %D%/packages/patches/tar-remove-wholesparse-check.patch \ %D%/packages/patches/tar-skip-unreliable-tests.patch \ %D%/packages/patches/tcc-boot-0.9.27.patch \ diff --git a/gnu/packages/patches/t4k-common-libpng16.patch b/gnu/packages/patches/t4k-common-libpng16.patch new file mode 100644 index 0000000000..17967773de --- /dev/null +++ b/gnu/packages/patches/t4k-common-libpng16.patch @@ -0,0 +1,26 @@ +Description: Fix for libpng 1.6 +Author: Programmer Nerd +Origin: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=743388#20 +Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=743388 +Reviewed-by: Tobias Frost > +Last-Update: 2016-04-07 +--- +This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ +--- a/src/t4k_loaders.c ++++ b/src/t4k_loaders.c +@@ -1028,12 +1028,9 @@ + { + png_init_io(png_ptr, fi); + +- info_ptr->width = surf->w; +- info_ptr->height = surf->h; +- info_ptr->bit_depth = 8; +- info_ptr->color_type = PNG_COLOR_TYPE_RGB_ALPHA; +- info_ptr->interlace_type = 1; +- info_ptr->valid = 0; /* will be updated by various png_set_FOO() functions */ ++ png_set_IHDR(png_ptr, info_ptr, surf->w, surf->h, 8, ++ PNG_COLOR_TYPE_RGB_ALPHA, PNG_INTERLACE_NONE, ++ PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT); + + png_set_sRGB_gAMA_and_cHRM(png_ptr, info_ptr, + PNG_sRGB_INTENT_PERCEPTUAL); -- cgit v1.2.3