Hello, I’m a bit new to advanced linux and programming stuffs… Can someone explain me why compiling exists and what this process does and how to do it in the principals situations (I’ve heard that you can use the “makepkg” command). Thx to everyone who replied.

  • Trent@lemmy.ml
    link
    fedilink
    arrow-up
    0
    ·
    5 months ago

    Compiling code converts it from human readable source code into optimized machine code which the processor understands how to execute. For a lot of software you can just unpack the source code, run ./configure, run ‘make’, and then ‘make install’. This can vary a lot and is a simplified explanation, but it’s a start…

  • lemmyreader@lemmy.ml
    link
    fedilink
    English
    arrow-up
    0
    ·
    5 months ago

    Some software is brand new and not yet packaged as software packages. And for already existing software Linux distributions will have to make choices as not everything can be included and maintained. Now if a developer creates new software, and things are not packaged yet (With Debian for Debian stable this can take a really long time) it can be comfortable for the developer to provide just instructions about how to compile the software so users can run the software, while the maintainer does not have to bother about packaging.

    • foremanguy@lemmy.mlOP
      link
      fedilink
      arrow-up
      0
      ·
      5 months ago

      So it’s a bit like taking all the useful packages and mix it up in a clean package? And are .deb .rpm… packages made like that?

      • lemmyreader@lemmy.ml
        link
        fedilink
        English
        arrow-up
        0
        ·
        5 months ago

        Yes, indeed. If you would want to you can re-compile Debian deb packages from Debian sources. To give you an idea : https://wiki.debian.org/apt-src There’s also Gentoo Linux which has a history of compiling software. Years ago that was interesting because of flags for compiling, make the resulting software optimized for certain CPU models.

  • LalSalaamComrade@lemmy.ml
    link
    fedilink
    English
    arrow-up
    0
    ·
    edit-2
    5 months ago

    Compiling is when you convert your human-readable programming language to binary machine code.

    makepkg is an Arch-exclusive command that ensures that your apps are built properly in any other Arch-based devices. Usually, all packages are compiled on a powerful machine in some server, and you just have to download the binaries.

    But in some cases, they don’t compile apps, or, their process may have delayed, so you can manually compile those apps on your device - that is called building from the source. From what I know, you can’t run makepkg on other Linuces (can we? I’ve never used Arch in depth).

    About .deb and .rpm, those are a type of packaging format - in reality, they’re just archives. Think of them as .exe and .msi equivalents. It contains the pre-built app, as well as the repository link, which makes it convenient if you want to upgrade that app in the future.

    • foremanguy@lemmy.mlOP
      link
      fedilink
      arrow-up
      0
      ·
      5 months ago

      humm… ok, and for example when you have the binaries of a file you have to compile it a last time, no? That’s my experience with aur, when you get the bin, you have to makepkg a other time

      • lemmyreader@lemmy.ml
        link
        fedilink
        English
        arrow-up
        0
        ·
        5 months ago

        The Arch Linux makepkg is a bash script with description

        make packages compatible for use with pacman

        Some packages of AUR are not about compiling but fetching the binary (sometimes converting it from deb) and then prepare it for you so you can install it. So when you use AUR to install a binary package instead of compiling there is really no compiling involved afair.