diff mbox series

[bug#64708,4/8] gnu: commencement: gnumach-headers-boot0: Update to 1.8+git20221224.

Message ID 0d6b3e695340f343aa03eb279846eb3e4e6ecee3.1689685375.git.janneke@gnu.org
State New
Headers show
Series Fix cross build and native build for the Hurd. | expand

Commit Message

Janneke Nieuwenhuizen July 18, 2023, 1:15 p.m. UTC
* gnu/packages/commencement.scm (gnumach-headers-boot0)[name]: New field; give
proper name.
[source]: Update to 1.8+git20221224, using git-fetch-from-tarball.
[native-inputs]: Add autoconf-boot0, automake-boot0, texinfo-boot0.
[arguments]: Add 'patch-compat' phase to allow building hurd-minimal etc, with
our out-of-date bootstsrap binaries.
---
 gnu/packages/commencement.scm | 46 ++++++++++++++++++++++++++---------
 1 file changed, 34 insertions(+), 12 deletions(-)

Comments

Ludovic Courtès July 18, 2023, 9:16 p.m. UTC | #1
Janneke Nieuwenhuizen <janneke@gnu.org> skribis:

> +     (name "gnumach-headers-boot0")
> +     (version "1.8+git20221224")
> +     (source
> +      (origin
> +        (method
> +         (git-fetch-from-tarball
> +          (origin
> +            (method url-fetch)
> +            (uri (string-append
> +                  "https://git.savannah.gnu.org/cgit/hurd/gnumach.git/snapshot/"
> +                  "gnumach-" version ".tar.gz"))
> +            (sha256
> +             (base32 "0vb19ynvrxz302snqxkd0wgizwa5fw2x06a4zjsllqb9ijbq9mc8")))))
> +        (uri (git-reference
> +              (url "https://git.savannah.gnu.org/git/hurd/gnumach.git")
> +              (commit version)))
> +        (file-name (git-file-name name version))
> +        (sha256
> +         (base32
> +          "0f49zqxf64ds75rmskizpybl2mw7sxs05k59gjp3pgspvr87w7gs"))))

Since this is the same revision as in hurd.scm, we can reduce
duplication like so:

  (origin
    (inherit (package-source gnumach-headers))
    (method (git-fetch-from-tarball …)))

Otherwise LGTM.
Janneke Nieuwenhuizen July 18, 2023, 9:31 p.m. UTC | #2
Ludovic Courtès writes:

Hi!

> Janneke Nieuwenhuizen <janneke@gnu.org> skribis:
>
>> +     (name "gnumach-headers-boot0")
>> +     (version "1.8+git20221224")
>> +     (source
>> +      (origin
>> +        (method
>> +         (git-fetch-from-tarball
>> +          (origin
>> +            (method url-fetch)
>> +            (uri (string-append
>> +                  "https://git.savannah.gnu.org/cgit/hurd/gnumach.git/snapshot/"
>> +                  "gnumach-" version ".tar.gz"))
>> +            (sha256
>> +             (base32 "0vb19ynvrxz302snqxkd0wgizwa5fw2x06a4zjsllqb9ijbq9mc8")))))
>> +        (uri (git-reference
>> +              (url "https://git.savannah.gnu.org/git/hurd/gnumach.git")
>> +              (commit version)))
>> +        (file-name (git-file-name name version))
>> +        (sha256
>> +         (base32
>> +          "0f49zqxf64ds75rmskizpybl2mw7sxs05k59gjp3pgspvr87w7gs"))))
>
> Since this is the same revision as in hurd.scm, we can reduce
> duplication like so:
>
>   (origin
>     (inherit (package-source gnumach-headers))
>     (method (git-fetch-from-tarball …)))

Eh...no?  Because gnumach-headers uses method git-fetch now!

> Otherwise LGTM.

Thanks!
Ludovic Courtès July 18, 2023, 10:21 p.m. UTC | #3
Janneke Nieuwenhuizen <janneke@gnu.org> skribis:

>> Janneke Nieuwenhuizen <janneke@gnu.org> skribis:
>>
>>> +     (name "gnumach-headers-boot0")
>>> +     (version "1.8+git20221224")
>>> +     (source
>>> +      (origin
>>> +        (method
>>> +         (git-fetch-from-tarball
>>> +          (origin
>>> +            (method url-fetch)
>>> +            (uri (string-append
>>> +                  "https://git.savannah.gnu.org/cgit/hurd/gnumach.git/snapshot/"
>>> +                  "gnumach-" version ".tar.gz"))
>>> +            (sha256
>>> +             (base32 "0vb19ynvrxz302snqxkd0wgizwa5fw2x06a4zjsllqb9ijbq9mc8")))))
>>> +        (uri (git-reference
>>> +              (url "https://git.savannah.gnu.org/git/hurd/gnumach.git")
>>> +              (commit version)))
>>> +        (file-name (git-file-name name version))
>>> +        (sha256
>>> +         (base32
>>> +          "0f49zqxf64ds75rmskizpybl2mw7sxs05k59gjp3pgspvr87w7gs"))))
>>
>> Since this is the same revision as in hurd.scm, we can reduce
>> duplication like so:
>>
>>   (origin
>>     (inherit (package-source gnumach-headers))
>>     (method (git-fetch-from-tarball …)))
>
> Eh...no?  Because gnumach-headers uses method git-fetch now!

That’s the whole point: here we override the method with one that’s
close to the graph root, but the <git-reference> and hash are the same
as the one from ‘gnumach-headers’.  Inheriting makes the intent
explicit.

Which is pretty cool no?

Ludo’.
Janneke Nieuwenhuizen July 19, 2023, 5 a.m. UTC | #4
Ludovic Courtès writes:

> Janneke Nieuwenhuizen <janneke@gnu.org> skribis:
>
>>> Janneke Nieuwenhuizen <janneke@gnu.org> skribis:
>>>
>>>> +     (name "gnumach-headers-boot0")
>>>> +     (version "1.8+git20221224")
>>>> +     (source
>>>> +      (origin
>>>> +        (method
>>>> +         (git-fetch-from-tarball
>>>> +          (origin
>>>> +            (method url-fetch)
>>>> +            (uri (string-append
>>>> +                  "https://git.savannah.gnu.org/cgit/hurd/gnumach.git/snapshot/"
>>>> +                  "gnumach-" version ".tar.gz"))
>>>> +            (sha256
>>>> +             (base32 "0vb19ynvrxz302snqxkd0wgizwa5fw2x06a4zjsllqb9ijbq9mc8")))))
>>>> +        (uri (git-reference
>>>> +              (url "https://git.savannah.gnu.org/git/hurd/gnumach.git")
>>>> +              (commit version)))
>>>> +        (file-name (git-file-name name version))
>>>> +        (sha256
>>>> +         (base32
>>>> +          "0f49zqxf64ds75rmskizpybl2mw7sxs05k59gjp3pgspvr87w7gs"))))
>>>
>>> Since this is the same revision as in hurd.scm, we can reduce
>>> duplication like so:
>>>
>>>   (origin
>>>     (inherit (package-source gnumach-headers))
>>>     (method (git-fetch-from-tarball …)))

Ah, I didn't really read this properly; pretty cool!

>> Eh...no?  Because gnumach-headers uses method git-fetch now!
>
> That’s the whole point: here we override the method with one that’s
> close to the graph root, but the <git-reference> and hash are the same
> as the one from ‘gnumach-headers’.  Inheriting makes the intent
> explicit.

I still wonder a bit if it's a good idea to have commencement packages /
this commencement package inherit from hurd.scm; it means a world
rebuild whenever hurd.scm is updated (unless you put something back like
the verbose origin declaration above).

I'll take with your suggestion and go for the less code duplication
option right now, we can change it again when the need arises.

> Which is pretty cool no?

Yeah!  Sorry for the confusion :)

