maboloshi / Recordum

沙漠之子's 微博客
https://maboloshi.github.io/Recordum
2 stars 0 forks source link

临时 #11

Open maboloshi opened 4 years ago

maboloshi commented 4 years ago

miktex 打包测试(人工)

构建 builder 环境

docker docker build -t maboloshi/miktex-builder:latest -f Dockerfile_builder

注意:国内网络环境构建建议参考#国内镜像源设置 设置国内镜像源

编译和打包测试

docker run --name builder -it \
    -v "$PWD:/home/builder/" \
    -v "$PWD/packages:/home/builder/packages"
    --entrypoint /bin/ash \
    maboloshi/miktex-builder:latest

如果在docker for windows下构建,请将上述$PWD等主机路径改成windows格式的绝对路径 You can also run the builder anywhere. You just need to mount your package source and build directories to /home/builder/package and /packages, respectively.

进入docker环境后

mkdir work
cp APKBUILD work/
cd work

#进行分步骤测试
#APKBUILD文件语法检查
abuild sanitycheck
#校验
abuild verify
#创建校验(如果不存在)
abuild checksum
#分析和安装依赖
abuild deps
#获取源代码
abuild fetch
#编译前准备
abuild prepare
#编译
abuild build
#check
abuild check
#打包
abuild rootpkg

直到调试到不报错基本就OK了 最后可以直接使用abuild -r进行完整测试 APK默认输出路径:/home/build/packages/builder/x86_64/miktex-2.9.7300-r1.apk

国内镜像源设置

Apline 镜像源设置

编辑Dockerfile添加sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories \

miktex 镜像源设置:

编辑APKBUILD文件在-DWITH_MAN_PAGES=FALSE \下添加: -DMIKTEX_DEFAULT_REPOSITORY=https://mirrors.tuna.tsinghua.edu.cn/CTAN/systems/win32/miktex/tm/packages/ \

maboloshi commented 4 years ago

/home/build/packages/builder/x86_64/`miktex-2.9.7300-r1.apk /home/builder/packages/home/x86_64/miktex-2.9.7300-r1.apk

maboloshi commented 4 years ago

docker build --target builder -t maboloshi/miktex-builder:builder . /home/builder/packages/home/x86_64/miktex-2.9.7300-r1.apk docker run -it \ --entrypoint /bin/ash \ maboloshi/miktex-builder:builder

maboloshi commented 4 years ago

docker build -t maboloshi/miktex-builder:latest -f Dockerfile . docker run --name builder1 -it \ -v "E:\【A_工程目录】\miktex-builder:/home/builder/work" \ --entrypoint /bin/ash \ maboloshi/miktex-builder:latest

maboloshi commented 4 years ago

默认包生成路径

mkdir -p "$REPODEST"/$repo/${subpkgarch/noarch/$CARCH}
cat control.tar.gz data.tar.gz > "$REPODEST"/$repo/${subpkgarch/noarch/$CARCH}/$apk

https://git.alpinelinux.org/abuild/tree/abuild.in#n1637

默认$REPODEST ~/packages $repo实际表示APKBUILD所在的当前目录