Skip to content

Commit

Permalink
fixes nix build issue and updates nixpkgs (#144)
Browse files Browse the repository at this point in the history
* Fixes #142
maintaining nix support and updating nixpkgs

* removed unneeded dependencies and added more emphasis on tagging
maintainers

* Update README.md

- Add new line

---------

Co-authored-by: beh-10257 <[email protected]>
Co-authored-by: R1kaB3rN <[email protected]>
  • Loading branch information
3 people authored Jul 11, 2024
1 parent f7164c3 commit 15decf6
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 27 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,9 @@ dnf install -y umu-launcher*.rpm
[![Stable version badge](https://img.shields.io/aur/version/umu-launcher?style=flat&label=umu-launcher)](https://aur.archlinux.org/packages/umu-launcher)

### NixOS
If there is any problem with the flake feel free to open a bug report and tag any of the maintainers
> maintainers: @beh-10257
If you want to add umu-launcher as a flake add this to your inputs in `flake.nix`
```nix
inputs = {
Expand All @@ -156,8 +159,6 @@ and in your `configuration.nix`
environment.systemPackages = [ inputs.umu.packages.${pkgs.system}.umu ];
}
```
If there is any problem with the flake feel free to open a bug report and tag any of the maintainers
> maintainers: @beh-10257

## Contributing

Expand Down
4 changes: 2 additions & 2 deletions packaging/nix/combine.nix
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{ env, package, symlinkJoin }:
symlinkJoin {
name = "umu-combine";
name = "umu-run-bwrap";
paths = [
env
package
];
postBuild = ''
rm $out/bin/umu-run
rm $out/bin/umu
'';
}
8 changes: 4 additions & 4 deletions packaging/nix/flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 11 additions & 4 deletions packaging/nix/flake.nix
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
{
description = "umu universal game launcher";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
};
outputs = { self, nixpkgs }:
let
umu-package = nixpkgs.legacyPackages.x86_64-linux.callPackage ./umu-launcher.nix { umu-launcher=( builtins.toPath "${self}/../../"); };
umu-run = nixpkgs.legacyPackages.x86_64-linux.callPackage ./umu-run.nix { package=umu-package; };
umu-launcher-src=builtins.toPath "${self}/../../";
nixpk=nixpkgs.legacyPackages.x86_64-linux;
in
let
pyth = nixpk.pkgs.python3;
in
let
umu-package = nixpk.callPackage ./umu-launcher.nix { umu-launcher=umu-launcher-src; pyth1=pyth; };
umu-run = nixpk.callPackage ./umu-run.nix { package=umu-package; };
in{
packages.x86_64-linux.umu = nixpkgs.legacyPackages.x86_64-linux.callPackage ./combine.nix { env=umu-run; package=umu-package; };
packages.x86_64-linux.umu = nixpk.callPackage ./combine.nix { env=umu-run; package=umu-package; };
};
}
22 changes: 18 additions & 4 deletions packaging/nix/umu-launcher.nix
Original file line number Diff line number Diff line change
@@ -1,19 +1,33 @@
{stdenv , umu-launcher, pkgs, ...}:
stdenv.mkDerivation {
pname = "umu-launcher";
{pyth1 ,python3Packages , umu-launcher, pkgs, ...}:
python3Packages.buildPythonPackage {
name = "umu-launcher";
version = "0.1";
src = umu-launcher;
pyproject = false;
depsBuildBuild = [
pkgs.meson
pkgs.ninja
pkgs.scdoc
pkgs.git
pkgs.python3Packages.installer
pkgs.hatch
pkgs.python3Packages.build
];
propagatedBuildInputs = [
pkgs.python3
pyth1
pkgs.python3Packages.xlib
];
makeFlags = [ "PYTHON_INTERPRETER=${pyth1}/bin/python" "SHELL_INTERPRETER=/run/current-system/sw/bin/bash" "DESTDIR=${placeholder "out"}" ];
dontUseMesonConfigure = true;
dontUseNinjaBuild = true;
dontUseNinjaInstall = true;
dontUseNinjaCheck = true;
configureScript = "./configure.sh";
configureFlags = [ "--prefix=${placeholder "out"}" ];
postInstall=''
mv -fv $out${pyth1}/* $out
mv -fv $out$out/* $out
rm -vrf $out/nix
mv $out/bin/umu-run $out/bin/umu
'';
}
15 changes: 4 additions & 11 deletions packaging/nix/umu-run.nix
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
{ package, lib,stdenv, buildFHSEnv, writeShellScript, ...}:
let
ldPath = lib.optionals stdenv.is64bit [ "/lib64" ] ++ [ "/lib32" ];
exportLDPath = ''
export LD_LIBRARY_PATH=${lib.concatStringsSep ":" ldPath}''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH
'';
in
{ package, buildFHSEnv, writeShellScript, ...}:
buildFHSEnv {
name = "umu";
runScript = writeShellScript "umu-env" ''
${exportLDPath}
${package}/bin/umu-run "$@"
name = "umu-run";
runScript = writeShellScript "umu-run-shell" ''
${package}/bin/umu "$@"
'';
}

0 comments on commit 15decf6

Please sign in to comment.