unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Pierre Langlois <pierre.langlois@gmx.com>
To: 49551@debbugs.gnu.org
Subject: [bug#49551] [PATCH] gnu: mg: Enable cross-compilation.
Date: Tue, 13 Jul 2021 20:51:28 +0100	[thread overview]
Message-ID: <871r82m1q7.fsf@gmx.com> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 330 bytes --]

Hi Guix!

I was trying to revive my pinebook pro over the weekend, and realised we
needed to cross-compile mg in order to get an inital bare-bones image.

OK to apply? I also removed the #t from the phases, hopefully that's OK,
I'm not sure if this sort of transition should be done incrementally or
all at once.

Thanks,
Pierre


[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 519 bytes --]

[-- Attachment #2: 0001-gnu-mg-Enable-cross-compilation.patch --]
[-- Type: text/x-patch, Size: 3068 bytes --]

From 9bf02578c486cd4e65ab5faf30c86f972f05f300 Mon Sep 17 00:00:00 2001
From: Pierre Langlois <pierre.langlois@gmx.com>
Date: Tue, 13 Jul 2021 20:17:51 +0100
Subject: [PATCH] gnu: mg: Enable cross-compilation.

* gnu/packages/text-editors.scm (mg)[arguments]: Use cc-for-target.
Add phase to substitute pkg-config with the target's pkg-config.
---
 gnu/packages/text-editors.scm | 21 +++++++++++++--------
 1 file changed, 13 insertions(+), 8 deletions(-)

diff --git a/gnu/packages/text-editors.scm b/gnu/packages/text-editors.scm
index 965ed6b9e7..11332fab0b 100644
--- a/gnu/packages/text-editors.scm
+++ b/gnu/packages/text-editors.scm
@@ -15,6 +15,7 @@
 ;;; Copyright © 2020 Maxime Devos <maximedevos@telenet.be>
 ;;; Copyright © 2021 aecepoglu <aecepoglu@fastmail.fm>
 ;;; Copyright © 2021 Leo Famulari <leo@famulari.name>
+;;; Copyright © 2021 Pierre Langlois <pierre.langlois@gmx.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -527,28 +528,32 @@ Wordstar-, EMACS-, Pico, Nedit or vi-like key bindings.  e3 can be used on
        ("ncurses" ,ncurses)))
     (arguments
      ;; No test suite available.
-     '(#:tests? #f
+     `(#:tests? #f
        #:make-flags (list (string-append "prefix=" %output)
-                          "CC=gcc")
+                          (string-append "CC=" ,(cc-for-target)))
        #:phases (modify-phases %standard-phases
                   (delete 'configure)   ; no configure script
                   (add-before 'build 'correct-location-of-difftool
                     (lambda _
                       (substitute* "buffer.c"
                         (("/usr/bin/diff")
-                         (which "diff")))
-                      #t))
+                         (which "diff")))))
+                  (add-before 'build 'pkg-config-for-cross-compiling-target
+                    (lambda _
+                      (substitute* "GNUmakefile"
+                        (("pkg-config")
+                         (or (which "pkg-config")
+                             (string-append ,(%current-target-system)
+                                            "-pkg-config"))))))
                   (add-before 'install 'patch-tutorial-location
                     (lambda* (#:key outputs #:allow-other-keys)
                       (substitute* "mg.1"
-                        (("/usr") (assoc-ref outputs "out")))
-                      #t))
+                        (("/usr") (assoc-ref outputs "out")))))
                   (add-after 'install 'install-tutorial
                     (lambda* (#:key outputs #:allow-other-keys)
                       (let* ((out (assoc-ref outputs "out"))
                              (doc (string-append out "/share/doc/mg")))
-                        (install-file "tutorial" doc)
-                        #t))))))
+                        (install-file "tutorial" doc)))))))
     (home-page "https://homepage.boetes.org/software/mg/")
     (synopsis "Microscopic GNU Emacs clone")
     (description
-- 
2.32.0


             reply	other threads:[~2021-07-13 19:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-13 19:51 Pierre Langlois [this message]
2021-07-14  7:16 ` [bug#49551] [PATCH] gnu: mg: Enable cross-compilation Mathieu Othacehe
2021-07-14  9:04   ` bug#49551: " Pierre Langlois

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=871r82m1q7.fsf@gmx.com \
    --to=pierre.langlois@gmx.com \
    --cc=49551@debbugs.gnu.org \
    /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).