all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Danny Milosavljevic <dannym@scratchpost.org>
To: Naga Malleswari <nagamalli@riseup.net>
Cc: 40485@debbugs.gnu.org
Subject: [bug#40485] Acknowledgement (gnu: Update libxfce4ui to 4.15.2.)
Date: Thu, 9 Apr 2020 00:19:36 +0200	[thread overview]
Message-ID: <20200409001936.16098b47@scratchpost.org> (raw)
In-Reply-To: <25e2a647-635c-f8f6-a962-8701fd69e3ce@riseup.net>

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

Hi Naga,

On Thu, 9 Apr 2020 01:13:34 +0530
Naga Malleswari <nagamalli@riseup.net> wrote:

> https://paste.debian.net/1139190/

Please, for archival purposes, post source code in the mailing list.  Pastebin
content will eventually vanish--and we do want to have some kind of public
record.

I'm gonna paste it here:

CASE 1:

(define-public libxfce4ui-1
  (package
    (name "libxfce4ui")
    (version "4.14.1")

(define-public libxfce4ui/latest
  (package
    (inherit libxfce4ui-1)
    (version "4.15.2")

CASE 2:
(define-public libxfce4ui
  (package
    (name "libxfce4ui")
    (version "4.14.1")


(define-public libxfce4ui/latest
  (package
    (inherit libxfce4ui)
    (version "4.15.2")
    (source (origin
              (method url-fetch)
              (uri (string-append "https://archive.xfce.org/src/xfce/"
                                  name "/" (version-major+minor version) "/"
                                  name "-" version ".tar.bz2"))
              (sha256
               (base32
                "0069da27chxrgylbzcm9vhzpfnvkii2n2dz8g6jlwfcr82arkayb"))))))

> CASE1:
> 
>  ./pre-inst-env guix build libxfce4ui   is building 4.14.1

I would have expected 4.15.2--are you sure that you overwrote the field SOURCE ?

> ./pre-inst-env guix build libxfce4ui-1           error: libxfce4ui-1: unknown package

"libxfce4ui-1" is not a package's name but a variable's name.  That won't work[1].

> ./pre-inst-env guix build libxfce4ui@4.15.2      error: libxfce4ui-4.15.2: unknown package

Why is there a dash in the error message?

Should work just fine with "@".

> CasE 2: 
>  ./pre-inst-env guix build libxfce4ui   is building 4.14.1

Should build 4.15.2.

> ./pre-inst-env guix build libxfce4ui@4.15.2  resulted  error: libxfce4ui-4.15.2: unknown package

Again the dash?  Why?

it works for me:

diff --git a/gnu/packages/xfce.scm b/gnu/packages/xfce.scm
index 0628b03207..ee2bba5ca1 100644
--- a/gnu/packages/xfce.scm
+++ b/gnu/packages/xfce.scm
@@ -163,7 +163,9 @@ Xfce Desktop Environment.")
 storage system.")
     (license lgpl2.0+)))
 
-(define-public libxfce4ui
+;; case 1
+
+(define-public libxfce4ui-1
   (package
     (name "libxfce4ui")
     (version "4.14.1")
@@ -201,6 +203,20 @@ storage system.")
 to share commonly used Xfce widgets among the Xfce applications.")
     (license lgpl2.0+)))
 
+(define-public libxfce4ui
+  (package
+    (inherit libxfce4ui-1)
+    (name "libxfce4ui") ; not necessary but I like it for no reason
+    (version "4.15.2")
+    (source (origin ; necessary block!!
+              (method url-fetch)
+              (uri (string-append "https://archive.xfce.org/src/xfce/"
+                                  name "/" (version-major+minor version) "/"
+                                  name "-" version ".tar.bz2"))
+              (sha256
+               (base32
+                "0069da27chxrgylbzcm9vhzpfnvkii2n2dz8g6jlwfcr82arkayb"))))))
+
 (define-public exo
   (package
     (name "exo")

$ ./pre-inst-env guix build libxfce4ui@4.14.1
/gnu/store/fk1ziblzyslg9z7gpm9j410jfgwbilsr-libxfce4ui-4.14.1

$ ./pre-inst-env guix build libxfce4ui@4.15.2
/gnu/store/cy5wyx1zrq9ahp6zl0wjpv0nd0a6hpkb-libxfce4ui-4.15.2

The argument to "guix build" is always[1] the field called NAME (and optionally
also the field called VERSION, after an "@" separator) of the package record.
The variable's name (define-public xxx) doesn't matter at this point[1].

Because the sha256 sum would have to change (among other things), make sure to
specify the field SOURCE also in the other package--otherwise you'll get the
old source.

Another reason to specify SOURCE in the other package follows:

Guile, the programming language used for Guix packages, usually uses
lexical scope.
Even the facility we built in order to make records (like <PACKAGE>) also uses
lexical scope.

That means a reference will bind to the identifier that is closest in the source
code (before it).  Once the identifier is bound, that's it--it's not going to
change binding ever again.

That means if you do this (silly example to prove a point--but you can actually
run that for real!):

  (define-public a
    (package
      (name "a")
      (version name)
      ;; Please ignore the following line for understanding for now.
      (source #f) (build-system #f) (synopsis #f) (description #f) (license #f) (home-page #f)))

  (define-public b
    (package
      (inherit a)
      (name "b")))

  (write (package-name b))
  (newline)
  (write (package-version b))
  (newline)

package "b" would have: (name "b") but (version "a").
Version is "a".  That's not a typo.

However, with

  (define-public a
    (package
      (name "a")
      (version name) ; here, NAME is a reference, which will be bound to the NAME one line above
      ;; Please ignore the following line for understanding for now.
      (source #f) (build-system #f) (synopsis #f) (description #f) (license #f) (home-page #f)))

  (define-public b
    (package
      (inherit a)
      (name "b")
      (version name)))

  (write (package-name b))
  (newline)
  (write (package-version b))
  (newline)

package "b" would have: (name "b") and (version "b").

Similarly for all other references, most notably the references to NAME and VERSION that
usually occur in a SOURCE field.

[1] Except for "guix build -e ..." (don't use it).
    Usually, user-facing tools only care about the contents of the <PACKAGE> record.
    Guile variables are invisible to the end user of the "guix" tool.

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2020-04-08 22:20 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-07 12:55 [bug#40485] gnu: Update libxfce4ui to 4.15.2 Naga Malleswari
     [not found] ` <handler.40485.B.158626413323635.ack@debbugs.gnu.org>
2020-04-07 13:40   ` [bug#40485] Acknowledgement (gnu: Update libxfce4ui to 4.15.2.) Naga Malleswari
2020-04-07 13:57     ` Danny Milosavljevic
2020-04-07 14:01       ` Danny Milosavljevic
2020-04-07 14:07         ` Danny Milosavljevic
2020-04-07 14:17           ` Naga Malleswari
2020-04-07 14:23             ` Danny Milosavljevic
2020-04-07 19:17               ` Naga Malleswari
2020-04-07 19:24                 ` Danny Milosavljevic
2020-04-07 19:48                 ` Danny Milosavljevic
2020-04-08 19:43                   ` Naga Malleswari
2020-04-08 22:19                     ` Danny Milosavljevic [this message]
2020-04-08 22:31                       ` Danny Milosavljevic
2020-04-08 22:44                       ` Danny Milosavljevic
2020-04-09 20:42                       ` Naga Malleswari
2020-04-09 22:11                         ` Danny Milosavljevic
2020-04-12 21:09                           ` Naga Malleswari
2020-04-13 19:27                         ` Danny Milosavljevic
2020-04-14 15:43                           ` [bug#40485] [PATCH v3] : " Naga Malleswari
2020-04-14 17:07                         ` Tobias Geerinckx-Rice via Guix-patches via
2020-04-19 15:59                           ` bug#40485: " Danny Milosavljevic

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200409001936.16098b47@scratchpost.org \
    --to=dannym@scratchpost.org \
    --cc=40485@debbugs.gnu.org \
    --cc=nagamalli@riseup.net \
    /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 external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.