mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2025-12-05 21:15:38 -05:00
80 lines
2.6 KiB
Makefile
Executable File
80 lines
2.6 KiB
Makefile
Executable File
#!/usr/bin/make -f
|
|
|
|
export DH_VERBOSE = 1
|
|
|
|
# Get git commit date for version
|
|
GIT_DATE := $(shell date +%Y%m%d)
|
|
GIT_COMMIT := HEAD
|
|
|
|
# Go needs writable directories for its caches
|
|
export HOME := $(CURDIR)/debian/tmp-home
|
|
export GOCACHE := $(CURDIR)/debian/tmp-home/go-cache
|
|
export GOMODCACHE := $(CURDIR)/debian/tmp-home/go-mod
|
|
|
|
# Launchpad has no network access, so use local toolchain only
|
|
export GOTOOLCHAIN := local
|
|
|
|
%:
|
|
dh $@
|
|
|
|
override_dh_auto_build:
|
|
# Create Go cache directories (sbuild sets HOME to non-existent path)
|
|
mkdir -p $(HOME) $(GOCACHE) $(GOMODCACHE)
|
|
|
|
# Git source is already included in source package (cloned by ppa-build.sh)
|
|
# Launchpad build environment has no internet access
|
|
test -d dms-git-repo || (echo "ERROR: dms-git-repo directory not found!" && exit 1)
|
|
|
|
# Patch go.mod to use Go 1.24 base version (Ubuntu has 1.24.4, project requires 1.24.6)
|
|
sed -i 's/^go 1\.24\.[0-9]*/go 1.24/' dms-git-repo/core/go.mod
|
|
|
|
# Build dms-cli from source
|
|
@if [ -f dms-git-repo/.dms-version ]; then \
|
|
. dms-git-repo/.dms-version; \
|
|
echo "Building with VERSION=$$VERSION COMMIT=$$COMMIT"; \
|
|
cd dms-git-repo/core && $(MAKE) GOFLAGS="-mod=vendor" dist ARCH=amd64 VERSION="$$VERSION" COMMIT="$$COMMIT"; \
|
|
else \
|
|
echo "Warning: .dms-version not found, building without version info"; \
|
|
cd dms-git-repo/core && $(MAKE) GOFLAGS="-mod=vendor" dist ARCH=amd64; \
|
|
fi
|
|
cp dms-git-repo/core/bin/dms-linux-amd64 dms
|
|
chmod +x dms
|
|
|
|
override_dh_auto_install:
|
|
# Install binary
|
|
install -Dm755 dms debian/dms-git/usr/bin/dms
|
|
|
|
# Install QML files from git clone
|
|
mkdir -p debian/dms-git/usr/share/quickshell/dms
|
|
cp -r dms-git-repo/* debian/dms-git/usr/share/quickshell/dms/
|
|
|
|
# Remove unnecessary directories
|
|
rm -rf debian/dms-git/usr/share/quickshell/dms/core
|
|
rm -rf debian/dms-git/usr/share/quickshell/dms/distro
|
|
|
|
# Install systemd user service
|
|
install -Dm644 dms-git-repo/assets/systemd/dms.service \
|
|
debian/dms-git/usr/lib/systemd/user/dms.service
|
|
|
|
# Install desktop file and icon
|
|
install -Dm644 dms-git-repo/assets/dms-open.desktop \
|
|
debian/dms-git/usr/share/applications/dms-open.desktop
|
|
install -Dm644 dms-git-repo/assets/danklogo.svg \
|
|
debian/dms-git/usr/share/icons/hicolor/scalable/apps/danklogo.svg
|
|
|
|
# Create DMS Version file
|
|
@if [ -f dms-git-repo/.dms-version ]; then \
|
|
. dms-git-repo/.dms-version; \
|
|
echo "$$VERSION" > debian/dms-git/usr/share/quickshell/dms/VERSION; \
|
|
else \
|
|
echo "dev" > debian/dms-git/usr/share/quickshell/dms/VERSION; \
|
|
fi
|
|
|
|
override_dh_auto_clean:
|
|
# Don't delete dms-git-repo directory - it's part of the source package (native format)
|
|
# Clean up build artifacts
|
|
rm -f dms
|
|
rm -rf dms-git-repo/core/bin
|
|
rm -rf debian/tmp-home
|
|
dh_auto_clean
|