mirror of
https://github.com/mx42/burrito-gw2-flake.git
synced 2026-01-14 05:39:50 +01:00
feat: try to package with derivation, patching ELF (/!\ BROKEN)
This commit is contained in:
51
flake.nix
51
flake.nix
@@ -14,14 +14,10 @@
|
|||||||
stripRoot = false;
|
stripRoot = false;
|
||||||
sha256 = "10iz1w3vz1881i8h898v2ankhfhcsi439jh8b38z14jpfzbv2m6x";
|
sha256 = "10iz1w3vz1881i8h898v2ankhfhcsi439jh8b38z14jpfzbv2m6x";
|
||||||
};
|
};
|
||||||
in
|
deps = with pkgs; [
|
||||||
{
|
stdenv.cc.cc.lib
|
||||||
|
|
||||||
packages.${system}.default = pkgs.buildFHSUserEnv {
|
|
||||||
name = "burrito-gw2";
|
|
||||||
|
|
||||||
targetPkgs = pkgs: with pkgs; [
|
|
||||||
glibc
|
glibc
|
||||||
|
gcc
|
||||||
xorg.libXcursor
|
xorg.libXcursor
|
||||||
xorg.libX11
|
xorg.libX11
|
||||||
xorg.libXinerama
|
xorg.libXinerama
|
||||||
@@ -32,8 +28,47 @@
|
|||||||
libGL
|
libGL
|
||||||
libudev-zero
|
libudev-zero
|
||||||
];
|
];
|
||||||
|
in
|
||||||
|
{
|
||||||
|
packages.${system} = {
|
||||||
|
default = self.packages.${system}.burrito;
|
||||||
|
|
||||||
runScript = "${self}/script.sh ${src}";
|
burrito = pkgs.stdenv.mkDerivation {
|
||||||
|
name = "burrito";
|
||||||
|
version = "1.0.0";
|
||||||
|
src = src;
|
||||||
|
nativeBuildInputs = [ pkgs.makeWrapper pkgs.autoPatchelfHook ];
|
||||||
|
buildInputs = deps;
|
||||||
|
runtimeDependencies = deps;
|
||||||
|
installPhase = ''
|
||||||
|
mkdir -p $out/bin $out/lib
|
||||||
|
|
||||||
|
# Copy the main executable
|
||||||
|
cp $src/burrito.x86_64 $out/bin/burrito.x86_64
|
||||||
|
chmod +x $out/bin/burrito.x86_64
|
||||||
|
|
||||||
|
# Copy the xml_converter
|
||||||
|
cp $src/xml_converter $out/bin/xml_converter
|
||||||
|
chmod +x $out/bin/xml_converter
|
||||||
|
|
||||||
|
# Copy the libraries
|
||||||
|
cp $src/*.so $out/lib/
|
||||||
|
|
||||||
|
# Patch the binary
|
||||||
|
# chmod +w $out/bin/burrito.x86_64
|
||||||
|
# patchelf --set-rpath "$out/lib:${pkgs.lib.makeLibraryPath deps}" $out/bin/burrito.x86_64
|
||||||
|
# chmod -w $out/bin/burrito.x86_64
|
||||||
|
|
||||||
|
# Create a wrapper script
|
||||||
|
makeWrapper $out/bin/burrito.x86_64 $out/bin/burrito \
|
||||||
|
--set LD_LIBRARY_PATH "$out/lib:${pkgs.lib.makeLibraryPath deps}" \
|
||||||
|
--chdir "$out/bin"
|
||||||
|
'';
|
||||||
|
meta = {
|
||||||
|
description = "Burrito Guild Wars 2 overlay";
|
||||||
|
platforms = [ "x86_64-linux" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
devShell.${system} = pkgs.mkShell {
|
devShell.${system} = pkgs.mkShell {
|
||||||
|
|||||||
Reference in New Issue
Block a user