Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ruby): Make coinstallable #35742

Merged
merged 1 commit into from
Dec 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
90 changes: 68 additions & 22 deletions ruby-3.1.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
package:
name: ruby-3.1
version: 3.1.6
epoch: 6
epoch: 7
description: "the Ruby programming language"
copyright:
- license: Ruby
- license: BSD-2-Clause
dependencies:
provides:
- ruby=${{package.full-version}}
runtime:
- ${{package.name}}-base=${{package.full-version}}

environment:
contents:
Expand All @@ -34,10 +36,15 @@ environment:
- xz-dev
- zlib-dev

vars:
prefix: /usr

var-transforms:
- from: ${{package.version}}
match: ^(\d+\.\d+)\.\d+
replace: $1
to: major-minor-version
- from: ${{package.version}}
match: ^(\d+\.\d+)\.\d+
replace: $1.0
to: stdlib-version
- from: ${{package.version}}
match: \.
replace: _
Expand All @@ -61,7 +68,11 @@ pipeline:
--host=${{host.triplet.gnu}} \
--build=${{host.triplet.gnu}} \
--target=${{host.triplet.gnu}} \
--prefix=${{vars.prefix}} \
--prefix=/usr \
--bindir=/usr/libexec/ruby/${{vars.stdlib-version}} \
--datadir=/usr/share/ruby/${{vars.stdlib-version}} \
--docdir=/usr/share/ruby/${{vars.stdlib-version}}/doc \
--mandir=/usr/share/ruby/${{vars.stdlib-version}}/man \
--enable-ipv6 \
--enable-loadable-sqlite-extensions \
--enable-optimizations \
Expand All @@ -81,39 +92,74 @@ pipeline:
- uses: strip

- runs: |
# Ignore the patch version of ruby since ruby will install under the
# version of the latest standard library. Should produce the string 3.1.*
RUBYWILD="$(echo ${{package.version}} | cut -d. -f-2).*"
rm ${{targets.destdir}}/usr/lib/libruby.so

RUBYDIR=${{targets.destdir}}${{vars.prefix}}/lib/ruby/$RUBYWILD
rm -rf ${RUBYDIR}/bundler
RUBYDIR=${{targets.destdir}}/usr/lib/ruby/${{vars.stdlib-version}}
rm -r ${RUBYDIR}/bundler
rm ${RUBYDIR}/bundler.rb

GEMDIR=${{targets.destdir}}${{vars.prefix}}/lib/ruby/gems/$RUBYWILD
rm -rf ${GEMDIR}/gems/bundler-*
GEMDIR=${{targets.destdir}}/usr/lib/ruby/gems/${{vars.stdlib-version}}
rm -r ${GEMDIR}/gems/bundler-*
rm ${GEMDIR}/specifications/default/bundler-*.gemspec

rm ${{targets.destdir}}/usr/bin/bundle \
${{targets.destdir}}/usr/bin/bundler
rm ${{targets.destdir}}/usr/libexec/ruby/${{vars.stdlib-version}}/bundle \
${{targets.destdir}}/usr/libexec/ruby/${{vars.stdlib-version}}/bundler

- runs: |
find ${{targets.destdir}} -name 'mkmf.log' -exec rm {} \;

subpackages:
- name: "ruby-3.1-doc"
description: "ruby documentation"
- name: "${{package.name}}-base"
description: "Ruby ${{vars.major-minor-version}} base"
pipeline:
- runs: |
mkdir -p ${{targets.contextdir}}

