mini_portile2 2.8.5.rc2 → 2.8.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ca5eb330aa4b2b6093e3cbe77641dfd14b3eff2601dce6c97f7de69f42fffcb5
4
- data.tar.gz: ad64c2536ab3e978c22d71bc380144f1fa579cf01993e97bf63553ec4732b851
3
+ metadata.gz: 8e05baa930606f2d6523ea99ac9e8eedebd895c7ce4d54cfeb66ec18cd765929
4
+ data.tar.gz: 4176f83bb1d2bba075e03e3e97d3205198cf595d6462da3c3004cae98421c341
5
5
  SHA512:
6
- metadata.gz: 67530e1e366cb1605a272234bbfe7ccd6d8659ebd081352a93848de694c03ad0bac23425f2a13c94f67b5c0a55273f178577f31ad088d452f4bfa810e8445c45
7
- data.tar.gz: 47e6b00a089e83e422f51c833744226c275af1a8700a21fa11a7f81c70b952da78fbf6df3a0cd8e1347be89b8c1ce6ac0f430a6339b3d0f3340aa2fe1efa0afb
6
+ metadata.gz: 9d665ab774d8f71ed02c2f0fc1fb79cea7dfaf4b989093afe58f666f9b71d731d95981e261e21d49c2d8ccbea759929ad3dce0420885daf1251a834e6c060f6f
7
+ data.tar.gz: d225acb7e38adff4ad72f54a5dfa786791a45c61cff83c8cf8e85aef749446632da5d23dbf133ff6617304b47ded60b617fd2a0582b759216390add7d69b1565
@@ -33,7 +33,7 @@ jobs:
33
33
  run: |
34
34
  git config --system core.autocrlf false
35
35
  git config --system core.eol lf
36
- - uses: actions/checkout@v3
36
+ - uses: actions/checkout@v4
37
37
  - uses: MSP-Greg/setup-ruby-pkgs@v1
38
38
  with:
39
39
  apt-get: _update_ build-essential cmake
@@ -57,20 +57,24 @@ jobs:
57
57
  run: |
58
58
  git config --system core.autocrlf false
59
59
  git config --system core.eol lf
60
- - uses: actions/checkout@v3
60
+ - uses: actions/checkout@v4
61
61
  - uses: MSP-Greg/setup-ruby-pkgs@v1
62
62
  with:
63
63
  apt-get: _update_ build-essential cmake
64
64
  mingw: _upgrade_ cmake
65
65
  ruby-version: ${{ matrix.ruby }}
66
66
  bundler-cache: true
67
- - uses: actions/cache@v3
67
+ - uses: actions/cache@v4
68
68
  with:
69
69
  path: examples/ports/archives
70
70
  key: examples-${{ hashFiles('examples/Rakefile') }}
71
71
  - run: bundle exec rake test:examples
72
72
 
73
73
  fedora: # see https://github.com/flavorjones/mini_portile/issues/118
74
+ strategy:
75
+ fail-fast: false
76
+ matrix:
77
+ task: ["test:unit", "test:examples"]
74
78
  runs-on: ubuntu-latest
75
79
  container:
76
80
  image: fedora:35
@@ -78,11 +82,36 @@ jobs:
78
82
  - run: |
79
83
  dnf group install -y "C Development Tools and Libraries"
80
84
  dnf install -y ruby ruby-devel libyaml-devel git-all patch cmake xz
81
- - uses: actions/checkout@v3
82
- - uses: actions/cache@v3
85
+ - uses: actions/checkout@v4
86
+ - uses: actions/cache@v4
83
87
  with:
84
88
  path: examples/ports/archives
85
89
  key: examples-${{ hashFiles('examples/Rakefile') }}
86
90
  - run: bundle install
87
- - run: bundle exec rake test:unit
88
- - run: bundle exec rake test:examples
91
+ - run: bundle exec rake ${{ matrix.task }}
92
+
93
+ freebsd:
94
+ strategy:
95
+ fail-fast: false
96
+ matrix:
97
+ task: ["test:unit", "test:examples"]
98
+ runs-on: ubuntu-latest
99
+ env:
100
+ MAKE: gmake
101
+ steps:
102
+ - uses: actions/checkout@v4
103
+ - uses: actions/cache@v4
104
+ with:
105
+ path: examples/ports/archives
106
+ key: examples-${{ hashFiles('examples/Rakefile') }}
107
+ - uses: vmactions/freebsd-vm@v1
108
+ with:
109
+ envs: MAKE
110
+ usesh: true
111
+ copyback: false
112
+ prepare: pkg install -y ruby devel/ruby-gems pkgconf git cmake devel/gmake textproc/libyaml security/gnupg
113
+ run: |
114
+ git config --global --add safe.directory /home/runner/work/mini_portile/mini_portile
115
+ gem install bundler
116
+ bundle install
117
+ bundle exec rake ${{ matrix.task }}
data/CHANGELOG.md CHANGED
@@ -1,14 +1,28 @@
1
1
  ## mini_portile changelog
