help needed to build a package from source

If none of the more specific forums is the right place to ask

help needed to build a package from source

Postby MagicPoulp » 2018-12-17 11:29

Please help me to understand how to build a package from source.

I tried to follow this tutorial given by Head_on_a_Stick on this forum.
viewtopic.php?f=16&t=38976
viewtopic.php?f=16&t=130057

On debian stable, I tried to build from source the package ruby from debian unstable.

The command devchange that is contained in the package devscripts is not installed. There is a debian stable backport for it.

When just running the basic commands, it will miss a dependency.

Code: Select all
> apt-get source ruby -t unstable
etc
> dpkg-buildpackage -rfakeroot -us -uc
dpkg-checkbuilddeps: error: Unmet build dependencies: debhelper (>= 9)

I tried to use build-dep, but it did not work.
> sudo apt-get build-dep debhelper
Reading package lists... Done
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 builddeps:debhelper : Depends: po4a but it is not installable
E: Unable to correct problems, you have held broken packages.

> sudo apt-get build-dep debhelper po4a
Reading package lists... Done
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 builddeps:debhelper : Depends: po4a but it is not installable
 builddeps:po4a : Depends: debhelper (>= 11) but it is not installable
                  Depends: docbook but it is not installable
                  Depends: docbook-xsl but it is not installable
                  Depends: gettext
                  Depends: libmodule-build-perl but it is not installable
                  Depends: libsgmls-perl but it is not installable
                  Depends: libterm-readkey-perl but it is not installable
                  Depends: libunicode-linebreak-perl but it is not installable
                  Depends: libyaml-tiny-perl but it is not installable
                  Depends: opensp but it is not installable
                  Depends: texlive-binaries
                  Depends: texlive-latex-base but it is not installable
                  Depends: xsltproc
E: Unable to correct problems, you have held broken packages.



--> Should I make a long line with all packages on the command build-dep?

--> Does build-dep actually install on the system the pacakges required to build a source package? Or is it just in a buffer for helping building source packages?
MagicPoulp
 
Posts: 197
Joined: 2018-11-05 21:30

Re: help needed to build a package from source

Postby milomak » 2018-12-17 13:11

have you addressed this part of the error message
Code: Select all
E: Unable to correct problems, you have held broken packages.
Desktop: iMac Late-2015 27" 5K Retina (17,1 - 3.3GHz) - MacOS and Windows 10 (Bootcamp)/ Debian Sid (External SSD)
Laptop: Lenovo ideapad Y700 [nVidia Optimus] (64-bit) - Debian Sid, Win10,
Kodi Box: AMD Athlon 5150 APU w/Radeon HD 8400 - Debian Sid
milomak
 
Posts: 1973
Joined: 2009-06-09 22:20

Re: help needed to build a package from source

Postby MagicPoulp » 2018-12-17 13:43

milomak wrote:have you addressed this part of the error message
Code: Select all
E: Unable to correct problems, you have held broken packages.


It seems to me the error means that the package po4a has many dependencies that are only in unstable and not in stable.

po4a is only in unstable and not in stable. it seems to me that the build-dep command should build a stable version of it.

Maybe I misunderstood the change to sources.list. With the configuration I have for apt, I can only reach the unstable repo using the pinning tag -t unstable. Maybe I should add -t unstable to the build-dep command.
MagicPoulp
 
Posts: 197
Joined: 2018-11-05 21:30

Re: help needed to build a package from source

Postby xepan » 2018-12-17 15:09

Not sure, but it seems to work here:
Code: Select all
user_CHROOT$ pwd
/home/user/Build/ruby-defaults-2.5.1
user_CHROOT$ ls ../*deb
../libruby_2.5.1_all.deb  ../ruby_2.5.1_i386.deb          ../ruby-dev_2.5.1_i386.deb
../ri_2.5.1_all.deb       ../ruby-all-dev_2.5.1_i386.deb  ../ruby-full_2.5.1_all.deb
user_CHROOT$
]

All i did was
Code: Select all
apt-get install devscripts build-essential.

Add:
Code: Select all
 deb-src http://deb.debian.org/debian sid main

to sources.list and apt-get update
I ran
Code: Select all
apt-get build-dep ruby

but it installed nothing, so was superfluous.


Code: Select all
apt-get source ruby
cd ruby-defaults-2.5.1
dpkg-buildpackage -us -uc

Not sure if you understood that already, but you do:
apt-get build-dep <package-you-want-to-compile>
Maybe i misunderstood something.
xepan
 
Posts: 89
Joined: 2018-11-28 06:38

Re: help needed to build a package from source

Postby MagicPoulp » 2018-12-17 15:39

What does build-dep do?

Does it modify the existing system? It should not for a local build change the system. It is strange that when I try it it says it will upgrade cmake.
I have restricted the preferences of apt so that it cannot fetch from unstable without the tag -t unstable.

When I say I am blocked, it is because I get long lists of packages to install from unstable. And it could corrupt my system.

Code: Select all
> sudo apt-get build-dep ruby
Reading package lists... Done
Picking 'ruby-defaults' as source package instead of 'ruby'
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 builddeps:ruby-defaults : Depends: debhelper (>= 9) but it is not installable
E: Unable to correct problems, you have held broken packages.
>:~/tmp/ruby-defaults-2.5.1$ sudo apt-get build-dep ruby -t unstable
Reading package lists... Done
Picking 'ruby-defaults' as source package instead of 'ruby'
Selected version '1:2.5.1' (unstable) for ruby-defaults
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED:
  libcurl3
The following NEW packages will be installed:
  autopoint debhelper dh-autoreconf dh-strip-nondeterminism dwz gettext intltool-debian libarchive-zip-perl libcom-err2 libcurl4 libfile-stripnondeterminism-perl libncurses6
  librhash0 libunistring2 po-debconf
The following packages will be upgraded:
  cmake cmake-data curl libc-bin libc-dev-bin libc-l10n libc6 libc6:i386 libc6-dev libc6-dev-i386 libc6-dev-x32 libc6-i386 libc6-x32 libcomerr2 libncursesw6 libssl-dev libssl1.1
  libtinfo6 libuv1 locales
20 upgraded, 15 newly installed, 1 to remove and 1455 not upgraded.
Need to get 37.9 MB of archives.
After this operation, 22.3 MB of additional disk space will be used.
Do you want to continue? [Y/n]
MagicPoulp
 
Posts: 197
Joined: 2018-11-05 21:30

Re: help needed to build a package from source

Postby xepan » 2018-12-17 15:44

apt-get build-dep pkg
will install the packages mentioned in debian/control file as Build-Depends: . (the Depends: too? not sure. probably).

Looks like you screwed your sources list. Post it (or them).
xepan
 
Posts: 89
Joined: 2018-11-28 06:38

Re: help needed to build a package from source

Postby milomak » 2018-12-17 17:19

MagicPoulp wrote:
milomak wrote:have you addressed this part of the error message
Code: Select all
E: Unable to correct problems, you have held broken packages.


It seems to me the error means that the package po4a has many dependencies that are only in unstable and not in stable.

po4a is only in unstable and not in stable. it seems to me that the build-dep command should build a stable version of it.

Maybe I misunderstood the change to sources.list. With the configuration I have for apt, I can only reach the unstable repo using the pinning tag -t unstable. Maybe I should add -t unstable to the build-dep command.

it most definitely is in stable

Code: Select all
$ apt-cache policy po4a
po4a:
  Installed: (none)
  Candidate: 0.55-1
  Version table:
     0.55-1 500
        500 http://debian.mirror.ac.za/debian testing/main amd64 Packages
        500 http://debian.mirror.ac.za/debian testing/main i386 Packages
        500 http://debian.mirror.ac.za/debian sid/main amd64 Packages
        500 http://debian.mirror.ac.za/debian sid/main i386 Packages
        500 http://ftp.is.co.za/debian testing/main amd64 Packages
        500 http://ftp.is.co.za/debian testing/main i386 Packages
        500 http://ftp.is.co.za/debian sid/main amd64 Packages
        500 http://ftp.is.co.za/debian sid/main i386 Packages
        500 http://debian.saix.net testing/main amd64 Packages
        500 http://debian.saix.net testing/main i386 Packages
        500 http://debian.saix.net sid/main amd64 Packages
        500 http://debian.saix.net sid/main i386 Packages
        500 http://deb-mir1.naitways.net/debian testing/main amd64 Packages
        500 http://deb-mir1.naitways.net/debian testing/main i386 Packages
        500 http://deb-mir1.naitways.net/debian sid/main amd64 Packages
        500 http://deb-mir1.naitways.net/debian sid/main i386 Packages
     0.47-2 500
        500 http://debian.mirror.ac.za/debian stable/main amd64 Packages
        500 http://debian.mirror.ac.za/debian stable/main i386 Packages
        500 http://ftp.is.co.za/debian stable/main amd64 Packages
        500 http://ftp.is.co.za/debian stable/main i386 Packages
        500 http://debian.saix.net stable/main amd64 Packages
        500 http://debian.saix.net stable/main i386 Packages
        500 http://deb-mir1.naitways.net/debian stable/main amd64 Packages
        500 http://deb-mir1.naitways.net/debian stable/main i386 Packages
Desktop: iMac Late-2015 27" 5K Retina (17,1 - 3.3GHz) - MacOS and Windows 10 (Bootcamp)/ Debian Sid (External SSD)
Laptop: Lenovo ideapad Y700 [nVidia Optimus] (64-bit) - Debian Sid, Win10,
Kodi Box: AMD Athlon 5150 APU w/Radeon HD 8400 - Debian Sid
milomak
 
Posts: 1973
Joined: 2009-06-09 22:20

Re: help needed to build a package from source

Postby stevepusser » 2018-12-17 18:49

Debhelper 10 is also standard in Stretch, so you either started out with a broken system, or broke it in the attempt to get a newer ruby. Your software sources.list is probably quite interesting.
The MX Linux repositories: Backports galore! If we don't have something, just ask and we'll try--we like challenges. New packages: Foliate 1.5.3, Minitube 3.1, wine-staging 4.12, Virtual Box 5.2.32 & 6.0.10, Pale Moon 28.6.1, Waterfox 56.2.12
User avatar
stevepusser
 
Posts: 11022
Joined: 2009-10-06 05:53

Re: help needed to build a package from source

Postby MagicPoulp » 2018-12-18 09:33

OK thank you for the comments. Yes my system is corrupted since debhelper should be available.

The reason was because of my preferences file with a bad priority on the release branch. Now it works.
MagicPoulp
 
Posts: 197
Joined: 2018-11-05 21:30

Re: help needed to build a package from source

Postby MagicPoulp » 2018-12-18 10:04

Please explain. Does the command below really require to install several packages on the system to build a source? Can't it be neutral and not impact the system with no installation?

Code: Select all
sudo apt-get build-dep ruby
Reading package lists... Done
Picking 'ruby-defaults' as source package instead of 'ruby'
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  autopoint debhelper dh-autoreconf dh-strip-nondeterminism gettext intltool-debian libarchive-zip-perl libfile-stripnondeterminism-perl po-debconf
0 upgraded, 9 newly installed, 0 to remove and 236 not upgraded.
Need to get 3,302 kB of archives.
After this operation, 10.2 MB of additional disk space will be used.
MagicPoulp
 
Posts: 197
Joined: 2018-11-05 21:30

Re: help needed to build a package from source

Postby xepan » 2018-12-18 10:10

I for one will probably not be able to help with such a confusing situation, but for others being able to help you later, you may provide the following info
The output of the command:
Code: Select all
apt-cache policy


That will probably cover the following already. If so, just omit:
whatever repos you have in /etc/apt/sources.list.d # looks as if there was no sid or such, apt-get update would have listed them. Just post them anyway,
content of /etc/apt/conf /etc/apt/conf.d and /etc/apt/preferences and preferences.d #whatever you find in /etc/apt sounding like "conf" or "preferences"

Well possible more info would be helpful, but the above is what i can think of for now.

Please explain. Does the command below really require to install several packages on the system to build a source? Can't it be neutral and not impact the system with no installation?

yes and
probably neutral, but quite a few prefer to "build" packages in a chroot anyway (or with pbuilder, etc). quick search gives renv/ruby-build
chroot might be a solution for you to work around the restrictions you got (i doubt it, but you might want to think about it).

is it only about building ruby? If so there might well be a solution similar to perlbrew for perl (install versions of perl in the users home).
xepan
 
Posts: 89
Joined: 2018-11-28 06:38

Re: help needed to build a package from source

Postby MagicPoulp » 2018-12-18 11:44

It is fine now. I could build ruby from source. I did not know about chroot and pbuilder. Thanks for the information.

Code: Select all
find .
.
./debian
./debian/ruby-dev.substvars
./debian/ruby
./debian/ruby/usr
./debian/ruby/usr/bin
./debian/ruby/usr/bin/ruby
./debian/ruby/usr/bin/rdoc
./debian/ruby/usr/bin/ri
./debian/ruby/usr/bin/irb
./debian/ruby/usr/bin/gem
./debian/ruby/usr/bin/erb
./debian/ruby/usr/share
./debian/ruby/usr/share/man
./debian/ruby/usr/share/man/man1
./debian/ruby/usr/share/man/man1/rdoc.1.gz
./debian/ruby/usr/share/man/man1/erb.1.gz
./debian/ruby/usr/share/man/man1/gem.1.gz
./debian/ruby/usr/share/man/man1/irb.1.gz
./debian/ruby/usr/share/man/man1/ruby.1.gz
./debian/ruby/usr/share/man/man1/ri.1.gz
./debian/ruby/usr/share/doc
./debian/ruby/usr/share/doc/ruby
./debian/ruby/usr/share/doc/ruby/README.Debian
./debian/ruby/usr/share/doc/ruby/NEWS.Debian.gz
./debian/ruby/usr/share/doc/ruby/copyright
./debian/ruby/usr/share/doc/ruby/changelog.gz
./debian/ruby/DEBIAN
./debian/ruby/DEBIAN/md5sums
./debian/ruby/DEBIAN/postinst
./debian/ruby/DEBIAN/preinst
./debian/ruby/DEBIAN/control
./debian/ruby-full
./debian/ruby-full/usr
./debian/ruby-full/usr/share
./debian/ruby-full/usr/share/doc
./debian/ruby-full/usr/share/doc/ruby-full
./debian/ruby-full/usr/share/doc/ruby-full/NEWS.Debian.gz
./debian/ruby-full/usr/share/doc/ruby-full/copyright
./debian/ruby-full/usr/share/doc/ruby-full/changelog.gz
./debian/ruby-full/DEBIAN
./debian/ruby-full/DEBIAN/md5sums
./debian/ruby-full/DEBIAN/control
./debian/ruby-all-dev.debhelper.log
./debian/ruby.substvars
./debian/ruby-full.debhelper.log
./debian/debhelper-build-stamp
./debian/files
./debian/rules
./debian/ri.debhelper.log
./debian/ruby.debhelper.log
./debian/README.Debian
./debian/ri.substvars
./debian/ruby-full.substvars
./debian/dump_data.rb
./debian/ruby-all-dev-depends
./debian/ruby.postinst
./debian/ruby-all-dev.substvars
./debian/libruby.debhelper.log
./debian/newruby
./debian/ruby.postinst.in
./debian/ri
./debian/ri/usr
./debian/ri/usr/share
./debian/ri/usr/share/doc
./debian/ri/usr/share/doc/ri
./debian/ri/usr/share/doc/ri/NEWS.Debian.gz
./debian/ri/usr/share/doc/ri/copyright
./debian/ri/usr/share/doc/ri/changelog.gz
./debian/ri/DEBIAN
./debian/ri/DEBIAN/md5sums
./debian/ri/DEBIAN/control
./debian/ruby-all-dev.install
./debian/NEWS
./debian/version-check
./debian/source
./debian/source/format
./debian/tests
./debian/tests/smoke-test
./debian/tests/wheezy2jessie.control
./debian/tests/wheezy2jessie-ruby-version
./debian/tests/wheezy2jessie-apt-listbugs-ruby1.8
./debian/tests/control
./debian/tests/ruby-all-dev
./debian/libruby
./debian/libruby/usr
./debian/libruby/usr/share
./debian/libruby/usr/share/doc
./debian/libruby/usr/share/doc/libruby
./debian/libruby/usr/share/doc/libruby/NEWS.Debian.gz
./debian/libruby/usr/share/doc/libruby/copyright
./debian/libruby/usr/share/doc/libruby/changelog.gz
./debian/libruby/DEBIAN
./debian/libruby/DEBIAN/md5sums
./debian/libruby/DEBIAN/control
./debian/control
./debian/ruby-all-dev
./debian/ruby-all-dev/usr
./debian/ruby-all-dev/usr/lib
./debian/ruby-all-dev/usr/lib/ruby
./debian/ruby-all-dev/usr/lib/ruby/vendor_ruby
./debian/ruby-all-dev/usr/lib/ruby/vendor_ruby/ruby_debian_dev.rb
./debian/ruby-all-dev/usr/share
./debian/ruby-all-dev/usr/share/doc
./debian/ruby-all-dev/usr/share/doc/ruby-all-dev
./debian/ruby-all-dev/usr/share/doc/ruby-all-dev/NEWS.Debian.gz
./debian/ruby-all-dev/usr/share/doc/ruby-all-dev/copyright
./debian/ruby-all-dev/usr/share/doc/ruby-all-dev/changelog.gz
./debian/ruby-all-dev/DEBIAN
./debian/ruby-all-dev/DEBIAN/md5sums
./debian/ruby-all-dev/DEBIAN/control
./debian/ruby-dev
./debian/ruby-dev/usr
./debian/ruby-dev/usr/lib
./debian/ruby-dev/usr/lib/x86_64-linux-gnu
./debian/ruby-dev/usr/lib/x86_64-linux-gnu/pkgconfig
./debian/ruby-dev/usr/lib/x86_64-linux-gnu/pkgconfig/ruby.pc
./debian/ruby-dev/usr/share
./debian/ruby-dev/usr/share/doc
./debian/ruby-dev/usr/share/doc/ruby-dev
./debian/ruby-dev/usr/share/doc/ruby-dev/NEWS.Debian.gz
./debian/ruby-dev/usr/share/doc/ruby-dev/copyright
./debian/ruby-dev/usr/share/doc/ruby-dev/changelog.gz
./debian/ruby-dev/DEBIAN
./debian/ruby-dev/DEBIAN/md5sums
./debian/ruby-dev/DEBIAN/control
./debian/ruby.links
./debian/libruby.substvars
./debian/copyright
./debian/ruby.preinst
./debian/changelog
./debian/ruby-dev.debhelper.log
./debian/compat
./ruby_debian_dev.rb
MagicPoulp
 
Posts: 197
Joined: 2018-11-05 21:30

Re: help needed to build a package from source

Postby MagicPoulp » 2018-12-18 11:47

Does chroot allow to install programs in a sandbox way?

Can one install docker in a chroot?

The documentation says it fakes the root folder. But will the program be runnable?
https://wiki.debian.org/chroot
MagicPoulp
 
Posts: 197
Joined: 2018-11-05 21:30

Re: help needed to build a package from source

Postby MagicPoulp » 2018-12-18 13:26

And what does the extension "~bpo50+1" mean in the first tutorial link I gave? Why a so strange notation?
viewtopic.php?f=16&t=38976

bp = backport I guess.
MagicPoulp
 
Posts: 197
Joined: 2018-11-05 21:30

Re: help needed to build a package from source

Postby MagicPoulp » 2018-12-18 14:06

For gcc 8, the package version looks like this:

4:8.1.0-1

Why a prefix "4:" and a sufix with a dash "-1" ?

This prefix can cause confusion because the version of gcc is not 4. It is 8.

Code: Select all
dpkg -s gcc
Package: gcc
Status: install ok installed
Priority: optional
Section: devel
Installed-Size: 45
Maintainer: Debian GCC Maintainers <debian-gcc@lists.debian.org>
Architecture: amd64
Source: gcc-defaults (1.178)
Version: 4:8.1.0-1
MagicPoulp
 
Posts: 197
Joined: 2018-11-05 21:30

Next

Return to General Questions

Who is online

Users browsing this forum: No registered users and 7 guests

fashionable