-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
umu-launcher[-unwrapped]: init at 1.1.4 #369259
base: master
Are you sure you want to change the base?
Conversation
Oh yeah, the build fails because of #366359, I've been working on this with |
ccb8609
to
6972537
Compare
6972537
to
42fdf85
Compare
73f963a
to
9257d01
Compare
# HACK: This has to be umu-run for the executable to be called that, but the | ||
# package attribute is still umu-launcher. Is there a better way? | ||
pname = "umu-run"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like it requires changes to buildFHSEnv
I was looking for the implementation in https://github.com/NixOS/nixpkgs/blob/master/pkgs/build-support/build-fhsenv-bubblewrap/buildFHSEnv.nix, but I believe it's actually this line in default.nix
:
executableName = args.pname or args.name; |
Making executableName
a de-structured function arg should solve this limitation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not in the scope of those PR. Changing basic builders probably also has a convoluted process so I don't think I will bother.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed it's not really in scope for this PR. Was just raising the discussion as it was something you'd highlighted with your comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
executableName
is now merged
instead of saying this type of stuff why don't you tell me what are your complaints and actually make an improvement |
Sorry. The improvement is this package, since I saw more value in upstreaming a proper package to nixpkgs compared to fixing the problems in the flake. |
On another note, @MattSturgeon please mark the threads as resolved if they are. Also, should I add you and @beh-10257 as maintainers to the package (assuming you're already in the maintainers list)? |
the flake is always gonna be more up to date so there is value in that |
I don't have permission to do that. I think as PR author you can? Otherwise someone with write-access must do it. |
Huh? You should be able to resolve your own reviews. Well in that case, do you want to add anything else or can I resolve them? |
@beh-10257 most of them you can get by replacing the package definitions entirely with the ones from this PR, while adapting them for the flake (make sure to tell me about anything that's missing from the packages in this PR along with a good reasoning as well, so I can add them too; eg. optional dependencies, since I couldn't find anything about those, but I did see some in the Nix package). Once you do that, I'll PR the rest of my suggestions, since that's easier than explaining. |
From Resolving conversations:
Most of my threads were more discussion than feedback. If you feel that they are resolved, then feel free to mark as such.
I agree it'd be nice if the flake and nixpkgs were kept in sync. This will likely need breaking changes though. One way that could be done would be to have the flake base itself on the nixpkgs impl, simply overriding # flake outputs
{
overlays.default = final: prev: {
umu-launcher-unwrapped = prev.umu-launcher-unwrapped.overrideAttrs (old: {
# TODO: would be nice to filter out irrelevant dirs,
# to avoid them invalidating build caches
# e.g. using filesets
src = ../../.;
# TODO: version should also be something sensible
version = "?";
});
};
} One way to avoid that being an invisibly breaking change, would be to add a new By keeping the old flake at its existing location (with a warning), users would have time to migrate to the new flake at the new location. That way a) end-users don't need |
Not needing |
Sorry I missed that question. Feel free to add me 👍 |
Please add me to the maintainers list as well (fuzen) |
Added the 2 of you, but I couldn't find @beh-10257 |
@@ -0,0 +1,15 @@ | |||
{ buildFHSEnv, umu-launcher-unwrapped }: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May be worth copying heroic
nixpkgs/pkgs/games/heroic/fhsenv.nix
Lines 4 to 5 in 235caa7
extraPkgs ? pkgs: [ ], | |
extraLibraries ? pkgs: [ ], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To make it easier for end-users to add extra packages to the FHS environment by overriding.
This could be done in a follow-up PR if preferred
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I what the code does, but in what scenario would that be useful
I assume heroic launcher also supports native games, in which case it would make sense, but as far as I know, umu is for windows games only
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needed for passing graphics and fixing a cursor issue. Graphics is needed for dxvk-nvapi to work
nixpkgs/nixos/modules/programs/steam.nix
Lines 51 to 57 in e24b4c0
extraLibraries = pkgs: let | |
prevLibs = if prev ? extraLibraries then prev.extraLibraries pkgs else [ ]; | |
additionalLibs = with config.hardware.graphics; | |
if pkgs.stdenv.hostPlatform.is64bit | |
then [ package ] ++ extraPackages | |
else [ package32 ] ++ extraPackages32; | |
in prevLibs ++ additionalLibs; |
Fixed formatting |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- sed 's|##UMU_VERSION##|$(shell git describe --always --long --tags)|g' -i $(<).tmp | ||
+ sed 's|##UMU_VERSION##|@version@|g' -i $(<).tmp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This patch shouldn't be needed once Open-Wine-Components/umu-launcher#289 makes it into a release.
Maybe gate the patch file behind lib.versionOlder "1.1.5"
or `version == "1.1.4"? Assuming this PR gets merged before there's another upstream release.
That way anyone overriding this package with a newer version (or commit) won't also need to disable the patch.
-RELEASEDIR := $(PROJECT)-$(shell git describe --abbrev=0) | ||
+RELEASEDIR := $(PROJECT)-@version@ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This patch could be avoided by overriding RELEASEDIR
explicitly in makeFlags
.
If it matters, we know $(PROJECT)
should always be umu-launcher
. But I think for our purposes RELEASEDIR
could be any string?
}; | ||
|
||
patches = [ | ||
./makefile-installer-prefix.patch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add a comment to explain why this patch is needed? And/or a TODO/FIXME if you think there's a better approach?
(personally, I don't really understand why we need --prefix
instead of --destdir
here)
pyproject = false; | ||
configureScript = "./configure.sh"; | ||
|
||
# The Makefile variables are a big mess, but this combination (and the patches) more or less do what we want |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: could we avoid vague negativity in comments? It could be helpful to list issues we have with the upstream variables, but I think this comment as-is may be counter-productive.
preBuild = '' | ||
makeFlagsArray+=( | ||
"PYTHON_INTERPRETER=${lib.getExe python3Packages.python}" | ||
"SHELL_INTERPRETER=${lib.getExe bash}" | ||
"PREFIX=" | ||
"PYTHONDIR=/${python3Packages.python.sitePackages}" | ||
"DESTDIR=$out" | ||
) | ||
''; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know we touched on this before, but my preference would be to set this via makeFlags
instead of having a preBuild
script.
I think this would make the package easier to override. Probably not a big deal, but it feels cleaner.
This could be done by either
- setting
DESTDIR
to some local path, then later during theinstallPhase
moving the files to$out
, - or by setting
DESTDIR=${placeholder "out"}
.
targetPkgs = pkgs: [ pkgs.umu-launcher-unwrapped ]; | ||
|
||
executableName = "umu-run"; | ||
runScript = "${umu-launcher-unwrapped}/bin/umu-run"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
runScript = "${umu-launcher-unwrapped}/bin/umu-run"; | |
runScript = lib.getExe umu-launcher-unwrapped; |
|
||
targetPkgs = pkgs: [ pkgs.umu-launcher-unwrapped ]; | ||
|
||
executableName = "umu-run"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IDK if this is good practice, but this could be set as:
executableName = "umu-run"; | |
executableName = umu-launcher-unwrapped.meta.mainProgram; |
It seems they aren't in the list. It'd be great to have them, but that'll have to do that themselves in a follow up PR. @beh-10257 see the relevant documentation:
|
Closes #297662
This was a tough one, but my version still turned out miles better than what they have in their repo (do not look at it if you care about your eyesight).
Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)Add a 👍 reaction to pull requests you find important.