Commit 76578892 authored by supechicken666's avatar supechicken666 Committed by GitHub

gcalculator => 3.38.2, use Wayland wrapper (#5349)

* Update gcalculator.rb
parent 37ae9b9d
require 'package' require 'package'
class Gcalculator < Package class Gcalculator < Package
description 'Calculator for solving mathematical equations' description 'GNOME desktop calculator'
homepage 'https://gitlab.gnome.org/GNOME/gnome-calculator' homepage 'https://wiki.gnome.org/Apps/Calculator'
version '3.38.1'
compatibility 'all' compatibility 'all'
source_url 'https://gitlab.gnome.org/GNOME/gnome-calculator/-/archive/3.38.1/gnome-calculator-3.38.1.tar.bz2' @_app = 'gnome-calculator'
source_sha256 '33706fe3ade10b58e39c008f005a5bcca1b59239047b8c8f3ed595d0b7bd6894' @_fullver = '3.38.2'
@_mainver = @_fullver.rpartition('.')[0]
binary_url ({ @_url = "https://download.gnome.org/sources/#{@_app}/#{@_mainver}/#{@_app}-#{@_fullver}"
aarch64: 'https://dl.bintray.com/chromebrew/chromebrew/gcalculator-3.38.1-chromeos-armv7l.tar.xz', version @_fullver
armv7l: 'https://dl.bintray.com/chromebrew/chromebrew/gcalculator-3.38.1-chromeos-armv7l.tar.xz', source_url "#{@_url}.tar.xz"
i686: 'https://dl.bintray.com/chromebrew/chromebrew/gcalculator-3.38.1-chromeos-i686.tar.xz', source_sha256 `curl -Ls #{@_url}.sha256sum | tail -n1 | cut -d ' ' -f1`.chomp
x86_64: 'https://dl.bintray.com/chromebrew/chromebrew/gcalculator-3.38.1-chromeos-x86_64.tar.xz',
})
binary_sha256 ({
aarch64: '1ab4852cb55661918bc646bf6b1ca1ecf153c3fcc78d46cf13b1e7bc830ee69d',
armv7l: '1ab4852cb55661918bc646bf6b1ca1ecf153c3fcc78d46cf13b1e7bc830ee69d',
i686: '0eb813d120d974365d2910e9a21bee9bdb6e533b0d21e26510b40cbe09d3c4ca',
x86_64: '8b1478a211443794b6aba531b30ff9359080cb580e5214d27d8df97beac3c0ec',
})
depends_on 'setuptools' => :build depends_on 'setuptools' => :build
depends_on 'gtk3'
depends_on 'gtksourceview' depends_on 'gtksourceview'
depends_on 'itstool' depends_on 'itstool'
depends_on 'libgee' depends_on 'libgee'
depends_on 'libsoup' depends_on 'libsoup'
depends_on 'sommelier'
def self.build def self.build
system "meson --prefix=#{CREW_PREFIX} --libdir=#{CREW_LIB_PREFIX} builddir" system "meson #{CREW_MESON_LTO_OPTIONS} builddir"
system 'meson configure builddir'
system 'ninja -C builddir' system 'ninja -C builddir'
end end
def self.install def self.install
system "DESTDIR=#{CREW_DEST_DIR} ninja -C builddir install" system "DESTDIR=#{CREW_DEST_DIR} ninja -C builddir install"
@_wrapper = <<~EOF
#!/bin/sh
WAYLAND_DISPLAY=wayland-0
GDK_BACKEND=wayland
CLUTTER_BACKEND=wayland
exec #{@_app}.elf "$@"
EOF
File.write(@_app, @_wrapper)
FileUtils.mv "#{CREW_DEST_PREFIX}/bin/#{@_app}", "#{CREW_DEST_PREFIX}/bin/#{@_app}.elf"
FileUtils.install @_app, "#{CREW_DEST_PREFIX}/bin/#{@_app}", mode: 0755
end end
def self.postinstall def self.postinstall
system 'gdk-pixbuf-query-loaders --update-cache'
system "glib-compile-schemas #{CREW_PREFIX}/share/glib-2.0/schemas" system "glib-compile-schemas #{CREW_PREFIX}/share/glib-2.0/schemas"
puts puts
puts "To use the gui calculator, execute 'gnome-calculator'".lightblue puts "To use the graphical calculator, execute 'gnome-calculator'".lightblue
puts puts
puts "To use the cli calculator, execute 'gcalccmd'".lightblue puts "To use the command line calculator, execute 'gcalccmd'".lightblue
puts puts
end end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment