unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* gnu: artanis: Remove implied $(DESTDIR) usage.
@ 2016-10-16  1:40 Adonay Felipe Nogueira
  2016-10-17  2:13 ` Marius Bakke
  0 siblings, 1 reply; 4+ messages in thread
From: Adonay Felipe Nogueira @ 2016-10-16  1:40 UTC (permalink / raw)
  To: guix-devel


[-- Attachment #1.1: Type: text/plain, Size: 748 bytes --]

My first patch to Guix project, I hope this helps. :)
-- 
# pt-BR: Brasileiro | en: Brazilian

* pt-BR: Palestra sobre liberdade de software (movimento filosófico político-social, não tecnológico).
  * en: Gives talks about software freedom (philosophical, political and social movement, not technological).
* pt-BR: Voluntário avaliador de liberdade de software (para software pagos ou gratuitos).
  * en: Volunteer evaluator of software freedom (for paid software, or gratis software).
* pt-BR: Presta suporte e consultoria básicos sobre software livre.
  * en: Gives basic support and consulting about free/libre software.

## pt-BR: Sobre mim e contato | en: About me and contact
<https://libreplanet.org/wiki/User:Adfeno>


[-- Attachment #1.2: guix.patch --]
[-- Type: text/x-patch, Size: 5623 bytes --]

From a51dc9fd4237a37a20fe457defa1821663c8e944 Mon Sep 17 00:00:00 2001
From: Adonay Felipe Nogueira <adfeno@openmailbox.org>
Date: Sat, 15 Oct 2016 22:32:42 -0300
Subject: [PATCH] gnu: artanis: Remove implied $(DESTDIR) usage.

* gnu/packages/patches/artanis-fix-Makefile.in.patch: New patch.
* gnu/local.mk (dist_patch_DATA): Register patch.
* gnu/packages/guile.scm (artanis)[source]: Use patch.
---
 gnu/local.mk                                       |  2 +
 gnu/packages/guile.scm                             |  4 +-
 gnu/packages/patches/artanis-fix-Makefile.in.patch | 69 ++++++++++++++++++++++
 3 files changed, 74 insertions(+), 1 deletion(-)
 create mode 100644 gnu/packages/patches/artanis-fix-Makefile.in.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 06e23cd..0439a0a 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -5,6 +5,7 @@
 # Copyright © 2013, 2014, 2015, 2016 Mark H Weaver <mhw@netris.org>
 # Copyright © 2016 Chris Marusich <cmmarusich@gmail.com>
 # Copyright © 2016 Kei Kebreau <kei@openmailbox.org>
+# Copyright © 2016 Adonay "adfeno" Felipe Nogueira <https://libreplanet.org/wiki/User:Adfeno> <adfeno@openmailbox.org>
 #
 # This file is part of GNU Guix.
 #
@@ -454,6 +455,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/antiword-CVE-2014-8123.patch			\
   %D%/packages/patches/apr-skip-getservbyname-test.patch	\
   %D%/packages/patches/arb-ldconfig.patch			\
+  %D%/packages/patches/artanis-fix-Makefile.in.patch		\
   %D%/packages/patches/ath9k-htc-firmware-binutils.patch	\
   %D%/packages/patches/ath9k-htc-firmware-gcc.patch		\
   %D%/packages/patches/ath9k-htc-firmware-objcopy.patch		\
diff --git a/gnu/packages/guile.scm b/gnu/packages/guile.scm
index 7361f1f..a8adf10 100644
--- a/gnu/packages/guile.scm
+++ b/gnu/packages/guile.scm
@@ -7,6 +7,7 @@
 ;;; Copyright © 2016 Erik Edrosa <erik.edrosa@gmail.com>
 ;;; Copyright © 2016 Eraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2016 Alex Kost <alezost@gmail.com>
+;;; Copyright © 2016 Adonay "adfeno" Felipe Nogueira <https://libreplanet.org/wiki/User:Adfeno> <adfeno@openmailbox.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -305,7 +306,8 @@ applicable."
                                   version ".tar.gz"))
               (sha256
                (base32
-                "19m3ak12cqk8js9d2mdg11kh4fjsq8frfpd10qw75h0zpr5cywpp"))))
+                "19m3ak12cqk8js9d2mdg11kh4fjsq8frfpd10qw75h0zpr5cywpp"))
+              (patches (search-patches "artanis-fix-Makefile.in.patch"))))
     (build-system gnu-build-system)
     ;; TODO: Add guile-dbi and guile-dbd optional dependencies.
     (inputs `(("guile" ,guile-2.0)))
