From a6cfd7536d1ee5cf94ea20394e80776f1fdbae95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Buchm=C3=BCller?= Date: Mon, 1 Jan 2018 19:50:27 +0100 Subject: [PATCH] discount: fix cross and enable pkgconfig file --- .../patches/cross-configure_inc.patch | 133 ++++++++++++++++++ .../discount/patches/cross-makefile_in.patch | 35 +++++ srcpkgs/discount/template | 10 +- 3 files changed, 171 insertions(+), 7 deletions(-) create mode 100644 srcpkgs/discount/patches/cross-configure_inc.patch create mode 100644 srcpkgs/discount/patches/cross-makefile_in.patch diff --git a/srcpkgs/discount/patches/cross-configure_inc.patch b/srcpkgs/discount/patches/cross-configure_inc.patch new file mode 100644 index 0000000000..7572676492 --- /dev/null +++ b/srcpkgs/discount/patches/cross-configure_inc.patch @@ -0,0 +1,133 @@ +Replace the compile time check for the scalar types required +to replace BYTE, WORD and DWORD with stdint.h types. + +--- configure.inc 2017-01-19 03:42:06.000000000 +0100 ++++ configure.inc 2018-01-01 18:49:05.494530670 +0100 +@@ -895,86 +895,28 @@ + + rc=1 + LOGN "defining WORD & DWORD scalar types" +- +-# --- is this needed anymore? --- +-# if AC_QUIET AC_CHECK_HEADERS WinDef.h; then +-# # windows machine; BYTE, WORD, DWORD already +-# # defined +-# +-# for x in $@; do +-# case "$x" in +-# sub)AC_SUB DWORD DWORD +-# AC_SUB WORD WORD +-# AC_SUB BYTE BYTE +-# ;; +-# *) +-# echo "#include " >> "$__cwd"/config.h +-# ;; +-# esac +-# done +-# TLOG " (defined in WinDef.h)" +-# return 0 +-# fi +- +- cat > ngc$$.c << EOF +-#include +-#include +- +-int pound_define = 1; +- +-void +-say(char *w, char *v) +-{ +- printf(pound_define ? "#define %s %s\n" +- : "s:@%s@:%s:g\n", w, v); +-} +- +-main(argc, argv) +-char **argv; +-{ +- unsigned long v_long; +- unsigned int v_int; +- unsigned short v_short; +- +- if ( argc > 1 && strcmp(argv[1], "sub") == 0 ) +- pound_define = 0; +- +- if (sizeof v_long == 4) +- say("DWORD", "unsigned long"); +- else if (sizeof v_int == 4) +- say("DWORD", "unsigned int"); +- else +- exit(1); +- +- if (sizeof v_int == 2) +- say("WORD", "unsigned int"); +- else if (sizeof v_short == 2) +- say("WORD", "unsigned short"); +- else +- exit(2); +- say("BYTE", "unsigned char"); +- exit(0); +-} +-EOF +- if $AC_CC ngc$$.c -o ngc$$; then +- while [ "$1" ]; do +- case "$1" in +- sub)if ./ngc$$ sub >> "$__cwd"/config.sub; then +- rc=0 +- fi;; +- *) if ./ngc$$ >> "$__cwd"/config.h; then +- rc=0 +- fi ;; +- esac +- shift +- done +- if [ "$rc" != 0 ]; then +- if ./ngc$$ >> "$__cwd"/config.h; then +- rc=1 +- fi +- fi +- fi +- __remove ngc$$ ngc$$.c ++ ++ while [ "$1" ]; do ++ case "$1" in ++ sub) # substitution strings for BYTE, WORD, DWORD ++ echo "s:@DWORD@:uint32_t:g" >> "$__cwd"/config.sub ++ echo "s:@WORD@:uint16_t:g" >> "$__cwd"/config.sub ++ echo "s:@BYTE@:uint8_t:g" >> "$__cwd"/config.sub ++ rc=0 ++ ;; ++ hdr) # config.h definitions for BYTE, WORD, DWORD ++ echo "#include " >> "$__cwd"/config.h ++ echo "#define BYTE uint8_t" >> "$__cwd"/config.h ++ echo "#define WORD uint16_t" >> "$__cwd"/config.h ++ echo "#define DWORD uint32_t" >> "$__cwd"/config.h ++ rc=0 ++ ;; ++ *) # unknown parameter ++ LOGN "(unknown: $1)" ++ ;; ++ esac ++ shift ++ done + case "$rc" in + 0) TLOG "" ;; + *) AC_FAIL " ** FAILED **" ;; +@@ -1548,7 +1548,7 @@ + } + EOF + +- $AC_CC -o config.sed ngc$$.c ++ cc -o config.sed ngc$$.c + status=$? + rm -f ngc$$.c + +--- mkdio.h.in 2017-01-19 03:42:06.000000000 +0100 ++++ mkdio.h.in 2018-01-01 18:52:22.871544747 +0100 +@@ -2,6 +2,7 @@ + #define _MKDIO_D + + #include ++#include + + typedef void MMIOT; + diff --git a/srcpkgs/discount/patches/cross-makefile_in.patch b/srcpkgs/discount/patches/cross-makefile_in.patch new file mode 100644 index 0000000000..00987d2948 --- /dev/null +++ b/srcpkgs/discount/patches/cross-makefile_in.patch @@ -0,0 +1,35 @@ +Compile tools to be run on the host using cc instead of $(CC). +Ideally the patch would introduce $(CC_FOR_BUILD) instead while +for Void we know that cc is going to work. + +--- Makefile.in 2017-01-19 03:42:06.000000000 +0100 ++++ Makefile.in 2018-01-01 19:33:18.233719865 +0100 +@@ -1,5 +1,5 @@ + CC=@CC@ -I. +-LFLAGS=-L. ++LFLAGS=@LDFLAGS@ -L. + CFLAGS=@CFLAGS@ + AR=@AR@ + RANLIB=@RANLIB@ +@@ -83,6 +83,9 @@ + blocktags: mktags + ./mktags > blocktags + ++mktags: mktags.c ++ cc -o $@ $< ++ + # example programs + @THEME@theme: theme.o $(MKDLIB) mkdio.h + @THEME@ $(CC) $(CFLAGS) $(LFLAGS) -o theme theme.o pgm_options.o -lmarkdown @LIBS@ +@@ -115,9 +118,9 @@ + done + + cols: tools/cols.c config.h +- $(CC) -o cols tools/cols.c ++ cc -o cols tools/cols.c + echo: tools/echo.c config.h +- $(CC) -o echo tools/echo.c ++ cc -o echo tools/echo.c + + clean: + rm -f $(PGMS) $(TESTFRAMEWORK) $(SAMPLE_PGMS) *.o diff --git a/srcpkgs/discount/template b/srcpkgs/discount/template index 5b994dbbd5..928c27c330 100644 --- a/srcpkgs/discount/template +++ b/srcpkgs/discount/template @@ -1,10 +1,10 @@ # Template file for 'discount' pkgname=discount version=2.2.2 -revision=1 +revision=2 build_style=configure configure_script="./configure.sh" -configure_args="--prefix=/usr --shared" +configure_args="--prefix=/usr --shared --pkg-config" short_desc="C implementation of John Gruber's Markdown" maintainer="Leah Neukirchen " license="3-clause-BSD" @@ -12,11 +12,6 @@ homepage="http://www.pell.portland.or.us/~orc/Code/discount" distfiles="${homepage}/${pkgname}-${version}.tar.bz2" checksum=ec7916731e3ef8516336333f8b7aa9e2af51e57c0017b1e03fa43f1ba6978f64 -nocross="http://build.voidlinux.eu/builders/armv7l_builder/builds/22221/steps/shell_3/logs/stdio" - -post_extract() { - sed -i '/^LFLAGS/s/$/ $(LDFLAGS)/' Makefile.in -} do_install() { make DESTDIR=${DESTDIR} install install.man vlicense COPYRIGHT @@ -27,6 +22,7 @@ discount-devel_package() { pkg_install() { vmove usr/include vmove usr/lib/*.so + vmove usr/lib/pkgconfig vmove usr/share/man/man3 } }