Skip to content

Commit

Permalink
remove multi instances feature
Browse files Browse the repository at this point in the history
As per Hyperion.
  • Loading branch information
apprehensions committed Aug 5, 2024
1 parent a197860 commit f231e73
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 139 deletions.
26 changes: 7 additions & 19 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
VERSION = v1.7.5

PREFIX = /usr
BINPREFIX = $(PREFIX)/libexec/vinegar
APPPREFIX = $(PREFIX)/share/applications
ICONPREFIX = $(PREFIX)/share/icons/hicolor

GO = go
GO_LDFLAGS = -s -w

VINEGAR_LDFLAGS = $(GO_LDFLAGS) -X main.BinPrefix=$(BINPREFIX) -X main.Version=$(VERSION)
VINEGAR_GOFLAGS = $(GO_GOFLAGS)
GO = go
GO_LDFLAGS = -s -w -X main.Version=$(VERSION)

ROBLOX_ICONS = \
assets/icons/128/roblox-player.png assets/icons/128/roblox-studio.png \
Expand All @@ -20,15 +16,12 @@ ROBLOX_ICONS = \

VINEGAR_ICON = splash/vinegar.png

all: vinegar robloxmutexer.exe
all: vinegar
icons: $(ROBLOX_ICONS) $(VINEGAR_ICON)
install: install-vinegar install-robloxmutexer install-desktop install-icons
install: install-vinegar install-desktop install-icons

vinegar:
$(GO) build $(VINEGAR_GOFLAGS) $(GOFLAGS) -ldflags="$(VINEGAR_LDFLAGS)" ./cmd/vinegar

robloxmutexer.exe:
GOOS=windows $(GO) build $(GOFLAGS) -ldflags="$(GO_LDFLAGS)" ./cmd/robloxmutexer
$(GO) build $(GOFLAGS) -ldflags="$(GO_LDFLAGS)" ./cmd/vinegar

$(ROBLOX_ICONS): assets/roblox-player.svg assets/roblox-studio.svg
rm -rf assets/icons
Expand All @@ -47,9 +40,6 @@ install-vinegar: vinegar assets/org.vinegarhq.Vinegar.metainfo.xml
install -Dm755 vinegar $(DESTDIR)$(PREFIX)/bin/vinegar
install -Dm644 assets/org.vinegarhq.Vinegar.metainfo.xml -t $(DESTDIR)$(PREFIX)/share/metainfo

install-robloxmutexer: robloxmutexer.exe
install -Dm755 robloxmutexer.exe $(DESTDIR)$(BINPREFIX)/robloxmutexer.exe

install-desktop:
install -Dm644 assets/desktop/vinegar.desktop $(DESTDIR)$(APPPREFIX)/org.vinegarhq.Vinegar.desktop
install -Dm644 assets/desktop/roblox-app.desktop $(DESTDIR)$(APPPREFIX)/org.vinegarhq.Vinegar.app.desktop
Expand All @@ -72,7 +62,6 @@ install-icons: icons
uninstall:
rm -f $(DESTDIR)$(PREFIX)/bin/vinegar
rm -f $(DESTDIR)$(PREFIX)/share/metainfo/org.vinegarhq.Vinegar.metainfo.xml
rm -f $(DESTDIR)$(BINPREFIX)/robloxmutexer.exe
rm -f $(DESTDIR)$(APPPREFIX)/org.vinegarhq.Vinegar.desktop
rm -f $(DESTDIR)$(APPPREFIX)/org.vinegarhq.Vinegar.app.desktop
rm -f $(DESTDIR)$(APPPREFIX)/org.vinegarhq.Vinegar.player.desktop
Expand All @@ -89,7 +78,6 @@ uninstall:
rm -f $(DESTDIR)$(ICONPREFIX)/128x128/apps/org.vinegarhq.Vinegar.player.png
rm -f $(DESTDIR)$(ICONPREFIX)/128x128/apps/org.vinegarhq.Vinegar.studio.png