diff --git a/gnu/packages/patches/artanis-fix-Makefile.in.patch b/gnu/packages/patches/artanis-fix-Makefile.in.patch
new file mode 100644
index 0000000..d2c19f1
--- /dev/null
+++ b/gnu/packages/patches/artanis-fix-Makefile.in.patch
@@ -0,0 +1,69 @@
+Applies until an Artanis release comes with patches #9130 and #9131
+applied.
+
+diff -ru artanis-0.1.2/Makefile.in artanis-0.1.2.1/Makefile.in
+--- artanis-0.1.2/Makefile.in	2016-02-10 12:35:18.800490571 -0200
++++ artanis-0.1.2.1/Makefile.in	2016-10-15 19:44:35.140907367 -0300
+@@ -19,9 +19,18 @@
+ MOD_OBJ := $(OBJ)/artanis
+ BIN := bin
+ TEMP_LIB_PATH := $(OBJ)
+-MOD_PATH := $(shell guile -c "(display (%site-dir))")
+ MOD_COMPILED_PATH := $(shell guile -c "(display (%site-ccache-dir))")
++
++ifdef DESTDIR
++INFO_DIR := $(DESTDIR)/share/info/
++MOD_PATH := $(DESTDIR)/$(shell guile -c "(display (%site-dir))")
+ MOD_TARGET_PATH := $(DESTDIR)/$(MOD_COMPILED_PATH)
++else
++INFO_DIR := $(PREFIX)/share/info/
++MOD_PATH := $(shell guile -c "(display (%site-dir))")
++MOD_TARGET_PATH := $(MOD_COMPILED_PATH)
++endif
++
+ GUILE_CFLAGS := -Wunsupported-warning -Wunbound-variable -Warity-mismatch -Wduplicate-case-datum -Wbad-case-datum -Wformat
+ GUILEC := GUILE_LOAD_COMPILED_PATH=$(TEMP_LIB_PATH) guild compile $(GUILE_CFLAGS)
+ ARTANIS_ETC := $(SRC)/etc/artanis
+@@ -36,7 +45,6 @@
+ GENDOCS :=$(BUILD_AUX)/gendocs.sh
+ CHK_TEXINFO := $(BUILD_AUX)/check_texinfo.scm
+ CP := cp -frd -P
+-INFO_DIR := $(PREFIX)/share/info/
+ TARBALL_NAME := artanis-$(VERSION)
+ TMP_DIR := $(shell mktemp -d)
+ ANN_GEN := $(BUILD_AUX)/announce-gen
+@@ -124,18 +132,29 @@
+ 	-rm -f config.{h,log}
+ 
+ install: $(ALL_TARGETS)
+-	mkdir -p $(DESTDIR)/$(MOD_PATH)
+-	$(CP) $(MOD) $(DESTDIR)/$(MOD_PATH)/
++	mkdir -p $(MOD_PATH)
++	$(CP) $(MOD) $(MOD_PATH)/
+ 	mkdir -p $(MOD_TARGET_PATH)/
+ 	$(CP) $(MOD_OBJ) $(MOD_TARGET_PATH)/
++
++ifdef DESTDIR
+ 	$(CP) $(ARTANIS_ETC) $(DESTDIR)/etc/
+ 	$(CP) $(ARTANIS_PAGES) $(DESTDIR)/etc/artanis/
+-	mkdir -p $(DESTDIR)/$(PREFIX)/bin/
+-	$(CP) $(BIN)/art $(DESTDIR)/$(PREFIX)/bin/
++	mkdir -p $(DESTDIR)/bin/
++	$(CP) $(BIN)/art $(DESTDIR)/bin/
+ 	mkdir -p $(DESTDIR)/etc/bash_completion.d/
+ 	$(CP) $(CMDCOMP) $(DESTDIR)/etc/bash_completion.d/
++else
++	$(CP) $(ARTANIS_ETC) $(PREFIX)/etc/
++	$(CP) $(ARTANIS_PAGES) $(PREFIX)/etc/artanis/
++	mkdir -p $(PREFIX)/bin/
++	$(CP) $(BIN)/art $(PREFIX)/bin/
++	mkdir -p $(PREFIX)/etc/bash_completion.d/
++	$(CP) $(CMDCOMP) $(PREFIX)/etc/bash_completion.d/
++endif
++
+ 	if [ -e /etc/bash.bashrc ]; then source /etc/bash.bashrc; fi
+-	if [ -e artanis.info ]; then mkdir -p $(DESTDIR)/$(INFO_DIR); $(CP) artanis.info $(DESTDIR)/$(INFO_DIR)/; fi
++	if [ -e artanis.info ]; then mkdir -p $(INFO_DIR); $(CP) artanis.info $(INFO_DIR)/; fi
+ 
+ distclean: distclean-mk clean clean-config clean-tarball
+ 	-rm -f $(BIN)/art
-- 
1.9.1


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 213 bytes --]

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

