从源码编译软件实战 参照学习贴https://bbs.deepin.org/post/283392
学习平台:OpenEuler的WSL子系统
1 2 3 sudo dnf install gcc g++ make
源码文档中的README.md
文档会有一些说明,建议提前看哈
1 2 3 4 5 6 7 sudo su dnf install wget wget https://github.com/htop-dev/htop/archive/refs/tags/3.2.2.tar.gz
下载地址是:https://github.com/htop-dev/htop/releases
下面所有的操作都是在/home/brian/htop-3.2.2/的目录下操作
错误1:./autogen.sh: line 2: autoreconf: command not found
如果遇到这个错误,请安装autoreconf
错误2:Can't exec "aclocal": No such file or directory at /usr/share/autoconf/Autom4te/FileUtils.pm line 274. autoreconf: error: aclocal failed with exit status: 2
如果遇到这个错误,请安装automake
再次执行./autogen.sh
就能成功了
1 2 3 ./configure --prefix=/usr/local
错误3:configure: error: can not find required library libncursesw; you may want to use --disable-unicode
如果遇到这个错误,请安装ncurses-devel
1 dnf install ncurses-devel
再次执行./configure --prefix=/usr/local
就能成功了
从源码打包deb包(没成功) 测试环境:Ubuntu 22.04 LTS 虚拟机 很多的步骤跟上面的差不多
1 2 3 4 sudo su sudo apt update sudo apt install build-essential checkinstall devscripts dh-make fakeroot
下载并解压htop
1 2 3 wget https://github.com/htop-dev/htop/archive/refs/tags/3.2.2.tar.gz tar -xvzf 3.2.2.tar.gz cd htop-3.2.2
执行脚本
执行环境配置
报错1:configure: error: can not find required library libncursesw; you may want to use --disable-unicode
安装libncursesw5-dev可以解决
1 apt install libncursesw5-dev
再次执行./configure
就能成功了 开始打包
选择y
用默认方法创建包
写一段包的描述,这里我不知道怎样完成退出,用Ctrl + C 退出了,需要再次运行sudo checkinstall
继续打包
这1-15的配置都是默认,回车 就下一步
这两个问题我应该把它们排除在包外么?
不知道怎样选,感觉都选错了,才导致后面包无法用。
包是生成了htop_3.2.2-1_amd64.deb
安装了也无法运行,坑就踩到这里,后续研究出来再更新本文。