Skip to content

Commit

Permalink
Merge pull request #15 from fetlife/change-base-image-to-bullseye
Browse files Browse the repository at this point in the history
Change base image to bullseye
  • Loading branch information
reneklacan authored Jan 9, 2024
2 parents aa38315 + b20a4cd commit 8022811
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ require 'rubygems/package_task'

spec = eval(File.read("libfacedetection.gemspec"))
GEM_RUBY_VERSION = "3.3.0"
DOCKER_IMAGE = "ruby:#{GEM_RUBY_VERSION}-bullseye"

def compile_cmd(_arch)
"gem instal gem-compiler; curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y; source '/root/.cargo/env'; rake gem:native"
end

gem_task = Gem::PackageTask.new(spec) do |pkg|
pkg.need_zip = true
Expand All @@ -15,10 +20,10 @@ end

desc "Generate a pre-compiled native gem for aarch64-linux"
task "gem:native:aarch64-linux" => ["gem"] do
sh %{docker run --rm --platform linux/arm64 -v $(pwd):/src -w /src ruby:#{GEM_RUBY_VERSION} /bin/bash -c "gem instal gem-compiler; curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y; source '/root/.cargo/env'; rake gem:native"}
sh %{docker run --rm --platform linux/arm64 -v $(pwd):/src -w /src #{DOCKER_IMAGE} /bin/bash -c "#{compile_cmd('aarch64-unknown-linux-musl')}"}
end

desc "Generate a pre-compiled native gem for x86_64-linux"
task "gem:native:x86_64-linux" => ["gem"] do
sh %{docker run --rm --platform linux/amd64 -v $(pwd):/src -w /src ruby:#{GEM_RUBY_VERSION} /bin/bash -c "gem instal gem-compiler; curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y; source '/root/.cargo/env'; rake gem:native"}
sh %{docker run --rm --platform linux/amd64 -v $(pwd):/src -w /src #{DOCKER_IMAGE} /bin/bash -c "#{compile_cmd('x86_64-unknown-linux-musl')}"}
end

0 comments on commit 8022811

Please sign in to comment.