从源码编译软件和打包软件
从源码编译软件实战
参照学习贴https://bbs.deepin.org/post/283392
学习平台:OpenEuler的WSL子系统
1 | # 安装需要的依赖 |
源码文档中的README.md文档会有一些说明,建议提前看哈
1 | # 切换到root用户 |

下载地址是:https://github.com/htop-dev/htop/releases
1 | # 下载下来的文件解压出来 |

1 | # cd进去看看都有啥 |

下面所有的操作都是在/home/brian/htop-3.2.2/的目录下操作
1 | # 执行这个脚本 |
错误1:./autogen.sh: line 2: autoreconf: command not found
如果遇到这个错误,请安装autoreconf
1 | dnf install autoconf |

错误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
1 | dnf install automake |

再次执行./autogen.sh就能成功了
1 | # 做环境配置,安装在/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就能成功了
1 | # 编译 |

1 | # 编译 |

1 | # 看看版本是否安装成功 |

1 | # 执行命令看看是否成功 |

从源码打包deb包(没成功)
测试环境:Ubuntu 22.04 LTS 虚拟机
很多的步骤跟上面的差不多
1 | sudo su #切换到root用户 |

下载并解压htop
1 | wget https://github.com/htop-dev/htop/archive/refs/tags/3.2.2.tar.gz |

执行脚本
1 | ./autogen.sh |

执行环境配置
1 | ./configure |
报错1:configure: error: can not find required library libncursesw; you may want to use --disable-unicode
安装libncursesw5-dev可以解决
1 | apt install libncursesw5-dev |

再次执行./configure就能成功了
开始打包
1 | sudo checkinstall |
- 选择
y用默认方法创建包 - 写一段包的描述,这里我不知道怎样完成退出,用Ctrl + C退出了,需要再次运行
sudo checkinstall继续打包
- 这1-15的配置都是默认,回车就下一步

- 这两个问题
我应该把它们排除在包外么?不知道怎样选,感觉都选错了,才导致后面包无法用。
- 包是生成了
htop_3.2.2-1_amd64.deb
- 安装了也无法运行,坑就踩到这里,后续研究出来再更新本文。
