最美情侣中文字幕电影,在线麻豆精品传媒,在线网站高清黄,久久黄色视频

歡迎光臨散文網(wǎng) 會員登陸 & 注冊

手把手教你構(gòu)建基于LoongArch64架構(gòu)的Linux系統(tǒng)(桌面應(yīng)用篇)

2023-06-29 10:15 作者:gracefeld  | 我要投稿

(Desktop Application For LoongArch64) 作者:孫海勇



0 制作說明

本文是CLFS for LoongArch文檔的擴(kuò)展內(nèi)容,主要針對桌面應(yīng)用相關(guān)的軟件包制作。

1 制作環(huán)境的準(zhǔn)備

本文制作步驟基于CLFS for LoongArch文檔制作的基礎(chǔ)系統(tǒng)來進(jìn)行,因此默認(rèn)認(rèn)為當(dāng)前具備了交叉編譯的基礎(chǔ)系統(tǒng)的環(huán)境。

切換到制作用戶

  使用命令切換到新創(chuàng)建的用戶:

su - lauser

  使用“su”命令進(jìn)行切換時加上“-”參數(shù)可以防止切換前的用戶環(huán)境變量帶到新用戶環(huán)境中。

2 設(shè)置環(huán)境變量

export LDFLAGS="-Wl,-rpath-link=${SYSDIR}/sysroot/usr/lib64" export PKG_CONFIG_SYSROOT_DIR=${SYSDIR}/sysroot export PKG_CONFIG_PATH="${SYSDIR}/sysroot/usr/lib64/pkgconfig:${SYSDIR}/sysroot/usr/share/pkgconfig" export COMMON_CONFIG="--prefix=/usr --sysconfdir=/etc --localstatedir=/var --libdir=/usr/lib64 \ ? ? ? ? ? ? ? ? ? ? ?--build=${CROSS_HOST} --host=${CROSS_TARGET}" export JOBS="-j8"

3 軟件包的制作

VLC

https://download.videolan.org/vlc/3.0.17.4/vlc-3.0.17.4.tar.xz

tar xvf ${DOWNLOADDIR}/vlc-3.0.17.4.tar.xz -C ${BUILDDIR} pushd ${BUILDDIR}/vlc-3.0.17.4 ? ? patch -Np1 -i ${DOWNLOADDIR}/0001-VLC-fix-for-gcc13.patch ? ? ./configure $COMMON_CONFIG --disable-chromecast ? ? make -C compat ${JOBS} ? ? make -C src ${JOBS} ? ? make -C src DESTDIR=${SYSDIR}/sysroot install ? ? make ${JOBS} ? ? make DESTDIR=${SYSDIR}/sysroot install popd

SimpleScreenRecorder

https://kgithub.com/MaartenBaert/ssr.git

git clone https://kgithub.com/MaartenBaert/ssr.git --depth 1 pushd ssr ? ? patch -Np1 -i ${DOWNLOADDIR}/ssr-add-loongarch64.patch ? ? mkdir cross-build ? ? pushd cross-build ? ? ? ? CC="${CROSS_TARGET}-gcc" CXX="${CROSS_TARGET}-g++" \ ? ? ? ? cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release \ ? ? ? ? ? ? ? -DPKG_CONFIG_EXECUTABLE=${SYSDIR}/cross-tools/bin/${CROSS_TARGET}-pkg-config \ ? ? ? ? ? ? ? -DCMAKE_SYSROOT=${SYSDIR}/sysroot \ ? ? ? ? ? ? ? -DCMAKE_FIND_ROOT_PATH=${SYSDIR}/sysroot/usr \ ? ? ? ? ? ? ? -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_LIBDIR=/usr/lib64 \ ? ? ? ? ? ? ? -DWITH_QT5=TRUE \ ? ? ? ? ? ? ? .. ? ? ? ? make ${JOBS} ? ? ? ? make DESTDIR=${SYSDIR}/sysroot install ? ? popd popd

LibreOffice

獲取軟件代碼。

git clone https://git.libreoffice.org/core --depth 1 pushd core git submodule init git submodule update --depth 1 popd mv core libreoffice-7.5-git tar -czf ${DOWNLOADDIR}/libreoffice-7.5-git.tar.gz libreoffice-7.5-git

