aboutsummaryrefslogtreecommitdiff
path: root/converters/chmview
diff options
context:
space:
mode:
authorPhilippe Audeoud <jadawin@FreeBSD.org>2008-09-01 19:45:04 +0000
committerPhilippe Audeoud <jadawin@FreeBSD.org>2008-09-01 19:45:04 +0000
commit965c2c5e56ec79a6529bcc097c523da06c59a1e5 (patch)
tree194984d371c9d8876e3d44b159e5f76a77449866 /converters/chmview
parentf75ae0d9dd5f96a6e1ffe55519d68f810ce51555 (diff)
downloadports-965c2c5e56ec79a6529bcc097c523da06c59a1e5.tar.gz
ports-965c2c5e56ec79a6529bcc097c523da06c59a1e5.zip
Notes
Diffstat (limited to 'converters/chmview')
-rw-r--r--converters/chmview/Makefile8
-rw-r--r--converters/chmview/files/patch-aa58
-rw-r--r--converters/chmview/files/patch-bb23
3 files changed, 76 insertions, 13 deletions
diff --git a/converters/chmview/Makefile b/converters/chmview/Makefile
index 7498213390db..71be7663f684 100644
--- a/converters/chmview/Makefile
+++ b/converters/chmview/Makefile
@@ -21,11 +21,7 @@ USE_DOS2UNIX= yes
WRKSRC= ${WRKDIR}/src
PLIST_FILES= bin/chmview
-.include <bsd.port.pre.mk>
-
-.if ${ARCH} != "i386"
-BROKEN= is not 64-bit clean
-.endif
+ONLY_FOR_ARCHS= i386 amd64
pre-patch:
@${CP} ${FILESDIR}/Makefile ${WRKSRC}
@@ -33,4 +29,4 @@ pre-patch:
do-install:
@${INSTALL_PROGRAM} ${WRKSRC}/chmview ${PREFIX}/bin/
-.include <bsd.port.post.mk>
+.include <bsd.port.mk>
diff --git a/converters/chmview/files/patch-aa b/converters/chmview/files/patch-aa
index 1992580c9b9d..ff9955ff0e18 100644
--- a/converters/chmview/files/patch-aa
+++ b/converters/chmview/files/patch-aa
@@ -1,6 +1,7 @@
---- ../src/chmview.c
-+++ chmview.c.new
-@@ -17,16 +17,30 @@
+diff -ruN src.old/chmview.c src/chmview.c
+--- src.old/chmview.c 2005-03-07 21:29:18.000000000 +0100
++++ chmview.c 2008-08-18 14:39:39.000000000 +0200
+@@ -17,19 +17,33 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
@@ -30,7 +31,11 @@
+
struct cb_data
{
- int extractwithoutpath;
+- int extractwithoutpath;
++ long extractwithoutpath;
+ char *path;
+ int pathlen;
+ };
@@ -44,6 +58,7 @@
return p;
}
@@ -79,6 +84,15 @@
const char ILLEGAL_SYMB[] = "<>:|?*\"";
const char ILLEGAL_REPL[] = "()_!__'";
+@@ -94,7 +142,7 @@
+ }
+ }
+
+-static int savetofile(struct chmFile *c, struct chmUnitInfo *ui, int extractwithoutpath)
++static int savetofile(struct chmFile *c, struct chmUnitInfo *ui, long extractwithoutpath)
+ {
+ LONGINT64 length=0;
+ char *outbuf=NULL;
@@ -103,6 +151,9 @@
char fullpath[CHM_MAX_PATHLEN*2+1];
char target[CHM_MAX_PATHLEN*2+1];
@@ -122,7 +136,14 @@
ReplaceIllegalChars(target);
strcat(fullpath,extractwithoutpath?pointtoname(target):(target[0]=='/'?target+1:target));
if (!extractwithoutpath)
-@@ -153,15 +223,19 @@
+@@ -147,26 +217,30 @@
+ return 0;
+ }
+
+-void extract(struct chmFile *c, struct chmUnitInfo *ui, int extractwithoutpath)
++void extract(struct chmFile *c, struct chmUnitInfo *ui, long extractwithoutpath)
+ {
+ char target[CHM_MAX_PATHLEN*2+1];
wchar_t temp[CHM_MAX_PATHLEN+1];
decode_UTF8(temp,ui->path);
@@ -138,12 +159,26 @@
error=1;
//return CHM_ENUMERATOR_FAILURE;
- }
-- printf("OK\n");
+ } else
-+ printf("OK\n");
+ printf("OK\n");
}
int _extract_callback_all(struct chmFile *c, struct chmUnitInfo *ui, void *context)
+ {
+- extract(c,ui,(int)context);
++ extract(c,ui,(long)context);
+ return CHM_ENUMERATOR_CONTINUE;
+ }
+
+@@ -180,7 +254,7 @@
+ return CHM_ENUMERATOR_CONTINUE;
+ }
+
+-extractdir(struct chmFile *c, char *path, int extractwithoutpath)
++extractdir(struct chmFile *c, char *path, long extractwithoutpath)
+ {
+ struct cb_data data = {extractwithoutpath,path,strlen(path)};
+ chm_enumerate(c,CHM_ENUMERATE_ALL,_extract_callback_dir,(void *)&data);
@@ -193,7 +267,11 @@
wchar_t temp[CHM_MAX_PATHLEN+1];
@@ -166,6 +201,15 @@
c = chm_open(infname);
if (!c)
exit(-1);
+@@ -265,7 +346,7 @@
+ char target[CHM_MAX_PATHLEN*2+1];
+ wchar_t temp[CHM_MAX_PATHLEN+1];
+ int status;
+- int extractwithoutpath = command[0]=='e'?1:0;
++ long extractwithoutpath = command[0]=='e'?1:0;
+
+ if (argc == 4)
+ {
@@ -305,7 +386,11 @@
strcat(target,name+1);
else
diff --git a/converters/chmview/files/patch-bb b/converters/chmview/files/patch-bb
new file mode 100644
index 000000000000..a50e6446608d
--- /dev/null
+++ b/converters/chmview/files/patch-bb
@@ -0,0 +1,23 @@
+diff -ruN src.old/chm_lib.c src/chm_lib.c
+--- src.old/chm_lib.c 2008-08-18 10:22:30.000000000 +0200
++++ chm_lib.c 2008-08-18 11:10:20.000000000 +0200
+@@ -170,8 +170,18 @@
+ typedef unsigned long UInt32;
+ typedef long long Int64;
+ typedef unsigned long long UInt64;
+-#else
+
++/* AMD64 */
++#elif __amd64__
++typedef unsigned char UChar;
++typedef short Int16;
++typedef unsigned short UInt16;
++typedef long Int32;
++typedef unsigned long UInt32;
++typedef long long Int64;
++typedef unsigned long long UInt64;
++
++#else
+ /* yielding an error is preferable to yielding incorrect behavior */
+ #error "Please define the sized types for your platform in chm_lib.c"
+ #endif