Skip to content

Commit

Permalink
Update librsvg to version 2.59.0
Browse files Browse the repository at this point in the history
  • Loading branch information
danyeaw committed Sep 18, 2024
1 parent 4b7b6b9 commit dac305c
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 23 deletions.
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.0",
repository="https://gitlab.gnome.org/GNOME/librsvg",
archive_url="https://download.gnome.org/sources/librsvg/{major}.{minor}/librsvg-{version}.tar.xz",
hash="49f29a0a92f4c2d19a2cb41e96ab2fce7eb5bde41850c8a914fcf655e3110944",
hash="370d6ada5cf0de91ceb70d849ed069523ce5de2b33b4c7e86bc640673ad65483",
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

0 comments on commit dac305c

Please sign in to comment.