image_compressor_pack 0.1.1.rc2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. checksums.yaml +7 -0
  2. checksums.yaml.gz.sig +0 -0
  3. data/.gitignore +15 -0
  4. data/.travis.yml +16 -0
  5. data/Gemfile +4 -0
  6. data/LICENSE.txt +21 -0
  7. data/Makefile +32 -0
  8. data/README.md +45 -0
  9. data/Rakefile +56 -0
  10. data/bin/console +14 -0
  11. data/bin/setup +7 -0
  12. data/certs/ignisf.pem +32 -0
  13. data/ext/image_compressor_pack/extconf.rb +30 -0
  14. data/image_compressor_pack.gemspec +28 -0
  15. data/lib/image_compressor_pack/dynamically_linked_recipes.yml +84 -0
  16. data/lib/image_compressor_pack/recipes.rb +42 -0
  17. data/lib/image_compressor_pack/statically_linked_recipes.yml +93 -0
  18. data/lib/image_compressor_pack/version.rb +3 -0
  19. data/lib/image_compressor_pack.rb +24 -0
  20. data/ports/archives/advancecomp-1.20.tar.gz +0 -0
  21. data/ports/archives/gifsicle-1.88.tar.gz +0 -0
  22. data/ports/archives/jhead-3.00.tar.gz +0 -0
  23. data/ports/archives/jpegoptim-1.4.3.tar.gz +0 -0
  24. data/ports/archives/lcms2-2.7.tar.gz +0 -0
  25. data/ports/archives/libpng-1.6.21.tar.gz +0 -0
  26. data/ports/archives/mozjpeg-3.1-release-source.tar.gz +0 -0
  27. data/ports/archives/nasm-2.12.01.tar.gz +0 -0
  28. data/ports/archives/optipng-0.7.6.tar.gz +0 -0
  29. data/ports/archives/pngcrush-1.8.1.tar.gz +0 -0
  30. data/ports/archives/pngquant-2.7.1-src.tar.gz +0 -0
  31. data/ports/archives/zlib-1.2.8.tar.gz +0 -0
  32. data/ports/patches/jhead/0001-Add-a-configure-shim.patch +21 -0
  33. data/ports/patches/jhead/0002-Specify-a-default-DESTDIR.patch +30 -0
  34. data/ports/patches/jhead/0003-Make-the-configure-script-set-the-DESTDIR.patch +39 -0
  35. data/ports/patches/jhead/0004-Make-the-makefile-install-to-the-proper-location.patch +23 -0
  36. data/ports/patches/jhead/0005-Produce-a-static-binary.patch +25 -0
  37. data/ports/patches/jpegoptim/0001-Link-lm-after-ljpeg.patch +34 -0
  38. data/ports/patches/libpng/0001-Do-not-build-binary-utilities.patch +327 -0
  39. data/ports/patches/mozjpeg/0001-Build-static-binaries.patch +34 -0
  40. data/ports/patches/optipng/0001-Allow-passing-LDFLAGS-as-configure-arg.patch +35 -0
  41. data/ports/patches/pngcrush/0001-Add-an-install-task.patch +33 -0
  42. data/ports/patches/pngcrush/0002-Add-a-configure-script.patch +41 -0
  43. data/ports/patches/pngcrush/0003-Produce-a-static-binary.patch +25 -0
  44. data/ports/patches/pngquant/0001-Work-around-mini-portile-s-configure-invocation.patch +965 -0
  45. data/ports/patches/pngquant/0002-Add-default-LDFLAGS.patch +24 -0
  46. data/ports/patches/pngquant/0003-Disable-libpng-check.patch +77 -0
  47. data/ports/patches/pngquant/0004-Remove-libz-check.patch +37 -0
  48. data/ports/patches/pngquant/0005-Remove-lcms2-check.patch +47 -0
  49. data/ports/patches/pngquant/0006-Do-not-build-static-binary.patch +25 -0
  50. data.tar.gz.sig +0 -0
  51. metadata +168 -0
  52. metadata.gz.sig +0 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: a7c08fa307a8b3251172cd1f13d3a860810065e3
