* Building Python pkg - date2name
@ 2021-04-24 13:10 phodina via
2021-04-29 6:42 ` Carlo Zancanaro
0 siblings, 1 reply; 2+ messages in thread
From: phodina via @ 2021-04-24 13:10 UTC (permalink / raw)
To: help-guix@gnu.org
Hi, I'm trying to build a python module date2name. However, I can't use guix import pypi date2name as I get error:
guix import: error: no source release for pypi package date2name 2018.05.09.1
So I just download it from github and attempt the build. But, it does not have a setup.py file and fails in the build phase.
In Guix manual there is option #:use-setuptools? #f but I also doesn't help.
Could you please provide guidance how to build the package?
(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
(package
(name "date2name")
(version "master")
(source (origin
(method git-fetch)
(uri
(git-reference
(url "https://github.com/novoid/date2name")
(commit version)))
(sha256
(base32
"064kydcry8jswbbvl1g7gg2pqmyz2fqk4j7k81pzlvb1vjnqjphd"))))
(build-system python-build-system)
(arguments
`(#:use-setuptools? #f))
(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)))
Kind regards
Petr Hodina
Sent with [ProtonMail](https://protonmail.com) Secure Email.
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Building Python pkg - date2name
2021-04-24 13:10 Building Python pkg - date2name phodina via
@ 2021-04-29 6:42 ` Carlo Zancanaro
0 siblings, 0 replies; 2+ messages in thread
From: Carlo Zancanaro @ 2021-04-29 6:42 UTC (permalink / raw)
To: phodina; +Cc: help-guix
[-- 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))))
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-04-29 6:43 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-24 13:10 Building Python pkg - date2name phodina via
2021-04-29 6:42 ` Carlo Zancanaro
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.