Browse Source

mingw-w64-pdcurses: upgrade to 4.1.0

Signed-off-by: Steven Noonan <steven@uplinklabs.net>
master
Steven Noonan 1 year ago
parent
commit
5569a18e69
Signed by: steven GPG Key ID: 408EEB508ED0CD4D
  1. 68
      mingw-w64-pdcurses/001-mingw-pdcurses-4.1.0-build.patch
  2. 43
      mingw-w64-pdcurses/002-fix-exports.patch
  3. 86
      mingw-w64-pdcurses/PKGBUILD
  4. 63
      mingw-w64-pdcurses/mingw-pdcurses-3.4-build.patch

68
mingw-w64-pdcurses/001-mingw-pdcurses-4.1.0-build.patch

@ -0,0 +1,68 @@
diff -Naur pdcurses-4.1.0-orig/wincon/Makefile.mng pdcurses-4.1.0/wincon/Makefile.mng
--- pdcurses-4.1.0-orig/wincon/Makefile.mng 2019-05-09 02:27:41.000000000 +0300
+++ pdcurses-4.1.0/wincon/Makefile.mng 2019-05-28 08:49:28.054006700 +0300
@@ -100,8 +100,9 @@
ifeq ($(DLL),Y)
CFLAGS += -DPDC_DLL_BUILD
LIBEXE = $(PREFIX)gcc
- LIBFLAGS = -Wl,--out-implib,pdcurses.a -shared -o
- LIBCURSES = pdcurses.dll
+ LIBARCHIVE = libpdcurses.dll.a
+ LIBFLAGS = -Wl,--out-implib,$(LIBARCHIVE) -shared -o
+ LIBCURSES = libpdcurses.dll
LIBDEPS = $(LIBOBJS) $(PDCOBJS)
LIBSADDED =
EXELIBS =
@@ -113,7 +114,8 @@
else
LIBFLAGS = rv
endif
- LIBCURSES = pdcurses.a
+ LIBARCHIVE = libpdcurses.a
+ LIBCURSES = $(LIBARCHIVE)
LIBDEPS = $(LIBOBJS) $(PDCOBJS)
LIBSADDED =
EXELIBS =
@@ -139,7 +141,7 @@
$(LIBCURSES) : $(LIBDEPS)
$(LIBEXE) $(LIBFLAGS) $@ $? $(LIBSADDED)
- $(CP) pdcurses.a panel.a
+ $(CP) $(LIBARCHIVE) libpanel.a
$(LIBOBJS) $(PDCOBJS) : $(PDCURSES_HEADERS)
$(PDCOBJS) : $(PDCURSES_WIN_H)
diff -Naur pdcurses-4.1.0-orig/wingui/Makefile.mng pdcurses-4.1.0/wingui/Makefile.mng
--- pdcurses-4.1.0-orig/wingui/Makefile.mng 2019-05-09 02:27:41.000000000 +0300
+++ pdcurses-4.1.0/wingui/Makefile.mng 2019-05-28 08:48:33.963930900 +0300
@@ -98,8 +98,9 @@
ifeq ($(DLL),Y)
CFLAGS += -DPDC_DLL_BUILD
LIBEXE = $(CC)
- LIBFLAGS = -Wl,--out-implib,pdcurses.a -shared -o
- LIBCURSES = pdcurses.dll
+ LIBARCHIVE = libpdcurses.dll.a
+ LIBFLAGS = -Wl,--out-implib,$(LIBARCHIVE) -shared -o
+ LIBCURSES = libpdcurses.dll
LIBDEPS = $(LIBOBJS) $(PDCOBJS)
LIBSADDED = -lgdi32 -lcomdlg32
EXELIBS =
@@ -111,7 +112,8 @@
else
LIBFLAGS = rv
endif
- LIBCURSES = pdcurses.a
+ LIBARCHIVE = libpdcurses.a
+ LIBCURSES = $(LIBARCHIVE)
LIBDEPS = $(LIBOBJS) $(PDCOBJS)
LIBSADDED =
EXELIBS = -lgdi32 -lcomdlg32
@@ -137,7 +139,7 @@
$(LIBCURSES) : $(LIBDEPS)
$(LIBEXE) $(LIBFLAGS) $@ $? $(LIBSADDED)
- $(CP) pdcurses.a panel.a
+ $(CP) $(LIBARCHIVE) libpanel.a
$(LIBOBJS) $(PDCOBJS) : $(PDCURSES_HEADERS)
$(PDCOBJS) : $(PDCURSES_WIN_H)

