all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Carlo Zancanaro <carlo@zancanaro.id.au>
To: phodina <phodina@protonmail.com>
Cc: help-guix@gnu.org
Subject: Re: Building Python pkg - date2name
Date: Thu, 29 Apr 2021 16:42:23 +1000	[thread overview]
Message-ID: <8735v9pp68.fsf@zancanaro.id.au> (raw)
In-Reply-To: <AEgGqsePWNfW8Hsj6khGdXGzlUGAzpCEKnz31zmCfw1aTdpkgy6wTfb_JG4PNode4AGmdhlvMrEVa6STFjdCAC__CthCPTwNMjdg2zikGoI=@protonmail.com>

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

Hi Petr,

I had a look at the date2name repository in Github, and it doesn't 
look like it has any instructions for packaging it at all. I'm not 
sure how they build things to distribute over pypi.

At any rate, it looks like it's mostly a matter of marking 
__init__.py as executable, and renaming it to bin/date2name, so 
I've attached a package definition that does that. I have 
confirmed that I am able to build and run it, but I can't confirm 
its behaviour as I don't use the tool.

I hope that helps!

Carlo


[-- Attachment #2: date2name.scm --]
[-- Type: application/octet-stream, Size: 1607 bytes --]

(define-module (expanse packages date2name)
  #:use-module (guix packages)
  #:use-module (guix git-download)
  #:use-module (guix build-system python)
  #:use-module (guix licenses))

(define-public date2name
  (let ((commit "7184c1f28219346da2821c19977e065a10d2cb1b")
        (version "0.0.1"))
    (package
     (name "date2name")
     (version version)
     (source (origin
              (method git-fetch)
              (uri
               (git-reference
                (url "https://github.com/novoid/date2name")
                (commit commit)))
              (sha256
               (base32
                "064kydcry8jswbbvl1g7gg2pqmyz2fqk4j7k81pzlvb1vjnqjphd"))))
     (build-system python-build-system)
     (arguments
      `(#:tests? #f ; no tests
        #:phases
        (modify-phases %standard-phases
          (delete 'build)
          (replace 'install
            (lambda* (#:key outputs #:allow-other-keys)
              (let* ((bindir (string-append (assoc-ref outputs "out") "/bin"))
                     (binary (string-append bindir "/date2name")))
                (mkdir-p bindir)
                (copy-file "date2name/__init__.py" binary)
                (chmod binary #o555)))))))
     (synopsis "Handling time-stamps and date-stamps in file names")
     (description "Per default, date2name gets the modification time
of matching files and directories and adds a datestamp in standard ISO
8601+ format YYYY-MM-DD (http://datestamps.org/index.shtml) at the
beginning of the file- or directory name.")
     (home-page "https://github.com/novoid/date2name")
     (license gpl3))))

      reply	other threads:[~2021-04-29  6:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-24 13:10 Building Python pkg - date2name phodina via
2021-04-29  6:42 ` Carlo Zancanaro [this message]

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=8735v9pp68.fsf@zancanaro.id.au \
    --to=carlo@zancanaro.id.au \
    --cc=help-guix@gnu.org \
    --cc=phodina@protonmail.com \
    /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.