From de09c710fd9be1fb8ddc72ea2b6cb243a602eef3 Mon Sep 17 00:00:00 2001 From: Rafal Date: Wed, 22 Feb 2023 18:06:06 +0100 Subject: [PATCH] spooles: enable clang --- mingw-w64-spooles/PKGBUILD | 16 ++- mingw-w64-spooles/spooles-1.patch | 179 ++++++++++++++++++++++++++++++ 2 files changed, 190 insertions(+), 5 deletions(-) create mode 100644 mingw-w64-spooles/spooles-1.patch diff --git a/mingw-w64-spooles/PKGBUILD b/mingw-w64-spooles/PKGBUILD index 78a0f2de78452..9f1e1c38924c1 100644 --- a/mingw-w64-spooles/PKGBUILD +++ b/mingw-w64-spooles/PKGBUILD @@ -6,19 +6,24 @@ _realname=spooles pkgbase=mingw-w64-${_realname} pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}") pkgver=2.2 -pkgrel=4 +pkgrel=5 pkgdesc="SParse Object Oriented Linear Equations Solver (mingw-w64)" arch=('any') -mingw_arch=('mingw32' 'mingw64' 'ucrt64') -depends=("${MINGW_PACKAGE_PREFIX}-gcc-libgfortran") -makedepends=("${MINGW_PACKAGE_PREFIX}-perl") +mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang32' 'clang64') +depends=($([[ ${MINGW_PACKAGE_PREFIX} == *-clang-* ]] || echo "${MINGW_PACKAGE_PREFIX}-gcc-libgfortran")) +makedepends=("${MINGW_PACKAGE_PREFIX}-cc" + "${MINGW_PACKAGE_PREFIX}-ghostscript" + "${MINGW_PACKAGE_PREFIX}-perl") url="https://www.netlib.org/linalg/spooles" license=('custom') source=("https://www.netlib.org/linalg/${_realname}/${_realname}.${pkgver}.tgz" spooles.patch + # Patch from (spooles-1): https://aur.archlinux.org/cgit/aur.git/tree/spooles-1.patch?h=spooles + spooles-1.patch LICENSE) sha256sums=('a84559a0e987a1e423055ef4fdf3035d55b65bbe4bf915efaa1a35bef7f8c5dd' '58a92b0336f8e2f9b32be9b68f86e02196eb7c075a627fcf828f4f2a2ba1990d' + '364C07247A6486EA86925B4FFDC0BB05022894E27C23C187F6A9725792BD4FEF' 'BCC3FC307C8B7FD8259CCA785F1AB6A5203D45EA51C5859D41DEFEA5C0E8820A') noextract=("${_realname}.${pkgver}.tgz") @@ -28,10 +33,11 @@ prepare() { cd "${srcdir}/${_realname}-${pkgver}" tar -xzf "${srcdir}/${_realname}.${pkgver}.tgz" patch -Np1 -i "${srcdir}"/spooles.patch + patch -Np1 -i "${srcdir}"/spooles-1.patch } build() { - make lib -C "${srcdir}/${_realname}-${pkgver}" + make CC=${CC} CFLAGS="$CFLAGS -Wno-error=format-security" lib -C "${srcdir}/${_realname}-${pkgver}" } package() { diff --git a/mingw-w64-spooles/spooles-1.patch b/mingw-w64-spooles/spooles-1.patch new file mode 100644 index 0000000000000..5f0ad2275121b --- /dev/null +++ b/mingw-w64-spooles/spooles-1.patch @@ -0,0 +1,179 @@ +diff -Nur spooles.old/ETree/src/transform.c spooles/ETree/src/transform.c +--- spooles.old/ETree/src/transform.c 1998-12-07 19:47:00.000000000 +0100 ++++ spooles/ETree/src/transform.c 2021-05-30 18:20:28.087479400 +0200 +@@ -1,6 +1,7 @@ + /* transform.c */ + + #include "../ETree.h" ++#include + + #define MYDEBUG 0 + +@@ -291,7 +292,7 @@ + remap the nzeros[] vector + ------------------------- + */ +-temp = IVinit(nfront, NULL) ; ++temp = IVinit(nfront, (int)(uintptr_t)NULL) ; + IVcopy(nfront, temp, nzeros) ; + IV_setSize(nzerosIV, nnew) ; + nzeros = IV_entries(nzerosIV) ; +@@ -453,7 +454,7 @@ + remap the nzeros[] vector + ------------------------- + */ +-temp = IVinit(nfront, NULL) ; ++temp = IVinit(nfront, (int)(uintptr_t)NULL) ; + IVcopy(nfront, temp, nzeros) ; + IV_setSize(nzerosIV, nnew) ; + nzeros = IV_entries(nzerosIV) ; +@@ -614,7 +615,7 @@ + remap the nzeros[] vector + ------------------------- + */ +-temp = IVinit(nfront, NULL) ; ++temp = IVinit(nfront, (int)(uintptr_t)NULL) ; + IVcopy(nfront, temp, nzeros) ; + IV_setSize(nzerosIV, nnew) ; + nzeros = IV_entries(nzerosIV) ; +diff -Nur spooles.old/Utilities/src/iohb.c spooles/Utilities/src/iohb.c +--- spooles.old/Utilities/src/iohb.c 1998-09-19 16:35:21.000000000 +0200 ++++ spooles/Utilities/src/iohb.c 2021-05-30 18:20:20.030812863 +0200 +@@ -215,6 +215,7 @@ + /*---------------------------------------------------------------------*/ + + #include "../Utilities.h" ++#include + + static int ParseIfmt(char* fmt, int* perline, int* width) ; + static int ParseRfmt(char* fmt, int* perline, int* width, +@@ -266,7 +267,7 @@ + &Ptrcrd, &Indcrd, &Valcrd, &Rhscrd, Rhstype); + fclose(in_file); + *Type = mat_type; +- *(*Type+3) = (char) NULL; ++ *(*Type+3) = (char)(uintptr_t) NULL; + *M = Nrow; + *N = Ncol; + *nz = Nnzero; +@@ -308,8 +309,8 @@ + if ( sscanf(line,"%*s") < 0 ) + IOHBTerminate("iohb.c: Null (or blank) first line of HB file.\n"); + (void) sscanf(line, "%72c%8[^\n]", Title, Key); +- *(Key+8) = (char) NULL; +- *(Title+72) = (char) NULL; ++ *(Key+8) = (char)(uintptr_t) NULL; ++ *(Title+72) = (char)(uintptr_t) NULL; + + /* Second line: */ + fgets(line, BUFSIZ, in_file); +@@ -344,10 +345,10 @@ + if ( sscanf(line, "%*16c%*16c%20c",Valfmt) != 1) + IOHBTerminate("iohb.c: Invalid format info, line 4 of Harwell-Boeing file.\n"); + sscanf(line, "%*16c%*16c%*20c%20c",Rhsfmt); +- *(Ptrfmt+16) = (char) NULL; +- *(Indfmt+16) = (char) NULL; +- *(Valfmt+20) = (char) NULL; +- *(Rhsfmt+20) = (char) NULL; ++ *(Ptrfmt+16) = (char)(uintptr_t) NULL; ++ *(Indfmt+16) = (char)(uintptr_t) NULL; ++ *(Valfmt+20) = (char)(uintptr_t) NULL; ++ *(Rhsfmt+20) = (char)(uintptr_t) NULL; + + /* (Optional) Fifth line: */ + if (*Rhscrd != 0 ) +@@ -454,7 +455,7 @@ + + ThisElement = (char *) malloc(Ptrwidth+1); + if ( ThisElement == NULL ) IOHBTerminate("Insufficient memory for ThisElement."); +- *(ThisElement+Ptrwidth) = (char) NULL; ++ *(ThisElement+Ptrwidth) = (char)(uintptr_t) NULL; + count=0; + for (i=0;i