about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorLily <egzozu.be.bas@gmail.com>2023-12-03 20:18:05 +0300
committerGitHub <noreply@github.com>2023-12-03 18:18:05 +0100
commitc2221e5304a949d2f42c5ad3ff00535410dfabb7 (patch)
tree0180d821da931e4f3d80f29f5bc829a7147779fe
parent104b5ec6d60c25af4f70a90222f31ddff1093bcb (diff)
downloadbox64-c2221e5304a949d2f42c5ad3ff00535410dfabb7.tar.gz
box64-c2221e5304a949d2f42c5ad3ff00535410dfabb7.zip
[TERMUX] Fix debian packaging (#1107)
* [TERMUX] Fix debian packaging

* How did I forget this
-rw-r--r--CMakeLists.txt18
1 files changed, 13 insertions, 5 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6ef0038b..1ea4e51f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -4,9 +4,7 @@ cmake_policy(SET CMP0065 NEW)
 
 SET(CMAKE_C_FLAGS_DEBUG  "-O0 -g")
 SET(CMAKE_CXX_FLAGS_DEBUG  "-O0 -g")
-if(TERMUX)
-	set(TERMUX_PATH "/data/data/com.termux/files")
-endif()
+
 option(RPI3ARM64 "Set to ON if targeting an RaspberryPI3 device with multiarch arm64 and armhf" ${RPI3ARM64})
 option(RPI4ARM64 "Set to ON if targeting an RaspberryPI4 device with multiarch arm64 and armhf" ${RPI4ARM64})
 option(RK3326 "Set to ON if targeting an Rockchip RK3326 based device" ${RK3326})
@@ -38,6 +36,7 @@ option(CI "Set to ON if running in CI" ${CI})
 option(WITH_MOLD "Set to ON to use with mold" ${WITH_MOLD})
 
 if(TERMUX)
+    set(TERMUX_PATH "/data/data/com.termux/files")
     set(ANDROID ON CACHE BOOL "")
 endif()
 if(LARCH64)
@@ -866,7 +865,7 @@ if(NOT _x86 AND NOT _x86_64)
     		install(FILES ${CMAKE_BINARY_DIR}/system/box64.conf DESTINATION /etc/binfmt.d/)
     		install(FILES ${CMAKE_SOURCE_DIR}/system/box64.box64rc DESTINATION /etc/)
 	  else()
-		install(FILES ${CMAKE_BINARY_DIR}/system/box64.conf DESTINATION ${TERMUX_PATH}/usr/etc/binfmt.d/)
+		#install(FILES ${CMAKE_BINARY_DIR}/system/box64.conf DESTINATION ${TERMUX_PATH}/usr/etc/binfmt.d/)
 		install(FILES ${CMAKE_SOURCE_DIR}/system/box64.box64rc DESTINATION ${TERMUX_PATH}/usr/etc/)
 	  endif()
 
@@ -924,7 +923,9 @@ string(REGEX MATCH "[0-9]" BOX64_REVISION ${TEMP_STRING})
 set(CPACK_PACKAGE_VERSION_MAJOR ${BOX64_MAJOR})
 set(CPACK_PACKAGE_VERSION_MINOR ${BOX64_MINOR})
 set(CPACK_PACKAGE_VERSION_PATCH ${BOX64_REVISION})
+if(NOT TERMUX)
 set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_CURRENT_SOURCE_DIR}/postinst")
+endif()
 if(_aarch64)
 	if(TERMUX)
 		set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "aarch64")
@@ -939,7 +940,14 @@ else()
     #probably wrong...
     execute_process(COMMAND "dpkg --print-architecture" OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE)
 endif()
-set(CPACK_DEBIAN_FILE_NAME "${BOX64}-${BOX64_MAJOR}.${BOX64_MINOR}.${BOX64_REVISION}_Linux-${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}.deb")
+if(TERMUX)
+set(CPACK_PACKAGING_INSTALL_PREFIX "${TERMUX_PATH}/usr")
+endif()
+if(NOT TERMUX)
+set(CPACK_DEBIAN_FILE_NAME "${BOX64}-${BOX64_MAJOR}.${BOX64_MINOR}.${BOX64_REVISION}_${CMAKE_SYSTEM_NAME}-${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}.deb")
+else()
+set(CPACK_DEBIAN_FILE_NAME "${BOX64}-${BOX64_MAJOR}.${BOX64_MINOR}.${BOX64_REVISION}_Termux-${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}.deb")
+endif()
 INCLUDE(CPack)
 
 add_test(bootSyscall ${CMAKE_COMMAND} -D TEST_PROGRAM=${CMAKE_BINARY_DIR}/${BOX64}