Skip to content
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

fixes nix build issue and updates nixpkgs #144

Merged
merged 3 commits into from
Jul 11, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@ 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 @@ -144,8 +146,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
Copy link
Member

@R1kaB3rN R1kaB3rN Jul 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can safely remove meson as a build dependency

Copy link
Member

@R1kaB3rN R1kaB3rN Jul 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same with ninja as well, since we're no longer building reaper

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 "$@"
'';
}
Loading