r/debian • • 2d ago

How to maintain 3rd apps from github on a debian ?

/r/linuxquestions/comments/1x1gp4h/how_to_maintain_3rd_apps_from_github_on_a_debian/
6 Upvotes

17 comments sorted by

3

u/redfacedquark 2d ago

In an ideal world, this is where you would be mentored to become a debian package maintainer so the benefits can be shared with everyone, however that process is likely more commitment than you're looking for.

You could try asking the author nicely to support deb builds, or you could try asking an existing debian developer nicely who works on other projects in the same domain/language to support the project. There is obviously an ongoing burden to maintaining a package though, especially in terms of reviewing updates with respect to security, stability, compatibility etc.

You could use the debian packaging tools to create a deb yourself for private use. This doesn't solve the problem of you doing work when there's an update, though it can be an enlightening experience if you're into that sort of thing.

Which packages specifically are you looking at? Are you sure the apps or similar ones are not already in the repo? I ask because the exact debian package name might be different from the upstream project name for a number of reasons.

Having said that, adding a quick script that does a git pull and runs the build commands for the project and sticking that in a cron job is a solution. A terrible solution for sure, but one nonetheless.

Finally, if there's a package from another distribution, like an rpm, there's tools to convert between them, though that's also far from ideal.

1

u/Specialist-Dog-501 2d ago

Hm..I found WINE as example in the EXTREPO, I can pull it from there. But GRUB-BTRFS doesn't exist for debian, I would need to compile it myself, and then again with every update I assume. FERDIUM I somehow could install via DEB-GET, but I still don't fully understand what DEB-GET really does- seems to be a mere wrapper for APT, not really an isolated package manager, that would be perfect. HOMEBREW seems to be that, but I wasn't able to add my external github apps to it, not sure why.
Linux is really strong with all this "Container" derivates..there should be one, that I can isolate a bunch of apps together, sharing their dependencies in that container, but not restricting access to all and everything like in a VM (what makes it heavy) and get a hook for update checks.

1

u/wizard10000 2d ago

GRUB-BTRFS doesn't exist for debian

It does exist in Kali repos - but don't map the repo, just download and install the deb. That's what I did -

https://http.kali.org/kali/pool/main/g/grub-btrfs/

1

u/Specialist-Dog-501 1d ago

Ou cool! Because I already tried to "make install" grub-btrfs locally and this somehow fails..I try to get the deb file from Kali then, this is a great idea! I didn't know, Kali is based on debian..
But again, it's one more isolated .deb file that I "forget" about at some point and then don't keep it updated..I need a list of them somewhere..may be deb-get is good for that ?

0

u/redfacedquark 2d ago

WINE

As in the windows emulator? Have you considered running windows in a VM?

GRUB-BTRFS doesn't exist for debian

That sounds like an absoulte nightmare to maintain seperately in a reliable way, probably why it's not been done. What are you trying to acheive? If you want btrfs on / that's one thing, I can't see a reason for caring what filesystem type /boot is on though.

I would need to compile it myself, and then again with every update

Perhaps gentoo is the distro for you then?

HOMEBREW seems to be that

Is homebrew not mac-specific? Never had the urge to touch an apple product. Complete antithesis to debian philosophy.

Linux is really strong with all this "Container" derivates..there should be one

Linux is being made more unreliable and distros are being undermined by things like flatpak and so forth in my opinion. Sure, there's debs vs rpms but they are part of what binds a distro together. The idea that another packaging system was going to sit on top and play nicely with the underlying OS differences was never going to work. It feels very much like a hostile move to damage or seize control from distros.

isolate a bunch of apps together, sharing their dependencies in that container, but not restricting access to all and everything like in a VM (what makes it heavy) and get a hook for update checks.

Sounds like you want a chroot maybe?

1

u/Specialist-Dog-501 1d ago

//As in the windows emulator? Have you considered running windows in a VM?
Na, I need WINE for music production and latency and CPU are critical..definitely not a job for a VM. But thinking about it..there's BOTTLES, with less latency/CPU impact..just I don't know which of the many flavours of WINE there is equivalent to the original WineHQ Github WINE 9.21..may be I can find this out, and then use BOTTLES to retrieve that exact WINE version..

//Is homebrew not mac-specific? Never had the urge to touch an apple product. Complete antithesis to debian philosophy.
As far I know, no, it's not apple specific, just it's main user base. It's open source also- it just has a very unique naming convention, which is a bit hard to understand ("taps", "cask", etc..)

