Skip to content

Commit

Permalink
umu-launcher[-unwrapped]: init at 1.1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
diniamo committed Jan 11, 2025
1 parent 082903a commit 3fb100f
Show file tree
Hide file tree
Showing 4 changed files with 112 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/Makefile.in b/Makefile.in
index b82053d..3e4379e 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -90,7 +90,7 @@ umu-dist: $(OBJDIR)/.build-umu-dist
umu-dist-install: umu-dist
$(info :: Installing umu )
install -d $(DESTDIR)$(PYTHONDIR)/$(INSTALLDIR)
- $(PYTHON_INTERPRETER) -m installer --destdir=$(DESTDIR) $(OBJDIR)/*.whl
+ $(PYTHON_INTERPRETER) -m installer --prefix=$(DESTDIR) $(OBJDIR)/*.whl

ifeq ($(FLATPAK), xtrue)
umu-install: version-install umu-dist-install
22 changes: 22 additions & 0 deletions pkgs/by-name/um/umu-launcher-unwrapped/no-umu-version-json.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
diff --git a/Makefile.in b/Makefile.in
index b82053d..37db8c9 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -50,7 +50,7 @@ fix_shebangs:
umu/umu_version.json: umu/umu_version.json.in
$(info :: Updating $(@) )
cp $(<) $(<).tmp
- sed 's|##UMU_VERSION##|$(shell git describe --always --long --tags)|g' -i $(<).tmp
+ sed 's|##UMU_VERSION##|@version@|g' -i $(<).tmp
mv $(<).tmp $(@)

.PHONY: version
@@ -151,7 +151,7 @@ clean:
@rm -rf -v $(OBJDIR) umu/umu_version.json ./$(RELEASEDIR) $(RELEASEDIR).tar.gz


-RELEASEDIR := $(PROJECT)-$(shell git describe --abbrev=0)
+RELEASEDIR := $(PROJECT)-@version@
$(RELEASEDIR):
mkdir -p $(@)

61 changes: 61 additions & 0 deletions pkgs/by-name/um/umu-launcher-unwrapped/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{
python3Packages,
fetchFromGitHub,
lib,
bash,
hatch,
scdoc,
replaceVars,
}:
python3Packages.buildPythonPackage rec {
pname = "umu-launcher-unwrapped";
version = "1.1.4";

src = fetchFromGitHub {
owner = "Open-Wine-Components";
repo = "umu-launcher";
rev = "refs/tags/${version}";
hash = "sha256-TOsVK6o2V8D7CLzVOkLs8AClrZmlVQTfeii32ZIQCu4=";
};

patches = [
./makefile-installer-prefix.patch
(replaceVars ./no-umu-version-json.patch { inherit version; })
];

nativeBuildInputs = [
python3Packages.build
hatch
scdoc
python3Packages.installer
];

pythonPath = [
python3Packages.filelock
python3Packages.xlib
];

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
preBuild = ''
makeFlagsArray+=(
"PYTHON_INTERPRETER=${lib.getExe python3Packages.python}"
"SHELL_INTERPRETER=${lib.getExe bash}"
"PREFIX="
"PYTHONDIR=/${python3Packages.python.sitePackages}"
"DESTDIR=$out"
)
'';

meta = {
description = "Unified launcher for Windows games on Linux using the Steam Linux Runtime and Tools";
changelog = "https://github.com/Open-Wine-Components/umu-launcher/releases/tag/${version}";
homepage = "https://github.com/Open-Wine-Components/umu-launcher";
license = lib.licenses.gpl3;
mainProgram = "umu-run";
maintainers = with lib.maintainers; [ diniamo MattSturgeon fuzen ];
platforms = lib.platforms.linux;
};
}
16 changes: 16 additions & 0 deletions pkgs/by-name/um/umu-launcher/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{ buildFHSEnv, umu-launcher-unwrapped }:
buildFHSEnv {
# 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";
inherit (umu-launcher-unwrapped) version meta;

targetPkgs = pkgs: [ pkgs.umu-launcher-unwrapped ];

extraInstallCommands = ''
ln -s ${umu-launcher-unwrapped}/lib $out/lib
ln -s ${umu-launcher-unwrapped}/share $out/share
'';

runScript = "${umu-launcher-unwrapped}/bin/umu-run";
}

0 comments on commit 3fb100f

Please sign in to comment.