From d9d5958059730e6919906291ac071618a984374d Mon Sep 17 00:00:00 2001
From: Erik Kundiman <erik@megapahit.org>
Date: Sat, 3 Aug 2024 21:37:16 +0800
Subject: Adjust release notes URL (ending up like SLv's)

since I haven't been able to build the WebAssembly website again
caused by its FreeType port's failure to link.
---
 indra/newview/llappviewer.cpp     | 2 +-
 indra/newview/lllogininstance.cpp | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 1048d36961..f1c0c104db 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -3308,7 +3308,7 @@ LLSD LLAppViewer::getViewerInfo() const
         url = LLTrans::getString("RELEASE_NOTES_BASE_URL");
         if (!LLStringUtil::endsWith(url, "/"))
             url += "/";
-        url += "#" + LLURI::escape(versionInfo.getVersion()); // + ".html";
+        url += LLURI::escape(versionInfo.getVersion()) + ".html";
     }
     info["VIEWER_RELEASE_NOTES_URL"] = url;
 
diff --git a/indra/newview/lllogininstance.cpp b/indra/newview/lllogininstance.cpp
index cf1aebf26b..2d9b46bf84 100644
--- a/indra/newview/lllogininstance.cpp
+++ b/indra/newview/lllogininstance.cpp
@@ -404,7 +404,7 @@ void LLLoginInstance::handleLoginFailure(const LLSD& event)
             relnotes = LLTrans::getString("RELEASE_NOTES_BASE_URL");
             if (!LLStringUtil::endsWith(relnotes, "/"))
                 relnotes += "/";
-            relnotes += "#" + LLURI::escape(login_version); // + ".html";
+            relnotes += LLURI::escape(login_version) + ".html";
         }
 
         if (gViewerWindow)
-- 
cgit v1.2.3


From 942d92bd73bb3db610da47b7634b57f10a6cd06f Mon Sep 17 00:00:00 2001
From: Erik Kundiman <erik@megapahit.org>
Date: Mon, 5 Aug 2024 12:40:28 +0800
Subject: Simplify, reindent and minimise difference from LL

This also contains removal of commented out lines that had previously
been used to get macOS using SDL2 instead of Cocoa, and removal of
dependency on SLPlugin when no media plugins are enabled (at all).
---
 indra/newview/CMakeLists.txt | 139 +++++++++++++++++++++----------------------
 1 file changed, 67 insertions(+), 72 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index e505a42863..25b555b372 100644
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -9,12 +9,12 @@ include(Linking)
 
 include(Boost)
 include(bugsplat)
-if (USE_AUTOBUILD_3P OR USE_CONAN)
+if (NOT USESYSTEMLIBS)
 include(BuildPackagesInfo)
 endif ()
 include(BuildVersion)
 include(CMakeCopyIfDifferent)
-if (USE_AUTOBUILD_3P OR USE_CONAN)
+if (NOT USESYSTEMLIBS)
 include(CubemapToEquirectangularJS)
 include(DBusGlib)
 endif ()
@@ -22,13 +22,13 @@ include(DragDrop)
 include(EXPAT)
 include(FMODSTUDIO)
 include(Hunspell)
-if (USE_AUTOBUILD_3P OR USE_CONAN)
+if (NOT USESYSTEMLIBS)
 include(JPEGEncoderBasic)
 endif ()
 include(JsonCpp)
 include(LLAppearance)
 include(LLAudio)
-if (USE_AUTOBUILD_3P OR USE_CONAN)
+if (NOT USESYSTEMLIBS)
 include(LLCA)
 endif ()
 include(LLCommon)
@@ -52,7 +52,7 @@ endif ()
 include(Tracy)
 include(UI)
 include(ViewerMiscLibs)
-if (USE_AUTOBUILD_3P OR USE_CONAN)
+if (NOT USESYSTEMLIBS)
 include(ViewerManager)
 endif ()
 include(VisualLeakDetector)
@@ -60,15 +60,16 @@ include(VulkanGltf)
 include(ZLIBNG)
 include(URIPARSER)
 include(LLPrimitive)
+
 if (ENABLE_MEDIA_PLUGINS)
-	include(LibVLCPlugin)
-	if (DARWIN OR LINUX)
-		include(CEFPlugin)
-	endif (DARWIN OR LINUX)
+    include(LibVLCPlugin)
+    if (DARWIN OR LINUX)
+        include(CEFPlugin)
+    endif (DARWIN OR LINUX)
 endif (ENABLE_MEDIA_PLUGINS)
 include(UnixInstall)
 
-if ((USE_AUTOBUILD_3P OR USE_CONAN) AND NOT HAVOK_TPV)
+if (NOT (USESYSTEMLIBS OR HAVOK_TPV))
    # When using HAVOK_TPV, the library is precompiled, so no need for this
 
    # Stub and probably havok lib itself is a hack, autobuild loads a 3p that really is a source tarball
@@ -89,7 +90,7 @@ if ((USE_AUTOBUILD_3P OR USE_CONAN) AND NOT HAVOK_TPV)
         target_compile_options( llphysicsextensions  PRIVATE -Wno-unused-local-typedef)
       endif (DARWIN)
    endif()
-endif ((USE_AUTOBUILD_3P OR USE_CONAN) AND NOT HAVOK_TPV)
+endif (NOT (USESYSTEMLIBS OR HAVOK_TPV))
 
 set(viewer_SOURCE_FILES
     gltfscenemanager.cpp
@@ -1419,21 +1420,18 @@ file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/viewer_version.txt"
            "${VIEWER_SHORT_VERSION}.${VIEWER_VERSION_REVISION}\n")
 
 set_source_files_properties(
-   llversioninfo.cpp tests/llversioninfo_test.cpp
+   llversioninfo.cpp tests/llversioninfo_test.cpp 
    PROPERTIES
    COMPILE_DEFINITIONS "${VIEWER_CHANNEL_VERSION_DEFINES}" # see BuildVersion.cmake
    )
 
 if (DARWIN)
-#  if (NOT USESYSTEMLIBS)
   LIST(APPEND viewer_SOURCE_FILES llappviewermacosx.cpp)
   LIST(APPEND viewer_SOURCE_FILES llappviewermacosx-objc.mm)
   LIST(APPEND viewer_SOURCE_FILES llappviewermacosx-objc.h)
-#  endif (NOT USESYSTEMLIBS)
   LIST(APPEND viewer_SOURCE_FILES llfilepicker_mac.mm)
   LIST(APPEND viewer_HEADER_FILES llfilepicker_mac.h)
 
-#  if (NOT USESYSTEMLIBS)
   # This should be compiled with the viewer.
   LIST(APPEND viewer_SOURCE_FILES llappdelegate-objc.mm)
   set_source_files_properties(
@@ -1448,7 +1446,6 @@ if (DARWIN)
     # warnings.
     COMPILE_FLAGS "-fmodules -fcxx-modules -Wno-nullability-completeness"
     )
-#  endif (NOT USESYSTEMLIBS)
 
   # Add resource files to the project.
   set(viewer_RESOURCE_FILES
@@ -1475,9 +1472,9 @@ if (USESYSTEMLIBS AND NOT DARWIN)
       PROPERTIES
       COMPILE_DEFINITIONS "${VIEWER_CHANNEL_VERSION_DEFINES}"
       )
-    if (NOT (CMAKE_CXX_COMPILER_ID MATCHES "AppleClang"))
+  if (NOT CMAKE_CXX_COMPILER_ID MATCHES "AppleClang")
     SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--as-needed")
-    endif ()
+  endif ()
 
 endif (USESYSTEMLIBS AND NOT DARWIN)
 