2
2
 
3
- ### 2.8.5.rc2 / 2023-09-17
3
+ ### 2.8.6 / 2024-04-14
4
4
 
5
5
  #### Added
6
6
 
7
- - New method `MiniPortile#mkmf_config` will set up MakeMakefile variables to properly link against the recipe. This should make it easier for C extensions to package third-party libraries.
8
- - With no arguments, will set up just `$INCFLAGS`, `$libs`, and `$LIBPATH`.
9
- - Optionally, if provided a pkg-config file, will use that config to more precisely set `$INCFLAGS`, `$libs`, `$LIBPATH`, and `$CFLAGS`/`$CXXFLAGS`.
10
- - Optionally, if provided the name of a static archive, will rewrite linker flags to ensure correct linkage.
11
- - New methods `#lib_path` and `#include_path` which point at the installed directories under `ports`.
7
+ - When using CMake on FreeBSD, default to clang's "cc" and "c++" compilers. (#139 by @mudge)
8
+
9
+
10
+ ### 2.8.5 / 2023-10-22
11
+
12
+ #### Added
13
+
14
+ - New methods `#lib_path` and `#include_path` which point at the installed directories under `ports`. (by @flavorjones)
15
+ - Add config param for CMAKE_BUILD_TYPE, which now defaults to `Release`. (#136 by @Watson1978)
16
+
17
+ #### Experimental
18
+
19
+ 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)
20
+
21
+ - With no arguments, will set up just `$INCFLAGS`, `$libs`, and `$LIBPATH`.
22
+ - Optionally, if provided a pkg-config file, will use that config to more precisely set `$INCFLAGS`, `$libs`, `$LIBPATH`, and `$CFLAGS`/`$CXXFLAGS`.
23
+ - Optionally, if provided the name of a static archive, will rewrite linker flags to ensure correct linkage.
24
+
25
+ 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.
12
26
 
13
27
 
14
28
  ### 2.8.4 / 2023-07-18
data/README.md CHANGED
@@ -138,8 +138,8 @@ This is configurable as above, except for Windows systems where it's hardcoded t
138
138
  The cmake command used is configurable, and in order of preference will use:
139
139
 
140
140
  - the `CMAKE` environment variable (if present)
141
- - the `cmake_command` value passed in to the constructor
142
- - `"cmake"`
141
+ - the `:cmake_command` keyword argument passed into the constructor
142
+ - `"cmake"` (the default)
143
143
 
144
144
  You can pass it in like so:
145
145
 
@@ -147,6 +147,19 @@ You can pass it in like so:
147
147
  MiniPortileCMake.new("libfoobar", "1.3.5", cmake_command: "cmake3")
