diff --git a/mingw-w64-librsvg/0006-fix-build-win32.patch b/mingw-w64-librsvg/0006-fix-build-win32.patch new file mode 100644 index 0000000000..d624b728de --- /dev/null +++ b/mingw-w64-librsvg/0006-fix-build-win32.patch @@ -0,0 +1,145 @@ +diff --git a/Makefile.am b/Makefile.am +index 23341928fa87bf8ac916051fabd8d1ca028465fa..a04828c935bc51b84b62ff31a0041e4e22883ce0 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -119,7 +119,6 @@ LIBRSVG_CRATE_SRC = \ + + LIBRSVG_C_API_SRC = \ + librsvg/Cargo.toml \ +- librsvg/build.rs \ + librsvg/c_api.rs \ + librsvg/lib.rs \ + librsvg/pixbuf_utils.rs \ +@@ -152,22 +151,22 @@ cargo_verbose_1 = --verbose + + LIBRSVG_BUILD_DIR=@abs_top_builddir@ + CARGO_TARGET_DIR=$(LIBRSVG_BUILD_DIR)/target +-LIBRSVG_TARGET_DIR=$(CARGO_TARGET_DIR)/$(RUST_TARGET_SUBDIR) + +-RUST_LIB=$(LIBRSVG_BUILD_DIR)/.libs/librsvg_c_api.a ++if PLATFORM_WIN32 ++# https://github.com/rust-lang/rust/issues/43749 ++RUST_LIB=$(CARGO_TARGET_DIR)/$(RUST_TARGET_SUBDIR)/rsvg_c_api.lib ++else ++RUST_LIB=$(CARGO_TARGET_DIR)/$(RUST_TARGET_SUBDIR)/librsvg_c_api.a ++endif + + check-local: + cd $(srcdir) && \ + CARGO_TARGET_DIR=$(CARGO_TARGET_DIR) \ +- LIBRSVG_BUILD_DIR=$(LIBRSVG_BUILD_DIR) \ +- LIBRSVG_TARGET_DIR=$(LIBRSVG_TARGET_DIR) \ + $(CARGO) --locked test $(CARGO_VERBOSE) $(CARGO_TARGET_ARGS) $(CARGO_RELEASE_ARGS) + + clean-local: + cd $(top_srcdir) && \ + CARGO_TARGET_DIR=$(CARGO_TARGET_DIR) \ +- LIBRSVG_BUILD_DIR=$(LIBRSVG_BUILD_DIR) \ +- LIBRSVG_TARGET_DIR=$(LIBRSVG_TARGET_DIR) \ + $(CARGO) clean + + distcheck-hook: +@@ -188,12 +187,11 @@ librsvg_c_api.la: $(LIBRSVG_INTERNALS_SRC) $(LIBRSVG_C_API_SRC) + PKG_CONFIG_ALLOW_CROSS=1 \ + PKG_CONFIG='$(PKG_CONFIG)' \ + CARGO_TARGET_DIR=$(CARGO_TARGET_DIR) \ +- LIBRSVG_BUILD_DIR=$(LIBRSVG_BUILD_DIR) \ +- LIBRSVG_TARGET_DIR=$(LIBRSVG_TARGET_DIR) \ + $(CARGO) --locked build $(CARGO_VERBOSE) $(CARGO_TARGET_ARGS) $(CARGO_RELEASE_ARGS) \ +- && if [[ $$($(NM) -g $(RUST_LIB) | grep "T __clzsi2" -c) -gt 1 ]] ; then \ ++ && if [[ $$($(NM) -g $(RUST_LIB) | grep "T __*clzsi2" -c) -gt 1 ]] ; then \ + $(AR) d $(RUST_LIB) clzsi2.o; \ +- fi ++ fi \ ++ && cd $(LIBRSVG_BUILD_DIR) && $(LINK) && mv $(RUST_LIB) .libs/librsvg_c_api.a + + librsvg_@RSVG_API_MAJOR_VERSION@_la_CPPFLAGS = \ + -I$(top_srcdir) \ +diff --git a/librsvg/Cargo.toml b/librsvg/Cargo.toml +index ce31aea89008db44c5aff427c2dc31f49c2165b4..55ae41e8e5d00f189e6fbab081d536f5234585b9 100644 +--- a/librsvg/Cargo.toml ++++ b/librsvg/Cargo.toml +@@ -3,7 +3,6 @@ name = "librsvg_c_api" + version = "0.0.1" + authors = ["Federico Mena Quintero "] + workspace = "../" +-build = "build.rs" + edition = "2018" + + [lib] +diff --git a/librsvg/build.rs b/librsvg/build.rs +deleted file mode 100644 +index cd1aa9f375fd08f98689716d76e49a48d456fd3c..0000000000000000000000000000000000000000 +--- a/librsvg/build.rs ++++ /dev/null +@@ -1,70 +0,0 @@ +-use std::env; +-use std::fs::File; +-use std::io::prelude::*; +- +-#[cfg(unix)] +-use std::os::unix::fs::symlink; +- +-#[cfg(all(windows, not(target_env = "msvc")))] +-use std::os::windows::fs::symlink_file as symlink; +- +-#[cfg(not(target_env = "msvc"))] +-use std::fs; +-#[cfg(not(target_env = "msvc"))] +-use std::path::PathBuf; +- +-fn main() { +- generate_convenience_lib().unwrap(); +-} +- +-/// Generate libtool archive file librsvg_c_api.la +-/// From: https://docs.rs/libtool/0.1.1/libtool/ +-#[cfg(not(target_env = "msvc"))] +-pub fn generate_convenience_lib() -> std::io::Result<()> { +- let target = env::var("TARGET").expect("TARGET was not set"); +- let build_dir = env::var("LIBRSVG_BUILD_DIR").expect("LIBRSVG_BUILD_DIR was not set"); +- let target_dir = env::var("LIBRSVG_TARGET_DIR").expect("LIBRSVG_TARGET_DIR was not set"); +- let libs_dir = format!("{}/.libs", build_dir); +- let libs_path = PathBuf::from(&libs_dir); +- let la_path = PathBuf::from(format!("{}/librsvg_c_api.la", build_dir)); +- let rust_lib = if target.contains("windows") { +- /* https://github.com/rust-lang/rust/issues/43749 */ +- "rsvg_c_api.lib" +- } else { +- "librsvg_c_api.a" +- }; +- let old_lib_path = PathBuf::from(format!("{}/{}", target_dir, rust_lib)); +- let new_lib_path = PathBuf::from(format!("{}/librsvg_c_api.a", libs_dir)); +- +- match fs::create_dir_all(&libs_path) { +- Ok(()) => println!("libs_path created"), +- _ => panic!("Failed to create libs_path"), +- } +- +- if la_path.exists() { +- fs::remove_file(&la_path)?; +- } +- +- /* PathBuf.exists() traverses symlinks so just try and remove it */ +- match fs::remove_file(&new_lib_path) { +- Ok(_v) => {}, +- Err(e) => println!("Error removing symlink: {:?}", e), +- } +- +- let mut file = File::create(&la_path).unwrap(); +- writeln!(file, "# librsvg_c_api.la - a libtool library file")?; +- writeln!(file, "# Generated by libtool-rust")?; +- writeln!(file, "dlname=''")?; +- writeln!(file, "library_names=''")?; +- writeln!(file, "old_library='librsvg_c_api.a'")?; +- writeln!(file, "inherited_linker_flags=''")?; +- writeln!(file, "installed=no")?; +- writeln!(file, "shouldnotlink=no")?; +- symlink(&old_lib_path, &new_lib_path)?; +- Ok(()) +-} +- +-#[cfg(target_env = "msvc")] +-pub fn generate_convenience_lib() -> std::io::Result<()> { +- Ok(()) +-} diff --git a/mingw-w64-librsvg/PKGBUILD b/mingw-w64-librsvg/PKGBUILD index 3a5404cf3f..03fcd163bd 100644 --- a/mingw-w64-librsvg/PKGBUILD +++ b/mingw-w64-librsvg/PKGBUILD @@ -3,7 +3,7 @@ _realname=librsvg pkgbase=mingw-w64-${_realname} pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}" -pkgver=2.46.0 +pkgver=2.46.2 pkgrel=1 pkgdesc="SVG rendering library (mingw-w64)" arch=('any') @@ -22,13 +22,16 @@ depends=("${MINGW_PACKAGE_PREFIX}-gdk-pixbuf2" optdepends=("${MINGW_PACKAGE_PREFIX}-gtk3: for rsvg-view-3") options=('staticlibs' 'strip') source=("https://download.gnome.org/sources/librsvg/${pkgver%.*}/${_realname}-${pkgver}.tar.xz" - "0005-hack-unixy-paths.patch") -sha256sums=('96c81e52cb81450f3b2e915e6409fd7d1e3c01e4661974b3a98c09a7c45743d1' - 'b23b094c0cb65fcbbbb952350448de6f3430b30f273e05acdbf7a56d634212dc') + "0005-hack-unixy-paths.patch" + "0006-fix-build-win32.patch") +sha256sums=('379ec0bbf9ce249c2bc03f4a124d8f532abe0916d908c5cf26821e5af1668197' + 'b23b094c0cb65fcbbbb952350448de6f3430b30f273e05acdbf7a56d634212dc' + 'fe88c66fcc26bcfbae124ddafb3ad0ac208cd69e682397b3897c500ea5ffdaef') prepare() { cd "${srcdir}/${_realname}-${pkgver}" patch -p1 -i "${srcdir}/0005-hack-unixy-paths.patch" + patch -p1 -i "${srcdir}/0006-fix-build-win32.patch" autoreconf -fiv }