Re: [ITA] libXpm-noX 3.5.12

2017-12-05 Thread Andrew Schulman
> On 15/11/2017 17:30, Ken Brown wrote:
> > My cygport file and other files needed for reproducing the build are 
> > attached.
> 
> I added this to your uploads, 

Gold star awarded! https://cygwin.com/goldstars/#KB



Re: [ITA] libXpm-noX 3.5.12

2017-11-20 Thread Ken Brown

On 11/20/2017 11:42 AM, Jon Turney wrote:

On 15/11/2017 17:30, Ken Brown wrote:
My cygport file and other files needed for reproducing the build are 
attached.


I added this to your uploads, but this fails to build for me:

libXpm-nox/libXpm-noX-3.5.12-1.src/libXpm-noX-3.5.12-1.x86_6/src/libXpm-3.5.12/src/simx.c:42:40: 
fatal error: xpmi.h: No such file or directory

  #include "xpmi.h"   /* for XpmMalloc */

which looks like some sort of case-sensitivity issue vs. XpmI.h, but I 
can't see that it's introduced by your patches, and I don't understand 
how it could be present in upstream...


Thanks for checking the build.  I didn't catch this because I did the 
build on a Cygwin installation that was case insensitive (which is not 
my usual habit).


The problem actually is present in upstream.  But it isn't a problem 
from the upstream point of view because the file simx.c is intended for 
the native Windows build, where case insensitivity can be assumed.


For the record, I'm attaching a revised 04-source-code.patch that fixes 
this.


Ken
diff -urN -x CYGWIN-PATCHES origsrc/libXpm-3.5.10/include/X11/xpm.h 
src/libXpm-3.5.10/include/X11/xpm.h
--- origsrc/libXpm-3.5.10/include/X11/xpm.h 2012-03-07 23:40:08.0 
-0500
+++ src/libXpm-3.5.10/include/X11/xpm.h 2013-06-30 18:41:11.234785900 -0400
@@ -33,7 +33,7 @@
 \*/
 
 /*
- * The code related to FOR_MSW has been added by
+ * The code related to XPM_NO_X has been added by
  * HeDu (h...@cul-ipn.uni-kiel.de) 4/94
  */
 
@@ -42,6 +42,11 @@
  * Lorens Younes (d93-...@nada.kth.se) 4/96
  */
 
+/* 
+ * The code related to CYGWIN has been added by
+ * Charles Wilson (cyg...@cygwin.com) 10/00
+ */
+
 #ifndef XPM_h
 #define XPM_h
 
@@ -62,21 +67,33 @@
 #define XpmRevision 11
 #define XpmIncludeVersion ((XpmFormat * 100 + XpmVersion) * 100 + XpmRevision)
 
+/* XPM_NO_X and FOR_MSW are synonymous */
+#ifdef XPM_NO_X
+#  ifndef FOR_MSW
+#define FOR_MSW
+#  endif
+#endif
+#ifdef FOR_MSW
+#  ifndef XPM_NO_X
+#define XPM_NO_X
+#  endif
+#endif
+
 #ifndef XPM_NUMBERS
 
-#ifdef FOR_MSW
+#ifdef XPM_NO_X
 # define SYSV  /* uses memcpy string.h etc. */
 # include 
 # include "simx.h" /* defines some X stuff using MSW types */
 #define NEED_STRCASECMP/* at least for MSVC++ */
-#else /* FOR_MSW */
+#else /* XPM_NO_X */
 # ifdef AMIGA
 #  include "amigax.h"
 # else /* not AMIGA */
 #  include 
 #  include 
 # endif /* not AMIGA */
-#endif /* FOR_MSW */
+#endif /* XPM_NO_X */
 
 /* let's define Pixel if it is not done yet */
 #if ! defined(_XtIntrinsic_h) && ! defined(PIXEL_ALREADY_TYPEDEFED)
@@ -255,7 +272,7 @@
 #define XpmReturnComments  XpmComments
 
 /* XpmAttributes mask_pixel value when there is no mask */
-#ifndef FOR_MSW
+#ifndef XPM_NO_X
 #define XpmUndefPixel 0x8000
 #else
 /* int is only 16 bit for MSW */
@@ -285,10 +302,10 @@
 
 _XFUNCPROTOBEGIN
 
-/* FOR_MSW, all ..Pixmap.. are excluded, only the ..XImage.. are used */
+/* XPM_NO_X, all ..Pixmap.. are excluded, only the ..XImage.. are used */
 /* Same for Amiga! */
 
-#if !defined(FOR_MSW) && !defined(AMIGA)
+#if !defined(XPM_NO_X) && !defined(AMIGA)
 FUNC(XpmCreatePixmapFromData, int, (Display *display,
Drawable d,
char **data,
@@ -345,7 +362,7 @@
 XImage **image_return,
 XImage **shapemask_return,
 XpmAttributes *attributes));