43
mingw-w64-pdcurses/002-fix-exports.patch

@ -0,0 +1,43 @@
diff -ruN PDCurses-patched/term.h PDCurses/term.h
--- PDCurses-patched/term.h 2017-10-02 09:48:51.000000000 +0800
+++ PDCurses/term.h 2017-10-02 09:49:28.290552879 +0800
@@ -23,23 +23,23 @@
/* PDCEX is defined in curses.h */
PDCEX TERMINAL *cur_term;
-int del_curterm(TERMINAL *);
-int putp(const char *);
-int restartterm(const char *, int, int *);
-TERMINAL *set_curterm(TERMINAL *);
-int setterm(const char *);
-int setupterm(const char *, int, int *);
-int tgetent(char *, const char *);
-int tgetflag(const char *);
-int tgetnum(const char *);
-char *tgetstr(const char *, char **);
-char *tgoto(const char *, int, int);
-int tigetflag(const char *);
-int tigetnum(const char *);
-char *tigetstr(const char *);
-char *tparm(const char *, long, long, long, long, long,
+PDCEX int del_curterm(TERMINAL *);
+PDCEX int putp(const char *);
+PDCEX int restartterm(const char *, int, int *);
+PDCEX TERMINAL *set_curterm(TERMINAL *);
+PDCEX int setterm(const char *);
+PDCEX int setupterm(const char *, int, int *);
+PDCEX int tgetent(char *, const char *);
+PDCEX int tgetflag(const char *);
+PDCEX int tgetnum(const char *);
+PDCEX char *tgetstr(const char *, char **);
+PDCEX char *tgoto(const char *, int, int);
+PDCEX int tigetflag(const char *);
+PDCEX int tigetnum(const char *);
+PDCEX char *tigetstr(const char *);
+PDCEX char *tparm(const char *, long, long, long, long, long,
long, long, long, long);
-int tputs(const char *, int, int (*)(int));
+PDCEX int tputs(const char *, int, int (*)(int));
#if defined(__cplusplus) || defined(__cplusplus__) || defined(__CPLUSPLUS)
}

86
mingw-w64-pdcurses/PKGBUILD