@@ -1625,7 +1622,7 @@ endif (WINDOWS)
 file(GLOB_RECURSE viewer_XUI_FILES LIST_DIRECTORIES FALSE
     ${CMAKE_CURRENT_SOURCE_DIR}/skins/*.xml)
 source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR}/skins PREFIX "XUI Files" FILES ${viewer_XUI_FILES})
-set_source_files_properties(${viewer_XUI_FILES}
+set_source_files_properties(${viewer_XUI_FILES} 
                             PROPERTIES HEADER_FILE_ONLY TRUE)
 list(APPEND viewer_SOURCE_FILES ${viewer_XUI_FILES})
 
@@ -1633,7 +1630,7 @@ list(APPEND viewer_SOURCE_FILES ${viewer_XUI_FILES})
 file(GLOB_RECURSE viewer_SHADER_FILES LIST_DIRECTORIES FALSE
     ${CMAKE_CURRENT_SOURCE_DIR}/app_settings/shaders/*.glsl)
 source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR}/app_settings/shaders PREFIX "Shaders" FILES ${viewer_SHADER_FILES})
-set_source_files_properties(${viewer_SHADER_FILES}
+set_source_files_properties(${viewer_SHADER_FILES} 
                             PROPERTIES HEADER_FILE_ONLY TRUE)
 list(APPEND viewer_SOURCE_FILES ${viewer_SHADER_FILES})
 
@@ -1665,8 +1662,8 @@ set(viewer_APPSETTINGS_FILES
     featuretable_mac.txt
     )
 
-if (NOT (USE_AUTOBUILD_3P OR USE_CONAN))
-	list(REMOVE_ITEM viewer_APPSETTINGS_FILES packages-info.txt)
+if (USESYSTEMLIBS)
+    list(REMOVE_ITEM viewer_APPSETTINGS_FILES packages-info.txt)
 endif ()
 
 source_group("App Settings" FILES ${viewer_APPSETTINGS_FILES})
@@ -1925,7 +1922,7 @@ endif (WINDOWS)
 # one of these being libz where you can find four or more versions in play
 # at once.  On Linux, libz can be found at link and run time via a number
 # of paths:
-#
+#     
 #      => -lfreetype
 #        => libz.so.1 (on install machine, not build)
 #      => -lSDL
@@ -1985,43 +1982,43 @@ set(ARTWORK_DIR ${CMAKE_CURRENT_SOURCE_DIR} CACHE PATH
     "Path to artwork files.")
 
 set_source_files_properties(llinventorygallery.cpp PROPERTIES COMPILE_FLAGS
-	-Wno-unused-but-set-variable)
+    -Wno-unused-but-set-variable)
 if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
-	set_source_files_properties(llappviewerlinux.cpp PROPERTIES
-		COMPILE_FLAGS -Wno-dangling-gsl
-	)
-	set_source_files_properties(llviewerstats.cpp PROPERTIES
-		COMPILE_FLAGS -Wno-unused-value)
+    set_source_files_properties(llappviewerlinux.cpp PROPERTIES
+        COMPILE_FLAGS -Wno-dangling-gsl
+    )
+    set_source_files_properties(llviewerstats.cpp PROPERTIES
+        COMPILE_FLAGS -Wno-unused-value)
 elseif (CMAKE_CXX_COMPILER_ID MATCHES "GNU")
-	set_source_files_properties(
-		llface.cpp
-		llhttpretrypolicy.cpp
-		llmodelpreview.cpp
-		llpanelface.cpp
-		lltexturefetch.cpp
-		PROPERTIES COMPILE_FLAGS -Wno-maybe-uninitialized)
-	set_source_files_properties(llfasttimerview.cpp PROPERTIES
-		COMPILE_FLAGS -Wno-nonnull)
-	set_source_files_properties(llinventorygallerymenu.cpp PROPERTIES
-		COMPILE_FLAGS -Wno-uninitialized)
-	set_source_files_properties(llviewerstats.cpp PROPERTIES
-		COMPILE_FLAGS -Wno-unused-value)
-	set_source_files_properties(llurl.cpp PROPERTIES COMPILE_FLAGS
-		-Wno-stringop-truncation)
-	set_source_files_properties(
-		llfloaterimsessiontab.cpp
-		llfloatersimplesnapshot.cpp
-		llfloatersidepanelcontainer.cpp
-		llinventorypanel.cpp
-		llpanelmaininventory.cpp
-		llpathfindingnavmesh.cpp
-		llsidepanelinventory.cpp
-		PROPERTIES COMPILE_FLAGS -Wno-dangling-reference
-	)
-	set_source_files_properties(
-		gltf/animation.cpp
-		gltf/primitive.cpp
-		PROPERTIES COMPILE_FLAGS -Wno-unused-function)
+    set_source_files_properties(
+        llface.cpp
+        llhttpretrypolicy.cpp
+        llmodelpreview.cpp
+        llpanelface.cpp
+        lltexturefetch.cpp
+        PROPERTIES COMPILE_FLAGS -Wno-maybe-uninitialized)
+    set_source_files_properties(llfasttimerview.cpp PROPERTIES
+        COMPILE_FLAGS -Wno-nonnull)
+    set_source_files_properties(llinventorygallerymenu.cpp PROPERTIES
+        COMPILE_FLAGS -Wno-uninitialized)
+    set_source_files_properties(llviewerstats.cpp PROPERTIES
+        COMPILE_FLAGS -Wno-unused-value)
+    set_source_files_properties(llurl.cpp PROPERTIES COMPILE_FLAGS
+        -Wno-stringop-truncation)
+    set_source_files_properties(
+        llfloaterimsessiontab.cpp
+        llfloatersimplesnapshot.cpp
+        llfloatersidepanelcontainer.cpp
+        llinventorypanel.cpp
+        llpanelmaininventory.cpp
+        llpathfindingnavmesh.cpp
+        llsidepanelinventory.cpp
+        PROPERTIES COMPILE_FLAGS -Wno-dangling-reference
+    )
+    set_source_files_properties(
+        gltf/animation.cpp
+        gltf/primitive.cpp
+        PROPERTIES COMPILE_FLAGS -Wno-unused-function)
 endif ()
 
 message("Copying fonts")
@@ -2042,7 +2039,7 @@ foreach(elem ${country_codes})
    set(emoji_mapping_src_file
       "${emoji_mapping_src_folder}/${elem}/emoji_characters.xml")
    set(emoji_mapping_dst_file
-      "${emoji_mapping_dst_folder}/${elem}/emoji_characters.xml")
+      "${emoji_mapping_dst_folder}/${elem}/emoji_characters.xml")      
    configure_file(${emoji_mapping_src_file} ${emoji_mapping_dst_file} COPYONLY)
 endforeach()
 
@@ -2140,13 +2137,13 @@ if (DARWIN)
   set(MACOSX_BUNDLE_BUNDLE_NAME "Megapahit")
   set(MACOSX_BUNDLE_SHORT_VERSION_STRING "${VIEWER_SHORT_VERSION}.${VIEWER_VERSION_REVISION}")
   set(MACOSX_BUNDLE_BUNDLE_VERSION "${VIEWER_SHORT_VERSION}${VIEWER_MACOSX_PHASE}${VIEWER_REVISION}")
-  set(MACOSX_BUNDLE_COPYRIGHT "Copyright © Megapahit. 2024")
+  set(MACOSX_BUNDLE_COPYRIGHT "Copyright © Megapahit 2024")
   set(MACOSX_BUNDLE_NSMAIN_NIB_FILE "SecondLife.nib")
   set(MACOSX_BUNDLE_NSPRINCIPAL_CLASS "LLApplication")
 
   # https://blog.kitware.com/upcoming-in-cmake-2-8-12-osx-rpath-support/
   set(CMAKE_MACOSX_RPATH 1)
-
+  
   set_target_properties(
     ${VIEWER_BINARY_NAME}
     PROPERTIES
@@ -2170,9 +2167,9 @@ if (DARWIN)
      "${VIEWER_APP_BUNDLE}/Contents/Info.plist"
     )
 
-  if (INSTALL)
-    install(PROGRAMS ${VIEWER_APP_EXE} DESTINATION ../MacOS)
-  else (INSTALL)
+ if (INSTALL)
+  install(PROGRAMS ${VIEWER_APP_EXE} DESTINATION ../MacOS)
+ else (INSTALL)
   add_custom_command(
     TARGET ${VIEWER_BINARY_NAME} POST_BUILD
     COMMAND ${PYTHON_EXECUTABLE}
@@ -2197,13 +2194,11 @@ if (DARWIN)
       ${VIEWER_BINARY_NAME}
       ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py
     )
-  endif (INSTALL)
+ endif (INSTALL)
 
-  if (ENABLE_MEDIA_PLUGINS)
+ if (ENABLE_MEDIA_PLUGINS)
   add_dependencies(${VIEWER_BINARY_NAME} SLPlugin media_plugin_libvlc media_plugin_cef)
-  else (ENABLE_MEDIA_PLUGINS)
-      add_dependencies(${VIEWER_BINARY_NAME} SLPlugin)
-  endif (ENABLE_MEDIA_PLUGINS)
+ endif ()
 
   if (ENABLE_SIGNING)
       set(SIGNING_SETTING "--signature=${SIGNING_IDENTITY}")
@@ -2353,7 +2348,7 @@ if (LL_TESTS)
 #    llremoteparcelrequest.cpp
     llviewerhelputil.cpp
     llversioninfo.cpp
-#    llvocache.cpp
+#    llvocache.cpp  
     llworldmap.cpp
     llworldmipmap.cpp
   )
@@ -2362,7 +2357,7 @@ if (LL_TESTS)
     llworldmap.cpp
     llworldmipmap.cpp
     PROPERTIES
-    LL_TEST_ADDITIONAL_SOURCE_FILES
+    LL_TEST_ADDITIONAL_SOURCE_FILES 
     tests/llviewertexture_stub.cpp
     #llviewertexturelist.cpp
   )
@@ -2396,7 +2391,7 @@ if (LL_TESTS)
     llworldmap.cpp
     llworldmipmap.cpp
     PROPERTIES
-    LL_TEST_ADDITIONAL_SOURCE_FILES
+    LL_TEST_ADDITIONAL_SOURCE_FILES 
     tests/llviewertexture_stub.cpp
   )
 
-- 
cgit v1.2.3


From a68c5bae3173bfeda314f1d8278b80622496c11e Mon Sep 17 00:00:00 2001
From: mobserveur <mobserveur@gmail.com>
Date: Tue, 6 Aug 2024 14:26:10 +0200
Subject: Attempt to fix the teleport issue from legacy search

This commit attempts to fix an a crash occuring when using the teleport button in the legacy search floater.
---
 indra/newview/fsfloatersearch.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'indra/newview')

diff --git a/indra/newview/fsfloatersearch.cpp b/indra/newview/fsfloatersearch.cpp
index f05e996699..ef5f70d34f 100644
--- a/indra/newview/fsfloatersearch.cpp
+++ b/indra/newview/fsfloatersearch.cpp
@@ -760,7 +760,7 @@ void FSFloaterSearch::onBtnTeleport()
 {
     if (!mParcelGlobal.isExactlyZero())
     {
-        gAgent.teleportViaLocation(mParcelGlobal);
+        gAgent.teleportViaLocationLookAt(mParcelGlobal);
         LLFloaterWorldMap::getInstance()->trackLocation(mParcelGlobal);
         /// <FS:CR> What should we do when when we teleport? The default (1) is to close the floater,
         /// the user may elect to minimize the floater (2), or to do nothing (any other setting)
-- 
cgit v1.2.3


From fb6eb9c4d53ecb1227b9a02b44e08ec609cc8417 Mon Sep 17 00:00:00 2001
From: Erik Kundiman <erik@megapahit.org>
Date: Wed, 7 Aug 2024 17:40:48 +0800
Subject: Install macOS executable without `make install`

Somehow the MACOSX_BUNDLE in add_executable isn't taking effect.
---
 indra/newview/CMakeLists.txt | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index 25b555b372..736227bea7 100644
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -2155,6 +2155,7 @@ if (DARWIN)
     LINK_FLAGS "-rpath @loader_path/../Frameworks"
     MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/Info-SecondLife.plist"
     XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER "${MACOSX_BUNDLE_GUI_IDENTIFIER}"
+    MACOSX_BUNDLE TRUE
     )
 
   set(VIEWER_APP_BUNDLE "${CMAKE_CURRENT_BINARY_DIR}/$<IF:$<BOOL:${LL_GENERATOR_IS_MULTI_CONFIG}>,$<CONFIG>,>/${product}.app")
@@ -2167,9 +2168,10 @@ if (DARWIN)
      "${VIEWER_APP_BUNDLE}/Contents/Info.plist"
     )
 
- if (INSTALL)
-  install(PROGRAMS ${VIEWER_APP_EXE} DESTINATION ../MacOS)
- else (INSTALL)
+ if (USESYSTEMLIBS)
+
+ else (USESYSTEMLIBS)
+
   add_custom_command(
     TARGET ${VIEWER_BINARY_NAME} POST_BUILD
     COMMAND ${PYTHON_EXECUTABLE}
@@ -2194,7 +2196,8 @@ if (DARWIN)
       ${VIEWER_BINARY_NAME}
       ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py
     )
- endif (INSTALL)
+
+ endif (USESYSTEMLIBS)
 
  if (ENABLE_MEDIA_PLUGINS)
   add_dependencies(${VIEWER_BINARY_NAME} SLPlugin media_plugin_libvlc media_plugin_cef)
-- 
cgit v1.2.3


From 7dcd92c833830cb63b32f153242e06c8963fa97b Mon Sep 17 00:00:00 2001
From: Erik Kundiman <erik@megapahit.org>
Date: Wed, 7 Aug 2024 17:45:23 +0800
Subject: Generate InfoPlist.strings

It didn't work before because the destination folder wouldn't exist
yet by the time it's configured, but CMake has been silent about it.
---
 indra/newview/CMakeLists.txt      | 5 +++++
 indra/newview/ViewerInstall.cmake | 6 +-----
 2 files changed, 6 insertions(+), 5 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index 736227bea7..0750abe5f0 100644
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -2170,6 +2170,11 @@ if (DARWIN)
 
  if (USESYSTEMLIBS)
 
+  configure_file(
+    ${CMAKE_CURRENT_SOURCE_DIR}/English.lproj/InfoPlist.strings
+    ${CMAKE_CURRENT_BINARY_DIR}/InfoPlist.strings
+    )
+
  else (USESYSTEMLIBS)
 
   add_custom_command(
diff --git a/indra/newview/ViewerInstall.cmake b/indra/newview/ViewerInstall.cmake
index b468f1af99..171ff86cf1 100644
--- a/indra/newview/ViewerInstall.cmake
+++ b/indra/newview/ViewerInstall.cmake
@@ -50,12 +50,8 @@ add_custom_target(contributors ALL
 
 if (DARWIN)
 
-    configure_file(
-        ${CMAKE_CURRENT_SOURCE_DIR}/English.lproj/InfoPlist.strings
-        ${VIEWER_APP_BUNDLE}/Contents/Resources/English.lproj/InfoPlist.strings
-        )
-
     install(FILES
+        ${CMAKE_CURRENT_BINARY_DIR}/InfoPlist.strings
         ${CMAKE_CURRENT_SOURCE_DIR}/English.lproj/language.txt
         DESTINATION English.lproj
         )
-- 
cgit v1.2.3


From ce115c00aaf597ad8583482732a680cf995d3741 Mon Sep 17 00:00:00 2001
From: Erik Kundiman <erik@megapahit.org>
Date: Wed, 7 Aug 2024 17:46:34 +0800
Subject: No need for custom target to generate contributors

The code is also moved to where it's relevant.
---
 indra/newview/CMakeLists.txt      | 52 +++++++++++++++++++++++++++++++++++++--
 indra/newview/ViewerInstall.cmake | 50 -------------------------------------
 2 files changed, 50 insertions(+), 52 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index 0750abe5f0..feedf6b2e0 100644
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -2043,7 +2043,55 @@ foreach(elem ${country_codes})
    configure_file(${emoji_mapping_src_file} ${emoji_mapping_dst_file} COPYONLY)
 endforeach()
 
-if (NOT USESYSTEMLIBS)
+if (USESYSTEMLIBS)
+
+  if (LINUX)
+    add_custom_command(
+        TARGET ${VIEWER_BINARY_NAME} POST_BUILD
+        COMMAND ${CMAKE_SYSROOT}/usr/bin/sed
+        ARGS -e '/Linden Lab.*/d' ${CMAKE_HOME_DIRECTORY}/../doc/contributions.txt > ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt
+        COMMAND ${CMAKE_SYSROOT}/usr/bin/sed
+        ARGS -i ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt -e '/following residents.*/d' ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt
+        COMMAND ${CMAKE_SYSROOT}/usr/bin/sed
+        ARGS -i ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt -e '/along with.*/d' ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt
+        COMMAND ${CMAKE_SYSROOT}/usr/bin/sed
+        ARGS -i ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt -e '/^$$/d' ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt
+        COMMAND ${CMAKE_SYSROOT}/usr/bin/sed
+        ARGS -i ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt -e '/\t.*/d' ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt
+        COMMAND ${CMAKE_SYSROOT}/usr/bin/sed
+        ARGS -i ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt -e '/^    .*/d' ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt
+        COMMAND sort
+        ARGS -R contributions.txt -o ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt
+        COMMAND paste
+        ARGS -s -d, ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt > ${CMAKE_CURRENT_BINARY_DIR}/contributors.txt
+        COMMAND ${CMAKE_SYSROOT}/usr/bin/sed
+        ARGS -i ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt -e 's/,/, /g' ${CMAKE_CURRENT_BINARY_DIR}/contributors.txt
+        )
+  else (LINUX)
+    add_custom_command(
+        TARGET ${VIEWER_BINARY_NAME} POST_BUILD
+        COMMAND sed
+        ARGS -e '/Linden Lab.*/d' ${CMAKE_HOME_DIRECTORY}/../doc/contributions.txt > ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt
+        COMMAND sed
+        ARGS -i '' -e '/following residents.*/d' ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt
+        COMMAND sed
+        ARGS -i '' -e '/along with.*/d' ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt
+        COMMAND sed
+        ARGS -i '' -e '/^$$/d' ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt
+        COMMAND sed
+        ARGS -i '' -e '/\t.*/d' ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt
+        COMMAND sed
+        ARGS -i '' -e '/^    .*/d' ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt
+        COMMAND sort
+        ARGS -R contributions.txt -o ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt
+        COMMAND paste
+        ARGS -s -d, ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt > ${CMAKE_CURRENT_BINARY_DIR}/contributors.txt
+        COMMAND sed
+        ARGS -i '' -e 's/,/, /g' ${CMAKE_CURRENT_BINARY_DIR}/contributors.txt
+        )
+  endif (LINUX)
+
+else (USESYSTEMLIBS)
 
 if (LINUX)
   set(product SecondLife-${ARCH}-${VIEWER_SHORT_VERSION}.${VIEWER_VERSION_REVISION})