* Re: gnu: artanis: Remove implied $(DESTDIR) usage.
  2016-10-16  1:40 gnu: artanis: Remove implied $(DESTDIR) usage Adonay Felipe Nogueira
@ 2016-10-17  2:13 ` Marius Bakke
  2016-10-17 12:54   ` Adonay Felipe Nogueira
  0 siblings, 1 reply; 4+ messages in thread
From: Marius Bakke @ 2016-10-17  2:13 UTC (permalink / raw)
  To: Adonay Felipe Nogueira, guix-devel

Adonay Felipe Nogueira <adfeno@openmailbox.org> writes:

> My first patch to Guix project, I hope this helps. :)

Welcome and thanks for this patch! :)

The current artanis package has a bug where the install location is set
to "$out/$out/share/guile/site/2.0". This patch fixes that by installing
to "$out/share/guile/site/2.0". I can load it from the Guile REPL now.

However, the same files are still present in
/gnu/store/...-artanis-0.1.2/gnu/store/...-artanis-0.1.2 as before. It
seems to be installed to both $out and $out/$out. Do you think you can
prevent this from happening as well?

Other than that I only have one remark:

[...]

> diff --git a/gnu/packages/patches/artanis-fix-Makefile.in.patch b/gnu/packages/patches/artanis-fix-Makefile.in.patch
> new file mode 100644
> index 0000000..d2c19f1
> --- /dev/null
> +++ b/gnu/packages/patches/artanis-fix-Makefile.in.patch
> @@ -0,0 +1,69 @@
> +Applies until an Artanis release comes with patches #9130 and #9131
> +applied.

Please mention the upstream commit hash or bug report here, so that
the next person can easily tell whether this is still needed or not.

Can you send an updated patch?

Thanks!

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

* Re: gnu: artanis: Remove implied $(DESTDIR) usage.
  2016-10-17  2:13 ` Marius Bakke
@ 2016-10-17 12:54   ` Adonay Felipe Nogueira
  2016-10-17 14:27     ` Marius Bakke
  0 siblings, 1 reply; 4+ messages in thread
From: Adonay Felipe Nogueira @ 2016-10-17 12:54 UTC (permalink / raw)
  To: guix-devel


[-- Attachment #1.1: Type: text/plain, Size: 266 bytes --]

Oh my! ... Sorry for being careless. I guess I was so happy to finally
fix the problem upstream that I forgot to adapt our recipe accordingly.

Thanks for testing. :)

I have made the patch again, and also properly referenced the patch
tickets from upstream.

[-- Attachment #1.2: guix.patch --]
[-- Type: text/x-patch, Size: 6590 bytes --]

From 85d418a8750cb7b90cab12c5cc7687e8fd8a6981 Mon Sep 17 00:00:00 2001
From: Adonay Felipe Nogueira <adfeno@openmailbox.org>
Date: Mon, 17 Oct 2016 10:47:21 -0200
Subject: [PATCH] gnu: artanis: Remove implied $(DESTDIR) usage.

* gnu/packages/patches/artanis-fix-Makefile.in.patch: New patch.
* gnu/local.mk (dist_patch_DATA): Register patch.
* gnu/packages/guile.scm (artanis)
** [source]: Use patch.
** [arguments]: Remove DESTDIR from #:make-flags.
---
 gnu/local.mk                                       |  2 +
 gnu/packages/guile.scm                             | 14 +++--
 gnu/packages/patches/artanis-fix-Makefile.in.patch | 70 ++++++++++++++++++++++
 3 files changed, 81 insertions(+), 5 deletions(-)
 create mode 100644 gnu/packages/patches/artanis-fix-Makefile.in.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 27872ce..9079b42 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -5,6 +5,7 @@
 # Copyright © 2013, 2014, 2015, 2016 Mark H Weaver <mhw@netris.org>
 # Copyright © 2016 Chris Marusich <cmmarusich@gmail.com>
 # Copyright © 2016 Kei Kebreau <kei@openmailbox.org>
+# Copyright © 2016 Adonay "adfeno" Felipe Nogueira <https://libreplanet.org/wiki/User:Adfeno> <adfeno@openmailbox.org>
 #
 # This file is part of GNU Guix.
 #
@@ -454,6 +455,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/antiword-CVE-2014-8123.patch			\
   %D%/packages/patches/apr-skip-getservbyname-test.patch	\
   %D%/packages/patches/arb-ldconfig.patch			\
+  %D%/packages/patches/artanis-fix-Makefile.in.patch		\
   %D%/packages/patches/ath9k-htc-firmware-binutils.patch	\
   %D%/packages/patches/ath9k-htc-firmware-gcc.patch		\
   %D%/packages/patches/ath9k-htc-firmware-objcopy.patch		\
diff --git a/gnu/packages/guile.scm b/gnu/packages/guile.scm
index 7361f1f..a99386a 100644
--- a/gnu/packages/guile.scm
+++ b/gnu/packages/guile.scm
@@ -7,6 +7,7 @@
 ;;; Copyright © 2016 Erik Edrosa <erik.edrosa@gmail.com>
 ;;; Copyright © 2016 Eraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2016 Alex Kost <alezost@gmail.com>
+;;; Copyright © 2016 Adonay "adfeno" Felipe Nogueira <https://libreplanet.org/wiki/User:Adfeno> <adfeno@openmailbox.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -305,7 +306,8 @@ applicable."
                                   version ".tar.gz"))
               (sha256
                (base32
-                "19m3ak12cqk8js9d2mdg11kh4fjsq8frfpd10qw75h0zpr5cywpp"))))
+                "19m3ak12cqk8js9d2mdg11kh4fjsq8frfpd10qw75h0zpr5cywpp"))
+              (patches (search-patches "artanis-fix-Makefile.in.patch"))))
     (build-system gnu-build-system)
     ;; TODO: Add guile-dbi and guile-dbd optional dependencies.
     (inputs `(("guile" ,guile-2.0)))
