unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH] fpm2 package derivation
@ 2017-06-30 21:13 Thomas Sigurdsen
  2017-07-01 16:06 ` Ludovic Courtès
  2017-07-02  9:18 ` Danny Milosavljevic
  0 siblings, 2 replies; 4+ messages in thread
From: Thomas Sigurdsen @ 2017-06-30 21:13 UTC (permalink / raw)
  To: guix-devel@gnu.org

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

Hi, just managed to make this work, ran it through guix lint and think it
should be allright. With that said I'm more than happy for feedback seeing as
I'm a guile newbie and never contributed much to anything before (even though
my papers say I have training as a programmer :P ).

Not sure if this is the right place to ask, but I'll go ahead: the previous
version that did not build was this:

https://notabug.org/thomassgn/guixsd-configuration/src/8dd3f613371b7f1ab28111f061f6735646174ee0/modules/tms/fpm2.scm

I don't understand why this did not work and the working definition does. I
arrived at the new working definition by looking at the definition of xfig
and nvi (also in gnu/packages/).

Quite happy just making this derivation install through guix!

Patch:
0001-Add-package-derivation-for-fpm2-v0.79.patch

From a73b8d8351279dadbb11a12097d1dfe488075df9 Mon Sep 17 00:00:00 2001
From: Thomas Sigurdsen <thomas.sigurdsen@gmail.com>
Date: Fri, 30 Jun 2017 22:54:10 +0200
Subject: [PATCH] Add package derivation for fpm2 v0.79

---
 gnu/packages/password-utils.scm | 54
+++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+)

diff --git a/gnu/packages/password-utils.scm b/gnu/packages/password-utils.scm
index 08591d108..f3e1f0a00 100644
--- a/gnu/packages/password-utils.scm
+++ b/gnu/packages/password-utils.scm
@@ -446,3 +446,57 @@ use pass, the standard unix password manager, as the
credential backend for your git repositories.  This is achieved by explicitly
defining mappings between hosts and entries in the password store.")
     (license license:lgpl3+)))
+
+(define-public fpm2
+  (package
+    (name "fpm2")
+    (version "0.79")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "http://als.regnet.cz/fpm2/download/fpm2-"
+                                  version ".tar.bz2"))
+              (sha256
+               (base32
+                "19sdy1lygfhkg5nxi2w9a4d9kwvw24nxp0ix0p0lz91qpvk9qpnm"))))
+    (build-system gnu-build-system)
+    (inputs `(("gtk2" ,gtk+-2)
+              ("gnupg" ,gnupg)
+              ("libxml2" ,libxml2)))
+    (native-inputs `(("pkgconfig" ,pkg-config)
+                     ("intltool" ,intltool)))
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-before
+             'configure 'pre-configure
+           (lambda _
+               (let* ((poinc (open-output-file "po/POTFILES.in")))
+                 (begin
+                   (newline poinc)
+                   (display "data/fpm2.desktop.in" poinc)
+                   (newline poinc)
+                   (display "data/fpm2.desktop.in.in" poinc)
+                   (newline poinc)
+                   (display "fpm2.glade" poinc)
+                   (newline poinc)
+                   (display "src/callbacks.c" poinc)
+                   (newline poinc)
+                   (display "src/fpm.c" poinc)
+                   (newline poinc)
+                   (display "src/fpm_file.c" poinc)
+                   (newline poinc)
+                   (display "src/interface.c" poinc)
+                   (newline poinc)
+                   (display "src/support.c" poinc)
+                   (newline poinc)
+                   (display "fpm2.glade" poinc)
+                   (newline poinc)
+                   (close-port poinc))))))))
+    (synopsis "Manages, generates and stores passwords encrypted")
+    (description "FPM2 is GTK2 port from Figaro's Password Manager
+originally developed by John Conneely, with some new enhancements.
+
+Upstream development seems to have stopped. It is therefore recommended
+to use a different password manager.  ")
+    (home-page "http://als.regnet.cz/fpm2/")
+    (license license:gpl2)))
-- 
2.13.2