編譯和安裝。

tar xvf ${DOWNLOADDIR}/libreoffice-7.5-git.tar.gz -C ${BUILDDIR} pushd ${BUILDDIR}/libreoffice-7.5-git ? ? cp ${SYSDIR}/cross-tools/share/automake-1.16/config.* ./ ? ? aclocal ? ? patch -Np1 -i ${DOWNLOADDIR}/libreoffice-7.5-for-clfs.patch ? ? patch -Np1 -i ${DOWNLOADDIR}/libreoffice-7.5-libgpg-error-add-loongarch64.patch ? ? patch -Np1 -i ${DOWNLOADDIR}/libreoffice-7.5-postgresql-disable_spinlock.patch ? ? PKG_CONFIG_FOR_BUILD=/bin/pkg-config \ ? ? perl ./autogen.sh CC=${CROSS_TARGET}-gcc CXX=${CROSS_TARGET}-g++ \ ? ? ? ? ? ? ? ? ? ? ? --build=${CROSS_HOST} --host=${CROSS_TARGET} \ ? ? ? ? ? ? ? ? ? ? ? --prefix=/opt/libreoffice \ ? ? ? ? ? ? ? ? ? ? ? --with-lang="zh-CN" --with-vendor=Sunhaiyong \ ? ? ? ? ? ? ? ? ? ? ? --with-help --with-myspell-dicts \ ? ? ? ? ? ? ? ? ? ? ? --without-junit --without-system-dicts --disable-dconf --disable-odk \ ? ? ? ? ? ? ? ? ? ? ? --enable-release-build=yes --without-java \ ? ? ? ? ? ? ? ? ? ? ? --with-system-boost --with-system-curl --with-system-epoxy \ ? ? ? ? ? ? ? ? ? ? ? --with-system-expat --with-system-graphite --with-system-harfbuzz \ ? ? ? ? ? ? ? ? ? ? ? --with-system-icu --with-system-jpeg --with-system-lcms2 \ ? ? ? ? ? ? ? ? ? ? ? --with-system-libatomic_ops --with-system-libpng --with-system-libxml \ ? ? ? ? ? ? ? ? ? ? ? --with-system-nss --with-system-openssl \ ? ? ? ? ? ? ? ? ? ? ? --with-system-zlib --with-system-openjpeg \ ? ? ? ? ? ? ? ? ? ? ? LIBS="-lstdc++" \ ? ? ? ? ? ? ? ? ? ? ? --with-boost-libdir=${SYSDIR}/sysroot/usr/lib64 \ ? ? ? ? ? ? ? ? ? ? ? --disable-coinmp --enable-python=no ? ? ZIC=/usr/sbin/zic make build ${JOBS} ? ? make DESTDIR=${PWD}/dest distro-pack-install ? ? cp -a ${PWD}/dest/opt/libreoffice ${SYSDIR}/sysroot/opt/ ? ? mkdir -pv ${SYSDIR}/sysroot/usr/share/bash-completion/completions/ ? ? cp -a ${PWD}/dest/usr/share/bash-completion/completions/* ${SYSDIR}/sysroot/usr/share/bash-completion/completions/ ? ? cp -a ${PWD}/dest/opt/libreoffice/share/applications/*.desktop \ ? ? ? ? ? ?${SYSDIR}/sysroot/usr/share/applications/ ? ? mkdir -pv ${SYSDIR}/sysroot/usr/share/xdg/ ? ? cp -a ${PWD}/dest/opt/libreoffice/lib/libreoffice/share/xdg/*.desktop \ ? ? ? ? ? ?${SYSDIR}/sysroot/usr/share/xdg/ popd

Thunderbird 100

https://archive.mozilla.org/pub/thunderbird/releases/100.0b4/source/thunderbird-100.0b4.source.tar.xz

tar xvf ${DOWNLOADDIR}/thunderbird-100.0b4.source.tar.xz -C ${BUILDDIR} pushd ${BUILDDIR}/thunderbird-100.0 ? ? mkdir -pv mozbuild/l10n-central ? ? pushd mozbuild/l10n-central ? ? ? ? unzip ${DOWNLOADDIR}/firefox-100-l10.zip ? ? ? ? mv zh-CN* zh-CN ? ? popd ? ? patch -Np1 -i ${DOWNLOADDIR}/firefox-100-add-loongarch.patch ? ? patch -Np1 -i ${DOWNLOADDIR}/firefox-100-add-rust-libc.patch ? ? patch -Np1 -i ${DOWNLOADDIR}/firefox-100-xpcom-add-loongarch.patch ? ? patch -Np1 -i ${DOWNLOADDIR}/firefox-100-for-clfs.patch ? ? patch -Np1 -i ${DOWNLOADDIR}/firefox-100-workround.patch ? ? patch -Np1 -i ${DOWNLOADDIR}/firefox-100-fix-for-gcc13.patch ? ? cat > comm/third_party/botan/src/build-data/arch/loongarch64.txt << "EOF" family loongarch endian little wordsize 64 EOF ? ? cat > mozconfig << "EOF" ac_add_options --disable-necko-wifi ac_add_options --with-system-libevent ac_add_options --with-system-libvpx ac_add_options --with-system-nspr ac_add_options --with-system-nss ac_add_options --with-system-icu ac_add_options --prefix=/usr ac_add_options --libdir=/usr/lib64 ac_add_options --target=loongarch64-unknown-linux-gnu ac_add_options --enable-application=comm/mail ac_add_options --disable-jit ac_add_options --disable-crashreporter ac_add_options --disable-updater ac_add_options --disable-debug ac_add_options --disable-debug-symbols ac_add_options --disable-tests ac_add_options --enable-optimize=-O2 ac_add_options --enable-official-branding ac_add_options --enable-system-ffi ac_add_options --enable-system-pixman ac_add_options --with-system-jpeg ac_add_options --with-system-png ac_add_options --with-system-zlib ac_add_options --without-wasm-sandboxed-libraries ac_add_options --with-system-webp ac_add_options --disable-strip ac_add_options --disable-jemalloc ac_add_options --disable-install-strip ac_add_options --enable-fmp4 ac_add_options --with-sysroot=${SYSDIR}/sysroot ?unset MOZ_TELEMETRY_REPORTING mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/thunderbird-build-dir EOF ? ? CC=${CROSS_TARGET}-gcc CXX=${CROSS_TARGET}-g++ \ ? ? CXXFLAGS="-fpermissive" \ ? ? MACH_BUILD_PYTHON_NATIVE_PACKAGE_SOURCE=system MOZBUILD_STATE_PATH=${PWD}/mozbuild \ ? ? ./mach configure ? ? CC=${CROSS_TARGET}-gcc CXX=${CROSS_TARGET}-g++ \ ? ? CXXFLAGS="-fpermissive" \ ? ? MACH_BUILD_PYTHON_NATIVE_PACKAGE_SOURCE=system MOZBUILD_STATE_PATH=${PWD}/mozbuild \ ? ? ./mach build ${JOBS} ? ? CC=${CROSS_TARGET}-gcc CXX=${CROSS_TARGET}-g++ \ ? ? CXXFLAGS="-fpermissive" \ ? ? MACH_BUILD_PYTHON_NATIVE_PACKAGE_SOURCE=system MOZBUILD_STATE_PATH=${PWD}/mozbuild \ ? ? ./mach package ? ? CC=${CROSS_TARGET}-gcc CXX=${CROSS_TARGET}-g++ \ ? ? CXXFLAGS="-fpermissive" \ ? ? MACH_BUILD_PYTHON_NATIVE_PACKAGE_SOURCE=system MOZBUILD_STATE_PATH=${PWD}/mozbuild \ ? ? ./mach build installers-zh-CN ? ? tar xvf thunderbird-build-dir/dist/thunderbird-100.0.zh-CN.linux-loongarch64.tar.bz2 \ ? ? ? ? -C ${SYSDIR}/sysroot/usr/lib64/ ? ? ln -sfv /usr/lib64/thunderbird/thunderbird ${SYSDIR}/sysroot/usr/bin/thunderbird popd cat > ${SYSDIR}/sysroot/usr/share/applications/thunderbird.desktop << "EOF" [Desktop Entry] Encoding=UTF-8 Name=Thunderbird Mail Name[zh_CN]=郵件客戶端 Comment=Send and receive mail Comment[zh_CN]=郵件客戶端 GenericName=郵件客戶端 Exec=thunderbird %u Terminal=false Type=Application Icon=thunderbird Categories=Network;Email; MimeType=text/html;text/xml;application/xhtml+xml;application/xml;application/rss+xml;x-scheme-handler/mailto; StartupNotify=true EOF ln -sfv ${SYSDIR}/sysroot/usr/lib/thunderbird/chrome/icons/default/default256.png \ ? ? ? ? ${SYSDIR}/sysroot/usr/share/pixmaps/thunderbird.png

4 處理目標(biāo)系統(tǒng)

清理符號(symbol)信息

  目前安裝到目標(biāo)系統(tǒng)中的二進(jìn)制文件大多帶有各種符號信息,這些信息不影響執(zhí)行,但是占用了大量的存儲空間,如果沒有調(diào)試相關(guān)的需求,可以將這些信息清理掉以減少存儲空間。

  清理符號信息可以使用strip命令,但strip必須能夠處理目標(biāo)平臺二進(jìn)制,所以我們可以使用交叉編譯工具鏈中的strip命令來操作,操作步驟如下:

pushd ${SYSDIR}/sysroot find usr/lib{,64} -type f -name \*.a -exec ${CROSS_TARGET}-strip --strip-debug {} ';' find usr/lib{,64} -type f -name \*.so* -exec ${CROSS_TARGET}-strip --strip-unneeded {} ';' find usr/{bin,sbin,libexec} -type f -exec ${CROSS_TARGET}-strip --strip-all {} ';' find opt -type f -exec ${CROSS_TARGET}-strip --strip-unneeded {} ';' popd

  這里我們發(fā)現(xiàn)strip使用的參數(shù)有多種,這里簡單的說明一下:
  *?--strip-debug,僅去掉調(diào)試相關(guān)的符號信息,該參數(shù)適合用于靜態(tài)庫文件,對于鏈接過程需要的信息是不會去掉的。
  *?--strip-unneeded,刪除所有與重定位無關(guān)的所有符號信息,該參數(shù)不能用于靜態(tài)庫文件,否則會導(dǎo)致靜態(tài)鏈接時無法使用處理過的靜態(tài)庫。
  *?--strip-all,該參數(shù)代表所有能去掉的符號信息都盡量去掉,該參數(shù)不建議用于庫文件,特別是靜態(tài)庫文件。

清除.la文件

find ${SYSDIR}/sysroot/usr/lib64/ -type f -name "*.la" -exec rm '{}' ';'

打包系統(tǒng)

  制作完成后就可以退出制作用戶環(huán)境了,使用命令:

exit

打包系統(tǒng)

  接著可以使用root權(quán)限對目標(biāo)系統(tǒng)進(jìn)行打包,打包步驟如下:

pushd ${SYSDIR}/sysroot sudo tar --xattrs-include='*' --owner=root --group=root -cjpf \ ${SYSDIR}/loongarch64-clfs-system-6.1-DesktopApp.tar.bz2 * popd

附錄

參考資料

《用“芯”探索 教你構(gòu)建龍芯平臺的Linux系統(tǒng)》 孫海勇 著

LFS:?https://www.linuxfromscratch.org/lfs/

BLFS:?https://www.linuxfromscratch.org/blfs/



手把手教你構(gòu)建基于LoongArch64架構(gòu)的Linux系統(tǒng)(桌面應(yīng)用篇)的評論 (共 條)

分享到微博請遵守國家法律
松江区| 桐梓县| 天峨县| 苍南县| 金溪县| 铜陵市| 扶余县| 松江区| 喜德县| 麻阳| 来安县| 高碑店市| 澄城县| 池州市| 乌拉特后旗| 临泉县| 新河县| 泸定县| 开江县| 重庆市| 德保县| 文成县| 驻马店市| 家居| 浏阳市| 介休市| 宁乡县| 五家渠市| 华宁县| 桃源县| 葵青区| 泸定县| 施甸县| 丰城市| 岐山县| 长寿区| 仙游县| 绥棱县| 阳信县| 呈贡县| 始兴县|