mv ${{targets.destdir}}/* ${{targets.contextdir}}

mkdir -p ${{targets.destdir}}/usr/bin
mkdir -p ${{targets.contextdir}}/usr/bin

for bin in ${{targets.contextdir}}/usr/libexec/ruby/${{vars.stdlib-version}}/*; do
bn="$(basename $bin)"
ln -s /usr/libexec/ruby/${{vars.stdlib-version}}/$bn ${{targets.destdir}}/usr/bin/
ln -s /usr/libexec/ruby/${{vars.stdlib-version}}/$bn ${{targets.contextdir}}/usr/bin/$bn\${{vars.major-minor-version}}
done

- name: "${{package.name}}-doc"
description: "Ruby ${{vars.major-minor-version}} documentation"
pipeline:
- uses: split/manpages
- runs: |
mkdir -p "${{targets.subpkgdir}}"/usr/share
mv "${{targets.destdir}}"/usr/share/doc "${{targets.subpkgdir}}"/usr/share/
mv "${{targets.destdir}}"/usr/share/ri "${{targets.subpkgdir}}"/usr/share/
datadir="/usr/share/ruby/${{vars.stdlib-version}}"

- name: "ruby-3.1-dev"
description: "ruby development headers"
mkdir -p "${{targets.contextdir}}/$datadir"

mv "${{targets.outdir}}/${{package.name}}-base/$datadir/doc" "${{targets.contextdir}}/$datadir/"
mv "${{targets.outdir}}/${{package.name}}-base/$datadir/man" "${{targets.contextdir}}/$datadir/"
mv "${{targets.outdir}}/${{package.name}}-base/usr/share/ri" "${{targets.contextdir}}/usr/share/"

- name: "${{package.name}}-base-dev"
description: "Ruby ${{vars.major-minor-version}} development headers"
dependencies:
runtime:
- ${{package.name}}-base=${{package.full-version}}
pipeline:
- uses: split/dev
with:
package: "${{package.name}}-base"
test:
pipeline:
- uses: test/pkgconf

# Empty package, ensures ruby-dev always installs development files for latest ruby version
- name: "${{package.name}}-dev"
description: "Ruby ${{vars.major-minor-version}} development headers"
dependencies:
provides:
- ruby-dev=${{package.full-version}}
runtime:
- ${{package.name}}-base=${{package.full-version}}

update:
enabled: true
version-transform:
Expand Down
93 changes: 68 additions & 25 deletions ruby-3.2.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
package:
name: ruby-3.2
version: 3.2.6
epoch: 1
description: "the Ruby programming language"
epoch: 2
description: "The Ruby ${{vars.major-minor-version}} programming language"
copyright:
- license: Ruby
- license: BSD-2-Clause
dependencies:
provides:
- ruby=${{package.full-version}}
runtime:
- ${{package.name}}-base=${{package.full-version}}

environment:
contents:
Expand Down Expand Up @@ -41,10 +43,15 @@ environment:
- yaml-dev
- zlib-dev

vars:
prefix: /usr

var-transforms:
- from: ${{package.version}}
match: ^(\d+\.\d+)\.\d+
replace: $1
to: major-minor-version
- from: ${{package.version}}
match: ^(\d+\.\d+)\.\d+
replace: $1.0
to: stdlib-version
- from: ${{package.version}}
match: \.
replace: _
Expand All @@ -68,7 +75,11 @@ pipeline:
--host=${{host.triplet.gnu}} \
--build=${{host.triplet.gnu}} \
--target=${{host.triplet.gnu}} \
--prefix=${{vars.prefix}} \
--prefix=/usr \
--bindir=/usr/libexec/ruby/${{vars.stdlib-version}} \
--datadir=/usr/share/ruby/${{vars.stdlib-version}} \
--docdir=/usr/share/ruby/${{vars.stdlib-version}}/doc \
--mandir=/usr/share/ruby/${{vars.stdlib-version}}/man \
--enable-shared \
--disable-rpath \
--sysconfdir=/etc \
Expand All @@ -90,42 +101,74 @@ pipeline:
- uses: autoconf/make-install

- runs: |
# Ignore the patch version of ruby since ruby will install under the
# version of the latest standard library. Should produce the string 3.2.*
RUBYWILD="$(echo ${{package.version}} | cut -d. -f-2).*"
rm ${{targets.destdir}}/usr/lib/libruby.so

RUBYDIR=${{targets.destdir}}${{vars.prefix}}/lib/ruby/$RUBYWILD
rm -rf ${RUBYDIR}/bundler
rm -f ${RUBYDIR}/bundler.rb
RUBYDIR=${{targets.destdir}}/usr/lib/ruby/${{vars.stdlib-version}}
rm -r ${RUBYDIR}/bundler
rm ${RUBYDIR}/bundler.rb

GEMDIR=${{targets.destdir}}${{vars.prefix}}/lib/ruby/gems/$RUBYWILD
rm -rf ${GEMDIR}/gems/bundler-*
rm -f ${GEMDIR}/specifications/default/bundler-*.gemspec
GEMDIR=${{targets.destdir}}/usr/lib/ruby/gems/${{vars.stdlib-version}}
rm -r ${GEMDIR}/gems/bundler-*
rm ${GEMDIR}/specifications/default/bundler-*.gemspec

rm -f ${{targets.destdir}}/usr/bin/bundle \
${{targets.destdir}}/usr/bin/bundler
rm ${{targets.destdir}}/usr/libexec/ruby/${{vars.stdlib-version}}/bundle \
${{targets.destdir}}/usr/libexec/ruby/${{vars.stdlib-version}}/bundler

- runs: |
find ${{targets.destdir}} -name 'mkmf.log' -exec rm {} \;

subpackages:
- name: "ruby-3.2-doc"
description: "ruby documentation"
- name: "${{package.name}}-base"
description: "Ruby ${{vars.major-minor-version}} base"
pipeline:
- runs: |
mkdir -p ${{targets.contextdir}}

mv ${{targets.destdir}}/* ${{targets.contextdir}}

mkdir -p ${{targets.destdir}}/usr/bin
mkdir -p ${{targets.contextdir}}/usr/bin

for bin in ${{targets.contextdir}}/usr/libexec/ruby/${{vars.stdlib-version}}/*; do
bn="$(basename $bin)"
ln -s /usr/libexec/ruby/${{vars.stdlib-version}}/$bn ${{targets.destdir}}/usr/bin/
ln -s /usr/libexec/ruby/${{vars.stdlib-version}}/$bn ${{targets.contextdir}}/usr/bin/$bn\${{vars.major-minor-version}}
done

- name: "${{package.name}}-doc"
description: "Ruby ${{vars.major-minor-version}} documentation"
pipeline:
- uses: split/manpages
- runs: |
mkdir -p "${{targets.subpkgdir}}"/usr/share
mv "${{targets.destdir}}"/usr/share/doc "${{targets.subpkgdir}}"/usr/share/
mv "${{targets.destdir}}"/usr/share/ri "${{targets.subpkgdir}}"/usr/share/
datadir="/usr/share/ruby/${{vars.stdlib-version}}"

- name: "ruby-3.2-dev"
description: "ruby development headers"
mkdir -p "${{targets.contextdir}}/$datadir"

mv "${{targets.outdir}}/${{package.name}}-base/$datadir/doc" "${{targets.contextdir}}/$datadir/"
mv "${{targets.outdir}}/${{package.name}}-base/$datadir/man" "${{targets.contextdir}}/$datadir/"
mv "${{targets.outdir}}/${{package.name}}-base/usr/share/ri" "${{targets.contextdir}}/usr/share/"

- name: "${{package.name}}-base-dev"
description: "Ruby ${{vars.major-minor-version}} development headers"
dependencies:
runtime:
- ${{package.name}}-base=${{package.full-version}}
pipeline:
- uses: split/dev
with:
package: "${{package.name}}-base"
test:
pipeline:
- uses: test/pkgconf

# Empty package, ensures ruby-dev always installs development files for latest ruby version
- name: "${{package.name}}-dev"
description: "Ruby ${{vars.major-minor-version}} development headers"
dependencies:
provides:
- ruby-dev=${{package.full-version}}
runtime:
- ${{package.name}}-base=${{package.full-version}}

update:
enabled: true
version-transform:
Expand Down
Loading
Loading