-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 17ce697
Showing
53 changed files
with
3,392 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Copyright (C) 2025 Ruby-GNOME Project Team | ||
# | ||
# This library is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU Lesser General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU Lesser General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU Lesser General Public License | ||
# along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
version: 2 | ||
updates: | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
# Copyright (C) 2025 Ruby-GNOME Project Team | ||
# | ||
# This library is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU Lesser General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU Lesser General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU Lesser General Public License | ||
# along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
name: Release | ||
on: | ||
push: | ||
tags: | ||
- "*" | ||
jobs: | ||
github: | ||
name: GitHub | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 10 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Extract release note | ||
run: | | ||
ruby \ | ||
-e 'print("## rubygems-requirements-system "); \ | ||
puts(ARGF.read.split(/^## /)[1]. \ | ||
gsub(/ {.+?}/, ""). \ | ||
gsub(/\[(.+?)\]\[.+?\]/) {$1})' \ | ||
doc/text/news.md > release-note.md | ||
- name: Upload to release | ||
run: | | ||
title=$(head -n1 release-note.md | sed -e 's/^## //') | ||
tail -n +2 release-note.md > release-note-without-version.md | ||
gh release create ${GITHUB_REF_NAME} \ | ||
--discussion-category Announcements \ | ||
--notes-file release-note-without-version.md \ | ||
--title "${title}" | ||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
rubygems: | ||
name: RubyGems | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 10 | ||
permissions: | ||
id-token: write | ||
environment: release | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: ruby | ||
bundler-cache: true | ||
- uses: rubygems/[email protected] | ||
- name: Push gems | ||
run: | | ||
bundle exec rake release:rubygem_push |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
# Copyright (C) 2025 Ruby-GNOME Project Team | ||
# | ||
# This library is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU Lesser General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU Lesser General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU Lesser General Public License | ||
# along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
name: Test | ||
on: | ||
- push | ||
- pull_request | ||
jobs: | ||
docker: | ||
name: ${{ matrix.distribution }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
distribution: | ||
- almalinux-9 | ||
- alpine-linux | ||
- alt-linux | ||
- amazon-linux-2 | ||
- amazon-linux-2023 | ||
- arch-linux | ||
- conda | ||
- debian-bookworm | ||
- fedora | ||
- gentoo-linux | ||
- opensuse | ||
- pld-linux | ||
- ubuntu-20.04 | ||
- ubuntu-22.04 | ||
- ubuntu-24.04 | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 60 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Prepare cache for Gentoo Linux | ||
if: | | ||
matrix.distribution == 'gentoo-linux' | ||
run: | | ||
docker pull gentoo/portage | ||
gentoo_portage_id=$(docker image inspect gentoo/portage | jq -r ".[0].Id") | ||
echo "GENTOO_PORTAGE_ID=${gentoo_portage_id}" >> "${GITHUB_ENV}" | ||
- name: Cache binary packages for Gentoo Linux | ||
if: | | ||
matrix.distribution == 'gentoo-linux' | ||
uses: actions/cache@v4 | ||
with: | ||
path: .cache | ||
key: ${{ matrix.distribution }}-${{ env.GENTOO_PORTAGE_ID }} | ||
restore-keys: ${{ matrix.distribution }}- | ||
- name: Build Docker image | ||
run: | | ||
docker compose build ${{ matrix.distribution }} | ||
- name: Run | ||
run: | | ||
docker compose run --rm ${{ matrix.distribution }} | ||
native: | ||
name: ${{ matrix.ruby-version }} on ${{ matrix.runs-on }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
runs-on: | ||
- macos | ||
- ubuntu | ||
ruby-version: | ||
- "3.4" | ||
- "3.3" | ||
- "3.2" | ||
- "3.1" | ||
runs-on: ${{ matrix.runs-on }}-latest | ||
timeout-minutes: 15 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: ${{ matrix.ruby-version }} | ||
bundler-cache: true | ||
- name: Install | ||
run: bundle exec rake install | ||
- name: Install glib2 gem | ||
run: | | ||
MAKEFLAGS="-j$(ruby -r etc -e 'puts Etc.nprocessors')" \ | ||
gem install glib2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Copyright (C) 2025 Ruby-GNOME Project Team | ||
# | ||
# This library is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU Lesser General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU Lesser General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU Lesser General Public License | ||
# along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
/.cache/ | ||
/pkg/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# -*- ruby -*- | ||
# | ||
# Copyright (C) 2025 Ruby-GNOME Project Team | ||
# | ||
# This library is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU Lesser General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU Lesser General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU Lesser General Public License | ||
# along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
source "https://rubygems.org/" | ||
|
||
gemspec | ||
|
||
gem "bundler" | ||
gem "rake" | ||
|
||
gem "cairo", path: File.join(__dir__, "rcairo") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,141 @@ | ||
# rubygems-requirements-system | ||
|
||
## Summary | ||
|
||
This is a RubyGems plugin. This installs system packages that are | ||
needed by a gem automatically. | ||
|
||
This is convenient for both of users and developers. | ||
|
||
Users don't need to install gem dependencies separately. | ||
|
||
Developers don't need to write documents how to install gem | ||
dependencies. | ||
|
||
## Motivation | ||
|
||
Bindings are helpful for developers because developers don't need to | ||
re-implement existing features. But users need to install not only | ||
bindings but also dependencies. | ||
|
||
There are some approaches to reduce the inconvenience: | ||
|
||
1. Installs dependencies automatically | ||
2. Bundles dependencies (a.k.a. fat gem) | ||
|
||
The 1. approach is used by Ruby-GNOME packages such as glib2 gem and | ||
gtk4 gem. | ||
|
||
The 2. approach is used by Nokogiri. | ||
|
||
If gems that use the 2. approach are maintained actively, there are | ||
not much problems. There are several problems otherwise. For example, | ||
security concerns and new CRuby support. | ||
|
||
See also: | ||
https://slide.rabbit-shocker.org/authors/kou/rubykaigi-takeout-2020/ | ||
|
||
The 1. approach will reduce maintenance costs. It will help both of | ||
developers and users. If we can reduce maintenance costs for | ||
developers, developers can focus on new features and bug fixes than | ||
releases. | ||
|
||
## Usage | ||
|
||
Add `rubygems-requirements-system` to your gem's runtime dependencies: | ||
|
||
```ruby | ||
Gem::Specification.new do |spec| | ||
# ... | ||
spec.add_runtime_dependency("rubygems-requirements-system") | ||
# ... | ||
end | ||
``` | ||
|
||
Add dependency information to `Gem::Specification#requirements`: | ||
|
||
```ruby | ||
Gem::Specification.new do |spec| | ||
# ... | ||
|
||
# Install GObject. Package ID is pkg-config's package name for now. | ||
# We'll add support for other package system's name such as CMake | ||
# package's name. | ||
# We can specify package names for each platform. | ||
spec.requirements << "system: gobject-2.0: alt_linux: glib2-devel" | ||
spec.requirements << "system: gobject-2.0: arch_linux: glib2" | ||
spec.requirements << "system: gobject-2.0: conda: glib" | ||
spec.requirements << "system: gobject-2.0: debian: libglib2.0-dev" | ||
spec.requirements << "system: gobject-2.0: gentoo_linux: dev-libs/glib" | ||
spec.requirements << "system: gobject-2.0: homebrew: glib" | ||
spec.requirements << "system: gobject-2.0: macports: glib2" | ||
# We can omit the Red Hat Enterprise Linux family case because | ||
# "pkgconfig(gobject-2.0)" can be generated automatically. | ||
spec.requirements << "system: gobject-2.0: rhel: pkgconfig(gobject-2.0)" | ||
|
||
# ... | ||
end | ||
``` | ||
|
||
You can require dependency A or B. For example, you can require | ||
`mysqlclient` or `libmariadb`. | ||
|
||
```ruby | ||
Gem::Specification.new do |spec| | ||
# ... | ||
|
||
# We need mysqliclient or libmariadb for this gem. | ||
spec.requirements << "system: mysqlclient|libmariadb: arch_linux: mariadb-libs" | ||
spec.requirements << "system: mysqlclient|libmariadb: debian: libmysqlclient-dev" | ||
spec.requirements << "system: mysqlclient|libmariadb: debian: libmariadb-dev" | ||
|
||
# ... | ||
end | ||
``` | ||
|
||
You can install multiple packages for a dependency. | ||
|
||
```ruby | ||
Gem::Specification.new do |spec| | ||
# ... | ||
|
||
# We need to install multiple packages to use cairo with conda. | ||
spec.requirements << "system: cairo: conda: cairo" | ||
spec.requirements << "system: cairo: conda: expat" | ||
spec.requirements << "system: cairo: conda: xorg-kbproto" | ||
spec.requirements << "system: cairo: conda: xorg-libxau" | ||
spec.requirements << "system: cairo: conda: xorg-libxext" | ||
spec.requirements << "system: cairo: conda: xorg-libxrender" | ||
spec.requirements << "system: cairo: conda: xorg-renderproto" | ||
spec.requirements << "system: cairo: conda: xorg-xextproto" | ||
spec.requirements << "system: cairo: conda: xorg-xproto" | ||
spec.requirements << "system: cairo: conda: zlib" | ||
|
||
# ... | ||
end | ||
``` | ||
|
||
## Requirements | ||
|
||
RubyGems 3.5.0 or later is required. RubyGems can load installed | ||
plugin immediately since 3.5.0. | ||
|
||
If `gem install glib2` installs rubygems-requirements-system gem as a | ||
dependency, old RubyGems doesn't use a RubyGems plugin in | ||
rubygems-requirements-system gem while installing glib2 gem. So glib2 | ||
gem dependencies aren't installed automatically. | ||
|
||
## History | ||
|
||
This is based on | ||
[native-package-installer](https://github.com/ruby-gnome/native-package-installer) | ||
gem. We could add support for RubyGems plugin to | ||
native-package-installer but we didn't. Because "native" package isn't | ||
a natural name for a package on the target platform. We want to use | ||
other word than "native". So we create a new gem. | ||
|
||
## License | ||
|
||
Copyright (C) 2013-2025 Ruby-GNOME Project Team | ||
|
||
LGPL-3 or later. See doc/text/lgpl-3.txt for details. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# -*- ruby -*- | ||
# | ||
# Copyright (C) 2025 Ruby-GNOME Project Team | ||
# | ||
# This library is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU Lesser General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU Lesser General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU Lesser General Public License | ||
# along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
require "bundler/gem_helper" | ||
|
||
base_dir = File.dirname(__FILE__) | ||
helper = Bundler::GemHelper.new(base_dir) | ||
def helper.version_tag | ||
version | ||
end | ||
helper.install |
Oops, something went wrong.