mime:
xdg-mime default org.vinegarhq.Vinegar.player.desktop x-scheme-handler/roblox-player
xdg-mime default org.vinegarhq.Vinegar.player.desktop x-scheme-handler/roblox
Expand All @@ -102,6 +90,6 @@ tests:
$(GO) test $(GOFLAGS) ./...

clean:
rm -f vinegar robloxmutexer.exe
rm -f vinegar

.PHONY: all install install-vinegar install-robloxmutexer install-desktop install-icons uninstall icons mime tests clean
.PHONY: all install install-vinegar install-desktop install-icons uninstall icons mime tests clean
87 changes: 0 additions & 87 deletions cmd/robloxmutexer/main.go

This file was deleted.

15 changes: 0 additions & 15 deletions cmd/vinegar/binary.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,21 +244,6 @@ func (b *Binary) HandleProtocolURI(mime string) {
}

func (b *Binary) Execute(args ...string) error {
// Studio can run in multiple instances, not Player
if b.GlobalConfig.MultipleInstances && b.Type == clientsettings.WindowsPlayer {
slog.Info("Running robloxmutexer")

mutexer := b.Prefix.Wine(filepath.Join(BinPrefix, "robloxmutexer.exe"))
if err := mutexer.Start(); err != nil {
return fmt.Errorf("run robloxmutexer: %w", err)
}
go func() {
if err := mutexer.Wait(); err != nil {
slog.Error("robloxmutexer returned too early", "error", err)
}
}()
}

cmd, err := b.Command(args...)
if err != nil {
return err
Expand Down
1 change: 0 additions & 1 deletion cmd/vinegar/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import (
)

var (
BinPrefix string
ConfigPath string
FirstRun bool
Version string
Expand Down
19 changes: 4 additions & 15 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ package config
import (
"errors"
"fmt"
"log/slog"
"os"
"os/exec"
"path/filepath"
Expand All @@ -13,7 +12,6 @@ import (
"github.com/BurntSushi/toml"
"github.com/apprehensions/rbxbin"
"github.com/vinegarhq/vinegar/splash"
"github.com/vinegarhq/vinegar/sysinfo"
)

// LogoPath is set at build-time to set the logo icon path, which is
Expand All @@ -38,11 +36,10 @@ type Binary struct {

// Config is a representation of the Vinegar configuration.
type Config struct {
MultipleInstances bool `toml:"multiple_instances"`
SanitizeEnv bool `toml:"sanitize_env"`
Player Binary `toml:"player"`
Studio Binary `toml:"studio"`
Env Environment `toml:"env"`
SanitizeEnv bool `toml:"sanitize_env"`
Player Binary `toml:"player"`
Studio Binary `toml:"studio"`
Env Environment `toml:"env"`

Splash splash.Config `toml:"splash"`
}
Expand Down Expand Up @@ -176,14 +173,6 @@ func (c *Config) setup() error {
SanitizeEnv()
}

// On each Flatpak instance, each one has their own wineserver, which means
// if a new Vinegar flatpak instance is ran, with the intent of having two
// running Player instances, one of the wineservers in either sandboxed
// instance will die.
if c.MultipleInstances && sysinfo.InFlatpak {
slog.Warn("Multiple instances is broken on Flatpak! Please consider using a source installation!")
}

c.Env.Setenv()

if err := c.Player.setup(); err != nil {
Expand Down
1 change: 0 additions & 1 deletion dxvk/dxvk.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ func Extract(name string, pfx *wine.Prefix) error {

for {
hdr, err := tr.Next()

if err != nil {
if err == io.EOF {
break
Expand Down
1 change: 0 additions & 1 deletion splash/splash.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ func New(cfg *Config) *Splash {
}

w := window(s.Size())


th := material.NewTheme()
th.Shaper = text.NewShaper(text.WithCollection(gofont.Collection()))
Expand Down

0 comments on commit f231e73

Please sign in to comment.