diff --git a/dde-file-manager.spec b/dde-file-manager.spec index 19937120093dd7f43fba54f546d6c421b539a542..e1f80c7c31edfaea96fdc93004d76f39e6a203d2 100644 --- a/dde-file-manager.spec +++ b/dde-file-manager.spec @@ -1,6 +1,6 @@ %define specrelease 8%{?dist} %if 0%{?openeuler} -%define specrelease 4 +%define specrelease 5 %endif Name: dde-file-manager @@ -11,6 +11,8 @@ License: GPLv3 URL: https://github.com/linuxdeepin/dde-file-manager Source0: %{name}_%{version}.orig.tar.xz Patch0: 0001-hide-authorized-watermask.patch +Patch1000: fix-support-for-risc-v.patch +Patch1001: riscv-link-and-file-path.patch BuildRequires: gcc-c++ BuildRequires: desktop-file-utils @@ -124,6 +126,10 @@ Deepin desktop environment - desktop module. %prep %setup -q -n %{name}-%{version} %patch0 -p1 +%ifarch riscv64 +%patch1000 -p1 +%patch1001 -p1 +%endif # fix file permissions find -type f -perm 775 -exec chmod 644 {} \; @@ -229,6 +235,10 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/dde-home.desktop ||: %{_datadir}/dbus-1/services/com.deepin.dde.desktop.service %changelog +* Tue Aug 23 2022 misaka00251 - 5.2.39-5 +- Rebase upstream & Fix compiling on RISC-V +- Special thanks to @Jingwiw + * Fri Aug 05 2022 liweiganga - 5.2.39-4 - delete authorized watermask diff --git a/fix-support-for-risc-v.patch b/fix-support-for-risc-v.patch new file mode 100644 index 0000000000000000000000000000000000000000..53dd98ea80a1e32fd0992e588bdb1329a419dff5 --- /dev/null +++ b/fix-support-for-risc-v.patch @@ -0,0 +1,109 @@ +Author: misaka00251 +Date: Tue Aug 23 17:46:44 2022 +0800 + + Fix support for RISC-V. + +diff --git a/3rdparty/charsetdetect/nspr-emu/prcpucfg_linux.h b/3rdparty/charsetdetect/nspr-emu/prcpucfg_linux.h +index 776c21e..6fe8c48 100644 +--- a/3rdparty/charsetdetect/nspr-emu/prcpucfg_linux.h ++++ b/3rdparty/charsetdetect/nspr-emu/prcpucfg_linux.h +@@ -645,6 +645,99 @@ + #define PR_BYTES_PER_WORD_LOG2 2 + #define PR_BYTES_PER_DWORD_LOG2 3 + ++#elif defined(__riscv) && (__riscv_xlen == 32) ++ ++#undef IS_BIG_ENDIAN ++#define IS_LITTLE_ENDIAN 1 ++#undef IS_64 ++ ++#define PR_BYTES_PER_BYTE 1 ++#define PR_BYTES_PER_SHORT 2 ++#define PR_BYTES_PER_INT 4 ++#define PR_BYTES_PER_INT64 8 ++#define PR_BYTES_PER_LONG 4 ++#define PR_BYTES_PER_FLOAT 4 ++#define PR_BYTES_PER_DOUBLE 8 ++#define PR_BYTES_PER_WORD 4 ++#define PR_BYTES_PER_DWORD 8 ++ ++#define PR_BITS_PER_BYTE 8 ++#define PR_BITS_PER_SHORT 16 ++#define PR_BITS_PER_INT 32 ++#define PR_BITS_PER_INT64 64 ++#define PR_BITS_PER_LONG 32 ++#define PR_BITS_PER_FLOAT 32 ++#define PR_BITS_PER_DOUBLE 64 ++#define PR_BITS_PER_WORD 32 ++ ++#define PR_BITS_PER_BYTE_LOG2 3 ++#define PR_BITS_PER_SHORT_LOG2 4 ++#define PR_BITS_PER_INT_LOG2 5 ++#define PR_BITS_PER_INT64_LOG2 6 ++#define PR_BITS_PER_LONG_LOG2 5 ++#define PR_BITS_PER_FLOAT_LOG2 5 ++#define PR_BITS_PER_DOUBLE_LOG2 6 ++#define PR_BITS_PER_WORD_LOG2 5 ++ ++#define PR_ALIGN_OF_SHORT 2 ++#define PR_ALIGN_OF_INT 4 ++#define PR_ALIGN_OF_LONG 4 ++#define PR_ALIGN_OF_INT64 8 ++#define PR_ALIGN_OF_FLOAT 4 ++#define PR_ALIGN_OF_DOUBLE 8 ++#define PR_ALIGN_OF_POINTER 4 ++#define PR_ALIGN_OF_WORD 4 ++ ++#define PR_BYTES_PER_WORD_LOG2 2 ++#define PR_BYTES_PER_DWORD_LOG2 3 ++ ++#elif defined(__riscv) && (__riscv_xlen == 64) ++ ++#undef IS_BIG_ENDIAN ++#define IS_LITTLE_ENDIAN 1 ++#define IS_64 ++ ++#define PR_BYTES_PER_BYTE 1 ++#define PR_BYTES_PER_SHORT 2 ++#define PR_BYTES_PER_INT 4 ++#define PR_BYTES_PER_INT64 8 ++#define PR_BYTES_PER_LONG 8 ++#define PR_BYTES_PER_FLOAT 4 ++#define PR_BYTES_PER_DOUBLE 8 ++#define PR_BYTES_PER_WORD 8 ++#define PR_BYTES_PER_DWORD 8 ++ ++#define PR_BITS_PER_BYTE 8 ++#define PR_BITS_PER_SHORT 16 ++#define PR_BITS_PER_INT 32 ++#define PR_BITS_PER_INT64 64 ++#define PR_BITS_PER_LONG 64 ++#define PR_BITS_PER_FLOAT 32 ++#define PR_BITS_PER_DOUBLE 64 ++#define PR_BITS_PER_WORD 64 ++ ++#define PR_BITS_PER_BYTE_LOG2 3 ++#define PR_BITS_PER_SHORT_LOG2 4 ++#define PR_BITS_PER_INT_LOG2 5 ++#define PR_BITS_PER_INT64_LOG2 6 ++#define PR_BITS_PER_LONG_LOG2 6 ++#define PR_BITS_PER_FLOAT_LOG2 5 ++#define PR_BITS_PER_DOUBLE_LOG2 6 ++#define PR_BITS_PER_WORD_LOG2 6 ++ ++#define PR_ALIGN_OF_SHORT 2 ++#define PR_ALIGN_OF_INT 4 ++#define PR_ALIGN_OF_LONG 8 ++#define PR_ALIGN_OF_INT64 8 ++#define PR_ALIGN_OF_FLOAT 4 ++#define PR_ALIGN_OF_DOUBLE 8 ++#define PR_ALIGN_OF_POINTER 8 ++#define PR_ALIGN_OF_WORD 8 ++ ++#define PR_BYTES_PER_WORD_LOG2 3 ++#define PR_BYTES_PER_DWORD_LOG2 3 ++ ++ + #else + + #error "Unknown CPU architecture" diff --git a/riscv-link-and-file-path.patch b/riscv-link-and-file-path.patch new file mode 100644 index 0000000000000000000000000000000000000000..2c52647806f531c64ab6a44821bc2d4e2c0c07c6 --- /dev/null +++ b/riscv-link-and-file-path.patch @@ -0,0 +1,82 @@ +Author: Jingwiw +Date: Sun Aug 28 10:28:38 2022 +0800 + + Solve link and file path problems that occur in riscv builds. + +diff --git a/src/common/common.pri b/src/common/common.pri +index cace636..8c72e7e 100644 +--- a/src/common/common.pri ++++ b/src/common/common.pri +@@ -74,6 +74,11 @@ unix { + QMAKE_CXXFLAGS += -O3 -ftree-vectorize -march=loongson3a -mhard-float -mno-micromips -mno-mips16 -flax-vector-conversions -mloongson-ext2 -mloongson-mmi #-mmsa #龙芯4000使用的编译优化参数 + } + ++ isEqual(ARCH, riscv64){ ++ QMAKE_CXXFLAGS += -O3 ++ QMAKE_LFLAGS += -latomic -pthread ++ } ++ + isEmpty(LIB_INSTALL_DIR) { + LIB_BASE_DIR = $$[QT_INSTALL_LIBS]/$$ProjectName + } else { +diff --git a/src/dde-file-manager-lib/dde-file-manager-lib.pro b/src/dde-file-manager-lib/dde-file-manager-lib.pro +index fd9c736..4be8fc8 100644 +--- a/src/dde-file-manager-lib/dde-file-manager-lib.pro ++++ b/src/dde-file-manager-lib/dde-file-manager-lib.pro +@@ -92,7 +92,7 @@ include(interfaces/vfs/vfs.pri) + include(interfaces/customization/customization.pri) + include(src.pri) + +-isEqual(ARCH, sw_64) | isEqual(ARCH, mips64) | isEqual(ARCH, mips32) | isEqual(ARCH, aarch64){ ++isEqual(ARCH, sw_64) | isEqual(ARCH, mips64) | isEqual(ARCH, mips32) | isEqual(ARCH, aarch64) | isEqual(ARCH, riscv64){ + include(search/dfsearch.pri) + } + +diff --git a/src/dde-file-manager-plugins/pluginPreview/pluginPreview.pro b/src/dde-file-manager-plugins/pluginPreview/pluginPreview.pro +index b6b6990..0cc76f5 100644 +--- a/src/dde-file-manager-plugins/pluginPreview/pluginPreview.pro ++++ b/src/dde-file-manager-plugins/pluginPreview/pluginPreview.pro +@@ -9,7 +9,7 @@ SUBDIRS += \ + ARCH = $$QMAKE_HOST.arch + + !CONFIG(DISABLE_FFMPEG):!isEqual(BUILD_MINIMUM, YES) { +- !isEqual(ARCH, sw_64):!isEqual(ARCH, mips64):!isEqual(ARCH, mips32) { ++ !isEqual(ARCH, sw_64):!isEqual(ARCH, mips64):!isEqual(ARCH, mips32):!isEqual(ARCH, riscv64) { + SUBDIRS += dde-video-preview-plugin + } + } +diff --git a/src/dde-file-manager/dde-file-manager.pro b/src/dde-file-manager/dde-file-manager.pro +index 0863c6f..57c68b4 100644 +--- a/src/dde-file-manager/dde-file-manager.pro ++++ b/src/dde-file-manager/dde-file-manager.pro +@@ -69,7 +69,7 @@ DEFINES += APPSHAREDIR=\\\"$$PREFIX/share/$$TARGET\\\" + target.path = $$BINDIR + + desktop.path = $${PREFIX}/share/applications/ +-isEqual(ARCH, sw_64) | isEqual(ARCH, mips64) | isEqual(ARCH, mips32) | isEqual(ARCH, aarch64) { ++isEqual(ARCH, sw_64) | isEqual(ARCH, mips64) | isEqual(ARCH, mips32) | isEqual(ARCH, aarch64) | isEqual(ARCH, riscv64) { + desktop.files = $$PWD/mips/$${TARGET}.desktop \ + dde-open.desktop + }else{ +@@ -91,7 +91,7 @@ manual.path = /usr/share/deepin-manual/manual-assets/application + + INSTALLS += target desktop policy pkexec propertyDialogShell manual + +-isEqual(ARCH, sw_64) | isEqual(ARCH, mips64) | isEqual(ARCH, mips32) | isEqual(ARCH, aarch64) { ++isEqual(ARCH, sw_64) | isEqual(ARCH, mips64) | isEqual(ARCH, mips32) | isEqual(ARCH, aarch64) | isEqual(ARCH, riscv64) { + dde-mips-shs.path = $$BINDIR + dde-mips-shs.files = $$PWD/mips/dde-computer.sh \ + $$PWD/mips/dde-trash.sh \ +diff --git a/tests/dde-file-manager-plugins/pluginPreview/test-pluginPreview.pro b/tests/dde-file-manager-plugins/pluginPreview/test-pluginPreview.pro +index 42697d9..3a5362a 100644 +--- a/tests/dde-file-manager-plugins/pluginPreview/test-pluginPreview.pro ++++ b/tests/dde-file-manager-plugins/pluginPreview/test-pluginPreview.pro +@@ -9,7 +9,7 @@ SUBDIRS += \ + ARCH = $$QMAKE_HOST.arch + + !CONFIG(DISABLE_FFMPEG):!isEqual(BUILD_MINIMUM, YES) { +- !isEqual(ARCH, sw_64):!isEqual(ARCH, mips64):!isEqual(ARCH, mips32) { ++ !isEqual(ARCH, sw_64):!isEqual(ARCH, mips64):!isEqual(ARCH, mips32):!isEqual(ARCH, riscv64) { + SUBDIRS += dde-video-preview-plugin/test-dde-video-preview-plugin.pro + } + }