From 7ee5776eff62f06a72d72bfa2f10b6b336f140c5 Mon Sep 17 00:00:00 2001 From: Alexey Kopytov Date: Sat, 6 Jan 2018 11:11:53 +0300 Subject: [PATCH] Remove build dependency on xxd/vim-common. --- Makefile.am | 2 ++ README.md | 6 +++--- configure.ac | 5 ----- debian/changelog | 6 ++++++ debian/control | 2 +- rpm/sysbench.spec | 4 +++- src/lua/internal/Makefile.am | 12 ++++++++++-- src/sb_lua.c | 2 +- 8 files changed, 26 insertions(+), 13 deletions(-) diff --git a/Makefile.am b/Makefile.am index a8cb064..5f95062 100644 --- a/Makefile.am +++ b/Makefile.am @@ -36,6 +36,8 @@ EXTRA_DIST = autogen.sh README.md README-WIN.txt README-Oracle.md ChangeLog \ rpm/sysbench.spec \ scripts/buildpack.sh +noinst_SCRIPTS = scripts/txt2c.sh + dist-hook: $(MAKE) -C $(distdir)/third_party/cram clean diff --git a/README.md b/README.md index 5260853..9343c15 100644 --- a/README.md +++ b/README.md @@ -131,7 +131,7 @@ build and use an older 0.5 release on Windows. ### Debian/Ubuntu ``` shell - apt -y install make automake libtool pkg-config libaio-dev vim-common + apt -y install make automake libtool pkg-config libaio-dev # For MySQL support apt -y install libmysqlclient-dev # For PostgreSQL support @@ -140,7 +140,7 @@ build and use an older 0.5 release on Windows. ### RHEL/CentOS ``` shell - yum -y install make automake libtool pkgconfig libaio-devel vim-common + yum -y install make automake libtool pkgconfig libaio-devel # For MySQL support, replace with mysql-devel on RHEL/CentOS 5 yum -y install mariadb-devel # For PostgreSQL support @@ -149,7 +149,7 @@ build and use an older 0.5 release on Windows. ### Fedora ``` shell - dnf -y install make automake libtool pkgconfig libaio-devel vim-common + dnf -y install make automake libtool pkgconfig libaio-devel # For MySQL support dnf -y install mariadb-devel # For PostgreSQL support diff --git a/configure.ac b/configure.ac index eb4a772..9c09e39 100644 --- a/configure.ac +++ b/configure.ac @@ -52,11 +52,6 @@ if test x"$sb_have_pkg_config" = xno; then AC_MSG_ERROR([the pkg-config package is required to build sysbench]) fi -AC_CHECK_PROG(sb_have_xxd, xxd, yes, no) -if test x"$sb_have_xxd" = xno; then - AC_MSG_ERROR("xxd is required to build sysbench (usually comes with the vim package)") -fi - AX_COMPILER_VENDOR # Checks for user arguments diff --git a/debian/changelog b/debian/changelog index 73d6518..ae7d568 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +sysbench (1.0.12-1) unstable; urgency=low + + * remove vim-common from build dependencies + + -- Alexey Kopytov Sat, 06 Jan 2018 10:59:42 +0300 + sysbench (1.0.11-1) unstable; urgency=low * add Debian Stretch support by adding optional build dependency on diff --git a/debian/control b/debian/control index b0192ea..788ee1e 100644 --- a/debian/control +++ b/debian/control @@ -2,7 +2,7 @@ Source: sysbench Section: misc Priority: extra Maintainer: Alexey Kopytov -Build-Depends: debhelper, autoconf, automake, libtool, libmysqlclient-dev | default-libmysqlclient-dev, libpq-dev, pkg-config, vim-common, python +Build-Depends: debhelper, autoconf, automake, libtool, libmysqlclient-dev | default-libmysqlclient-dev, libpq-dev, pkg-config, python Standards-Version: 3.9.5 Homepage: https://github.com/akopytov/sysbench diff --git a/rpm/sysbench.spec b/rpm/sysbench.spec index a275edc..b598664 100644 --- a/rpm/sysbench.spec +++ b/rpm/sysbench.spec @@ -19,7 +19,6 @@ BuildRequires: automake BuildRequires: libtool BuildRequires: pkgconfig BuildRequires: libaio-devel -BuildRequires: vim-common # Use bundled cram for tests BuildRequires: python @@ -75,6 +74,9 @@ make test %changelog +* Sat Jan 6 2018 Alexey Kopytov - 1.0.12-1 +- Remove vim-common from build dependencies. + * Sun Apr 09 2017 Alexey Kopytov - 1.0.5-1 - Add --without-gcc-arch to configure flags diff --git a/src/lua/internal/Makefile.am b/src/lua/internal/Makefile.am index 6793054..f25f928 100644 --- a/src/lua/internal/Makefile.am +++ b/src/lua/internal/Makefile.am @@ -18,11 +18,19 @@ BUILT_SOURCES = sysbench.lua.h sysbench.rand.lua.h sysbench.sql.lua.h \ sysbench.compat.lua.h sysbench.cmdline.lua.h \ sysbench.histogram.lua.h -CLEARFILES = $(BUILT_SOURCES) +CLEANFILES = $(BUILT_SOURCES) EXTRA_DIST = $(BUILT_SOURCES:.h=) SUFFIXES = .lua .lua.h .lua.lua.h: - xxd -i $< $@ + @echo "Creating $@ from $<" + @var=$$(echo $< | sed 's/\./_/g') && \ + ( echo "unsigned char $${var}[] =" && \ + sed -e 's/\\/\\\\/g' \ + -e 's/"/\\"/g' \ + -e 's/^/ "/g' \ + -e 's/$$/\\n"/g' $< && \ + echo ";" && \ + echo "size_t $${var}_len = sizeof($${var}) - 1;" ) > $@ diff --git a/src/sb_lua.c b/src/sb_lua.c index 9e1838a..ea3f6fa 100644 --- a/src/sb_lua.c +++ b/src/sb_lua.c @@ -99,7 +99,7 @@ typedef struct { const char *name; const unsigned char *source; /* Use a pointer, since _len variables are not compile-time constants */ - unsigned int *source_len; + size_t *source_len; } internal_script_t; typedef enum {