//Sounds like you want a chroot maybe?
I heard about that one, and it's probably the underlying tech beneath many containerizations ?
But I have issues to understand it fully, to what level the encapsulation works, where you need to open it for the real root, where not etc..I rather go with the abstraction layers above (LXC, Docker, etc..) before messing around with this root technology and not understanding what process is impacted..but at some point, I really like to fiddle with it, may be in a VM, where I cannot mess up too many things. I have distroshelf/docker up, but at this point, I don't understand what it's doing, why's it's not mimicking an initsystem, and what exactly it encapsulates..I imagine, it would be only worse with chroot.

1

u/redfacedquark 1d ago

In its basic form, a chroot is just an environment where / maps to a different location. The same kernel handles system calls, the same network interfaces are available but you after using debootstrap to create it (can be a different suite like sid) and running the chroot command (or variant like schroot etc.) to switch to it, gives you a prompt where you can apt install and configure an isolated set of packages.

Chroots are (were?) used as a jail to give users or services limited capabilities. You might think something like vmware gives more isolation but it also adds more complexity (see for example the recent hyperviser escape bug in the vmx-net driver).

1

u/Specialist-Dog-501 2d ago

deb-get didn't work on my "borked" daily driver and messed up WINE 9.21 installed from github..can't use that for now on my daily driver.
But a borked start system is not a requirement- I may setup a fresh debian and do it better from the start, If I know how.

1

u/elivoncoder 2d ago

so, similar to androids obtainium then?

https://github.com/ImranR98/Obtainium

sounds neat, I like it. 

1

u/Specialist-Dog-501 1d ago

Yes, but for linux, that would be the ideal solution

1

u/deluded_dragon Debian Testing 2d ago

It's not a mortal sin downloading and building from source every now and then. You can have a ~./local/bin directory in which you can install them, so to avoid messing with the system packages installed from the repositories (especially if you are the only user of the PCs or if you are the only one interested in using the program).

1

u/Specialist-Dog-501 1d ago

Well..I guess I need to have the dependencies on my system, right ? if I can isolate them together with the target app somewhere, fine..I guess this is what distroshelf/Docker is made for ? compiling things together, not messing up the rest of the system. Sorry, I am really a rookie in this field- and probably compiled a few things on arch without even realizing it as pacman (?) handled the dependencies..but at the stage where I am know, I understand this can be risky, going-out-of-sync with the distro repo and causing later conflicts. If not true, then yes, I glady compile smaller things locally, but this dependencies...

1

u/deluded_dragon Debian Testing 1d ago

For sure you must have some developers' environment. Often the dependencies are explained in the INSTALL or README file since the developers are often polite with fellow developers and package builders.

Anyway: read carefully this page before proceeding. If you have doubts, don't esitate to ask.

https://wiki.debian.org/DontBreakDebian

And after 20 years with Debian I still feel a rookie, so don't be afraid 😄

1

u/Specialist-Dog-501 1d ago

Has anyone experience with aptly or reprepo? Those seems to be for creating a local repository in a debian system, and then the repo turns up in the usual software repository list from apt..sounds ideal ?

0

u/scythe-3 Debian Stable 2d ago

If there's no Debian apt repo, then Flatpak. If there's no Flatpak, then cargo install or go install. If there's no cargo/go install, then checkinstall in a custom bash script (in the same vein as Arch/AUR PKGBUILDs).

I manage my own Neovim install on Debian with a bash script (using the official nvim build steps). I'll post as a reply in a bit.

1

u/scythe-3 Debian Stable 2d ago