4
+ data.tar.gz: e559bb673be33b769076683beafda9a02f2e8846
5
+ SHA512:
6
+ metadata.gz: 22f7d5b6100fffbbae13f6a2a2d520e700937bc8c162c6baefa963d2c020f0381548e70be8454ae2a638490aeb5105de75d26d3f36779a21a416d93347e30df1
7
+ data.tar.gz: 005b042ce9439580eff40edf774f48fb3101c8f22dd8b76da9ee428a73f354bf4ac78f95ad530311ceeb5cb0be9c68874c9a07fe03fd8c2f0f8b25c886eb55c9
checksums.yaml.gz.sig ADDED
Binary file
data/.gitignore ADDED
@@ -0,0 +1,15 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ *.bundle
11
+ *.so
12
+ *.o
13
+ *.a
14
+ mkmf.log
15
+ /lib/.paths.yml
data/.travis.yml ADDED
@@ -0,0 +1,16 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.3.1
4
+ matrix:
5
+ include:
6
+ - rvm: 2.2
7
+ os: osx
8
+ osx_image: xcode7.3
9
+ - rvm: jruby-9.0.5.0
10
+ jdk: oraclejdk8
11
+ - rvm: 2.3.1
12
+ dist: trusty
13
+ sudo: true
14
+ script:
15
+ - MAKEFLAGS=-j8 bundle exec rake compile
16
+ cache: bundler
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in image_compressor_pack.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015 Petko Bordjukov
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/Makefile ADDED
@@ -0,0 +1,32 @@
1
+ NULLCMD = :
2
+
3
+ all: Makefile
4
+ static::
5
+ .PHONY: all install static install-so install-rb
6
+ .PHONY: clean clean-so clean-static clean-rb
7
+
8
+ clean-static::
9
+ clean-rb-default::
10
+ clean-rb::
11
+ clean-so::
12
+ clean::
13
+ distclean-rb-default::
14
+ distclean-rb::
15
+ distclean-so::
16
+ distclean-static::
17
+ distclean::
18
+
19
+ realclean: distclean
20
+ install: install-so install-rb
21
+
22
+ install-so: Makefile
23
+ install-rb: pre-install-rb install-rb-default
24
+ install-rb-default: pre-install-rb-default
25
+ pre-install-rb: Makefile
26
+ pre-install-rb-default: Makefile
27
+ pre-install-rb-default:
28
+ @$(NULLCMD)
29
+
30
+ site-install: site-install-so site-install-rb
31
+ site-install-so: install-so
32
+ site-install-rb: install-rb
data/README.md ADDED
@@ -0,0 +1,45 @@
1
+ # Image Compressor Pack
2
+
3
+ A source distribution of a bunch of lossy and lossless image optimisation
4
+ utilities for use with `image_optim`. Created because I didn't trust the
5
+ binaries in the `image_optim_pack` gem and wanted something to automate the
6
+ compilation from source.
7
+
8
+ ## Installation
9
+
10
+ Add this line to your application's Gemfile:
11
+
12
+ ```ruby
13
+ gem 'image_compressor_pack', github: 'ignisf/image_compressor_pack'
14
+ ```
15
+
16
+ And then execute:
17
+
18
+ $ bundle
19
+
20
+ ## Usage
21
+
22
+ For use in Rails with `image_optim`. Just adding it to your `Gemfile` should be
23
+ enough to add most of the utilities `image_optim` has workers for to the `PATH`.
24
+
25
+ At this point `image_optim_pack` supports `svgo` and `pngout` which are not
26
+ included in `image_compressor_pack`. `svgo` requires nodejs and `pngout`'s
27
+ source is not open.
28
+
29
+ To exclude them, use the following in your Rails environment configuration or
30
+ appropriate initialiser:
31
+
32
+ ```ruby
33
+ config.assets.image_optim = {skip_missing_workers: true,
34
+ svgo: false,
35
+ pngout: false}
36
+ ```
37
+
38
+ See https://github.com/toy/image_optim#from-rails for more info on Rails
39
+ configuration or https://github.com/toy/image_optim#configuration if you are
40
+ using `image_optim` and `image_compressor_pack` outside of Rails.
41
+
42
+ ## License
43
+
44
+ The gem is available as open source under the terms of the
45
+ [MIT License](http://opensource.org/licenses/MIT).
data/Rakefile ADDED
@@ -0,0 +1,56 @@
1
+ require 'bundler/gem_tasks'
2
+ require 'image_compressor_pack/recipes'
3
+
4
+ desc 'Compile all recipes'
5
+ task :compile do
6
+ sh 'ruby ext/image_compressor_pack/extconf.rb'
7
+ end
8
+
9
+ module Helpers
10
+ module_function
11
+
12
+ def binary_gemspec(platform = Gem::Platform.local)
13
+ gemspec = eval(File.read 'image_compressor_pack.gemspec')
14
+ gemspec.platform = platform
15
+ gemspec
16
+ end
17
+
18
+ def binary_gem_name(platform = Gem::Platform.local)
19
+ File.basename binary_gemspec(platform).cache_file
20
+ end
21
+ end
22
+
23
+ desc "Build #{Helpers.binary_gem_name} into the pkg directory"
24
+ task binary: :compile do
25
+ gemspec = Helpers.binary_gemspec
26
+ gemspec.extensions.clear
27
+
28
+ # We don't need most things for the binary
29
+ gemspec.files = `git ls-files lib`.split("\n")
30
+ gemspec.files += ['LICENSE.txt', File.join('lib', '.paths.yml')]
31
+ gemspec.files += `git ls-files -o ports`.split("\n")
32
+
33
+ FileUtils.mkdir_p 'pkg'
34
+
35
+ package = if Gem::VERSION < '2.0.0'
36
+ Gem::Builder.new(gemspec).build
37
+ else
38
+ require 'rubygems/package'
39
+ Gem::Package.build gemspec
40
+ end
41
+
42
+ FileUtils.mv package, 'pkg'
43
+ end
44
+
45
+ task :clean do
46
+ sh 'git clean -dxf -e .bundle -e vendor/bundle'
47
+ end
48
+
49
+ desc 'Download all recipe archives'
50
+ task :download do
51
+ ImageCompressorPack.recipes.each(&:download)
52
+ end
53
+
54
+ task build: [:clean, :download]
55
+
56
+ task default: [:compile]
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "image_compressor_pack"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start
data/bin/setup ADDED
@@ -0,0 +1,7 @@
1
+ #!/bin/bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+
5
+ bundle install
6
+
7
+ # Do any other automated setup that you need to do here
data/certs/ignisf.pem ADDED
@@ -0,0 +1,32 @@
1
+ -----BEGIN CERTIFICATE-----
2
+ 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
31
+ bfdfE27aG1U=
32
+ -----END CERTIFICATE-----
@@ -0,0 +1,30 @@
1
+ require 'fileutils'
2
+ require_relative '../../lib/image_compressor_pack/recipes'
3
+
4
+ root = File.expand_path("../../../", __FILE__)
5
+
6
+ recipes = ImageCompressorPack.recipes
7
+
8
+ recipes.each do |recipe|
9
+ checkpoint = "#{recipe.target}/#{recipe.name}-#{recipe.version}-#{recipe.host}.installed"
10
+ unless File.exist?(checkpoint)
11
+ `rm -rf tmp/#{recipe.host}/ports/#{recipe.name}/#{recipe.version}`
12
+ recipe.cook
13
+ FileUtils.touch checkpoint
14
+ end
15
+ recipe.activate
16
+ end
17
+
18
+ absolute_paths = Dir.glob(File.join(root, 'ports', recipes.first.host, '**', 'bin'))
19
+ relative_paths = absolute_paths.map { |path| path.gsub(/#{root}\//, '') }
20
+
21
+ File.open(File.join(root, 'lib', '.paths.yml'), 'w') do |f|
22
+ f.puts relative_paths.to_yaml
23
+ end
24
+
25
+ source_makefile = File.join(root, 'Makefile')
26
+ destination_makefile = 'Makefile'
27
+
28
+ unless File.exist?(destination_makefile) and File.identical?(source_makefile, destination_makefile)
29
+ FileUtils.cp(File.join(root, 'Makefile'), 'Makefile')
30
+ end
@@ -0,0 +1,28 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'image_compressor_pack/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "image_compressor_pack"
8
+ spec.version = ImageCompressorPack::VERSION
9
+ spec.authors = ["Petko Bordjukov"]
10
+ spec.email = ["bordjukov@gmail.com"]
11
+ spec.cert_chain = ['certs/ignisf.pem']
12
+ spec.signing_key = File.expand_path("~/.ssh/gem-private_key.pem") if $0 =~ /gem\z/
13
+
14
+ spec.summary = %q{A distribution of image optimization utilities.}
15
+ spec.description = %q{This gem packs a bunch of useful utilities for image optimization for use with image_optim.}
16
+ spec.homepage = "https://github.com/ignisf/image_compressor_pack"
17
+ spec.license = "MIT"
18
+
19
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
20
+ spec.files += `git ls-files -o -z ports/archives`.split("\x0")
21
+ spec.require_paths = ["lib"]
22
+ spec.extensions = ["ext/image_compressor_pack/extconf.rb"]
23
+
24
+ spec.add_runtime_dependency "mini_portile2", "~> 2.0"
25
+
26
+ spec.add_development_dependency "bundler", "~> 1.10"
27
+ spec.add_development_dependency "rake", "~> 10.0"
28
+ end
@@ -0,0 +1,84 @@
1
+ nasm:
2
+ version: 2.12.01
3
+ files:
4
+ - :url: http://www.nasm.us/pub/nasm/releasebuilds/2.12.01/nasm-2.12.01.tar.gz
5
+ :sha256: 4cab94c041ae85740b47d92d0a25dd2325f05b2378dcf6fac4d09c49c62ee481
6
+ zlib:
7
+ version: 1.2.8
8
+ files:
9
+ - :url: http://download.sourceforge.net/libpng/zlib-1.2.8.tar.gz
10
+ :md5: 44d667c142d7cda120332623eab69f40
11
+ configure_options: ['--static']
12
+ lcms2:
13
+ version: 2.7
14
+ files:
15
+ - :url: http://download.sourceforge.net/lcms/lcms2-2.7.tar.gz
16
+ :sha256: 4524234ae7de185e6b6da5d31d6875085b2198bc63b1211f7dde6e2d197d6a53
17
+ libpng:
18
+ version: 1.6.21
19
+ files:
20
+ - :url: http://download.sourceforge.net/libpng/libpng-1.6.21.tar.gz
21
+ :md5: aca36ec8e0a3b406a5912243bc243717
22
+ patch_files:
23
+ - 0001-Do-not-build-binary-utilities.patch
24
+ configure_options: ['--enable-static', '--disable-shared', '--without-binconfigs', '--disable-unversioned-libpng-pc', '--disable-unversioned-libpng-config']
25
+ mozjpeg:
26
+ version: 3.1
27
+ files:
28
+ - :url: https://github.com/mozilla/mozjpeg/releases/download/v3.1/mozjpeg-3.1-release-source.tar.gz
29
+ :sha256: deedd88342c5da219f0047d9a290cd58eebe1b7a513564fcd8ebc49670077a1f
30
+ optipng:
31
+ version: 0.7.6
32
+ files:
33
+ - :url: http://downloads.sourceforge.net/project/optipng/OptiPNG/optipng-0.7.6/optipng-0.7.6.tar.gz
34
+ :sha256: 4870631fcbd3825605f00a168b8debf44ea1cda8ef98a73e5411eee97199be80
35
+ configure_options: ['-with-system-libs']
36
+ pngquant:
37
+ version: 2.7.1
38
+ files:
39
+ - :url: https://pngquant.org/pngquant-2.7.1-src.tar.gz
40
+ :sha1: a14f66a5b85bf65f432ce16bf029bee344a5d915
41
+ patch_files:
42
+ - 0001-Work-around-mini-portile-s-configure-invocation.patch
43
+ - 0002-Add-default-LDFLAGS.patch
44
+ - 0003-Disable-libpng-check.patch
45
+ - 0004-Remove-libz-check.patch
46
+ - 0005-Remove-lcms2-check.patch
47
+ - 0006-Do-not-build-static-binary.patch
48
+ configure_options: []
49
+ advancecomp:
50
+ version: 1.20
51
+ files:
52
+ - :url: https://github.com/amadvance/advancecomp/releases/download/v1.20/advancecomp-1.20.tar.gz
53
+ :sha256: 590a447cfc7ab3a37ec707e13967a0046a81a888c561ebaff5415b1e946da67b
54
+ gifsicle:
55
+ version: 1.88
56
+ files:
57
+ - :url: https://www.lcdf.org/gifsicle/gifsicle-1.88.tar.gz
58
+ :sha256: 4585d2e683d7f68eb8fcb15504732d71d7ede48ab5963e61915201f9e68305be
59
+ configure_options: ['--without-x', '--disable-gifdiff']
60
+ jhead:
61
+ version: 3.00
62
+ files:
63
+ - :url: http://sentex.net/%7Emwandel/jhead/jhead-3.00.tar.gz
64
+ :sha256: 88cc01da018e242fe2e05db73f91b6288106858dd70f27506c4989a575d2895e
65
+ patch_files:
66
+ - 0001-Add-a-configure-shim.patch
67
+ - 0002-Specify-a-default-DESTDIR.patch
68
+ - 0003-Make-the-configure-script-set-the-DESTDIR.patch
69
+ - 0004-Make-the-makefile-install-to-the-proper-location.patch
70
+ pngcrush:
71
+ version: 1.8.1
72
+ files:
73
+ - :url: http://downloads.sourceforge.net/project/pmt/pngcrush/1.8.1/pngcrush-1.8.1.tar.gz
74
+ :sha256: ab299feb0dd77d2e84a043cf773302ad6323733d9b82e8ce76468dd024c0ad63
75
+ patch_files:
76
+ - 0001-Add-an-install-task.patch
77
+ - 0002-Add-a-configure-script.patch
78
+ jpegoptim:
79
+ version: 1.4.3
80
+ files:
81
+ - :url: http://www.kokkonen.net/tjko/src/jpegoptim-1.4.3.tar.gz
82
+ :sha256: 233d4ae09273cb977e162671f4767be7ef5d96e8c1888d3ed4aa70c4dac1a34c
83
+ patch_files:
84
+ - 0001-Link-lm-after-ljpeg.patch
@@ -0,0 +1,42 @@
1
+ require 'mini_portile2'
2
+ require 'yaml'
3
+ require 'rbconfig'
4
+
5
+ module ImageCompressorPack
6
+ def self.recipes
7
+ unless RbConfig::CONFIG['target_os'] =~ /darwin/
8
+ statically_linked_recipes
9
+ else
10
+ dynamically_linked_recipes
11
+ end
12
+ end
13
+
14
+ def self.statically_linked_recipes
15
+ parse_recipes File.expand_path('../statically_linked_recipes.yml', __FILE__)
16
+ end
17
+
18
+ def self.dynamically_linked_recipes
19
+ parse_recipes File.expand_path('../dynamically_linked_recipes.yml', __FILE__)
20
+ end
21
+
22
+ def self.parse_recipes(file)
23
+ recipes = YAML.load_file(file)
24
+
25
+ recipes.map do |name, parameters|
26
+ MiniPortile.new(name, parameters['version']).tap do |recipe|
27
+ recipe.files = parameters['files']
28
+ recipe.target = if parameters['target'].nil?
29
+ File.expand_path('../../../ports', __FILE__)
30
+ else
31
+ parameters['target']
32
+ end
33
+ unless parameters['patch_files'].nil?
34
+ recipe.patch_files = parameters['patch_files'].map do |patch|
35
+ File.expand_path("../../../ports/patches/#{name}/#{patch}", __FILE__)
36
+ end
37
+ end
38
+ recipe.configure_options = parameters['configure_options'] unless parameters['configure_options'].nil?
39
+ end
40
+ end
41
+ end
42
+ end
@@ -0,0 +1,93 @@
1
+ nasm:
2
+ version: 2.12.01
3
+ files:
4
+ - :url: http://www.nasm.us/pub/nasm/releasebuilds/2.12.01/nasm-2.12.01.tar.gz
5
+ :sha256: 4cab94c041ae85740b47d92d0a25dd2325f05b2378dcf6fac4d09c49c62ee481
6
+ configure_options: ['LDFLAGS=-static']
7
+ zlib:
8
+ version: 1.2.8
9
+ files:
10
+ - :url: http://download.sourceforge.net/libpng/zlib-1.2.8.tar.gz
11
+ :md5: 44d667c142d7cda120332623eab69f40
12
+ configure_options: ['--static']
13
+ lcms2:
14
+ version: 2.7
15
+ files:
16
+ - :url: http://download.sourceforge.net/lcms/lcms2-2.7.tar.gz
17
+ :sha256: 4524234ae7de185e6b6da5d31d6875085b2198bc63b1211f7dde6e2d197d6a53
18
+ libpng:
19
+ version: 1.6.21
20
+ files:
21
+ - :url: http://download.sourceforge.net/libpng/libpng-1.6.21.tar.gz
22
+ :md5: aca36ec8e0a3b406a5912243bc243717
23
+ patch_files:
24
+ - 0001-Do-not-build-binary-utilities.patch
25
+ configure_options: ['--enable-static', '--disable-shared', '--without-binconfigs', '--disable-unversioned-libpng-pc', '--disable-unversioned-libpng-config']
26
+ mozjpeg:
27
+ version: 3.1
28
+ files:
29
+ - :url: https://github.com/mozilla/mozjpeg/releases/download/v3.1/mozjpeg-3.1-release-source.tar.gz
30
+ :sha256: deedd88342c5da219f0047d9a290cd58eebe1b7a513564fcd8ebc49670077a1f
31
+ configure_options: ['--enable-static', '--disable-shared', 'libpng_LIBS=-lpng\ -lz']
32
+ patch_files:
33
+ - 0001-Build-static-binaries.patch
34
+ optipng:
35
+ version: 0.7.6
36
+ files:
37
+ - :url: http://downloads.sourceforge.net/project/optipng/OptiPNG/optipng-0.7.6/optipng-0.7.6.tar.gz
38
+ :sha256: 4870631fcbd3825605f00a168b8debf44ea1cda8ef98a73e5411eee97199be80
39
+ configure_options: ['-with-system-libs', 'LDFLAGS=-static']
40
+ patch_files:
41
+ - 0001-Allow-passing-LDFLAGS-as-configure-arg.patch
42
+ pngquant:
43
+ version: 2.7.1
44
+ files:
45
+ - :url: https://pngquant.org/pngquant-2.7.1-src.tar.gz
46
+ :sha1: a14f66a5b85bf65f432ce16bf029bee344a5d915
47
+ patch_files:
48
+ - 0001-Work-around-mini-portile-s-configure-invocation.patch
49
+ - 0002-Add-default-LDFLAGS.patch
50
+ - 0003-Disable-libpng-check.patch
51
+ - 0004-Remove-libz-check.patch
52
+ - 0005-Remove-lcms2-check.patch
53
+ configure_options: ['--extra-ldflags=-lpng']
54
+ advancecomp:
55
+ version: 1.20
56
+ files:
57
+ - :url: https://github.com/amadvance/advancecomp/releases/download/v1.20/advancecomp-1.20.tar.gz
58
+ :sha256: 590a447cfc7ab3a37ec707e13967a0046a81a888c561ebaff5415b1e946da67b
59
+ configure_options: ['LDFLAGS=-static']
60
+ gifsicle:
61
+ version: 1.88
62
+ files:
63
+ - :url: https://www.lcdf.org/gifsicle/gifsicle-1.88.tar.gz
64
+ :sha256: 4585d2e683d7f68eb8fcb15504732d71d7ede48ab5963e61915201f9e68305be
65
+ configure_options: ['--without-x', '--disable-gifdiff', 'LDFLAGS=-static']
66
+ jhead:
67
+ version: 3.00
68
+ files:
69
+ - :url: http://sentex.net/%7Emwandel/jhead/jhead-3.00.tar.gz
70
+ :sha256: 88cc01da018e242fe2e05db73f91b6288106858dd70f27506c4989a575d2895e
71
+ patch_files:
72
+ - 0001-Add-a-configure-shim.patch
73
+ - 0002-Specify-a-default-DESTDIR.patch
74
+ - 0003-Make-the-configure-script-set-the-DESTDIR.patch
75
+ - 0004-Make-the-makefile-install-to-the-proper-location.patch
76
+ - 0005-Produce-a-static-binary.patch
77
+ pngcrush:
78
+ version: 1.8.1
79
+ files:
80
+ - :url: http://downloads.sourceforge.net/project/pmt/pngcrush/1.8.1/pngcrush-1.8.1.tar.gz
81
+ :sha256: ab299feb0dd77d2e84a043cf773302ad6323733d9b82e8ce76468dd024c0ad63
82
+ patch_files:
83
+ - 0001-Add-an-install-task.patch
84
+ - 0002-Add-a-configure-script.patch
85
+ - 0003-Produce-a-static-binary.patch
86
+ jpegoptim:
87
+ version: 1.4.3
88
+ files:
89
+ - :url: http://www.kokkonen.net/tjko/src/jpegoptim-1.4.3.tar.gz
90
+ :sha256: 233d4ae09273cb977e162671f4767be7ef5d96e8c1888d3ed4aa70c4dac1a34c
91
+ patch_files:
92
+ - 0001-Link-lm-after-ljpeg.patch
93
+ configure_options: ['LDFLAGS=-static']
@@ -0,0 +1,3 @@
1
+ module ImageCompressorPack
2
+ VERSION = "0.1.1.rc2"
3
+ end
@@ -0,0 +1,24 @@
1
+ require 'image_compressor_pack/recipes'
2
+ require 'image_compressor_pack/version'
3
+
4
+ module ImageCompressorPack
5
+ def self.paths
6
+ root = File.expand_path("../../", __FILE__)
7
+ relative_paths = YAML.load_file File.expand_path('../.paths.yml', __FILE__)
8
+ relative_paths.map { |path| File.join root, path }
9
+ end
10
+
11
+ def self.activate
12
+ paths.each do |path|
13
+ path.gsub!(File::SEPARATOR, File::ALT_SEPARATOR) if File::ALT_SEPARATOR
14
+
15
+ old_value = ENV['PATH'] || ''
16
+
17
+ unless old_value.include?(path)
18
+ ENV['PATH'] = "#{path}#{File::PATH_SEPARATOR}#{old_value}"
19
+ end
20
+ end
21
+ end
22
+ end
23
+
24
+ ImageCompressorPack.activate
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -0,0 +1,21 @@
1
+ From fbbd4f0cba3e832feef2a2664e2ff7e30d0abee8 Mon Sep 17 00:00:00 2001
2
+ From: Petko Bordjukov <bordjukov@gmail.com>
3
+ Date: Sun, 22 Nov 2015 16:37:04 +0200
4
+ Subject: [PATCH 1/5] Add a configure shim
5
+
6
+ To work around mini_portile2's configuration process
7
+ ---
8
+ configure | 1 +
9
+ 1 file changed, 1 insertion(+)
10
+ create mode 100755 configure
11
+
12
+ diff --git a/configure b/configure
13
+ new file mode 100755
14
+ index 0000000..1a24852
15
+ --- /dev/null
16
+ +++ b/configure
17
+ @@ -0,0 +1 @@
18
+ +#!/bin/sh
19
+ --
20
+ 2.8.3
21
+
@@ -0,0 +1,30 @@
1
+ From 9185d3dcab8243ffdd7bf7ee7f57c76f7fbeba4d Mon Sep 17 00:00:00 2001
2
+ From: Petko Bordjukov <bordjukov@gmail.com>
3
+ Date: Sun, 22 Nov 2015 17:41:05 +0200
4
+ Subject: [PATCH 2/5] Specify a default DESTDIR
5
+
6
+ ---
7
+ makefile | 3 ++-
8
+ 1 file changed, 2 insertions(+), 1 deletion(-)
9
+
10
+ diff --git a/makefile b/makefile
11
+ index 2197f6c..40c67d2 100644
12
+ --- a/makefile
13
+ +++ b/makefile
14
+ @@ -4,11 +4,12 @@
15
+ OBJ=.
16
+ SRC=.
17
+ CFLAGS:= $(CFLAGS) -O3 -Wall
18
+ +DESTDIR=.
19
+
20
+ all: jhead
21
+
22
+ objs = $(OBJ)/jhead.o $(OBJ)/jpgfile.o $(OBJ)/jpgqguess.o $(OBJ)/paths.o \
23
+ - $(OBJ)/exif.o $(OBJ)/iptc.o $(OBJ)/gpsinfo.o $(OBJ)/makernote.o
24
+ + $(OBJ)/exif.o $(OBJ)/iptc.o $(OBJ)/gpsinfo.o $(OBJ)/makernote.o
25
+
26
+ $(OBJ)/%.o:$(SRC)/%.c
27
+ ${CC} $(CFLAGS) -c $< -o $@
28
+ --
29
+ 2.8.3
30
+