From 2b8491fbbe818944baf454faf1326034022ac320 Mon Sep 17 00:00:00 2001 From: Julien Lepiller Date: Fri, 30 Aug 2019 22:52:06 +0200 Subject: gnu: mariadb: Split into out, lib and dev. * gnu/packages/databases.scm (mariadb): Split into out, lib and dev. (perl-dbd-mysql, python-mysqlclient): Adjust dependencies. * gnu/packages/bioinformatics.scm (kentutils): Adjust dependencies. * gnu/packages/cran.scm (r-rmysql): Adjust dependencies. * gnu/packages/emacs-xyz.scm (emacs-emacsql): Adjust dependencies. * gnu/packages/kodi.scm (kodi): Adjust dependencies. * gnu/packages/qt.scm (qt, qtbase): Adjust dependencies. * gnu/packages/ruby.scm (ruby-mysql2): Adjust dependencies. --- gnu/packages/databases.scm | 57 +++++++++++++++++++++++++++++++++------------- 1 file changed, 41 insertions(+), 16 deletions(-) (limited to 'gnu/packages/databases.scm') diff --git a/gnu/packages/databases.scm b/gnu/packages/databases.scm index bb7adf25a6..ca2ca9bda0 100644 --- a/gnu/packages/databases.scm +++ b/gnu/packages/databases.scm @@ -647,9 +647,11 @@ (define-public mariadb (find-files "pcre") (find-files "zlib"))) #t)))) (build-system cmake-build-system) + (outputs '("out" "lib" "dev")) (arguments `(#:configure-flags - '("-DBUILD_CONFIG=mysql_release" + (list + "-DBUILD_CONFIG=mysql_release" ;; Linking with libarchive fails, like this: ;; ld: /gnu/store/...-libarchive-3.2.2/lib/libarchive.a(archive_entry.o): @@ -673,15 +675,26 @@ (define-public mariadb "-DDEFAULT_COLLATION=utf8_general_ci" "-DMYSQL_DATADIR=/var/lib/mysql" "-DMYSQL_UNIX_ADDR=/run/mysqld/mysqld.sock" - "-DINSTALL_INFODIR=share/mysql/docs" - "-DINSTALL_MANDIR=share/man" + (string-append "-DCMAKE_INSTALL_PREFIX=" (assoc-ref %outputs "lib")) + (string-append "-DCMAKE_INSTALL_RPATH=" (assoc-ref %outputs "lib") + "/lib") + (string-append "-DINSTALL_INFODIR=" (assoc-ref %outputs "out") + "/share/mysql/docs") + (string-append "-DINSTALL_MANDIR=" (assoc-ref %outputs "out") + "/share/man") + (string-append "-DINSTALL_SCRIPTDIR=" (assoc-ref %outputs "out") "/bin") + (string-append "-DINSTALL_BINDIR=" (assoc-ref %outputs "out") "/bin") + "-DCMAKE_INSTALL_LIBDIR=lib" "-DINSTALL_PLUGINDIR=lib/mysql/plugin" - "-DINSTALL_SCRIPTDIR=bin" - "-DINSTALL_INCLUDEDIR=include/mysql" - "-DINSTALL_DOCREADMEDIR=share/mysql/docs" - "-DINSTALL_SUPPORTFILESDIR=share/mysql/support-files" + (string-append "-DINSTALL_INCLUDEDIR=" (assoc-ref %outputs "dev") + "/include/mysql") + (string-append "-DINSTALL_DOCREADMEDIR=" (assoc-ref %outputs "out") + "/share/mysql/docs") + (string-append "-DINSTALL_DOCDIR=" (assoc-ref %outputs "out") + "/share/mysql/docs") + (string-append "-DINSTALL_SUPPORTFILESDIR=" (assoc-ref %outputs "out") + "/share/mysql/support-files") "-DINSTALL_MYSQLSHAREDIR=share/mysql" - "-DINSTALL_DOCDIR=share/mysql/docs" "-DINSTALL_SHAREDIR=share") #:phases (modify-phases %standard-phases @@ -764,19 +777,29 @@ (define-public mariadb 'install 'post-install (lambda* (#:key outputs #:allow-other-keys) (let* ((out (assoc-ref outputs "out")) - (test (assoc-ref outputs "test"))) + (dev (assoc-ref outputs "dev")) + (lib (assoc-ref outputs "lib"))) (substitute* (string-append out "/bin/mysql_install_db") (("basedir=\"\"") (string-append "basedir=\"" out "\""))) ;; Remove unneeded files for testing. - (with-directory-excursion out + (with-directory-excursion lib (for-each delete-file-recursively - '("data" "mysql-test" "sql-bench" - "share/man/man1/mysql-test-run.pl.1")) - ;; Delete huge and unnecessary executables. - (for-each delete-file (find-files "bin" "(test|embedded)")) + '("data" "mysql-test" "sql-bench")) ;; And static libraries. (for-each delete-file (find-files "lib" "\\.a$"))) + (with-directory-excursion out + (delete-file "share/man/man1/mysql-test-run.pl.1") + ;; Delete huge and unnecessary executables. + (for-each delete-file (find-files "bin" "(test|embedded)"))) + (mkdir-p (string-append dev "/share")) + (mkdir-p (string-append dev "/bin")) + (rename-file (string-append lib "/bin/mysqld") + (string-append out "/bin/mysqld")) + (rename-file (string-append lib "/share/pkgconfig") + (string-append dev "/share/pkgconfig")) + (rename-file (string-append out "/bin/mysql_config") + (string-append dev "/bin/mysql_config")) #t)))))) (native-inputs `(("bison" ,bison) @@ -1544,7 +1567,8 @@ (define-public perl-dbd-mysql #:tests? #f)) (propagated-inputs `(("perl-dbi" ,perl-dbi) - ("mysql" ,mariadb))) + ("mysql" ,mariadb "lib") + ("mysql-dev" ,mariadb "dev"))) (home-page "https://metacpan.org/release/DBD-mysql") (synopsis "DBI MySQL interface") (description "This package provides a MySQL driver for the Perl5 @@ -2662,7 +2686,8 @@ (define-public python-mysqlclient ("mock" ,python-mock) ("py.test" ,python-pytest))) (inputs - `(("mysql" ,mariadb) + `(("mysql" ,mariadb "lib") + ("mysql-dev" ,mariadb "dev") ("libz" ,zlib) ("openssl" ,openssl))) (home-page "https://github.com/PyMySQL/mysqlclient-python") -- cgit v1.2.3 From ae8a0184bf5a77f88b95e98d7e042110b082e970 Mon Sep 17 00:00:00 2001 From: Guillaume Le Vaillant Date: Wed, 20 Nov 2019 13:46:37 +0100 Subject: gnu: Add libdbi. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/databases.scm (libdbi): New variable. Signed-off-by: Ludovic Courtès --- gnu/packages/databases.scm | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'gnu/packages/databases.scm') diff --git a/gnu/packages/databases.scm b/gnu/packages/databases.scm index acce540e06..2ccaae205c 100644 --- a/gnu/packages/databases.scm +++ b/gnu/packages/databases.scm @@ -37,6 +37,7 @@ ;;; Copyright © 2019 Alex Griffin ;;; Copyright © 2019 Gábor Boskovits ;;; Copyright © 2019 Pierre Langlois +;;; Copyright © 2019 Guillaume Le Vaillant ;;; ;;; This file is part of GNU Guix. ;;; @@ -3170,3 +3171,24 @@ (define-public python-crate It implements the Python DB API 2.0 specification and includes support for SQLAlchemy.") (license license:asl2.0))) + +(define-public libdbi + (package + (name "libdbi") + (version "0.9.0") + (source (origin + (method url-fetch) + (uri (string-append "mirror://sourceforge/libdbi/libdbi/libdbi-" + version "/libdbi-" version ".tar.gz")) + (sha256 + (base32 + "00s5ra7hdlq25iv23nwf4h1v3kmbiyzx0v9bhggjiii4lpf6ryys")))) + (build-system gnu-build-system) + (synopsis "Database independent abstraction layer in C") + (description + "This library implements a database independent abstraction layer in C, +similar to the DBI/DBD layer in Perl. Writing one generic set of code, +programmers can leverage the power of multiple databases and multiple +simultaneous database connections by using this framework.") + (home-page "http://libdbi.sourceforge.net/") + (license license:lgpl2.1+))) -- cgit v1.2.3 From df81de86836686ac713a375bd647d49b8f8f344d Mon Sep 17 00:00:00 2001 From: Guillaume Le Vaillant Date: Wed, 20 Nov 2019 13:46:38 +0100 Subject: gnu: Add libdbi-drivers. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/databases.scm (libdbi-drivers): New variable. Signed-off-by: Ludovic Courtès --- gnu/packages/databases.scm | 68 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) (limited to 'gnu/packages/databases.scm') diff --git a/gnu/packages/databases.scm b/gnu/packages/databases.scm index 2ccaae205c..4be5912022 100644 --- a/gnu/packages/databases.scm +++ b/gnu/packages/databases.scm @@ -3192,3 +3192,71 @@ (define-public libdbi simultaneous database connections by using this framework.") (home-page "http://libdbi.sourceforge.net/") (license license:lgpl2.1+))) + +(define-public libdbi-drivers + (package + (name "libdbi-drivers") + (version "0.9.0") + (source (origin + (method url-fetch) + (uri (string-append "mirror://sourceforge/libdbi-drivers/" + "libdbi-drivers/libdbi-drivers-" version + "/libdbi-drivers-" version ".tar.gz")) + (sha256 + (base32 + "0m680h8cc4428xin4p733azysamzgzcmv4psjvraykrsaz6ymlj3")))) + (build-system gnu-build-system) + (native-inputs + `(("inetutils" ,inetutils) + ("glibc-locales" ,glibc-locales))) + (inputs + `(("libdbi" ,libdbi) + ("mysql" ,mariadb) + ("postgresql" ,postgresql) + ("sqlite" ,sqlite))) + (arguments + `(#:configure-flags + (let ((libdbi (assoc-ref %build-inputs "libdbi")) + (mysql (assoc-ref %build-inputs "mysql")) + (postgresql (assoc-ref %build-inputs "postgresql")) + (sqlite (assoc-ref %build-inputs "sqlite"))) + (list "--disable-docs" + (string-append "--with-dbi-incdir=" libdbi "/include") + (string-append "--with-dbi-libdir=" libdbi "/lib") + "--with-mysql" + (string-append "--with-mysql-incdir=" mysql "/include/mysql") + (string-append "--with-mysql-libdir=" mysql "/lib") + "--with-pgsql" + (string-append "--with-pgsql-incdir=" postgresql "/include") + (string-append "--with-pgsql-libdir=" postgresql "/lib") + "--with-sqlite3" + (string-append "--with-sqlite-incdir=" sqlite "/include") + (string-append "--with-sqlite-libdir=" sqlite "/lib"))) + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'fix-tests + (lambda* (#:key inputs #:allow-other-keys) + (substitute* "tests/test_mysql.sh" + (("^MYMYSQLD=.*") + (string-append "MYMYSQLD=" + (assoc-ref inputs "mysql") + "/bin/mysqld"))) + #t)) + (add-after 'install 'remove-empty-directories + (lambda* (#:key outputs #:allow-other-keys) + (let ((var (string-append (assoc-ref outputs "out") "/var"))) + (delete-file-recursively var)) + #t))))) + (synopsis "Database drivers for the libdbi framework") + (description + "The @code{libdbi-drivers} library provides the database specific drivers +for the @code{libdbi} framework. + +The drivers officially supported by @code{libdbi} are: +@itemize +@item MySQL, +@item PostgreSQL, +@item SQLite. +@end itemize") + (home-page "http://libdbi-drivers.sourceforge.net/") + (license license:lgpl2.1+))) -- cgit v1.2.3 From 312ec128af832dc5d22ce4f6ffe66920e69eda8f Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Wed, 4 Dec 2019 08:56:36 +0100 Subject: gnu: python-pandas: Move to (gnu packages python-science). * gnu/packages/python-xyz.scm (python-pandas, python2-pandas): Move from here... * gnu/packages/python-science.scm (python-pandas, python2-pandas): ...to here. * gnu/packages/benchmark.scm, gnu/packages/databases.scm, gnu/packages/graph.scm, gnu/packages/parallel.scm, gnu/packages/serialization.scm: Import (gnu packages python-science). --- gnu/packages/benchmark.scm | 1 + gnu/packages/databases.scm | 1 + gnu/packages/graph.scm | 1 + gnu/packages/parallel.scm | 1 + gnu/packages/python-science.scm | 98 ++++++++++++++++++++++++++++++++++++++++- gnu/packages/python-xyz.scm | 89 ------------------------------------- gnu/packages/serialization.scm | 1 + 7 files changed, 101 insertions(+), 91 deletions(-) (limited to 'gnu/packages/databases.scm') diff --git a/gnu/packages/benchmark.scm b/gnu/packages/benchmark.scm index c513370e74..8e347879dd 100644 --- a/gnu/packages/benchmark.scm +++ b/gnu/packages/benchmark.scm @@ -35,6 +35,7 @@ (define-module (gnu packages benchmark) #:use-module (gnu packages maths) #:use-module (gnu packages mpi) #:use-module (gnu packages python) + #:use-module (gnu packages python-science) #:use-module (gnu packages python-xyz) #:use-module (gnu packages storage) #:use-module (ice-9 match)) diff --git a/gnu/packages/databases.scm b/gnu/packages/databases.scm index 4be5912022..8260bfcb43 100644 --- a/gnu/packages/databases.scm +++ b/gnu/packages/databases.scm @@ -97,6 +97,7 @@ (define-module (gnu packages databases) #:use-module (gnu packages python) #:use-module (gnu packages python-crypto) #:use-module (gnu packages python-web) + #:use-module (gnu packages python-science) #:use-module (gnu packages python-xyz) #:use-module (gnu packages rdf) #:use-module (gnu packages readline) diff --git a/gnu/packages/graph.scm b/gnu/packages/graph.scm index 326477730b..52db619fb3 100644 --- a/gnu/packages/graph.scm +++ b/gnu/packages/graph.scm @@ -43,6 +43,7 @@ (define-module (gnu packages graph) #:use-module (gnu packages multiprecision) #:use-module (gnu packages pkg-config) #:use-module (gnu packages python) + #:use-module (gnu packages python-science) #:use-module (gnu packages python-web) #:use-module (gnu packages python-xyz) #:use-module (gnu packages statistics) diff --git a/gnu/packages/parallel.scm b/gnu/packages/parallel.scm index 0ad47bca0d..3cb39473fb 100644 --- a/gnu/packages/parallel.scm +++ b/gnu/packages/parallel.scm @@ -44,6 +44,7 @@ (define-module (gnu packages parallel) #:use-module (gnu packages perl) #:use-module (gnu packages pkg-config) #:use-module (gnu packages python) + #:use-module (gnu packages python-science) #:use-module (gnu packages python-xyz) #:use-module (gnu packages readline) #:use-module (gnu packages tcl) diff --git a/gnu/packages/python-science.scm b/gnu/packages/python-science.scm index 93fc63c2e7..4a262ec793 100644 --- a/gnu/packages/python-science.scm +++ b/gnu/packages/python-science.scm @@ -1,10 +1,13 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2015 Ricardo Wurmus +;;; Copyright © 2015, 2016 Ricardo Wurmus ;;; Copyright © 2015 Federico Beffa +;;; Copyright © 2016 Ben Woodcroft ;;; Copyright © 2016 Hartmut Goebel ;;; Copyright © 2016 Efraim Flashner -;;; Copyright © 2016, 2018 Marius Bakke +;;; Copyright © 2016, 2017, 2018, 2019 Marius Bakke ;;; Copyright © 2019 Tobias Geerinckx-Rice +;;; Copyright © 2019 Maxim Cournoyer +;;; Copyright © 2019 Giacomo Leidi ;;; ;;; This file is part of GNU Guix. ;;; @@ -30,8 +33,10 @@ (define-module (gnu packages python-science) #:use-module (gnu packages maths) #:use-module (gnu packages perl) #:use-module (gnu packages python) + #:use-module (gnu packages python-web) #:use-module (gnu packages python-xyz) #:use-module (gnu packages sphinx) + #:use-module (gnu packages time) #:use-module (guix packages) #:use-module (guix download) #:use-module (guix utils) @@ -191,3 +196,92 @@ (define-public python-scikit-image (define-public python2-scikit-image (package-with-python2 python-scikit-image)) + +(define-public python-pandas + (package + (name "python-pandas") + (version "0.25.2") + (source + (origin + (method url-fetch) + (uri (pypi-uri "pandas" version)) + (sha256 + (base32 "1gp2pvzdiakvgjmykdzdlzrsfbg4vjm49jjdl9s0ha0a3yfs34fa")))) + (build-system python-build-system) + (arguments + `(#:modules ((guix build utils) + (guix build python-build-system) + (ice-9 ftw) + (srfi srfi-26)) + #:phases (modify-phases %standard-phases + (add-after 'unpack 'patch-which + (lambda* (#:key inputs #:allow-other-keys) + (let ((which (assoc-ref inputs "which"))) + (substitute* "pandas/io/clipboard/__init__.py" + (("^CHECK_CMD = .*") + (string-append "CHECK_CMD = \"" which "\"\n")))) + #t)) + (replace 'check + (lambda _ + (let ((build-directory + (string-append + (getcwd) "/build/" + (car (scandir "build" + (cut string-prefix? "lib." <>)))))) + ;; Disable the "strict data files" option which causes + ;; the build to error out if required data files are + ;; not available (as is the case with PyPI archives). + (substitute* "setup.cfg" + (("addopts = --strict-data-files") "addopts = ")) + (with-directory-excursion build-directory + ;; Delete tests that require "moto" which is not yet + ;; in Guix. + (for-each delete-file + '("pandas/tests/io/conftest.py" + "pandas/tests/io/json/test_compression.py" + "pandas/tests/io/parser/test_network.py" + "pandas/tests/io/test_parquet.py")) + (invoke "pytest" "-vv" "pandas" "--skip-slow" + "--skip-network" "-k" + ;; XXX: Due to the deleted tests above. + "not test_read_s3_jsonl")))))))) + (propagated-inputs + `(("python-numpy" ,python-numpy) + ("python-openpyxl" ,python-openpyxl) + ("python-pytz" ,python-pytz) + ("python-dateutil" ,python-dateutil) + ("python-xlrd" ,python-xlrd))) + (inputs + `(("which" ,which))) + (native-inputs + `(("python-cython" ,python-cython) + ("python-beautifulsoup4" ,python-beautifulsoup4) + ("python-lxml" ,python-lxml) + ("python-html5lib" ,python-html5lib) + ("python-nose" ,python-nose) + ("python-pytest" ,python-pytest) + ("python-pytest-mock" ,python-pytest-mock))) + (home-page "https://pandas.pydata.org") + (synopsis "Data structures for data analysis, time series, and statistics") + (description + "Pandas is a Python package providing fast, flexible, and expressive data +structures designed to make working with structured (tabular, +multidimensional, potentially heterogeneous) and time series data both easy +and intuitive. It aims to be the fundamental high-level building block for +doing practical, real world data analysis in Python.") + (properties `((python2-variant . ,(delay python2-pandas)))) + (license license:bsd-3))) + +;; Pandas 0.24.x are the last versions that support Python 2. +(define-public python2-pandas + (let ((pandas (package-with-python2 + (strip-python2-variant python-pandas)))) + (package/inherit + pandas + (version "0.24.2") + (source (origin + (method url-fetch) + (uri (pypi-uri "pandas" version)) + (sha256 + (base32 + "18imlm8xbhcbwy4wa957a1fkamrcb0z988z006jpfda3ki09z4ag"))))))) diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm index 186e558f2f..30b84d26b4 100644 --- a/gnu/packages/python-xyz.scm +++ b/gnu/packages/python-xyz.scm @@ -1155,95 +1155,6 @@ (define-public python-schedule (define-public python2-schedule (package-with-python2 python-schedule)) -(define-public python-pandas - (package - (name "python-pandas") - (version "0.25.2") - (source - (origin - (method url-fetch) - (uri (pypi-uri "pandas" version)) - (sha256 - (base32 "1gp2pvzdiakvgjmykdzdlzrsfbg4vjm49jjdl9s0ha0a3yfs34fa")))) - (build-system python-build-system) - (arguments - `(#:modules ((guix build utils) - (guix build python-build-system) - (ice-9 ftw) - (srfi srfi-26)) - #:phases (modify-phases %standard-phases - (add-after 'unpack 'patch-which - (lambda* (#:key inputs #:allow-other-keys) - (let ((which (assoc-ref inputs "which"))) - (substitute* "pandas/io/clipboard/__init__.py" - (("^CHECK_CMD = .*") - (string-append "CHECK_CMD = \"" which "\"\n")))) - #t)) - (replace 'check - (lambda _ - (let ((build-directory - (string-append - (getcwd) "/build/" - (car (scandir "build" - (cut string-prefix? "lib." <>)))))) - ;; Disable the "strict data files" option which causes - ;; the build to error out if required data files are - ;; not available (as is the case with PyPI archives). - (substitute* "setup.cfg" - (("addopts = --strict-data-files") "addopts = ")) - (with-directory-excursion build-directory - ;; Delete tests that require "moto" which is not yet - ;; in Guix. - (for-each delete-file - '("pandas/tests/io/conftest.py" - "pandas/tests/io/json/test_compression.py" - "pandas/tests/io/parser/test_network.py" - "pandas/tests/io/test_parquet.py")) - (invoke "pytest" "-vv" "pandas" "--skip-slow" - "--skip-network" "-k" - ;; XXX: Due to the deleted tests above. - "not test_read_s3_jsonl")))))))) - (propagated-inputs - `(("python-numpy" ,python-numpy) - ("python-openpyxl" ,python-openpyxl) - ("python-pytz" ,python-pytz) - ("python-dateutil" ,python-dateutil) - ("python-xlrd" ,python-xlrd))) - (inputs - `(("which" ,which))) - (native-inputs - `(("python-cython" ,python-cython) - ("python-beautifulsoup4" ,python-beautifulsoup4) - ("python-lxml" ,python-lxml) - ("python-html5lib" ,python-html5lib) - ("python-nose" ,python-nose) - ("python-pytest" ,python-pytest) - ("python-pytest-mock" ,python-pytest-mock))) - (home-page "https://pandas.pydata.org") - (synopsis "Data structures for data analysis, time series, and statistics") - (description - "Pandas is a Python package providing fast, flexible, and expressive data -structures designed to make working with structured (tabular, -multidimensional, potentially heterogeneous) and time series data both easy -and intuitive. It aims to be the fundamental high-level building block for -doing practical, real world data analysis in Python.") - (properties `((python2-variant . ,(delay python2-pandas)))) - (license license:bsd-3))) - -;; Pandas 0.24.x are the last versions that support Python 2. -(define-public python2-pandas - (let ((pandas (package-with-python2 - (strip-python2-variant python-pandas)))) - (package/inherit - pandas - (version "0.24.2") - (source (origin - (method url-fetch) - (uri (pypi-uri "pandas" version)) - (sha256 - (base32 - "18imlm8xbhcbwy4wa957a1fkamrcb0z988z006jpfda3ki09z4ag"))))))) - (define-public python2-mechanize (package (name "python2-mechanize") diff --git a/gnu/packages/serialization.scm b/gnu/packages/serialization.scm index 00a8d27387..a213e4ba0c 100644 --- a/gnu/packages/serialization.scm +++ b/gnu/packages/serialization.scm @@ -46,6 +46,7 @@ (define-module (gnu packages serialization) #:use-module (gnu packages lua) #:use-module (gnu packages pkg-config) #:use-module (gnu packages python) + #:use-module (gnu packages python-science) #:use-module (gnu packages python-xyz) #:use-module (gnu packages perl)) -- cgit v1.2.3