Sha256: 61aa78f165b082e62ac231344086ce27082140d1bc5e5ee36cc732d343e39544

Contents?: true

Size: 1.21 KB

Versions: 1

Compression:

Stored size: 1.21 KB

Contents

# Copyright (c) 2023 M.J.N. Corino, The Netherlands
#
# This software is released under the MIT license.

###
# wxRuby3 buildtools platform pkg manager for SuSE type systems
###

module WXRuby3

  module Config

    module Platform

      module PkgManager

        PLATFORM_DEPS = %w[gtk3-devel webkit2gtk3-devel gspell-devel gstreamer-devel gstreamer-plugins-base-devel libcurl-devel libsecret-devel libnotify-devel libSDL-devel zlib-devel libjpeg-devel libpng-devel]

        class << self

          private

          def do_install(distro, pkgs)
            run_zypper(make_install_cmd(pkgs))
          end

          def add_platform_pkgs(pkgs)
            # add build tools
            if pkgs.include?('g++')
              pkgs.delete('g++')
              pkgs << 'gcc-c++'
            end
            # find pkgs we need
            PLATFORM_DEPS.inject(pkgs) { |list, pkg| list << pkg unless system("rpm -q --whatprovides #{pkg} >/dev/null 2>&1"); list }
          end

          def run_zypper(cmd)
            run("zypper -t -i #{cmd}")
          end

          def make_install_cmd(pkgs)
            # create install command
            "install -y #{ pkgs.join(' ') }"
          end

        end

      end

    end

  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
wxruby3-0.9.7 rakelib/lib/config/pkgman/suse.rb