Skip to content

Commit

Permalink
fix: build libarchive 3.6.2 on ubuntu-20.04 to ensure compatibility w…
Browse files Browse the repository at this point in the history
…ith GLIBC 2.31+
  • Loading branch information
maxirmx committed Dec 21, 2024
1 parent 0f508bf commit b5698bb
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 24 deletions.
19 changes: 6 additions & 13 deletions .github/workflows/test-and-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -135,15 +135,15 @@ jobs:
include:
- env: { os: windows-latest, platform: x64-mingw-ucrt }
ruby: '3.3'
experimental: true
- env: { os: windows-latest, platform: x64-mingw-ucrt }
ruby: '3.1'
experimental: true
steps:
- uses: actions/checkout@v4
with:
repository: metanorma/metanorma

- uses: metanorma/metanorma-build-scripts/inkscape-setup-action@main

- uses: actions/download-artifact@v4
with:
path: pkg
Expand All @@ -156,23 +156,16 @@ jobs:
mv pkg/ffi-libarchive-binary-*-${{ matrix.env.platform }} pkg/ffi-libarchive-binary
echo "gem 'ffi-libarchive-binary', path: 'pkg/ffi-libarchive-binary'" > Gemfile.devel
# https://github.com/rubygems/rubygems/issues/5160
- if: matrix.ruby == '3.0'
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
bundler: ${{ env.BUNDLER_VER }}
rubygems: latest

- if: matrix.ruby != '3.0'
uses: ruby/setup-ruby@v1
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler: ${{ env.BUNDLER_VER }}
bundler-cache: true

- uses: metanorma/metanorma-build-scripts/inkscape-setup-action@main

- run: bundle exec rake
continue-on-error: ${{ matrix.experimental }}

# ----- Release -----
release:
Expand Down
2 changes: 1 addition & 1 deletion README.adoc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
= Binaries for ffi-libarchive

image:https://img.shields.io/gem/v/ffi-libarchive-binary.svg["Gem Version", link="https://rubygems.org/gems/ffi-libarchive-binary"]
image:https://github.com/fontist/ffi-libarchive-binary/actions/workflows/rspec.yml/badge.svg["Build Status", link="https://github.com/fontist/ffi-libarchive-binary/actions/workflows/rspec.yml"]
image:https://github.com/fontist/ffi-libarchive-binary/actions/workflows/test-and-release.yml/badge.svg["Build Status", link="https://github.com/fontist/ffi-libarchive-binary/actions/workflows/test-and-release.yml"]

== Purpose

Expand Down
20 changes: 14 additions & 6 deletions lib/ffi-libarchive-binary/libarchive_recipe.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,22 @@
module LibarchiveBinary
class LibarchiveRecipe < MiniPortileCMake
ROOT = Pathname.new(File.expand_path("../..", __dir__))

#
# libarchive 3.7.x uses new GLIBC packaging ( links to libc only and not to pthread, dl, ...)
# this does not link work on Ubuntu 20 with GLIBC 3.21
#
# Cannot build 3.7.x on Ubuntu 22 either because it creates a reference to GLIB 3.22 (min) that does
# not resolve on Ubuntu 20
#
# So without patching we are stick to 3.6.2 until Ubuntu 20 shall be supported
#
def initialize
super("libarchive", "3.7.4")
super("libarchive", "3.6.2")
@printed = {}

@files << {
url: "https://www.libarchive.org/downloads/libarchive-3.7.4.tar.gz",
sha256: "7875d49596286055b52439ed42f044bd8ad426aa4cc5aabd96bfe7abb971d5e8",
url: "https://www.libarchive.org/downloads/libarchive-3.6.2.tar.gz",
sha256: "ba6d02f15ba04aba9c23fd5f236bb234eab9d5209e95d1c4df85c44d5f19b9b3",
}

@target = ROOT.join(@target).to_s
Expand All @@ -40,12 +48,12 @@ def generator_flags

def default_flags
[
"-DENABLE_OPENSSL:BOOL=ON", "-DENABLE_LIBB2:BOOL=OFF", "-DENABLE_LZ4:BOOL=OFF",
"-DENABLE_OPENSSL:BOOL=ON", "-DENABLE_LIBB2:BOOL=OFF", "-DENABLE_LZ4:BOOL=OFF",
"-DENABLE_LZO::BOOL=OFF", "-DENABLE_LZMA:BOOL=ON", "-DENABLE_ZSTD:BOOL=OFF",
"-DENABLE_ZLIB::BOOL=ON", "-DENABLE_BZip2:BOOL=OFF", "-DENABLE_LIBXML2:BOOL=OFF",
"-DENABLE_EXPAT::BOOL=ON", "-DENABLE_TAR:BOOL=OFF", "-DENABLE_ICONV::BOOL=OFF",
"-DENABLE_CPIO::BOOL=OFF", "-DENABLE_CAT:BOOL=OFF", "-DENABLE_ACL:BOOL=OFF",
"-DENABLE_TEST:BOOL=OFF",
"-DENABLE_TEST:BOOL=OFF", "-DENABLE_UNZIP:BOOL=OFF",
"-DCMAKE_INCLUDE_PATH=#{include_path}",
"-DCMAKE_LIBRARY_PATH=#{library_path}"
]
Expand Down
6 changes: 3 additions & 3 deletions lib/ffi-libarchive-binary/openssl_recipe.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ class OpensslRecipe < BaseRecipe
ROOT = Pathname.new(File.expand_path("../..", __dir__))

def initialize
super("openssl", "1.1.1w")
super("openssl", "1.1.1n")

@files << {
url: "https://github.com/openssl/openssl/releases/download/OpenSSL_1_1_1w/openssl-1.1.1w.tar.gz",
sha256: "cf3098950cb4d853ad95c0841f1f9c6d3dc102dccfcacd521d93925208b76ac8",
url: "https://www.openssl.org/source/openssl-1.1.1n.tar.gz",
sha256: "40dceb51a4f6a5275bde0e6bf20ef4b91bfc32ed57c0552e2e8e15463372b17a",
}

@target = ROOT.join(@target).to_s
Expand Down
2 changes: 1 addition & 1 deletion lib/ffi-libarchive-binary/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module LibarchiveBinary
VERSION = "0.3.1"
VERSION = "0.3.2"
end

0 comments on commit b5698bb

Please sign in to comment.