From 48cb1ea542b35e01bf93cc9cd51b1f256e176f7e Mon Sep 17 00:00:00 2001 From: Donovan Glover Date: Thu, 8 Jun 2023 18:30:11 -0400 Subject: [PATCH] packages: Use srb2 from fork --- flake.lock | 17 ++++++ flake.nix | 1 + packages/srb2/cmake.patch | 19 ------- packages/srb2/default.nix | 112 -------------------------------------- src/main.nix | 3 +- 5 files changed, 20 insertions(+), 132 deletions(-) delete mode 100644 packages/srb2/cmake.patch delete mode 100644 packages/srb2/default.nix diff --git a/flake.lock b/flake.lock index 1a1a24f..30f815d 100644 --- a/flake.lock +++ b/flake.lock @@ -395,6 +395,22 @@ "type": "github" } }, + "nixpkgs-srb2": { + "locked": { + "lastModified": 1686161408, + "narHash": "sha256-+zLyuXX949OO4fQwa6AqTTHr8RSfBdHlMIq1AJuy+5I=", + "owner": "donovanglover", + "repo": "nixpkgs", + "rev": "97b52a7a806da410d171a755459fba17e39fcfed", + "type": "github" + }, + "original": { + "owner": "donovanglover", + "ref": "srb2", + "repo": "nixpkgs", + "type": "github" + } + }, "root": { "inputs": { "crystal-flake": "crystal-flake", @@ -405,6 +421,7 @@ "nixpkgs": "nixpkgs", "nixpkgs-hyprland-autoname-workspaces": "nixpkgs-hyprland-autoname-workspaces", "nixpkgs-master": "nixpkgs-master", + "nixpkgs-srb2": "nixpkgs-srb2", "stylix": "stylix" } }, diff --git a/flake.nix b/flake.nix index 6798e5b..4bc0d38 100644 --- a/flake.nix +++ b/flake.nix @@ -30,6 +30,7 @@ nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; nixpkgs-master.url = "github:NixOS/nixpkgs/master"; nixpkgs-hyprland-autoname-workspaces.url = "github:donovanglover/nixpkgs/hyprland-autoname-workspaces"; + nixpkgs-srb2.url = "github:donovanglover/nixpkgs/srb2"; home-manager = { url = "github:nix-community/home-manager/master"; diff --git a/packages/srb2/cmake.patch b/packages/srb2/cmake.patch deleted file mode 100644 index adb070a..0000000 --- a/packages/srb2/cmake.patch +++ /dev/null @@ -1,19 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 915912af5..f5c2cf9cc 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -91,11 +91,6 @@ if("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL Windows) - endif() - endif() - else() -- CPMAddPackage( -- NAME Ccache.cmake -- GITHUB_REPOSITORY TheLartians/Ccache.cmake -- VERSION 1.2 -- ) - endif() - - # Dependencies --- -2.40.1 - diff --git a/packages/srb2/default.nix b/packages/srb2/default.nix deleted file mode 100644 index 7c822c2..0000000 --- a/packages/srb2/default.nix +++ /dev/null @@ -1,112 +0,0 @@ -{ - lib, - stdenv, - fetchurl, - fetchFromGitHub, - cmake, - curl, - nasm, - libopenmpt, - p7zip, - libgme, - libpng, - SDL2, - SDL2_mixer, - zlib, - unzip, - makeWrapper, - makeDesktopItem, - copyDesktopItems, -}: let - version = "2.2.11"; - - # Normal assets found on the official release - assets = stdenv.mkDerivation rec { - pname = "srb2-data"; - inherit version; - nativeBuildInputs = [unzip]; - src = fetchurl { - url = "https://github.com/STJr/SRB2/releases/download/SRB2_release_${version}/SRB2-v${lib.replaceStrings ["."] [""] version}-Full.zip"; - sha256 = "sha256-KsJIkCczD/HyIwEy5dI3zsHbWFCMBaCoCHizfupFoWM="; - }; - sourceRoot = "."; - installPhase = '' - mkdir -p $out/share/srb2 - cp -r *pk3 *dta *dat models/ $out/share/srb2/ - ''; - }; -in - stdenv.mkDerivation rec { - pname = "srb2"; - inherit version; - - src = fetchFromGitHub { - owner = "STJr"; - repo = "SRB2"; - rev = "SRB2_release_${version}"; - sha256 = "sha256-tyiXivJWjNnL+4YynUV6k6iaMs8o9HkHrp+qFj2+qvQ="; - }; - - nativeBuildInputs = [ - cmake - nasm - p7zip - makeWrapper - copyDesktopItems - ]; - - buildInputs = [ - curl - libgme - libpng - libopenmpt - SDL2 - SDL2_mixer - zlib - ]; - - cmakeFlags = [ - "-DSRB2_ASSET_DIRECTORY=${assets}/share/srb2" - "-DGME_INCLUDE_DIR=${libgme}/include" - "-DOPENMPT_INCLUDE_DIR=${libopenmpt.dev}/include" - "-DSDL2_MIXER_INCLUDE_DIR=${lib.getDev SDL2_mixer}/include/SDL2" - "-DSDL2_INCLUDE_DIR=${lib.getDev SDL2.dev}/include/SDL2" - ]; - - patches = [ - ./cmake.patch - ]; - - # Desktop icon - desktopItems = [ - (makeDesktopItem rec { - name = "Sonic Robo Blast 2"; - exec = pname; - icon = pname; - comment = meta.description; - desktopName = name; - genericName = name; - categories = ["Game"]; - }) - ]; - - installPhase = '' - mkdir -p $out/bin $out/share/applications $out/share/pixmaps $out/share/icons - - copyDesktopItems - - cp ../srb2.png $out/share/pixmaps/. - cp ../srb2.png $out/share/icons/. - - cp bin/lsdlsrb2 $out/bin/srb2 - wrapProgram $out/bin/srb2 --set SRB2WADDIR "${assets}/share/srb2" - ''; - - meta = with lib; { - description = "Sonic Robo Blast 2 is a 3D Sonic the Hedgehog fangame based on a modified version of Doom Legacy"; - homepage = "https://www.srb2.org/"; - platforms = platforms.linux; - license = licenses.gpl2Plus; - maintainers = with maintainers; [zeratax]; - }; - } diff --git a/src/main.nix b/src/main.nix index 702b95e..dd10508 100644 --- a/src/main.nix +++ b/src/main.nix @@ -6,6 +6,7 @@ crystal-flake, nixpkgs-hyprland-autoname-workspaces, nixpkgs-master, + nixpkgs-srb2, ... }: let VARIABLES = import ./variables.nix; @@ -64,7 +65,6 @@ in { crystal-flake.packages.${VARIABLES.system}.crystal crystal-flake.packages.${VARIABLES.system}.crystalline nixpkgs-master.legacyPackages.${VARIABLES.system}.waycorner - (pkgs.callPackage ../packages/srb2 {}) slade typespeed osu-lazer-bin @@ -184,6 +184,7 @@ in { kickoff greetd.tuigreet nixpkgs-hyprland-autoname-workspaces.legacyPackages.${VARIABLES.system}.hyprland-autoname-workspaces + nixpkgs-srb2.legacyPackages.${VARIABLES.system}.srb2 ]; nixpkgs.config.allowUnfreePredicate = pkg: