From 4a6bb6ba1731546c880e5615afe2fb35f3344c76 Mon Sep 17 00:00:00 2001 From: Nathan Owens Date: Fri, 25 Dec 2020 19:56:24 -0600 Subject: [PATCH] mvwm-git: fix cross-build --- .../patches/0001-Fix-cross-build.patch | 177 ++++++++++++++++++ srcpkgs/mvwm-git/template | 13 +- 2 files changed, 182 insertions(+), 8 deletions(-) create mode 100644 srcpkgs/mvwm-git/patches/0001-Fix-cross-build.patch diff --git a/srcpkgs/mvwm-git/patches/0001-Fix-cross-build.patch b/srcpkgs/mvwm-git/patches/0001-Fix-cross-build.patch new file mode 100644 index 00000000000..453283be306 --- /dev/null +++ b/srcpkgs/mvwm-git/patches/0001-Fix-cross-build.patch @@ -0,0 +1,177 @@ +From 53b028752d6fdd96471be8cd4c3d1c8d490df2a5 Mon Sep 17 00:00:00 2001 +From: Nathan Owens +Date: Fri, 25 Dec 2020 19:45:56 -0600 +Subject: [PATCH] Fix cross-build + +--- + configure.ac | 77 ++++++++-------------------------------------------- + 1 file changed, 12 insertions(+), 65 deletions(-) + +diff --git configure.ac configure.ac +index 20e91fc..e7a544a 100644 +--- configure.ac ++++ configure.ac +@@ -191,16 +191,6 @@ fi + AC_ISC_POSIX + AC_MINIX + +-# catch -Werror and similar options when running configure +-AC_TRY_COMPILE([#include ], +-[int i; static j; int *p; char *c; +- switch (*p = p = *c) { case 0: printf("%Q", c, p); } +- *c = &i; c = p; +- while (1 || (unsigned int)3 >= 0 || ((int)-1) == ((unsigned int)1)); +- ], , AC_MSG_ERROR(" +-configure is not able to compile programs with warnings. Please +-remove all offending options like -Werror from the CFLAGS and +-CPPFLAGS variables and run configure again.")) + + # check size of some types + ac_save_CFLAGS="$CFLAGS" +@@ -540,22 +530,8 @@ if test ! x"$png_LIBS" = x; then + my_LIBS="$LIBS" + CPPFLAGS="$CPPFLAGS $png_CFLAGS" + LIBS="$LIBS $png_LIBS -lz -lm" +- AC_TRY_RUN([#include +- int main(int c, char **v) { +- return c == 1 ? 0 : (PNG_LIBPNG_VER < 10005) ? 2 : 0 ;}], +- [./conftest dummy_arg; png_status=$?; +- if test x"$png_status" = x0; then +- with_png=yes; +- else +- with_png=no; +- if test x"$png_status" = x2; then +- problem_png=": png library version is too old" +- else +- problem_png=": Internal png detection logic error" +- fi +- fi], +- [with_png="no"; problem_png=": png test error, see config.log"], +- [echo $ac_n "cross compiling; assumed OK... $ac_c"]) ++ AC_CHECK_HEADERS([png.h], ++ with_png=yes) + AC_MSG_RESULT($with_png) + CPPFLAGS="$my_CPPFLAGS" + LIBS="$my_LIBS" +@@ -712,12 +688,9 @@ AH_VERBATIM([_HAVE_LIBCHARSET], + # ******** nl_langinfo and CODESET + AH_TEMPLATE([HAVE_CODESET],[Have nl_langinfo (CODESET)]) + AC_MSG_CHECKING([for nl_langinfo (CODESET)]) +-AC_TRY_COMPILE([#include +-#include ], +-[char *codeset = nl_langinfo(CODESET); setlocale(LC_CTYPE, "");], +- AC_DEFINE(HAVE_CODESET) +- have_codeset=yes, +- have_codeset=no) ++AC_CHECK_HEADERS([langinfo.h locale.h], ++ [AC_DEFINE(HAVE_CODESET), ++ have_codeset=yes]) + AC_MSG_RESULT($have_codeset) + + +@@ -762,39 +735,16 @@ if test ! x"$with_bidi" = xno; then + fribidi_in_path=yes + ac_save_LIBS="$LIBS" + LIBS="$LIBS $Bidi_LIBS" +- AC_TRY_RUN([#include +-#include +-int main() +-{ +- FriBidiChar *logical_unicode_str = +- (FriBidiChar *)malloc((4 + 1) * sizeof(FriBidiChar)); +- fribidi_charset_to_unicode( +- fribidi_parse_charset("iso8859-8"), "test", 4, +- logical_unicode_str); +- return 0; +-} +-], [:], [fribidi_in_path=no]) +- LIBS="$ac_save_LIBS" ++ AC_CHECK_HEADERS([fribidi/fribidi.h], ++ fribidi_in_path=yes) + if test ! x"$fribidi_in_path" = xyes; then + ac_save_CFLAGS="$CFLAGS" + ac_save_LIBS="$LIBS" + CFLAGS="$CFLAGS $Bidi_CFLAGS" + LIBS="$LIBS $Bidi_LIBS" +- AC_TRY_RUN([#include +-#include +-int main() +-{ +- FriBidiChar *logical_unicode_str = +- (FriBidiChar *)malloc((4 + 1) * sizeof(FriBidiChar)); +- fribidi_charset_to_unicode( +- fribidi_parse_charset("iso8859-8"), "test", 4, +- logical_unicode_str); +- return 0; +-} +-], [:], [with_bidi=no; problem_bidi=": Bad fribidi version, see config.log"]) +- CFLAGS="$ac_save_CFLAGS" +- LIBS="$ac_save_LIBS" +- fi ++ AC_CHECK_HEADERS([fribidi/fribidi.h], ++ fribidi_in_path=yes) ++ fi + if test ! x"$fribidi_in_path" = xno; then + Bidi_CFLAGS= + Bidi_LIBS=-lfribidi +@@ -809,11 +759,8 @@ if test x"$with_bidi" = xno; then + Bidi_LIBS= + else + AC_DEFINE(HAVE_BIDI) +- AC_TRY_RUN([#include +- int main(int c, char **v) { +- return FRIBIDI_CHARSET_NOT_FOUND * 0; +- } +- ], [AC_DEFINE(FRIBIDI_CHARSET_SPELLING)]) ++ AC_CHECK_HEADERS([fribidi/fribidi.h], ++ [AC_DEFINE(FRIBIDI_CHARSET_SPELLING)]) + fi + AH_VERBATIM([_FRIBIDI_CHARSET_SPELLING], + [#ifdef FRIBIDI_CHARSET_SPELLING +-- +2.29.2 + +diff --git configure.ac configure.ac +index e7a544a..4004761 100644 +--- configure.ac ++++ configure.ac +@@ -930,9 +930,6 @@ AC_REPLACE_FUNCS(gethostname strcasecmp strncasecmp strdup strerror usleep atexi + dnl dv: this is harmful with autoconf 2.53 and is done automatically anyway + dnl AC_SUBST(LIBOBJS) + +-# check for mkstemp, see the discution on this subject on the mvwm workers +-# list (2001-02-16 and 2001-02-24) +-AM_SAFETY_CHECK_MKSTEMP + + # If we do not have atexit(), then check for on_exit() + if test x$ac_cv_func_atexit = xno; then +-- +2.29.2 + +From 3bf088b4364b007eb13a31d449cf41f7e3769ceb Mon Sep 17 00:00:00 2001 +From: Nathan Owens +Date: Fri, 25 Dec 2020 19:54:24 -0600 +Subject: [PATCH] 1 + +--- + configure.ac | 4 ---- + 1 file changed, 4 deletions(-) + +diff --git configure.ac configure.ac +index 4004761..b3d51e4 100644 +--- configure.ac ++++ configure.ac +@@ -940,10 +940,6 @@ fi + AC_CHECK_FUNCS(unsetenv) + + # Define some compatibility macros needed for config.h. +-mg_DEFINE_IF_NOT([#include ], +- [defined XK_Page_Up && defined XK_Page_Down], +- [COMPAT_OLD_KEYSYMDEF], [$X_CFLAGS], +- [Old AIX systems (3.2.5) don't define some common keysyms.]) + AH_VERBATIM([_COMPAT_OLD_KEYSYMDEF], + [#ifdef COMPAT_OLD_KEYSYMDEF + # define XK_Page_Up XK_Prior +-- +2.29.2 + diff --git a/srcpkgs/mvwm-git/template b/srcpkgs/mvwm-git/template index 5bc72355c72..0aa55def716 100644 --- a/srcpkgs/mvwm-git/template +++ b/srcpkgs/mvwm-git/template @@ -3,6 +3,7 @@ pkgname=mvwm-git version=20150409 revision=3 _commit=f23f011fcd711422645043a215d5638a4965b187 +wrksrc="mvwm-$_commit" build_style=gnu-configure configure_script="./autogen.sh" hostmakedepends="pkg-config git automake autoconf" @@ -10,17 +11,13 @@ makedepends="fribidi-devel libXpm-devel librsvg-devel libXrandr-devel libXcursor-devel libXt-devel libXft-devel fontconfig-devel readline-devel perl" depends="perl" -short_desc="An extremely powerful ICCCM-compliant window manager (FVWM rewrite)" +short_desc="Extremely powerful ICCCM-compliant window manager (FVWM rewrite)" maintainer="Thomas Adam " -license="GPL-2,custom" +license="GPL-2.0-or-later" homepage="http://github.com/ThomasAdam/mvwm" -provides="mvwm-${version}_${revision}" -replaces="mvwm>=0" -wrksrc="mvwm-$_commit" distfiles="$homepage/archive/$_commit.tar.gz" checksum=34f6831d3e42b06d7af0ddf88ae43f353cd84f23563f090e7e4f0a13b75d7560 +provides="mvwm-${version}_${revision}" +replaces="mvwm>=0" CFLAGS="-fcommon" - -# cannot run test program while cross compiling -nocross="https://build.voidlinux.org/builders/aarch64_builder/builds/2229/steps/shell_3/logs/stdio"