unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Jesse Gibbons <jgibbons2357@gmail.com>
To: Tobias Geerinckx-Rice <me@tobias.gr>
Cc: guix-devel@gnu.org
Subject: Re: 01/01: services: Add ‘/usr/bin/env’ special file.
Date: Sat, 07 Sep 2019 09:33:55 -0600	[thread overview]
Message-ID: <76a6cc31864fabfb4804e91b7f5086b2f59ccbff.camel@gmail.com> (raw)
In-Reply-To: <87lfv0wnjw.fsf@nckx>

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

Hi T-G-R,
On Sat, 2019-09-07 at 09:52 +0200, Tobias Geerinckx-Rice wrote:
> Jesse,
> 
> Thanks!  It was linked from another thread[0] Ludo' pasted to my 
> patch, though.  I've read both.
> 
> Jesse Gibbons 写道:
> > Here's a post with what I think is a good argument against 
> > adding
> > /usr/bin/env. I think the standard patch-shebang phase does a 
> > good job
> > at preventing the potential issue, but the argument still 
> > applies to
> 
> So is the argument here that Guix packages would generate scripts 
> at run-time that refer to /usr/bin/env?  Or just that it's 
> currently easy to catch packages that install #!/usr/bin/env 
> scripts?  Or something else?
> 
> Neither /bin/sh nor /usr/bin/env are available in the build 
> environment.  Relying on the *likely* run-time non-existence of 
> /usr/bin/env in *user* environments to catch *packaging* bugs does 
> not sound acceptable to me.
> 
> > scripts generated by make, as I learned while attempting to port
> > pysolfc.
> 
> If you have the time, could you elaborate?
It's a bit complicated.
Pysolfc has a horrible build system. It doesn't build the required i18n
unless you call "make test". Howevver, "make test" runs a script
generates python test scripts that use #!/usr/bin/env to find both
python and python2. Since they are generated by a shell script, patch-
shebangs does not catch them, and it fails to find /usr/bin/env. It's a
mess that I don't know how to solve.

I've attached my pysolfc.scm so you can observe what I mean. Sorry it's
a horrible mess of commented broken code.
> 
> Kind regards,
> 
> T G-R
> 
> [0]: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=35910

-- 
-Jesse

