Skip to content

Commit df549ed

Browse files
committed
refactor: extract mini_portile recipe config to dependencies.yml
1 parent 8ab3ecc commit df549ed

File tree

4 files changed

+21
-20
lines changed

4 files changed

+21
-20
lines changed

.github/workflows/gem-install.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
- uses: actions/cache@v3
2424
with:
2525
path: ports/archives
26-
key: ports-archives-tarball-${{hashFiles('ext/sqlite3/extconf.rb')}}
26+
key: ports-archives-tarball-${{hashFiles('ext/sqlite3/extconf.rb','dependencies.yml')}}
2727
- uses: ruby/setup-ruby-pkgs@v1
2828
with:
2929
ruby-version: "3.1"
@@ -38,7 +38,7 @@ jobs:
3838
- uses: actions/cache@v3
3939
with:
4040
path: ports/archives
41-
key: ports-archives-tarball-${{hashFiles('ext/sqlite3/extconf.rb')}}
41+
key: ports-archives-tarball-${{hashFiles('ext/sqlite3/extconf.rb','dependencies.yml')}}
4242
- uses: ruby/setup-ruby-pkgs@v1
4343
with:
4444
ruby-version: "3.1"
@@ -158,7 +158,7 @@ jobs:
158158
- uses: actions/cache@v3
159159
with:
160160
path: ports/archives
161-
key: ports-archives-tarball-${{hashFiles('ext/sqlite3/extconf.rb')}}
161+
key: ports-archives-tarball-${{hashFiles('ext/sqlite3/extconf.rb','dependencies.yml')}}
162162
- run: |
163163
docker run --rm -v "$(pwd):/sqlite3" -w /sqlite3 \
164164
larskanis/rake-compiler-dock-mri-${{matrix.plat}}:1.2.1 \

dependencies.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# TODO: stop using symbols here once we no longer support Ruby 2.7 and can rely on symbolize_names
2+
:sqlite3:
3+
# checksum verified by first checking the published sha3(256) checksum against https://sqlite.org/download.html:
4+
#
5+
# $ sha3sum -a 256 ports/archives/sqlite-autoconf-3390400.tar.gz
6+
# 431328e30d12c551da9ba7ef2122b269076058512014afa799caaf62ca567090 ports/archives/sqlite-autoconf-3390400.tar.gz
7+
#
8+
# $ sha256sum ports/archives/sqlite-autoconf-3390400.tar.gz
9+
# f31d445b48e67e284cf206717cc170ab63cbe4fd7f79a82793b772285e78fdbb ports/archives/sqlite-autoconf-3390400.tar.gz
10+
#
11+
:version: "3.39.4"
12+
:files:
13+
- :url: "https://sqlite.org/2022/sqlite-autoconf-3390400.tar.gz"
14+
:sha256: "f31d445b48e67e284cf206717cc170ab63cbe4fd7f79a82793b772285e78fdbb"

ext/sqlite3/extconf.rb

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
require "mkmf"
22
require "mini_portile2"
3+
require "yaml"
34

45
module Sqlite3
56
module ExtConf
@@ -131,23 +132,8 @@ def sqlite3_config
131132
end
132133

133134
def mini_portile_config
134-
{
135-
sqlite3: {
136-
# checksum verified by first checking the published sha3(256) checksum against https://sqlite.org/download.html:
137-
#
138-
# $ sha3sum -a 256 ports/archives/sqlite-autoconf-3390400.tar.gz
139-
# 431328e30d12c551da9ba7ef2122b269076058512014afa799caaf62ca567090 ports/archives/sqlite-autoconf-3390400.tar.gz
140-
#
141-
# $ sha256sum ports/archives/sqlite-autoconf-3390400.tar.gz
142-
# f31d445b48e67e284cf206717cc170ab63cbe4fd7f79a82793b772285e78fdbb ports/archives/sqlite-autoconf-3390400.tar.gz
143-
#
144-
version: "3.39.4",
145-
files: [{
146-
url: "https://sqlite.org/2022/sqlite-autoconf-3390400.tar.gz",
147-
sha256: "f31d445b48e67e284cf206717cc170ab63cbe4fd7f79a82793b772285e78fdbb",
148-
}],
149-
}
150-
}
135+
# TODO: once Ruby 2.7 is no longer supported, use symbolize_names: true
136+
YAML.load_file(File.join(package_root_dir, "dependencies.yml"))
151137
end
152138

153139
def abort_could_not_find(missing)

sqlite3.gemspec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ Gem::Specification.new do |s|
4444
"LICENSE",
4545
"LICENSE-DEPENDENCIES",
4646
"README.md",
47+
"dependencies.yml",
4748
"ext/sqlite3/aggregator.c",
4849
"ext/sqlite3/aggregator.h",
4950
"ext/sqlite3/backup.c",

0 commit comments

Comments
 (0)