From 5d8c5d2701afffc1ca82c80740ff3300b23f7e87 Mon Sep 17 00:00:00 2001 From: Oliver Kopp Date: Wed, 21 Aug 2024 23:28:43 +0200 Subject: [PATCH 1/4] Use "NAME" consistently, make Vagrantfile consistent --- scripts/vms/fedora/Vagrantfile | 32 ++++++++++++--------- scripts/vms/linux-mint-cinnamon/Vagrantfile | 9 ++++-- scripts/vms/ubuntu/Vagrantfile | 11 +++---- scripts/vms/windows/Vagrantfile | 7 ++--- 4 files changed, 34 insertions(+), 25 deletions(-) diff --git a/scripts/vms/fedora/Vagrantfile b/scripts/vms/fedora/Vagrantfile index 58dffc1f7c6..ed716517d7e 100644 --- a/scripts/vms/fedora/Vagrantfile +++ b/scripts/vms/fedora/Vagrantfile @@ -1,35 +1,39 @@ # -*- mode: ruby -*- # vi: set ft=ruby : +NAME = "jabref-fedora-39" + Vagrant.configure("2") do |config| config.vm.box = "fedora/39-cloud-base" - config.vm.network :forwarded_port, guest: 80, host: 8080, auto_correct: true - config.vm.network :forwarded_port, guest: 9000, host: 9000, auto_correct: true - config.vm.network :forwarded_port, guest: 5000, host: 5000, auto_correct: true + config.vm.define NAME + config.vm.hostname =NAME config.vm.provider "virtualbox" do |v| - v.name = "jabref-fedora" + v.name = NAME v.gui = true v.customize ["modifyvm", :id, "--memory", "4096", "--cpus", "2"] end - config.vm.provision "shell", inline: "sudo dnf update -y" - config.vm.provision "shell", inline: "sudo dnf install -y @kde-desktop-environment" + config.vm.provision "shell", inline: <<-SHELL + sudo dnf update -y + sudo dnf install -y @kde-desktop-environment - # Following X11 packages are NOT required even the clipboard functionality seems to ask for (cf. https://github.com/JabRef/jabref/issues/11464) - # config.vm.provision "shell", inline: "sudo dnf install -y kwin-x11 plasma-workspace-x11" + # Following X11 packages are NOT required even the clipboard functionality seems to ask for (cf. https://github.com/JabRef/jabref/issues/11464) + # sudo dnf install -y kwin-x11 plasma-workspace-x11 - # We need exactly the java version required by JabRef. Auto download does not work on Fedora. - config.vm.provision "shell", inline: "sudo dnf install -y git java-21-openjdk-devel.x86_64" + # We need exactly the java version required by JabRef. Auto download does not work on Fedora. + sudo dnf install -y git java-21-openjdk-devel.x86_64 - config.vm.provision "shell", inline: "sudo systemctl set-default graphical.target" + sudo systemctl set-default graphical.target + SHELL - config.vm.provision "shell", inline: "git clone --recurse-submodules https://github.com/JabRef/jabref.git", privileged: false - config.vm.provision "shell", inline: "cd jabref && ./gradlew jar || true", privileged: false + config.vm.provision "shell", privileged:false, inline: <<-SHELL + git clone --recurse-submodules https://github.com/JabRef/jabref.git + cd jabref && ./gradlew jar || true + SHELL - # config.vm.provision "shell", inline: "sudo systemctl enable sddm" config.vm.provision "shell", inline: "sudo reboot" config.ssh.forward_x11 = true diff --git a/scripts/vms/linux-mint-cinnamon/Vagrantfile b/scripts/vms/linux-mint-cinnamon/Vagrantfile index 32951d49d3e..6da77bf67ad 100644 --- a/scripts/vms/linux-mint-cinnamon/Vagrantfile +++ b/scripts/vms/linux-mint-cinnamon/Vagrantfile @@ -1,16 +1,19 @@ # -*- mode: ruby -*- # vi: set ft=ruby : +NAME = "jabref-linux-mint-cinnamon" + Vagrant.configure("2") do |config| # https://portal.cloud.hashicorp.com/vagrant/discover/aaronvonawesome/linux-mint-21-cinnamon config.vm.box = "aaronvonawesome/linux-mint-21-cinnamon" # config.vm.box = "archman/linuxmint" # v22 - config.vm.network :forwarded_port, guest: 80, host: 8080, auto_correct: true + config.vm.define NAME + config.vm.hostname =NAME config.vm.provider "virtualbox" do |v| - v.name = "jabref-linux-mint-cinnamon" + v.name = NAME v.gui = true v.customize ["modifyvm", :id, "--memory", "2048", "--cpus", "2"] end @@ -40,5 +43,7 @@ Vagrant.configure("2") do |config| ./gradlew jar SHELL + config.vm.provision "shell", inline: "sudo reboot" + config.ssh.forward_x11 = true end diff --git a/scripts/vms/ubuntu/Vagrantfile b/scripts/vms/ubuntu/Vagrantfile index 18d0644493c..03892c4acbd 100644 --- a/scripts/vms/ubuntu/Vagrantfile +++ b/scripts/vms/ubuntu/Vagrantfile @@ -1,6 +1,8 @@ # -*- mode: ruby -*- # vi: set ft=ruby : +NAME = "jabref-ubuntu-24.04" + Vagrant.configure("2") do |config| # config.vm.box = "ubuntu/trusty64" @@ -12,18 +14,17 @@ Vagrant.configure("2") do |config| # Here, the ubuntu-desktop works without usses config.vm.box = "caspermeijn/ubuntu-desktop-24.04" - config.vm.network :forwarded_port, guest: 80, host: 8080, auto_correct: true - config.vm.network :forwarded_port, guest: 9000, host: 9000, auto_correct: true - config.vm.network :forwarded_port, guest: 5000, host: 5000, auto_correct: true - # Share an additional folder to the guest VM. The first argument is # the path on the host to the actual folder. The second argument is # the path on the guest to mount the folder. And the optional third # argument is a set of non-required options. # config.vm.synced_folder "C:/TEMP/JabRef", "/tmp/jabref" + config.vm.define NAME + config.vm.hostname =NAME + config.vm.provider "virtualbox" do |v| - v.name = "jabref-ubuntu" + v.name = NAME v.gui = true v.customize ["modifyvm", :id, "--memory", "2048", "--cpus", "2"] end diff --git a/scripts/vms/windows/Vagrantfile b/scripts/vms/windows/Vagrantfile index e3df75a74e5..21331b914af 100644 --- a/scripts/vms/windows/Vagrantfile +++ b/scripts/vms/windows/Vagrantfile @@ -1,10 +1,13 @@ # -*- mode: ruby -*- # vi: set ft=ruby : + NAME = "jabref-windows-sandbox" Vagrant.configure("2") do |config| config.vm.box = "gusztavvargadr/windows-10" config.vm.box_url = "https://app.vagrantup.com/gusztavvargadr/boxes/windows-10" + + config.vm.define NAME config.vm.hostname = NAME config.vm.provider "virtualbox" do |vb| @@ -40,8 +43,4 @@ Vagrant.configure("2") do |config| # cd jabref # .\\gradlew jar SHELL - - # Used to set the Vagrant machine name - config.vm.define NAME do |t| - end end From 814ddf4e70b1f3c344f4e4438a6304d384d051ba Mon Sep 17 00:00:00 2001 From: Oliver Kopp Date: Wed, 21 Aug 2024 23:28:52 +0200 Subject: [PATCH 2/4] Refine README.md of Cinnamon --- scripts/vms/linux-mint-cinnamon/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/vms/linux-mint-cinnamon/README.md b/scripts/vms/linux-mint-cinnamon/README.md index be220975808..d958c3a3061 100644 --- a/scripts/vms/linux-mint-cinnamon/README.md +++ b/scripts/vms/linux-mint-cinnamon/README.md @@ -1,8 +1,8 @@ # Linux Mint Cinnamon VM -[Linux Mint](https://linuxmint.com/) with JabRef snap and libreoffice-connection pre-installed. +[Linux Mint](https://linuxmint.com/) with JabRef sources. -Uses . +Uses . Start JabRef by following steps: From 6eece40fb256128ed9fdad172d8ab4535f3e7f3d Mon Sep 17 00:00:00 2001 From: Oliver Kopp Date: Thu, 22 Aug 2024 01:07:40 +0200 Subject: [PATCH 3/4] Add Debian 12 w/ IntelliJ - Fix some markdown and spaces --- scripts/vms/README.md | 13 ++--- scripts/vms/debian-12/README.md | 21 ++++++++ scripts/vms/debian-12/Vagrantfile | 58 +++++++++++++++++++++ scripts/vms/fedora/Vagrantfile | 2 +- scripts/vms/linux-mint-cinnamon/README.md | 6 +-- scripts/vms/linux-mint-cinnamon/Vagrantfile | 2 +- scripts/vms/ubuntu/Vagrantfile | 2 +- 7 files changed, 92 insertions(+), 12 deletions(-) create mode 100644 scripts/vms/debian-12/README.md create mode 100644 scripts/vms/debian-12/Vagrantfile diff --git a/scripts/vms/README.md b/scripts/vms/README.md index 260313fe462..5809913510d 100644 --- a/scripts/vms/README.md +++ b/scripts/vms/README.md @@ -49,12 +49,13 @@ Then, everything is removed. ## Available VMs -| VM | JabRef | Browser | LibreOffice | -|-------------------------------------------------|---------|---------|-------------| -| [`fedora`](fedora/) | source | -- | -- | -| [`Linux Mint (Cinnamon)`](linux-mint-cinnamon/) | source | Firefox | yes | -| [`ubuntu`](ubuntu/) | snap | Firefox | yes | -| [`windows`](windows/) | source | Edge | -- | +| VM | JabRef | Browser | LibreOffice | IntelliJ | +|-------------------------------------------------|---------|---------|-------------| --------- | +| [`Debian 12`](debian-12/) | source | Firefox | -- | yes | +| [`fedora`](fedora/) | source | -- | -- | -- | +| [`Linux Mint (Cinnamon)`](linux-mint-cinnamon/) | source | Firefox | yes | -- | +| [`ubuntu`](ubuntu/) | snap | Firefox | yes | -- | +| [`windows`](windows/) | source | Edge | -- | -- | ## Troubleshooting diff --git a/scripts/vms/debian-12/README.md b/scripts/vms/debian-12/README.md new file mode 100644 index 00000000000..0b347535fba --- /dev/null +++ b/scripts/vms/debian-12/README.md @@ -0,0 +1,21 @@ +# Debian 12 + +Uses . + +Reproducer for . + +Installs [Just Perfection GNOME Shell Extension](https://gitlab.gnome.org/jrahmatzadeh/just-perfection). + +After `vagrant up`: + +1. Terminate the VM. +2. Open settings of the VM. +3. Reconfigure the Virtual Box display to "VMSVGA", "Enable 3D Acceleration", use 32 MB of Video RAM. +4. Power on. +5. Log in. + +Then, start JabRef by following steps: + +1. Open termminal +2. `cd jabref` +3. `./gradlew run` diff --git a/scripts/vms/debian-12/Vagrantfile b/scripts/vms/debian-12/Vagrantfile new file mode 100644 index 00000000000..128ec8c0bcc --- /dev/null +++ b/scripts/vms/debian-12/Vagrantfile @@ -0,0 +1,58 @@ +# -*- mode: ruby -*- +# vi: set ft=ruby : + +NAME = "jabref-debian-12" + +Vagrant.configure("2") do |config| + + config.vm.box = "alvistack/debian-12" + + config.vm.define NAME + config.vm.hostname = NAME + + config.vm.provider "virtualbox" do |v| + v.name = NAME + v.gui = true + v.customize ["modifyvm", :id, "--memory", "2048", "--cpus", "2"] + end + + config.vm.provision "shell", inline: <<-SHELL + sudo apt-get update + sudo apt-get -y upgrade + + # enable building of the virtual box guest addons + # hint from https://forums.virtualbox.org/viewtopic.php?p=508680&sid=fe86fb0f6c03c7443f1fba9a5c29a861#p508680 + # sudo apt install -y build-essential dkms + + sudo apt-get install -y git + + # install IntelliJ Community Edition - source: https://snapcraft.io/install/intellij-idea-community/debian + sudo rm /etc/apt/preferences.d/nosnap.pref # source: https://stackoverflow.com/a/77235743/873282 + sudo apt-get install -y snapd + sudo snap install snapd + sudo snap install intellij-idea-community --classic + SHELL + + config.vm.provision "shell", privileged: false, inline: <<-SHELL + # Install "Just Perfection GNOME Shell Extension" + cd /tmp + # URL retrieved from https://extensions.gnome.org/review/56688 + wget https://extensions.gnome.org/review/download/56688.shell-extension.zip -O shell-extension.zip + gnome-extensions install --force shell-extension.zip + + # Install JDK, clone JabRef's source code, and do an initial build + curl -s "https://get.sdkman.io" | bash + source "$HOME/.sdkman/bin/sdkman-init.sh" + sdk install java 21.0.4-tem < /dev/null + + cd ~ + git clone --recurse-submodules https://github.com/JabRef/jabref.git + cd jabref + sdk use java 21.0.4-tem + ./gradlew jar + SHELL + + config.vm.provision "shell", inline: "sudo reboot" + + config.ssh.forward_x11 = true +end diff --git a/scripts/vms/fedora/Vagrantfile b/scripts/vms/fedora/Vagrantfile index ed716517d7e..d49f35a3b13 100644 --- a/scripts/vms/fedora/Vagrantfile +++ b/scripts/vms/fedora/Vagrantfile @@ -8,7 +8,7 @@ Vagrant.configure("2") do |config| config.vm.box = "fedora/39-cloud-base" config.vm.define NAME - config.vm.hostname =NAME + config.vm.hostname = NAME config.vm.provider "virtualbox" do |v| v.name = NAME diff --git a/scripts/vms/linux-mint-cinnamon/README.md b/scripts/vms/linux-mint-cinnamon/README.md index d958c3a3061..5518a6e1f4d 100644 --- a/scripts/vms/linux-mint-cinnamon/README.md +++ b/scripts/vms/linux-mint-cinnamon/README.md @@ -6,9 +6,9 @@ Uses Date: Thu, 22 Aug 2024 01:46:15 +0200 Subject: [PATCH 4/4] Fix version of extension --- scripts/vms/debian-12/Vagrantfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/vms/debian-12/Vagrantfile b/scripts/vms/debian-12/Vagrantfile index 128ec8c0bcc..f500ee77527 100644 --- a/scripts/vms/debian-12/Vagrantfile +++ b/scripts/vms/debian-12/Vagrantfile @@ -26,6 +26,8 @@ Vagrant.configure("2") do |config| sudo apt-get install -y git + # sudo apt-get install -y task-cinnamon-desktop + # install IntelliJ Community Edition - source: https://snapcraft.io/install/intellij-idea-community/debian sudo rm /etc/apt/preferences.d/nosnap.pref # source: https://stackoverflow.com/a/77235743/873282 sudo apt-get install -y snapd @@ -36,8 +38,7 @@ Vagrant.configure("2") do |config| config.vm.provision "shell", privileged: false, inline: <<-SHELL # Install "Just Perfection GNOME Shell Extension" cd /tmp - # URL retrieved from https://extensions.gnome.org/review/56688 - wget https://extensions.gnome.org/review/download/56688.shell-extension.zip -O shell-extension.zip + wget https://extensions.gnome.org/extension-data/just-perfection-desktopjust-perfection.v26.shell-extension.zip -O shell-extension.zip gnome-extensions install --force shell-extension.zip # Install JDK, clone JabRef's source code, and do an initial build