From patchwork Sun Aug 7 18:39:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jean Pierre De Jesus DIAZ X-Patchwork-Id: 4407 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 8AD5227BBEA; Sun, 7 Aug 2022 19:41:13 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 95F6127BBE9 for ; Sun, 7 Aug 2022 19:41:12 +0100 (BST) Received: from localhost ([::1]:33084 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oKlD5-0007ku-My for patchwork@mira.cbaines.net; Sun, 07 Aug 2022 14:41:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36036) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oKlCw-0007kd-Jk for guix-patches@gnu.org; Sun, 07 Aug 2022 14:41:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:48550) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oKlCw-0002lY-BC for guix-patches@gnu.org; Sun, 07 Aug 2022 14:41:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oKlCw-0003vw-6z for guix-patches@gnu.org; Sun, 07 Aug 2022 14:41:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#57043] [PATCH] gnu: rust-freetype-sys-0.13: Unbundle freetype2. Resent-From: Jean Pierre De Jesus DIAZ Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 07 Aug 2022 18:41:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 57043 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 57043@debbugs.gnu.org X-Debbugs-Original-To: "guix-patches@gnu.org" Received: via spool by submit@debbugs.gnu.org id=B.165989762015053 (code B ref -1); Sun, 07 Aug 2022 18:41:01 +0000 Received: (at submit) by debbugs.gnu.org; 7 Aug 2022 18:40:20 +0000 Received: from localhost ([127.0.0.1]:38299 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oKlCF-0003ug-FN for submit@debbugs.gnu.org; Sun, 07 Aug 2022 14:40:19 -0400 Received: from lists.gnu.org ([209.51.188.17]:48146) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oKlCD-0003uX-Jr for submit@debbugs.gnu.org; Sun, 07 Aug 2022 14:40:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35982) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oKlCD-0007P7-ED for guix-patches@gnu.org; Sun, 07 Aug 2022 14:40:17 -0400 Received: from mail-4323.proton.ch ([185.70.43.23]:33025) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oKlC7-0002OZ-UE for guix-patches@gnu.org; Sun, 07 Aug 2022 14:40:16 -0400 Date: Sun, 07 Aug 2022 18:39:55 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jeandudey.tech; s=protonmail3; t=1659897599; x=1660156799; bh=iM/MJy682E5Mb0ZFmcLodJvDnQ6dTzzT2F1zyyWA6i8=; h=Date:To:From:Reply-To:Subject:Message-ID:Feedback-ID:From:To:Cc: Date:Subject:Reply-To:Feedback-ID:Message-ID; b=U+R9RbITyJ8a3VvVTYeJu6SJHjluEChStX0vzRx0sCYZWs/Ipshzq9Zr+AIZxb004 5ScJOqpDxmgxUTmJuM+u4V4j0rVqq8BerKdNc2IHxAuaIQYnPlxnigW2crbltm++bu o20Qv6eRZPhPBZyaxH3eSG0n4xjOYbnVzsya5DzEjUXLBhgGv5cNrqkSM7obb3tmeA 3/j4iqFHa4IYXc+snmkkuKPFRzoWfzi5LJ1QF9ydC+vAJC9ukN0rQ5m0uk25E5Cz/V uDCoI1agFKAxloomjnU4/jyV/GdlhxfWneBEvvnAh33hrClvZ/e+wUvRPFRkIGueg0 iX/wCBAFZBAfQ== Message-ID: Feedback-ID: 20187791:user:proton MIME-Version: 1.0 Received-SPF: pass client-ip=185.70.43.23; envelope-from=me@jeandudey.tech; helo=mail-4323.proton.ch X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" Reply-to: Jean Pierre De Jesus DIAZ X-ACL-Warn: , Jean Pierre De Jesus DIAZ via Guix-patches X-Patchwork-Original-From: Jean Pierre De Jesus DIAZ via Guix-patches via From: Jean Pierre De Jesus DIAZ X-getmail-retrieved-from-mailbox: Patches Hello, This patch removes the bundled freetype2 library on `rust-freetype-sys-0.13'. Also removes unneeded build dependencies (`pkg-config' and `cmake'). One less bundled dependency ;). — Jean-Pierre De Jesus DIAZ From f6dec2567dc997a32ef308bd42d259ac60dbbab5 Mon Sep 17 00:00:00 2001 From: Jean-Pierre De Jesus DIAZ Date: Sun, 7 Aug 2022 20:36:14 +0200 Subject: [PATCH] gnu: rust-freetype-sys-0.13: Unbundle freetype2. * gnu/packages/crates-io.scm (rust-freetype-sys-0.13) [source]: Remove bundled `freetype2' source code and add patch to use system library. --- gnu/packages/crates-io.scm | 16 +++--- ...ust-freetype-sys-0.13-simplify-build.patch | 53 +++++++++++++++++++ 2 files changed, 63 insertions(+), 6 deletions(-) create mode 100644 gnu/packages/patches/rust-freetype-sys-0.13-simplify-build.patch diff --git a/gnu/packages/crates-io.scm b/gnu/packages/crates-io.scm index cfafce9aa3..cddd8ebaf0 100644 --- a/gnu/packages/crates-io.scm +++ b/gnu/packages/crates-io.scm @@ -27,6 +27,7 @@ ;;; Copyright © 2022 Aleksandr Vityazev ;;; Copyright © 2022 Marius Bakke ;;; Copyright © 2022 Evgenii Lepikhin +;;; Copyright © 2022 Jean-Pierre De Jesus DIAZ ;;; ;;; This file is part of GNU Guix. ;;; @@ -22904,14 +22905,17 @@ (define-public rust-freetype-sys-0.13 (uri (crate-uri "freetype-sys" version)) (file-name (string-append name "-" version ".tar.gz")) (sha256 - (base32 "06kkds31s6b1i39dyanwmzbnic7laia1kk3gfvx8sqncq08l0zd3")))) + (base32 "06kkds31s6b1i39dyanwmzbnic7laia1kk3gfvx8sqncq08l0zd3")) + (patches (search-patches "rust-freetype-sys-0.13-simplify-build.patch")) + (modules '((guix build utils))) + (snippet + '(delete-file-recursively "freetype2")))) (build-system cargo-build-system) (arguments - `(#:skip-build? #t - #:cargo-inputs - (("rust-cmake" ,rust-cmake-0.1) - ("rust-libc" ,rust-libc-0.2) - ("rust-pkg-config" ,rust-pkg-config-0.3)))) + `(#:cargo-inputs + (("rust-libc" ,rust-libc-0.2)))) + (inputs + (list freetype)) (home-page "https://github.com/PistonDevelopers/freetype-sys") (synopsis "Low level binding for FreeType font library") (description diff --git a/gnu/packages/patches/rust-freetype-sys-0.13-simplify-build.patch b/gnu/packages/patches/rust-freetype-sys-0.13-simplify-build.patch new file mode 100644 index 0000000000..bb16f3e065 --- /dev/null +++ b/gnu/packages/patches/rust-freetype-sys-0.13-simplify-build.patch @@ -0,0 +1,53 @@ +Force freetype-sys to use system libraries, this removes the need for CMake. + +The bundled source is still present at the crate package, it should be removed +through a package snippet. + +diff -Naur freetype-sys-0.13.1/Cargo.toml freetype-sys-0.13.1-patch/Cargo.toml > 1.patch +--- freetype-sys-0.13.1/Cargo.toml 2020-07-05 11:15:43.000000000 +0200 ++++ freetype-sys-0.13.1-patch/Cargo.toml 2022-08-07 19:53:57.649678214 +0200 +@@ -24,8 +24,3 @@ + repository = "https://github.com/PistonDevelopers/freetype-sys.git" + [dependencies.libc] + version = "0.2.42" +-[build-dependencies.cmake] +-version = "0.1.42" +- +-[build-dependencies.pkg-config] +-version = "0.3.11" +diff -Naur freetype-sys-0.13.1/build.rs freetype-sys-0.13.1-patch/build.rs > 2.patch +--- freetype-sys-0.13.1/build.rs 2020-05-30 05:59:09.000000000 +0200 ++++ freetype-sys-0.13.1-patch/build.rs 2022-08-07 19:54:34.153503846 +0200 +@@ -1,30 +1,4 @@ +-extern crate cmake; +-extern crate pkg_config; +- +-use cmake::Config; +-use std::env; +- + fn main() { +- let target = env::var("TARGET").unwrap(); +- if !target.contains("android") +- && pkg_config::Config::new().atleast_version("18.5.12").find("freetype2").is_ok() +- { +- return +- } +- +- let mut config = Config::new("freetype2"); +- if let Ok(s) = env::var("FREETYPE_CMAKE_GENERATOR") { +- config.generator(s); +- } +- let dst = config +- .define("WITH_BZip2", "OFF") +- .define("WITH_HarfBuzz", "OFF") +- .define("WITH_PNG", "OFF") +- .define("WITH_ZLIB", "OFF") +- .profile("Release") +- .build(); +- let out_dir = env::var("OUT_DIR").unwrap(); +- println!("cargo:rustc-link-search=native={}/lib", dst.display()); +- println!("cargo:rustc-link-lib=static=freetype"); ++ println!("cargo:rustc-link-lib=freetype"); +- println!("cargo:outdir={}", out_dir); + } ++ -- 2.36.1