about summary refs log tree commit diff
path: root/pkgs/by-name/gc/gcs/package.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/by-name/gc/gcs/package.nix')
-rw-r--r--pkgs/by-name/gc/gcs/package.nix46
1 files changed, 31 insertions, 15 deletions
diff --git a/pkgs/by-name/gc/gcs/package.nix b/pkgs/by-name/gc/gcs/package.nix
index 954128a40ba1..3aab48bd4896 100644
--- a/pkgs/by-name/gc/gcs/package.nix
+++ b/pkgs/by-name/gc/gcs/package.nix
@@ -1,8 +1,11 @@
 {
   lib,
+  stdenv,
   buildGoModule,
   buildNpmPackage,
   fetchFromGitHub,
+  cacert,
+  unzip,
   pkg-config,
   libGL,
   libX11,
@@ -14,19 +17,33 @@
   mupdf,
   fontconfig,
   freetype,
-  stdenv,
-  darwin,
+  apple-sdk_11,
 }:
 
 buildGoModule rec {
   pname = "gcs";
-  version = "5.21.0";
+  version = "5.27.0";
 
   src = fetchFromGitHub {
     owner = "richardwilkes";
     repo = "gcs";
-    rev = "v${version}";
-    hash = "sha256-mes1aXh4R1re4sW3xYDWtSIcW7lwkWoAxbcbdyT/W+o=";
+    rev = "refs/tags/v${version}";
+
+    nativeBuildInputs = [
+      cacert
+      unzip
+    ];
+
+    # also fetch pdf.js files
+    # note: the version is locked in the file
+    postFetch = ''
+      cd $out/server/pdf
+      substituteInPlace refresh-pdf.js.sh \
+          --replace-fail '/bin/rm' 'rm'
+      . refresh-pdf.js.sh
+    '';
+
+    hash = "sha256-QVkyemBQ7RrV3dpP3n7Pg0XljdxWtCphZIj2T77nKtU=";
   };
 
   modPostBuild = ''
@@ -34,15 +51,14 @@ buildGoModule rec {
     sed -i 's|-lmupdf[^ ]* |-lmupdf |g' vendor/github.com/richardwilkes/pdf/pdf.go
   '';
 
-  vendorHash = "sha256-H5GCrrqmDwpCneXawu7kZsRfrQ8hcsbqhpAAG6FCawg=";
+  vendorHash = "sha256-+vCc1g5noAl/iwEYhNZJYPiScKqKGKlsuruoUO/4tiU=";
 
   frontend = buildNpmPackage {
     name = "${pname}-${version}-frontend";
 
     inherit src;
     sourceRoot = "${src.name}/server/frontend";
-
-    npmDepsHash = "sha256-wP6sjdcjljzmTs0GUMbF2BPo83LKpfdn15sUuMEIn6E=";
+    npmDepsHash = "sha256-VWTJg/pluRYVVBDiJ+t2uhyodRuIFfHpzCZMte1krDM=";
 
     installPhase = ''
       runHook preInstall
@@ -60,6 +76,9 @@ buildGoModule rec {
 
   buildInputs =
     [
+      mupdf
+    ]
+    ++ lib.optionals stdenv.hostPlatform.isLinux [
       libGL
       libX11
       libXcursor
@@ -67,14 +86,11 @@ buildGoModule rec {
       libXinerama
       libXi
       libXxf86vm
-      mupdf
       fontconfig
       freetype
     ]
-    ++ lib.optionals stdenv.isDarwin [
-      darwin.apple_sdk_11_0.frameworks.Carbon
-      darwin.apple_sdk_11_0.frameworks.Cocoa
-      darwin.apple_sdk_11_0.frameworks.Kernel
+    ++ lib.optionals stdenv.hostPlatform.isDarwin [
+      apple-sdk_11
     ];
 
   # flags are based on https://github.com/richardwilkes/gcs/blob/master/build.sh
@@ -92,7 +108,7 @@ buildGoModule rec {
   '';
 
   meta = {
-    changelog = "https://github.com/richardwilkes/gcs/releases/tag/${src.rev}";
+    changelog = "https://github.com/richardwilkes/gcs/releases/tag/v${version}";
     description = "Stand-alone, interactive, character sheet editor for the GURPS 4th Edition roleplaying game system";
     homepage = "https://gurpscharactersheet.com/";
     license = lib.licenses.mpl20;
@@ -100,6 +116,6 @@ buildGoModule rec {
     maintainers = with lib.maintainers; [ tomasajt ];
     platforms = lib.platforms.linux ++ lib.platforms.darwin;
     # incompatible vendor/github.com/richardwilkes/unison/internal/skia/libskia_linux.a
-    broken = stdenv.isLinux && stdenv.isAarch64;
+    broken = stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64;
   };
 }