Files
chromebrew/packages/libmaxminddb.rb
Maximilian Downey Twiss f6dc1d8d4e Derive binary_url in package.rb (#7082)
* Add binary_compression value to each package

* Remove binary_url values and arrays

* Handle packages with empty binary_sha256 arrays (either missing binaries or not compiled by us)
2024-01-25 11:03:31 -05:00

42 lines
1.3 KiB
Ruby

# Adapted from Arch Linux libmaxminddb PKGBUILD at:
# https://github.com/archlinux/svntogit-community/raw/packages/libmaxminddb/trunk/PKGBUILD
require 'package'
class Libmaxminddb < Package
description 'MaxMind GeoIP2 database - split package with library and utilities'
homepage 'https://dev.maxmind.com/geoip/geoip2/downloadable/'
version '1.6.0'
license 'Apache-2.0'
compatibility 'all'
source_url 'https://github.com/maxmind/libmaxminddb.git'
git_hashtag version
binary_compression 'tpxz'
binary_sha256({
aarch64: 'dd5d36efff43193b39e867aafa2d8dc62952dff8e4deb899bc39e118279a4ee7',
armv7l: 'dd5d36efff43193b39e867aafa2d8dc62952dff8e4deb899bc39e118279a4ee7',
i686: '86c9e0b36eac6fcf3aa8f2148e48820b6aac60cb0557ef2bee96fae026cc6316',
x86_64: 'dde95291d323c066507792a3709e56faf4850341303a5b9e2cd0cf4da080bc17'
})
def self.patch
system "sed -i '/set(CMAKE_C_EXTENSIONS OFF)/a include(GNUInstallDirs)' CMakeLists.txt"
system "sed -i 's,DESTINATION lib,DESTINATION \${CMAKE_INSTALL_LIBDIR},g' CMakeLists.txt"
end
def self.build
FileUtils.mkdir('builddir')
Dir.chdir('builddir') do
system "cmake #{CREW_CMAKE_OPTIONS} \
-DBUILD_SHARED_LIBS=ON \
../ -G Ninja"
end
system 'samu -C builddir'
end
def self.install
system "DESTDIR=#{CREW_DEST_DIR} samu -C builddir install"
end
end