unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Jean Pierre De Jesus DIAZ via Guix-patches via <guix-patches@gnu.org>
To: "57043@debbugs.gnu.org" <57043@debbugs.gnu.org>
Subject: [bug#57043] [PATCH] gnu: rust-freetype-sys-0.13: Unbundle freetype2.
Date: Mon, 08 Aug 2022 14:37:00 +0000	[thread overview]
Message-ID: <IVg0RBBB75esVQ62YwfXdBTMYRgTsRGyHzqJi73VVUMcNILlr2dh1ViKMdLRGvMFzsNVPUXwLfr_hY3cyWb0UlRlCQs6ipd3Qk0G-OqyS0M=@jeandudey.tech> (raw)
In-Reply-To: <HGgZmDLEAonfFN-y6zfOKMo8NKy1RXvOfRvKz_NhjsFPW6NMdGToBoJpBnJ5Rh8b6eRsJjw7UpVAxlhZeJww-6VXMmYswdYS2QXvB1fdEBE=@jeandudey.tech>

[-- Attachment #1: Type: text/plain, Size: 1330 bytes --]

>Anyway, this can be done more simple -- all that I needed to do was
>deleting the freetype2 subdirectory (in a snippet) and adding 'freetype'
>to inputs.  Patching the build script or build.rs was not necessary.

Thought that the pkg-config `if' block was for Android only, my mistake.

Probably influenced by the compilation error caused by not building
without the freetype2 directory, because `pkg-config' was not present.

>Additionally, I noticed that in the modified build.rs, only
>rustc-link-lib (-l) is set, but not rustc-link-search (-L).

>Antioxidant needs the latter to be set, otherwise dependents will fail
>to link because of not finding the freetype library.

This reminds me of also fixing `rust-bzip2-sys-0.1' in the future because
it also doesn't specify the linker search path because the default build
script was removed like I did in this case.

See:

https://github.com/alexcrichton/bzip2-rs/blob/bzip2-sys-0.1.9/bzip2-sys/build.rs#L12-L23

I don't know our stance on this though, or if there's a policy that
mandates removing compilation support for bundled code or to leave it as
is as long as the code compiles. I'd leave it as it though to make
maintenance easier and less modifications to the original source code.

Thanks for the review!

—
Jean-Pierre De Jesus DIAZ

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-rust-freetype-sys-0.13-Unbundle-freetype2.patch --]
[-- Type: text/x-patch; name=0001-gnu-rust-freetype-sys-0.13-Unbundle-freetype2.patch, Size: 1977 bytes --]

From a3487eae2c5b7a507929816e60206878c1d2fc0e Mon Sep 17 00:00:00 2001
From: Jean-Pierre De Jesus DIAZ <me@jeandudey.tech>
Date: Mon, 8 Aug 2022 16:33:16 +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.
  [arguments]: Remove `#:skip-build? #t'.
  [native-inputs]: Add pkg-config.
  [inputs]: Add freetype.
---
 gnu/packages/crates-io.scm | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/crates-io.scm b/gnu/packages/crates-io.scm
index cfafce9aa3..b5d4dc7c61 100644
--- a/gnu/packages/crates-io.scm
+++ b/gnu/packages/crates-io.scm
@@ -27,6 +27,7 @@
 ;;; Copyright © 2022 Aleksandr Vityazev <avityazev@posteo.org>
 ;;; Copyright © 2022 Marius Bakke <marius@gnu.org>
 ;;; Copyright © 2022 Evgenii Lepikhin <e.lepikhin@corp.mail.ru>
+;;; Copyright © 2022 Jean-Pierre De Jesus DIAZ <me@jeandudey.tech>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -22904,14 +22905,20 @@ (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"))
+       (modules '((guix build utils)))
+       (snippet
+         '(delete-file-recursively "freetype2"))))
     (build-system cargo-build-system)
     (arguments
-     `(#:skip-build? #t
-       #:cargo-inputs
+     `(#:cargo-inputs
        (("rust-cmake" ,rust-cmake-0.1)
         ("rust-libc" ,rust-libc-0.2)
         ("rust-pkg-config" ,rust-pkg-config-0.3))))
+    (native-inputs
+      (list pkg-config))
+    (inputs
+      (list freetype))
     (home-page "https://github.com/PistonDevelopers/freetype-sys")
     (synopsis "Low level binding for FreeType font library")
     (description
-- 
2.36.1


      parent reply	other threads:[~2022-08-08 14:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-07 18:39 [bug#57043] [PATCH] gnu: rust-freetype-sys-0.13: Unbundle freetype2 Jean Pierre De Jesus DIAZ via Guix-patches via
2022-08-07 21:59 ` Maxime Devos
2022-08-08 14:37 ` Jean Pierre De Jesus DIAZ via Guix-patches via [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='IVg0RBBB75esVQ62YwfXdBTMYRgTsRGyHzqJi73VVUMcNILlr2dh1ViKMdLRGvMFzsNVPUXwLfr_hY3cyWb0UlRlCQs6ipd3Qk0G-OqyS0M=@jeandudey.tech' \
    --to=guix-patches@gnu.org \
    --cc=57043@debbugs.gnu.org \
    --cc=me@jeandudey.tech \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).