diff --git a/CMakeLists.txt b/CMakeLists.txt index a6bc89f..128fd6b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -112,3 +112,5 @@ if(UNIX AND NOT APPLE) elseif(WIN32) target_link_libraries(${PROJECT_NAME} winmm) endif() + +install(TARGETS supertuxkart-editor) diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..19ef019 --- /dev/null +++ b/flake.lock @@ -0,0 +1,27 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1720691131, + "narHash": "sha256-CWT+KN8aTPyMIx8P303gsVxUnkinIz0a/Cmasz1jyIM=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "a046c1202e11b62cbede5385ba64908feb7bfac4", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-24.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..d157505 --- /dev/null +++ b/flake.nix @@ -0,0 +1,38 @@ +{ + description = "stk-editor flake"; + + inputs = { + nixpkgs.url = github:nixos/nixpkgs?ref=nixos-24.05; + }; + + outputs = + { nixpkgs + , self + } @ inputs: + let + system = "x86_64-linux"; + pkgs = nixpkgs.legacyPackages.${system}; + in + { + packages.${system}.default = pkgs.stdenv.mkDerivation { + pname = "supertuxkart-editor"; + version = "git"; + src = ./.; + nativeBuildInputs = with pkgs; [ + cmake + glew + makeWrapper + physfs + xorg.libX11 + xorg.libXxf86vm + zlib + ]; + postInstall = '' + cp -r $src/src/font -t $out/bin + ''; + preFixup = '' + wrapProgram $out/bin/supertuxkart-editor --run "cd $out/bin" + ''; + }; + }; +}