htmldoc_remote_compile_wrapper 0.4 → 0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/extconf.rb +4 -23
- data/htmldoc_remote_compile_wrapper.gemspec +1 -1
- data/src/htmldoc-1.8.27-libpng15.patch +150 -0
- data/src/htmldoc-1.8.27-source.tar.gz +0 -0
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2fab4de30f058f763f9123fef205b251d3addd63
|
4
|
+
data.tar.gz: c2c2ba4150f18d5b469fc83ea25ac09dd52f43db
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d7ddef0bace28b4bda541256f1cb1956e50be47767893280233b8087ad3e82960899fa3a0dbd18667962a5b50bd67899003a0e283214e44a23506c6ca55043a6
|
7
|
+
data.tar.gz: 4726ce05a6dd1bad29abefd986475bf291ade1d263b79a1d4d71e819015f4d62b6715699865610cb7b219db6205c4a5cb058f511400d73218723932e46d30933
|
data/ext/extconf.rb
CHANGED
@@ -1,38 +1,21 @@
|
|
1
1
|
require 'mkmf'
|
2
|
-
require 'fileutils'
|
3
|
-
require 'open-uri'
|
4
2
|
|
5
3
|
root = File.expand_path('../..', __FILE__)
|
6
4
|
src_dir = File.join(root, 'src')
|
7
5
|
bin_dir = File.join(root, 'bin')
|
8
|
-
tgz_filename = "htmldoc.
|
6
|
+
tgz_filename = "htmldoc-1.8.27-source.tar.gz"
|
9
7
|
tgz_file = File.join(src_dir, tgz_filename)
|
10
|
-
patch_file = File.join(src_dir, "libpng_patch")
|
11
|
-
|
12
|
-
FileUtils.rm_rf src_dir
|
13
|
-
FileUtils.mkdir src_dir
|
14
|
-
|
15
|
-
source_url = "https://joenoon-public.s3.amazonaws.com/htmldoc-1.8.27-source.tar.gz"
|
16
8
|
# Fixes building with libpng-1.5, from upstream svn r1668 via Fedora
|
17
9
|
# Remove at version 1.8.28. cf. https://github.com/mxcl/homebrew/issues/15915
|
18
|
-
|
19
|
-
|
20
|
-
puts "===> Downloading: #{source_url} to #{tgz_file}"
|
21
|
-
|
22
|
-
open(tgz_file, "wb") do |file|
|
23
|
-
file.print open(source_url).read
|
24
|
-
end
|
25
|
-
|
26
|
-
open(patch_file, "wb") do |file|
|
27
|
-
file.print open(patch_url).read
|
28
|
-
end
|
10
|
+
patch_filename = "htmldoc-1.8.27-libpng15.patch"
|
11
|
+
patch_file = File.join(src_dir, patch_filename)
|
29
12
|
|
30
13
|
Dir.chdir(src_dir) do
|
31
14
|
puts "===> Changing to directory: #{src_dir}"
|
32
15
|
puts "===> Extracting #{tgz_filename}"
|
33
16
|
system "tar xzf #{tgz_filename} --strip-components=1"
|
34
17
|
puts "===> Patching"
|
35
|
-
system "patch -p0
|
18
|
+
system "patch -p0 <#{patch_filename}"
|
36
19
|
puts "===> Configuring with prefix: #{root}"
|
37
20
|
system "./configure --prefix=#{root}"
|
38
21
|
puts "===> Building..."
|
@@ -44,8 +27,6 @@ Dir.chdir(src_dir) do
|
|
44
27
|
system "make clean"
|
45
28
|
end
|
46
29
|
|
47
|
-
FileUtils.rm_rf src_dir
|
48
|
-
|
49
30
|
puts "===> Done compiling htmldoc."
|
50
31
|
|
51
32
|
create_makefile 'htmldoc_remote_compile_wrapper'
|
@@ -0,0 +1,150 @@
|
|
1
|
+
Original http://pkgs.fedoraproject.org/cgit/htmldoc.git/plain/htmldoc-1.8.27-libpng15.patch?h=f18
|
2
|
+
|
3
|
+
From upstream 1.8 branch svn r1668
|
4
|
+
|
5
|
+
The previous libpng-1.5 conversion patch here caused corrupt PNG output
|
6
|
+
on 64 bit. e.g. http://answerpot.com/showthread.php?3662601-PNG+Rendering+Problems
|
7
|
+
|
8
|
+
The upstream version (below) works well.
|
9
|
+
|
10
|
+
Index: htmldoc/image.cxx
|
11
|
+
===================================================================
|
12
|
+
--- htmldoc/image.cxx.orig
|
13
|
+
+++ htmldoc/image.cxx
|
14
|
+
@@ -3,23 +3,11 @@
|
15
|
+
*
|
16
|
+
* Image handling routines for HTMLDOC, a HTML document processing program.
|
17
|
+
*
|
18
|
+
- * Copyright 1997-2005 by Easy Software Products.
|
19
|
+
+ * Copyright 2011 by Michael R Sweet.
|
20
|
+
+ * Copyright 1997-2010 by Easy Software Products. All rights reserved.
|
21
|
+
*
|
22
|
+
- * These coded instructions, statements, and computer programs are the
|
23
|
+
- * property of Easy Software Products and are protected by Federal
|
24
|
+
- * copyright law. Distribution and use rights are outlined in the file
|
25
|
+
- * "COPYING.txt" which should have been included with this file. If this
|
26
|
+
- * file is missing or damaged please contact Easy Software Products
|
27
|
+
- * at:
|
28
|
+
- *
|
29
|
+
- * Attn: ESP Licensing Information
|
30
|
+
- * Easy Software Products
|
31
|
+
- * 44141 Airport View Drive, Suite 204
|
32
|
+
- * Hollywood, Maryland 20636-3142 USA
|
33
|
+
- *
|
34
|
+
- * Voice: (301) 373-9600
|
35
|
+
- * EMail: info@easysw.com
|
36
|
+
- * WWW: http://www.easysw.com
|
37
|
+
+ * This program is free software. Distribution and use rights are outlined in
|
38
|
+
+ * the file "COPYING.txt".
|
39
|
+
*
|
40
|
+
* Contents:
|
41
|
+
*
|
42
|
+
@@ -1499,7 +1487,7 @@ image_load_png(image_t *img, /* I - Imag
|
43
|
+
|
44
|
+
rows = NULL;
|
45
|
+
|
46
|
+
- if (setjmp(pp->jmpbuf))
|
47
|
+
+ if (setjmp(png_jmpbuf(pp)))
|
48
|
+
{
|
49
|
+
progress_error(HD_ERROR_BAD_FORMAT, "PNG file contains errors!");
|
50
|
+
|
51
|
+
@@ -1526,7 +1514,7 @@ image_load_png(image_t *img, /* I - Imag
|
52
|
+
|
53
|
+
png_read_info(pp, info);
|
54
|
+
|
55
|
+
- if (info->color_type & PNG_COLOR_MASK_PALETTE)
|
56
|
+
+ if (png_get_color_type(pp, info) & PNG_COLOR_MASK_PALETTE)
|
57
|
+
{
|
58
|
+
png_set_expand(pp);
|
59
|
+
|
60
|
+
@@ -1535,15 +1523,15 @@ image_load_png(image_t *img, /* I - Imag
|
61
|
+
if (Encryption)
|
62
|
+
img->use ++;
|
63
|
+
}
|
64
|
+
- else if (info->bit_depth < 8)
|
65
|
+
+ else if (png_get_bit_depth(pp, info) < 8)
|
66
|
+
{
|
67
|
+
png_set_packing(pp);
|
68
|
+
png_set_expand(pp);
|
69
|
+
}
|
70
|
+
- else if (info->bit_depth == 16)
|
71
|
+
+ else if (png_get_bit_depth(pp, info) == 16)
|
72
|
+
png_set_strip_16(pp);
|
73
|
+
|
74
|
+
- if (info->color_type & PNG_COLOR_MASK_COLOR)
|
75
|
+
+ if (png_get_color_type(pp, info) & PNG_COLOR_MASK_COLOR)
|
76
|
+
{
|
77
|
+
depth = 3;
|
78
|
+
img->depth = gray ? 1 : 3;
|
79
|
+
@@ -1554,10 +1542,10 @@ image_load_png(image_t *img, /* I - Imag
|
80
|
+
img->depth = 1;
|
81
|
+
}
|
82
|
+
|
83
|
+
- img->width = info->width;
|
84
|
+
- img->height = info->height;
|
85
|
+
+ img->width = png_get_image_width(pp, info);
|
86
|
+
+ img->height = png_get_image_height(pp, info);
|
87
|
+
|
88
|
+
- if ((info->color_type & PNG_COLOR_MASK_ALPHA) || info->num_trans)
|
89
|
+
+ if (png_get_color_type(pp, info) & PNG_COLOR_MASK_ALPHA)
|
90
|
+
{
|
91
|
+
if ((PSLevel == 0 && PDFVersion >= 14) || PSLevel == 3)
|
92
|
+
image_need_mask(img, 8);
|
93
|
+
@@ -1571,14 +1559,14 @@ image_load_png(image_t *img, /* I - Imag
|
94
|
+
|
95
|
+
#ifdef DEBUG
|
96
|
+
printf("color_type=0x%04x, depth=%d, img->width=%d, img->height=%d, img->depth=%d\n",
|
97
|
+
- info->color_type, depth, img->width, img->height, img->depth);
|
98
|
+
- if (info->color_type & PNG_COLOR_MASK_COLOR)
|
99
|
+
+ png_get_color_type(pp, info), depth, img->width, img->height, img->depth);
|
100
|
+
+ if (png_get_color_type(pp, info) & PNG_COLOR_MASK_COLOR)
|
101
|
+
puts(" COLOR");
|
102
|
+
else
|
103
|
+
puts(" GRAYSCALE");
|
104
|
+
- if ((info->color_type & PNG_COLOR_MASK_ALPHA) || info->num_trans)
|
105
|
+
+ if (png_get_color_type(pp, info) & PNG_COLOR_MASK_ALPHA)
|
106
|
+
puts(" ALPHA");
|
107
|
+
- if (info->color_type & PNG_COLOR_MASK_PALETTE)
|
108
|
+
+ if (png_get_color_type(pp, info) & PNG_COLOR_MASK_PALETTE)
|
109
|
+
puts(" PALETTE");
|
110
|
+
#endif // DEBUG
|
111
|
+
|
112
|
+
@@ -1594,9 +1582,9 @@ image_load_png(image_t *img, /* I - Imag
|
113
|
+
* Allocate pointers...
|
114
|
+
*/
|
115
|
+
|
116
|
+
- rows = (png_bytep *)calloc(info->height, sizeof(png_bytep));
|
117
|
+
+ rows = (png_bytep *)calloc(png_get_image_height(pp, info), sizeof(png_bytep));
|
118
|
+
|
119
|
+
- for (i = 0; i < (int)info->height; i ++)
|
120
|
+
+ for (i = 0; i < (int)png_get_image_height(pp, info); i ++)
|
121
|
+
rows[i] = img->pixels + i * img->width * depth;
|
122
|
+
|
123
|
+
/*
|
124
|
+
@@ -1610,7 +1598,7 @@ image_load_png(image_t *img, /* I - Imag
|
125
|
+
* Generate the alpha mask as necessary...
|
126
|
+
*/
|
127
|
+
|
128
|
+
- if ((info->color_type & PNG_COLOR_MASK_ALPHA) || info->num_trans)
|
129
|
+
+ if (png_get_color_type(pp, info) & PNG_COLOR_MASK_ALPHA)
|
130
|
+
{
|
131
|
+
#ifdef DEBUG
|
132
|
+
for (inptr = img->pixels, i = 0; i < img->height; i ++)
|
133
|
+
@@ -1639,7 +1627,7 @@ image_load_png(image_t *img, /* I - Imag
|
134
|
+
* Reformat the data as necessary for the reader...
|
135
|
+
*/
|
136
|
+
|
137
|
+
- if (gray && info->color_type & PNG_COLOR_MASK_COLOR)
|
138
|
+
+ if (gray && png_get_color_type(pp, info) & PNG_COLOR_MASK_COLOR)
|
139
|
+
{
|
140
|
+
/*
|
141
|
+
* Greyscale output needed...
|
142
|
+
@@ -1720,7 +1708,7 @@ image_need_mask(image_t *img, /* I - Ima
|
143
|
+
{
|
144
|
+
// Alpha mask
|
145
|
+
img->maskwidth = (img->width * scaling + 7) / 8;
|
146
|
+
- size = img->maskwidth * img->height * scaling;
|
147
|
+
+ size = img->maskwidth * img->height * scaling + 1;
|
148
|
+
}
|
149
|
+
|
150
|
+
img->mask = (uchar *)calloc(size, 1);
|
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: htmldoc_remote_compile_wrapper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.5'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joe Noon
|
@@ -26,6 +26,8 @@ files:
|
|
26
26
|
- ext/extconf.rb
|
27
27
|
- htmldoc_remote_compile_wrapper.gemspec
|
28
28
|
- lib/htmldoc_remote_compile_wrapper.rb
|
29
|
+
- src/htmldoc-1.8.27-libpng15.patch
|
30
|
+
- src/htmldoc-1.8.27-source.tar.gz
|
29
31
|
homepage: ''
|
30
32
|
licenses: []
|
31
33
|
metadata: {}
|