From 9c50c6cbe606d1ec5fa642ca6d0730cd953d28e1 Mon Sep 17 00:00:00 2001 From: John Parent Date: Wed, 23 Oct 2024 18:04:44 -0400 Subject: [PATCH 1/4] gpt4all bespoke installers Adds initial support for bespoke platform specific installers, DragNDrop and InnoSetup on MacOS and Windows respectively. This moves gpt4all away from reliance on the IFW framework installers. DragNDrop produces a dmg, that on mounting, provides the user an interface to drag the gpt4all app bundle into the application directory. InnoSetup provides a traditional Windows installation wizard. To insepct these new behaviors, simply run the gpt4all build and package process as normal, and depending on your platform, either a DragNDorp DMG or InnoSetup exectauble will be produce. On MacOS simply mount or double click the DMG, on Windows, execute or double click the installer. Signed-off-by: John Parent --- gpt4all-chat/CMakeLists.txt | 83 +--------------- gpt4all-chat/cmake/Gpt4allCPack.cmake | 97 +++++++++++++++++++ .../cmake/gpt4allCPackOptions.cmake.in | 37 +++++++ 3 files changed, 135 insertions(+), 82 deletions(-) create mode 100644 gpt4all-chat/cmake/Gpt4allCPack.cmake create mode 100644 gpt4all-chat/cmake/gpt4allCPackOptions.cmake.in diff --git a/gpt4all-chat/CMakeLists.txt b/gpt4all-chat/CMakeLists.txt index f3a6c7755a45..f8c453cd6321 100644 --- a/gpt4all-chat/CMakeLists.txt +++ b/gpt4all-chat/CMakeLists.txt @@ -444,85 +444,4 @@ if (NOT APPLE) COMPONENT ${COMPONENT_NAME_MAIN}) endif() -set(CPACK_GENERATOR "IFW") -set(CPACK_VERBATIM_VARIABLES YES) -set(CPACK_IFW_VERBOSE ON) - -if(${CMAKE_SYSTEM_NAME} MATCHES Linux) - find_program(LINUXDEPLOYQT linuxdeployqt HINTS "$ENV{HOME}/dev/linuxdeployqt/build/tools/linuxdeployqt" "$ENV{HOME}/project/linuxdeployqt/bin") - configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/deploy-qt-linux.cmake.in" - "${CMAKE_BINARY_DIR}/cmake/deploy-qt-linux.cmake" @ONLY) - set(CPACK_PRE_BUILD_SCRIPTS ${CMAKE_BINARY_DIR}/cmake/deploy-qt-linux.cmake) - set(CPACK_IFW_ROOT "~/Qt/Tools/QtInstallerFramework/4.6") - set(CPACK_PACKAGE_FILE_NAME "${COMPONENT_NAME_MAIN}-installer-linux") - set(CPACK_IFW_TARGET_DIRECTORY "@HomeDir@/${COMPONENT_NAME_MAIN}") -elseif(${CMAKE_SYSTEM_NAME} MATCHES Windows) - find_program(WINDEPLOYQT windeployqt HINTS ${_qt_bin_dir}) - configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/deploy-qt-windows.cmake.in" - "${CMAKE_BINARY_DIR}/cmake/deploy-qt-windows.cmake" @ONLY) - set(CPACK_PRE_BUILD_SCRIPTS ${CMAKE_BINARY_DIR}/cmake/deploy-qt-windows.cmake) - set(CPACK_IFW_ROOT "C:/Qt/Tools/QtInstallerFramework/4.6") - set(CPACK_IFW_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/resources/gpt4all.ico") - set(CPACK_PACKAGE_FILE_NAME "${COMPONENT_NAME_MAIN}-installer-win64") - set(CPACK_IFW_TARGET_DIRECTORY "@HomeDir@\\${COMPONENT_NAME_MAIN}") -elseif(${CMAKE_SYSTEM_NAME} MATCHES Darwin) - find_program(MACDEPLOYQT macdeployqt HINTS ${_qt_bin_dir}) - configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/deploy-qt-mac.cmake.in" - "${CMAKE_BINARY_DIR}/cmake/deploy-qt-mac.cmake" @ONLY) - set(CPACK_PRE_BUILD_SCRIPTS ${CMAKE_BINARY_DIR}/cmake/deploy-qt-mac.cmake) - set(CPACK_IFW_ROOT "~/Qt/Tools/QtInstallerFramework/4.6") - set(CPACK_IFW_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/resources/gpt4all.icns") - set(CPACK_PACKAGE_FILE_NAME "${COMPONENT_NAME_MAIN}-installer-darwin") - set(CPACK_IFW_TARGET_DIRECTORY "@ApplicationsDir@/${COMPONENT_NAME_MAIN}") - set(CPACK_BUNDLE_NAME ${COMPONENT_NAME_MAIN}) - set(CPACK_BUNDLE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/resources/gpt4all.icns") -endif() - -set(CPACK_PACKAGE_INSTALL_DIRECTORY ${COMPONENT_NAME_MAIN}) -set(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR}) -set(CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR}) -SET(CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH}) -set(CPACK_PACKAGE_HOMEPAGE_URL "https://www.nomic.ai/gpt4all") -set(CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/icons/gpt4all-48.png") -set(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE) -set(CPACK_RESOURCE_FILE_README ${CMAKE_CURRENT_SOURCE_DIR}/README.md) -set(CPACK_PACKAGE_EXECUTABLES "GPT4All") -set(CPACK_CREATE_DESKTOP_LINKS "GPT4All") -set(CPACK_IFW_PACKAGE_NAME "GPT4All") -set(CPACK_IFW_PACKAGE_TITLE "GPT4All Installer") -set(CPACK_IFW_PACKAGE_PUBLISHER "Nomic, Inc.") -set(CPACK_IFW_PRODUCT_URL "https://www.nomic.ai/gpt4all") -set(CPACK_IFW_PACKAGE_WIZARD_STYLE "Aero") -set(CPACK_IFW_PACKAGE_LOGO "${CMAKE_CURRENT_SOURCE_DIR}/icons/gpt4all-48.png") -set(CPACK_IFW_PACKAGE_WINDOW_ICON "${CMAKE_CURRENT_SOURCE_DIR}/icons/gpt4all-32.png") -set(CPACK_IFW_PACKAGE_WIZARD_SHOW_PAGE_LIST OFF) -set(CPACK_IFW_PACKAGE_CONTROL_SCRIPT "${CMAKE_CURRENT_SOURCE_DIR}/cmake/installer_control.qs") - -include(InstallRequiredSystemLibraries) -include(CPack) -include(CPackIFW) -if(GPT4ALL_OFFLINE_INSTALLER) - cpack_add_component(${COMPONENT_NAME_MAIN}) -else() - cpack_add_component(${COMPONENT_NAME_MAIN} DOWNLOADED) -endif() -cpack_ifw_configure_component(${COMPONENT_NAME_MAIN} ESSENTIAL FORCED_INSTALLATION) -cpack_ifw_configure_component(${COMPONENT_NAME_MAIN} VERSION ${APP_VERSION}) -cpack_ifw_configure_component(${COMPONENT_NAME_MAIN} LICENSES "MIT LICENSE" ${CPACK_RESOURCE_FILE_LICENSE}) -cpack_ifw_configure_component(${COMPONENT_NAME_MAIN} SCRIPT "${CMAKE_CURRENT_SOURCE_DIR}/cmake/installer_component.qs") -cpack_ifw_configure_component(${COMPONENT_NAME_MAIN} REPLACES "gpt4all-chat") #Was used in very earliest prototypes - -if (GPT4ALL_LOCALHOST) - cpack_ifw_add_repository("GPT4AllRepository" URL "http://localhost/repository") -elseif(GPT4ALL_OFFLINE_INSTALLER) - add_compile_definitions(GPT4ALL_OFFLINE_INSTALLER) -else() - if(${CMAKE_SYSTEM_NAME} MATCHES Linux) - cpack_ifw_add_repository("GPT4AllRepository" URL "https://gpt4all.io/installer_repos/linux/repository") - elseif(${CMAKE_SYSTEM_NAME} MATCHES Windows) - #To sign the target on windows have to create a batch script add use it as a custom target and then use CPACK_IFW_EXTRA_TARGETS to set this extra target - cpack_ifw_add_repository("GPT4AllRepository" URL "https://gpt4all.io/installer_repos/windows/repository") - elseif(${CMAKE_SYSTEM_NAME} MATCHES Darwin) - cpack_ifw_add_repository("GPT4AllRepository" URL "https://gpt4all.io/installer_repos/mac/repository") - endif() -endif() +include(Gpt4allCPack) diff --git a/gpt4all-chat/cmake/Gpt4allCPack.cmake b/gpt4all-chat/cmake/Gpt4allCPack.cmake new file mode 100644 index 000000000000..3c0ab43166a0 --- /dev/null +++ b/gpt4all-chat/cmake/Gpt4allCPack.cmake @@ -0,0 +1,97 @@ +# Setup Generic CPack options +include(InstallRequiredSystemLibraries) +set(CPACK_VERBATIM_VARIABLES YES) + +set(CPACK_PACKAGE_NAME "gpt4all") +set(CPACK_PACKAGE_VERSION ${APP_VERSION_BASE}) +set(CPACK_PACKAGE_VERSION_MAJOR ) +set(CPACK_PACKAGE_VERSION_MINOR ) +set(CPACK_PACKAGE_VERSION_PATCH ) +set(CPACK_PACKAGE_VENDOR "nomic") +set(CPACK_PACKAGE_DESCRIPTION + "GPT4All runs large language models (LLMs) privately on everyday desktops & laptops.") +set(CPACK_PACKAGE_INSTALL_DIRECTORY ${COMPONENT_NAME_MAIN}) +set(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR}) +set(CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR}) +set(CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH}) +set(CPACK_PACKAGE_HOMEPAGE_URL "https://www.nomic.ai/gpt4all") +set(CPACK_PACKAGE_EXECUTABLES "gpt4all") +set(CPACK_CREATE_DESKTOP_LINKS "gpt4all") +# TODO: Is there another intro message we want? +set(CPACK_RESOURCE_FILE_README "${CMAKE_SOURCE_DIR}/README.md") +set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_BINARY_DIR}/LICENSE.txt") +# TODO: ask Adam if there's a better email to use here +set(CPACK_PACKAGE_CONTACT "adam@nomic.ai") + +# Why are we creating components here? There's only one... gpt4all is installed monolithically +# unless we want to start vendoring models for the downloaded version? +if(GPT4ALL_OFFLINE_INSTALLER) + cpack_add_component(${COMPONENT_NAME_MAIN}) +else() + cpack_add_component(${COMPONENT_NAME_MAIN} DOWNLOADED) +endif() + +# Setup platform specific CPack options + +if(${CMAKE_SYSTEM_NAME} MATCHES Linux) + find_program(LINUXDEPLOYQT linuxdeployqt HINTS "$ENV{HOME}/dev/linuxdeployqt/build/tools/linuxdeployqt" "$ENV{HOME}/project/linuxdeployqt/bin") + configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/deploy-qt-linux.cmake.in" + "${CMAKE_BINARY_DIR}/cmake/deploy-qt-linux.cmake" @ONLY) + set(CPACK_PRE_BUILD_SCRIPTS ${CMAKE_BINARY_DIR}/cmake/deploy-qt-linux.cmake) + # Still using IFW on Linux + set(CPACK_GENERATOR "IFW") + set(CPACK_IFW_VERBOSE ON) + set(CPACK_IFW_PACKAGE_NAME "GPT4All") + set(CPACK_IFW_PACKAGE_TITLE "GPT4All Installer") + set(CPACK_IFW_PACKAGE_PUBLISHER "Nomic, Inc.") + set(CPACK_IFW_PRODUCT_URL "https://www.nomic.ai/gpt4all") + set(CPACK_IFW_PACKAGE_WIZARD_STYLE "Aero") + set(CPACK_IFW_PACKAGE_LOGO "${CMAKE_CURRENT_SOURCE_DIR}/icons/gpt4all-48.png") + set(CPACK_IFW_PACKAGE_WINDOW_ICON "${CMAKE_CURRENT_SOURCE_DIR}/icons/gpt4all-32.png") + set(CPACK_IFW_PACKAGE_WIZARD_SHOW_PAGE_LIST OFF) + set(CPACK_IFW_PACKAGE_CONTROL_SCRIPT "${CMAKE_CURRENT_SOURCE_DIR}/cmake/installer_control.qs") + set(CPACK_IFW_ROOT "~/Qt/Tools/QtInstallerFramework/4.6") + set(CPACK_PACKAGE_FILE_NAME "${COMPONENT_NAME_MAIN}-installer-linux") + set(CPACK_IFW_TARGET_DIRECTORY "@HomeDir@/${COMPONENT_NAME_MAIN}") +elseif(${CMAKE_SYSTEM_NAME} MATCHES Windows) + find_program(WINDEPLOYQT windeployqt HINTS ${_qt_bin_dir}) + configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/deploy-qt-windows.cmake.in" + "${CMAKE_BINARY_DIR}/cmake/deploy-qt-windows.cmake" @ONLY) + set(CPACK_PRE_BUILD_SCRIPTS ${CMAKE_BINARY_DIR}/cmake/deploy-qt-windows.cmake) + set(CPACK_PACKAGE_FILE_NAME "${COMPONENT_NAME_MAIN}-installer-win64") + set(CPACK_GENERATOR "InnoSetup") + set(CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/resources/gpt4all.ico") + # Todo - extend this to all languages we want to support + set(GPT4ALL_DIST_LANGUAGES english) + set(GPT4ALL_ICON_FILE "${CMAKE_CURRENT_SOURCE_DIR}/icons/gpt4all-48.png") +elseif(${CMAKE_SYSTEM_NAME} MATCHES Darwin) + find_program(MACDEPLOYQT macdeployqt HINTS ${_qt_bin_dir}) + configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/deploy-qt-mac.cmake.in" + "${CMAKE_BINARY_DIR}/cmake/deploy-qt-mac.cmake" @ONLY) + set(CPACK_PRE_BUILD_SCRIPTS ${CMAKE_BINARY_DIR}/cmake/deploy-qt-mac.cmake) + set(CPACK_PACKAGE_FILE_NAME "${COMPONENT_NAME_MAIN}-installer-darwin") + set(CPACK_BUNDLE_NAME ${COMPONENT_NAME_MAIN}) + set(CPACK_GENERATOR "DragNDrop") + set(CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/resources/gpt4all.icns") + set(CPACK_BUNDLE_ICON ${CPACK_PACKAGE_ICON}) + set(CPACK_PACKAGING_INSTALL_PREFIX "/Applications/gpt4all") + set(CPACK_INCLUDE_TOPLEVEL_DIRECTORY ON) + set(CPACK_DMG_DISABLE_APPLICATIONS_SYMLINK OFF) +endif() + +# Setup vars for CPack option config + +# Configure CPack options file (this sets up generator specfic behavior) +configure_file(gpt4allCPackOptions.cmake.in ${CMAKE_BINARY_DIR}/gpt4allCPackOptions.cmake) +set(CPACK_PROJECT_CONFIG_FILE ${CMAKE_BINARY_DIR}/gpt4allCPackOPtions.cmake) + +# Setup Cpack +include(CPack) +if(LINUX) + include(CPackIFW) + cpack_ifw_configure_component(${COMPONENT_NAME_MAIN} ESSENTIAL FORCED_INSTALLATION) + cpack_ifw_configure_component(${COMPONENT_NAME_MAIN} VERSION ${APP_VERSION}) + cpack_ifw_configure_component(${COMPONENT_NAME_MAIN} LICENSES "MIT LICENSE" ${CPACK_RESOURCE_FILE_LICENSE}) + cpack_ifw_configure_component(${COMPONENT_NAME_MAIN} SCRIPT "${CMAKE_CURRENT_SOURCE_DIR}/cmake/installer_component.qs") + cpack_ifw_configure_component(${COMPONENT_NAME_MAIN} REPLACES "gpt4all-chat") #Was used in very earliest prototypes +endif() diff --git a/gpt4all-chat/cmake/gpt4allCPackOptions.cmake.in b/gpt4all-chat/cmake/gpt4allCPackOptions.cmake.in new file mode 100644 index 000000000000..81316b9075d7 --- /dev/null +++ b/gpt4all-chat/cmake/gpt4allCPackOptions.cmake.in @@ -0,0 +1,37 @@ + + +# Configure Windows Installer Options + +#Setup innosetup +if(CPACK_GENERATOR ) + # Should be one of x86, x64, arm64, ia64 + set(CPACK_INNOSETUP_ARCHITECTURE @GPT4ALL_INSTALLER_ARCH@) + + # TODO (john): ask adam about this + set(CPACK_INNOSETUP_INSTALL_ROOT {%USERPROFILE}) + set(CPACK_INNOSETUP_ALLOW_CUSTOM_DIRECTORY ON) + set(CPACK_INNOSETUP_PROGRAM_MENU_FOLDER "gpt4all") + # ask adam if we want to support all options gpt4all supports + set(CPACK_INNOSETUP_LANGUAGES @GPT4ALL_DIST_LANGUAGES@) + set(CPACK_INNOSETUP_IGNORE_LICENSE_PAGE OFF) + set(CPACK_INNOSETUP_USE_MODERN_WIZARD ON) + set(CPACK_INNOSETUP_ICON_FILE @GPT4ALL_ICON_FILE@) + set(CPACK_INNOSETUP_CREATE_UNINSTALL_LINK ON) + set(CPACK_INNOSETUP_RUN_EXECUTABLES gpt4all) + set(CPACK_INNOSETUP_VERIFY_DOWNLOADS ON) +endif() + +# Configure MacOs installer Options + +# Setup DragNDrop (preferred) +if(CPACK_GENERATOR MATCHES "DragNDrop") + set(CPACK_DMG_FORMAT "UDBZ") + set(VERSION "${CPACK_PACKAGE_VERSION}") + # this also sets the volume name + set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-installer-darwin") + # set(CPACK_INCLUDE_TOPLEVEL_DIRECTORY ON) + # TODO: uncomment the line below when we have an image + # maybe we want an applescript to mange ths instead? + # set(CPACK_DMG_BACKGROUND_IMAGE @CMAKE_SOURCE_DIR@/icons/) +endif() + From 75136ce217d8066f4eecf1449d9bb64ba027503d Mon Sep 17 00:00:00 2001 From: John Parent Date: Tue, 29 Oct 2024 14:28:11 -0400 Subject: [PATCH 2/4] WIP --- gpt4all-chat/CMakeLists.txt | 11 ++++++++++- gpt4all-chat/cmake/Gpt4allCPack.cmake | 14 ++++++++------ gpt4all-chat/cmake/gpt4allCPackOptions.cmake.in | 3 --- 3 files changed, 18 insertions(+), 10 deletions(-) diff --git a/gpt4all-chat/CMakeLists.txt b/gpt4all-chat/CMakeLists.txt index f8c453cd6321..5addc937f988 100644 --- a/gpt4all-chat/CMakeLists.txt +++ b/gpt4all-chat/CMakeLists.txt @@ -427,6 +427,10 @@ if (LLMODEL_CUDA) LIBRARY DESTINATION lib COMPONENT ${COMPONENT_NAME_MAIN} # .so/.dylib RUNTIME DESTINATION lib COMPONENT ${COMPONENT_NAME_MAIN} # .dll ) + if (APPLE AND GPT4ALL_SIGN_INSTALL) + sign_target_osx(llamamodel-mainline-cuda) + sign_target_osx(llamamodel-mainline-cuda-avxonly) + endif() if (WIN32) install( RUNTIME_DEPENDENCY_SET llama-cuda-deps @@ -435,6 +439,11 @@ if (LLMODEL_CUDA) DIRECTORIES "${CUDAToolkit_BIN_DIR}" DESTINATION lib COMPONENT ${COMPONENT_NAME_MAIN} ) + if (GPT4ALL_SIGN_INSTALL) + sign_target_windows(llamamodel-mainline-cuda) + sign_target_windows(llamamodel-mainline-avxonly) + sign_target_windows(llama-cuda-deps) + endif() endif() endif() @@ -444,4 +453,4 @@ if (NOT APPLE) COMPONENT ${COMPONENT_NAME_MAIN}) endif() -include(Gpt4allCPack) +include(${CMAKE_SOURCE_DIR}/cmake/Gpt4allCPack.cmake) diff --git a/gpt4all-chat/cmake/Gpt4allCPack.cmake b/gpt4all-chat/cmake/Gpt4allCPack.cmake index 3c0ab43166a0..f13f01cee840 100644 --- a/gpt4all-chat/cmake/Gpt4allCPack.cmake +++ b/gpt4all-chat/cmake/Gpt4allCPack.cmake @@ -18,8 +18,8 @@ set(CPACK_PACKAGE_HOMEPAGE_URL "https://www.nomic.ai/gpt4all") set(CPACK_PACKAGE_EXECUTABLES "gpt4all") set(CPACK_CREATE_DESKTOP_LINKS "gpt4all") # TODO: Is there another intro message we want? -set(CPACK_RESOURCE_FILE_README "${CMAKE_SOURCE_DIR}/README.md") -set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_BINARY_DIR}/LICENSE.txt") +set(CPACK_RESOURCE_FILE_README "${CMAKE_SOURCE_DIR}/../README.md") +set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/../LICENSE.txt") # TODO: ask Adam if there's a better email to use here set(CPACK_PACKAGE_CONTACT "adam@nomic.ai") @@ -68,21 +68,23 @@ elseif(${CMAKE_SYSTEM_NAME} MATCHES Darwin) find_program(MACDEPLOYQT macdeployqt HINTS ${_qt_bin_dir}) configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/deploy-qt-mac.cmake.in" "${CMAKE_BINARY_DIR}/cmake/deploy-qt-mac.cmake" @ONLY) - set(CPACK_PRE_BUILD_SCRIPTS ${CMAKE_BINARY_DIR}/cmake/deploy-qt-mac.cmake) + # set(CPACK_PRE_BUILD_SCRIPTS ${CMAKE_BINARY_DIR}/cmake/deploy-qt-mac.cmake) + set(CPACK_PRE_BUILD_SCRIPTS "") set(CPACK_PACKAGE_FILE_NAME "${COMPONENT_NAME_MAIN}-installer-darwin") set(CPACK_BUNDLE_NAME ${COMPONENT_NAME_MAIN}) set(CPACK_GENERATOR "DragNDrop") set(CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/resources/gpt4all.icns") set(CPACK_BUNDLE_ICON ${CPACK_PACKAGE_ICON}) - set(CPACK_PACKAGING_INSTALL_PREFIX "/Applications/gpt4all") + set(CPACK_PACKAGING_INSTALL_PREFIX "gpt4all") set(CPACK_INCLUDE_TOPLEVEL_DIRECTORY ON) - set(CPACK_DMG_DISABLE_APPLICATIONS_SYMLINK OFF) + set(CPACK_DMG_DISABLE_APPLICATIONS_SYMLINK ON) + set(CPACK_COMPONENTS_ALL_IN_ONE_PACKAGE ON) endif() # Setup vars for CPack option config # Configure CPack options file (this sets up generator specfic behavior) -configure_file(gpt4allCPackOptions.cmake.in ${CMAKE_BINARY_DIR}/gpt4allCPackOptions.cmake) +configure_file(${CMAKE_SOURCE_DIR}/cmake/gpt4allCPackOptions.cmake.in ${CMAKE_BINARY_DIR}/gpt4allCPackOptions.cmake) set(CPACK_PROJECT_CONFIG_FILE ${CMAKE_BINARY_DIR}/gpt4allCPackOPtions.cmake) # Setup Cpack diff --git a/gpt4all-chat/cmake/gpt4allCPackOptions.cmake.in b/gpt4all-chat/cmake/gpt4allCPackOptions.cmake.in index 81316b9075d7..0cdce392c4f7 100644 --- a/gpt4all-chat/cmake/gpt4allCPackOptions.cmake.in +++ b/gpt4all-chat/cmake/gpt4allCPackOptions.cmake.in @@ -27,9 +27,6 @@ endif() if(CPACK_GENERATOR MATCHES "DragNDrop") set(CPACK_DMG_FORMAT "UDBZ") set(VERSION "${CPACK_PACKAGE_VERSION}") - # this also sets the volume name - set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-installer-darwin") - # set(CPACK_INCLUDE_TOPLEVEL_DIRECTORY ON) # TODO: uncomment the line below when we have an image # maybe we want an applescript to mange ths instead? # set(CPACK_DMG_BACKGROUND_IMAGE @CMAKE_SOURCE_DIR@/icons/) From e1e56d272341722fe3a7379c17b5dffc1a37951a Mon Sep 17 00:00:00 2001 From: John Parent Date: Tue, 29 Oct 2024 20:53:06 -0400 Subject: [PATCH 3/4] Finalize Windows installer behavior + add icons Signed-off-by: John Parent --- gpt4all-chat/cmake/Gpt4allCPack.cmake | 13 +++++++++---- gpt4all-chat/icons/gpt4all-48.bmp | Bin 0 -> 9354 bytes gpt4all-chat/icons/gpt4all-48.ico | Bin 0 -> 9662 bytes 3 files changed, 9 insertions(+), 4 deletions(-) create mode 100644 gpt4all-chat/icons/gpt4all-48.bmp create mode 100644 gpt4all-chat/icons/gpt4all-48.ico diff --git a/gpt4all-chat/cmake/Gpt4allCPack.cmake b/gpt4all-chat/cmake/Gpt4allCPack.cmake index f13f01cee840..6a305b837a46 100644 --- a/gpt4all-chat/cmake/Gpt4allCPack.cmake +++ b/gpt4all-chat/cmake/Gpt4allCPack.cmake @@ -15,7 +15,7 @@ set(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR}) set(CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR}) set(CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH}) set(CPACK_PACKAGE_HOMEPAGE_URL "https://www.nomic.ai/gpt4all") -set(CPACK_PACKAGE_EXECUTABLES "gpt4all") +set(CPACK_PACKAGE_EXECUTABLES chat;gpt4all) set(CPACK_CREATE_DESKTOP_LINKS "gpt4all") # TODO: Is there another intro message we want? set(CPACK_RESOURCE_FILE_README "${CMAKE_SOURCE_DIR}/../README.md") @@ -59,11 +59,16 @@ elseif(${CMAKE_SYSTEM_NAME} MATCHES Windows) "${CMAKE_BINARY_DIR}/cmake/deploy-qt-windows.cmake" @ONLY) set(CPACK_PRE_BUILD_SCRIPTS ${CMAKE_BINARY_DIR}/cmake/deploy-qt-windows.cmake) set(CPACK_PACKAGE_FILE_NAME "${COMPONENT_NAME_MAIN}-installer-win64") - set(CPACK_GENERATOR "InnoSetup") - set(CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/resources/gpt4all.ico") + set(CPACK_GENERATOR "INNOSETUP") + set(CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/icons/gpt4all-48.bmp") # Todo - extend this to all languages we want to support set(GPT4ALL_DIST_LANGUAGES english) - set(GPT4ALL_ICON_FILE "${CMAKE_CURRENT_SOURCE_DIR}/icons/gpt4all-48.png") + set(GPT4ALL_ICON_FILE "${CMAKE_CURRENT_SOURCE_DIR}/icons/gpt4all-48.ico") + if (CMAKE_SIZEOF_VOID_P GREATER 4) + set(GPT4ALL_INSTALLER_ARCH x64) + else() + set(GPT4ALL_INSTALLER_ARCH x86) + endif() elseif(${CMAKE_SYSTEM_NAME} MATCHES Darwin) find_program(MACDEPLOYQT macdeployqt HINTS ${_qt_bin_dir}) configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/deploy-qt-mac.cmake.in" diff --git a/gpt4all-chat/icons/gpt4all-48.bmp b/gpt4all-chat/icons/gpt4all-48.bmp new file mode 100644 index 0000000000000000000000000000000000000000..34e6041a5c4b6d13898f0c13a07a0c48135a75bd GIT binary patch literal 9354 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 M8MK=-yAIO-1L%K Date: Tue, 29 Oct 2024 22:16:11 -0400 Subject: [PATCH 4/4] MacOS Update MacOS installer behavior finalized Signed-off-by: John Parent --- gpt4all-chat/cmake/Gpt4allCPack.cmake | 13 +++++-------- gpt4all-chat/cmake/deploy-qt-mac.cmake.in | 16 ++++++++-------- gpt4all-chat/cmake/generate_gpt4all_alias.cmake | 4 ++++ 3 files changed, 17 insertions(+), 16 deletions(-) create mode 100644 gpt4all-chat/cmake/generate_gpt4all_alias.cmake diff --git a/gpt4all-chat/cmake/Gpt4allCPack.cmake b/gpt4all-chat/cmake/Gpt4allCPack.cmake index 6a305b837a46..98515d0144bb 100644 --- a/gpt4all-chat/cmake/Gpt4allCPack.cmake +++ b/gpt4all-chat/cmake/Gpt4allCPack.cmake @@ -73,17 +73,14 @@ elseif(${CMAKE_SYSTEM_NAME} MATCHES Darwin) find_program(MACDEPLOYQT macdeployqt HINTS ${_qt_bin_dir}) configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/deploy-qt-mac.cmake.in" "${CMAKE_BINARY_DIR}/cmake/deploy-qt-mac.cmake" @ONLY) - # set(CPACK_PRE_BUILD_SCRIPTS ${CMAKE_BINARY_DIR}/cmake/deploy-qt-mac.cmake) - set(CPACK_PRE_BUILD_SCRIPTS "") + set(CPACK_PRE_BUILD_SCRIPTS ${CMAKE_BINARY_DIR}/cmake/deploy-qt-mac.cmake) set(CPACK_PACKAGE_FILE_NAME "${COMPONENT_NAME_MAIN}-installer-darwin") - set(CPACK_BUNDLE_NAME ${COMPONENT_NAME_MAIN}) set(CPACK_GENERATOR "DragNDrop") set(CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/resources/gpt4all.icns") - set(CPACK_BUNDLE_ICON ${CPACK_PACKAGE_ICON}) - set(CPACK_PACKAGING_INSTALL_PREFIX "gpt4all") - set(CPACK_INCLUDE_TOPLEVEL_DIRECTORY ON) - set(CPACK_DMG_DISABLE_APPLICATIONS_SYMLINK ON) - set(CPACK_COMPONENTS_ALL_IN_ONE_PACKAGE ON) + set(CPACK_PACKAGING_INSTALL_PREFIX "/gpt4all") + set(CPACK_DMG_DISABLE_APPLICATIONS_SYMLINK OFF) + # set(CPACK_COMPONENTS_ALL_IN_ONE_PACKAGE ON) + # set(CPACK_COMPONENTS_GROUPING ALL_IN_ONE) endif() # Setup vars for CPack option config diff --git a/gpt4all-chat/cmake/deploy-qt-mac.cmake.in b/gpt4all-chat/cmake/deploy-qt-mac.cmake.in index d9458aa32c40..83ba8c67736f 100644 --- a/gpt4all-chat/cmake/deploy-qt-mac.cmake.in +++ b/gpt4all-chat/cmake/deploy-qt-mac.cmake.in @@ -5,16 +5,16 @@ set(GPT4ALL_SIGNING_ID "@MAC_SIGNING_IDENTITY@") if (GPT4ALL_SIGNING_ID) set(MAC_NOTARIZE -sign-for-notarization=${GPT4ALL_SIGNING_ID}) endif() -execute_process(COMMAND ${MACDEPLOYQT} ${CPACK_TEMPORARY_INSTALL_DIRECTORY}/packages/${COMPONENT_NAME_MAIN}/data/bin/gpt4all.app -qmldir=${CMAKE_CURRENT_SOURCE_DIR} -verbose=2 ${MAC_NOTARIZE}) -file(GLOB MYLLAMALIBS ${CPACK_TEMPORARY_INSTALL_DIRECTORY}/packages/${COMPONENT_NAME_MAIN}/data/lib/libllama*) -file(GLOB MYLLMODELLIBS ${CPACK_TEMPORARY_INSTALL_DIRECTORY}/packages/${COMPONENT_NAME_MAIN}/data/lib/libllmodel.*) +execute_process(COMMAND ${MACDEPLOYQT} ${CPACK_TEMPORARY_INSTALL_DIRECTORY}/ALL_IN_ONE/${COMPONENT_NAME_MAIN}/bin/gpt4all.app -qmldir=${CMAKE_CURRENT_SOURCE_DIR} -verbose=2 ${MAC_NOTARIZE}) +file(GLOB MYLLAMALIBS ${CPACK_TEMPORARY_INSTALL_DIRECTORY}/ALL_IN_ONE/${COMPONENT_NAME_MAIN}/lib/libllama*) +file(GLOB MYLLMODELLIBS ${CPACK_TEMPORARY_INSTALL_DIRECTORY}/ALL_IN_ONE/${COMPONENT_NAME_MAIN}/lib/libllmodel.*) file(COPY ${MYLLAMALIBS} - DESTINATION ${CPACK_TEMPORARY_INSTALL_DIRECTORY}/packages/${COMPONENT_NAME_MAIN}/data/bin/gpt4all.app/Contents/Frameworks) + DESTINATION ${CPACK_TEMPORARY_INSTALL_DIRECTORY}/ALL_IN_ONE/${COMPONENT_NAME_MAIN}/bin/gpt4all.app/Contents/Frameworks) file(COPY ${MYLLMODELLIBS} - DESTINATION ${CPACK_TEMPORARY_INSTALL_DIRECTORY}/packages/${COMPONENT_NAME_MAIN}/data/bin/gpt4all.app/Contents/Frameworks) + DESTINATION ${CPACK_TEMPORARY_INSTALL_DIRECTORY}/ALL_IN_ONE/${COMPONENT_NAME_MAIN}/bin/gpt4all.app/Contents/Frameworks) file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/icons/gpt4all-32.png" - DESTINATION ${CPACK_TEMPORARY_INSTALL_DIRECTORY}/packages/${COMPONENT_NAME_MAIN}/data) + DESTINATION ${CPACK_TEMPORARY_INSTALL_DIRECTORY}/ALL_IN_ONE/${COMPONENT_NAME_MAIN}) file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/icons/gpt4all-48.png" - DESTINATION ${CPACK_TEMPORARY_INSTALL_DIRECTORY}/packages/${COMPONENT_NAME_MAIN}/data) + DESTINATION ${CPACK_TEMPORARY_INSTALL_DIRECTORY}/ALL_IN_ONE/${COMPONENT_NAME_MAIN}) file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/resources/gpt4all.icns" - DESTINATION ${CPACK_TEMPORARY_INSTALL_DIRECTORY}/packages/${COMPONENT_NAME_MAIN}/data) + DESTINATION ${CPACK_TEMPORARY_INSTALL_DIRECTORY}/ALL_IN_ONE/${COMPONENT_NAME_MAIN}) diff --git a/gpt4all-chat/cmake/generate_gpt4all_alias.cmake b/gpt4all-chat/cmake/generate_gpt4all_alias.cmake new file mode 100644 index 000000000000..cab06e4caf03 --- /dev/null +++ b/gpt4all-chat/cmake/generate_gpt4all_alias.cmake @@ -0,0 +1,4 @@ +execute_process( + COMMAND ln -s bin/gpt4all.app gpt4all + WORKING_DIRECTORY ${CPACK_TEMPORARY_INSTALL_DIRECTORY}/ALL_IN_ONE +) \ No newline at end of file