diff options
author | Torge Matthies | 2024-02-14 22:48:34 +0100 |
---|---|---|
committer | Torge Matthies | 2024-02-14 22:48:34 +0100 |
commit | e9e0212dc43f82e40a1696b116ee60a7342d9cc0 (patch) | |
tree | 122efe8c3956e7e437735ef3bba2d23c3923cde2 | |
download | aur-e9e0212dc43f82e40a1696b116ee60a7342d9cc0.tar.gz |
Initial commit
-rw-r--r-- | .SRCINFO | 23 | ||||
-rw-r--r-- | PKGBUILD | 57 | ||||
-rw-r--r-- | UnityHubNative.desktop | 10 | ||||
-rw-r--r-- | fix-cmakelists.patch | 142 | ||||
-rw-r--r-- | fix-wxwidgets-usage.patch | 44 |
5 files changed, 276 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..01bcdeeeab10 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,23 @@ +pkgbase = unityhubnative-git + pkgdesc = A lightweight C++ / wxWidgets alternative to the official Unity Hub + pkgver = 1.53.r9.gbc636ec + pkgrel = 1 + url = https://github.com/Ravbug/UnityHubNative + arch = x86_64 + license = GPL-3.0-only + license = custom + makedepends = icoutils + makedepends = fmt + depends = wxwidgets + depends = libcurl.so + provides = unityhubnative + source = unityhubnative::git+https://github.com/Ravbug/UnityHubNative.git + source = UnityHubNative.desktop + source = fix-cmakelists.patch + source = fix-wxwidgets-usage.patch + sha256sums = SKIP + sha256sums = 89bf2f78b85654a9e2e7f68e82c59ec2327970757a4637058bbacd607064e7df + sha256sums = 1f5eb1e514f43c944662e1d3319122622bfa10acb0f50250479f20b411bd2521 + sha256sums = 2a2a277ef7a5c00a9b06d400e0a4a3c9769c952107639a3527e1c633730f6cc5 + +pkgname = unityhubnative-git diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..b785a83b8821 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,57 @@ +# Maintainer: Torge Matthies <openglfreak at googlemail dot com> + +_pkgname=unityhubnative +pkgname="$_pkgname-git" +pkgver=1.53.r9.gbc636ec +pkgrel=1 +pkgdesc='A lightweight C++ / wxWidgets alternative to the official Unity Hub' +url='https://github.com/Ravbug/UnityHubNative' +license=('GPL-3.0-only' 'custom') # The code mixes a bunch of different licenses +arch=('x86_64') +depends=('wxwidgets' 'libcurl.so') +makedepends=('icoutils' 'fmt') +provides=("$_pkgname") +source=("$_pkgname::git+https://github.com/Ravbug/UnityHubNative.git" + 'UnityHubNative.desktop' + 'fix-cmakelists.patch' + 'fix-wxwidgets-usage.patch') +sha256sums=('SKIP' + '89bf2f78b85654a9e2e7f68e82c59ec2327970757a4637058bbacd607064e7df' + '1f5eb1e514f43c944662e1d3319122622bfa10acb0f50250479f20b411bd2521' + '2a2a277ef7a5c00a9b06d400e0a4a3c9769c952107639a3527e1c633730f6cc5') + +pkgver() { + git -C "$_pkgname" describe --long --tags --abbrev=7 | sed 's/\([^-]*-g\)/r\1/;s/-/./g' +} + +prepare() { + patch -d "$_pkgname" --binary -Np1 -i ../fix-cmakelists.patch + patch -d "$_pkgname" --binary -Np1 -i ../fix-wxwidgets-usage.patch + rm -rf "$_pkgname/curl" "$_pkgname/fmt" "$_pkgname/mbedtls" "$_pkgname/wxWidgets" +} + +build() { + cmake \ + -G 'Unix Makefiles' \ + -B 'build' \ + -S "$_pkgname" \ + -DCMAKE_BUILD_TYPE:STRING='None' \ + -DCMAKE_INSTALL_PREFIX:PATH='/usr' \ + -DBUILD_SHARED_LIBS:BOOL='True' \ + -Wno-dev + cmake --build 'build' + mkdir 'build/icon' + icotool --extract --icon "$_pkgname/source/wxwin.ico" --output='build/icon' + mv "$(find build/icon -type f -name '*.png' | sort | tail -n1)" 'build/UnityHubNative.png' +} + +check() { + ctest --test-dir 'build' --output-on-failure --stop-on-failure +} + +package() { + DESTDIR="$pkgdir" cmake --install 'build' + install -D -m644 "$_pkgname/LICENSE.md" -t "$pkgdir/usr/share/licenses/$pkgname" + install -D -m644 'build/UnityHubNative.png' -t "$pkgdir/usr/share/icons" + install -D -m644 'UnityHubNative.desktop' -t "$pkgdir/usr/share/applications" +} diff --git a/UnityHubNative.desktop b/UnityHubNative.desktop new file mode 100644 index 000000000000..9cbad543990a --- /dev/null +++ b/UnityHubNative.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Name=Unity Hub Native +Exec=/usr/bin/UnityHubNative +Terminal=false +Type=Application +Icon=UnityHubNative +StartupWMClass=UnityHubNative +Comment=Lightweight C++ / wxWidgets alternative to the official Unity Hub +Categories=Development; +TryExec=UnityHubNative diff --git a/fix-cmakelists.patch b/fix-cmakelists.patch new file mode 100644 index 000000000000..d10cd3f35989 --- /dev/null +++ b/fix-cmakelists.patch @@ -0,0 +1,142 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index a1bab97a..9fd3643d 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,9 +1,6 @@ +-cmake_minimum_required(VERSION 3.16)
++cmake_minimum_required(VERSION 3.16)
+
+ project("UnityHubNative")
+-set(CMAKE_INSTALL_PREFIX ${CMAKE_CURRENT_BINARY_DIR})
+-set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/$<CONFIGURATION>)
+-set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/$<CONFIGURATION>)
+ set(CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT "dwarf-with-dsym" CACHE INTERNAL "")
+
+ option(BUILD_SHARED_LIBS OFF "Build static")
+@@ -19,8 +16,6 @@ if(UNIX AND NOT APPLE) + set(LINUX TRUE CACHE INTERNAL "")
+ add_definitions(-Wno-write-strings)
+ endif()
+-set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/wxWidgets/build/cmake/modules" CACHE INTERNAL "")
+-message("module path = ${CMAKE_MODULE_PATH}")
+
+ file(GLOB source "source/*.cpp" "source/*.hpp" "source/*.h")
+ if (APPLE)
+@@ -31,57 +26,19 @@ endif() + add_executable("${PROJECT_NAME}" WIN32 ${source} "source/wxmac.icns" "source/windows.rc" ${OBJCPP})
+ target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20)
+
+-#wxwidgets
+-set(wxBUILD_SHARED OFF CACHE INTERNAL "")
+-set(wxUSE_STL ON CACHE INTERNAL "")
+-set(wxUSE_REGEX OFF CACHE INTERNAL "")
+-set(wxUSE_LIBJPEG OFF CACHE INTERNAL "")
+-set(wxUSE_LIBTIFF OFF CACHE INTERNAL "")
+-set(wxUSE_ZLIB builtin CACHE INTERNAL "")
+-add_subdirectory("wxWidgets" EXCLUDE_FROM_ALL)
++find_package(wxWidgets REQUIRED COMPONENTS net core base)
++include(${wxWidgets_USE_FILE})
++target_link_libraries(${PROJECT_NAME} PRIVATE ${wxWidgets_LIBRARIES})
+
+-# libcurl
+-if (MSVC)
+- # use Windows native SSL instead of OpenSSL or MbedTLS
+- set(CURL_USE_SCHANNEL ON CACHE INTERNAL "")
+-else()
+- # for curl SSL
+- set(ENABLE_TESTING OFF CACHE INTERNAL "")
+- set(ENABLE_PROGRAMS OFF CACHE INTERNAL "")
+- set(CURL_USE_MBEDTLS ON CACHE INTERNAL "")
+- add_subdirectory(mbedtls EXCLUDE_FROM_ALL)
+- set(MBEDTLS_LIBRARIES "mbedtls")
+-endif()
+-set(BUILD_TESTING OFF)
+-set(USE_OPENSSL OFF)
+-set(CURL_USE_LIBSSH2 OFF)
+-set(CURL_DISABLE_FTP ON) # disable unused features & protocols
+-set(CURL_DISABLE_FILE ON)
+-set(CURL_DISABLE_TELNET ON)
+-set(CURL_DISABLE_LDAP ON)
+-set(CURL_DISABLE_DICT ON)
+-set(CURL_DISABLE_TFTP ON)
+-set(CURL_DISABLE_GOPHER ON)
+-set(CURL_DISABLE_IMAP ON)
+-set(CURL_DISABLE_SMB ON)
+-set(CURL_DISABLE_SMTP ON)
+-set(CURL_DISABLE_RTSP ON)
+-set(CURL_DISABLE_MQTT ON)
+-set(CURL_DISABLE_POP3 ON)
+-add_subdirectory(curl EXCLUDE_FROM_ALL)
++find_package(CURL REQUIRED)
++include_directories(${CURL_INCLUDE_DIR})
++target_link_libraries(${PROJECT_NAME} PRIVATE ${CURL_LIBRARIES})
+
+-add_subdirectory("fmt" EXCLUDE_FROM_ALL)
+-
+-target_link_libraries("${PROJECT_NAME}"
+- PUBLIC
+- wx::core
+- CURL::libcurl
+- fmt
+-)
+-target_include_directories(${PROJECT_NAME} PUBLIC "fmt/include")
++find_package(fmt REQUIRED)
++target_link_libraries(${PROJECT_NAME} PRIVATE fmt::fmt-header-only)
+
+ # mac app
+-set_target_properties("${PROJECT_NAME}" PROPERTIES
++set_target_properties("${PROJECT_NAME}" PROPERTIES
+ MACOSX_BUNDLE ON
+ MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_LIST_DIR}/source/Info.plist"
+ XCODE_GENERATE_SCHEME ON
+@@ -90,46 +47,15 @@ set_target_properties("${PROJECT_NAME}" PROPERTIES + )
+ set_source_files_properties("${CMAKE_CURRENT_LIST_DIR}/source/wxmac.icns" PROPERTIES MACOSX_PACKAGE_LOCATION "Resources")
+ if(APPLE)
+- INSTALL(CODE
++ INSTALL(CODE
+ "include(BundleUtilities)
+ fixup_bundle(\"${CMAKE_INSTALL_PREFIX}/$<CONFIGURATION>/${PROJECT_NAME}.app\" \"\" \"\")
+- "
++ "
+ COMPONENT Runtime
+ )
+-elseif(LINUX)
+-INSTALL(CODE
+- "include(${CMAKE_CURRENT_SOURCE_DIR}/appimage.cmake)
+- make_appimage(
+- EXE \"${CMAKE_INSTALL_PREFIX}/$<CONFIGURATION>/${PROJECT_NAME}\"
+- NAME \"${PROJECT_NAME}\"
+- ICON \"${CMAKE_CURRENT_SOURCE_DIR}/source/wxlin.xpm\"
+- OUTPUT_NAME \"${CMAKE_INSTALL_PREFIX}/$<CONFIGURATION>/${PROJECT_NAME}.AppImage\"
+- ASSETS \"\"
+- )
+- "
+- COMPONENT Runtime
+- )
++else()
++ INSTALL(TARGETS ${PROJECT_NAME})
+ endif()
+ # windows app
+ set_property(TARGET ${PROJECT_NAME} PROPERTY VS_DPI_AWARE "PerMonitor")
+ set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT "${PROJECT_NAME}")
+-
+- # Strip binary for release builds
+- if (CMAKE_BUILD_TYPE STREQUAL Release)
+- if(LINUX)
+- add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD COMMAND ${CMAKE_STRIP} ${CMAKE_BUILD_TYPE}/${PROJECT_NAME})
+- elseif(APPLE)
+- add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD COMMAND ${CMAKE_STRIP} ${CMAKE_BUILD_TYPE}/${PROJECT_NAME}.app/Contents/MacOS/${PROJECT_NAME})
+- endif()
+-endif ()
+-
+-macro(enable_unity targets)
+- foreach(target ${targets})
+- set_target_properties("${target}" PROPERTIES UNITY_BUILD ON)
+- endforeach()
+-endmacro()
+-
+-set(all_unity "wxcore;wxbase;fmt;wxpng;")
+-if(MSVC)
+-#enable_unity("${all_unity}")
+-endif()
diff --git a/fix-wxwidgets-usage.patch b/fix-wxwidgets-usage.patch new file mode 100644 index 000000000000..b95ec71b6907 --- /dev/null +++ b/fix-wxwidgets-usage.patch @@ -0,0 +1,44 @@ +diff --git a/source/activation.cpp b/source/activation.cpp +index cb5efd8f..c02a9a75 100644 +--- a/source/activation.cpp ++++ b/source/activation.cpp +@@ -57,11 +57,11 @@ void PersonalActivationDlg::OnCreateHit(wxCommandEvent& evt) + void DisplayLicenseOutput(){
+ std::filesystem::path logfile
+ #ifdef __APPLE__
+- = std::filesystem::path(wxGetHomeDir()) / "Library/Logs/Unity/Editor.log";
++ = std::filesystem::path(wxGetHomeDir().ToStdString()) / "Library/Logs/Unity/Editor.log";
+ #elif defined _WIN32
+ = std::filesystem::path(wxGetHomeDir().ToStdString()) / "AppData"/"Local"/"Unity"/"Editor"/"Editor.log";
+ #else
+- = std::filesystem::path(wxGetHomeDir()) / ".config/unity3d/Editor.log";
++ = std::filesystem::path(wxGetHomeDir().ToStdString()) / ".config/unity3d/Editor.log";
+ #endif
+ ifstream in(logfile);
+ std::string output;
+@@ -94,9 +94,9 @@ void PersonalActivationDlg::OnActivateHit(wxCommandEvent&) +
+ void PlusProActivationDlg::OnActivateHit(wxCommandEvent&)
+ {
+- const std::string& username = plusProActivUsernameCtrl->GetValue();
+- const std::string& password = plusProActivPasswordCtrl->GetValue();
+- const std::string& serial = plusProActivationSerialCtrl->GetValue();
++ const auto& username = plusProActivUsernameCtrl->GetValue().ToStdString();
++ const auto& password = plusProActivPasswordCtrl->GetValue().ToStdString();
++ const auto& serial = plusProActivationSerialCtrl->GetValue().ToStdString();
+
+ auto cmd = fmt::format("{} -batchmode -username {} -password {} -serial {} -quit",the_editor.executablePath().string(),username,password,serial);
+
+diff --git a/source/interface_derived.cpp b/source/interface_derived.cpp +index 053545ef..c460fbcc 100644 +--- a/source/interface_derived.cpp ++++ b/source/interface_derived.cpp +@@ -218,7 +218,7 @@ void MainFrameDerived::Filter(wxKeyEvent &){ + projects.clear(); + auto filter = projSearchCtrl->GetValue(); + transform(filter.begin(), filter.end(), filter.begin(), ::tolower); +- LoadProjects(filter); ++ LoadProjects(filter.ToStdString()); + } + + //definitions for the events |