@@ -2122,7 +2170,7 @@ if (LINUX)
   endif (PACKAGE)
 endif (LINUX)
 
-endif (NOT USESYSTEMLIBS)
+endif (USESYSTEMLIBS)
 
 if (DARWIN)
   # These all get set with PROPERTIES. It's not that the property names are
diff --git a/indra/newview/ViewerInstall.cmake b/indra/newview/ViewerInstall.cmake
index 171ff86cf1..add7d23884 100644
--- a/indra/newview/ViewerInstall.cmake
+++ b/indra/newview/ViewerInstall.cmake
@@ -1,53 +1,3 @@
-if (LINUX)
-    add_custom_command(
-        OUTPUT contributors.txt
-        COMMAND ${CMAKE_SYSROOT}/usr/bin/sed
-        ARGS -e '/Linden Lab.*/d' ${CMAKE_HOME_DIRECTORY}/../doc/contributions.txt > ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt
-        COMMAND ${CMAKE_SYSROOT}/usr/bin/sed
-        ARGS -i ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt -e '/following residents.*/d' ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt
-        COMMAND ${CMAKE_SYSROOT}/usr/bin/sed
-        ARGS -i ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt -e '/along with.*/d' ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt
-        COMMAND ${CMAKE_SYSROOT}/usr/bin/sed
-        ARGS -i ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt -e '/^$$/d' ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt
-        COMMAND ${CMAKE_SYSROOT}/usr/bin/sed
-        ARGS -i ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt -e '/\t.*/d' ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt
-        COMMAND ${CMAKE_SYSROOT}/usr/bin/sed
-        ARGS -i ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt -e '/^    .*/d' ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt
-        COMMAND sort
-        ARGS -R contributions.txt -o ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt
-        COMMAND paste
-        ARGS -s -d, ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt > ${CMAKE_CURRENT_BINARY_DIR}/contributors.txt
-        COMMAND ${CMAKE_SYSROOT}/usr/bin/sed
-        ARGS -i ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt -e 's/,/, /g' ${CMAKE_CURRENT_BINARY_DIR}/contributors.txt
-        )
-else (LINUX)
-    add_custom_command(
-        OUTPUT contributors.txt
-        COMMAND sed
-        ARGS -e '/Linden Lab.*/d' ${CMAKE_HOME_DIRECTORY}/../doc/contributions.txt > ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt
-        COMMAND sed
-        ARGS -i '' -e '/following residents.*/d' ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt
-        COMMAND sed
-        ARGS -i '' -e '/along with.*/d' ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt
-        COMMAND sed
-        ARGS -i '' -e '/^$$/d' ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt
-        COMMAND sed
-        ARGS -i '' -e '/\t.*/d' ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt
-        COMMAND sed
-        ARGS -i '' -e '/^    .*/d' ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt
-        COMMAND sort
-        ARGS -R contributions.txt -o ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt
-        COMMAND paste
-        ARGS -s -d, ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt > ${CMAKE_CURRENT_BINARY_DIR}/contributors.txt
-        COMMAND sed
-        ARGS -i '' -e 's/,/, /g' ${CMAKE_CURRENT_BINARY_DIR}/contributors.txt
-        )
-endif (LINUX)
-
-add_custom_target(contributors ALL
-    DEPENDS contributors.txt
-    )
-
 if (DARWIN)
 
     install(FILES
-- 
cgit v1.2.3


From 17420cffcb0859eb1fe4a7a141ee47e12b8c0c3d Mon Sep 17 00:00:00 2001
From: mobserveur <mobserveur@gmail.com>
Date: Wed, 7 Aug 2024 19:02:44 +0200
Subject: megapahit tuning : return of the smoothie

This commit reintroduces the meapahit specic optimisations while maintaining an option for
the LL vertex buffer optimisation mode.
---
 indra/newview/app_settings/settings.xml                       |  4 ++--
 indra/newview/skins/default/xui/en/floater_mp_performance.xml | 10 +++++-----
 2 files changed, 7 insertions(+), 7 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 35c5bb7cff..e03fc429bf 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -13775,8 +13775,8 @@
       OpenGL buffer mapping mode:
       0:auto
       1:normal
-      2:optimised
-      3:experimental.</string>
+      2:MP optimised
+      3:LL optimized.</string>
       <key>Persist</key>
       <integer>1</integer>
       <key>Type</key>
diff --git a/indra/newview/skins/default/xui/en/floater_mp_performance.xml b/indra/newview/skins/default/xui/en/floater_mp_performance.xml
index 06dc4cabc6..d943a13f66 100644
--- a/indra/newview/skins/default/xui/en/floater_mp_performance.xml
+++ b/indra/newview/skins/default/xui/en/floater_mp_performance.xml
@@ -66,7 +66,7 @@
      height="15"
      left="2"
      top="8">
-     Buffer mapping
+     Optimisations:
      (needs restart):
     </text>
 
@@ -85,13 +85,13 @@
          value="1" />
         <combo_box.item
          enabled="true"
-         label="Optimized (Apple GPU)"
-         name="Optimized"
+         label="Apple GPU (smoothie)"
+         name="Megapahit Optimisations"
          value="2" />
         <combo_box.item
          enabled="true"
-         label="Experimental"
-         name="Experimental"
+         label="Apple GPU (LL)"
+         name="LL Optimisations"
          value="3" />
     </combo_box>
 
-- 
cgit v1.2.3


From 14a87739a21bbf37b98ac6a9a0918c33f6000f1a Mon Sep 17 00:00:00 2001
From: Erik Kundiman <erik@megapahit.org>
Date: Thu, 8 Aug 2024 09:04:14 +0800
Subject: Install FMOD 2.03.02 automatically on GNU/Linux

---
 indra/newview/ViewerInstall.cmake | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'indra/newview')

