dev-util/trace-cmd: Clean up how flags are passed to the build system
authorPatrick McLean <patrick.mclean@sony.com>
Wed, 10 Apr 2019 00:55:09 +0000 (17:55 -0700)
committerPatrick McLean <chutzpah@gentoo.org>
Wed, 10 Apr 2019 00:55:09 +0000 (17:55 -0700)
Copyright: Sony Interactive Entertainment Inc.
Package-Manager: Portage-2.3.62, Repoman-2.3.12
Signed-off-by: Patrick McLean <chutzpah@gentoo.org>
dev-util/trace-cmd/files/trace-cmd-2.7-makefile.patch
dev-util/trace-cmd/trace-cmd-2.7-r2.ebuild
dev-util/trace-cmd/trace-cmd-9999.ebuild

index da1ca62e7c042ff399281ede2d72a0059c3326bf..a9d7584dc625623b284ecefaffc1f30a2bf2a561 100644 (file)
@@ -1,7 +1,8 @@
-diff -ur trace-cmd-v2.7.orig/Makefile trace-cmd-v2.7/Makefile
---- trace-cmd-v2.7.orig/Makefile       2018-02-01 23:35:28.000000000 +0100
-+++ trace-cmd-v2.7/Makefile    2018-09-16 16:42:58.445655156 +0200
-@@ -63,7 +63,7 @@
+diff --git a/Makefile b/Makefile
+index a5d2c38..a99e5a4 100644
+--- a/Makefile
++++ b/Makefile
+@@ -63,7 +63,7 @@ python_dir = $(HOME)/.trace-cmd/python
  var_dir = $(HOME)/.trace-cmd/
  else
  plugin_dir = $(libdir)/trace-cmd/plugins
@@ -10,7 +11,7 @@ diff -ur trace-cmd-v2.7.orig/Makefile trace-cmd-v2.7/Makefile
  PLUGIN_DIR = -DPLUGIN_DIR="$(plugin_dir)"
  PYTHON_DIR = -DPYTHON_DIR="$(python_dir)"
  PLUGIN_DIR_SQ = '$(subst ','\'',$(PLUGIN_DIR))'
-@@ -119,8 +119,11 @@
+@@ -119,8 +119,13 @@ endif # NO_PYTHON
  test-build = $(if $(shell sh -c 'echo "$(1)" | \
        $(CC) -o /dev/null -c -x c - > /dev/null 2>&1 && echo y'), $2)
  
