Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix local installation on Linux #393

Closed
algo99 opened this issue Dec 11, 2022 · 5 comments
Closed

Fix local installation on Linux #393

algo99 opened this issue Dec 11, 2022 · 5 comments
Labels
bug Something isn't working linux Linux-related

Comments

@algo99
Copy link
Contributor

algo99 commented Dec 11, 2022

Hi,
I noticed by a local installation on Linux (Fedora-37) after:

$ cd build/release
$ cmake -G Ninja -DCMAKE_BUILD_TYPE=Release ../..
$ ninja
$ sudo ninja install

these files are installed not at the usual place:

-- Installing: /usr/local/./git-credential-libsecret
-- Installing: /usr/local/./git-credential-gnome-keyring
-- Installing: /usr/local/./indexer
-- Installing: /usr/local/./relauncher
-- Installing: /usr/local/./Gittyup
...
-- Installing: /usr/local/./libQt5Concurrent.so.5
-- Installing: /usr/local/./libQt5Core.so.5
-- Installing: /usr/local/./libQt5Gui.so.5
-- Installing: /usr/local/./libQt5Network.so.5
-- Installing: /usr/local/./libQt5PrintSupport.so.5
-- Installing: /usr/local/./libQt5Widgets.so.5
-- Installing: /usr/local/./libQt5Test.so.5
-- Installing: /usr/local/./libQt5DBus.so.5
-- Installing: /usr/local/./libQt5XcbQpa.so.5
-- Installing: /usr/local/./libssl.so.1.1
-- Installing: /usr/local/./libcrypto.so.1.1

The next patch solves this problem for me:

git diff

 ~/Disk2_Downloads/3rd/Gittyup ╱ master !5                                                                                                                                                       9m 40s 
❯ git diff
diff --git a/dep/git/CMakeLists.txt b/dep/git/CMakeLists.txt
index 6add461..3dd88ab 100644
--- a/dep/git/CMakeLists.txt
+++ b/dep/git/CMakeLists.txt
@@ -14,7 +14,7 @@ if(NOT USE_SYSTEM_GIT)
     if(NOT APPLE)
       install(
         TARGETS ${TARGET}
-        DESTINATION .
+        DESTINATION ${CMAKE_INSTALL_BINDIR}
         COMPONENT ${GITTYUP_NAME})
     endif()
   endmacro()
diff --git a/pack/CMakeLists.txt b/pack/CMakeLists.txt
index eea79fe..ff1c164 100644
--- a/pack/CMakeLists.txt
+++ b/pack/CMakeLists.txt
@@ -100,7 +100,7 @@ elseif(NOT USE_SYSTEM_QT)
 
       install(
         FILES ${QT_LIBRARY}
-        DESTINATION .
+        DESTINATION ${CMAKE_INSTALL_LIBDIR}
         PERMISSIONS
           OWNER_READ
           OWNER_WRITE
@@ -131,7 +131,7 @@ if(UNIX AND NOT APPLE)
 
   install(
     FILES "${LIB_PATH}/${LIB_NAME}${LIB_EXT}"
-    DESTINATION .
+    DESTINATION ${CMAKE_INSTALL_LIBDIR}
     PERMISSIONS
       OWNER_READ
       OWNER_WRITE
@@ -166,7 +166,7 @@ if(NOT APPLE)
 
       install(
         FILES ${SSL_LIB}
-        DESTINATION .
+        DESTINATION ${CMAKE_INSTALL_LIBDIR}
         PERMISSIONS
           OWNER_READ
           OWNER_WRITE
diff --git a/src/app/CMakeLists.txt b/src/app/CMakeLists.txt
index bc1e811..0417e80 100755
--- a/src/app/CMakeLists.txt
+++ b/src/app/CMakeLists.txt
@@ -162,7 +162,7 @@ else()
   # Install application.
   install(
     TARGETS gittyup
-    DESTINATION .
+    DESTINATION ${CMAKE_INSTALL_BINDIR}
     COMPONENT ${GITTYUP_NAME})
 endif()
 
diff --git a/src/index/CMakeLists.txt b/src/index/CMakeLists.txt
index 207a9e1..7284066 100644
--- a/src/index/CMakeLists.txt
+++ b/src/index/CMakeLists.txt
@@ -44,7 +44,7 @@ else()
   else()
     install(
       TARGETS indexer
-      DESTINATION .
+      DESTINATION ${CMAKE_INSTALL_BINDIR}
       COMPONENT ${GITTYUP_NAME})
   endif()
 endif()
diff --git a/src/update/CMakeLists.txt b/src/update/CMakeLists.txt
index be292e8..aefd544 100644
--- a/src/update/CMakeLists.txt
+++ b/src/update/CMakeLists.txt
@@ -41,7 +41,7 @@ elseif(UNIX)
   else()
     install(
       TARGETS relauncher
-      DESTINATION .
+      DESTINATION ${CMAKE_INSTALL_BINDIR}
       COMPONENT ${GITTYUP_NAME})
   endif()
 endif()
(END)

@alerque
Copy link
Contributor

alerque commented Dec 12, 2022

This is probably related it #191.

@exactly-one-kas exactly-one-kas added bug Something isn't working linux Linux-related labels Dec 12, 2022
@Murmele
Copy link
Owner

Murmele commented Jan 23, 2023

@algo99 is your patch still needed? Can you create a merge request if yes?

@algo99
Copy link
Contributor Author

algo99 commented Jan 23, 2023

Just tested with the current master, without the patch the same result (wrong paths) as described above.

Murmele added a commit that referenced this issue Feb 17, 2023
* Fix local installation paths on Linux, see issue #393
@Murmele
Copy link
Owner

Murmele commented Apr 16, 2023

@algo99 can you try again?
Might be fixed with #397

@algo99
Copy link
Contributor Author

algo99 commented Apr 27, 2023

Yea, now it works as it should be. Thank you!
sudo ninja uninstall works as well.
I'm closing the ticket.

@algo99 algo99 closed this as completed Apr 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working linux Linux-related
Projects
None yet
Development

No branches or pull requests

4 participants