Greetings,
Janneke
diff mbox series

Patch

diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index 1d69c2a80f..b15a71feb3 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -2660,18 +2660,40 @@  (define gnumach-headers-boot0
   (with-boot0
    (package
      (inherit gnumach-headers)
-     (version "1.8-116-g28b53508")
-     (source (bootstrap-origin
-              (origin
-                (method url-fetch)
-                (uri (list (string-append "mirror://gnu/guix/mirror/gnumach-"
-                                          version ".tar.gz")
-                           (string-append "https://lilypond.org/janneke/hurd/"
-                                          "gnumach-" version ".tar.gz")))
-                (sha256
-                 (base32
-                  "006i0zgwy81vxarpfm12vip4q6i5mgmi5mmy5ldvxp5hx9h3l0zg")))))
-     (native-inputs '()))))
+     (name "gnumach-headers-boot0")
+     (version "1.8+git20221224")
+     (source
+      (origin
+        (method
+         (git-fetch-from-tarball
+          (origin
+            (method url-fetch)
+            (uri (string-append
+                  "https://git.savannah.gnu.org/cgit/hurd/gnumach.git/snapshot/"
+                  "gnumach-" version ".tar.gz"))
+            (sha256
+             (base32 "0vb19ynvrxz302snqxkd0wgizwa5fw2x06a4zjsllqb9ijbq9mc8")))))
+        (uri (git-reference
+              (url "https://git.savannah.gnu.org/git/hurd/gnumach.git")
+              (commit version)))
+        (file-name (git-file-name name version))
+        (sha256
+         (base32
+          "0f49zqxf64ds75rmskizpybl2mw7sxs05k59gjp3pgspvr87w7gs"))))
+     (native-inputs (list autoconf-boot0 automake-boot0 texinfo-boot0))
+     (arguments
+      (substitute-keyword-arguments (package-arguments gnumach-headers)
+        ((#:phases phases)
+         #~(modify-phases #$phases
+             (add-after 'unpack 'patch-compat
+               (lambda _
+                 (substitute* '("include/device/device_types.h"
+                                "include/mach_debug/slab_info.h"
+                                "include/mach_debug/vm_info.h")
+                   (("rpc_vm_size_t") "unsigned int")
+                   (("rpc_vm_offset_t") "unsigned int")
+                   (("rpc_long_natural_t") "unsigned long")
+                   (("long_natural_t") "unsigned long")))))))))))
 
 (define mig-boot0
   (let* ((mig (package