r/debian • u/Specialist-Dog-501 • 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/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
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.
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.