@@ -315,12 +317,14 @@ applicable."
     (arguments
      '(#:make-flags
        ;; TODO: The documentation must be built with the `docs' target.
-       (let* ((out (assoc-ref %outputs "out"))
-              (dir (string-append out "/share/guile/site/2.0")))
+       (let*
+           ((dir
+              (string-append
+                (assoc-ref %outputs "out")
+                "/share/guile/site/2.0")))
          ;; Don't use (%site-dir) for site paths.
          (list (string-append "MOD_PATH=" dir)
-               (string-append "MOD_COMPILED_PATH=" dir)
-               (string-append "DESTDIR=" out)))
+               (string-append "MOD_COMPILED_PATH=" dir)))
        #:test-target "test"
        #:phases
        (modify-phases %standard-phases
diff --git a/gnu/packages/patches/artanis-fix-Makefile.in.patch b/gnu/packages/patches/artanis-fix-Makefile.in.patch
new file mode 100644
index 0000000..7e4800d
--- /dev/null
+++ b/gnu/packages/patches/artanis-fix-Makefile.in.patch
@@ -0,0 +1,70 @@
+Applies until an Artanis release comes with the following patches
+applied:
+* <https://savannah.gnu.org/patch/?func=detailitem&item_id=9130>
+* <https://savannah.gnu.org/patch/?func=detailitem&item_id=9131>
+diff -ru artanis-0.1.2/Makefile.in artanis-0.1.2.1/Makefile.in
+--- artanis-0.1.2/Makefile.in	2016-02-10 12:35:18.800490571 -0200
++++ artanis-0.1.2.1/Makefile.in	2016-10-15 19:44:35.140907367 -0300
+@@ -19,9 +19,18 @@
+ MOD_OBJ := $(OBJ)/artanis
+ BIN := bin
+ TEMP_LIB_PATH := $(OBJ)
+-MOD_PATH := $(shell guile -c "(display (%site-dir))")
+ MOD_COMPILED_PATH := $(shell guile -c "(display (%site-ccache-dir))")
++
++ifdef DESTDIR
++INFO_DIR := $(DESTDIR)/share/info/
++MOD_PATH := $(DESTDIR)/$(shell guile -c "(display (%site-dir))")
+ MOD_TARGET_PATH := $(DESTDIR)/$(MOD_COMPILED_PATH)
++else
++INFO_DIR := $(PREFIX)/share/info/
++MOD_PATH := $(shell guile -c "(display (%site-dir))")
++MOD_TARGET_PATH := $(MOD_COMPILED_PATH)
++endif
++
+ GUILE_CFLAGS := -Wunsupported-warning -Wunbound-variable -Warity-mismatch -Wduplicate-case-datum -Wbad-case-datum -Wformat
+ GUILEC := GUILE_LOAD_COMPILED_PATH=$(TEMP_LIB_PATH) guild compile $(GUILE_CFLAGS)
+ ARTANIS_ETC := $(SRC)/etc/artanis
+@@ -36,7 +45,6 @@
+ GENDOCS :=$(BUILD_AUX)/gendocs.sh
+ CHK_TEXINFO := $(BUILD_AUX)/check_texinfo.scm
+ CP := cp -frd -P
+-INFO_DIR := $(PREFIX)/share/info/
+ TARBALL_NAME := artanis-$(VERSION)
+ TMP_DIR := $(shell mktemp -d)
+ ANN_GEN := $(BUILD_AUX)/announce-gen
+@@ -124,18 +132,29 @@
+ 	-rm -f config.{h,log}
+ 
+ install: $(ALL_TARGETS)
+-	mkdir -p $(DESTDIR)/$(MOD_PATH)
+-	$(CP) $(MOD) $(DESTDIR)/$(MOD_PATH)/
++	mkdir -p $(MOD_PATH)
++	$(CP) $(MOD) $(MOD_PATH)/
+ 	mkdir -p $(MOD_TARGET_PATH)/
+ 	$(CP) $(MOD_OBJ) $(MOD_TARGET_PATH)/
++
++ifdef DESTDIR
+ 	$(CP) $(ARTANIS_ETC) $(DESTDIR)/etc/
+ 	$(CP) $(ARTANIS_PAGES) $(DESTDIR)/etc/artanis/
+-	mkdir -p $(DESTDIR)/$(PREFIX)/bin/
+-	$(CP) $(BIN)/art $(DESTDIR)/$(PREFIX)/bin/
++	mkdir -p $(DESTDIR)/bin/
++	$(CP) $(BIN)/art $(DESTDIR)/bin/
+ 	mkdir -p $(DESTDIR)/etc/bash_completion.d/
+ 	$(CP) $(CMDCOMP) $(DESTDIR)/etc/bash_completion.d/
++else
++	$(CP) $(ARTANIS_ETC) $(PREFIX)/etc/
++	$(CP) $(ARTANIS_PAGES) $(PREFIX)/etc/artanis/
++	mkdir -p $(PREFIX)/bin/
++	$(CP) $(BIN)/art $(PREFIX)/bin/
++	mkdir -p $(PREFIX)/etc/bash_completion.d/
++	$(CP) $(CMDCOMP) $(PREFIX)/etc/bash_completion.d/
++endif
++
+ 	if [ -e /etc/bash.bashrc ]; then source /etc/bash.bashrc; fi
+-	if [ -e artanis.info ]; then mkdir -p $(DESTDIR)/$(INFO_DIR); $(CP) artanis.info $(DESTDIR)/$(INFO_DIR)/; fi
++	if [ -e artanis.info ]; then mkdir -p $(INFO_DIR); $(CP) artanis.info $(INFO_DIR)/; fi
+ 
+ distclean: distclean-mk clean clean-config clean-tarball
+ 	-rm -f $(BIN)/art
-- 
1.9.1


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 213 bytes --]

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

* Re: gnu: artanis: Remove implied $(DESTDIR) usage.
  2016-10-17 12:54   ` Adonay Felipe Nogueira
@ 2016-10-17 14:27     ` Marius Bakke
  0 siblings, 0 replies; 4+ messages in thread
From: Marius Bakke @ 2016-10-17 14:27 UTC (permalink / raw)
  To: Adonay Felipe Nogueira, guix-devel

Adonay Felipe Nogueira <adfeno@openmailbox.org> writes:

> Oh my! ... Sorry for being careless. I guess I was so happy to finally
> fix the problem upstream that I forgot to adapt our recipe accordingly.
>
> Thanks for testing. :)
>
> I have made the patch again, and also properly referenced the patch
> tickets from upstream.

Thanks! I made slight adjustments to the commit message and kept the
original (let* ((out ...))) to make it clearer what the patch does.

Pushed as 8a666bc5cb3c50b4b881290c7776c3f681a734bc !

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

end of thread, other threads:[~2016-10-17 14:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-16  1:40 gnu: artanis: Remove implied $(DESTDIR) usage Adonay Felipe Nogueira
2016-10-17  2:13 ` Marius Bakke
2016-10-17 12:54   ` Adonay Felipe Nogueira
2016-10-17 14:27     ` Marius Bakke

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