public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "David Seifert" <soap@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: app-crypt/nitrokey-app/files/, app-crypt/nitrokey-app/
Date: Sun, 16 Aug 2020 18:11:10 +0000 (UTC)	[thread overview]
Message-ID: <1597601455.8b565d4b9e871dbde172da1a2a356a25684a4f68.soap@gentoo> (raw)

commit:     8b565d4b9e871dbde172da1a2a356a25684a4f68
Author:     David Seifert <soap <AT> gentoo <DOT> org>
AuthorDate: Sun Aug 16 18:10:55 2020 +0000
Commit:     David Seifert <soap <AT> gentoo <DOT> org>
CommitDate: Sun Aug 16 18:10:55 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8b565d4b

app-crypt/nitrokey-app: Fix installing bash auto-completion

Closes: https://bugs.gentoo.org/736956
Package-Manager: Portage-3.0.2, Repoman-2.3.23
Signed-off-by: David Seifert <soap <AT> gentoo.org>

 ...Make-BASH_COMPLETION_DIR-user-overridable.patch | 46 ++++++++++++++++++++++
 ...y-app-1.4.ebuild => nitrokey-app-1.4-r1.ebuild} |  4 ++
 2 files changed, 50 insertions(+)

diff --git a/app-crypt/nitrokey-app/files/nitrokey-app-1.4-Make-BASH_COMPLETION_DIR-user-overridable.patch b/app-crypt/nitrokey-app/files/nitrokey-app-1.4-Make-BASH_COMPLETION_DIR-user-overridable.patch
new file mode 100644
index 00000000000..4acfe55abd0
--- /dev/null
+++ b/app-crypt/nitrokey-app/files/nitrokey-app-1.4-Make-BASH_COMPLETION_DIR-user-overridable.patch
@@ -0,0 +1,46 @@
+From e5036fab19c11a09ab350761ec03f54aa5fcb70c Mon Sep 17 00:00:00 2001
+From: David Seifert <soap@gentoo.org>
+Date: Sun, 16 Aug 2020 19:54:18 +0200
+Subject: [PATCH] Make BASH_COMPLETION_DIR user overridable
+
+---
+ CMakeLists.txt | 22 +++++++++++++++-------
+ 1 file changed, 15 insertions(+), 7 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 5feb2c0..1ab3f1a 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -163,14 +163,22 @@ IF(NOT WIN32)
+   # Removed - should be provided by libnitrokey
+ 
+   # Install autocompletion scripts
+-  set(PKG_GET_BASH_COMPLETION ${PKG_CONFIG_EXECUTABLE} --variable=completionsdir bash-completion)
+-  execute_process(COMMAND ${PKG_GET_BASH_COMPLETION} RESULT_VARIABLE ERR OUTPUT_VARIABLE BASH_COMPLETION_DIR OUTPUT_STRIP_TRAILING_WHITESPACE)
+-  IF(${ERR})
+-    set(BASH_COMPLETION_DIR "etc/bash_completion.d")
++  set(BASH_COMPLETION_PATH "" CACHE STRING "Directory for installing bash autocompletion files. The default (empty) means we will try to autodetect it")
++
++  IF(BASH_COMPLETION_PATH STREQUAL "")
++    message(STATUS "Trying to autodetect bash autocompletion directory")
++    set(PKG_GET_BASH_COMPLETION ${PKG_CONFIG_EXECUTABLE} --variable=completionsdir bash-completion)
++    execute_process(COMMAND ${PKG_GET_BASH_COMPLETION} RESULT_VARIABLE ERR OUTPUT_VARIABLE BASH_COMPLETION_DIR OUTPUT_STRIP_TRAILING_WHITESPACE)
++    IF(${ERR})
++      set(BASH_COMPLETION_DIR "etc/bash_completion.d")
++    ENDIF()
++    string(REGEX REPLACE "^/" "" BASH_COMPLETION_DIR "${BASH_COMPLETION_DIR}")
++    string(REGEX REPLACE "^usr/" "" BASH_COMPLETION_DIR "${BASH_COMPLETION_DIR}") # usual prefix is usr/local
++    message(STATUS "Setting bash-completion dir to ${BASH_COMPLETION_DIR}")
++  ELSE()
++    message(STATUS "User-provided bash autocompletion directory: ${BASH_COMPLETION_PATH}")
++    set(BASH_COMPLETION_DIR ${BASH_COMPLETION_PATH})
+   ENDIF()
+-  string(REGEX REPLACE "^/" "" BASH_COMPLETION_DIR "${BASH_COMPLETION_DIR}")
+-  string(REGEX REPLACE "^usr/" "" BASH_COMPLETION_DIR "${BASH_COMPLETION_DIR}") # usual prefix is usr/local
+-  message(STATUS "Setting bash-completion dir to ${BASH_COMPLETION_DIR}")
+ 
+   install(FILES
+    ${CMAKE_SOURCE_DIR}/data/bash-autocomplete/nitrokey-app
+-- 
+2.28.0
+

diff --git a/app-crypt/nitrokey-app/nitrokey-app-1.4.ebuild b/app-crypt/nitrokey-app/nitrokey-app-1.4-r1.ebuild
similarity index 85%
rename from app-crypt/nitrokey-app/nitrokey-app-1.4.ebuild
rename to app-crypt/nitrokey-app/nitrokey-app-1.4-r1.ebuild
index 959c79c3378..faf50aa87f4 100644
--- a/app-crypt/nitrokey-app/nitrokey-app-1.4.ebuild
+++ b/app-crypt/nitrokey-app/nitrokey-app-1.4-r1.ebuild
@@ -36,6 +36,10 @@ BDEPEND="
 	dev-qt/linguist-tools:5
 	virtual/pkgconfig"
 
+PATCHES=( "${FILESDIR}"/${P}-Make-BASH_COMPLETION_DIR-user-overridable.patch )
+
+mycmakeargs=( -DBASH_COMPLETION_PATH=share/bash-completion/completions )
+
 pkg_postinst() {
 	xdg_icon_cache_update
 }


             reply	other threads:[~2020-08-16 18:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-16 18:11 David Seifert [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-01-31 19:32 [gentoo-commits] repo/gentoo:master commit in: app-crypt/nitrokey-app/files/, app-crypt/nitrokey-app/ David Seifert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1597601455.8b565d4b9e871dbde172da1a2a356a25684a4f68.soap@gentoo \
    --to=soap@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox