Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/target
/debug.log
/test.log

# Debian build artifacts
debian/.debhelper/
debian/cargo_home/
debian/debhelper-build-stamp
debian/files
debian/xdebug-tui.substvars
debian/xdebug-tui/
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ Interactive [Xdebug](https://xdebug.org) step-debugging client for your terminal

- Download the [latest release](https://github.com/dantleech/debug-tui/releases/latest).
- Compile it yourself `cargo build`.
- Install the Debian package: `sudo dpkg -i xdebug-tui_*.deb`

### Building the Debian package

```bash
dpkg-buildpackage -us -uc -b
```

## CLI options

Expand Down
162 changes: 162 additions & 0 deletions debian/Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
#!groovy

// Current version of this Pipeline https://github.com/VitexSoftware/BuildImages/blob/main/Test/Jenkinsfile-parael

String[] distributions = [
//'debian:bookworm',
'debian:trixie',
'debian:forky',
//'ubuntu:jammy',
//'ubuntu:noble'
]

String vendor = 'vitexsoftware'
//String distroFamily = ''

properties([
copyArtifactPermission('*')
])
node() {
ansiColor('xterm') {
stage('SCM Checkout') {
checkout scm
}
}
}

def branches = [:]
distributions.each { distro ->
branches[distro] = {
def distroName = distro
println "Dist:" + distroName

def dist = distroName.split(':')
def distroFamily = dist[0]
def distroCode = dist[1]
def buildImage = ''
def artifacts = []
def buildVer = ''

node {
ansiColor('xterm') {
stage('Checkout ' + distroName) {
checkout scm
def imageName = vendor + '/' + distro
buildImage = docker.image(imageName)
sh 'git checkout debian/changelog'
def version = sh (
script: 'dpkg-parsechangelog --show-field Version',
returnStdout: true
).trim()
buildVer = version + '.' + env.BUILD_NUMBER + '~' + distroCode
}
stage('Build ' + distroName) {
buildImage.inside {
// Set unique build directories for this parallel build to avoid conflicts
def uniqueBuildId = env.BUILD_NUMBER + '-' + distroCode + '-' + env.EXECUTOR_NUMBER
sh '''
export DH_INTERNAL_BUILDDIR="/tmp/debhelper-build-''' + uniqueBuildId + '''"
export TMPDIR="/tmp/build-''' + uniqueBuildId + '''"
mkdir -p "$DH_INTERNAL_BUILDDIR" "$TMPDIR"
'''
sh 'dch -b -v ' + buildVer + ' "' + env.BUILD_TAG + '"'
sh 'sudo apt-get update --allow-releaseinfo-change'
sh 'sudo chown jenkins:jenkins ..'
sh 'sudo rm -rf debian/$(dpkg-parsechangelog --show-field Source)/ debian/.debhelper/ debian/tmp/'
sh '''
export DH_INTERNAL_BUILDDIR="/tmp/debhelper-build-''' + uniqueBuildId + '''"
export TMPDIR="/tmp/build-''' + uniqueBuildId + '''"
debuild-pbuilder -r"sudo -E" -i -us -uc -b
'''
sh 'mkdir -p $WORKSPACE/dist/debian/ ; rm -rf $WORKSPACE/dist/debian/* ; for deb in $(cat debian/files | awk \'{print $1}\'); do mv "../$deb" $WORKSPACE/dist/debian/; done'
artifacts = sh (
script: "cat debian/files | awk '{print \$1}'",
returnStdout: true
).trim().split('\n')
}
}

stage('Test ' + distroName) {
buildImage.inside {
def debconf_debug = 0 //Set to "5" or "developer" to debug debconf
sh 'cd $WORKSPACE/dist/debian/ ; dpkg-scanpackages . /dev/null > Packages; gzip -9c Packages > Packages.gz; cd $WORKSPACE'
sh 'echo "deb [trusted=yes] file://///$WORKSPACE/dist/debian/ ./" | sudo tee /etc/apt/sources.list.d/local.list'
sh 'sudo apt-get update --allow-releaseinfo-change'
sh 'echo "INSTALATION"'

def installOrder = [
// '',
]

def sorted_artifacts = artifacts.toList()

// If installOrder is empty, install all produced packages
if (installOrder.isEmpty()) {
sorted_artifacts.each { deb_file ->
if (deb_file.endsWith('.deb')) {
def pkgName = deb_file.tokenize('/')[-1].replaceFirst(/_.*/, '')
sh 'echo -e "${GREEN} installing ' + pkgName + ' on `lsb_release -sc` ${ENDCOLOR} "'
sh 'sudo DEBIAN_FRONTEND=noninteractive DEBCONF_DEBUG=' + debconf_debug + ' apt-get -y install ' + pkgName
}
}
} else {
// Install packages in specified order
installOrder.each { pkgPrefix ->
def debFile = null
for (item in sorted_artifacts) {
def itemStr = item.toString()
if (itemStr.startsWith(pkgPrefix) && itemStr.endsWith('.deb')) {
debFile = itemStr
break
}
}
if (debFile) {
def pkgName = debFile.tokenize('/')[-1].replaceFirst(/_.*/, '')
sh 'echo -e "${GREEN} installing ' + pkgName + ' on `lsb_release -sc` ${ENDCOLOR} "'
sh 'sudo DEBIAN_FRONTEND=noninteractive DEBCONF_DEBUG=' + debconf_debug + ' apt-get -y install ' + pkgName
}
}
}

}
stage('Archive artifacts ' + distroName ) {
// Only run if previous stages (Build and Test) succeeded
buildImage.inside {
// Archive all produced artifacts listed in debian/files
artifacts.each { deb_file ->
println "Archiving artifact: " + deb_file
archiveArtifacts artifacts: 'dist/debian/' + deb_file
}

// Cleanup: remove any produced files named in debian/files
// Try both the dist location and any potential original locations referenced by debian/files
def uniqueBuildId = env.BUILD_NUMBER + '-' + distroCode + '-' + env.EXECUTOR_NUMBER
sh '''
set -e
if [ -f debian/files ]; then
while read -r file _; do
[ -n "$file" ] || continue
rm -f "dist/debian/$file" || true
rm -f "../$file" || true
rm -f "$WORKSPACE/$file" || true
done < debian/files
fi
# Cleanup temporary build directories
rm -rf "/tmp/debhelper-build-''' + uniqueBuildId + '''" || true
rm -rf "/tmp/build-''' + uniqueBuildId + '''" || true
'''
}
}
}
}
}
}
}

parallel branches

node {
stage('Publish to Aptly') {
publishDebToAptly()
}
}
5 changes: 5 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
xdebug-tui (0.3.1) unstable; urgency=low

* Initial release.

-- Vítězslav Dvořák <info@vitexsoftware.cz> Thu, 26 Feb 2026 09:24:33 +0100
1 change: 1 addition & 0 deletions debian/clean
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
target/
29 changes: 29 additions & 0 deletions debian/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
Source: xdebug-tui
Section: devel
Priority: optional
Maintainer: Vítězslav Dvořák <info@vitexsoftware.cz>
Build-Depends:
debhelper-compat (= 13),
cargo,
rustc,
libstdc++-dev,
pkg-config,
Standards-Version: 4.7.0
Homepage: https://github.com/dantleech/debug-tui
Rules-Requires-Root: no
Vcs-Git: https://github.com/Vitexus/xdebug-tui.git
Vcs-Browser: https://github.com/Vitexus/xdebug-tui

Package: xdebug-tui
Architecture: any
Multi-Arch: foreign
Depends:
${misc:Depends},
${shlibs:Depends},
Description: Interactive Xdebug step-debugging client for the terminal
debug-tui is a terminal-based interactive step-debugging client for
PHP's Xdebug extension. It provides a TUI (Text User Interface) with
features including step-over/into/out navigation, history mode to
revisit previous steps, stack frame jumping, Vim-like motions, inline
variable values display, and process control for launching and
restarting debugged processes.
32 changes: 32 additions & 0 deletions debian/copyright
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: debug-tui
Upstream-Contact: Daniel Leech <https://github.com/dantleech>
Source: https://github.com/dantleech/debug-tui
Comment: Upstream does not provide an explicit license file.
Please contact upstream to clarify the licensing terms.

Files: *
Copyright: 2025 Daniel Leech
License: UNKNOWN
The upstream project does not include a license file.
This package is provided for local/private use only until
upstream clarifies the license.

Files: debian/*
Copyright: 2026 Vítězslav Dvořák <info@vitexsoftware.cz>
License: GPL-3+
This package is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
.
This package is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
.
On Debian systems, the complete text of the GNU General
Public License version 3 can be found in "/usr/share/common-licenses/GPL-3".
1 change: 1 addition & 0 deletions debian/dirs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
usr/bin
4 changes: 4 additions & 0 deletions debian/gbp.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[DEFAULT]
debian-branch = main
upstream-tag = %(version)s
pristine-tar = False
18 changes: 18 additions & 0 deletions debian/rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/make -f
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
export CARGO_HOME = $(CURDIR)/debian/cargo_home

%:
dh $@

override_dh_auto_build:
cargo build --release

override_dh_auto_install:
install -D -m 755 target/release/debug-tui $(CURDIR)/debian/xdebug-tui/usr/bin/xdebug-tui

override_dh_auto_test:

override_dh_auto_clean:
cargo clean || true
rm -rf $(CARGO_HOME)
1 change: 1 addition & 0 deletions debian/source/format
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.0 (native)
2 changes: 2 additions & 0 deletions debian/tests/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Test-Command: xdebug-tui --help
Restrictions: superficial
4 changes: 4 additions & 0 deletions debian/upstream/metadata
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Bug-Database: https://github.com/dantleech/debug-tui/issues
Bug-Submit: https://github.com/dantleech/debug-tui/issues/new
Repository: https://github.com/dantleech/debug-tui.git
Repository-Browse: https://github.com/dantleech/debug-tui
3 changes: 3 additions & 0 deletions debian/watch
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
version=4
opts=filenamemangle=s/.+\/v?(\d\S+)\.tar\.gz/xdebug-tui-$1\.tar\.gz/ \
https://github.com/dantleech/debug-tui/tags .*/archive/refs/tags/v?(\d[\d.]+)\.tar\.gz
Empty file added debian/xdebug-tui.install
Empty file.