Patchwork [v2] gnu: Add sunxi-tools.

login
register
mail settings
Submitter Danny Milosavljevic
Date Oct. 2, 2016, 9:58 a.m.
Message ID <20161002095836.6495-1-dannym@scratchpost.org>
Download mbox | patch
Permalink /patch/16173/
State New
Headers show

Comments

Danny Milosavljevic - Oct. 2, 2016, 9:58 a.m.
* gnu/packages/admin.scm (sunxi-tools): New variable.
---
 gnu/packages/admin.scm | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)
Ludovic Courtès - Oct. 4, 2016, 9:19 a.m.
Danny Milosavljevic <dannym@scratchpost.org> skribis:

> * gnu/packages/admin.scm (sunxi-tools): New variable.
> ---
>  gnu/packages/admin.scm | 32 ++++++++++++++++++++++++++++++++
>  1 file changed, 32 insertions(+)
>
> diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm
> index 6981242..06c552f 100644
> --- a/gnu/packages/admin.scm
> +++ b/gnu/packages/admin.scm
> @@ -1846,3 +1846,35 @@ Kerberos and Heimdal and FAST is supported with recent MIT Kerberos.")
>      (license license:gpl1+)))
>  
>  ;;http://archives.eyrie.org/software/kerberos/pam-krb5-4.7.tar.xz
> +
> +(define-public sunxi-tools
> +  (package
> +    (name "sunxi-tools")
> +    (version "1.3")
> +    (source
> +     (origin
> +       (method url-fetch)
> +       (uri (string-append "https://github.com/linux-sunxi/"
> +                           "sunxi-tools/archive/v" version ".tar.gz"))
> +       (sha256
> +        (base32 "1iazm28gws1i8sls3gxwc5p108n56ags287zmh1rpvkn2k1az81a"))
> +       (modules '((guix build utils)))
> +       (snippet
> +        ;; Source is included anyway.
> +        '(delete-file-recursively "bin"))))

The comment should rather be “Remove binaries contained in the tarball.”

> +    (native-inputs
> +     `(("pkg-config" ,pkg-config)))
> +    (inputs
> +     `(("libusb" ,libusb)))
> +    (build-system gnu-build-system)
> +    (arguments
> +     `(#:tests? #f ; no tests exist
> +       #:make-flags (list (string-append "PREFIX="
> +                                         (assoc-ref %outputs "out")))
> +       #:phases
> +       (modify-phases %standard-phases
> +         (delete 'configure))))
> +    (home-page "https://github.com/linux-sunxi/sunxi-tools")
> +    (synopsis "Tools to help manage Allwinner A10 devices")
> +    (description "This package contains tools for Allwinner A10 devices (for FEX, FEL USB, PIO, NAND, JTAG, RAM)")

I don’t understand this description.  Since “Tools”, “manage”, and
“devices” could mean anything, could you add qualifiers to give more
context, like:

  “Frobbing tools for Allwinner A10 foobar devices”

and similarly expound the description (with a period at the end of the
sentence)?

Based on that, we might device that admin.scm is not the best fit for
this package.  Maybe flashing-tools.scm?

Could you send an updated patch?

Thanks in advance!

Ludo’.
Danny Milosavljevic - Oct. 4, 2016, 10:07 a.m.
> I don’t understand this description.  Since “Tools”, “manage”, and
> “devices” could mean anything, could you add qualifiers to give more
> context, like:
> 
>   “Frobbing tools for Allwinner A10 foobar devices”
> 
> and similarly expound the description (with a period at the end of the
> sentence)?
> 
> Based on that, we might device that admin.scm is not the best fit for
> this package.  Maybe flashing-tools.scm?

The tools included are:

- sunxi-fexc, bin2fex, fex2bin: Compile a textual description of a board (.fex) to a binary representation (.bin). Like Devicetree - if a vendor doesn't know Devicetree exists and therefore doesn't use it. [can be used on target and host]
- sunxi-fel: Puts an Allwinner A10 device into FEL mode which makes it register as a special USB device (rather than USB host). You can then connect it to another computer and flash it from there (kinda like Arduino or other Atmels). [only makes sense to be used on host]
- sunxi-nand-part: Partitions NAND flash. [only makes sense to be used on target since it uses ioctls specific to the NAND kernel driver]
- sunxi-bootinfo: Reads out boot0 and boot1 information. These are the bootloaders before U-Boot. [can be used on target and host - since it requires an image file]
- sunxi-pio: Sets GPIO and oscillates a GPIO in order to be able to find it [only makes sense to be used on target - since it uses /dev/mem]

So how about this description:

    (description "This package contains tools for Allwinner A10 devices:
- sunxi-fexc, bin2fex, fex2bin: Compile a textual description of a board (.fex) to a binary representation (.bin).
- sunxi-fel: Puts a Allwinner A10 device into FEL mode which makes it register as a special USB device (rather than USB host). You can then connect it to another computer and flash it from there.
- sunxi-nand-part: Partitions NAND flash.
- sunxi-bootinfo: Reads out boot0 and boot1 information. These are the bootloaders before U-Boot.
- sunxi-pio: Sets GPIO and oscillates a GPIO in order to be able to find it.
")
Ludovic Courtès - Oct. 4, 2016, 1:15 p.m.
Danny Milosavljevic <dannym@scratchpost.org> skribis:

>> I don’t understand this description.  Since “Tools”, “manage”, and
>> “devices” could mean anything, could you add qualifiers to give more
>> context, like:
>> 
>>   “Frobbing tools for Allwinner A10 foobar devices”
>> 
>> and similarly expound the description (with a period at the end of the
>> sentence)?
>> 
>> Based on that, we might device that admin.scm is not the best fit for
>> this package.  Maybe flashing-tools.scm?
>
> The tools included are:

I’m not asking that you explain it to me personally ;-), but rather that
the description conveys a message that makes sense both for the domain
expert and the passerby.

  https://www.gnu.org/software/guix/manual/html_node/Synopses-and-Descriptions.html

> So how about this description:
>
>     (description "This package contains tools for Allwinner A10 devices:
> - sunxi-fexc, bin2fex, fex2bin: Compile a textual description of a board (.fex) to a binary representation (.bin).
> - sunxi-fel: Puts a Allwinner A10 device into FEL mode which makes it register as a special USB device (rather than USB host). You can then connect it to another computer and flash it from there.
> - sunxi-nand-part: Partitions NAND flash.
> - sunxi-bootinfo: Reads out boot0 and boot1 information. These are the bootloaders before U-Boot.
> - sunxi-pio: Sets GPIO and oscillates a GPIO in order to be able to find it.
> ")

Sure.  Make sure to use @enumerate/@item for the list, and @command for
the command names.

This still doesn’t address the synopsis issue as I wrote above.  What
about this synopsis:

  Hardware management tools for Allwinner A10 single-board computers

?

Please send a patch the addresses this and I’ll happily apply it!

Ludo’.
Vincent Legoll - Oct. 4, 2016, 2:38 p.m.
Hello,

On Tue, Oct 4, 2016 at 3:15 PM, Ludovic Courtès <ludo@gnu.org> wrote:
> This still doesn’t address the synopsis issue as I wrote above.  What
> about this synopsis:
>
>   Hardware management tools for Allwinner A10 single-board computers
>
> ?

LGTM, but are those only for A10 ? I used some fex2bin/bin2fex on AW
H3 I think...

Patch

diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm
index 6981242..06c552f 100644
--- a/gnu/packages/admin.scm
+++ b/gnu/packages/admin.scm
@@ -1846,3 +1846,35 @@  Kerberos and Heimdal and FAST is supported with recent MIT Kerberos.")
     (license license:gpl1+)))
 
 ;;http://archives.eyrie.org/software/kerberos/pam-krb5-4.7.tar.xz
+
+(define-public sunxi-tools
+  (package
+    (name "sunxi-tools")
+    (version "1.3")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "https://github.com/linux-sunxi/"
+                           "sunxi-tools/archive/v" version ".tar.gz"))
+       (sha256
+        (base32 "1iazm28gws1i8sls3gxwc5p108n56ags287zmh1rpvkn2k1az81a"))
+       (modules '((guix build utils)))
+       (snippet
+        ;; Source is included anyway.
+        '(delete-file-recursively "bin"))))
+    (native-inputs
+     `(("pkg-config" ,pkg-config)))
+    (inputs
+     `(("libusb" ,libusb)))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:tests? #f ; no tests exist
+       #:make-flags (list (string-append "PREFIX="
+                                         (assoc-ref %outputs "out")))
+       #:phases
+       (modify-phases %standard-phases
+         (delete 'configure))))
+    (home-page "https://github.com/linux-sunxi/sunxi-tools")
+    (synopsis "Tools to help manage Allwinner A10 devices")
+    (description "This package contains tools for Allwinner A10 devices (for FEX, FEL USB, PIO, NAND, JTAG, RAM)")
+    (license license:gpl2+)))