From 86de22b526313a68e5c8bb8a361d5904c30d8b51 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Mon, 16 May 2016 22:20:12 +0100 Subject: Initial commit --- guix-env.scm | 217 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 217 insertions(+) create mode 100644 guix-env.scm (limited to 'guix-env.scm') diff --git a/guix-env.scm b/guix-env.scm new file mode 100644 index 0000000..eb188e3 --- /dev/null +++ b/guix-env.scm @@ -0,0 +1,217 @@ +(use-modules ((guix licenses) #:select (bsd-3 gpl3+ psfl)) + (guix packages) + (guix download) + (guix git-download) + (guix gexp) + (guix build-system gnu) + (guix build-system cmake) + (guix build-system python) + (guix build-system trivial) + (gnu packages python) + (gnu packages xml) + (gnu packages tls) + (gnu packages emacs) + (gnu packages package-management) + (gnu packages zip) + (gnu packages swig) + (gnu packages compression) + (gnu packages guile)) + +(define libsolv + (package + (name "libsolv") + (version "0.6.22") + (source (origin + (method url-fetch) + (uri (string-append "https://github.com/openSUSE/libsolv/archive/" + version ".tar.gz")) + (file-name (string-append name "-" version ".tar.gz")) + (modules '((guix build utils))) + (sha256 + (base32 + "0zl7dlqmib05y5f2wkbz66n68bmqk2fxhvph1dfr071v7jnzc6gf")) + (snippet + '(substitute* '("bindings/python/CMakeLists.txt") + (("EXECUTE_PROCESS.*") "") + (("libsolv ") "libsolv python2.7 ") + )))) + (build-system cmake-build-system) + (inputs + `(("expat" ,expat) + ("zlib" ,zlib) + ("python" ,python-2.7) + ("swig" ,swig))) + (arguments + '(#:configure-flags + (list (string-append "-DPYTHON_INSTALL_DIR=" + (assoc-ref %outputs "out") "/lib/python2.7/site-packages") + "-DENABLE_PYTHON=1" + (string-append ; uses lib64 by default + "-DLIB=lib") + (string-append "-DCMAKE_INSTALL_RPATH=" + (assoc-ref %outputs "out") "/lib")))) + ;(assoc-ref %outputs "out") "/lib:" + ;(assoc-ref %outputs "out") "/lib64")))) + (home-page "https://github.com/openSUSE/libsolv") + (synopsis "libsolv") + (description "") + (license bsd-3))) + +(define pyguile + (package + (name "pyguile") + (version "0.3.1") + (source (origin + (method git-fetch) + (uri (git-reference + (url "http://git.cbaines.net/pyguile") + (commit "HEAD"))) + (sha256 + (base32 + "037w1bf58yn4kfy5jydd1jzfi7dpg0m2w8p1sd2wnr6py03hybwq")))) + ;(source (origin + ; (method url-fetch) + ; (uri (string-append "https://github.com/cbaines/pyguile/archive/v" + ; version ".tar.gz")) + ; (file-name (string-append name "-" version ".tar.gz")) + ; (modules '((guix build utils))) + ; (sha256 + ; (base32 + ; "0ds5pnm4dc0vyfa5wlyw9dvzl6dyiizh4q8s153byyn8jkiimb5c")))) + (build-system cmake-build-system) + (inputs + `(("python" ,python-2.7) + ("guile" ,guile-2.0))) + (arguments + '(;#:tests? #f ; no tests + ;#:make-flags (list "CC=gcc" + ; (string-append "PREFIX=" %output)) + #:phases + (modify-phases %standard-phases + (delete 'configure) + (delete 'check) + (replace 'build + (lambda* (#:key outputs #:allow-other-keys) + ;(chdir "..") + (display "CWD ")(display (getcwd))(display "\n") + (let ((out (assoc-ref outputs "out"))) + (zero? + (system* "make" "CC=gcc"))))) + (replace + 'install + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (guild (string-append (assoc-ref %build-inputs "guile") + "/bin/guild")) + (scm-dir + (string-append out "/share/guile/site/2.0/")) + (scm-path + (string-append scm-dir "pyguile.scm")) + (lib-dir + (string-append out "/lib/")) + (lib-path + (string-append lib-dir "libpyguile.so"))) + (mkdir-p scm-dir) + (mkdir-p lib-dir) + (copy-file "pyguile.scm" scm-path) + (copy-file "libpyguile.so" lib-path) + (substitute* scm-path + (("libpyguile") + (string-append lib-dir "libpyguile"))) + (setenv "GUILE_AUTO_COMPILE" "0") + (unless (zero? + (system* guild "compile" scm-path + "-o" (string-append scm-dir "pyguile.go"))) + (error "failed to compile")) + #t)))))) + (home-page "https://github.com/tddpirate/pyguile") + (synopsis "pyguile") + (description "") + (license bsd-3))) + +(define python-packaging + (package + (name "python-packaging") + (version "16.7") + (source + (origin + (method url-fetch) + (uri (string-append + "https://pypi.python.org/packages/28/ad/4e6601d14b11bb300719a8bb6247f6ef5861467a692523c978a4e9e3981a/packaging-" + version + ".tar.gz")) + (sha256 + (base32 + "07h18mrpqs0lv2x4fl43pqi0xj6hdrmrnm6v9q634yliagg6q91f")))) + (build-system python-build-system) + (inputs + `(("python-setuptools" ,python-setuptools))) + (propagated-inputs + `(("python-pyparsing" ,python-pyparsing) + ("python-six" ,python-six))) + (home-page "https://github.com/pypa/packaging") + (synopsis "Core utilities for Python packages") + (description + "Core utilities for Python packages") + (license #f))) + +(define python2-packaging + (package-with-python2 python-packaging)) + +(define python-setuptools + (package + (name "python-setuptools") + (version "20.10.1") + (source + (origin + (method url-fetch) + (uri "https://pypi.python.org/packages/d3/16/21cf5dc6974280197e42d57bf7d372380562ec69aef9bb796b5e2dbbed6e/setuptools-20.10.1.tar.gz") + (sha256 + (base32 + "1pdm34rjixkdyp5j2yp774ri1da7ncqy8s34h4qxdl4yy22whn9y")))) + (build-system python-build-system) + ;; FIXME: Tests require pytest, which itself relies on setuptools. + ;; One could bootstrap with an internal untested setuptools. + (arguments + `(#:tests? #f)) + (home-page "https://pypi.python.org/pypi/setuptools") + (synopsis + "Library designed to facilitate packaging Python projects") + (description + "Setuptools is a fully-featured, stable library designed to facilitate +packaging Python projects, where packaging includes: +Python package and module definitions, +distribution package metadata, +test hooks, +project installation, +platform-specific details, +Python 3 support.") + (license psfl))) + +(define python2-setuptools + (package-with-python2 python-setuptools)) + +(define guix-pypi-utils + (package + (name "guix-pypi-utils") + (version "0.1") + (source (local-file "." #:recursive? #t)) + (build-system trivial-build-system) + (inputs + `(("unzip" ,unzip) + ("libsolv" ,libsolv) + ("guile" ,guile-2.0))) + (propagated-inputs + `(("guix" ,guix-0.11.0) + ("guile-lib" ,guile-lib) + ("guile-json" ,guile-json) + ("pyguile" ,pyguile) + ("python" ,python-2.7) + ("python2-setuptools" ,python2-setuptools) + ("python2-packaging" ,python2-packaging))) + (home-page "https://example.com") + (synopsis "guix-pypi-utils") + (description "") + (license gpl3+))) + +guix-pypi-utils -- cgit v1.2.3