diff --git a/indra/newview/ViewerInstall.cmake b/indra/newview/ViewerInstall.cmake
index add7d23884..5c4c08dc9d 100644
--- a/indra/newview/ViewerInstall.cmake
+++ b/indra/newview/ViewerInstall.cmake
@@ -130,7 +130,7 @@ if (LINUX)
             install(FILES
                 ${AUTOBUILD_INSTALL_DIR}/lib/release/libfmod.so
                 ${AUTOBUILD_INSTALL_DIR}/lib/release/libfmod.so.13
-                ${AUTOBUILD_INSTALL_DIR}/lib/release/libfmod.so.13.22
+                ${AUTOBUILD_INSTALL_DIR}/lib/release/libfmod.so.13.23
             DESTINATION ${_LIB})
         endif (USE_FMODSTUDIO)
         install(PROGRAMS
-- 
cgit v1.2.3


From 9bb9b975d9a2f2830865a63f5fe339b8f74147c8 Mon Sep 17 00:00:00 2001
From: Erik Kundiman <erik@megapahit.org>
Date: Thu, 8 Aug 2024 20:45:11 +0800
Subject: Install GLH, Mikktspace, TinyEXR, TinyGLTF & LLCA

automatically. Fix tab to spaces too.
---
 indra/newview/CMakeLists.txt | 2 --
 1 file changed, 2 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index feedf6b2e0..1bf44abb95 100644
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -28,9 +28,7 @@ endif ()
 include(JsonCpp)
 include(LLAppearance)
 include(LLAudio)
-if (NOT USESYSTEMLIBS)
 include(LLCA)
-endif ()
 include(LLCommon)
 include(LLCoreHttp)
 include(LLImage)
-- 
cgit v1.2.3


From 15181f40926e59465f50291f5b7b9323fe383749 Mon Sep 17 00:00:00 2001
From: Erik Kundiman <erik@megapahit.org>
Date: Sat, 10 Aug 2024 20:14:48 +0800
Subject: No Meshoptimizer macOS install name change or link

since the app links to Meshoptimizer statically now on macOS.
---
 indra/newview/FixBundle.cmake.in  | 5 -----
 indra/newview/FixPackage.cmake.in | 5 -----
 2 files changed, 10 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/FixBundle.cmake.in b/indra/newview/FixBundle.cmake.in
index 6d343680d9..b0d23c712c 100644
--- a/indra/newview/FixBundle.cmake.in
+++ b/indra/newview/FixBundle.cmake.in
@@ -31,11 +31,6 @@ file(CREATE_LINK
         "${viewer_BINARY_DIR}/${VIEWER_CHANNEL}.app/Contents/Resources/SLPlugin.app/Contents/Frameworks/libjpeg.8.dylib"
         SYMBOLIC
     )
-file(CREATE_LINK
-        "../../../../Frameworks/libmeshoptimizer.dylib"
-        "${viewer_BINARY_DIR}/${VIEWER_CHANNEL}.app/Contents/Resources/SLPlugin.app/Contents/Frameworks/libmeshoptimizer.dylib"
-        SYMBOLIC
-    )
 file(CREATE_LINK
         "../../../../Frameworks/libaprutil-1.0.dylib"
         "${viewer_BINARY_DIR}/${VIEWER_CHANNEL}.app/Contents/Resources/SLPlugin.app/Contents/Frameworks/libaprutil-1.0.dylib"
diff --git a/indra/newview/FixPackage.cmake.in b/indra/newview/FixPackage.cmake.in
index 167519edd3..fc8cae1d19 100644
--- a/indra/newview/FixPackage.cmake.in
+++ b/indra/newview/FixPackage.cmake.in
@@ -31,11 +31,6 @@ file(CREATE_LINK
         "${CMAKE_CACHEFILE_DIR}/_CPack_Packages/${CMAKE_SYSTEM_NAME}/Bundle/${CPACK_BUNDLE_NAME}-${CPACK_PACKAGE_VERSION}-${CMAKE_SYSTEM_NAME}/${CPACK_BUNDLE_NAME}.app/Contents/Resources/SLPlugin.app/Contents/Frameworks/libjpeg.8.dylib"
         SYMBOLIC
     )
-file(CREATE_LINK
-        "../../../../Frameworks/libmeshoptimizer.dylib"
-        "${CMAKE_CACHEFILE_DIR}/_CPack_Packages/${CMAKE_SYSTEM_NAME}/Bundle/${CPACK_BUNDLE_NAME}-${CPACK_PACKAGE_VERSION}-${CMAKE_SYSTEM_NAME}/${CPACK_BUNDLE_NAME}.app/Contents/Resources/SLPlugin.app/Contents/Frameworks/libmeshoptimizer.dylib"
-        SYMBOLIC
-    )
 file(CREATE_LINK
         "../../../../Frameworks/libaprutil-1.0.dylib"
         "${CMAKE_CACHEFILE_DIR}/_CPack_Packages/${CMAKE_SYSTEM_NAME}/Bundle/${CPACK_BUNDLE_NAME}-${CPACK_PACKAGE_VERSION}-${CMAKE_SYSTEM_NAME}/${CPACK_BUNDLE_NAME}.app/Contents/Resources/SLPlugin.app/Contents/Frameworks/libaprutil-1.0.dylib"
-- 
cgit v1.2.3


From 72c5668d54dd7f0fd43ce084cee84ea07662c4ae Mon Sep 17 00:00:00 2001
From: Erik Kundiman <erik@megapahit.org>
Date: Sat, 10 Aug 2024 21:00:29 +0800
Subject: Make sure APP_SHARE_DIR is valued in llfilesystem

otherwise the app would crash on GNU/Linux or BSD for missing the
share directory prefix, unless cmake is run twice like before just
so APP_SHARE_DIR is picked up but we don't want to have to run it
twice.
---
 indra/newview/CMakeLists.txt | 1 -
 1 file changed, 1 deletion(-)

(limited to 'indra/newview')

diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index 1bf44abb95..49a52c1e0f 100644
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -65,7 +65,6 @@ if (ENABLE_MEDIA_PLUGINS)
         include(CEFPlugin)
     endif (DARWIN OR LINUX)
 endif (ENABLE_MEDIA_PLUGINS)
-include(UnixInstall)
 
 if (NOT (USESYSTEMLIBS OR HAVOK_TPV))
    # When using HAVOK_TPV, the library is precompiled, so no need for this
-- 
cgit v1.2.3


From 15a1ca3695cd5886f0296567c10f9d62c30729b2 Mon Sep 17 00:00:00 2001
From: Erik Kundiman <erik@megapahit.org>
Date: Sun, 11 Aug 2024 14:35:38 +0800
Subject: Rearrange CPack settings & contributors generation

where they belong in newview/CMakeLists.txt.
---
 indra/newview/CMakeLists.txt | 169 ++++++++++++++++++++++++++++++-------------
 1 file changed, 118 insertions(+), 51 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index 49a52c1e0f..1dfadad584 100644
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -2040,57 +2040,80 @@ foreach(elem ${country_codes})
    configure_file(${emoji_mapping_src_file} ${emoji_mapping_dst_file} COPYONLY)
 endforeach()
 
-if (USESYSTEMLIBS)
-
-  if (LINUX)
-    add_custom_command(
-        TARGET ${VIEWER_BINARY_NAME} POST_BUILD
-        COMMAND ${CMAKE_SYSROOT}/usr/bin/sed
-        ARGS -e '/Linden Lab.*/d' ${CMAKE_HOME_DIRECTORY}/../doc/contributions.txt > ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt
-        COMMAND ${CMAKE_SYSROOT}/usr/bin/sed
-        ARGS -i ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt -e '/following residents.*/d' ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt
-        COMMAND ${CMAKE_SYSROOT}/usr/bin/sed
-        ARGS -i ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt -e '/along with.*/d' ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt
-        COMMAND ${CMAKE_SYSROOT}/usr/bin/sed
-        ARGS -i ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt -e '/^$$/d' ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt
-        COMMAND ${CMAKE_SYSROOT}/usr/bin/sed
-        ARGS -i ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt -e '/\t.*/d' ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt
-        COMMAND ${CMAKE_SYSROOT}/usr/bin/sed
-        ARGS -i ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt -e '/^    .*/d' ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt
-        COMMAND sort
-        ARGS -R contributions.txt -o ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt
-        COMMAND paste
-        ARGS -s -d, ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt > ${CMAKE_CURRENT_BINARY_DIR}/contributors.txt
-        COMMAND ${CMAKE_SYSROOT}/usr/bin/sed
-        ARGS -i ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt -e 's/,/, /g' ${CMAKE_CURRENT_BINARY_DIR}/contributors.txt
-        )
-  else (LINUX)
-    add_custom_command(
-        TARGET ${VIEWER_BINARY_NAME} POST_BUILD
-        COMMAND sed
-        ARGS -e '/Linden Lab.*/d' ${CMAKE_HOME_DIRECTORY}/../doc/contributions.txt > ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt
-        COMMAND sed
-        ARGS -i '' -e '/following residents.*/d' ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt
-        COMMAND sed
-        ARGS -i '' -e '/along with.*/d' ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt
-        COMMAND sed
-        ARGS -i '' -e '/^$$/d' ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt
-        COMMAND sed
-        ARGS -i '' -e '/\t.*/d' ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt
-        COMMAND sed
-        ARGS -i '' -e '/^    .*/d' ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt
-        COMMAND sort
-        ARGS -R contributions.txt -o ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt
-        COMMAND paste
-        ARGS -s -d, ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt > ${CMAKE_CURRENT_BINARY_DIR}/contributors.txt
-        COMMAND sed
-        ARGS -i '' -e 's/,/, /g' ${CMAKE_CURRENT_BINARY_DIR}/contributors.txt
-        )
-  endif (LINUX)
-
-else (USESYSTEMLIBS)
+if (PACKAGE AND USESYSTEMLIBS)
+  set(CPACK_PACKAGE_NAME ${VIEWER_BINARY_NAME}
+    CACHE STRING "Viewer binary name.")
+  set(CPACK_PACKAGE_VERSION ${VIEWER_VERSION_MAJOR}.${VIEWER_VERSION_MINOR}.${VIEWER_VERSION_PATCH}.${VIEWER_VERSION_REVISION}
+    CACHE STRING "Viewer major.minor.patch.revision versions.")
+  set(VIEWER_PACKAGE_COMMENT
+    "A fork of the Second Life viewer"
+    )
+  set(VIEWER_PACKAGE_DESCRIPTION
+    "An entrance to virtual empires in only megabytes. A shelter for the metaverse refugees, especially those from less supported operating systems."
+    )
+  set(VIEWER_PACKAGE_DOMAIN_NAME
+    ${VIEWER_BINARY_NAME}.net
+    )
+endif (PACKAGE AND USESYSTEMLIBS)
 
 if (LINUX)
+  if (USESYSTEMLIBS)
+    add_custom_command(
+      TARGET ${VIEWER_BINARY_NAME} POST_BUILD
+      COMMAND ${CMAKE_SYSROOT}/usr/bin/sed
+      ARGS -e '/Linden Lab.*/d' ${CMAKE_HOME_DIRECTORY}/../doc/contributions.txt > ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt
+      COMMAND ${CMAKE_SYSROOT}/usr/bin/sed
+      ARGS -i ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt -e '/following residents.*/d' ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt
+      COMMAND ${CMAKE_SYSROOT}/usr/bin/sed
+      ARGS -i ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt -e '/along with.*/d' ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt
+      COMMAND ${CMAKE_SYSROOT}/usr/bin/sed
+      ARGS -i ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt -e '/^$$/d' ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt
+      COMMAND ${CMAKE_SYSROOT}/usr/bin/sed
+      ARGS -i ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt -e '/\t.*/d' ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt
+      COMMAND ${CMAKE_SYSROOT}/usr/bin/sed
+      ARGS -i ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt -e '/^    .*/d' ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt
+      COMMAND sort
+      ARGS -R contributions.txt -o ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt
+      COMMAND paste
+      ARGS -s -d, ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt > ${CMAKE_CURRENT_BINARY_DIR}/contributors.txt
+      COMMAND ${CMAKE_SYSROOT}/usr/bin/sed
+      ARGS -i ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt -e 's/,/, /g' ${CMAKE_CURRENT_BINARY_DIR}/contributors.txt
+      )
+    if (PACKAGE)
+      if (${LINUX_DISTRO} MATCHES debian OR ${LINUX_DISTRO} MATCHES ubuntu)
+        set(CPACK_BINARY_DEB ON CACHE BOOL "Able to package Debian DEB.")
+        set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE
+          amd64
+          CACHE STRING "Debian package architecture.")
+        set(CPACK_DEBIAN_PACKAGE_DESCRIPTION ${VIEWER_PACKAGE_COMMENT}
+          CACHE STRING "Debian package description.")
+        set(CPACK_DEBIAN_PACKAGE_MAINTAINER
+          $ENV{USER}@${VIEWER_PACKAGE_DOMAIN_NAME}
+          CACHE STRING "Debian package maintainer.")
+        set(CPACK_DEBIAN_PACKAGE_SECTION net
+          CACHE STRING "Debian package section.")
+      elseif (${LINUX_DISTRO} MATCHES fedora)
+        set(CPACK_BINARY_RPM ON CACHE BOOL "Able to package Fedora RPM.")
+        set(CPACK_RPM_PACKAGE_SUMMARY ${VIEWER_PACKAGE_COMMENT}
+          CACHE STRING "RPM package summary.")
+        set(CPACK_RPM_PACKAGE_ARCHITECTURE
+          ${CMAKE_SYSTEM_PROCESSOR}
+          CACHE STRING "RPM package architecture.")
+        set(CPACK_RPM_PACKAGE_LICENSE LGPL-2.1-only
+          CACHE STRING "RPM package license.")
+        set(CPACK_RPM_PACKAGE_VENDOR ${VIEWER_CHANNEL}
+          CACHE STRING "RPM package vendor.")
+        set(CPACK_RPM_PACKAGE_URL
+          https://${VIEWER_PACKAGE_DOMAIN_NAME}
+          CACHE STRING "RPM package URL.")
+        set(CPACK_RPM_PACKAGE_DESCRIPTION ${VIEWER_PACKAGE_DESCRIPTION}
+          CACHE STRING "RPM package description.")
+        set(CPACK_RPM_PACKAGE_REQUIRES
+          "apr-util, boost-fiber, boost-program-options, boost-regex, boost-thread, collada-dom, expat, fltk, mesa-libGLU, hunspell, jsoncpp, libnghttp2, SDL2, uriparser, vlc-libs, vlc-plugins-base, libvorbis, xmlrpc-epi"
+          CACHE STRING "RPM package requirements.")
+      endif (${LINUX_DISTRO} MATCHES debian OR ${LINUX_DISTRO} MATCHES ubuntu)
+    endif (PACKAGE)
+  else (USESYSTEMLIBS)
   set(product SecondLife-${ARCH}-${VIEWER_SHORT_VERSION}.${VIEWER_VERSION_REVISION})
 
   # These are the generated targets that are copied to package/
@@ -2165,10 +2188,51 @@ if (LINUX)
     add_dependencies(llpackage copy_l_viewer_manifest)
     check_message_template(llpackage)
   endif (PACKAGE)
+  endif (USESYSTEMLIBS)
+elseif (USESYSTEMLIBS)
+  add_custom_command(
+    TARGET ${VIEWER_BINARY_NAME} POST_BUILD
+    COMMAND sed
+    ARGS -e '/Linden Lab.*/d' ${CMAKE_HOME_DIRECTORY}/../doc/contributions.txt > ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt
+    COMMAND sed
+    ARGS -i '' -e '/following residents.*/d' ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt
+    COMMAND sed
+    ARGS -i '' -e '/along with.*/d' ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt
+    COMMAND sed
+    ARGS -i '' -e '/^$$/d' ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt
+    COMMAND sed
+    ARGS -i '' -e '/\t.*/d' ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt
+    COMMAND sed
+    ARGS -i '' -e '/^    .*/d' ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt
+    COMMAND sort
+    ARGS -R contributions.txt -o ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt
+    COMMAND paste
+    ARGS -s -d, ${CMAKE_CURRENT_BINARY_DIR}/contributions.txt > ${CMAKE_CURRENT_BINARY_DIR}/contributors.txt
+    COMMAND sed
+    ARGS -i '' -e 's/,/, /g' ${CMAKE_CURRENT_BINARY_DIR}/contributors.txt
+    )
+  if (CMAKE_SYSTEM_NAME MATCHES FreeBSD AND PACKAGE)
+    set(CPACK_BINARY_FREEBSD ON CACHE BOOL "Able to package FreeBSD PKG.")
+    set(CPACK_FREEBSD_PACKAGE_COMMENT ${VIEWER_PACKAGE_COMMENT}
+      CACHE STRING "FreeBSD package comment.")
+    set(CPACK_FREEBSD_PACKAGE_DESCRIPTION ${VIEWER_PACKAGE_DESCRIPTION}
+      CACHE STRING "FreeBSD package description.")
+    set(CPACK_FREEBSD_PACKAGE_WWW
+      https://${VIEWER_PACKAGE_DOMAIN_NAME}
+      CACHE STRING "FreeBSD package WWW.")
+    set(CPACK_FREEBSD_PACKAGE_LICENSE LGPL21
+      CACHE STRING "FreeBSD package license.")
+    set(CPACK_FREEBSD_PACKAGE_MAINTAINER
+      $ENV{USER}@${VIEWER_PACKAGE_DOMAIN_NAME}
+      CACHE STRING "FreeBSD package maintainer.")
+    set(CPACK_FREEBSD_PACKAGE_ORIGIN net/${VIEWER_BINARY_NAME}
+      CACHE STRING "FreeBSD package origin.")
+    set(CPACK_FREEBSD_PACKAGE_DEPS
+      "audio/freealut;devel/collada-dom;graphics/libGLU;textproc/hunspell;misc/meshoptimizer;www/libnghttp2;graphics/openjpeg;net/uriparser;multimedia/vlc;audio/libvorbis;net/xmlrpc-epi"
+      CACHE STRING "FreeBSD package dependencies.")
+  endif (CMAKE_SYSTEM_NAME MATCHES FreeBSD AND PACKAGE)
 endif (LINUX)
 
-endif (USESYSTEMLIBS)
-
 if (DARWIN)
   # These all get set with PROPERTIES. It's not that the property names are
   # magically known to CMake -- it's that these names are referenced in the
@@ -2312,6 +2376,9 @@ endif (DARWIN)
 if (INSTALL)
   include(${CMAKE_CURRENT_SOURCE_DIR}/ViewerInstall.cmake)
 endif (INSTALL)
+if (PACKAGE AND USESYSTEMLIBS)
+  include(CPack)
+endif (PACKAGE AND USESYSTEMLIBS)
 
 # Note that the conventional VIEWER_SYMBOL_FILE is set by ../../build.sh
 if (PACKAGE AND (RELEASE_CRASH_REPORTING OR NON_RELEASE_CRASH_REPORTING) AND VIEWER_SYMBOL_FILE)
-- 
cgit v1.2.3


From 1b2d37285d4ae85bb10dd543ff2a40ea3e5419ee Mon Sep 17 00:00:00 2001
From: Erik Kundiman <erik@megapahit.org>
Date: Sun, 11 Aug 2024 15:27:47 +0800
Subject: CPACK_DEBIAN_PACKAGE_DEPENDS are in CMakeLists now

and can be differentiated across different distros, even though
there are only stable/LTS Debian and Ubuntu for now.
---
 indra/newview/CMakeLists.txt | 9 +++++++++
 1 file changed, 9 insertions(+)

(limited to 'indra/newview')

diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index 1dfadad584..2409fb1e18 100644
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -2092,6 +2092,15 @@ if (LINUX)
           CACHE STRING "Debian package maintainer.")
         set(CPACK_DEBIAN_PACKAGE_SECTION net
           CACHE STRING "Debian package section.")
+        if (${LINUX_DISTRO} MATCHES debian)
+          set(CPACK_DEBIAN_PACKAGE_DEPENDS
+            "libaprutil1, libboost-fiber1.74.0 | libboost-fiber1.81.0, libboost-filesystem1.74.0 | libboost-filesystem1.81.0, libboost-program-options1.74.0 | libboost-program-options1.81.0, libboost-regex1.74.0 | libboost-regex1.81.0, libboost-thread1.74.0 | libboost-thread1.81.0, libcollada-dom2.5-dp0, libexpat1, libfltk1.3, libglu1-mesa, libhunspell-1.7-0, libjsoncpp25, libmeshoptimizer2d (>= 0.18), libnghttp2-14, libsdl2-2.0-0, liburiparser1, libvlc5, libvorbisenc2, libvorbisfile3, libxmlrpc-epi0, vlc-plugin-base"
+          CACHE STRING "Debian package dependencies.")
+        elseif (${LINUX_DISTRO} MATCHES ubuntu)
+          set(CPACK_DEBIAN_PACKAGE_DEPENDS
+            "libaprutil1t64, libboost-fiber1.83.0, libboost-filesystem1.83.0, libboost-program-options1.83.0, libboost-regex1.83.0, libboost-thread1.83.0, libcollada-dom2.5-dp0, libexpat1, libfltk2.0-0t64, libglu1-mesa, libhunspell-1.7-0, libjsoncpp25, libmeshoptimizer2d, libnghttp2-14, libsdl2-2.0-0, liburiparser1, libvlc5, libvorbisenc2, libvorbisfile3, libxmlrpc-epi0t64, vlc-plugin-base"
+          CACHE STRING "Debian package dependencies.")
+        endif (${LINUX_DISTRO} MATCHES debian)
       elseif (${LINUX_DISTRO} MATCHES fedora)
         set(CPACK_BINARY_RPM ON CACHE BOOL "Able to package Fedora RPM.")
         set(CPACK_RPM_PACKAGE_SUMMARY ${VIEWER_PACKAGE_COMMENT}
-- 
cgit v1.2.3


From 2caff153c35274de15276b3cae10c7df54dacfc2 Mon Sep 17 00:00:00 2001
From: Erik Kundiman <erik@megapahit.org>
Date: Mon, 12 Aug 2024 13:08:38 +0800
Subject: Automatic OpenJPEG download, configure & install

---
 indra/newview/CMakeLists.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'indra/newview')

diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index 2409fb1e18..bc597fb69e 100644
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -2118,7 +2118,7 @@ if (LINUX)
         set(CPACK_RPM_PACKAGE_DESCRIPTION ${VIEWER_PACKAGE_DESCRIPTION}
           CACHE STRING "RPM package description.")
         set(CPACK_RPM_PACKAGE_REQUIRES
-          "apr-util, boost-fiber, boost-program-options, boost-regex, boost-thread, collada-dom, expat, fltk, mesa-libGLU, hunspell, jsoncpp, libnghttp2, SDL2, uriparser, vlc-libs, vlc-plugins-base, libvorbis, xmlrpc-epi"
+          "apr-util, boost-fiber, boost-program-options, boost-regex, boost-thread, collada-dom, expat, fltk, mesa-libGLU, hunspell, jsoncpp, libnghttp2, openjpeg2, SDL2, uriparser, vlc-libs, vlc-plugins-base, libvorbis, xmlrpc-epi"
           CACHE STRING "RPM package requirements.")
       endif (${LINUX_DISTRO} MATCHES debian OR ${LINUX_DISTRO} MATCHES ubuntu)
     endif (PACKAGE)
-- 
cgit v1.2.3


From aa363ba3d396685fa1e2454a903656b4cc973bba Mon Sep 17 00:00:00 2001
From: Erik Kundiman <erik@megapahit.org>
Date: Mon, 12 Aug 2024 20:39:26 +0800
Subject: Automatic XMLRPC-EPI Mac download, build & install

When linking to the static archive on arm64, it would fail with an
error of undefined iconv symbols.
When linking to the dynamic library, the path was to the dynamic
library was still assumed to still be in /usr/local/lib, so specifically
for the executable target, this needs to be changed (temporarily) to
the one in the prebuilt directory first, to later be changed again
by fixup_bundle to the bundled one in Frameworks.
---
 indra/newview/CMakeLists.txt | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index bc597fb69e..19ecfe425c 100644
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -2287,14 +2287,18 @@ if (DARWIN)
     )
 
  if (USESYSTEMLIBS)
