Files
chromebrew/packages/gdb.rb
2022-10-05 20:16:53 -05:00

79 lines
2.8 KiB
Ruby

# Adapted from Arch Linux gdb PKGBUILD at:
# https://github.com/archlinux/svntogit-packages/raw/packages/gdb/trunk/PKGBUILD
require 'package'
class Gdb < Package
description 'The GNU Debugger'
homepage 'https://www.gnu.org/software/gdb/'
version '11.2'
license 'GPL3'
compatibility 'all'
source_url 'https://ftp.gnu.org/gnu/gdb/gdb-11.2.tar.xz'
source_sha256 '1497c36a71881b8671a9a84a0ee40faab788ca30d7ba19d8463c3cc787152e32'
binary_url({
aarch64: 'https://gitlab.com/api/v4/projects/26210301/packages/generic/gdb/11.2_armv7l/gdb-11.2-chromeos-armv7l.tpxz',
armv7l: 'https://gitlab.com/api/v4/projects/26210301/packages/generic/gdb/11.2_armv7l/gdb-11.2-chromeos-armv7l.tpxz',
i686: 'https://gitlab.com/api/v4/projects/26210301/packages/generic/gdb/11.2_i686/gdb-11.2-chromeos-i686.tpxz',
x86_64: 'https://gitlab.com/api/v4/projects/26210301/packages/generic/gdb/11.2_x86_64/gdb-11.2-chromeos-x86_64.tpxz'
})
binary_sha256({
aarch64: 'bf7bd97110ed30b47bc700f70dd8d1624bb22ba95e7e7a28899aa39bc1a9c188',
armv7l: 'bf7bd97110ed30b47bc700f70dd8d1624bb22ba95e7e7a28899aa39bc1a9c188',
i686: '788f7fc7eab81ba4b662465dcd4ee597b85d6fb62aa4c2b2abd3bb493db02a9f',
x86_64: 'a331fad82a11e38f0387831b301621c98e3cdd8e7d2ecf55254f1bc67e1418e9'
})
depends_on 'mpfr' # R
depends_on 'gmp' # R
depends_on 'source_highlight' # R
depends_on 'boost' # R
def self.build
FileUtils.mkdir_p 'build'
Dir.chdir('build') do
system "CPPFLAGS='-I#{CREW_PREFIX}/include/ncursesw -lncursesw' \
../configure \
#{CREW_OPTIONS} \
--disable-nls \
--enable-64-bit-bfd \
--enable-host-shared \
--enable-lto \
--enable-shared \
--enable-sim \
--enable-source-highlight \
--enable-tui \
--with-curses \
--with-lzma \
--with-pkgversion=Chromebrew \
--with-python=python3 \
--with-system-gdbinit=#{CREW_PREFIX}/etc/gdb/gdbinit \
--with-system-readline \
--with-system-zlib \
--with-x"
system 'make'
end
end
def self.install
Dir.chdir('build') do
system "make -C gdb DESTDIR=#{CREW_DEST_DIR} install"
system "make -C gdbserver DESTDIR=#{CREW_DEST_DIR} install"
end
# Remove files conflicting with binutils
FileUtils.rm_f "#{CREW_DEST_PREFIX}/share/info/bfd.info"
conflict_packages = %w[binutils]
conflict_packages.each do |package|
file = File.read("#{CREW_META_PATH}#{package}.filelist")
file.each_line do |line|
if File.exist?("#{CREW_DEST_DIR}#{line}")
FileUtils.rm_f "#{CREW_DEST_DIR}#{line}"
puts "Removed #{CREW_DEST_DIR}#{line}"
end
end
end
FileUtils.rm_f "#{CREW_DEST_LIB_PREFIX}/libinproctrace.so"
end
end