148
148
  ```
149
149
 
150
+ #### `cmake_build_type`
151
+
152
+ The cmake build type is configurable as of v2.8.5, and in order of preference will use:
153
+
154
+ - the `CMAKE_BUILD_TYPE` environment variable (if present)
155
+ - the `:cmake_build_type` keyword argument passed into the constructor
156
+ - `"Release"` (the default)
157
+
158
+ You can pass it in like so:
159
+
160
+ ``` ruby
161
+ MiniPortileCMake.new("libfoobar", "1.3.5", cmake_build_type: "Debug")
162
+ ```
150
163
 
151
164
  ### Local source directories
152
165
 
@@ -32,9 +32,9 @@ $MINI_PORTILE_STATIC_LIBS = {}
32
32
  class MiniPortile
33
33
  DEFAULT_TIMEOUT = 10
34
34
 
35
- attr_reader :name, :version, :original_host
35
+ attr_reader :name, :version, :original_host, :source_directory
36
36
  attr_writer :configure_options
37
- attr_accessor :host, :files, :patch_files, :target, :logger, :source_directory
37
+ attr_accessor :host, :files, :patch_files, :target, :logger
38
38
 
39
39
  def self.windows?
40
40
  target_os =~ /mswin|mingw/
@@ -11,6 +11,7 @@ class MiniPortileCMake < MiniPortile
11
11
  def initialize(name, version, **kwargs)
12
12
  super(name, version, **kwargs)
13
13
  @cmake_command = kwargs[:cmake_command]
14
+ @cmake_build_type = kwargs[:cmake_build_type]
14
15
  end
15
16
 
16
17
  def configure_defaults
@@ -49,6 +50,10 @@ class MiniPortileCMake < MiniPortile
49
50
  (ENV["CMAKE"] || @cmake_command || "cmake").dup
50
51
  end
51
52
 
53
+ def cmake_build_type
54
+ (ENV["CMAKE_BUILD_TYPE"] || @cmake_build_type || "Release").dup
55
+ end
56
+
52
57
  private
53
58
 
54
59
  def generator_defaults
@@ -69,7 +74,8 @@ class MiniPortileCMake < MiniPortile
69
74
  "-DCMAKE_SYSTEM_NAME=#{cmake_system_name}",
70
75
  "-DCMAKE_SYSTEM_PROCESSOR=#{cpu_type}",
71
76
  "-DCMAKE_C_COMPILER=#{c_compiler}",
72
- "-DCMAKE_CXX_COMPILER=#{cxx_compiler}"
77
+ "-DCMAKE_CXX_COMPILER=#{cxx_compiler}",
78
+ "-DCMAKE_BUILD_TYPE=#{cmake_build_type}",
73
79
  ]
74
80
  end
75
81
 
@@ -88,6 +94,9 @@ class MiniPortileCMake < MiniPortile
88
94
  if MiniPortile.darwin?
89
95
  c_compiler ||= 'clang'
90
96
  cxx_compiler ||='clang++'
97
+ elsif MiniPortile.freebsd?
98
+ c_compiler ||= 'cc'
99
+ cxx_compiler ||= 'c++'
91
100
  else
92
101
  c_compiler ||= 'gcc'
93
102
  cxx_compiler ||= 'g++'
@@ -1,3 +1,3 @@
1
1
  class MiniPortile
2
- VERSION = "2.8.5.rc2"
2
+ VERSION = "2.8.6"
3
3
  end
@@ -1,7 +1,4 @@
1
- # coding: utf-8
2
- lib = File.expand_path("../lib", __FILE__)
3
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require "mini_portile2/version"
1
+ require_relative "lib/mini_portile2/version"
5
2
 
6
3
  Gem::Specification.new do |spec|
7
4
  spec.name = "mini_portile2"
@@ -10,8 +7,12 @@ Gem::Specification.new do |spec|
10
7
  spec.authors = ["Luis Lavena", "Mike Dalessio", "Lars Kanis"]
11
8
  spec.email = "mike.dalessio@gmail.com"
12
9
 
13
- spec.summary = "Simplistic port-like solution for developers"
14
- spec.description = "Simplistic port-like solution for developers. It provides a standard and simplified way to compile against dependency libraries without messing up your system."
10
+ spec.summary = "Simple autoconf and cmake builder for developers"
11
+ spec.description = <<~TEXT
12
+ Simple autoconf and cmake builder for developers. It provides a standard way to compile against
13
+ dependency libraries without requiring system-wide installation. It also simplifies
14
+ vendoring and cross-compilation by providing a consistent build interface.
15
+ TEXT
15
16
 
16
17
  spec.homepage = "https://github.com/flavorjones/mini_portile"
17
18
  spec.licenses = ["MIT"]
data/test/test_cmake.rb CHANGED
@@ -96,7 +96,8 @@ class TestCMakeConfig < TestCMake
96
96
  "-DCMAKE_SYSTEM_NAME=Darwin",
97
97
  "-DCMAKE_SYSTEM_PROCESSOR=arm64",
98
98
  "-DCMAKE_C_COMPILER=some-host-clang",
99
- "-DCMAKE_CXX_COMPILER=some-host-clang++"
99
+ "-DCMAKE_CXX_COMPILER=some-host-clang++",
100
+ "-DCMAKE_BUILD_TYPE=Release"
100
101
  ],
101
102
  recipe.configure_defaults)
102
103
  end
@@ -106,6 +107,29 @@ class TestCMakeConfig < TestCMake
106
107
  end
107
108
  end
108
109
 
110
+ def test_configure_defaults_with_freebsd
111
+ recipe = init_recipe
112
+ recipe.host = 'some-host'
113
+
114
+ with_env({ "CC" => nil, "CXX" => nil }) do
115
+ with_stubbed_target(os: 'freebsd14') do
116
+ with_compilers(recipe, c_compiler: 'cc', cxx_compiler: 'c++') do
117
+ Open3.stub(:capture2, cmake_help_mock('Unix')) do
118
+ assert_equal(
119
+ [
120
+ "-DCMAKE_SYSTEM_NAME=FreeBSD",
121
+ "-DCMAKE_SYSTEM_PROCESSOR=x86_64",
122
+ "-DCMAKE_C_COMPILER=cc",
123
+ "-DCMAKE_CXX_COMPILER=c++",
124
+ "-DCMAKE_BUILD_TYPE=Release"
125
+ ],
126
+ recipe.configure_defaults)
127
+ end
128
+ end
129
+ end
130
+ end
131
+ end
132
+
109
133
  def test_configure_defaults_with_manual_system_name
110
134
  recipe = init_recipe
111
135
  recipe.system_name = 'Custom'
@@ -119,7 +143,8 @@ class TestCMakeConfig < TestCMake
119
143
  "-DCMAKE_SYSTEM_NAME=Custom",
120
144
  "-DCMAKE_SYSTEM_PROCESSOR=x86_64",
121
145
  "-DCMAKE_C_COMPILER=gcc",
122
- "-DCMAKE_CXX_COMPILER=g++"
146
+ "-DCMAKE_CXX_COMPILER=g++",
147
+ "-DCMAKE_BUILD_TYPE=Release"
123
148
  ],
124
149
  recipe.configure_defaults)
125
150
  end
@@ -194,6 +219,17 @@ class TestCMakeConfig < TestCMake
194
219
  end
195
220
  end
196
221
 
222
+ def test_cmake_build_type_configuration
223
+ without_env("CMAKE_BUILD_TYPE") do
224
+ assert_equal("Release", MiniPortileCMake.new("test", "1.0.0").cmake_build_type)
225
+ assert_equal("xyzzy", MiniPortileCMake.new("test", "1.0.0", cmake_build_type: "xyzzy").cmake_build_type)
226
+ end
227
+ with_env("CMAKE_BUILD_TYPE"=>"Debug") do
228
+ assert_equal("Debug", MiniPortileCMake.new("test", "1.0.0").cmake_build_type)
229
+ assert_equal("Debug", MiniPortileCMake.new("test", "1.0.0", cmake_build_type: "xyzzy").cmake_build_type)
230
+ end
231
+ end
232
+
197
233
  private
198
234
 
199
235
  def with_stubbed_target(os: 'linux', cpu: 'x86_64')
@@ -227,7 +263,8 @@ class TestCMakeConfig < TestCMake
227
263
  "-DCMAKE_SYSTEM_NAME=Linux",
228
264
  "-DCMAKE_SYSTEM_PROCESSOR=x86_64",
229
265
  "-DCMAKE_C_COMPILER=gcc",
230
- "-DCMAKE_CXX_COMPILER=g++"
266
+ "-DCMAKE_CXX_COMPILER=g++",
267
+ "-DCMAKE_BUILD_TYPE=Release"
231
268
  ]
232
269
  end
233
270
 
metadata CHANGED
@@ -1,16 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mini_portile2
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.8.5.rc2
4
+ version: 2.8.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luis Lavena
8
8
  - Mike Dalessio
9
9
  - Lars Kanis
10
- autorequire:
10
+ autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2023-09-17 00:00:00.000000000 Z
13
+ date: 2024-04-14 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: bundler
@@ -96,9 +96,10 @@ dependencies:
96
96
  - - "~>"
97
97
  - !ruby/object:Gem::Version
98
98
  version: '1.7'
99
- description: Simplistic port-like solution for developers. It provides a standard
100
- and simplified way to compile against dependency libraries without messing up your
101
- system.
99
+ description: |
100
+ Simple autoconf and cmake builder for developers. It provides a standard way to compile against
101
+ dependency libraries without requiring system-wide installation. It also simplifies
102
+ vendoring and cross-compilation by providing a consistent build interface.
102
103
  email: mike.dalessio@gmail.com
103
104
  executables: []
104
105
  extensions: []
@@ -144,7 +145,7 @@ homepage: https://github.com/flavorjones/mini_portile
144
145
  licenses:
145
146
  - MIT
146
147
  metadata: {}
147
- post_install_message:
148
+ post_install_message:
148
149
  rdoc_options: []
149
150
  require_paths:
150
151
  - lib
@@ -155,14 +156,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
155
156
  version: 2.3.0
156
157
  required_rubygems_version: !ruby/object:Gem::Requirement
157
158
  requirements:
158
- - - ">"
159
+ - - ">="
159
160
  - !ruby/object:Gem::Version
160
- version: 1.3.1
161
+ version: '0'
161
162
  requirements: []
162
- rubygems_version: 3.4.19
163
- signing_key:
163
+ rubygems_version: 3.5.3
164
+ signing_key:
164
165
  specification_version: 4
165
- summary: Simplistic port-like solution for developers
166
+ summary: Simple autoconf and cmake builder for developers
166
167
  test_files:
167
168
  - test/assets/git/config
168
169
  - test/assets/gpg-fixtures/data