ruby-zint 1.0.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.standard.yml +2 -0
- data/Gemfile +2 -0
- data/README.md +30 -8
- data/Rakefile +12 -0
- data/ext/ruby-zint/extconf.rb +86 -0
- data/lib/zint/aus_post.rb +1 -0
- data/lib/zint/aus_redirect.rb +1 -0
- data/lib/zint/aus_reply.rb +1 -0
- data/lib/zint/aus_route.rb +1 -0
- data/lib/zint/azrune.rb +1 -0
- data/lib/zint/aztec.rb +1 -0
- data/lib/zint/barcode.rb +439 -47
- data/lib/zint/{noascii.rb → bc_412.rb} +3 -2
- data/lib/zint/c25iata.rb +1 -0
- data/lib/zint/c25ind.rb +1 -0
- data/lib/zint/c25inter.rb +1 -0
- data/lib/zint/c25logic.rb +1 -0
- data/lib/zint/c25matrix.rb +1 -0
- data/lib/zint/c25standard.rb +1 -0
- data/lib/zint/{box.rb → cep_net.rb} +3 -2
- data/lib/zint/channel.rb +1 -0
- data/lib/zint/codabar.rb +1 -0
- data/lib/zint/codablock_f.rb +1 -0
- data/lib/zint/code11.rb +1 -0
- data/lib/zint/code128.rb +1 -0
- data/lib/zint/{dotty_mode.rb → code128ab.rb} +3 -2
- data/lib/zint/code128b.rb +2 -4
- data/lib/zint/code16k.rb +1 -0
- data/lib/zint/code32.rb +1 -0
- data/lib/zint/code39.rb +1 -0
- data/lib/zint/code49.rb +1 -0
- data/lib/zint/code93.rb +1 -0
- data/lib/zint/code_one.rb +1 -0
- data/lib/zint/constants/capability_flags.rb +14 -11
- data/lib/zint/constants/input_data_types.rb +8 -7
- data/lib/zint/constants/output_options.rb +14 -11
- data/lib/zint/constants/symbologies.rb +13 -6
- data/lib/zint/constants/warn_levels.rb +1 -1
- data/lib/zint/daft.rb +1 -0
- data/lib/zint/data_matrix.rb +1 -0
- data/lib/zint/dbarexp.rb +1 -0
- data/lib/zint/dbarexpstk.rb +1 -0
- data/lib/zint/dbarltd.rb +1 -0
- data/lib/zint/dbaromn.rb +1 -0
- data/lib/zint/dbaromnstk.rb +1 -0
- data/lib/zint/dbarstk.rb +1 -0
- data/lib/zint/dependencies.rb +8 -0
- data/lib/zint/dot_code.rb +1 -0
- data/lib/zint/dpd.rb +1 -0
- data/lib/zint/dpident.rb +1 -0
- data/lib/zint/dpleit.rb +1 -0
- data/lib/zint/ean128.rb +1 -0
- data/lib/zint/ean14.rb +1 -0
- data/lib/zint/eanx.rb +1 -0
- data/lib/zint/eanxchk.rb +1 -0
- data/lib/zint/excode39.rb +1 -0
- data/lib/zint/fim.rb +1 -0
- data/lib/zint/flat.rb +1 -0
- data/lib/zint/grid_matrix.rb +1 -0
- data/lib/zint/gs1_128.rb +1 -0
- data/lib/zint/hanxin.rb +1 -0
- data/lib/zint/hibc128.rb +1 -0
- data/lib/zint/hibc39.rb +1 -0
- data/lib/zint/hibcaztec.rb +1 -0
- data/lib/zint/hibcblockf.rb +1 -0
- data/lib/zint/hibcdm.rb +1 -0
- data/lib/zint/hibcmicpdf.rb +1 -0
- data/lib/zint/hibcpdf.rb +1 -0
- data/lib/zint/hibcqr.rb +1 -0
- data/lib/zint/isbnx.rb +1 -0
- data/lib/zint/itf14.rb +1 -0
- data/lib/zint/japan_post.rb +1 -0
- data/lib/zint/kix.rb +1 -0
- data/lib/zint/korea_post.rb +1 -0
- data/lib/zint/logmars.rb +1 -0
- data/lib/zint/mailmark.rb +1 -0
- data/lib/zint/mailmark_2d.rb +8 -0
- data/lib/zint/mailmark_4s.rb +8 -0
- data/lib/zint/maxi_code.rb +1 -0
- data/lib/zint/micro_pdf417.rb +1 -0
- data/lib/zint/micro_qr.rb +1 -0
- data/lib/zint/msiplessey.rb +1 -0
- data/lib/zint/native.rb +87 -0
- data/lib/zint/nve18.rb +1 -0
- data/lib/zint/one_code.rb +1 -0
- data/lib/zint/pdf417.rb +1 -0
- data/lib/zint/pdf417comp.rb +1 -0
- data/lib/zint/pdf417trunc.rb +1 -0
- data/lib/zint/pharma.rb +1 -0
- data/lib/zint/pharmatwo.rb +1 -0
- data/lib/zint/planet.rb +1 -0
- data/lib/zint/plessey.rb +1 -0
- data/lib/zint/postnet.rb +1 -0
- data/lib/zint/pzn.rb +1 -0
- data/lib/zint/qr.rb +1 -0
- data/lib/zint/rmqr.rb +1 -0
- data/lib/zint/rss14.rb +1 -0
- data/lib/zint/rss14stack.rb +1 -0
- data/lib/zint/rss14stackomni.rb +1 -0
- data/lib/zint/rssexp.rb +1 -0
- data/lib/zint/rssexpstack.rb +1 -0
- data/lib/zint/rssltd.rb +1 -0
- data/lib/zint/structs/structapp.rb +25 -0
- data/lib/zint/structs/symbol.rb +44 -36
- data/lib/zint/structs/vector.rb +47 -5
- data/lib/zint/structs/vector_circle.rb +32 -0
- data/lib/zint/structs/vector_hexagon.rb +31 -0
- data/lib/zint/structs/vector_rect.rb +37 -0
- data/lib/zint/structs/vector_string.rb +43 -8
- data/lib/zint/telepen.rb +1 -0
- data/lib/zint/telepennum.rb +1 -0
- data/lib/zint/ultra.rb +1 -0
- data/lib/zint/upc_a.rb +1 -0
- data/lib/zint/upc_a_chk.rb +1 -0
- data/lib/zint/upc_e.rb +1 -0
- data/lib/zint/upc_e_chk.rb +1 -0
- data/lib/zint/upnqr.rb +1 -0
- data/lib/zint/{bind.rb → upu_s10.rb} +3 -2
- data/lib/zint/uspsimail.rb +1 -0
- data/lib/zint/version.rb +1 -1
- data/lib/zint/vin.rb +1 -0
- data/lib/zint/zint_recipe.rb +27 -0
- data/lib/zint.rb +15 -83
- data/ports/archives/zint-2.12.0-src.tar.gz +0 -0
- metadata +34 -12
- data/Gemfile.lock +0 -79
- data/lib/zint/stdout.rb +0 -7
- data/lib/zint/structs/circle.rb +0 -11
- data/lib/zint/structs/hexagon.rb +0 -11
- data/lib/zint/structs/rect.rb +0 -12
data/lib/zint/pdf417trunc.rb
CHANGED
data/lib/zint/pharma.rb
CHANGED
data/lib/zint/pharmatwo.rb
CHANGED
data/lib/zint/planet.rb
CHANGED
data/lib/zint/plessey.rb
CHANGED
data/lib/zint/postnet.rb
CHANGED
data/lib/zint/pzn.rb
CHANGED
data/lib/zint/qr.rb
CHANGED
data/lib/zint/rmqr.rb
CHANGED
data/lib/zint/rss14.rb
CHANGED
data/lib/zint/rss14stack.rb
CHANGED
data/lib/zint/rss14stackomni.rb
CHANGED
data/lib/zint/rssexp.rb
CHANGED
data/lib/zint/rssexpstack.rb
CHANGED
data/lib/zint/rssltd.rb
CHANGED
@@ -0,0 +1,25 @@
|
|
1
|
+
module Zint
|
2
|
+
module Structs
|
3
|
+
# Structured Append info - ignored unless `zint_structapp.count` is set to non-zero value
|
4
|
+
class Structapp < FFI::Struct
|
5
|
+
layout :index, :int, # Position in Structured Append sequence, 1-based. Must be <= `count`
|
6
|
+
:count, :int, # Number of symbols in Structured Append sequence. Set >= 2 to add SA Info
|
7
|
+
:id, [:char, 32] # Optional ID to distinguish sequence, ASCII, NUL-terminated unless max 32 long
|
8
|
+
|
9
|
+
# Position in Structured Append sequence, 1-based. Must be <= `count`
|
10
|
+
def index
|
11
|
+
self[:index]
|
12
|
+
end
|
13
|
+
|
14
|
+
# Number of symbols in Structured Append sequence. Set >= 2 to add SA Info
|
15
|
+
def count
|
16
|
+
self[:count]
|
17
|
+
end
|
18
|
+
|
19
|
+
# Optional ID to distinguish sequence, ASCII, NUL-terminated unless max 32 long
|
20
|
+
def id
|
21
|
+
self[:id]
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
data/lib/zint/structs/symbol.rb
CHANGED
@@ -1,41 +1,49 @@
|
|
1
1
|
module Zint
|
2
2
|
module Structs
|
3
|
-
class Symbol < FFI::
|
4
|
-
layout :symbology, :int,
|
5
|
-
:height, :float,
|
6
|
-
:
|
7
|
-
:
|
8
|
-
:
|
9
|
-
:
|
10
|
-
:
|
11
|
-
:
|
12
|
-
:
|
13
|
-
:
|
14
|
-
:
|
15
|
-
:
|
16
|
-
:
|
17
|
-
:
|
18
|
-
:
|
19
|
-
:
|
20
|
-
:
|
21
|
-
:
|
22
|
-
:
|
23
|
-
:
|
24
|
-
:
|
25
|
-
:
|
26
|
-
:
|
27
|
-
:
|
28
|
-
:
|
29
|
-
:
|
30
|
-
:
|
31
|
-
:
|
32
|
-
:
|
33
|
-
:
|
34
|
-
:
|
35
|
-
:
|
36
|
-
:
|
37
|
-
:
|
38
|
-
:
|
3
|
+
class Symbol < FFI::ManagedStruct
|
4
|
+
layout :symbology, :int, # Symbol to use (see BARCODE_XXX below)
|
5
|
+
:height, :float, # Barcode height in X-dimensions (ignored for fixed-width barcodes)
|
6
|
+
:scale, :float, # Scale factor when printing barcode, i.e. adjusts X-dimension. Default 1
|
7
|
+
:whitespace_width, :int, # Width in X-dimensions of whitespace to left & right of barcode
|
8
|
+
:whitespace_height, :int, # Height in X-dimensions of whitespace above & below the barcode
|
9
|
+
:border_width, :int, # Size of border in X-dimensions
|
10
|
+
:output_options, :int, # Various output parameters (bind, box etc, see below)
|
11
|
+
:fgcolour, [:char, 10], # Foreground as RGB/RGBA hexadecimal string, 6 or 8 characters, NUL-terminated
|
12
|
+
:bgcolour, [:char, 10], # Background as RGB/RGBA hexadecimal string, 6 or 8 characters, NUL-terminated
|
13
|
+
:fgcolor, :pointer, # Pointer to fgcolour (alternate spelling)
|
14
|
+
:bgcolor, :pointer, # Pointer to bgcolour (alternate spelling)
|
15
|
+
:outfile, [:char, 256], # Name of file to output to, NUL-terminated. Default "out.png" ("out.gif" if NO_PNG)
|
16
|
+
:primary, [:char, 128], # Primary message data (MaxiCode, Composite), NUL-terminated
|
17
|
+
:option_1, :int, # Symbol-specific options (see "../docs/manual.txt")
|
18
|
+
:option_2, :int, # Symbol-specific options
|
19
|
+
:option_3, :int, # Symbol-specific options
|
20
|
+
:show_hrt, :int, # Show (1) or hide (0) Human Readable Text (HRT). Default 1
|
21
|
+
:fontsize, :int, # Unused
|
22
|
+
:input_mode, :int, # Encoding of input data (see DATA_MODE etc below). Default DATA_MODE
|
23
|
+
:eci, :int, # Extended Channel Interpretation. Default 0 (none)
|
24
|
+
:dpmm, :float, # Resolution of output in dots per mm (BMP/EMF/PCX/PNG/TIF only). Default 0 (none)
|
25
|
+
:dot_size, :float, # Size of dots used in BARCODE_DOTTY_MODE. Default 0.8
|
26
|
+
:guard_descent, :float, # Height in X-dimensions that EAN/UPC guard bars descend. Default 5
|
27
|
+
:structapp, Structapp, # Structured Append info. Default structapp.count 0 (none)
|
28
|
+
:warn_level, :int, # Affects error/warning value returned by Zint API (see WARN_XXX below)
|
29
|
+
:debug, :int, # Debugging flags
|
30
|
+
:text, [:uchar, 128], # Human Readable Text (if any), UTF-8, NUL-terminated (output only)
|
31
|
+
:rows, :int, # Number of rows used by the symbol (output only)
|
32
|
+
:width, :int, # Width of the generated symbol (output only)
|
33
|
+
:encoded_data, [:uchar, 200 * 144], # Encoded data (output only). Allows for rows of 1152 modules
|
34
|
+
:row_height, [:float, 200], # Heights of rows (output only). Allows for 200 row DotCode
|
35
|
+
:errtxt, [:char, 100], # Error message if an error or warning occurs, NUL-terminated (output only)
|
36
|
+
:bitmap, :pointer, # Stored bitmap image (raster output only)
|
37
|
+
:bitmap_width, :int, # Width of bitmap image (raster output only)
|
38
|
+
:bitmap_height, :int, # Height of bitmap image (raster output only)
|
39
|
+
:alphamap, :pointer, # Array of alpha values used (raster output only)
|
40
|
+
:bitmap_byte_length, :uchar, # Size of BMP bitmap data (raster output only)
|
41
|
+
:vector, Vector.by_ref # Pointer to vector header (vector output only)
|
42
|
+
|
43
|
+
# @private
|
44
|
+
def self.release(ptr)
|
45
|
+
Native.ZBarcode_Delete(ptr)
|
46
|
+
end
|
39
47
|
end
|
40
48
|
end
|
41
49
|
end
|
data/lib/zint/structs/vector.rb
CHANGED
@@ -1,12 +1,54 @@
|
|
1
1
|
module Zint
|
2
2
|
module Structs
|
3
3
|
class Vector < FFI::Struct
|
4
|
-
layout :width, :float,
|
4
|
+
layout :width, :float, # Width, height of barcode image (including text, whitespace)
|
5
5
|
:height, :float,
|
6
|
-
:rectangles,
|
7
|
-
:hexagons,
|
8
|
-
:strings,
|
9
|
-
:circles,
|
6
|
+
:rectangles, VectorRect.by_ref, # Pointer to first rectangle
|
7
|
+
:hexagons, VectorHexagon.by_ref, # Pointer to first hexagon
|
8
|
+
:strings, VectorString.by_ref, # Pointer to first string
|
9
|
+
:circles, VectorCircle.by_ref # Pointer to first circle
|
10
|
+
|
11
|
+
# Height of barcode image (including text, whitespace)
|
12
|
+
def height
|
13
|
+
self[:height]
|
14
|
+
end
|
15
|
+
|
16
|
+
# Width of barcode image (including text, whitespace)
|
17
|
+
def width
|
18
|
+
self[:width]
|
19
|
+
end
|
20
|
+
|
21
|
+
# Calls the given block and passes a VectorRect object for each rectangle to be printed.
|
22
|
+
def each_rectangle(&block)
|
23
|
+
each_vector(:rectangles, &block)
|
24
|
+
end
|
25
|
+
|
26
|
+
# Calls the given block and passes a VectorHexagon object for each hexagon to be printed.
|
27
|
+
def each_hexagon(&block)
|
28
|
+
each_vector(:hexagons, &block)
|
29
|
+
end
|
30
|
+
|
31
|
+
# Calls the given block and passes a VectorString object for each text string to be printed.
|
32
|
+
def each_string(&block)
|
33
|
+
each_vector(:strings, &block)
|
34
|
+
end
|
35
|
+
|
36
|
+
# Calls the given block and passes a VectorCircle object for each circle to be printed.
|
37
|
+
def each_circle(&block)
|
38
|
+
each_vector(:circles, &block)
|
39
|
+
end
|
40
|
+
|
41
|
+
private def each_vector(attr)
|
42
|
+
return to_enum(:each_vector, attr) unless block_given?
|
43
|
+
|
44
|
+
o = self[attr]
|
45
|
+
until o.null?
|
46
|
+
# Avoid garbage collection of Vector (and hence Barcode) before Vector*, since all memory is freed by ZBarcode_Delete()
|
47
|
+
o.instance_variable_set(:@vector, self)
|
48
|
+
yield o
|
49
|
+
o = o[:next]
|
50
|
+
end
|
51
|
+
end
|
10
52
|
end
|
11
53
|
end
|
12
54
|
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
module Zint
|
2
|
+
module Structs
|
3
|
+
class VectorCircle < FFI::Struct
|
4
|
+
layout :x, :float,
|
5
|
+
:y, :float,
|
6
|
+
:diameter, :float, # Circle diameter. Does not include width (if any)
|
7
|
+
:width, :float, # Width of circle perimeter (circumference). 0 for fill (disc)
|
8
|
+
:colour, :int, # Non-zero for draw with background colour (else draw with foreground colour)
|
9
|
+
:next, VectorCircle.by_ref # Pointer to next circle
|
10
|
+
|
11
|
+
# x position
|
12
|
+
def x
|
13
|
+
self[:x]
|
14
|
+
end
|
15
|
+
|
16
|
+
# y position
|
17
|
+
def y
|
18
|
+
self[:y]
|
19
|
+
end
|
20
|
+
|
21
|
+
# diameter
|
22
|
+
def diameter
|
23
|
+
self[:diameter]
|
24
|
+
end
|
25
|
+
|
26
|
+
# Non-zero for draw with background colour
|
27
|
+
def colour
|
28
|
+
self[:colour]
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
module Zint
|
2
|
+
module Structs
|
3
|
+
class VectorHexagon < FFI::Struct
|
4
|
+
layout :x, :float,
|
5
|
+
:y, :float,
|
6
|
+
:diameter, :float,
|
7
|
+
:rotation, :int, # 0, 90, 180, 270 degrees
|
8
|
+
:next, VectorHexagon.by_ref # Pointer to next hexagon
|
9
|
+
|
10
|
+
# x position
|
11
|
+
def x
|
12
|
+
self[:x]
|
13
|
+
end
|
14
|
+
|
15
|
+
# y position
|
16
|
+
def y
|
17
|
+
self[:y]
|
18
|
+
end
|
19
|
+
|
20
|
+
# diameter
|
21
|
+
def diameter
|
22
|
+
self[:diameter]
|
23
|
+
end
|
24
|
+
|
25
|
+
# 0, 90, 180, 270 degrees
|
26
|
+
def rotation
|
27
|
+
self[:rotation]
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
module Zint
|
2
|
+
module Structs
|
3
|
+
class VectorRect < FFI::Struct
|
4
|
+
layout :x, :float,
|
5
|
+
:y, :float,
|
6
|
+
:height, :float,
|
7
|
+
:width, :float,
|
8
|
+
:colour, :int, # -1 for foreground, 1-8 for Cyan, Blue, Magenta, Red, Yellow, Green, Black, White
|
9
|
+
:next, VectorRect.by_ref # Pointer to next rectangle
|
10
|
+
|
11
|
+
# x position
|
12
|
+
def x
|
13
|
+
self[:x]
|
14
|
+
end
|
15
|
+
|
16
|
+
# y position
|
17
|
+
def y
|
18
|
+
self[:y]
|
19
|
+
end
|
20
|
+
|
21
|
+
# height
|
22
|
+
def height
|
23
|
+
self[:height]
|
24
|
+
end
|
25
|
+
|
26
|
+
# width
|
27
|
+
def width
|
28
|
+
self[:width]
|
29
|
+
end
|
30
|
+
|
31
|
+
# -1 for foreground, 1-8 for Cyan, Blue, Magenta, Red, Yellow, Green, Black, White
|
32
|
+
def colour
|
33
|
+
self[:colour]
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -1,15 +1,50 @@
|
|
1
1
|
module Zint
|
2
2
|
module Structs
|
3
3
|
class VectorString < FFI::Struct
|
4
|
-
layout :x, :float,
|
4
|
+
layout :x, :float, # x, y position relative to halign
|
5
5
|
:y, :float,
|
6
|
-
:fsize, :float,
|
7
|
-
:width, :float,
|
8
|
-
:length, :int,
|
9
|
-
:rotation, :int,
|
10
|
-
:halign, :int,
|
11
|
-
:text, :pointer,
|
12
|
-
:next,
|
6
|
+
:fsize, :float, # font size
|
7
|
+
:width, :float, # Suggested string width, may be 0 if none recommended
|
8
|
+
:length, :int, # Number of characters
|
9
|
+
:rotation, :int, # 0, 90, 180, 270 degrees
|
10
|
+
:halign, :int, # Horizontal alignment: 0 for centre, 1 for left, 2 for right (end)
|
11
|
+
:text, :pointer, # the text string to be printed
|
12
|
+
:next, VectorString.by_ref # Pointer to next string
|
13
|
+
|
14
|
+
# x position relative to halign
|
15
|
+
def x
|
16
|
+
self[:x]
|
17
|
+
end
|
18
|
+
|
19
|
+
# y position
|
20
|
+
def y
|
21
|
+
self[:y]
|
22
|
+
end
|
23
|
+
|
24
|
+
# font size
|
25
|
+
def fsize
|
26
|
+
self[:fsize]
|
27
|
+
end
|
28
|
+
|
29
|
+
# Suggested string width, may be 0 if none recommended
|
30
|
+
def width
|
31
|
+
self[:width]
|
32
|
+
end
|
33
|
+
|
34
|
+
# 0, 90, 180, 270 degrees
|
35
|
+
def rotation
|
36
|
+
self[:rotation]
|
37
|
+
end
|
38
|
+
|
39
|
+
# Horizontal alignment: 0 for centre, 1 for left, 2 for right (end)
|
40
|
+
def halign
|
41
|
+
self[:halign]
|
42
|
+
end
|
43
|
+
|
44
|
+
# the text string to be printed
|
45
|
+
def text
|
46
|
+
self[:text].read_bytes(self[:length])
|
47
|
+
end
|
13
48
|
end
|
14
49
|
end
|
15
50
|
end
|
data/lib/zint/telepen.rb
CHANGED
data/lib/zint/telepennum.rb
CHANGED
data/lib/zint/ultra.rb
CHANGED
data/lib/zint/upc_a.rb
CHANGED
data/lib/zint/upc_a_chk.rb
CHANGED
data/lib/zint/upc_e.rb
CHANGED
data/lib/zint/upc_e_chk.rb
CHANGED
data/lib/zint/upnqr.rb
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
module Zint
|
2
|
-
|
2
|
+
# Universal Postal Union S10
|
3
|
+
class UpuS10 < Barcode
|
3
4
|
def initialize(value: nil, input_file: nil, options: {})
|
4
|
-
super(value: value, input_file: input_file, type: Zint::
|
5
|
+
super(value: value, input_file: input_file, type: Zint::BARCODE_UPU_S10, options: options)
|
5
6
|
end
|
6
7
|
end
|
7
8
|
end
|
data/lib/zint/uspsimail.rb
CHANGED
data/lib/zint/version.rb
CHANGED
data/lib/zint/vin.rb
CHANGED
@@ -0,0 +1,27 @@
|
|
1
|
+
require_relative "dependencies"
|
2
|
+
require "rubygems"
|
3
|
+
# Keep the version constraint in sync with libusb.gemspec
|
4
|
+
gem "mini_portile2", Zint::MINI_PORTILE_VERSION
|
5
|
+
require "mini_portile2"
|
6
|
+
|
7
|
+
module Zint
|
8
|
+
class ZintRecipe < MiniPortileCMake
|
9
|
+
ROOT = File.expand_path("../../..", __FILE__)
|
10
|
+
|
11
|
+
def initialize
|
12
|
+
super("libzint", ZINT_VERSION)
|
13
|
+
self.target = File.join(ROOT, "ports")
|
14
|
+
self.files = [url: ZINT_SOURCE_URI, sha1: ZINT_SOURCE_SHA1]
|
15
|
+
end
|
16
|
+
|
17
|
+
def cook_and_activate
|
18
|
+
checkpoint = File.join(target, "#{name}-#{version}-#{host}.installed")
|
19
|
+
unless File.exist?(checkpoint)
|
20
|
+
cook
|
21
|
+
FileUtils.touch checkpoint
|
22
|
+
end
|
23
|
+
activate
|
24
|
+
self
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|