build: Fix usage of CMAKE_INSTALL_PREFIX on Linux (#401)

* build: Fix usage of CMAKE_INSTALL_PREFIX

* build: Use /usr prefix in Linux CI builds

* ci: Delete DEBIAN folder after .deb packaging step
This commit is contained in:
Mark Nokalt 2022-01-22 18:10:49 -03:00 committed by GitHub
parent 89b9d21eaa
commit 3e9493f3e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 17 deletions

View File

@ -177,10 +177,10 @@ jobs:
sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
sudo apt update
sudo bash dist/get_deps_debian.sh
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > rustup-init.sh
sh rustup-init.sh -y --default-toolchain none
rm rustup-init.sh
@ -192,14 +192,14 @@ jobs:
run: |
mkdir -p build
cd build
CC=gcc-10 CXX=g++-10 cmake \
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
-DCMAKE_INSTALL_PREFIX="$PWD/install" \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_C_FLAGS="-fuse-ld=lld" \
-DCMAKE_CXX_FLAGS="-fuse-ld=lld" \
-DRUST_PATH="$HOME/.cargo/bin/" \
CC=gcc-10 CXX=g++-10 cmake \
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
-DCMAKE_INSTALL_PREFIX="$PWD/install/usr" \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_C_FLAGS="-fuse-ld=lld" \
-DCMAKE_CXX_FLAGS="-fuse-ld=lld" \
-DRUST_PATH="$HOME/.cargo/bin/" \
..
make -j 4 install
@ -214,8 +214,10 @@ jobs:
- name: 📦 Bundle DEB
run: |
cp -r build/DEBIAN build/install
dpkg-deb --build build/install
mv build/install.deb imhex.deb
rm -rf build/install/DEBIAN
- name: 📦 Bundle AppImage
run: |
@ -249,3 +251,4 @@ jobs:
name: Linux AppImage
path: |
imhex.AppImage

View File

@ -68,10 +68,10 @@ macro(detectOS)
set(MAGIC_INSTALL_LOCATION "magic")
elseif(UNIX AND NOT APPLE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DOS_LINUX")
set(CMAKE_INSTALL_BINDIR "usr/bin")
set(CMAKE_INSTALL_LIBDIR "usr/lib")
set(PLUGINS_INSTALL_LOCATION "usr/share/imhex/plugins")
set(MAGIC_INSTALL_LOCATION "usr/share/imhex/magic")
set(CMAKE_INSTALL_BINDIR "bin")
set(CMAKE_INSTALL_LIBDIR "lib")
set(PLUGINS_INSTALL_LOCATION "share/imhex/plugins")
set(MAGIC_INSTALL_LOCATION "share/imhex/magic")
else()
message(FATAL_ERROR "Unknown / unsupported system!")
endif()
@ -209,9 +209,8 @@ macro(createPackage)
]])
elseif(UNIX AND NOT APPLE)
configure_file(${CMAKE_SOURCE_DIR}/dist/DEBIAN/control.in ${CMAKE_BINARY_DIR}/DEBIAN/control)
install(FILES ${CMAKE_BINARY_DIR}/DEBIAN/control DESTINATION ${CMAKE_INSTALL_PREFIX}/DEBIAN)
install(FILES ${CMAKE_SOURCE_DIR}/dist/imhex.desktop DESTINATION ${CMAKE_INSTALL_PREFIX}/usr/share/applications)
install(FILES ${CMAKE_SOURCE_DIR}/resources/icon.png DESTINATION ${CMAKE_INSTALL_PREFIX}/usr/share/pixmaps RENAME imhex.png)
install(FILES ${CMAKE_SOURCE_DIR}/dist/imhex.desktop DESTINATION ${CMAKE_INSTALL_PREFIX}/share/applications)
install(FILES ${CMAKE_SOURCE_DIR}/resources/icon.png DESTINATION ${CMAKE_INSTALL_PREFIX}/share/pixmaps RENAME imhex.png)
endif()
if (CREATE_BUNDLE)