From 0228e7e696f1a49495e9ec091fb5e8e22b21b3f8 Mon Sep 17 00:00:00 2001 From: gregory guy Date: Thu, 9 May 2019 16:27:57 +0200 Subject: [PATCH] Fix hardcoded installation path. This resolves issue #1. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: gregory guy Signed-off-by: Slávek Banko --- config.h.cmake | 3 +++ configure.in.in | 1 + kdpkg-install/console.cpp | 8 ++++++-- kdpkg-install/install.cpp | 8 ++++++-- kdpkg-install/main.cpp | 9 ++++++--- kdpkg/main.cpp | 12 ++++++------ 6 files changed, 28 insertions(+), 13 deletions(-) diff --git a/config.h.cmake b/config.h.cmake index 61ede3a..cb4462f 100644 --- a/config.h.cmake +++ b/config.h.cmake @@ -6,3 +6,6 @@ /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ #cmakedefine WORDS_BIGENDIAN @WORDS_BIGENDIAN@ + +/* Define the install PATH prefix */ +#define PREFIX "@CMAKE_INSTALL_PREFIX@" diff --git a/configure.in.in b/configure.in.in index 593c6a4..96f849c 100644 --- a/configure.in.in +++ b/configure.in.in @@ -4,3 +4,4 @@ AM_INIT_AUTOMAKE(kdpkg, 0.1) AC_C_BIGENDIAN AC_CHECK_KDEMAXPATHLEN +AC_DEFINE_UNQUOTED([PREFIX], ["$prefix"], [Define the install PATH prefix]) diff --git a/kdpkg-install/console.cpp b/kdpkg-install/console.cpp index 9f28dfe..fa404ce 100644 --- a/kdpkg-install/console.cpp +++ b/kdpkg-install/console.cpp @@ -18,7 +18,11 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ - +#ifdef HAVE_CONFIG_H +#include "config.h" +#else +#define PREFIX "/usr" +#endif #include #include @@ -53,7 +57,7 @@ console::console(TQWidget *parent, const TQStrList &run, const char *name, const if ((pipe_prefix = popen(prefixcommand.c_str(), "r")) == NULL) { - m_kdePrefix = "/usr"; + m_kdePrefix = PREFIX; } else { fgets(prefix_result, 2048, pipe_prefix); diff --git a/kdpkg-install/install.cpp b/kdpkg-install/install.cpp index 3c78386..043342b 100644 --- a/kdpkg-install/install.cpp +++ b/kdpkg-install/install.cpp @@ -17,7 +17,11 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - +#ifdef HAVE_CONFIG_H +#include "config.h" +#else +#define PREFIX "/usr" +#endif #include #include @@ -70,7 +74,7 @@ install::install( const TQString &url, TQWidget *parent, const char *name, const if ((pipe_prefix = popen(prefixcommand.c_str(), "r")) == NULL) { - m_kdePrefix = "/usr"; + m_kdePrefix = PREFIX; } else { fgets(prefix_result, 2048, pipe_prefix); diff --git a/kdpkg-install/main.cpp b/kdpkg-install/main.cpp index 0ce2b64..775c0bd 100644 --- a/kdpkg-install/main.cpp +++ b/kdpkg-install/main.cpp @@ -17,6 +17,11 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#else +#define PREFIX "/usr" +#endif #include "install.h" @@ -40,7 +45,7 @@ int main(int argc, char **argv) // specify data for About dialog TDEAboutData* about = new TDEAboutData("kdpkg-install", I18N_NOOP("kdpkg-install"), ""); - about->setProgramLogo( TQImage("/usr/share/icons/hicolor/32x32/apps/kdpkg.png") ); + about->setProgramLogo( TQImage( PREFIX "/share/icons/hicolor/32x32/apps/kdpkg.png") ); about->setShortDescription( I18N_NOOP("Frontend for dpkg.") ); about->setLicense(TDEAboutData::License_GPL_V2); about->setHomepage("http://trinity.pearsoncomputing.net"); @@ -50,8 +55,6 @@ int main(int argc, char **argv) about->addAuthor("Timothy Pearson (Trinity Project)", I18N_NOOP("Developer"), "kb9vqf@pearsoncomputing.net", "http://trinity.pearsoncomputing.net"); about->addAuthor("Fabian Würtz (xadras)", I18N_NOOP("Developer"), "xadras@sidux.com", "http://linux.wuertz.org/"); - - TDECmdLineArgs::init(argc, argv, about); TDECmdLineArgs::addCmdLineOptions( options ); diff --git a/kdpkg/main.cpp b/kdpkg/main.cpp index cacb438..30f2229 100644 --- a/kdpkg/main.cpp +++ b/kdpkg/main.cpp @@ -17,6 +17,11 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#else +#define PREFIX "/usr" +#endif #include "kdpkg.h" @@ -40,7 +45,7 @@ int main(int argc, char **argv) // specify data for About dialog TDEAboutData* about = new TDEAboutData("kdpkg", I18N_NOOP("kdpkg"), ""); - about->setProgramLogo( TQImage("/usr/share/icons/hicolor/32x32/apps/kdpkg.png") ); + about->setProgramLogo( TQImage( PREFIX "/share/icons/hicolor/32x32/apps/kdpkg.png") ); about->setShortDescription( I18N_NOOP("Frontend for dpkg.") ); about->setLicense(TDEAboutData::License_GPL_V2); about->setHomepage("http://trinity.pearsoncomputing.net"); @@ -50,11 +55,6 @@ int main(int argc, char **argv) about->addAuthor("Timothy Pearson (Trinity Project)", I18N_NOOP("Developer"), "kb9vqf@pearsoncomputing.net", "http://trinity.pearsoncomputing.net"); about->addAuthor("Fabian Würtz (xadras)", I18N_NOOP("Developer"), "xadras@sidux.com", "http://xadras.wordpress.com/"); - - - - - TDECmdLineArgs::init(argc, argv, about); TDECmdLineArgs::addCmdLineOptions( options );