[-- Attachment #2: 0001-Add-package-derivation-for-fpm2-v0.79.patch --]
[-- Type: text/x-patch, Size: 2947 bytes --]

From a73b8d8351279dadbb11a12097d1dfe488075df9 Mon Sep 17 00:00:00 2001
From: Thomas Sigurdsen <thomas.sigurdsen@gmail.com>
Date: Fri, 30 Jun 2017 22:54:10 +0200
Subject: [PATCH] Add package derivation for fpm2 v0.79

---
 gnu/packages/password-utils.scm | 54 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 54 insertions(+)

diff --git a/gnu/packages/password-utils.scm b/gnu/packages/password-utils.scm
index 08591d108..f3e1f0a00 100644
--- a/gnu/packages/password-utils.scm
+++ b/gnu/packages/password-utils.scm
@@ -446,3 +446,57 @@ use pass, the standard unix password manager, as the credential backend for
 your git repositories.  This is achieved by explicitly defining mappings
 between hosts and entries in the password store.")
     (license license:lgpl3+)))
+
+(define-public fpm2
+  (package
+    (name "fpm2")
+    (version "0.79")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "http://als.regnet.cz/fpm2/download/fpm2-"
+                                  version ".tar.bz2"))
+              (sha256
+               (base32
+                "19sdy1lygfhkg5nxi2w9a4d9kwvw24nxp0ix0p0lz91qpvk9qpnm"))))
+    (build-system gnu-build-system)
+    (inputs `(("gtk2" ,gtk+-2)
+              ("gnupg" ,gnupg)
+              ("libxml2" ,libxml2)))
+    (native-inputs `(("pkgconfig" ,pkg-config)
+                     ("intltool" ,intltool)))
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-before
+             'configure 'pre-configure
+           (lambda _
+               (let* ((poinc (open-output-file "po/POTFILES.in")))
+                 (begin
+                   (newline poinc)
+                   (display "data/fpm2.desktop.in" poinc)
+                   (newline poinc)
+                   (display "data/fpm2.desktop.in.in" poinc)
+                   (newline poinc)
+                   (display "fpm2.glade" poinc)
+                   (newline poinc)
+                   (display "src/callbacks.c" poinc)
+                   (newline poinc)
+                   (display "src/fpm.c" poinc)
+                   (newline poinc)
+                   (display "src/fpm_file.c" poinc)
+                   (newline poinc)
+                   (display "src/interface.c" poinc)
+                   (newline poinc)
+                   (display "src/support.c" poinc)
+                   (newline poinc)
+                   (display "fpm2.glade" poinc)
+                   (newline poinc)
+                   (close-port poinc))))))))
+    (synopsis "Manages, generates and stores passwords encrypted")
+    (description "FPM2 is GTK2 port from Figaro's Password Manager
+originally developed by John Conneely, with some new enhancements.
+
+Upstream development seems to have stopped. It is therefore recommended
+to use a different password manager.  ")
+    (home-page "http://als.regnet.cz/fpm2/")
+    (license license:gpl2)))
-- 
2.13.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] fpm2 package derivation
  2017-06-30 21:13 [PATCH] fpm2 package derivation Thomas Sigurdsen
@ 2017-07-01 16:06 ` Ludovic Courtès
  2017-07-02  9:18 ` Danny Milosavljevic
  1 sibling, 0 replies; 4+ messages in thread
From: Ludovic Courtès @ 2017-07-01 16:06 UTC (permalink / raw)
  To: Thomas Sigurdsen; +Cc: guix-devel@gnu.org

Hello Thomas,

Thomas Sigurdsen <thomas.sigurdsen@gmail.com> skribis:

> Hi, just managed to make this work, ran it through guix lint and think it
> should be allright. With that said I'm more than happy for feedback seeing as
> I'm a guile newbie and never contributed much to anything before (even though
> my papers say I have training as a programmer :P ).

Well, good job so far!  :-)

> Not sure if this is the right place to ask, but I'll go ahead: the previous
> version that did not build was this:
>
> https://notabug.org/thomassgn/guixsd-configuration/src/8dd3f613371b7f1ab28111f061f6735646174ee0/modules/tms/fpm2.scm
>
> I don't understand why this did not work and the working definition does. I
> arrived at the new working definition by looking at the definition of xfig
> and nvi (also in gnu/packages/).

I don’t know how this did not work exactly, but one thing that comes to
mind is that perhaps the open port didn’t get flushed because that
version didn’t have a ‘close-port’ call at the end.

BTW, when dealing with files it’s safer to use ‘call-with-output-file’
instead of ‘open-output-file’:

  (call-with-output-file "foo.txt"
    (lambda (port)
      (display something port)
      …))

It takes care of closing the port when the lambda is left one way or
another (exceptions, etc.)

> +     `(#:phases
> +       (modify-phases %standard-phases
> +         (add-before
> +             'configure 'pre-configure
> +           (lambda _
> +               (let* ((poinc (open-output-file "po/POTFILES.in")))
> +                 (begin
> +                   (newline poinc)
> +                   (display "data/fpm2.desktop.in" poinc)
> +                   (newline poinc)
> +                   (display "data/fpm2.desktop.in.in" poinc)
> +                   (newline poinc)
> +                   (display "fpm2.glade" poinc)
> +                   (newline poinc)
> +                   (display "src/callbacks.c" poinc)
> +                   (newline poinc)
> +                   (display "src/fpm.c" poinc)
> +                   (newline poinc)
> +                   (display "src/fpm_file.c" poinc)
> +                   (newline poinc)
> +                   (display "src/interface.c" poinc)
> +                   (newline poinc)
> +                   (display "src/support.c" poinc)
> +                   (newline poinc)
> +                   (display "fpm2.glade" poinc)
> +                   (newline poinc)
> +                   (close-port poinc))))))))

So I’d suggest ‘call-with-output-file’ and a loop:

  (for-each (lambda (file)
              (display file port))
            '("fmp2.glade" …))

However, could you explain why this is needed in the first place?

> +    (synopsis "Manages, generates and stores passwords encrypted")
> +    (description "FPM2 is GTK2 port from Figaro's Password Manager
> +originally developed by John Conneely, with some new enhancements.
> +
> +Upstream development seems to have stopped. It is therefore recommended
> +to use a different password manager.  ")

This last part is not confidence-inspiring.  :-)  Do you think it’s a
good idea to provide it to our users anyway, when there’s already a
number of password managers available?  Many won’t notice that last
sentence.

Thank you,
Ludo’.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] fpm2 package derivation
  2017-06-30 21:13 [PATCH] fpm2 package derivation Thomas Sigurdsen
  2017-07-01 16:06 ` Ludovic Courtès
@ 2017-07-02  9:18 ` Danny Milosavljevic
  2017-07-02 18:41   ` Thomas Sigurdsen
  1 sibling, 1 reply; 4+ messages in thread
From: Danny Milosavljevic @ 2017-07-02  9:18 UTC (permalink / raw)
  To: Thomas Sigurdsen; +Cc: guix-devel@gnu.org

In the linked resource, you have "(lambda () ...)" on like 36 as a phase.  That probably doesn't work since Guix passes quite a few arguments there (where the inputs are, where the outputs are, compilation flags etcetc).  If you don't care about them, just use a variable name to hold them all (for example "_").

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] fpm2 package derivation
  2017-07-02  9:18 ` Danny Milosavljevic
@ 2017-07-02 18:41   ` Thomas Sigurdsen
  0 siblings, 0 replies; 4+ messages in thread
From: Thomas Sigurdsen @ 2017-07-02 18:41 UTC (permalink / raw)
  To: Danny Milosavljevic; +Cc: guix-devel@gnu.org


Thank you. That also explains the error messages I got; for some reason I
thought '_' was special, but of course - this is lisp, it's not weird like
that.

On Sun, 2 Jul 2017 11:18:47 +0200
Danny Milosavljevic <dannym@scratchpost.org> wrote:

> In the linked resource, you have "(lambda () ...)" on like 36 as a phase.
> That probably doesn't work since Guix passes quite a few arguments there
> (where the inputs are, where the outputs are, compilation flags etcetc).
> If you don't care about them, just use a variable name to hold them all
> (for example "_").

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-07-02 18:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-30 21:13 [PATCH] fpm2 package derivation Thomas Sigurdsen
2017-07-01 16:06 ` Ludovic Courtès
2017-07-02  9:18 ` Danny Milosavljevic
2017-07-02 18:41   ` Thomas Sigurdsen

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).