diff --git a/LICENSE b/LICENSE index 725b179..26b02a3 100644 --- a/LICENSE +++ b/LICENSE @@ -1,9 +1,7 @@ -MIT License - Copyright (c) 2024 qenya Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/README.md b/README.md index 5e20558..128efde 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,3 @@ # nix-scoutshonour -Nix derivations for freeware games by Christine Love \ No newline at end of file +Nix derivations for freeware games by Christine Love diff --git a/default.nix b/default.nix new file mode 100644 index 0000000..e287af0 --- /dev/null +++ b/default.nix @@ -0,0 +1,6 @@ +{ pkgs ? import { } }: + +{ + digital-a-love-story = pkgs.pkgsi686Linux.callPackage ./packages/digital-a-love-story { }; + dont-take-it-personally-babe = pkgs.pkgsi686Linux.callPackage ./packages/dont-take-it-personally-babe { }; +} diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..ad56595 --- /dev/null +++ b/flake.lock @@ -0,0 +1,27 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1734649271, + "narHash": "sha256-4EVBRhOjMDuGtMaofAIqzJbg4Ql7Ai0PSeuVZTHjyKQ=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "d70bd19e0a38ad4790d3913bf08fcbfc9eeca507", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "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..f3bb530 --- /dev/null +++ b/flake.nix @@ -0,0 +1,26 @@ +{ + description = "Freeware games by Christine Love"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + }; + + outputs = { self, nixpkgs }: + let + systems = [ "x86_64-linux" "i686-linux" ]; + forAllSystems = nixpkgs.lib.genAttrs systems; + in + { + packages = forAllSystems (system: import ./default.nix { + pkgs = nixpkgs.legacyPackages."${system}"; + }); + + legacyPackages = forAllSystems (system: import ./default.nix { + pkgs = import nixpkgs { inherit system; }; + }); + + overlays.default = final: prev: { + scoutshonour = import ./default.nix { pkgs = final; }; + }; + }; +} diff --git a/packages/digital-a-love-story/default.nix b/packages/digital-a-love-story/default.nix new file mode 100644 index 0000000..657317e --- /dev/null +++ b/packages/digital-a-love-story/default.nix @@ -0,0 +1,69 @@ +{ stdenv +, lib +, fetchzip +, zlib +, autoPatchelfHook +, xorg +, libpulseaudio +, alsa-lib +}: + +stdenv.mkDerivation rec { + pname = "digital-a-love-story"; + version = "1.1"; + + src = fetchzip { + url = "https://www.scoutshonour.com/lilyofthevalley/digital-${version}.tar.bz2"; + sha256 = "+7KcZ8dKts1AoKWNfHMKIt+w2fBFIAcnkuAtzSw49xk="; + }; + + nativeBuildInputs = [ + autoPatchelfHook + ]; + + buildInputs = [ + zlib + ]; + + appendRunpaths = [ + "${xorg.libX11}/lib" + "${xorg.libXext}/lib" + "${xorg.libXrender}/lib" + "${xorg.libXrandr}/lib" + "${xorg.libXcursor}/lib" + "${libpulseaudio}/lib" + "${alsa-lib}/lib" + ]; + + sourceRoot = "."; + + dontConfigure = true; + dontBuild = true; + + installPhase = '' + runHook preInstall + + # copy distributed files + mkdir -p $out/opt/digital + cp -R source/* $out/opt/digital + + # add launcher + mkdir -p $out/bin + substituteAll ${./launcher.sh} $out/bin/digital + chmod +x $out/bin/digital + + # add desktop file + mkdir -p $out/share/applications + substituteAll ${./digital.desktop} $out/share/applications/digital.desktop + + runHook postInstall + ''; + + meta = with lib; { + homepage = "https://scoutshonour.com/digital/"; + description = "Digital: A Love Story, a freeware game by Christine Love"; + license = licenses.cc-by-nc-sa-30; + platforms = lists.intersectLists platforms.x86 platforms.linux; + mainProgram = "digital"; + }; +} diff --git a/packages/digital-a-love-story/digital.desktop b/packages/digital-a-love-story/digital.desktop new file mode 100644 index 0000000..c540fe5 --- /dev/null +++ b/packages/digital-a-love-story/digital.desktop @@ -0,0 +1,6 @@ +[Desktop Entry] +Name=Digital: A Love Story +Exec=@out@/bin/digital +Icon=@out@/opt/digital/game/icon.png +Type=Application +Categories=Game; \ No newline at end of file diff --git a/packages/digital-a-love-story/launcher.sh b/packages/digital-a-love-story/launcher.sh new file mode 100644 index 0000000..5216916 --- /dev/null +++ b/packages/digital-a-love-story/launcher.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +exec "@out@/opt/digital/lib/python" "-OO" "@out@/opt/digital/Digital.py" "$@" \ No newline at end of file diff --git a/packages/dont-take-it-personally-babe/default.nix b/packages/dont-take-it-personally-babe/default.nix new file mode 100644 index 0000000..ad0d11b --- /dev/null +++ b/packages/dont-take-it-personally-babe/default.nix @@ -0,0 +1,76 @@ +{ stdenv +, lib +, fetchzip +, zlib +, xorg +, libglvnd +, libGLU +, autoPatchelfHook +, libpulseaudio +, alsa-lib +}: + +stdenv.mkDerivation rec { + pname = "dont-take-it-personally-babe"; + version = "1.1"; + + src = fetchzip { + url = "https://scoutshonour.com/donttakeitpersonallybabeitjustaintyourstory/don't%20take%20it%20personally,%20babe-${version}-linux-x86.tar.bz2"; + sha256 = "X1xAJS8SrsQ5yrValrlfmeRLtSiH94EUw++GWjstwdc="; + }; + + nativeBuildInputs = [ + autoPatchelfHook + ]; + + buildInputs = [ + zlib + xorg.libX11 + xorg.libXext + libglvnd + libGLU + xorg.libXi + xorg.libXmu + ]; + + appendRunpaths = [ + "${xorg.libX11}/lib" + "${xorg.libXext}/lib" + "${xorg.libXrender}/lib" + "${xorg.libXrandr}/lib" + "${libpulseaudio}/lib" + "${alsa-lib}/lib" + ]; + + sourceRoot = "."; + + dontConfigure = true; + dontBuild = true; + + installPhase = '' + runHook preInstall + + # copy distributed files + mkdir -p $out/opt/donttakeitpersonallybabeitjustaintyourstory + cp -R source/* $out/opt/donttakeitpersonallybabeitjustaintyourstory + + # add launcher + mkdir -p $out/bin + substituteAll ${./launcher.sh} $out/bin/donttakeitpersonallybabeitjustaintyourstory + chmod +x $out/bin/donttakeitpersonallybabeitjustaintyourstory + + # add desktop file + mkdir -p $out/share/applications + substituteAll ${./donttakeitpersonallybabeitjustaintyourstory.desktop} $out/share/applications/donttakeitpersonallybabeitjustaintyourstory.desktop + + runHook postInstall + ''; + + meta = with lib; { + homepage = "https://scoutshonour.com/donttakeitpersonallybabeitjustaintyourstory/"; + description = "don't take it personally, babe, it just ain't your story: a freeware game by Christine Love"; + license = licenses.cc-by-nc-sa-30; + platforms = lists.intersectLists platforms.x86 platforms.linux; + mainProgram = "donttakeitpersonallybabeitjustaintyourstory"; + }; +} diff --git a/packages/dont-take-it-personally-babe/donttakeitpersonallybabeitjustaintyourstory.desktop b/packages/dont-take-it-personally-babe/donttakeitpersonallybabeitjustaintyourstory.desktop new file mode 100644 index 0000000..879b8ca --- /dev/null +++ b/packages/dont-take-it-personally-babe/donttakeitpersonallybabeitjustaintyourstory.desktop @@ -0,0 +1,6 @@ +[Desktop Entry] +Name=don't take it personally, babe, it just ain't your story +Exec=@out@/bin/donttakeitpersonallybabeitjustaintyourstory +Icon=@out@/opt/donttakeitpersonallybabeitjustaintyourstory/game/icon256x256.png +Type=Application +Categories=Game; \ No newline at end of file diff --git a/packages/dont-take-it-personally-babe/launcher.sh b/packages/dont-take-it-personally-babe/launcher.sh new file mode 100644 index 0000000..77c91f5 --- /dev/null +++ b/packages/dont-take-it-personally-babe/launcher.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +exec "@out@/opt/donttakeitpersonallybabeitjustaintyourstory/lib/python" "-OO" "@out@/opt/donttakeitpersonallybabeitjustaintyourstory/don't take it personally, babe.py" "$@" \ No newline at end of file