mirror of
https://github.com/chromebrew/chromebrew.git
synced 2026-01-09 07:28:01 -05:00
94 lines
3.4 KiB
Ruby
94 lines
3.4 KiB
Ruby
require 'package'
|
|
|
|
class Giflib < Package
|
|
description 'giflib is a library for reading and writing gif images.'
|
|
homepage 'http://giflib.sourceforge.net/'
|
|
version '5.2.1'
|
|
license 'MIT'
|
|
compatibility 'all'
|
|
source_url 'https://downloads.sourceforge.net/project/giflib/giflib-5.2.1.tar.gz'
|
|
source_sha256 '31da5562f44c5f15d63340a09a4fd62b48c45620cd302f77a6d9acf0077879bd'
|
|
|
|
binary_url({
|
|
aarch64: 'https://gitlab.com/api/v4/projects/26210301/packages/generic/giflib/5.2.1_armv7l/giflib-5.2.1-chromeos-armv7l.tar.zst',
|
|
armv7l: 'https://gitlab.com/api/v4/projects/26210301/packages/generic/giflib/5.2.1_armv7l/giflib-5.2.1-chromeos-armv7l.tar.zst',
|
|
i686: 'https://gitlab.com/api/v4/projects/26210301/packages/generic/giflib/5.2.1_i686/giflib-5.2.1-chromeos-i686.tar.zst',
|
|
x86_64: 'https://gitlab.com/api/v4/projects/26210301/packages/generic/giflib/5.2.1_x86_64/giflib-5.2.1-chromeos-x86_64.tar.zst'
|
|
})
|
|
binary_sha256({
|
|
aarch64: '727b6d1cdbcbc59a90d2b759faeaddf29a957bc4670e088683f5f867caf04593',
|
|
armv7l: '727b6d1cdbcbc59a90d2b759faeaddf29a957bc4670e088683f5f867caf04593',
|
|
i686: 'cc0a7353ec3c691b37e33512f25bd7b5d0d20a57dcc5d516162c3a66b6905c4e',
|
|
x86_64: '06bb0ff65e3562c7779671eaa4a0fbd45ae51e01e46e4b4ced6e89df05b6abbf'
|
|
})
|
|
|
|
depends_on 'glibc' # R
|
|
|
|
def self.build
|
|
# No configure script in the source.
|
|
system 'make', "PREFIX=#{CREW_PREFIX}", "LIBDIR=#{CREW_LIB_PREFIX}"
|
|
end
|
|
|
|
def self.check
|
|
system 'make', 'check'
|
|
end
|
|
|
|
def self.install
|
|
system 'make', "DESTDIR=#{CREW_DEST_DIR}", "PREFIX=#{CREW_PREFIX}", "LIBDIR=#{CREW_LIB_PREFIX}", 'install'
|
|
@libname = name.to_s.start_with?('lib') ? name.downcase : "lib#{name.gsub('lib', '').downcase}"
|
|
@libnames = Dir["#{CREW_DEST_LIB_PREFIX}/#{@libname}.so*"]
|
|
@libnames = Dir["#{CREW_DEST_LIB_PREFIX}/#{@libname}-*.so*"] if @libnames.empty?
|
|
@libnames.each do |s|
|
|
s.gsub!("#{CREW_DEST_LIB_PREFIX}/", '')
|
|
end
|
|
@dlname = @libnames.grep(/.so./).first
|
|
@libname = @dlname.gsub(/.so.\d+/, '')
|
|
@longest_libname = @libnames.max_by(&:length)
|
|
@libvars = @longest_libname.rpartition('.so.')[2].split('.')
|
|
@libtool_file = <<~LIBTOOLEOF
|
|
# #{@libname}.la - a libtool library file
|
|
# Generated by libtool (GNU libtool) (Created by Chromebrew)
|
|
#
|
|
# Please DO NOT delete this file!
|
|
# It is necessary for linking the library.
|
|
|
|
# The name that we can dlopen(3).
|
|
dlname='#{@dlname}'
|
|
|
|
# Names of this library.
|
|
library_names='#{@libnames.reverse.join(' ')}'
|
|
|
|
# The name of the static archive.
|
|
old_library='#{@libname}.a'
|
|
|
|
# Linker flags that cannot go in dependency_libs.
|
|
inherited_linker_flags=''
|
|
|
|
# Libraries that this one depends upon.
|
|
dependency_libs=''
|
|
|
|
# Names of additional weak libraries provided by this library
|
|
weak_library_names=''
|
|
|
|
# Version information for #{name}.
|
|
current=#{@libvars[1]}
|
|
age=#{@libvars[1]}
|
|
revision=#{@libvars[2]}
|
|
|
|
# Is this an already installed library?
|
|
installed=yes
|
|
|
|
# Should we warn about portability when linking against -modules?
|
|
shouldnotlink=no
|
|
|
|
# Files to dlopen/dlpreopen
|
|
dlopen=''
|
|
dlpreopen=''
|
|
|
|
# Directory that this library needs to be installed in:
|
|
libdir='#{CREW_LIB_PREFIX}'
|
|
LIBTOOLEOF
|
|
File.write("#{CREW_DEST_LIB_PREFIX}/#{@libname}.la", @libtool_file)
|
|
end
|
|
end
|