[-- Attachment #2: pysolfc.scm --]
[-- Type: text/x-scheme, Size: 5889 bytes --]

;;; Broken Guix
;;; Guix packages that are in-progress, broken, nonfree, or otherwise will
;;; not build and run to my satisfaction.
;;;
;;; Copyright (C) 2019 Jesse Gibbons
;;;
;;; This program is free software: you can redistribute it and/or modify
;;; it under the terms of the GNU General Public License as published by
;;; the Free Software Foundation, either version 3 of the License, or
;;; (at your option) any later version.
;;;
;;; This program is distributed in the hope that it will be useful,
;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with this program.  If not, see <https://www.gnu.org/licenses/>.
(define-module (broken-packages pysolfc)
  #:use-module (guix packages)
  #:use-module (guix download)
  #:use-module (guix build-system python)
  #:use-module (guix licenses)
  #:use-module (guix gexp)
  #:use-module (gnu packages python)
  #:use-module (gnu packages python-xyz)
  #:use-module (gnu packages compression)
  #:use-module (gnu packages base)
  #:use-module (gnu packages perl)
  )

(define-public pysolfc
  (package
   (name "pysolfc")
   (version "2.6.4")
   (source
    (origin
     (method url-fetch)
     (uri (string-append
	   "https://github.com/shlomif/PySolFC/archive/pysolfc-"
	   version
	   ".tar.gz"))
     (sha256
      (base32
       "17r9mbn4fj6kbxhllsab74gfjac0j2mjdwkkwaxp6cqpy4dss3z8"))))
   (build-system python-build-system)
   (native-inputs
     `(("make" ,gnu-make)
       ("perl" ,perl)
       ("python2" ,python-2)
       ("moose" ,perl-moose)
       ("coreutils" ,coreutils)
       ("python2-pycotap" ,python2-pycotap)
       ))
    (propagated-inputs
     `(
       ("python2-six"  ,python2-six)
       ("python2-tkinter" ,python-2 "tk")
       ("python2-random2" ,python2-random2)
       ("python2" ,python-2)
       ("python-six"  ,python-six)
       ("python-tkinter" ,python "tk")
       ("python-random2" ,python-random2)))
   (arguments
    `(#:python ,python
      #:phases (modify-phases %standard-phases
			      ;; (add-before 'patch-generated-file-shebangs 'generate-tests
			      ;; 		 (lambda _
			      ;; 		   (begin
			      ;; 		     (invoke "make" "pretest")
			      ;; 		     (system "echo =================")
			      ;; 		     (invoke "echo" (string-append "#!" (which "env")))
			      ;; 		     (substitute* (find-files "tests" "\\.py$")
			      ;; 				  (("#!/usr/bin/env")
			      ;; 				   (string-append "#!" (which "env"))))
			      ;; 		     )))
			      ;; (add-before 'build 'make-test
			      ;; 		 (lambda _
			      ;; 		   (begin
			      ;; 		     (system "cat tests/unit-generated/*")
			      ;; 		     (invoke "false")
			      ;; 		     (invoke "make" "test")
			      ;; 		     )))
			      (add-before 'build 'make-rules
					  (lambda _
					    (begin
					      (invoke "make" "rules"))))
			      (add-after 'make-rules 'move-images
					 (lambda _
					   (begin
					     (invoke "false")
					     #t
					     ))))))
   
   (home-page "https://pysolfc.sourceforge.io/")
   (synopsis
    "Solitaire Collection, Written in Python")
   (description
    "PySol Fan Club Edition (PySolFC) is a collection of more than 1000 solitaire card games. It is a fork of PySol Solitaire.")
   (license gpl3+)))

(define python-random2
  (package
   (name "python-random2")
   (version "1.0.1")
   (source
    (origin
     (method url-fetch)
     (uri (pypi-uri "random2" version ".zip"))
     (sha256
      (base32
       "01y0s4747plsx8fdnxy0nz83dp69naddz58m81r9h0s1qfm31b9l"))))
   (native-inputs
    `(("unzip" ,unzip)))
   (build-system python-build-system)
   (arguments
    `(#:python ,python
      #:use-setuptools? #f))
   (home-page "http://pypi.python.org/pypi/random2")
   (synopsis
    "Python 3 compatible Pytohn 2 `random` Module.")
   (description
    "Python 3 compatible Pytohn 2 `random` Module.")
   (license #f)))

(define python2-random2
  (package
   (name "python2-random2")
   (version "1.0.1")
   (source
    (origin
     (method url-fetch)
     (uri (pypi-uri "random2" version ".zip"))
     (sha256
      (base32
       "01y0s4747plsx8fdnxy0nz83dp69naddz58m81r9h0s1qfm31b9l"))))
   (native-inputs
    `(("unzip" ,unzip)))
   (build-system python-build-system)
   (arguments
    `(#:python ,python-2
      #:use-setuptools? #f))
   (home-page "http://pypi.python.org/pypi/random2")
   (synopsis
    "Python 3 compatible Pytohn 2 `random` Module.")
   (description
    "Python 3 compatible Pytohn 2 `random` Module.")
   (license #f)))

(define-public python-pycotap
  (package
   (name "python-pycotap")
   (version "1.1.0")
   (source
    (origin
     (method url-fetch)
     (uri (pypi-uri "pycotap" version))
     (sha256
      (base32
       "128qn7zjn95nivcxbxjclkwjw2qif5sf9c1b8rrsczcpn78kckf1"))))
   (inputs `(("python" ,python)))
   (build-system python-build-system)
   (arguments
    `(#:python ,python))
   (home-page "https://el-tramo.be/pycotap")
   (synopsis
    "A tiny test runner that outputs TAP results to standard output.")
   (description
    "A tiny test runner that outputs TAP results to standard output.")
   (license expat)))

(define-public python2-pycotap
  (package
   (name "python2-pycotap")
   (version "1.1.0")
   (source
    (origin
     (method url-fetch)
     (uri (pypi-uri "pycotap" version))
     (sha256
      (base32
       "128qn7zjn95nivcxbxjclkwjw2qif5sf9c1b8rrsczcpn78kckf1"))))
   (build-system python-build-system)
   (arguments
    `(#:python ,python-2))
   (home-page "https://el-tramo.be/pycotap")
   (synopsis
    "A tiny test runner that outputs TAP results to standard output.")
   (description
    "A tiny test runner that outputs TAP results to standard output.")
   (license expat)))

  reply	other threads:[~2019-09-07 15:34 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20190906102509.28951.2772@vcs0.savannah.gnu.org>
     [not found] ` <20190906102510.002BE21324@vcs0.savannah.gnu.org>
2019-09-06 10:36   ` 01/01: services: Add ‘/usr/bin/env’ special file Christopher Baines
2019-09-06 10:44     ` pelzflorian (Florian Pelz)
2019-09-06 10:47       ` pelzflorian (Florian Pelz)
2019-09-06 15:54     ` Tobias Geerinckx-Rice
2019-09-06 23:21       ` Mark H Weaver
2019-09-07  5:05         ` Jesse Gibbons
2019-09-07  7:52           ` Tobias Geerinckx-Rice via Development of GNU Guix and the GNU System distribution.
2019-09-07 15:33             ` Jesse Gibbons [this message]
2019-09-07 10:06         ` Tobias Geerinckx-Rice
2019-09-07 15:03           ` Jesse Gibbons
2019-09-08 21:48             ` Ludovic Courtès
2019-09-08 23:53               ` Jesse Gibbons
2019-09-08 22:19         ` Tobias Geerinckx-Rice
2019-09-06 23:47       ` Mark H Weaver
2019-09-07  8:54         ` Tobias Geerinckx-Rice
2019-09-07 14:41       ` Marius Bakke
2019-09-07 17:56         ` Ricardo Wurmus
2019-09-08 11:55           ` Konrad Hinsen
2019-09-08 18:31             ` Hartmut Goebel
2019-09-08 22:07           ` Ludovic Courtès
2019-09-09  7:01             ` Bengt Richter
2019-09-09  8:13               ` Ludovic Courtès
2019-09-09  1:37           ` Chris Marusich

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

  List information: https://guix.gnu.org/

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

  git send-email \
    --in-reply-to=76a6cc31864fabfb4804e91b7f5086b2f59ccbff.camel@gmail.com \
    --to=jgibbons2357@gmail.com \
    --cc=guix-devel@gnu.org \
    --cc=me@tobias.gr \
    /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 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).