@ -1,49 +1,85 @@
# Maintainer: Andrew Sun <adsun701@gmail.com>
# Contributor: Filip Brcic <brcha@gna.org>
pkgname=mingw-w64-pdcurses
pkgver=3.4
pkgrel=4
pkgdesc="Curses library for MinGW-w64"
arch=(any)
depends=(mingw-w64-crt)
makedepends=(mingw-w64-gcc)
provides=(mingw-w64-curses)
pkgver=4.1.0
pkgrel=1
pkgdesc="Public Domain Curses wincon port (mingw-w64)"
arch=('any')
url="https://www.projectpluto.com/win32a.htm"
depends=('mingw-w64-crt')
makedepends=('mingw-w64-gcc')
options=(staticlibs !buildflags !strip)
license=("public domain")
url="http://pdcurses.sourceforge.net"
source=("http://downloads.sourceforge.net/pdcurses/PDCurses-${pkgver}.tar.gz"
"mingw-pdcurses-3.4-build.patch")
md5sums=('4e04e4412d1b1392a7f9a489b95b331a'
'd1a36327155f51a1073b930e3647e4aa')
source=(pdcurses-${pkgver}.tar.gz::"https://github.com/Bill-Gray/PDCurses/archive/v${pkgver}.tar.gz"
001-mingw-pdcurses-4.1.0-build.patch
002-fix-exports.patch)
sha256sums=('3421e2e84bdc8220dc6740b70aa9b0e30542064189efc8609e00de78ced75656'
'913b5aff09d0ab1a2197f66a98657927d85a0dc3577c2b5e69179148fb2b0242'
'246f93facdd2703f8b9d0bcd57e89688fd861d34a30facc60a48892b330b08bc')
_architectures="i686-w64-mingw32 x86_64-w64-mingw32"
prepare() {
cd "${srcdir}/PDCurses-${pkgver}"
patch -Np1 -i ${srcdir}/mingw-pdcurses-3.4-build.patch
sed -i "s|CFLAGS = \-O2 \-Wall|CFLAGS = \-O2 \-g -pipe \-Wall \-Wp,\-D_FORTIFY_SOURCE=2 \-fexceptions \-\-param=ssp\-buffer\-size=4|g" win32/mingwin32.mak
patch -p1 -i ${srcdir}/001-mingw-pdcurses-4.1.0-build.patch
patch -p1 -i ${srcdir}/002-fix-exports.patch
}
build() {
cd "${srcdir}/PDCurses-${pkgver}"
export CFLAGS="-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions --param=ssp-buffer-size=4"
for _arch in ${_architectures}; do
cp -a win32 build-${_arch} && pushd build-${_arch}
make -f mingwin32.mak \
CC=${_arch}-gcc \
LINK=${_arch}-gcc \
STRIP=${_arch}-strip \
WIDE=Y UTF8=Y DLL=Y
# NOte that you should use something like -${_arch}
# to prevent building i686 compiled binaries from
# being compiled with x86_64 compiled binaries and
# vice-versa. That causes build failures - no surpise.
cp -rf wingui wingui-shared-${_arch}
pushd wingui-shared-${_arch}
make -f Makefile.mng \
CC=${_arch}-gcc \
LINK=${_arch}-gcc \
STRIP=${_arch}-strip \
AR=${_arch}-ar \
WIDE=Y \
UTF8=Y \
DLL=Y
popd
cp -rf wingui wingui-static-${_arch}
pushd wingui-static-${_arch}
make -f Makefile.mng \
CC=${_arch}-gcc \
LINK=${_arch}-gcc \
STRIP=${_arch}-strip \
AR=${_arch}-ar \
WIDE=Y \
UTF8=Y
popd
done
}
package() {
cd "${srcdir}/PDCurses-${pkgver}"
for _arch in ${_architectures} ; do
install -d "${pkgdir}"/usr/${_arch}/{bin,lib,include}
install build-${_arch}/pdcurses.dll "${pkgdir}"/usr/${_arch}/bin/
install build-${_arch}/pdcurses.a "${pkgdir}"/usr/${_arch}/lib/libpdcurses.dll.a
install -m 0644 curses.h panel.h term.h "${pkgdir}"/usr/${_arch}/include/
find "$pkgdir/usr/${_arch}" -name '*.exe' -exec rm {} \;
mkdir -p ${pkgdir}/usr/${_arch}/{bin,include,lib}
mkdir ${pkgdir}/usr/${_arch}/include/pdcurses
install wingui-shared-${_arch}/*.exe ${pkgdir}/usr/${_arch}/bin/
install wingui-shared-${_arch}/libpdcurses.dll ${pkgdir}/usr/${_arch}/bin/
install wingui-shared-${_arch}/libpdcurses.dll.a ${pkgdir}/usr/${_arch}/lib/libpdcurses.dll.a
install wingui-shared-${_arch}/libpdcurses.dll.a ${pkgdir}/usr/${_arch}/lib/libcurses.dll.a
install wingui-shared-${_arch}/libpdcurses.dll.a ${pkgdir}/usr/${_arch}/lib/libpanel.dll.a
install wingui-static-${_arch}/libpdcurses.a ${pkgdir}/usr/${_arch}/lib/libpdcurses.a
install wingui-static-${_arch}/libpdcurses.a ${pkgdir}/usr/${_arch}/lib/libcurses.a
install wingui-static-${_arch}/libpdcurses.a ${pkgdir}/usr/${_arch}/lib/libpanel.a
echo '#include "pdcurses/curses.h"' > pdcurses.h
install -m 0644 curses.h panel.h term.h acs_defs.h ${pkgdir}/usr/${_arch}/include/pdcurses/
install -m 0644 pdcurses.h ${pkgdir}/usr/${_arch}/include/pdcurses.h
find "$pkgdir/usr/${_arch}" -name '*.exe' -exec ${_arch}-strip --strip-unneeded {} \;
find "$pkgdir/usr/${_arch}" -name '*.dll' -exec ${_arch}-strip --strip-unneeded {} \;
find "$pkgdir/usr/${_arch}" -name '*.a' -o -name '*.dll' | xargs ${_arch}-strip -g
done

63
mingw-w64-pdcurses/mingw-pdcurses-3.4-build.patch

@ -1,63 +0,0 @@
diff -Naur PDCurses-3.4.orig/win32/mingwin32.mak PDCurses-3.4/win32/mingwin32.mak
--- PDCurses-3.4.orig/win32/mingwin32.mak 2008-07-21 14:31:36.000000000 +0200
+++ PDCurses-3.4/win32/mingwin32.mak 2012-04-20 15:28:55.071506378 +0200
@@ -19,6 +19,7 @@
PDCURSES_WIN_H = $(osdir)/pdcwin.h
CC = gcc
+STRIP = strip
ifeq ($(DEBUG),Y)
CFLAGS = -g -Wall -DPDCDEBUG
@@ -30,8 +31,8 @@
CFLAGS += -I$(PDCURSES_SRCDIR)
-BASEDEF = $(PDCURSES_SRCDIR)\exp-base.def
-WIDEDEF = $(PDCURSES_SRCDIR)\exp-wide.def
+BASEDEF = $(PDCURSES_SRCDIR)/exp-base.def
+WIDEDEF = $(PDCURSES_SRCDIR)/exp-wide.def
DEFDEPS = $(BASEDEF)
@@ -50,7 +51,7 @@
ifeq ($(DLL),Y)
CFLAGS += -DPDC_DLL_BUILD
- LIBEXE = gcc $(DEFFILE)
+ LIBEXE = $(CC) $(DEFFILE)
LIBFLAGS = -Wl,--out-implib,pdcurses.a -shared -o
LIBCURSES = pdcurses.dll
LIBDEPS = $(LIBOBJS) $(PDCOBJS) $(DEFFILE)
@@ -70,24 +71,24 @@
libs: $(LIBCURSES)
clean:
- -del *.o
- -del *.exe
- -del $(CLEAN)
+ -rm *.o
+ -rm *.exe
+ -rm $(CLEAN)
demos: $(DEMOS)
- strip *.exe
+ $(STRIP) *.exe
$(DEFFILE): $(DEFDEPS)
echo LIBRARY pdcurses > $@
echo EXPORTS >> $@
- type $(BASEDEF) >> $@
+ cat $(BASEDEF) >> $@
ifeq ($(WIDE),Y)
- type $(WIDEDEF) >> $@
+ cat $(WIDEDEF) >> $@
endif
$(LIBCURSES) : $(LIBDEPS)
$(LIBEXE) $(LIBFLAGS) $@ $?
- -copy pdcurses.a panel.a
+ -cp pdcurses.a panel.a
$(LIBOBJS) $(PDCOBJS) : $(PDCURSES_HEADERS)
$(PDCOBJS) : $(PDCURSES_WIN_H)
Loading…
Cancel
Save