mini_portile2 2.1.0 → 2.8.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: b90aadf075467a1583841db365f7bd1aafb26790
4
- data.tar.gz: 7689b3b467a964185225509458770aa60e1214e7
2
+ SHA256:
3
+ metadata.gz: 70898a2aae18144f603247968314787f2bb4291ce43bab39e7d9f0236d1dcd16
4
+ data.tar.gz: be938e39466de9c5d731d261c7e2afa63a88e5ca20bdfd594b6f39761b250798
5
5
  SHA512:
6
- metadata.gz: 7b0296b213f1e3b0edb2238a660489379ae084beef21ae3dc2b6f22a677d8053111ac0a130f5638c097149294c028676d06b199b8473dd1496552ab62b230e80
7
- data.tar.gz: 1a3762db4b474760297a93c9a4a17f29cc96b0999ffca256da2f9124f1fe2a597121ca8d7ef2cb5ace853a569c679a2e6df032d6039741920df3927ec2189ef8
6
+ metadata.gz: 55d44167607aca34fee6fa086246d7f71146e500d77a79f128af9399cd057404ee44d9fb8a349f89928c6f21139826e785d2da23bc4ea656c93047fa1990a20a
7
+ data.tar.gz: bd0c5d6b654deb5325d1f5329ef0e93b1a47cfde7225ab4f8730dfb419ab27604eb4713d1ae3659dcd4fdf1697e00acbad020c06347b7456041f0121ae40bb05
@@ -0,0 +1,2 @@
1
+ github: flavorjones
2
+ tidelift: rubygems/mini_portile2
@@ -0,0 +1,163 @@
1
+ name: Continuous Integration
2
+ concurrency:
3
+ group: "${{github.workflow}}-${{github.ref}}"
4
+ cancel-in-progress: true
5
+ on:
6
+ workflow_dispatch:
7
+ push:
8
+ branches:
9
+ - main
10
+ - v*.*.x
11
+ tags:
12
+ - v*.*.*
13
+ pull_request:
14
+ types: [opened, synchronize]
15
+ branches:
16
+ - "*"
17
+ schedule:
18
+ - cron: "0 8 * * 5" # At 08:00 on Friday # https://crontab.guru/#0_8_*_*_5
19
+
20
+ jobs:
21
+ test-unit:
22
+ env:
23
+ MAKEFLAGS: -j2
24
+ strategy:
25
+ fail-fast: false
26
+ matrix:
27
+ platform: [ubuntu-latest, windows-latest, macos-latest]
28
+ ruby: ["2.3", "2.4", "2.5", "2.6", "2.7", "3.0", "3.1", "3.2", "3.3", "head"]
29
+ exclude:
30
+ # I can't figure out how to install these on macos through setup-ruby
31
+ - ruby: "2.3"
32
+ platform: "macos-latest"
33
+ - ruby: "2.4"
34
+ platform: "macos-latest"
35
+ - ruby: "2.5"
36
+ platform: "macos-latest"
37
+ runs-on: ${{ matrix.platform }}
38
+ steps:
39
+ - name: configure git crlf on windows
40
+ if: matrix.platform == 'windows-latest'
41
+ run: |
42
+ git config --system core.autocrlf false
43
+ git config --system core.eol lf
44
+ - uses: actions/checkout@v4
45
+ - uses: MSP-Greg/setup-ruby-pkgs@v1
46
+ with:
47
+ apt-get: _update_ build-essential cmake
48
+ mingw: _upgrade_ cmake
49
+ ruby-version: ${{ matrix.ruby }}
50
+ bundler-cache: true
51
+ - run: bundle exec rake test:unit
52
+
53
+ test-examples:
54
+ env:
55
+ MAKEFLAGS: -j2
56
+ strategy:
57
+ fail-fast: false
58
+ matrix:
59
+ # use macos-13 (not 14) because libyaml 0.2.5 doesn't have up-to-date config.guess and config.sub
60
+ platform: [ubuntu-latest, windows-latest, macos-13]
61
+ ruby: ["3.1"]
62
+ runs-on: ${{ matrix.platform }}
63
+ steps:
64
+ - name: configure git crlf on windows
65
+ if: matrix.platform == 'windows-latest'
66
+ run: |
67
+ git config --system core.autocrlf false
68
+ git config --system core.eol lf
69
+ - uses: actions/checkout@v4
70
+ - uses: MSP-Greg/setup-ruby-pkgs@v1
71
+ with:
72
+ apt-get: _update_ build-essential cmake
73
+ mingw: _upgrade_ cmake
74
+ ruby-version: ${{ matrix.ruby }}
75
+ bundler-cache: true
76
+ - uses: actions/cache@v4
77
+ with:
78
+ path: examples/ports/archives
79
+ key: examples-${{ hashFiles('examples/Rakefile') }}
80
+ - run: bundle exec rake test:examples
81
+
82
+ fedora: # see https://github.com/flavorjones/mini_portile/issues/118
83
+ strategy:
84
+ fail-fast: false
85
+ matrix:
86
+ task: ["test:unit", "test:examples"]
87
+ runs-on: ubuntu-latest
88
+ container:
89
+ image: fedora:35
90
+ steps:
91
+ - run: |
92
+ dnf group install -y "C Development Tools and Libraries"
93
+ dnf install -y ruby ruby-devel libyaml-devel git-all patch cmake xz
94
+ - uses: actions/checkout@v4
95
+ - uses: actions/cache@v4
96
+ with:
97
+ path: examples/ports/archives
98
+ key: examples-${{ hashFiles('examples/Rakefile') }}
99
+ - run: bundle install
100
+ - run: bundle exec rake ${{ matrix.task }}
101
+
102
+ freebsd:
103
+ strategy:
104
+ fail-fast: false
105
+ matrix:
106
+ task: ["test:unit", "test:examples"]
107
+ runs-on: ubuntu-latest
108
+ env:
109
+ MAKE: gmake
110
+ steps:
111
+ - uses: actions/checkout@v4
112
+ - uses: actions/cache@v4
113
+ with:
114
+ path: examples/ports/archives
115
+ key: examples-${{ hashFiles('examples/Rakefile') }}
116
+ - uses: vmactions/freebsd-vm@v1
117
+ with:
118
+ envs: MAKE
119
+ usesh: true
120
+ copyback: false
121
+ prepare: pkg install -y ruby devel/ruby-gems pkgconf git cmake devel/gmake textproc/libyaml security/gnupg
122
+ run: |
123
+ git config --global --add safe.directory /home/runner/work/mini_portile/mini_portile
124
+ gem install bundler
125
+ bundle install
126
+ bundle exec rake ${{ matrix.task }}
127
+
128
+ openbsd:
129
+ strategy:
130
+ fail-fast: false
131
+ matrix:
132
+ task: ["test:unit", "test:examples"]
133
+ runs-on: ubuntu-latest
134
+ env:
135
+ MAKE: gmake
136
+ steps:
137
+ - uses: actions/checkout@v4
138
+ - uses: vmactions/openbsd-vm@v1
139
+ with:
140
+ envs: MAKE
141
+ usesh: true
142
+ copyback: false
143
+ prepare: |
144
+ pkg_add ruby%3.1 gmake cmake git pkgconf security/gnupg
145
+ ln -sf /usr/local/bin/ruby31 /usr/local/bin/ruby
146
+ ln -sf /usr/local/bin/bundle31 /usr/local/bin/bundle
147
+ ln -sf /usr/local/bin/bundler31 /usr/local/bin/bundler
148
+ ln -sf /usr/local/bin/erb31 /usr/local/bin/erb
149
+ ln -sf /usr/local/bin/gem31 /usr/local/bin/gem
150
+ ln -sf /usr/local/bin/irb31 /usr/local/bin/irb
151
+ ln -sf /usr/local/bin/racc31 /usr/local/bin/racc
152
+ ln -sf /usr/local/bin/rake31 /usr/local/bin/rake
153
+ ln -sf /usr/local/bin/rbs31 /usr/local/bin/rbs
154
+ ln -sf /usr/local/bin/rdbg31 /usr/local/bin/rdbg
155
+ ln -sf /usr/local/bin/rdoc31 /usr/local/bin/rdoc
156
+ ln -sf /usr/local/bin/ri31 /usr/local/bin/ri
157
+ ln -sf /usr/local/bin/syntax_suggest31 /usr/local/bin/syntax_suggest
158
+ ln -sf /usr/local/bin/typeprof31 /usr/local/bin/typeprof
159
+ run: |
160
+ git config --global --add safe.directory /home/runner/work/mini_portile/mini_portile
161
+ gem install bundler
162
+ bundle install
163
+ bundle exec rake ${{ matrix.task }}
@@ -0,0 +1,66 @@
1
+ name: downstream
2
+ concurrency:
3
+ group: "${{github.workflow}}-${{github.ref}}"
4
+ cancel-in-progress: true
5
+ on:
6
+ workflow_dispatch:
7
+ schedule:
8
+ - cron: "0 7 * * 1,3,5" # At 07:00 on Monday, Wednesday, and Friday # https://crontab.guru/#0_7_*_*_1,3,5
9
+ push:
10
+ branches:
11
+ - main
12
+ - "v*.*.x"
13
+ tags:
14
+ - v*.*.*
15
+ pull_request:
16
+ types: [opened, synchronize]
17
+ branches:
18
+ - '*'
19
+
20
+ jobs:
21
+ downstream:
22
+ name: downstream-${{matrix.name}}-${{matrix.platform}}
23
+ strategy:
24
+ fail-fast: false
25
+ matrix:
26
+ name: [re2, nokogiri, sqlite3]
27
+ platform: [ubuntu-latest, windows-latest, macos-latest]
28
+ include:
29
+ - name: re2
30
+ url: https://github.com/mudge/re2
31
+ command: "bundle exec rake compile spec"
32
+ ruby: "3.3"
33
+ - name: nokogiri
34
+ url: https://github.com/sparklemotion/nokogiri
35
+ command: "bundle exec rake compile test"
36
+ ruby: "3.3"
37
+ - name: sqlite3
38
+ url: https://github.com/sparklemotion/sqlite3-ruby
39
+ command: "bundle exec rake compile test"
40
+ ruby: "3.3"
41
+ runs-on: ${{matrix.platform}}
42
+ steps:
43
+ - name: configure git crlf
44
+ if: ${{ startsWith(matrix.platform, 'windows') }}
45
+ run: |
46
+ git config --system core.autocrlf false
47
+ git config --system core.eol lf
48
+ - uses: actions/checkout@v4
49
+ - uses: ruby/setup-ruby@v1
50
+ with:
51
+ ruby-version: ${{matrix.ruby}}
52
+ bundler-cache: true
53
+ bundler: latest
54
+ - run: git clone --depth=1 ${{matrix.url}} ${{matrix.name}}
55
+ - uses: actions/cache@v4
56
+ with:
57
+ path: ${{matrix.name}}/ports/archives
58
+ key: tarballs-${{matrix.name}}
59
+ enableCrossOsArchive: true
60
+ - name: ${{matrix.name}} test suite
61
+ working-directory: ${{matrix.name}}
62
+ run: |
63
+ bundle remove mini_portile2 || true
64
+ bundle add mini_portile2 --path=".."
65
+ bundle install --local || bundle install
66
+ ${{matrix.command}}
data/.gitignore CHANGED
@@ -1,5 +1,6 @@
1
- pkg
2
- tmp
3
- Gemfile.lock
4
1
  .bundle
