From ffb41deafdc3b70fc858d4c099aed0f73c88d167 Mon Sep 17 00:00:00 2001 From: "Jason E. Hale" Date: Fri, 6 Jan 2017 17:01:41 +0000 Subject: [PATCH] - Use archivers/minizip from ports instead of bundled version - Use archivers/libunrar5 instead of old archivers/libunrar - Fix and install icons - Add .desktop file - Convert ugly REINPLACE_CMDs to patches - Remove a bunch of useless warnings --- graphics/comical/Makefile | 47 +++++++++---------- .../files/patch-ComicalIcons_comical.xpm | 14 ++++++ graphics/comical/files/patch-Makefile | 24 ++++++++-- .../comical/files/patch-src_ComicalApp.cpp | 14 ++++++ graphics/comical/files/patch-src_Makefile | 12 +++++ 5 files changed, 80 insertions(+), 31 deletions(-) create mode 100644 graphics/comical/files/patch-ComicalIcons_comical.xpm create mode 100644 graphics/comical/files/patch-src_ComicalApp.cpp create mode 100644 graphics/comical/files/patch-src_Makefile diff --git a/graphics/comical/Makefile b/graphics/comical/Makefile index be2a0a31bf93..31da0f691430 100644 --- a/graphics/comical/Makefile +++ b/graphics/comical/Makefile @@ -3,7 +3,7 @@ PORTNAME= comical PORTVERSION= 0.8 -PORTREVISION= 9 +PORTREVISION= 10 CATEGORIES= graphics MASTER_SITES= SF @@ -13,39 +13,34 @@ COMMENT= Sequential image viewer LICENSE= GPLv2+ LICENSE_FILE= ${WRKSRC}/COPYING -LIB_DEPENDS= libunrar.so:archivers/libunrar - -MAKE_JOBS_UNSAFE= yes +LIB_DEPENDS= libminizip.so:archivers/minizip \ + libunrar.so.5:archivers/libunrar5 USES= gmake USE_WX= 2.8+ -PLIST_FILES= bin/comical +MAKE_ENV= WX_CONFIG=${WX_CONFIG} +INSTALL_TARGET= install-strip +MAKE_JOBS_UNSAFE= yes -post-patch: - @${REINPLACE_CMD} -e 's|/usr/local|${PREFIX}|; \ - s|\`wx-config --cxx\`|${CXX}|; \ - s|wx-config|${WX_CONFIG}|; \ - s|unrar/libunrar.a u|u|; \ - s|-lunrar|-L${LOCALBASE}/lib -lunrar|;' \ - ${WRKSRC}/Makefile +DESKTOP_ENTRIES="Comical" \ + "Comic Book Viewer" \ + "${PORTNAME}.png" \ + "${PORTNAME}" \ + "Graphics;Viewer;" \ + false - @${REINPLACE_CMD} -e 's|wx-config|${WX_CONFIG}|; \ - s|-D_UNIX|-D_UNIX -DwxUSE_UNICODE|; \ - s|CFLAGS =|CFLAGS=${CFLAGS} |; \ - s|CPPFLAGS =|CPPFLAGS=${CXXFLAGS} |; \ - s|$$(CC)|${CXX}|; \ - s|-I../unrar|-I${LOCALBASE}/include/libunrar3|;' \ - ${WRKSRC}/src/Makefile +ICONS= comical.png comical.xpm +PLIST_FILES= bin/comical \ + share/pixmaps/comical.png \ + share/pixmaps/comical.xpm - @${REINPLACE_CMD} -e 's|gcc|${CC}|; \ - s|CFLAGS=|CFLAGS+=|;' \ - ${WRKSRC}/unzip/Makefile - - @${REINPLACE_CMD} -e 's|frame->SetIcon|//frame->SetIcon|' \ - ${WRKSRC}/src/ComicalApp.cpp +# 'make makepatch' doesn't like dirs with spaces +pre-patch: + @${MV} ${WRKSRC}/Comical\ Icons ${WRKSRC}/ComicalIcons post-install: - @${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/${PORTNAME} + cd ${WRKSRC}/ComicalIcons && \ + ${INSTALL_DATA} ${ICONS} ${STAGEDIR}${PREFIX}/share/pixmaps .include diff --git a/graphics/comical/files/patch-ComicalIcons_comical.xpm b/graphics/comical/files/patch-ComicalIcons_comical.xpm new file mode 100644 index 000000000000..4944b15f2b57 --- /dev/null +++ b/graphics/comical/files/patch-ComicalIcons_comical.xpm @@ -0,0 +1,14 @@ +Avoid a boatload of warnings like this: +In file included from ComicalApp.cpp:34: +./../Comical Icons/comical.xpm:3:1: warning: conversion from string literal to 'char *' +is deprecated [-Wc++11-compat-deprecated-writable-strings] + +--- ComicalIcons/comical.xpm.orig 2017-01-06 15:58:55 UTC ++++ ComicalIcons/comical.xpm +@@ -1,5 +1,5 @@ + /* XPM */ +-static char *comical_xpm[]={ ++static const char *comical_xpm[]={ + "128 128 131 2", + "Qt c None", + ".8 c #080000", diff --git a/graphics/comical/files/patch-Makefile b/graphics/comical/files/patch-Makefile index 6ef6596c82c4..2ead48037c45 100644 --- a/graphics/comical/files/patch-Makefile +++ b/graphics/comical/files/patch-Makefile @@ -1,9 +1,23 @@ ---- Makefile.orig 2006-03-05 03:27:10.000000000 +0000 +--- Makefile.orig 2006-03-05 03:27:10 UTC +++ Makefile -@@ -1,5 +1,5 @@ - CC = `wx-config --cxx` +@@ -1,8 +1,8 @@ +-CC = `wx-config --cxx` -LDFLAGS = `wx-config --libs` -Lunrar -lunrar -Lunzip -lminiunzip -+LDFLAGS = `wx-config --libs` -Lunrar -lunrar -Lunzip -lminiunzip -lz ++CC = ${CXX} ++LDFLAGS += `${WX_CONFIG} --libs` -L${LOCALBASE}/lib -lunrar -lminizip -lz INSTALL = install INSTALL_PROGRAM = $(INSTALL) - prefix = /usr/local +-prefix = /usr/local ++prefix = ${PREFIX} + exec_prefix = $(prefix) + bindir = $(exec_prefix)/bin + +@@ -12,7 +12,7 @@ OBJS = $(patsubst %.cpp,%.o,$(wildcard s + + all: comical + +-comical: $(OBJS) unrar/libunrar.a unzip/libminiunzip.a ++comical: $(OBJS) + $(CC) -o $@ $(OBJS) $(LDFLAGS) + + $(OBJS): diff --git a/graphics/comical/files/patch-src_ComicalApp.cpp b/graphics/comical/files/patch-src_ComicalApp.cpp new file mode 100644 index 000000000000..365103c2d8a9 --- /dev/null +++ b/graphics/comical/files/patch-src_ComicalApp.cpp @@ -0,0 +1,14 @@ +Add missing header and adjust location of icons + +--- src/ComicalApp.cpp.orig 2006-03-03 04:23:15 UTC ++++ src/ComicalApp.cpp +@@ -30,7 +30,8 @@ + #include + + #if !defined(__WXMAC__) && !defined(__WXCOCOA__) && !defined(__WXMSW__) && !defined(__WXPM__) +-#include "../Comical Icons/comical.xpm" ++#include ++#include "../ComicalIcons/comical.xpm" + #endif + + // Create a new application object. diff --git a/graphics/comical/files/patch-src_Makefile b/graphics/comical/files/patch-src_Makefile new file mode 100644 index 000000000000..a39660267608 --- /dev/null +++ b/graphics/comical/files/patch-src_Makefile @@ -0,0 +1,12 @@ +--- src/Makefile.orig 2006-03-05 03:27:10 UTC ++++ src/Makefile +@@ -1,6 +1,6 @@ +-INCLUDE = -I../unrar -I../unzip +-CFLAGS = -O2 -Wall -pipe +-CPPFLAGS = `wx-config --cxxflags` $(CFLAGS) -D_UNIX $(INCLUDE) ++INCLUDE = -I${LOCALBASE}/include/libunrar5 -I${LOCALBASE}/include/minizip ++CFLAGS += -Wall -Wno-unused-local-typedef -pipe ${CXXFLAGS} ++CPPFLAGS += `${WX_CONFIG} --cxxflags` $(CFLAGS) -D_UNIX -DwxUSE_UNICODE $(INCLUDE) + + .SUFFIXES: .cpp .png .h .d .o +