diff mbox

[06/11] gnu: Add python-sh.

Message ID 20160822132018.19828-6-david@craven.ch
State New
Headers show

Commit Message

David Craven Aug. 22, 2016, 1:20 p.m. UTC
* gnu/packages/python.scm (python-sh): New variable.
(python2-sh): New variable.
---
 gnu/packages/python.scm | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

Comments

Danny Milosavljevic Aug. 27, 2016, 8:42 a.m. UTC | #1
On Mon, 22 Aug 2016 15:20:13 +0200
David Craven <david@craven.ch> wrote:

> +  (description "Python subprocess interface.")

I'd mention that it provides a function per program and that you invoke programs by calling a function called like the program in the sh module. 

Essentially it hides the fact that it's an invocation of a process rather than a call of a function.

That's what it's for - otherwise you could have just used the Python built-in subprocess module.
David Craven Aug. 28, 2016, 12:28 p.m. UTC | #2
Thanks for your suggestions. I pushed the packages.

Is there a git repo somewhere I can pull your uboot stuff from? I'd
like to test it =)

I'm interested in starting a riscv port of guixsd at some point. I've
identified some blocking issues I think need to be addressed first to
make it feasible:

1. getting guix system vm running on arm/mips (requires uboot working)
2. offloading builds to a vm (since riscv won't have (commercially)
available soc's till next year)
3. updating the default gcc to a recent version (preferably gcc 6)

So I'm willing to invest some quality time with these issues...
Danny Milosavljevic Aug. 29, 2016, 10:31 a.m. UTC | #3
Hi,

On Sun, 28 Aug 2016 14:28:31 +0200
David Craven <david@craven.ch> wrote:

> Thanks for your suggestions. I pushed the packages.
> 
> Is there a git repo somewhere I can pull your uboot stuff from? I'd
> like to test it =) 

There's no such repo right now.

I'd prefer merging into master soon to creating a fork.

For what it's worth, the changes I sent to the mailing list were tested on my machines, including that the Grub support still works.

If merging is deemed too risky, would it be possible to create a "wip-u-boot" branch on Savannah instead? - it seems that is how these bigger changes are handled. Then I could push the U-Boot parts there.

I've attached the UNFINISHED u-boot-install program which installs the U-Boot bootloader (comparable to grub-install). I plan to upstream it into the U-Boot main repository eventually. The other parts required for u-boot support were all already posted to our mailing list here.

gnu/packages/u-boot.scm could be merged now - it shouldn't affect anything because it's unused by master.

Other than that, it's mostly renaming "grub" -> "bootloader" in the Guix main source code that it creating a massive amount of noise in the patches I sent before. The actual functional change is a small part.

> I'm interested in starting a riscv port of guixsd at some point.

Nice! I think RISC-V is quite important to have.
David Craven Aug. 29, 2016, 11:25 a.m. UTC | #4
> If merging is deemed too risky, would it be possible to create a
> "wip-u-boot" branch on Savannah instead? - it seems that is
> how these bigger changes are handled. Then I could push the
> U-Boot parts there.

I'll collect your patches and do that. That should make it easier
to test. (I'm not qualified to merge your patches ;-)
David Craven Aug. 29, 2016, 2:12 p.m. UTC | #5
Mhmm so I'm trying your patches and I get a no code for gnu system
u-boot. The file seems to be missing from the patches?
Danny Milosavljevic Aug. 29, 2016, 2:19 p.m. UTC | #6
On Mon, 29 Aug 2016 16:12:00 +0200
David Craven <david@craven.ch> wrote:

> Mhmm so I'm trying your patches and I get a no code for gnu system
> u-boot. The file seems to be missing from the patches?

Attached gnu/system/u-boot.scm . (Don't worry, once the branch is up, I'll diff with what I have here :) )
David Craven Aug. 29, 2016, 4:51 p.m. UTC | #7
So I think that dtc and uboot are good now, I'll give it a few days
before merging...

I'm getting an Unbound variable: <u-boot-configuration> error :/

Here's my bootloader configuration. Any suggestions? =)

  (bootloader (u-boot-configuration
               (board "vexpress_ca9x4")
               (device "/dev/sdX")
               (u-boot armhf-linux-uboot)))

Thank you,
David
Danny Milosavljevic Aug. 29, 2016, 5:20 p.m. UTC | #8
On Mon, 29 Aug 2016 18:51:45 +0200
David Craven <david@craven.ch> wrote:

> So I think that dtc and uboot are good now, I'll give it a few days
> before merging...
> 
> I'm getting an Unbound variable: <u-boot-configuration> error :/
> 
> Here's my bootloader configuration. Any suggestions? =)
> 
>   (bootloader (u-boot-configuration
>                (board "vexpress_ca9x4")
>                (device "/dev/sdX")
>                (u-boot armhf-linux-uboot)))

(use-modules ...
             (gnu system u-boot))
             ^^^ Add this
Danny Milosavljevic Aug. 29, 2016, 5:52 p.m. UTC | #9
> >   (bootloader (u-boot-configuration
> >                (board "vexpress_ca9x4")
> >                (device "/dev/sdX")
> >                (u-boot armhf-linux-uboot)))  

Note: It should infer the correct u-boot to use on its own - at least that's the intention with the whole make-u-boot-package thing.
Danny Milosavljevic Aug. 29, 2016, 6:10 p.m. UTC | #10
On Mon, 29 Aug 2016 19:52:23 +0200
Danny Milosavljevic <dannym@scratchpost.org> wrote:

> > >   (bootloader (u-boot-configuration
> > >                (board "vexpress_ca9x4")
> > >                (device "/dev/sdX")
> > >                (u-boot armhf-linux-uboot)))    
> 
> Note: It should infer the correct u-boot to use on its own - at least that's the intention with the whole make-u-boot-package thing.

Aaaand... this part is not implemented yet because I can't find in which package gnu/build/install.scm's install-grub finds the executable "grub-install" that it invokes (and how it finds it at all O_o).
diff mbox

Patch

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index a703be3..8720341 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -10062,3 +10062,29 @@  binary or text.")
       (native-inputs
        `(("python2-setuptools" ,python2-setuptools)
          ,@(package-native-inputs base))))))
+
+(define-public python-sh
+  (package
+  (name "python-sh")
+  (version "1.11")
+  (source (origin
+            (method url-fetch)
+            (uri (pypi-uri "sh" version))
+            (sha256
+             (base32
+              "192r0mpv6dmkysjzhc43ddffiwb5g7c76bgr1mb1z2xz9awbj3sr"))))
+  (build-system python-build-system)
+  (arguments
+   `(#:tests? #f)) ; no tests
+  (home-page "https://github.com/amoffat/sh")
+  (synopsis "Python subprocess interface")
+  (description "Python subprocess interface.")
+  (license license:expat)
+  (properties `((python2-variant . ,(delay python2-sh))))))
+
+(define-public python2-sh
+  (let ((base (package-with-python2 (strip-python2-variant python-sh))))
+    (package (inherit base)
+      (native-inputs
+       `(("python2-setuptools" ,python2-setuptools)
+         ,@(package-native-inputs base))))))