2
+ Gemfile.lock
3
+ pkg
5
4
  ports
5
+ tmp
6
+ mkmf.log
data/CHANGELOG.md CHANGED
@@ -1,3 +1,169 @@
1
+ ## mini_portile changelog
2
+
3
+ ### 2.8.7 / 2024-05-31
4
+
5
+ #### Added
6
+
7
+ - When setting the C compiler through the `MiniPortile` constructor, the preferred keyword argument is now `:cc_command`. The original `:gcc_command` is still supported. (#144 by @flavorjones)
8
+ - Add support for extracting xz-compressed tarballs on OpenBSD. (#141 by @postmodern)
9
+ - Add OpenBSD support to the experimental method `MakeMakefile#mkmf_config`. (#141 by @flavorjones)
10
+
11
+
12
+ #### Changed
13
+
14
+ - `MiniPortileCMake` now detects the C and C++ compiler the same way `MiniPortile` does: by examining environment variables, then using kwargs, then looking in RbConfig (in that order). (#144 by @flavorjones)
15
+ - GPG file verification error messages are captured in the raised exception. Previously these errors went to `stderr`. (#145 by @flavorjones)
16
+
17
+
18
+ ### 2.8.6 / 2024-04-14
19
+
20
+ #### Added
21
+
22
+ - When using CMake on FreeBSD, default to clang's "cc" and "c++" compilers. (#139 by @mudge)
23
+
24
+
25
+ ### 2.8.5 / 2023-10-22
26
+
27
+ #### Added
28
+
29
+ - New methods `#lib_path` and `#include_path` which point at the installed directories under `ports`. (by @flavorjones)
30
+ - Add config param for CMAKE_BUILD_TYPE, which now defaults to `Release`. (#136 by @Watson1978)
31
+
32
+ #### Experimental
33
+
34
+ Introduce experimental support for `MiniPortile#mkmf_config` which sets up MakeMakefile variables to properly link against the recipe. This should make it easier for C extensions to package third-party libraries. (by @flavorjones)
35
+
36
+ - With no arguments, will set up just `$INCFLAGS`, `$libs`, and `$LIBPATH`.
37
+ - Optionally, if provided a pkg-config file, will use that config to more precisely set `$INCFLAGS`, `$libs`, `$LIBPATH`, and `$CFLAGS`/`$CXXFLAGS`.
38
+ - Optionally, if provided the name of a static archive, will rewrite linker flags to ensure correct linkage.
39
+
40
+ Note that the behavior may change slightly before official support is announced. Please comment on [#118](https://github.com/flavorjones/mini_portile/issues/118) if you have feedback.
41
+
42
+
43
+ ### 2.8.4 / 2023-07-18
44
+
45
+ - cmake: set CMAKE compile flags to configure cross-compilation similarly to `autotools` `--host` flag: `SYSTEM_NAME`, `SYSTEM_PROCESSOR`, `C_COMPILER`, and `CXX_COMPILER`. [#130] (Thanks, @stanhu!)
46
+
47
+
48
+ ### 2.8.3 / 2023-07-18
49
+
50
+ #### Fixed
51
+
52
+ - cmake: only use MSYS/NMake generators when available. [#129] (Thanks, @stanhu!)
53
+
54
+
55
+ ### 2.8.2 / 2023-04-30
56
+
57
+ #### Fixed
58
+
59
+ - Ensure that the `source_directory` option will work when given a Windows path to an autoconf directory. [#126]
60
+
61
+
62
+ ### 2.8.1 / 2022-12-24
63
+
64
+ #### Fixed
65
+
66
+ - Support applying patches via `git apply` even when the working directory resembles a git directory. [#119] (Thanks, @h0tw1r3!)
67
+
68
+
69
+ ### 2.8.0 / 2022-02-20
70
+
71
+ #### Added
72
+
73
+ - Support xz-compressed archives (recognized by an `.xz` file extension).
74
+ - When downloading a source archive, default open_timeout and read_timeout to 10 seconds, but allow configuration via open_timeout and read_timeout config parameters.
75
+
76
+
77
+ ### 2.7.1 / 2021-10-20
78
+
79
+ #### Packaging
80
+
81
+ A test artifact that has been included in the gem was being flagged by some users' security scanners because it wasn't a real tarball. That artifact has been updated to be a real tarball. [#108]
82
+
83
+
84
+ ### 2.7.0 / 2021-08-31
85
+
86
+ #### Added
87
+
88
+ The commands used for "make", "compile", and "cmake" are configurable via keyword arguments. [#107] (Thanks, @cosmo0920!)
89
+
90
+
91
+ ### 2.6.1 / 2021-05-31
92
+
93
+ #### Dependencies
94
+
95
+ Make `net-ftp` an optional dependency, since requiring it as a hard dependency in v2.5.2 caused warnings to be emitted by Ruby 2.7 and earlier. A warning message is emitted if FTP functionality is called and `net-ftp` isn't available; this should only happen in Ruby 3.1 and later.
96
+
97
+
98
+ ### 2.5.3 / 2021-05-31
99
+
100
+ #### Dependencies
101
+
102
+ Make `net-ftp` an optional dependency, since requiring it as a hard dependency in v2.5.2 caused warnings to be emitted by Ruby 2.7 and earlier. A warning message is emitted if FTP functionality is called and `net-ftp` isn't available; this should only happen in Ruby 3.1 and later.
103
+
104
+
105
+ ### 2.6.0 / 2021-05-31
106
+
107
+ ### Added
108
+
109
+ Recipes may build against a local directory by specifying `source_directory` instead of `files`. In
110
+ particular, this may be useful for debugging problems with the upstream dependency (e.g., use `git
111
+ bisect` in a local clone) or for continuous integration with upstream HEAD.
112
+
113
+
114
+ ### 2.5.2 / 2021-05-28
115
+
116
+ #### Dependencies
117
+
118
+ Add `net-ftp` as an explicit dependency to accommodate the upcoming Ruby 3.1 changes that move this and other gems out of the "default" gem set and into the "bundled" gem set. See https://bugs.ruby-lang.org/issues/17873 [#101]
119
+
120
+
121
+ ### 2.5.1 / 2021-04-28
122
+
123
+ #### Dependencies
124
+
125
+ This release ends support for ruby < 2.3.0. If you're on 2.2.x or earlier, we strongly suggest that you find the time to upgrade, because [official support for Ruby 2.2 ended on 2018-03-31](https://www.ruby-lang.org/en/news/2018/06/20/support-of-ruby-2-2-has-ended/).
126
+
127
+ #### Enhancements
128
+
129
+ * `MiniPortile.execute` now takes an optional `:env` hash, which is merged into the environment variables for the subprocess. Likely this is only useful for specialized use cases. [#99]
130
+ * Experimental support for cmake-based projects extended to Windows. (Thanks, @larskanis!)
131
+
132
+
133
+ ### 2.5.0 / 2020-02-24
134
+
135
+ #### Enhancements
136
+
137
+ * When verifying GPG signatures, remove all imported pubkeys from keyring [#90] (Thanks, @hanazuki!)
138
+
139
+
140
+ ### 2.4.0 / 2018-12-02
141
+
142
+ #### Enhancements
143
+
144
+ * Skip progress report when Content-Length is unavailable. [#85] (Thanks, @eagletmt!)
145
+
146
+
147
+ ### 2.3.0 / 2017-09-13
148
+
149
+ #### Enhancements
150
+
151
+ * Verify checksums of files at extraction time (in addition to at download time). (#56)
152
+ * Clarify error message if a `tar` command can't be found. (#81)
153
+
154
+
155
+ ### 2.2.0 / 2017-06-04
156
+
157
+ #### Enhancements
158
+
159
+ * Remove MD5 hashing of configure options, not avialbale in FIPS mode. (#78)
160
+ * Add experimental support for cmake-based projects.
161
+ * Retry on HTTP failures during downloads. [#63] (Thanks, @jtarchie and @jvshahid!)
162
+ * Support Ruby 2.4 frozen string literals.
163
+ * Support applying patches for users with misconfigured git worktree. [#69]
164
+ * Support gpg signature verification of download resources.
165
+
166
+
1
167
  ### 2.1.0 / 2016-01-06
2
168
 
3
169
  #### Enhancements
data/Gemfile CHANGED
@@ -1,4 +1,6 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
+ gem "net-ftp" if Gem::Requirement.new("> 3.1.0.dev").satisfied_by?(Gem::Version.new(RUBY_VERSION))
4
+
3
5
  # Specify your gem's dependencies in mini_portile2.gemspec
4
6
  gemspec
data/README.md CHANGED
@@ -5,8 +5,8 @@ renamed to `mini_portile2`. For mini_portile versions 0.6.x and
5
5
  previous, please visit
6
6
  [the v0.6.x branch](https://github.com/flavorjones/mini_portile/tree/v0.6.x).
7
7
 
8
- [![travis status](https://travis-ci.org/flavorjones/mini_portile.svg?branch=master)](https://travis-ci.org/flavorjones/mini_portile?branch=master)
9
- [![appveyor status](https://ci.appveyor.com/api/projects/status/509669xx1qlhqqab/branch/master?svg=true)](https://ci.appveyor.com/project/flavorjones/mini-portile/branch/master)
8
+ [![Continuous Integration](https://github.com/flavorjones/mini_portile/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/flavorjones/mini_portile/actions/workflows/ci.yml)
9
+ [![Tidelift dependencies](https://tidelift.com/badges/package/rubygems/mini_portile2)](https://tidelift.com/subscription/pkg/rubygems-mini.portile2?utm_source=undefined&utm_medium=referral&utm_campaign=readme)
10
10
 
11
11
  * Documentation: http://www.rubydoc.info/github/flavorjones/mini_portile
12
12
  * Source Code: https://github.com/flavorjones/mini_portile
@@ -46,15 +46,17 @@ appropriate `ENV` variables.)
46
46
 
47
47
  ## Sounds easy, but where's the catch?
48
48
 
49
- At this time (and highly likely will be always) `mini_portile2` is
50
- only compatible with **GCC compilers** and **autoconf**- or
51
- **configure**-based projects.
49
+ At this time `mini_portile2` only supports **autoconf**- or
50
+ **configure**-based projects. (That is, it assumes the library you
51
+ want to build contains a `configure` script, which all the
52
+ autoconf-based libraries do.)
52
53
 
53
- That is, it assumes the library you want to build contains a
54
- `configure` script, which all the autoconf-based libraries do.
54
+ As of v2.2.0, there is experimental support for **CMake**-based
55
+ projects. We welcome your feedback on this, particularly for Windows
56
+ platforms.
55
57
 
56
58
 
57
- ### How to use
59
+ ### How to use (for autoconf projects)
58
60
 
59
61
  Now that you know the catch, and you're still reading this, here is a
60
62
  quick example:
@@ -81,6 +83,104 @@ library into a namespaced structure.
81
83
  `#activate` ensures GCC will find this library and prefer it over a
82
84
  system-wide installation.
83
85
 
86
+ Some keyword arguments can be passed to the constructor to configure the commands used:
87
+
88
+ #### `cc_command` and `cxx_command`
89
+
90
+ The C compiler command that is used is configurable, and in order of preference will use:
91
+
92
+ - the `CC` environment variable (if present)
93
+ - the `:cc_command` keyword argument passed in to the constructor
94
+ - `RbConfig::CONFIG["CC"]`
95
+ - `"gcc"`
96
+
97
+ The C++ compiler is similarly configuratble, and in order of preference will use:
98
+
99
+ - the `CXX` environment variable (if present)
100
+ - the `:cxx_command` keyword argument passed in to the constructor
101
+ - `RbConfig::CONFIG["CXX"]`
102
+ - `"g++"`
103
+
104
+ You can pass your compiler commands to the MiniPortile constructor:
105
+
106
+ ``` ruby
107
+ MiniPortile.new("libiconv", "1.13.1", cc_command: "clang", cxx_command: "clang++")
108
+ ```
109
+
110
+ (For backwards compatibility, the constructor also supports a keyword argument `:gcc_command` for the C compiler.)
111
+
112
+ #### `make_command`
113
+
114
+ The configuration/make command that is used is configurable, and in order of preference will use:
115
+
116
+ - the `MAKE` environment variable (if present)
117
+ - the `make_command` value passed in to the constructor
118
+ - the `make` environment variable (if present)
119
+ - `"make"`
120
+
121
+ You can pass it in like so:
122
+
123
+ ``` ruby
124
+ MiniPortile.new("libiconv", "1.13.1", make_command: "nmake")
125
+ ```
126
+
127
+ #### `open_timeout`, `read_timeout`
128
+
129
+ By default, when downloading source archives, MiniPortile will use a timeout value of 10
130
+ seconds. This can be overridden by passing a different value (in seconds):
131
+
132
+ ``` ruby
133
+ MiniPortile.new("libiconv", "1.13.1", open_timeout: 99, read_timeout: 2)
134
+ ```
135
+
136
+
137
+ ### How to use (for cmake projects)
138
+
139
+ Same as above, but instead of `MiniPortile.new`, call `MiniPortileCMake.new`.
140
+
141
+ #### `make_command`
142
+
143
+ This is configurable as above, except for Windows systems where it's hardcoded to `"nmake"`.
144
+
145
+ #### `cmake_command`
146
+
147
+ The cmake command used is configurable, and in order of preference will use:
148
+
149
+ - the `CMAKE` environment variable (if present)
150
+ - the `:cmake_command` keyword argument passed into the constructor
151
+ - `"cmake"` (the default)
152
+
153
+ You can pass it in like so:
154
+
155
+ ``` ruby
156
+ MiniPortileCMake.new("libfoobar", "1.3.5", cmake_command: "cmake3")
157
+ ```
158
+
159
+ #### `cmake_build_type`
160
+
161
+ The cmake build type is configurable as of v2.8.5, and in order of preference will use:
162
+
163
+ - the `CMAKE_BUILD_TYPE` environment variable (if present)
164
+ - the `:cmake_build_type` keyword argument passed into the constructor
165
+ - `"Release"` (the default)
166
+
167
+ You can pass it in like so:
168
+
169
+ ``` ruby
170
+ MiniPortileCMake.new("libfoobar", "1.3.5", cmake_build_type: "Debug")
171
+ ```
172
+
173
+ ### Local source directories
174
+
175
+ Instead of downloading a remote file, you can also point mini_portile2 at a local source
176
+ directory. In particular, this may be useful for testing or debugging:
177
+
178
+ ``` ruby
179
+ gem "mini_portile2", "~> 2.0.0" # NECESSARY if used in extconf.rb. see below.
180
+ require "mini_portile2"
181
+ recipe = MiniPortile.new("libiconv", "1.13.1")
182
+ recipe.source_directory = "/path/to/local/source/for/library-1.2.3"
183
+ ```
84
184
 
85
185
  ### Directory Structure Conventions
86
186
 
@@ -140,7 +240,7 @@ task :libiconv do
140
240
  recipe = MiniPortile.new("libiconv", "1.13.1")
141
241
  recipe.files << {
142
242
  url: "http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.13.1.tar.gz"],
143
- md5: "7ab33ebd26687c744a37264a330bbe9a"
243
+ sha256: "55a36168306089009d054ccdd9d013041bfc3ab26be7033d107821f1c4949a49"
144
244
  }
145
245
  checkpoint = ".#{recipe.name}-#{recipe.version}.installed"
146
246
 
@@ -167,6 +267,45 @@ The above example will:
167
267
  As an exercise for the reader, you could specify the libiconv version
168
268
  in an environment variable or a configuration file.
169
269
 
270
+ ### Download verification
271
+ MiniPortile supports HTTPS, HTTP, FTP and FILE sources for download.
272
+ The integrity of the downloaded file can be verified per hash value or PGP signature.
273
+ This is particular important for untrusted sources (non-HTTPS).
274
+
275
+ #### Hash digest verification
276
+ MiniPortile can verify the integrity of the downloaded file per SHA256, SHA1 or MD5 hash digest.
277
+
278
+ ```ruby
279
+ recipe.files << {
280
+ url: "http://your.host/file.tar.bz2",
281
+ sha256: "<32 byte hex value>",
282
+ }
283
+ ```
284
+
285
+ #### PGP signature verification
286
+ MiniPortile can also verify the integrity of the downloaded file per PGP signature.
287
+
288
+ ```ruby
289
+ public_key = <<-EOT
290
+ -----BEGIN PGP PUBLIC KEY BLOCK-----
291
+ Version: GnuPG v1
292
+
293
+ mQENBE7SKu8BCADQo6x4ZQfAcPlJMLmL8zBEBUS6GyKMMMDtrTh3Yaq481HB54oR
294
+ [...]
295
+ -----END PGP PUBLIC KEY BLOCK-----
296
+ EOT
297
+
298
+ recipe.files << {
299
+ url: "http://your.host/file.tar.bz2",
300
+ gpg: {
301
+ key: public_key,
302
+ signature_url: "http://your.host/file.tar.bz2.sig"
303
+ }
304
+ }
305
+ ```
306
+
307
+ Please note, that the `gpg` executable is required to verify the signature.
308
+ It is therefore recommended to use the hash verification method instead of PGP, when used in `extconf.rb` while `gem install`.
170
309
 
171
310
  ### Native and/or Cross Compilation
172
311
 
@@ -194,6 +333,22 @@ toolchain. This has been tested against Ubuntu, OSX and even Windows
194
333
  (RubyInstaller with DevKit)
195
334
 
196
335
 
336
+ ## Support
337
+
338
+ The bug tracker is available here:
339
+
340
+ * https://github.com/flavorjones/mini_portile/issues
341
+
342
+ Consider subscribing to [Tidelift][tidelift] which provides license assurances and timely security notifications for your open source dependencies, including Loofah. [Tidelift][tidelift] subscriptions also help the Loofah maintainers fund our [automated testing](https://ci.nokogiri.org) which in turn allows us to ship releases, bugfixes, and security updates more often.
343
+
344
+ [tidelift]: https://tidelift.com/subscription/pkg/rubygems-mini.portile2?utm_source=rubygems-mini.portile2&utm_medium=referral&utm_campaign=enterprise
345
+
346
+
347
+ ## Security
348
+
349
+ See [`SECURITY.md`](SECURITY.md) for vulnerability reporting details.
350
+
351
+
197
352
  ## License
198
353
 
199
354
  This library is licensed under MIT license. Please see LICENSE.txt for details.
data/Rakefile CHANGED
@@ -1,12 +1,10 @@
1
1
  require "rake/clean"
2
- require 'bundler/gem_tasks'
2
+ require "bundler/gem_tasks"
3
+ require "rake/testtask"
3
4
 
4
- namespace :test do
5
- desc "Test MiniPortile by running unit tests"
6
- task :unit do
7
- sh "ruby -w -W2 -I. -Ilib -e \"#{Dir["test/test_*.rb"].map{|f| "require '#{f}';"}.join}\" -- -v"
8
- end
5
+ Rake::TestTask.new("test:unit")
9
6
 
7
+ namespace :test do
10
8
  desc "Test MiniPortile by compiling examples"
11
9
  task :examples do
12
10
  Dir.chdir("examples") do
data/SECURITY.md ADDED
@@ -0,0 +1,13 @@
1
+ # Security and Vulnerability Reporting
2
+
3
+ The mini_portile core contributors take security very seriously and investigate all reported vulnerabilities.
4
+
5
+ If you would like to report a vulnerablity or have a security concern regarding mini_portile, please [report it via Tidelift](https://tidelift.com/security).
6
+
7
+ Your report will be acknowledged within 48 hours, and you'll receive a more detailed response within 96 hours indicating next steps in handling your report.
8
+
9
+ If you have not received a reply to your submission within 96 hours, Contact the current security coordinator, Mike Dalessio <mike.dalessio@gmail.com>.
10
+
11
+ The information you share with the mini_portile core contributors as part of this process will be kept confidential within the team, unless or until we need to share information upstream with our dependent libraries' core teams, at which point we will notify you.
12
+
13
+ If a vulnerability is first reported by you, we will credit you with the discovery in the public disclosure.