@@ -19,11 +20,13 @@ diff -ur trace-cmd-v2.7.orig/Makefile trace-cmd-v2.7/Makefile
 -udis86-flags := $(call test-build,\#include <udis86.h>,-DHAVE_UDIS86 -ludis86)
 +udis86-flags := -DHAVE_UDIS86
 +udis86-ldflags := -ludis86
++else
++udis86-flags := -UHAVE_UDIS86
 +endif # NO_UDIS86
  
  define BLK_TC_FLUSH_SOURCE
  #include <linux/blktrace_api.h>
-@@ -276,6 +279,7 @@
+@@ -276,6 +281,7 @@ endif
  # Append required CFLAGS
  override CFLAGS += $(CONFIG_FLAGS) $(INCLUDES) $(PLUGIN_DIR_SQ) $(VAR_DIR)
  override CFLAGS += $(udis86-flags) $(blk-flags)
index d38e2e55b21ebc29e08af41b57e8da48d2076ed2..f9a2adfa4f0ab0dd68a35077b1ec12cd67201d6c 100644 (file)
@@ -41,8 +41,8 @@ CONFIG_CHECK="
        ~BLK_DEV_IO_TRACE"
 
 PATCHES=(
-       "${FILESDIR}"/${PN}-2.7-makefile.patch
-       "${FILESDIR}"/${PN}-2.7-soname.patch
+       "${FILESDIR}"/trace-cmd-2.7-makefile.patch
+       "${FILESDIR}"/trace-cmd-2.7-soname.patch
 )
 
 pkg_setup() {
@@ -51,30 +51,33 @@ pkg_setup() {
 }
 
 src_configure() {
-       MAKEOPTS+=" prefix=/usr
-               libdir=/usr/$(get_libdir)
-               CC=$(tc-getCC)
-               AR=$(tc-getAR)
-               $(usex audit '' '' 'NO_AUDIT=1')"
+       EMAKE_FLAGS=(
+               "prefix=/usr"
+               "libdir=/usr/$(get_libdir)"
+               "CC=$(tc-getCC)"
+               "AR=$(tc-getAR)"
+               $(usex audit '' '' 'NO_AUDIT=1')
+               $(usex udis86 '' '' 'NO_UDIS86=1')
+       )
 
        if use python; then
-               MAKEOPTS+=" PYTHON_VERS=${EPYTHON//python/python-}"
-               MAKEOPTS+=" python_dir=$(python_get_sitedir)/${PN}"
+               EMAKE_FLAGS+=(
+                       "PYTHON_VERS=${EPYTHON//python/python-}"
+                       "python_dir=$(python_get_sitedir)/${PN}"
+               )
        else
-               MAKEOPTS+=" NO_PYTHON=1"
+               EMAKE_FLAGS+=("NO_PYTHON=1")
        fi
-
-       use udis86 || MAKEOPTS+=" NO_UDIS86=1"
 }
 
 src_compile() {
-       emake V=1 all_cmd libs
+       emake "${EMAKE_FLAGS[@]}" all_cmd libs
        use doc && emake doc
 
 }
 
 src_install() {
-       emake DESTDIR="${D}" V=1 install install_libs
+       emake "${EMAKE_FLAGS[@]}" DESTDIR="${D}" V=1 install install_libs
        use doc && emake DESTDIR="${D}" install_doc
 
 }
index d38e2e55b21ebc29e08af41b57e8da48d2076ed2..f9a2adfa4f0ab0dd68a35077b1ec12cd67201d6c 100644 (file)
@@ -41,8 +41,8 @@ CONFIG_CHECK="
        ~BLK_DEV_IO_TRACE"
 
 PATCHES=(
-       "${FILESDIR}"/${PN}-2.7-makefile.patch
-       "${FILESDIR}"/${PN}-2.7-soname.patch
+       "${FILESDIR}"/trace-cmd-2.7-makefile.patch
+       "${FILESDIR}"/trace-cmd-2.7-soname.patch
 )
 
 pkg_setup() {
@@ -51,30 +51,33 @@ pkg_setup() {
 }
 
 src_configure() {
-       MAKEOPTS+=" prefix=/usr
-               libdir=/usr/$(get_libdir)
-               CC=$(tc-getCC)
-               AR=$(tc-getAR)
-               $(usex audit '' '' 'NO_AUDIT=1')"
+       EMAKE_FLAGS=(
+               "prefix=/usr"
+               "libdir=/usr/$(get_libdir)"
+               "CC=$(tc-getCC)"
+               "AR=$(tc-getAR)"
+               $(usex audit '' '' 'NO_AUDIT=1')
+               $(usex udis86 '' '' 'NO_UDIS86=1')
+       )
 
        if use python; then
-               MAKEOPTS+=" PYTHON_VERS=${EPYTHON//python/python-}"
-               MAKEOPTS+=" python_dir=$(python_get_sitedir)/${PN}"
+               EMAKE_FLAGS+=(
+                       "PYTHON_VERS=${EPYTHON//python/python-}"
+                       "python_dir=$(python_get_sitedir)/${PN}"
+               )
        else
-               MAKEOPTS+=" NO_PYTHON=1"
+               EMAKE_FLAGS+=("NO_PYTHON=1")
        fi
-
-       use udis86 || MAKEOPTS+=" NO_UDIS86=1"
 }
 
 src_compile() {
-       emake V=1 all_cmd libs
+       emake "${EMAKE_FLAGS[@]}" all_cmd libs
        use doc && emake doc
 
 }
 
 src_install() {
-       emake DESTDIR="${D}" V=1 install install_libs
+       emake "${EMAKE_FLAGS[@]}" DESTDIR="${D}" V=1 install install_libs
        use doc && emake DESTDIR="${D}" install_doc
 
 }