我们暂时定于使用 http://download.documentfoundation.org/libreoffice/src/7.3.4/ 的tarball包。
apt-get install git build-essential zip ccache junit4 libkrb5-dev nasm graphviz python3 python3-dev qtbase5-dev libkf5coreaddons-dev libkf5i18n-dev libkf5config-dev libkf5windowsystem-dev libkf5kio-dev autoconf libcups2-dev libfontconfig1-dev gperf default-jdk doxygen libxslt1-dev xsltproc libxml2-utils libxrandr-dev libx11-dev bison flex libgtk-3-dev libgstreamer-plugins-base1.0-dev libgstreamer1.0-dev ant ant-optional libnss3-dev libavahi-client-dev
xz-utils pkg-config autoconf make gcc libfontconfig1-dev libarchive-zip-perl libclucene-dev libxmlsec1-dev librevenge-dev libodfgen-dev libepubgen-dev libwpd-dev libwpg-dev libwps-dev libvisio-dev libcdr-dev libmspub-dev libmwaw-dev libetonyek-dev libfreehand-dev libe-book-dev libabw-dev libqxp-dev libzmf-dev libstaroffice-dev libreoffice-sdbc-hsqldb libpq-dev libcurl4-gnutls-dev libboost-dev libboost-date-time-dev libboost-filesystem-dev libboost-locale-dev libboost-iostreams-dev libmdds-dev libglm-dev
xz -d libreoffice-7.3.4.2.tar.xz
wget -r --level=1 -nd -P <lo_root>/external/tarballs https://go.suokunlong.cn:88/dl/libreoffice/external_tarballs/
docker pull riscv64/debian:unstable
docker build ~/mydockerbuild -f example_dockerfile -t example_image
docker run example_image # 交互模式
// 或者这样的方式去执行:
docker run -it --rm example_image bash
vimer@dev:~/git/LibreOffice-riscv-port/patch$ docker image ls REPOSITORY TAG IMAGE ID CREATED SIZE example_image latest 27be1957beac 5 hours ago 2.02GB
这里记载下loongarch64 on Debian的一些资源,虽然现在还没有准备好。
https://blog.xen0n.name/en/posts/tinkering/loongarch-faq/
记录下维护rush的操作,在后面进行更广泛的总结。
vimer@debian-local:~/build_test/rfs/debian-rush$ gbp clone [email protected]:vimerbf-guest/rush.git
gbp:info: Cloning from '[email protected]:vimerbf-guest/rush.git'
其实,如果有新的upstream更新,应该是先gbp pq import,其次才是import upstream release.
https://www.eyrie.org/~eagle/notes/debian/git.html#workflow:
When there's a new upstream release, run:
git fetch upstream
gbp pq import # only if you have patches against upstream
git checkout debian/master
gbp import-orig --uscan --upstream-vcs-tag=<upstream-tag>
# The rest are only if you have patches against upstream
gbp pq rebase
gbp pq export
gbp pq drop
git add debian/patches
git commit
import新的版本:
vimer@debian-local:~/build_test/rfs/debian-rush/rush$ gbp import-orig --uscan --debian-branch=debian/main --upstream-branch=upstream/latest --verbose
gbp:debug: ['git', 'rev-parse', '--show-cdup']
gbp:debug: ['git', 'rev-parse', '--is-bare-repository']
gbp:debug: ['git', 'rev-parse', '--git-dir']
gbp:debug: ['git', 'for-each-ref', '--format=%(refname:short)', 'refs/heads/']
gbp:debug: ['git', 'show-ref', '--verify', 'refs/heads/upstream/latest']
gbp:error:
Repository does not have branch 'upstream/latest' for upstream sources. If there is none see
file:///usr/share/doc/git-buildpackage/manual-html/gbp.import.html#GBP.IMPORT.CONVERT
on howto create it otherwise use --upstream-branch to specify it.
这里失败了,因为没有upstream/latest branch. 对策是新建一个upstream/latest branch即可。
vimer@debian-local:~/build_test/rfs/debian-rush/rush$ git checkout -b upstream/latest
切换到一个新分支 'upstream/latest'
vimer@debian-local:~/build_test/rfs/debian-rush/rush$ git checkout debian/main
切换到分支 'debian/main'
您的分支与上游分支 'origin/debian/main' 一致。
...
vimer@debian-local:~/build_test/rfs/debian-rush/rush$ gbp import-orig --uscan --debian-branch=debian/main --upstream-branch=upstream/latest --verbose
...
gbp:debug: rm ['-rf', '../tmpdk5cwagw'] []
gbp:info: Successfully imported version 2.2 of ../rush_2.2.orig.tar.gz
假设我们有一个新的 upstream release,使用 gbp buildpackage时,如果没有orig的tarball,则不会build的,
build的version是根据top of changelog来确定版本及对应的tarball。
gbp buildpackage --git-upstream-tree=upstream/2.2 --git-upstream-branch=upstream/2.2 --git-builder=sbuild -d unstable --git-debian-branch=debian/main --git-export-dir=../build-area/ --git-ignore-new --verbose
这个只有在我们没有新的orig tarball时确认使用。
还可以使用这个命令编译:
gbp buildpackage --git-builder=sbuild -d unstable --source --git-debian-branch=debian/main --git-export-dir=../rush-build-area/ --git-ignore-new --verbose
Please fix your approach of downloading the orig.tar.gz. This one is not the originally distributed one… You can get the right one with
uscan --download-current-version.
gpg --armor --detach-sign myprogram-0.1.orig.tar.gz
salsa 后面所有的改动转移到这里来。
Please run `origtargz` before to get the orig.tar.gz.
There is something off with the file in the archive.
I guess I took that from your mentors upload.
https://wiki.debian.org/UpdatingaPackagetoNewUpstreamVersion这篇wiki真的不错,解决如何更新upstream的问题。
收藏!
这里肥猫大佬提供了许多材料,对于目前的我暂时还是消化不了,暂且把所有的材料放在这里收藏一下,以防后面需要时找不到。
原始问题:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1011913
Arch的解决方案: https://github.com/felixonmars/archriscv-packages/blob/master/gcc/riscv64.patch#L65
gcc那边的issue: https://github.com/riscv-collab/riscv-gcc/issues/337
惊人的分析文章: https://blog.jiejiss.com/A-RISC-V-gcc-pitfall-revealed-by-a-glibc-update/
这里有很多import的场景:
对于新包来说,需要新建一个repo,创建各个分支,详情可以参考python package notes,这个需要 one by one的去做.
最好使用dsc 这个选项:
gbp import-dsc --upstream-branch=upstream/latest --debian-branch=debian/main --verbose ../libunwind_1.3.2-2.dsc --pristine-tar
gbp import-orig --debian-branch=debian/main --upstream-branch=upstream/latest
使用 gbp 带sbuild去编译debian package的方法如下 :
gbp buildpackage --git-builder=sbuild --git-debian-branch=debian/main --git-upstream-tree=upstream --git-pristine-tar-commit --git-ignore-new --git-export-dir=/tmp/build-area/jimtcl --git-verbose
需要 .sbuildrc的配合:
# -d
$distribution = 'unstable';
# -A
$build_arch_all = 1;
# -s
$build_source = 1;
# --source-only-changes (applicable for dput. irrelevant for dgit push-source).
$source_only_changes = 1;
# -v
$verbose = 1;
# parallel build
$ENV{'DEB_BUILD_OPTIONS'} = 'parallel=5';
##############################################################################
# POST-BUILD RELATED (turn off functionality by setting variables to 0)
##############################################################################
$run_lintian = 1;
$lintian_opts = ['-i', '-I'];
$run_piuparts = 1;
# 暂时停用 piuparts 检查
#$piuparts_opts = ['--schroot', 'unstable-amd64-sbuild', '--no-eatmydata'];
$run_autopkgtest = 1;
$autopkgtest_root_args = '';
$autopkgtest_opts = [ '--', 'schroot', '%r-%a-sbuild' ];
gbp buildpackage --git-builder=sbuild --arch=riscv64 -d sid --source --git-debian-branch=debian/main --git-export-dir=../rush-build-area/ --git-ignore-new --verbose
不用顾虑上游源代码。
这种情况是,直接clone salsa后,里面只有一个debian/目录。例如 neochat, 当clone下来之后,如果按照上面的命令进行编译,会遇到上面的issue:
gbp:error: upstream/22.06 is not a valid treeish
解决方案就是使用本地的upstream tarball代替upstream分支。
uscan --force-download
gpgv: Signature made Fri Jun 24 14:41:11 2022 UTC
gpgv: using RSA key B3CB366552540BE06EE9AD9711968C44928CAEFC
gpgv: Good signature from "Bhushan Shah (mykolab address) <[email protected]>"
gpgv: aka "Bhushan Shah <[email protected]>"
gpgv: aka "Bhushan Shah (kde) <[email protected]>"
Successfully symlinked ../neochat-22.06.tar.xz to ../neochat_22.06.orig.tar.xz.
# 直接使用下载好tarball
gbp buildpackage --git-tarball-dir=../ --git-builder=sbuild -d unstable --git-debian-branch=debian/main --git-export-dir=../build-area/ --git-ignore-new --verbose
gbp import-orig --uscan --debian-branch=debian/main --upstream-branch=upstream/latest
gbp import-orig --verbose --upstream-branch=upstream/latest --upstream-version=2.2 ../v2.3.2.tar.gz