Skip to content

Commit

Permalink
[Refactor] Partial Vagrantfile, reorganize scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
melianmiko committed Feb 6, 2025
1 parent e2920b1 commit 30ea6f8
Show file tree
Hide file tree
Showing 9 changed files with 211 additions and 106 deletions.
14 changes: 8 additions & 6 deletions .github/workflows/on_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,11 @@ jobs:
uses: abatilo/actions-poetry@v2
with:
poetry-version: "1.8.3"
- name: Install Just
run: choco install just
- uses: actions/checkout@v4
- run: poetry install
- run: poetry run just env
- run: poetry run just gh_autobuild
- run: just prepare
- run: just bump_version_git build pkg_win32_portable
- name: Upload portable
uses: actions/upload-artifact@v4
with:
Expand All @@ -54,10 +55,11 @@ jobs:
uses: abatilo/actions-poetry@v2
with:
poetry-version: "1.8.3"
- name: Install Just
run: curl -s https://just.systems/install.sh | sudo bash -s -- --to /usr/local/bin
- uses: actions/checkout@v4
- run: poetry install
- run: poetry run just env
- run: poetry run just gh_autobuild
- run: just dependencies_debian prepare
- run: just bump_version_git build pkg_debian
- name: Upload bundle
uses: actions/upload-artifact@v4
with:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
/build
/builddir
/dist
/.vagrant
/scripts/tools
/release.json
/accent.json
Expand Down
53 changes: 53 additions & 0 deletions Vagrantfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
Vagrant.configure("2") do |config|
config.vm.define "debian", primary: true do |debian|
debian.vm.box = "generic/debian12"
debian.vm.synced_folder ".", "/home/vagrant/openfreebuds"

debian.vm.provision "shell",
run: 'once',
name: "Prepare base dependencies (Flatpak, Just, Poetry)",
privileged: true,
inline: <<-SHELL
apt update
apt install -y --no-install-recommends pipx curl flatpak python-is-python3
# Install qasync (not in Debian repos, required for packaging as runtime dep)
# Since Debian 13, will be in main repo
curl -s -o /tmp/qasync.deb https://deb.mmk.pw/pool/main/q/qasync/python3-qasync_0.27.1-4_all.deb
apt install -y --no-install-recommends /tmp/qasync.deb
rm /tmp/qasync.deb
# Install Just
# Since Debian 13, will be in main repo
if [ ! -f /usr/local/bin/just ]
then
curl -s https://just.systems/install.sh | bash -s -- --to /usr/local/bin
fi
# Install Poetry for user
sudo -u vagrant pipx install poetry
echo 'export PATH=$PATH:/home/vagrant/.local/bin' >> /home/vagrant/.bashrc
SHELL

debian.vm.provision "shell",
run: 'always',
name: "Install Flatpak requirements",
privileged: false,
inline: <<-SHELL
flatpak remote-add --if-not-exists --user flathub https://dl.flathub.org/repo/flathub.flatpakrepo
flatpak install -y --user org.flatpak.Builder
SHELL

debian.vm.provision "shell",
run: 'always',
name: "Install and build everything",
privileged: false,
inline: <<-SHELL
export FLATPAKBUILDDIR=$HOME/flatpak
cd ~/openfreebuds
just dependencies_debian prepare
just build pkg_debian_full pkg_flatpak
SHELL
end
end
5 changes: 3 additions & 2 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@ Section: utils
Priority: optional
Maintainer: MelianMiko <[email protected]>
Build-Depends: debhelper-compat (= 12),
python3 (>= 3.11),
build-essential,
python3-dev,
python3-pip,
pyqt6-dev-tools,
libcairo2-dev,
gobject-introspection,
libgirepository1.0-dev,
qt6-l10n-tools,
fakeroot,
make,
git
Standards-Version: 4.4.1
Expand Down
9 changes: 6 additions & 3 deletions debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@
dh $@

override_dh_auto_build:
poetry run just build
# Only installs precompiled wheel binary
true

override_dh_auto_install:
DESTDIR=${PWD}/debian/openfreebuds/usr PYTHONLIBDIR=${PWD}/debian/openfreebuds/usr/lib/python3/dist-packages poetry run just install
DESTDIR=${PWD}/debian/openfreebuds/usr \
PYTHONLIBDIR=${PWD}/debian/openfreebuds/usr/lib/python3/dist-packages \
just install

override_dh_clean:
git clean -xfd -e accent.json
true
4 changes: 3 additions & 1 deletion debian/source/options
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
tar-ignore = "*venv"
tar-ignore = ".git"
tar-ignore = ".vagrant"
tar-ignore = "dist"
tar-ignore = "scripts/build_flatpak"
Loading

0 comments on commit 30ea6f8

Please sign in to comment.