Skip to content

Commit

Permalink
graphics/zphoto: Fix build with graphics/imlib2 1.12.1
Browse files Browse the repository at this point in the history
- Add license
- Pet portlint, portclippy, portfmt and Q/A check

Add minimal support to `pkg-config imlib2`; imlib2-config has been
dropped since imlib2-1.7.5.

PR:		276430
  • Loading branch information
nunotexbsd committed Jan 18, 2024
1 parent 77eed51 commit 06f249d
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 30 deletions.
24 changes: 14 additions & 10 deletions graphics/zphoto/Makefile
@@ -1,33 +1,37 @@
PORTNAME= zphoto
PORTVERSION= 1.2
PORTREVISION= 14
PORTREVISION= 15
CATEGORIES= graphics www
MASTER_SITES= http://namazu.org/~satoru/zphoto/

MAINTAINER= ports@FreeBSD.org
COMMENT= Zooming photo album generator
WWW= http://namazu.org/~satoru/zphoto/

LIB_DEPENDS= libming.so:graphics/ming \
libpopt.so:devel/popt \
libImlib2.so:graphics/imlib2
LICENSE= LGPL21
LICENSE_FILE= ${WRKSRC}/COPYING

USES= alias gmake localbase perl5
LIB_DEPENDS= libImlib2.so:graphics/imlib2 \
libming.so:graphics/ming \
libpopt.so:devel/popt

USES= alias gmake localbase perl5 pkgconfig
USE_PERL5= build
GNU_CONFIGURE= yes
CONFIGURE_ARGS= --disable-avifile

OPTIONS_DEFINE= ZIP NLS
OPTIONS_DEFINE= NLS ZIP
OPTIONS_DEFAULT= ZIP
OPTIONS_SUB= yes

ZIP_DESC= Enable zip support
ZIP_RUN_DEPENDS= zip:archivers/zip
ZIP_CONFIGURE_OFF= --disable-zip
ZIP_DESC= Enable zip support

NLS_USES= gettext
NLS_USES= gettext-tools
NLS_CONFIGURE_ENABLE= nls

ZIP_RUN_DEPENDS= zip:archivers/zip
ZIP_CONFIGURE_OFF= --disable-zip

post-patch:
@${REINPLACE_CMD} -e 's|<ming.h>|<ming/ming.h>|g' ${WRKSRC}/*.c ${WRKSRC}/configure

Expand Down
22 changes: 19 additions & 3 deletions graphics/zphoto/files/patch-configure
@@ -1,6 +1,9 @@
--- configure.orig Wed May 5 16:27:51 2004
+++ configure Wed May 5 16:44:18 2004
@@ -4131,7 +4131,7 @@
Add minimal support to `pkg-config imlib2`; imlib2-config has been
dropped since imlib2-1.7.5.

--- configure.orig 2004-07-20 16:49:27 UTC
+++ configure
@@ -4494,7 +4494,7 @@ EOF
SWFMovie_save(movie, "foo"); /* 0.2a API */
}
EOF
Expand All @@ -9,3 +12,16 @@

cat >>confdefs.h <<_ACEOF
#define MING_0_2a 1
@@ -4867,6 +4867,12 @@ IMLIB2CONFIG=$ac_cv_path_IMLIB2CONFIG
esac
fi
IMLIB2CONFIG=$ac_cv_path_IMLIB2CONFIG
+
+if test -z "$IMLIB2CONFIG"; then
+ if pkg-config imlib2; then
+ IMLIB2CONFIG="pkg-config imlib2"
+ fi
+fi

if test -n "$IMLIB2CONFIG"; then
echo "$as_me:$LINENO: result: $IMLIB2CONFIG" >&5
22 changes: 11 additions & 11 deletions graphics/zphoto/files/patch-exif.c
@@ -1,6 +1,6 @@
--- exif.c.orig 2004-06-07 18:58:04.000000000 +0900
+++ exif.c 2010-12-03 21:25:38.562390923 +0900
@@ -33,11 +33,11 @@
--- exif.c.orig 2004-06-07 09:58:04 UTC
+++ exif.c
@@ -33,11 +33,11 @@ enum {
HEADER_OFFSET2 = 8
};

Expand All @@ -17,7 +17,7 @@

#define SWAP_ENDIAN_SHORT(val) ((unsigned short) ( \
(((unsigned short) (val) & (unsigned short) 0x00ff) << 8) | \
@@ -46,14 +46,14 @@
@@ -46,14 +46,14 @@ is_little_endian ()
static int
is_little_endian ()
{
Expand All @@ -35,7 +35,7 @@
if (memcmp(p, x, 4) == 0) {
retval = 1;
} else {
@@ -63,8 +63,8 @@
@@ -63,8 +63,8 @@ is_little_endian ()
return retval;
}

Expand All @@ -46,7 +46,7 @@
{
if (is_little_endian()) {
return x;
@@ -83,8 +83,8 @@
@@ -83,8 +83,8 @@ ushort_from_be (unsigned short x)
}
}

Expand All @@ -57,7 +57,7 @@
{
if (is_little_endian()) {
return SWAP_ENDIAN_LONG(x);
@@ -115,7 +115,7 @@
@@ -115,7 +115,7 @@ static int


static int
Expand All @@ -66,7 +66,7 @@
{
int x = fseek(stream, offset, whence);
if (x != 0)
@@ -142,16 +142,16 @@
@@ -142,16 +142,16 @@ typedef void (*TraverseFunc) (FILE *fp,
typedef void (*TraverseFunc) (FILE *fp,
unsigned short tag,
unsigned short type,
Expand All @@ -87,7 +87,7 @@
void *data)
{
if (tag == 0x8769) {
@@ -163,12 +163,12 @@
@@ -163,12 +163,12 @@ get_time (FILE *fp,
get_time (FILE *fp,
unsigned short tag,
unsigned short type,
Expand All @@ -103,7 +103,7 @@
char buf[BUFSIZ];
struct tm t;

@@ -204,16 +204,16 @@
@@ -204,16 +204,16 @@ read_ushort (FILE *fp, int le_exif_p)
return ushort_from_be(x);
}

Expand All @@ -126,7 +126,7 @@
}

static int
@@ -225,12 +225,12 @@
@@ -225,12 +225,12 @@ read_directory (FILE *fp, TraverseFunc func, void *dat
n = read_ushort(fp, le_exif_p);
for (i = 0; i < n; i++) {
unsigned short tag, type;
Expand Down
@@ -1,6 +1,6 @@
--- templates/default/all/Makefile.in.org 2014-06-21 19:51:31.487457236 +0900
+++ templates/default/all/Makefile.in 2014-06-21 19:51:46.935435015 +0900
@@ -369,9 +369,9 @@
--- templates/default/all/Makefile.in.orig 2004-07-20 16:49:24 UTC
+++ templates/default/all/Makefile.in
@@ -369,9 +369,9 @@ install-data-local:
| sh

install-data-local:
Expand Down
6 changes: 3 additions & 3 deletions graphics/zphoto/files/patch-util.c
@@ -1,6 +1,6 @@
--- util.c.orig 2010-12-04 00:36:16.000000000 +0900
+++ util.c 2010-12-04 00:36:52.000000000 +0900
@@ -389,7 +389,7 @@
--- util.c.orig 2004-07-20 16:48:11 UTC
+++ util.c
@@ -389,7 +389,7 @@ zphoto_get_image_suffixes (void)
zphoto_get_image_suffixes (void)
{
static char *empty[] = { NULL };
Expand Down

0 comments on commit 06f249d

Please sign in to comment.