From 808ad19a0c1817bac959f3324819fbf166559980 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tristan=20Dani=C3=ABl=20Maat?= Date: Wed, 13 Mar 2024 01:11:21 +0100 Subject: [PATCH] gcs: Write working package --- home-config/config/personal/default.nix | 11 ++++- pkgs/_sources/generated.json | 20 ++++++++ pkgs/_sources/generated.nix | 11 +++++ pkgs/applications/gcs.nix | 65 +++++++++++++++++++++++++ pkgs/default.nix | 1 + pkgs/nvfetcher.toml | 4 ++ 6 files changed, 110 insertions(+), 2 deletions(-) create mode 100644 pkgs/applications/gcs.nix diff --git a/home-config/config/personal/default.nix b/home-config/config/personal/default.nix index a3ef7bd8..8e5517a5 100644 --- a/home-config/config/personal/default.nix +++ b/home-config/config/personal/default.nix @@ -1,9 +1,16 @@ -{pkgs, ...}: { +{ + flake-inputs, + pkgs, + ... +}: { imports = [ ./ssh-servers.nix ]; - home.packages = with pkgs; [prismlauncher]; + home.packages = with pkgs; [ + prismlauncher + flake-inputs.self.packages.${pkgs.system}.gcs + ]; programs.firefox.enableThirdPartyRepositories = true; programs.git = { diff --git a/pkgs/_sources/generated.json b/pkgs/_sources/generated.json index 95ba1a5c..5bcb7725 100644 --- a/pkgs/_sources/generated.json +++ b/pkgs/_sources/generated.json @@ -94,6 +94,26 @@ }, "version": "v1.3.0" }, + "gcs": { + "cargoLocks": null, + "date": null, + "extract": null, + "name": "gcs", + "passthru": null, + "pinned": false, + "src": { + "deepClone": false, + "fetchSubmodules": false, + "leaveDotGit": false, + "name": null, + "owner": "richardwilkes", + "repo": "gcs", + "rev": "v5.20.4", + "sha256": "sha256-aoU2wRz2XB6+3e6am/dLjRbcDmWTjtDtTBwc6c4n3DE=", + "type": "github" + }, + "version": "v5.20.4" + }, "ohmyzsh": { "cargoLocks": null, "date": "2024-03-21", diff --git a/pkgs/_sources/generated.nix b/pkgs/_sources/generated.nix index 0731ef62..ea398ff2 100644 --- a/pkgs/_sources/generated.nix +++ b/pkgs/_sources/generated.nix @@ -54,6 +54,17 @@ sha256 = "sha256-GU6HKha7Y01HJX6pyYHORUkFKgl9mWtDd65d+3pYxjI="; }; }; + gcs = { + pname = "gcs"; + version = "v5.20.4"; + src = fetchFromGitHub { + owner = "richardwilkes"; + repo = "gcs"; + rev = "v5.20.4"; + fetchSubmodules = false; + sha256 = "sha256-aoU2wRz2XB6+3e6am/dLjRbcDmWTjtDtTBwc6c4n3DE="; + }; + }; ohmyzsh = { pname = "ohmyzsh"; version = "d157fc60c93fa59e757921b503e9594bd23b422c"; diff --git a/pkgs/applications/gcs.nix b/pkgs/applications/gcs.nix new file mode 100644 index 00000000..d956a5e2 --- /dev/null +++ b/pkgs/applications/gcs.nix @@ -0,0 +1,65 @@ +{ + pkgs, + sources, + buildGoModule, +}: +buildGoModule { + inherit (sources.gcs) pname version src; + + overrideModAttrs = _: { + postBuild = '' + sed 's/lmupdf_linux_amd64/lmupdf/' -i ./vendor/github.com/richardwilkes/pdf/pdf.go + ''; + }; + + RELEASE = sources.gcs.version; + DIST = 1; + + ldflags = [ + "-X" + "github.com/richardwilkes/toolbox/cmdline.AppVersion=${sources.gcs.version}" + "-s" + "-w" + ]; + + nativeBuildInputs = with pkgs; [ + pkg-config + ]; + + buildInputs = with pkgs; [ + libGL + fontconfig + freetype + mupdf + + xorg.libX11 + xorg.libXcursor + xorg.libXrandr + xorg.libXinerama + xorg.libXi + xorg.libXxf86vm + ]; + + postInstall = let + # TODO(tlater): Add mimetypes + desktop = '' + [Desktop Entry] + Name=GCS + Comment=GCS (GURPS Character Sheet) is a stand-alone, interactive, character sheet editor that allows you to build characters for the GURPS 4th Edition roleplaying game system. + Exec=gcs + Icon=gcs + Terminal=false + Type=Application + Catgories=Game;Utility;RolePlaying + ''; + in '' + mkdir -p $out/share/{applications,icons/hicolor/1024x1024/apps} + echo -n '${desktop}' > $out/share/applications/com.trollworks.gcs.desktop + cp packaging/internal/embedded/app-1024.png $out/share/icons/hicolor/1024x1024/apps/gcs.png + + rm $out/bin/{gen,packaging,scr} + ''; + + vendorHash = "sha256-7uIS/Q+xwUYcdaqzXffZUUFWJ/WOGpYdDnNRHQ4UIaU="; + meta.mainProgram = "${sources.gcs.pname}"; +} diff --git a/pkgs/default.nix b/pkgs/default.nix index bbb56a7c..1a862774 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -22,6 +22,7 @@ in { drivestrike = callPackage ./applications/drivestrike.nix {}; emacs = callPackage ./applications/emacs {}; gauth = callPackage ./applications/gauth.nix {}; + gcs = callPackage ./applications/gcs.nix {}; stumpwm = callPackage ./applications/stumpwm {}; stumpwm-contrib = callPackage ./applications/stumpwm/stumpwm-contrib.nix {}; nextcloudcmd = callPackage ./applications/nextcloudcmd.nix {}; diff --git a/pkgs/nvfetcher.toml b/pkgs/nvfetcher.toml index c5974a49..4a730026 100644 --- a/pkgs/nvfetcher.toml +++ b/pkgs/nvfetcher.toml @@ -20,6 +20,10 @@ fetch.github = "black7375/Firefox-UI-Fix" src.github_tag = "pcarrier/gauth" fetch.github = "pcarrier/gauth" +[gcs] +src.github = "richardwilkes/gcs" +fetch.github = "richardwilkes/gcs" + [ohmyzsh] src.git = "https://github.com/ohmyzsh/ohmyzsh" src.branch = "master"