How to add 'deb-src' repo to '/etc/apt/sources.list' ? buildd

Asked by SOURAV DAS

Hii, I am trying to build roc-toolkit https://github.com/roc-streaming/roc-toolkit/ with pulseaudio support. But the problem is roc-toolkit need the pulseaudio source code to be build. This is why it itself has ability to download the source of pulseaudio. But the problem is as the Launchpad has no external internet aceess(?) It can't be downloaded. but the thing is I also can bundle pulseaudio with roc-toolkit source, but this will make everything a high main-tenant. I don't like that. Everytime if pulseaudio bumps its version, I've to make it available for roc-toolkit? And this make me to track pulseaudio also.

This is the PPA, Where I did all the tests : https://launchpad.net/~pipewire-debian/+archive/ubuntu/bionic-qt5125

The solution : How would be If I can include 'deb-src' repo into '/etc/apt/sources.list' of buildd chrooted launchpad build environment and download the source with 'apt source pulseaudio' ?

The problem of the above solution : But how to add those 'deb-src' repo ? as I can't do with in 'debian/rules'
```bash
sed 's/deb/deb-src/g' /etc/apt/sources.list | su -c "tee -a /etc/apt/sources.list" || echo -e "\n\n"
Password: su: Authentication failure
```
or
```bash
sed 's/deb/deb-src/g' /etc/apt/sources.list | sudo tee -a /etc/apt/sources.list || echo -e "\n\n"
/bin/sh: 1: sudo: not found
```
As it need root access, So 'sudo' command not found or `root` password is unknown to me.

If I go to change without su or sudo, There is a permission denied error comes naturally as /etc/* files are belongs to root user.

The question : How to add 'deb-src' repo to '/etc/apt/sources.list' in Launchpad build environment and update with `apt-get update` ?

Here is build logs link :
[1] : https://launchpadlibrarian.net/546634026/buildlog_ubuntu-focal-amd64.roc-toolkit-pulse_0.1.5.r41.gc896873-7~ubuntu20.04_BUILDING.txt.gz
[2] : https://launchpadlibrarian.net/546638179/buildlog_ubuntu-focal-amd64.roc-toolkit-pulse_0.1.5.r41.gc896873-8~ubuntu20.04_BUILDING.txt.gz

Question information

Language:
English Edit question
Status:
Solved
For:
Launchpad itself Edit question
Assignee:
No assignee Edit question
Solved by:
Colin Watson
Solved:
Last query:
Last reply:
Revision history for this message
Colin Watson (cjwatson) said :
#1

IMO this is a support question rather than a bug report, so moving it over there.

Revision history for this message
Best Colin Watson (cjwatson) said :
#2

You can't do exactly what you're asking for. However, you can achieve the same goal by configuring apt to use different file locations so that you can run it as non-root, which will work here because "apt source" doesn't need root access. Off the top of my head I don't have a precise recipe for this, but perhaps you might find https://salsa.debian.org/installer-team/debian-installer/-/blob/master/build/util/get-packages to be useful inspiration: all the stuff about udebs there is irrelevant to you, but it illustrates the basic approach of configuring apt appropriately.

Revision history for this message
SOURAV DAS (pipewire-debian) said :
#3

sorry for this @Colin I discussed with the devs and dropped the package maintaing for this tool because of too much complexity and they will find some easy way to build these modules for pulseaudio, may be pulseaudio natively build these modules at their end. For now the issue is solved.

Revision history for this message
SOURAV DAS (pipewire-debian) said :
#4

Thanks Colin Watson, that solved my question.