Skip to content

Commit b99ae87

Browse files
danyeawpbor
authored andcommitted
Update librsvg to version 2.59.1
1 parent 5178660 commit b99ae87

File tree

2 files changed

+66
-23
lines changed

2 files changed

+66
-23
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
diff --git a/meson/query-rustc.py b/meson/query-rustc.py
2+
index 2b169b1fc5ad7dff2dfec1d62214ee4cb1fce0de..f97cb692d1a080a730be8953c60e52ffc9a71b91 100755
3+
--- a/meson/query-rustc.py
4+
+++ b/meson/query-rustc.py
5+
@@ -64,7 +64,6 @@ def retrive_version_info(output, query):
6+
7+
if __name__ == "__main__":
8+
args = parser.parse_args()
9+
- dummy_out = tempfile.NamedTemporaryFile()
10+
query = args.query
11+
query_arg = None
12+
rustc_cmd = [Path(args.RUSTC).as_posix()]
13+
@@ -85,17 +84,23 @@ if __name__ == "__main__":
14+
if args.target:
15+
rustc_cmd.extend(['--target', args.target])
16+
17+
- # We need these for '--print=native-static-libs' on Windows
18+
- if query == 'native-static-libs':
19+
- rustc_cmd.extend(['--crate-type', 'staticlib'])
20+
- rustc_cmd.append(os.devnull)
21+
- rustc_cmd.extend(['-o', dummy_out.name])
22+
+ fd, dummy_out = tempfile.mkstemp()
23+
+ os.close(fd)
24+
+ try:
25+
+ # We need these for '--print=native-static-libs' on Windows
26+
+ if query == 'native-static-libs':
27+
+ rustc_cmd.extend(['--crate-type', 'staticlib'])
28+
+ rustc_cmd.append(os.devnull)
29+
+ rustc_cmd.extend(['-o', dummy_out])
30+
+
31+
+ query_results = subprocess.run(
32+
+ rustc_cmd,
33+
+ capture_output=True,
34+
+ text=True,
35+
+ )
36+
+ finally:
37+
+ os.unlink(dummy_out)
38+
39+
- query_results = subprocess.run(
40+
- rustc_cmd,
41+
- capture_output=True,
42+
- text=True,
43+
- )
44+
if query == 'native-static-libs':
45+
retrieve_native_static_libs_from_output(query_results.stderr)
46+
elif query == 'default-host-toolchain' or query == 'stable-actual-version':

gvsbuild/projects/librsvg.py

Lines changed: 20 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,22 @@
1212
#
1313
# You should have received a copy of the GNU General Public License
1414
# along with this program; if not, see <http://www.gnu.org/licenses/>.
15-
import sys
1615

16+
from gvsbuild.utils.base_builders import Meson
1717
from gvsbuild.utils.base_expanders import Tarball
1818
from gvsbuild.utils.base_project import Project, project_add
1919

2020

2121
@project_add
22-
class Librsvg(Tarball, Project):
22+
class Librsvg(Tarball, Meson):
2323
def __init__(self):
2424
Project.__init__(
2525
self,
2626
"librsvg",
27-
version="2.58.3",
27+
version="2.59.1",
2828
repository="https://gitlab.gnome.org/GNOME/librsvg",
2929
archive_url="https://download.gnome.org/sources/librsvg/{major}.{minor}/librsvg-{version}.tar.xz",
30-
hash="49f29a0a92f4c2d19a2cb41e96ab2fce7eb5bde41850c8a914fcf655e3110944",
30+
hash="6116267c7ddabfd4daaf1c341326da0a773139a7223e885ae40ee09bd6986ef6",
3131
dependencies=[
3232
"cargo",
3333
"cairo",
@@ -36,29 +36,26 @@ def __init__(self):
3636
"libxml2",
3737
"freetype",
3838
],
39-
patches=[],
39+
patches=[
40+
# https://gitlab.gnome.org/GNOME/librsvg/-/merge_requests/1040
41+
"001-fix-failed-to-rename-query-rust.patch",
42+
],
4043
)
41-
if Project.opts.enable_gi:
42-
self.add_dependency("gobject-introspection")
43-
44-
def build(self):
45-
self.builder.mod_env("INCLUDE", "include\\cairo", add_gtk=True)
4644

47-
b_dir = f"{self.builder.working_dir}\\{self.name}\\win32"
48-
49-
config = self.builder.opts.configuration
50-
gtk_dir = self.builder.gtk_dir
51-
rust_ver = Project.get_project("cargo").version
52-
python = sys.executable
53-
cmd = f'nmake -f makefile.vc CFG={config} "PREFIX={gtk_dir}" CARGO=cargo RUSTUP=rustup "PYTHON={python}" TOOLCHAIN_VERSION={rust_ver} install'
54-
55-
if Project.opts.enable_gi:
56-
cmd += " INTROSPECTION=1"
45+
if self.opts.enable_gi:
46+
self.add_dependency("gobject-introspection")
47+
enable_gi = "enabled"
48+
else:
49+
enable_gi = "disabled"
5750

58-
self.push_location(b_dir)
59-
self.exec_vs(cmd)
60-
self.pop_location()
51+
self.add_param(f"-Dintrospection={enable_gi}")
52+
self.add_param("-Ddocs=disabled")
53+
self.add_param("-Dtests=false")
54+
self.add_param("-Dvala=disabled")
6155

56+
def build(self):
57+
self.builder.exec_cargo("install cargo-c --locked")
58+
Meson.build(self)
6259
self.install(r".\COPYING.LIB share\doc\librsvg")
6360

6461
def post_install(self):

0 commit comments

Comments
 (0)