-#if !defined(FOR_MSW) && !defined(AMIGA)
+#if !defined(XPM_NO_X) && !defined(AMIGA)
 FUNC(XpmCreatePixmapFromBuffer, int, (Display *display,
  Drawable d,
  char *buffer,
@@ -389,7 +406,7 @@
 FUNC(XpmWriteFileFromXpmImage, int, (char *filename,
 XpmImage *image,
 XpmInfo *info));
-#if !defined(FOR_MSW) && !defined(AMIGA)
+#if !defined(XPM_NO_X) && !defined(AMIGA)
 FUNC(XpmCreatePixmapFromXpmImage, int, (Display *display,
Drawable d,
XpmImage *image,
@@ -408,7 +425,7 @@
   XImage *shapeimage,
   XpmImage *xpmimage,
   XpmAttributes *attributes));
-#if !defined(FOR_MSW) && !defined(AMIGA)
+#if !defined(XPM_NO_X) && !defined(AMIGA)
 FUNC(XpmCreateXpmImageFromPixmap, int, (Display *display,
Pixmap pixmap,
Pixmap shapemask,
diff -urN -x CYGWIN-PATCHES origsrc/libXpm-3.5.10/src/create.c 
src/libXpm-3.5.10/src/create.c
--- origsrc/libXpm-3.5.10/src/create.c  2012-03-07 23:40:08.0 -0500

Re: [ITA] libXpm-noX 3.5.12

2017-11-20 Thread Jon Turney

On 15/11/2017 17:30, Ken Brown wrote:
My cygport file and other files needed for reproducing the build are 
attached.


I added this to your uploads, but this fails to build for me:

libXpm-nox/libXpm-noX-3.5.12-1.src/libXpm-noX-3.5.12-1.x86_6/src/libXpm-3.5.12/src/simx.c:42:40: 
fatal error: xpmi.h: No such file or directory

 #include "xpmi.h"   /* for XpmMalloc */

which looks like some sort of case-sensitivity issue vs. XpmI.h, but I 
can't see that it's introduced by your patches, and I don't understand 
how it could be present in upstream...




[ITA] libXpm-noX 3.5.12

2017-11-15 Thread Ken Brown

My cygport file and other files needed for reproducing the build are attached.

Package files
=

D=http://sanibeltranquility.com/cygwin
${D}/x86/release/libXpm-noX/libXpm-noX-3.5.12-1-src.tar.xz
${D}/x86/release/libXpm-noX/libXpm-noX-3.5.12-1.hint
${D}/x86/release/libXpm-noX/libXpm-noX-3.5.12-1.tar.xz
${D}/x86/release/libXpm-noX/libXpm-noX-debuginfo/libXpm-noX-debuginfo-3.5.12-1.hint
${D}/x86/release/libXpm-noX/libXpm-noX-debuginfo/libXpm-noX-debuginfo-3.5.12-1.tar.xz
${D}/x86/release/libXpm-noX/libXpm-noX_4/libXpm-noX_4-3.5.12-1.hint
${D}/x86/release/libXpm-noX/libXpm-noX_4/libXpm-noX_4-3.5.12-1.tar.xz
${D}/x86/release/libXpm-noX/libXpm-noX-devel/libXpm-noX-devel-3.5.12-1.hint
${D}/x86/release/libXpm-noX/libXpm-noX-devel/libXpm-noX-devel-3.5.12-1.tar.xz
${D}/x86_64/release/libXpm-noX/libXpm-noX-3.5.12-1-src.tar.xz
${D}/x86_64/release/libXpm-noX/libXpm-noX-3.5.12-1.hint
${D}/x86_64/release/libXpm-noX/libXpm-noX-3.5.12-1.tar.xz
${D}/x86_64/release/libXpm-noX/libXpm-noX-debuginfo/libXpm-noX-debuginfo-3.5.12-1.hint
${D}/x86_64/release/libXpm-noX/libXpm-noX-debuginfo/libXpm-noX-debuginfo-3.5.12-1.tar.xz
${D}/x86_64/release/libXpm-noX/libXpm-noX_4/libXpm-noX_4-3.5.12-1.hint
${D}/x86_64/release/libXpm-noX/libXpm-noX_4/libXpm-noX_4-3.5.12-1.tar.xz
${D}/x86_64/release/libXpm-noX/libXpm-noX-devel/libXpm-noX-devel-3.5.12-1.hint
${D}/x86_64/release/libXpm-noX/libXpm-noX-devel/libXpm-noX-devel-3.5.12-1.tar.xz

Ken

NAME="libXpm-noX"
VERSION=3.5.12
RELEASE=1
SUMMARY="X.Org X Pixmap library -- no X required"
DESCRIPTION="A version of the X.Org X Pixmap library that does not require an X
server, and provides none of the X-based display routines.  It
provides tools and libraries for manipulating XPM images.  It is
useful if you have an application that needs to read and write Xpm
format files, but either does not display them or handles display
itself, without accessing X11 services."

HOMEPAGE="https://cgit.freedesktop.org/xorg/lib/libXpm;
ORIG_PN="libXpm"
xorg_cat="lib"
SRC_URI="http://xorg.freedesktop.org/releases/individual/${xorg_cat}/${ORIG_PN}-${PV}.tar.bz2;
SRC_URI+=" sxpm-win.c"
SRC_URI+=" README.Cygwin"
SRC_URI+=" postinstall.sh"
SRC_URI+=" preremove.sh"

PATCH_URI="01-build-system.patch"
PATCH_URI+=" 02-msw-doc.patch"
PATCH_URI+=" 03-cxpm-syntax.patch"
PATCH_URI+=" 04-source-code.patch"

PKG_NAMES="libXpm-noX libXpm-noX-devel libXpm-noX_4"

libXpm_noX_CATEGORY="Graphics"
libXpm_noX_SUMMARY="${SUMMARY} (utilities)"

libXpm_noX_devel_CATEGORY="Graphics Libs Devel"
libXpm_noX_devel_SUMMARY="${SUMMARY} (devel)"
libXpm_noX_devel_DESCRIPTIION="${SUMMARY}
This package provides the (specialized) header files
and link libraries in /usr/include/noX and /usr/lib/noX,
respectively."

libXpm_noX_4_CATEGORY="Graphics Libs"
libXpm_noX_4_SUMMARY="${SUMMARY} (runtime)"

libXpm_noX_CONTENTS="--exclude=usr/bin/*.dll usr/bin usr/share"
libXpm_noX_devel_CONTENTS='usr/include usr/lib etc/'
libXpm_noX_4_CONTENTS='usr/bin/cygXpm-noX-4.dll'

DEPEND="xorg-util-macros"

src_compile() {
cd ${S}
cygautoreconf

cd ${B}
cygconf --includedir=/usr/include/noX --libdir=/usr/lib/noX \
  --disable-stat-zfile --with-localedir=no --enable-static
cygmake -j1

# custom rules...
./libtool --mode=compile gcc -I. -I${S}/include -I${S}/include/X11 
-I${S}/src \
-DXPM_NO_X ${CPPFLAGS} ${CFLAGS} -o ${B}/sxpm-win.o -c 
${S}/sxpm-win.c
./libtool --mode=link gcc -o ${B}/sxpm-win.exe ${B}/sxpm-win.o \
./src/libXpm-noX.la
}

HTMLDOCS="doc/FAQ.html doc/README.html"
DOCS="README.Cygwin sxpm/*xpm doc/README.MSW"

src_install() {
cd ${B}
cyginstall

dodir /usr/lib/pkgconfig
${B}/libtool --mode=install /bin/install -m0755 sxpm-win.exe 
${D}/usr/bin/sxpm-noX.exe

exeinto /etc/postinstall
newexe ${S}/postinstall.sh libXpm-noX-devel.sh
exeinto /etc/preremove
newexe ${S}/preremove.sh libXpm-noX-devel.sh

cd ${D}
mv usr/lib/noX/pkgconfig/* usr/lib/pkgconfig

mv usr/bin/cxpm.exe usr/bin/cxpm-noX.exe
mv usr/share/man/man1/cxpm.1usr/share/man/man1/cxpm-noX.1

# don't install manpage for sxpm (it's incorrect, wrt sxpm-win)
rm -f usr/share/man/man1/sxpm.1
}
--- origsrc/libXpm-3.5.12/Makefile.am   2016-12-12 16:44:47.0 -0500
+++ src/libXpm-3.5.12/Makefile.am   2017-11-14 18:59:05.860229400 -0500
@@ -6,7 +6,7 @@ SUBDIRS = doc include man src sxpm cxpm
 ACLOCAL_AMFLAGS = -I m4
 
 pkgconfigdir = $(libdir)/pkgconfig
-pkgconfig_DATA = xpm.pc
+pkgconfig_DATA = xpm-nox.pc
 
 EXTRA_DIST = COPYRIGHT NEWS.old
 
--- origsrc/libXpm-3.5.12/configure.ac  2016-12-12 17:09:25.0 -0500
+++ src/libXpm-3.5.12/configure.ac  2017-11-14 19:03:15.445588100 -0500
@@ -10,8 +10,38 @@ AC_CONFIG_MACRO_DIR([m4])
 # Initialize Automake
 AM_INIT_AUTOMAKE([foreign dist-bzip2])
 
+dnl Check for host type
+AC_CANONICAL_HOST
+
 # Initialize