-
   configure_file(
     ${CMAKE_CURRENT_SOURCE_DIR}/English.lproj/InfoPlist.strings
     ${CMAKE_CURRENT_BINARY_DIR}/InfoPlist.strings
     )
-
+  add_custom_command(
+    TARGET ${VIEWER_BINARY_NAME} POST_BUILD
+    COMMAND ${CMAKE_INSTALL_NAME_TOOL}
+      -change "/usr/local/lib/libxmlrpc-epi.0.dylib" "${AUTOBUILD_INSTALL_DIR}/lib/release/libxmlrpc-epi.0.dylib"
+      ${VIEWER_APP_EXE}
+    VERBATIM
+  )
  else (USESYSTEMLIBS)
-
   add_custom_command(
     TARGET ${VIEWER_BINARY_NAME} POST_BUILD
     COMMAND ${PYTHON_EXECUTABLE}
@@ -2319,7 +2323,6 @@ if (DARWIN)
       ${VIEWER_BINARY_NAME}
       ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py
     )
-
  endif (USESYSTEMLIBS)
 
  if (ENABLE_MEDIA_PLUGINS)
-- 
cgit v1.2.3


From 207641f9859088a71f3aa1db48d2a43cb16f3b62 Mon Sep 17 00:00:00 2001
From: Erik Kundiman <erik@megapahit.org>
Date: Thu, 15 Aug 2024 06:54:30 +0800
Subject: One more opting out from WebRTC for FreeBSD

