1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
|
(define-module (gn packages databases)
#:use-module (gnu packages)
#:use-module (guix packages)
#:use-module (guix download)
#:use-module ((guix licenses) #:prefix license:)
#:use-module (guix utils)
#:use-module (guix build-system gnu)
#:use-module (guix build-system python)
#:use-module (past packages tls)
#:use-module (gnu packages compression)
#:use-module (gnu packages databases)
#:use-module (gnu packages linux)
#:use-module (gnu packages ncurses)
#:use-module (gnu packages perl)
#:use-module (gnu packages readline)
; #:use-module (gnu packages tls))
)
(define-public mysql-5.0
(package
(inherit mysql)
(version "5.0.96")
(source
(origin
(method url-fetch)
(uri (string-append "https://downloads.mysql.com/archives/mysql-"
(version-major+minor version)
"/mysql-" version ".tar.gz"))
(sha256
(base32
"117w87bqj2vqxkiljcwyaxbkj5fygl5570zla0baln2ifwa3i1a3"))))
(build-system gnu-build-system)
(arguments
'(#:configure-flags
(list
"--with-unix-socket-path=/var/run/mysqld/mysqld.sock"
"--with-extra-charsets=all"
"--enable-thread-safe-client"
"--without-openssl"
"--without-docs"
;; Use system readline.
"--without-readline"
"--without-libedit")
;; TODO: Enable tests.
;#:test-target "test-force"
;#:test-target "test-bt"
#:make-flags '("CXXFLAGS=-Wno-narrowing -fpermissive")
#:phases
(modify-phases %standard-phases
(add-before 'check 'pre-check
(lambda _
(setenv "PERL5LIB" (string-append
(getcwd) "/mqsql-test"
":" (getenv "PERL5LIB")))
#t))
(add-after 'install 'clean-install-directory
(lambda* (#:key outputs #:allow-other-keys)
(let ((out (assoc-ref outputs "out")))
(delete-file-recursively (string-append out "/mysql-test"))
(delete-file-recursively (string-append out "/sql-bench"))
(for-each delete-file
(find-files (string-append out "/bin") "^mysqltest"))
#t))))))
(inputs
`(("ncurses" ,ncurses)
("perl" ,perl)
("procps" ,procps)
("readline" ,readline)
("zlib" ,zlib)))
(native-inputs `())))
(define-public mysql-5.5
(package
(inherit mysql)
(version "5.5.62")
(source
(origin
(method url-fetch)
(uri (string-append "https://downloads.mysql.com/archives/mysql-"
(version-major+minor version)
"/mysql-" version ".tar.gz"))
(sha256
(base32
"1mwrzwk9ap09s430fpdkyhvx5j2syd3xj2hyfzvanjphq4xqbrxi"))))
(arguments
`(#:configure-flags
'("-DBUILD_CONFIG=mysql_release"
"-DWITH_SSL=system"
"-DWITH_ZLIB=system"
"-DWITH_READLINE=OFF"
"-DWITH_LIBEDIT=OFF"
"-DDEFAULT_CHARSET=utf8"
"-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"
"-DINSTALL_PLUGINDIR=lib/mysql/plugin"
"-DINSTALL_SCRIPTDIR=bin"
"-DINSTALL_INCLUDEDIR=include/mysql"
"-DINSTALL_DOCREADMEDIR=share/mysql/docs"
"-DINSTALL_SUPPORTFILESDIR=share/mysql"
"-DINSTALL_MYSQLSHAREDIR=share/mysql"
"-DINSTALL_DOCDIR=share/mysql/docs"
"-DINSTALL_SHAREDIR=share/mysql"
;; Get rid of test data.
"-DINSTALL_MYSQLTESTDIR="
"-DINSTALL_SQLBENCHDIR=")
#:phases
(modify-phases %standard-phases
(add-after 'install 'clean-install-directories
(lambda* (#:key outputs #:allow-other-keys)
(let ((out (assoc-ref outputs "out")))
(delete-file-recursively (string-append out "/data"))
(for-each delete-file
(find-files (string-append out "/bin") "_embedded$"))
#t))))))
(inputs
`(("libaio" ,libaio)
("ncurses" ,ncurses)
("openssl" ,openssl-1.0)
("readline" ,readline)
("zlib" ,zlib)))))
(define-public python2-mysqlclient
(let ((base (package-with-python2 python-mysqlclient)))
(package
(inherit base)
(version "1.4.6")
(source
(origin
(method url-fetch)
(uri (pypi-uri "mysqlclient" version))
(sha256
(base32
"05ifrfz7rrl7j4gq4xz5acd76lrnmry9vrvg98hknakm72damzgk"))))
(inputs
`(("zlib" ,zlib)
,@(package-inputs base))))))
(define-public mysql++
(package
(name "mysql++")
(version "3.3.0")
(source
(origin
(method url-fetch)
(uri (string-append "https://tangentsoft.com/mysqlpp/releases"
"/mysql++-" version ".tar.gz"))
(sha256
(base32
"1kz7l1ngk649cpp2h1cnyqan9px8d50r0dk7kngwrhkcam3br724"))))
(build-system gnu-build-system)
(arguments
`(#:configure-flags
(list (string-append "--with-mysql-include="
(assoc-ref %build-inputs "mariadb:dev"))
(string-append "--with-mysql-lib="
(assoc-ref %build-inputs "mariadb:lib")))
#:phases
(modify-phases %standard-phases
;; It is unclear how to run the test suite so we just invoke the
;; compiled binaries which start with 'test_*'.
(replace 'check
(lambda* (#:key tests? #:allow-other-keys)
(when tests?
(setenv "LD_PRELOAD" "./libmysqlpp.so.3")
(and
(invoke "./test_array_index")
(invoke "./test_cpool")
(invoke "./test_datetime")
(invoke "./test_insertpolicy")
(invoke "./test_inttypes")
(invoke "./test_manip")
(invoke "./test_null_comparison")
(invoke "./test_qssqls")
(invoke "./test_qstream")
(invoke "./test_query_copy")
(invoke "./test_sqlstream")
(invoke "./test_ssqls2")
(invoke "./test_string")
;(invoke "./test_tcp") ; Requires TCP connection.
(invoke "./test_uds")
(invoke "./test_wnp")))
#t)))))
(inputs
`(("mariadb:dev" ,mariadb "dev")
("mariadb:lib" ,mariadb "lib")))
(home-page "https://tangentsoft.net/mysqlpp/")
(synopsis "MySQL C++ library bindings")
(description "MySQL++ is a complex C++ API for MySQL. The goal of this API
is to make working with Queries as easy as working with other STL containers.")
(license license:lgpl2.1+)))
|