Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update librsvg to version 2.59.1 #1440

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 17 additions & 22 deletions gvsbuild/projects/librsvg.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,22 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, see <http://www.gnu.org/licenses/>.
import sys

from gvsbuild.utils.base_builders import Meson
from gvsbuild.utils.base_expanders import Tarball
from gvsbuild.utils.base_project import Project, project_add


@project_add
class Librsvg(Tarball, Project):
class Librsvg(Tarball, Meson):
def __init__(self):
Project.__init__(
self,
"librsvg",
version="2.58.3",
version="2.59.1",
repository="https://gitlab.gnome.org/GNOME/librsvg",
archive_url="https://download.gnome.org/sources/librsvg/{major}.{minor}/librsvg-{version}.tar.xz",
hash="49f29a0a92f4c2d19a2cb41e96ab2fce7eb5bde41850c8a914fcf655e3110944",
hash="6116267c7ddabfd4daaf1c341326da0a773139a7223e885ae40ee09bd6986ef6",
dependencies=[
"cargo",
"cairo",
Expand All @@ -38,27 +38,22 @@ def __init__(self):
],
patches=[],
)
if Project.opts.enable_gi:
self.add_dependency("gobject-introspection")

def build(self):
self.builder.mod_env("INCLUDE", "include\\cairo", add_gtk=True)

b_dir = f"{self.builder.working_dir}\\{self.name}\\win32"

config = self.builder.opts.configuration
gtk_dir = self.builder.gtk_dir
rust_ver = Project.get_project("cargo").version
python = sys.executable
cmd = f'nmake -f makefile.vc CFG={config} "PREFIX={gtk_dir}" CARGO=cargo RUSTUP=rustup "PYTHON={python}" TOOLCHAIN_VERSION={rust_ver} install'

if Project.opts.enable_gi:
cmd += " INTROSPECTION=1"
if self.opts.enable_gi:
self.add_dependency("gobject-introspection")
enable_gi = "enabled"
else:
enable_gi = "disabled"

self.push_location(b_dir)
self.exec_vs(cmd)
self.pop_location()
self.add_param(f"-Dintrospection={enable_gi}")
self.add_param("-Ddocs=disabled")
self.add_param("-Dtests=false")
self.add_param("-Dvala=disabled")

def build(self):
# Install cargo-c version compatible with Cargo 0.77.x
self.builder.exec_cargo("install --force cargo-c --version 0.9.32 --locked")
Meson.build(self)
self.install(r".\COPYING.LIB share\doc\librsvg")

def post_install(self):
Expand Down
4 changes: 3 additions & 1 deletion gvsbuild/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ def __init__(self):
Tool.__init__(
self,
"cargo",
version="1.81.0",
# Linking error with the latest Cargo version and librsvg
# https://gitlab.gnome.org/GNOME/librsvg/-/issues/1107
version="1.77.2",
repository="rust-lang/rust",
archive_url="https://win.rustup.rs/x86_64",
archive_filename="rustup-init.exe",
Expand Down