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
Changes from 1 commit
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
Next Next commit
Fixes #142
maintaining nix support and updating nixpkgs
  • Loading branch information
beh-10257 committed Jul 11, 2024
commit 4cdd208f59b513eff3ed14f9750e22a857661b03
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; };
};
}
24 changes: 20 additions & 4 deletions packaging/nix/umu-launcher.nix
Original file line number Diff line number Diff line change
@@ -1,19 +1,35 @@
{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
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.ninja
pkgs.scdoc
pkgs.git
pkgs.python3Packages.installer
pkgs.hatch
pkgs.python3Packages.build
];
propagatedBuildInputs = [
pkgs.python3
pyth1
pkgs.python3Packages.xlib
pkgs.gvfs
pkgs.dconf
];
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 "$@"
'';
}