Skip to content

Commit

Permalink
feat(ruby): Make coinstallable
Browse files Browse the repository at this point in the history
Signed-off-by: RJ Sampson <[email protected]>
  • Loading branch information
EyeCantCU committed Dec 3, 2024
1 parent 5a37b8a commit cb66df9
Show file tree
Hide file tree
Showing 2 changed files with 79 additions and 22 deletions.
64 changes: 42 additions & 22 deletions ruby-3.3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ package:
dependencies:
provides:
- ruby=${{package.full-version}}
runtime:
- ${{package.name}}-base=${{package.full-version}}

environment:
contents:
Expand Down Expand Up @@ -39,10 +41,11 @@ environment:
- yaml-dev
- zlib-dev

vars:
prefix: /usr

var-transforms:
- from: ${{package.version}}
match: ^(\d+\.\d+)\.\d+
replace: $1.0
to: stdlib-version
- from: ${{package.version}}
match: \.
replace: _
Expand All @@ -66,7 +69,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 @@ -88,38 +95,51 @@ 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.3.*
RUBYWILD="$(echo ${{package.version}} | cut -d. -f-2).*"
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.3-doc"
- name: "${{package.name}}-base"
description:
pipeline:
- runs: |
mkdir -p ${{targets.contextdir}}/usr/bin
mv ${{targets.destdir}}/* ${{targets.contextdir}}
mkdir -p ${{targets.destdir}}/usr/bin
for bin in ${{targets.contextdir}}/usr/libexec/ruby/${{vars.stdlib-version}}/*; do
ln -s /usr/libexec/ruby/${{vars.stdlib-version}}/$(basename $bin) ${{targets.destdir}}/usr/bin/$bin
done
- name: "${{package.name}}-doc"
description: "ruby 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}}"
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: "ruby-3.3-dev"
- name: "${{package.name}}-dev"
description: "ruby development headers"
pipeline:
- uses: split/dev
with:
package: "${{package.name}}-base"
test:
pipeline:
- uses: test/pkgconf
Expand Down
37 changes: 37 additions & 0 deletions ruby-supported-ruby.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package:
name: ruby-supported-ruby
version: 1
epoch: 0
description: metapackage to install all supported versions of ruby
copyright:
- license: "MIT"
dependencies:
runtime:
- ruby-3.1-base
- ruby-3.2-base
- ruby-3.3-base

environment:
contents:
packages:
- busybox

data:
- name: rb-versions
items:
3.1: '31'
3.2: '32'
3.3: '33'

subpackages:
- name: ${{package.name}}-dev
description: metapackage to install all supported versions of ruby-dev
dependencies:
runtime:
- ruby-3.1-base-dev
- ruby-3.2-base-dev
- ruby-3.3-base-dev

update:
enabled: false
exclude-reason: No source to watch for the new versions

0 comments on commit cb66df9

Please sign in to comment.