[Bug 2213078] Review Request: goldendict-ng - The Next Generation GoldenDict

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



https://bugzilla.redhat.com/show_bug.cgi?id=2213078



--- Comment #14 from shenlebantongying <shenlebantongying@xxxxxxxxx> ---
Thanks for the detailed explanation of Fedora's guidelines. We can go either
way, marked as conflict or co-exist install.

If we choose to co-exist install, I have upstreamed a new flag to co-exist with
the original GD in parallel

https://github.com/xiaoyifang/goldendict-ng/pull/1041

It cannot be directly applied to v23.07.23 due to a file name change
https://github.com/xiaoyifang/goldendict-ng/releases/tag/v23.07.23

but I attached an equivalent patch for v23.07.23 below. We can carry this patch
for one version and then drop it in the next release.

```
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 50939bdb..18cb077d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -11,13 +11,19 @@ option(WITH_ZIM "enable zim support" ON)
 option(USE_SYSTEM_FMT "use system fmt instead of bundled one" OFF)
 option(USE_SYSTEM_TOML "use system toml++ instead of bundled one" OFF)

+option(USE_ALTERNATIVE_NAME "Force the name goldendict-ng " OFF)
+
 include(FeatureSummary)

 project(goldendict-ng
         VERSION 23.06.02
         LANGUAGES CXX C)

-set(GOLDENDICT "goldendict") # binary/executable name
+if (NOT USE_ALTERNATIVE_NAME)
+    set(GOLDENDICT "goldendict") # binary/executable name
+else ()
+    set(GOLDENDICT "goldendict-ng")
+endif ()

 set(CMAKE_AUTOUIC ON)
 set(CMAKE_AUTOMOC ON)
@@ -94,11 +100,6 @@ endif ()
 # Note: used as c++ string thus need surrounding " "
 add_compile_definitions(PROGRAM_VERSION="${PROJECT_VERSION}")

-if (LINUX)
-    # see: config.cc -> getProgramDataDir
-   
add_compile_definitions(PROGRAM_DATA_DIR="${CMAKE_INSTALL_PREFIX}/share/goldendict")
-endif ()
-
 target_link_libraries(${GOLDENDICT} PRIVATE
         Qt6::Xml
         Qt6::Concurrent
@@ -194,9 +195,24 @@ if (LINUX OR BSD)
     install(FILES
${CMAKE_SOURCE_DIR}/redist/org.xiaoyifang.GoldenDict_NG.desktop DESTINATION
share/applications)
     install(FILES
${CMAKE_SOURCE_DIR}/redist/org.xiaoyifang.GoldenDict_NG.metainfo.xml
DESTINATION share/metainfo)

-    install(FILES ${CMAKE_SOURCE_DIR}/redist/icons/goldendict.png DESTINATION
share/pixmaps)
-
-    install(FILES ${qm_files} DESTINATION share/goldendict/locale)
+    if (NOT USE_ALTERNATIVE_NAME)
+        # see: config.cc -> getProgramDataDir
+       
add_compile_definitions(PROGRAM_DATA_DIR="${CMAKE_INSTALL_PREFIX}/share/goldendict")
+        install(FILES ${CMAKE_SOURCE_DIR}/redist/icons/goldendict.png
DESTINATION share/pixmaps)
+        install(FILES ${qm_files} DESTINATION share/goldendict/locale)
+    else ()
+       
add_compile_definitions(PROGRAM_DATA_DIR="${CMAKE_INSTALL_PREFIX}/share/goldendict-ng")
+        install(FILES ${CMAKE_SOURCE_DIR}/redist/icons/goldendict.png
DESTINATION share/pixmaps
+                RENAME goldendict-ng.png)
+        install(FILES ${qm_files} DESTINATION share/goldendict-ng/locale)
+
+        block() # patch the desktop file to adapt the binary & icon file's
name change
+            file(READ
"${CMAKE_SOURCE_DIR}/redist/org.xiaoyifang.GoldenDict_NG.desktop"
DESKTOP_FILE_CONTENT)
+            string(REGEX REPLACE "\nIcon=goldendict\n"
"\nIcon=goldendict-ng\n" DESKTOP_FILE_CONTENT "${DESKTOP_FILE_CONTENT}")
+            string(REGEX REPLACE "\nExec=goldendict %u\n"
"\nExec=goldendict-ng %u\n" DESKTOP_FILE_CONTENT "${DESKTOP_FILE_CONTENT}")
+            file(WRITE
"${CMAKE_SOURCE_DIR}/redist/org.xiaoyifang.GoldenDict_NG.desktop"
"${DESKTOP_FILE_CONTENT}")
+        endblock()
+    endif ()
 endif ()

 qt_finalize_target(${GOLDENDICT})
```


-- 
You are receiving this mail because:
You are on the CC list for the bug.
You are always notified about changes to this product and component
https://bugzilla.redhat.com/show_bug.cgi?id=2213078

Report this comment as SPAM: https://bugzilla.redhat.com/enter_bug.cgi?product=Bugzilla&format=report-spam&short_desc=Report%20of%20Bug%202213078%23c14
_______________________________________________
package-review mailing list -- package-review@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to package-review-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/package-review@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue




[Index of Archives]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite Conditions]     [KDE Users]

  Powered by Linux