---
 indra/newview/llvoiceclient.cpp | 2 ++
 1 file changed, 2 insertions(+)

(limited to 'indra/newview')

diff --git a/indra/newview/llvoiceclient.cpp b/indra/newview/llvoiceclient.cpp
index 6ff7426317..a914c4e6c9 100644
--- a/indra/newview/llvoiceclient.cpp
+++ b/indra/newview/llvoiceclient.cpp
@@ -289,7 +289,9 @@ void LLVoiceClient::setNonSpatialVoiceModule(const std::string &voice_server_typ
 
 void LLVoiceClient::setHidden(bool hidden)
 {
+#if !__FreeBSD__
     LLWebRTCVoiceClient::getInstance()->setHidden(hidden);
+#endif
     LLVivoxVoiceClient::getInstance()->setHidden(hidden);
 }
 
-- 
cgit v1.2.3


From d15ebf5623fe15677a59a66029e9cfd00edc2942 Mon Sep 17 00:00:00 2001
From: Erik Kundiman <erik@megapahit.org>
Date: Sat, 17 Aug 2024 13:23:01 +0800
Subject: Distance in nearby tab (draft)

https://megapahit.com/show_bug.cgi?id=49
Still needs to be tidied up. For now it's aligned to the left.
If you want to align it to the right, apart from modifying
avatar_distance in panel_avatar_list_item.xml to look more like
last_interaction, modify newview/llavatarlistitem.cpp line 555
to be something like:
`S32 avatar_distance_width = avatar_item->mLastInteractionTime->getRect().mLeft - avatar_item->mAvatarDistance->getRect().mLeft;`
I had tried this at first, but I couldn't make it look good and
that's why I aligned it to the left.

Also, these distances need to not be shown on Friends list.
I'm doing that next.
---
 indra/newview/llavatarlist.cpp                     | 37 ++++++++++++++++++++--
 indra/newview/llavatarlist.h                       |  2 ++
 indra/newview/llavatarlistitem.cpp                 | 20 ++++++++++++
 indra/newview/llavatarlistitem.h                   |  4 +++
 .../default/xui/en/panel_avatar_list_item.xml      | 11 +++++++
 5 files changed, 72 insertions(+), 2 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/llavatarlist.cpp b/indra/newview/llavatarlist.cpp
index e467f74f9c..57126d175f 100644
--- a/indra/newview/llavatarlist.cpp
+++ b/indra/newview/llavatarlist.cpp
@@ -36,6 +36,7 @@
 #include "lltextutil.h"
 
 // newview
+#include "llagent.h"
 #include "llagentdata.h" // for comparator
 #include "llavatariconctrl.h"
 #include "llavatarnamecache.h"
@@ -47,6 +48,7 @@
 #include "llvoiceclient.h"
 #include "llviewercontrol.h"    // for gSavedSettings
 #include "lltooldraganddrop.h"
+#include "llworld.h"
 
 static LLDefaultChildRegistry::Register<LLAvatarList> r("avatar_list");
 
@@ -131,6 +133,7 @@ LLAvatarList::LLAvatarList(const Params& p)
 :   LLFlatListViewEx(p)
 , mIgnoreOnlineStatus(p.ignore_online_status)
 , mShowLastInteractionTime(p.show_last_interaction_time)
+, mAvatarDistance(true)
 , mContextMenu(NULL)
 , mDirty(true) // to force initial update
 , mNeedUpdateNames(false)
@@ -147,7 +150,7 @@ LLAvatarList::LLAvatarList(const Params& p)
     // Set default sort order.
     setComparator(&NAME_COMPARATOR);
 
-    if (mShowLastInteractionTime)
+    if (mShowLastInteractionTime || mAvatarDistance)
     {
         mLITUpdateTimer = new LLTimer();
         mLITUpdateTimer->setTimerExpirySec(0); // zero to force initial update
@@ -196,9 +199,16 @@ void LLAvatarList::draw()
     if (mDirty)
         refresh();
 
-    if (mShowLastInteractionTime && mLITUpdateTimer->hasExpired())
+    if ((mShowLastInteractionTime || mAvatarDistance) && mLITUpdateTimer->hasExpired())
     {
+        if (mAvatarDistance)
+        {
+            updateAvatarDistance();
+        }
+        if (mShowLastInteractionTime)
+        {
         updateLastInteractionTimes();
+        }
         mLITUpdateTimer->setTimerExpirySec(LIT_UPDATE_PERIOD); // restart the timer
     }
 }
@@ -422,6 +432,7 @@ void LLAvatarList::addNewItem(const LLUUID& id, const std::string& name, BOOL is
     // This sets the name as a side effect
     item->setAvatarId(id, mSessionID, mIgnoreOnlineStatus);
     item->setOnline(mIgnoreOnlineStatus ? true : is_online);
+    item->showAvatarDistance(true);
     item->showLastInteractionTime(mShowLastInteractionTime);
 
     item->setAvatarIconVisible(mShowIcons);
@@ -528,6 +539,28 @@ void LLAvatarList::computeDifference(
     LLCommonUtils::computeDifference(vnew_unsorted, vcur, vadded, vremoved);
 }
 
+void LLAvatarList::updateAvatarDistance()
+{
+    std::vector<LLPanel*> items;
+    getItems(items);
+    auto uuids = getIDs();
+    std::vector<LLVector3d> positions;
+    auto me_pos = gAgent.getPositionGlobal();
+    LLWorld::getInstance()->getAvatars(&uuids, &positions, me_pos, gSavedSettings.getF32("MPVNearMeRange"));
+    std::map <LLUUID, LLVector3d> avatarsPositions;
+    auto pos_it = positions.begin();
+    auto id_it = uuids.begin();
+    for (;pos_it != positions.end() && id_it != uuids.end(); ++pos_it, ++id_it)
+    {
+        avatarsPositions[*id_it] = *pos_it;
+    }
+    for (auto it = items.begin(); it != items.end(); it++)
+    {
+        auto item = static_cast<LLAvatarListItem*>(*it);
+        item->setAvatarDistance(dist_vec(avatarsPositions[item->getAvatarId()], me_pos));
+    }
+}
+
 // Refresh shown time of our last interaction with all listed avatars.
 void LLAvatarList::updateLastInteractionTimes()
 {
diff --git a/indra/newview/llavatarlist.h b/indra/newview/llavatarlist.h
index 2352c7cd55..ac92c97660 100644
--- a/indra/newview/llavatarlist.h
+++ b/indra/newview/llavatarlist.h
@@ -110,6 +110,7 @@ protected:
         const uuid_vec_t& vnew,
         uuid_vec_t& vadded,
         uuid_vec_t& vremoved);
+    void updateAvatarDistance();
     void updateLastInteractionTimes();
     void rebuildNames();
     void onItemDoubleClicked(LLUICtrl* ctrl, S32 x, S32 y, MASK mask);
@@ -118,6 +119,7 @@ protected:
 private:
 
     bool mIgnoreOnlineStatus;
+    bool mAvatarDistance;
     bool mShowLastInteractionTime;
     bool mDirty;
     bool mNeedUpdateNames;
diff --git a/indra/newview/llavatarlistitem.cpp b/indra/newview/llavatarlistitem.cpp
index 5f243d18c0..dd0e2d83d3 100644
--- a/indra/newview/llavatarlistitem.cpp
+++ b/indra/newview/llavatarlistitem.cpp
@@ -65,6 +65,7 @@ LLAvatarListItem::LLAvatarListItem(bool not_from_ui_factory/* = true*/)
     LLFriendObserver(),
     mAvatarIcon(NULL),
     mAvatarName(NULL),
+    mAvatarDistance(NULL),
     mLastInteractionTime(NULL),
     mIconPermissionOnline(NULL),
     mIconPermissionMap(NULL),
@@ -107,6 +108,7 @@ BOOL  LLAvatarListItem::postBuild()
 {
     mAvatarIcon = getChild<LLAvatarIconCtrl>("avatar_icon");
     mAvatarName = getChild<LLTextBox>("avatar_name");
+    mAvatarDistance = getChild<LLTextBox>("avatar_distance");
     mLastInteractionTime = getChild<LLTextBox>("last_interaction");
 
     mIconPermissionOnline = getChild<LLIconCtrl>("permission_online_icon");
@@ -301,6 +303,17 @@ void LLAvatarListItem::setAvatarId(const LLUUID& id, const LLUUID& session_id, b
     }
 }
 
+void LLAvatarListItem::showAvatarDistance(bool show)
+{
+    mAvatarDistance->setVisible(show);
+    updateChildren();
+}
+
+void LLAvatarListItem::setAvatarDistance(F32 distance)
+{
+    mAvatarDistance->setValue(llformat("%.1f m", distance));
+}
+
 void LLAvatarListItem::showLastInteractionTime(bool show)
 {
     mLastInteractionTime->setVisible(show);
@@ -538,6 +551,9 @@ void LLAvatarListItem::initChildrenWidths(LLAvatarListItem* avatar_item)
     // last interaction time textbox width + padding
     S32 last_interaction_time_width = avatar_item->mIconPermissionEditTheirs->getRect().mLeft - avatar_item->mLastInteractionTime->getRect().mLeft;
 
+    // avatar distance textbox width + padding
+    S32 avatar_distance_width = avatar_item->mAvatarDistance->getRect().mLeft - avatar_item->mAvatarName->getRect().mLeft;
+
     // avatar icon width + padding
     S32 icon_width = avatar_item->mAvatarName->getRect().mLeft - avatar_item->mAvatarIcon->getRect().mLeft;
 
@@ -546,6 +562,7 @@ void LLAvatarListItem::initChildrenWidths(LLAvatarListItem* avatar_item)
     S32 index = ALIC_COUNT;
     sChildrenWidths[--index] = icon_width;
     sChildrenWidths[--index] = 0; // for avatar name we don't need its width, it will be calculated as "left available space"
+    sChildrenWidths[--index] = avatar_distance_width;
     sChildrenWidths[--index] = last_interaction_time_width;
     sChildrenWidths[--index] = permission_edit_theirs_width;
     sChildrenWidths[--index] = permission_edit_mine_width;
@@ -666,6 +683,9 @@ LLView* LLAvatarListItem::getItemChildView(EAvatarListItemChildIndex child_view_
     case ALIC_NAME:
         child_view = mAvatarName;
         break;
+    case ALIC_DISTANCE:
+        child_view = mAvatarDistance;
+        break;
     case ALIC_INTERACTION_TIME:
         child_view = mLastInteractionTime;
         break;
diff --git a/indra/newview/llavatarlistitem.h b/indra/newview/llavatarlistitem.h
index 3f6dcb0783..ac356ab3b1 100644
--- a/indra/newview/llavatarlistitem.h
+++ b/indra/newview/llavatarlistitem.h
@@ -98,12 +98,14 @@ public:
     void setHighlight(const std::string& highlight);
     void setState(EItemState item_style);
     void setAvatarId(const LLUUID& id, const LLUUID& session_id, bool ignore_status_changes = false, bool is_resident = true);
+    void setAvatarDistance(F32 distance);
     void setLastInteractionTime(U32 secs_since);
     //Show/hide profile/info btn, translating speaker indicator and avatar name coordinates accordingly
     void setShowProfileBtn(bool show);
     void setShowInfoBtn(bool show);
     void showSpeakingIndicator(bool show);
     void setShowPermissions(bool show) { mShowPermissions = show; };
+    void showAvatarDistance(bool show);
     void showLastInteractionTime(bool show);
     void setAvatarIconVisible(bool visible);
     void setShowCompleteName(bool show) { mShowCompleteName = show;};
@@ -158,6 +160,7 @@ private:
         ALIC_PERMISSION_EDIT_MINE,
         ALIC_PERMISSION_EDIT_THEIRS,
         ALIC_INTERACTION_TIME,
+        ALIC_DISTANCE,
         ALIC_NAME,
         ALIC_ICON,
         ALIC_COUNT,
@@ -199,6 +202,7 @@ private:
     LLView* getItemChildView(EAvatarListItemChildIndex child_index);
 
     LLTextBox* mAvatarName;
+    LLTextBox* mAvatarDistance;
     LLTextBox* mLastInteractionTime;
     LLStyle::Params mAvatarNameStyle;
 
diff --git a/indra/newview/skins/default/xui/en/panel_avatar_list_item.xml b/indra/newview/skins/default/xui/en/panel_avatar_list_item.xml
index ca6e94397d..122b5ae508 100644
--- a/indra/newview/skins/default/xui/en/panel_avatar_list_item.xml
+++ b/indra/newview/skins/default/xui/en/panel_avatar_list_item.xml
@@ -65,6 +65,17 @@
      use_ellipses="true"
      value="(loading)"
      width="180" />
+    <text
+     follows="left|right"
+     font="SansSerifSmall"
+     height="15"
+     layout="topleft"
+     left_pad="5"
+     name="avatar_distance"
+     top="6"
+     text_color="LtGray_50"
+     value="0m"
+     width="35" />
     <text
      follows="right"
      font="SansSerifSmall"
-- 
cgit v1.2.3


From b1c0b309421b76c1e39bff76439e9c0d6391d7ad Mon Sep 17 00:00:00 2001
From: Erik Kundiman <erik@megapahit.org>
Date: Sat, 17 Aug 2024 14:54:09 +0800
Subject: Show avatar distance only on nearby list

---
 indra/newview/llavatarlist.cpp                      | 5 +++--
 indra/newview/llavatarlist.h                        | 1 +
 indra/newview/skins/default/xui/en/panel_people.xml | 1 +
 3 files changed, 5 insertions(+), 2 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/llavatarlist.cpp b/indra/newview/llavatarlist.cpp
index 57126d175f..5624961e35 100644
--- a/indra/newview/llavatarlist.cpp
+++ b/indra/newview/llavatarlist.cpp
@@ -121,6 +121,7 @@ static const LLFlatListView::ItemReverseComparator REVERSE_NAME_COMPARATOR(NAME_
 
 LLAvatarList::Params::Params()
 : ignore_online_status("ignore_online_status", false)
+, show_avatar_distance("show_avatar_distance", false)
 , show_last_interaction_time("show_last_interaction_time", false)
 , show_info_btn("show_info_btn", true)
 , show_profile_btn("show_profile_btn", true)
@@ -133,7 +134,7 @@ LLAvatarList::LLAvatarList(const Params& p)
 :   LLFlatListViewEx(p)
 , mIgnoreOnlineStatus(p.ignore_online_status)
 , mShowLastInteractionTime(p.show_last_interaction_time)
-, mAvatarDistance(true)
+, mAvatarDistance(p.show_avatar_distance)
 , mContextMenu(NULL)
 , mDirty(true) // to force initial update
 , mNeedUpdateNames(false)
@@ -432,7 +433,7 @@ void LLAvatarList::addNewItem(const LLUUID& id, const std::string& name, BOOL is
     // This sets the name as a side effect
     item->setAvatarId(id, mSessionID, mIgnoreOnlineStatus);
     item->setOnline(mIgnoreOnlineStatus ? true : is_online);
-    item->showAvatarDistance(true);
+    item->showAvatarDistance(mAvatarDistance);
     item->showLastInteractionTime(mShowLastInteractionTime);
 
     item->setAvatarIconVisible(mShowIcons);
diff --git a/indra/newview/llavatarlist.h b/indra/newview/llavatarlist.h
index ac92c97660..5593985fff 100644
--- a/indra/newview/llavatarlist.h
+++ b/indra/newview/llavatarlist.h
@@ -50,6 +50,7 @@ public:
     struct Params : public LLInitParam::Block<Params, LLFlatListViewEx::Params>
     {
         Optional<bool>  ignore_online_status, // show all items as online
+                        show_avatar_distance,
                         show_last_interaction_time, // show most recent interaction time. *HACK: move this to a derived class
                         show_info_btn,
                         show_profile_btn,
diff --git a/indra/newview/skins/default/xui/en/panel_people.xml b/indra/newview/skins/default/xui/en/panel_people.xml
index c31e6c94ea..199609d57d 100644
--- a/indra/newview/skins/default/xui/en/panel_people.xml
+++ b/indra/newview/skins/default/xui/en/panel_people.xml
@@ -223,6 +223,7 @@ Learn about [https://community.secondlife.com/knowledgebase/joining-and-particip
                keep_one_selected="false"
                multi_select="true"
                name="avatar_list"
+               show_avatar_distance="true"
                right="-1"
                top="2" />
            </layout_panel>
-- 
cgit v1.2.3


From d985bf9feda44e43d5e49983a12611f2c121d4eb Mon Sep 17 00:00:00 2001
From: Erik Kundiman <erik@megapahit.org>
Date: Sun, 18 Aug 2024 16:59:07 +0800
Subject: openSUSE Tumbleweed support

Its own CPACK_RPM_PACKAGE_REQUIRES will catch up soon.
---
 indra/newview/CMakeLists.txt | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index 19ecfe425c..6166d6d070 100644
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -2101,7 +2101,7 @@ if (LINUX)
             "libaprutil1t64, libboost-fiber1.83.0, libboost-filesystem1.83.0, libboost-program-options1.83.0, libboost-regex1.83.0, libboost-thread1.83.0, libcollada-dom2.5-dp0, libexpat1, libfltk2.0-0t64, libglu1-mesa, libhunspell-1.7-0, libjsoncpp25, libmeshoptimizer2d, libnghttp2-14, libsdl2-2.0-0, liburiparser1, libvlc5, libvorbisenc2, libvorbisfile3, libxmlrpc-epi0t64, vlc-plugin-base"
           CACHE STRING "Debian package dependencies.")
         endif (${LINUX_DISTRO} MATCHES debian)
-      elseif (${LINUX_DISTRO} MATCHES fedora)
+      elseif (${LINUX_DISTRO} MATCHES fedora OR (${LINUX_DISTRO} MATCHES opensuse-tumbleweed))
         set(CPACK_BINARY_RPM ON CACHE BOOL "Able to package Fedora RPM.")
         set(CPACK_RPM_PACKAGE_SUMMARY ${VIEWER_PACKAGE_COMMENT}
           CACHE STRING "RPM package summary.")
@@ -2117,9 +2117,12 @@ if (LINUX)
           CACHE STRING "RPM package URL.")
         set(CPACK_RPM_PACKAGE_DESCRIPTION ${VIEWER_PACKAGE_DESCRIPTION}
           CACHE STRING "RPM package description.")
-        set(CPACK_RPM_PACKAGE_REQUIRES
-          "apr-util, boost-fiber, boost-program-options, boost-regex, boost-thread, collada-dom, expat, fltk, mesa-libGLU, hunspell, jsoncpp, libnghttp2, openjpeg2, SDL2, uriparser, vlc-libs, vlc-plugins-base, libvorbis, xmlrpc-epi"
-          CACHE STRING "RPM package requirements.")
+        if (${LINUX_DISTRO} MATCHES fedora)
+          set(CPACK_RPM_PACKAGE_REQUIRES
+            "apr-util, boost-fiber, boost-program-options, boost-regex, boost-thread, collada-dom, expat, fltk, mesa-libGLU, hunspell, jsoncpp, libnghttp2, openjpeg2, SDL2, uriparser, vlc-libs, vlc-plugins-base, libvorbis, xmlrpc-epi"
+            CACHE STRING "RPM package requirements.")
+        elseif (${LINUX_DISTRO} MATCHES opensuse-tumbleweed)
+        endif (${LINUX_DISTRO} MATCHES fedora)
       endif (${LINUX_DISTRO} MATCHES debian OR ${LINUX_DISTRO} MATCHES ubuntu)
     endif (PACKAGE)
   else (USESYSTEMLIBS)
-- 
cgit v1.2.3