```

!/bin/bash

==============================================================================

COLOR LOGGING

==============================================================================

if [ -t 2 ] && [ -z "${NO_COLOR}" ] && [ "$(tput colors 2>/dev/null || echo 0)" -ge 8 ]; then CLR_RED="$(tput bold; tput setaf 1)" CLR_GREEN="$(tput bold; tput setaf 2)" CLR_YELLOW="$(tput bold; tput setaf 3)" CLR_BLUE="$(tput bold; tput setaf 4)" CLR_MAGENTA="$(tput bold; tput setaf 5)" CLR_CYAN="$(tput bold; tput setaf 6)" CLR_RESET="$(tput sgr0)" else CLR_RED="" CLR_GREEN="" CLR_YELLOW="" CLR_BLUE="" CLR_MAGENTA="" CLR_CYAN="" CLR_RESET="" fi

log_error() { echo "${CLR_RED}ERROR:${CLR_RESET} $1" >&2; } log_success() { echo "${CLR_GREEN}SUCCESS:${CLR_RESET} $1"; } log_warn() { echo "${CLR_YELLOW}WARNING:${CLR_RESET} $1" >&2; } log_info() { echo "${CLR_BLUE}INFO:${CLR_RESET} $1"; } log_debug() { echo "${CLR_MAGENTA}DEBUG:${CLR_RESET} $1"; } log_note() { echo "${CLR_CYAN}NOTE:${CLR_RESET} $1"; }

==============================================================================

PRIVILEGE VALIDATION & DEPENDENCY CHECKS

==============================================================================

if [ "$EUID" -ne 0 ]; then log_error "Script must be run with sudo privileges." exit 1 fi

Define global paths.

NVIM_BIN="/usr/bin/nvim" GH_BIN="/usr/bin/gh" BUILD_DIR="/home/$SUDO_USER/build"

if [ ! -x "$NVIM_BIN" ]; then log_error "Neovim (nvim) is not installed." exit 1 fi

Check if gh CLI is installed.

if [ ! -x "$GH_BIN" ]; then log_error "GitHub CLI (gh) is not installed." exit 1 fi

==============================================================================

NVIM VERSION CHECK

==============================================================================

RAW_INSTALLED=$(nvim -v | head -n 1 | awk '{print $2}') INSTALLED_VERSION=${RAW_INSTALLED#v}

RELEASE_VERSION=$(sudo -u "$SUDO_USER" gh release list \ --repo neovim/neovim \ --exclude-pre-releases \ --limit 1 2>/dev/null | awk '{print $2}') if [ -z "$RELEASE_VERSION" ]; then log_error "Failed to fetch latest release using gh CLI." echo "Check your authentication or network status." >&2 exit 1 fi

if [ "$INSTALLED_VERSION" == "$RELEASE_VERSION" ]; then echo "Neovim is already up to date." echo -e "\tInstalled: \t$INSTALLED_VERSION" echo -e "\tLatest: \t$RELEASE_VERSION" exit 0 else echo "New version of Neovim available for install." echo -e "\tInstalled: \t$INSTALLED_VERSION" echo -e "\tLatest: \t$RELEASE_VERSION" fi

==============================================================================

CLONE & BUILD

==============================================================================

log_note "Navigating to build directory '$BUILD_DIR'..." if [ ! -d "$BUILD_DIR" ]; then log_warn "Build directory does not exist. Creating directory: '$BUILD_DIR'." mkdir -p "$BUILD_DIR" fi cd "$BUILD_DIR" || return

log_note "Cloning Neovim GitHub repository..." sudo -u "$SUDO_USER" gh repo clone neovim/neovim > /dev/null 2>&1

log_note "Checking out stable branch..." cd ./neovim && sudo -u "$SUDO_USER" git checkout stable > /dev/null 2>&1

echo "" log_note "Building Neovim..." if sudo -u "$SUDO_USER" make CMAKE_BUILD_TYPE=RelWithDebInfo; then log_success "Neovim built successfully!" else log_error "Build failed." exit 1 fi

echo "" log_note "Checking Neovim build version..." RAW_BUILD=$(./build/bin/nvim -v | head -n 1 | awk '{print $2}') BUILD_VERSION=${RAW_BUILD#v} if [ "$BUILD_VERSION" == "$RELEASE_VERSION" ]; then log_success "Build version matches release." else log_error "Build version does not match release." echo "This is likely an error in the script. Troubleshooting required." >&2 echo -e "\tBuild: \t$BUILD_VERSION" >&2 echo -e "\tLatest: \t$RELEASE_VERSION" >&2 exit 1 fi

==============================================================================

PACKAGE & INSTALL

==============================================================================

echo "" log_note "Packaging build as DEB..." cd ./build || return if sudo -u "$SUDO_USER" cpack -G DEB; then log_success "DEB package created." else log_error "DEB packaging failed." exit 1 fi

echo "" log_note "Installing DEB package..." if apt install ./nvim-linux-x86_64.deb; then log_success "Neovim succesfully updated!" else log_error "Install failed. Neovim not updated." exit 1 fi

==============================================================================

CLEANUP

==============================================================================

echo "" log_note "Cleaning up build files...." cd "$BUILD_DIR" || return if rm -rf ./neovim; then log_success "Files cleaned. Exiting..." fi

exit 0 ```

1

u/Specialist-Dog-501 2d ago

Thanks for sharing this, I honor the effort- but I am probably not the right person for this, this is yet beyond my skill level. I hope others following this post may have the level to pick this up.
I focus on getting apps then "flatpaked"- according Gemini AI, I should not need to install all necessary dependencies locally, so I should have a fair chance even as a non-developer to get that packed.