From a7e4b22c912de8549bb489d021852d5a5448b607 Mon Sep 17 00:00:00 2001 From: Heitor Augusto Date: Sun, 9 Feb 2025 13:11:10 -0300 Subject: [PATCH 1/2] vinegar: 1.7.8 -> 1.8.0 --- pkgs/by-name/vi/vinegar/package.nix | 157 +++++++++++++++++++++------- 1 file changed, 119 insertions(+), 38 deletions(-) diff --git a/pkgs/by-name/vi/vinegar/package.nix b/pkgs/by-name/vi/vinegar/package.nix index b88e26336c06..68cfa1ae0974 100644 --- a/pkgs/by-name/vi/vinegar/package.nix +++ b/pkgs/by-name/vi/vinegar/package.nix @@ -1,81 +1,162 @@ { lib, buildGoModule, - fetchFromGitHub, - fetchurl, - pkg-config, - xorg, - wayland, - vulkan-headers, wine64Packages, + fetchpatch, + fetchFromGitHub, + glib, + makeBinaryWrapper, + pkg-config, + gtk4, + libadwaita, libGL, libxkbcommon, - makeBinaryWrapper, + vulkan-headers, + vulkan-loader, + wayland, + winetricks, + xorg, + symlinkJoin, + cairo, + gdk-pixbuf, + graphene, + pango, nix-update-script, }: let - wine = (wine64Packages.staging.override { embedInstallers = true; }).overrideAttrs (oldAttrs: { - patches = oldAttrs.patches or [ ] ++ [ - (fetchurl { - name = "loader-prefer-winedllpath.patch"; - url = "https://raw.githubusercontent.com/flathub/org.vinegarhq.Vinegar/3e07606350d803fa386eb4c358836a230819380d/patches/wine/loader-prefer-winedllpath.patch"; - hash = "sha256-89wnr2rIbyw490hHwckB9g1GKCXm6BERnplfwEUlNOg="; - }) - ]; - }); + wine = + (wine64Packages.staging.override { + dbusSupport = true; + embedInstallers = true; + pulseaudioSupport = true; + x11Support = true; + waylandSupport = true; + }).overrideAttrs + (oldAttrs: { + # https://github.com/flathub/org.vinegarhq.Vinegar/blob/1a42384ff0c5670504415190301c20e89601bbad/wine.yml#L31 + # --with-wayland is added by waylandSupport = true; + configureFlags = oldAttrs.configureFlags or [ ] ++ [ + "--disable-tests" + "--disable-win16" + "--with-dbus" + "--with-pulse" + "--with-x" + "--without-oss" + ]; + + patches = oldAttrs.patches or [ ] ++ [ + (fetchpatch { + name = "loader-prefer-winedllpath.patch"; + url = "https://raw.githubusercontent.com/flathub/org.vinegarhq.Vinegar/3e07606350d803fa386eb4c358836a230819380d/patches/wine/loader-prefer-winedllpath.patch"; + hash = "sha256-89wnr2rIbyw490hHwckB9g1GKCXm6BERnplfwEUlNOg="; + }) + ]; + }); in buildGoModule rec { pname = "vinegar"; - version = "1.7.8"; + version = "1.8.0"; src = fetchFromGitHub { owner = "vinegarhq"; repo = "vinegar"; - rev = "v${version}"; - hash = "sha256-qyBYPBXQgjnGA2LnghPFOd0AO6+sQcZPzPI0rlJvGHE="; + tag = "v${version}"; + hash = "sha256-eAQ5qlBY1PmpijEu7mPmCBFbAIA30ABcbirdBljAmTQ="; }; - vendorHash = "sha256-SDJIoZf/Doa/NrEBRL1WXvz+fyTDGRyG0bvQ0S8A+KA="; + vendorHash = "sha256-NLNAUf99psBq8PayorBH1DT6o9wZyKwx9ab+TtpKU50="; nativeBuildInputs = [ - pkg-config + glib makeBinaryWrapper + pkg-config ]; buildInputs = [ + gtk4 + libadwaita + libGL + libxkbcommon + vulkan-headers + vulkan-loader + wayland + wine + winetricks xorg.libX11 xorg.libXcursor xorg.libXfixes - wayland - vulkan-headers - wine - libGL - libxkbcommon ]; - ldflags = [ - "-s" - "-w" - ]; + buildPhase = '' + runHook preBuild - makeFlags = [ - "PREFIX=${placeholder "out"}" - ]; + make PREFIX=$out + + runHook postBuild + ''; + + # Add getGoDirs to checkPhase since it is not being provided by the buildPhase + preCheck = '' + getGoDirs() { + local type; + type="$1" + if [ -n "$subPackages" ]; then + echo "$subPackages" | sed "s,\(^\| \),\1./,g" + else + find . -type f -name \*$type.go -exec dirname {} \; | grep -v "/vendor/" | sort --unique | grep -v "$exclude" + fi + } + ''; + + preInstall = '' + substituteInPlace Makefile --replace-fail 'gtk-update-icon-cache' '${lib.getExe' gtk4 "gtk4-update-icon-cache"}' + ''; + + installPhase = '' + runHook preInstall + + make PREFIX=$out install + + runHook postInstall + ''; postInstall = '' wrapProgram $out/bin/vinegar \ - --prefix PATH : ${lib.makeBinPath [ wine ]} + --prefix PATH : ${ + lib.makeBinPath [ + wine + winetricks + ] + } \ + --prefix PUREGOTK_LIB_FOLDER : ${passthru.libraryPath}/lib ''; - passthru.updateScript = nix-update-script { }; + passthru = { + libraryPath = symlinkJoin { + name = "vinegar-puregotk-lib-folder"; + paths = [ + cairo + glib.out + graphene + gdk-pixbuf + gtk4 + libadwaita + pango.out + vulkan-loader + ]; + }; + + updateScript = nix-update-script { }; + }; meta = { - description = "Open-source, minimal, configurable, fast bootstrapper for running Roblox on Linux"; - homepage = "https://github.com/vinegarhq/vinegar"; changelog = "https://github.com/vinegarhq/vinegar/releases/tag/v${version}"; + description = "Open-source, minimal, configurable, fast bootstrapper for running Roblox Studio on Linux"; + homepage = "https://github.com/vinegarhq/vinegar"; license = lib.licenses.gpl3Only; - maintainers = with lib.maintainers; [ HeitorAugustoLN ]; mainProgram = "vinegar"; + maintainers = with lib.maintainers; [ HeitorAugustoLN ]; platforms = [ "x86_64-linux" ]; + sourceProvenance = [ lib.sourceTypes.fromSource ]; }; } From d68c0aedd61cb06a4bb1143b605fca8936a91a06 Mon Sep 17 00:00:00 2001 From: Heitor Augusto Date: Mon, 10 Feb 2025 17:37:06 -0300 Subject: [PATCH 2/2] vinegar: 1.8.0 -> 1.8.1 --- pkgs/by-name/vi/vinegar/package.nix | 31 +++++++++++++++++------------ 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/pkgs/by-name/vi/vinegar/package.nix b/pkgs/by-name/vi/vinegar/package.nix index 68cfa1ae0974..8a6bb7daf1fc 100644 --- a/pkgs/by-name/vi/vinegar/package.nix +++ b/pkgs/by-name/vi/vinegar/package.nix @@ -7,20 +7,20 @@ glib, makeBinaryWrapper, pkg-config, + cairo, + gdk-pixbuf, + graphene, gtk4, libadwaita, libGL, libxkbcommon, + pango, vulkan-headers, vulkan-loader, wayland, winetricks, xorg, symlinkJoin, - cairo, - gdk-pixbuf, - graphene, - pango, nix-update-script, }: let @@ -33,7 +33,7 @@ let waylandSupport = true; }).overrideAttrs (oldAttrs: { - # https://github.com/flathub/org.vinegarhq.Vinegar/blob/1a42384ff0c5670504415190301c20e89601bbad/wine.yml#L31 + # https://github.com/flathub/org.vinegarhq.Vinegar/blob/a3c2f1249dec9548bd870027f55edcc58343b685/wine.yml#L31-L38 # --with-wayland is added by waylandSupport = true; configureFlags = oldAttrs.configureFlags or [ ] ++ [ "--disable-tests" @@ -55,16 +55,16 @@ let in buildGoModule rec { pname = "vinegar"; - version = "1.8.0"; + version = "1.8.1"; src = fetchFromGitHub { owner = "vinegarhq"; repo = "vinegar"; tag = "v${version}"; - hash = "sha256-eAQ5qlBY1PmpijEu7mPmCBFbAIA30ABcbirdBljAmTQ="; + hash = "sha256-7rc6LKZx0OOZDedtTpHIQT4grx1FejRiVnJnVDUddy4="; }; - vendorHash = "sha256-NLNAUf99psBq8PayorBH1DT6o9wZyKwx9ab+TtpKU50="; + vendorHash = "sha256-TZhdwHom4DTgLs4z/eADeoKakMtyFrvVljDg4JJp7dc="; nativeBuildInputs = [ glib @@ -73,10 +73,15 @@ buildGoModule rec { ]; buildInputs = [ + cairo + gdk-pixbuf + glib.out + graphene gtk4 libadwaita libGL libxkbcommon + pango.out vulkan-headers vulkan-loader wayland @@ -87,6 +92,10 @@ buildGoModule rec { xorg.libXfixes ]; + postPatch = '' + substituteInPlace Makefile --replace-fail 'gtk-update-icon-cache' '${lib.getExe' gtk4 "gtk4-update-icon-cache"}' + ''; + buildPhase = '' runHook preBuild @@ -108,10 +117,6 @@ buildGoModule rec { } ''; - preInstall = '' - substituteInPlace Makefile --replace-fail 'gtk-update-icon-cache' '${lib.getExe' gtk4 "gtk4-update-icon-cache"}' - ''; - installPhase = '' runHook preInstall @@ -136,9 +141,9 @@ buildGoModule rec { name = "vinegar-puregotk-lib-folder"; paths = [ cairo + gdk-pixbuf glib.out graphene - gdk-pixbuf gtk4 libadwaita pango.out