diff options
author | Peder Bergebakken Sundt <pbsds@hotmail.com> | 2024-05-21 16:45:34 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-21 16:45:34 +0200 |
commit | cc414c2bc6001bbdbdc14f01b9df242637e863bf (patch) | |
tree | 47bbe2a585b0be189d4c2bd5232843bacb7a05a4 /pkgs | |
parent | ddb221c5082bba6cbfcfbe5338ae51934b70c796 (diff) | |
parent | 4903f64bcddf766edf72fbc9f496e95a8e59f0ba (diff) |
Merge pull request #305728 from TomaSajt/gcs
gcs: 5.20.4 -> 5.21.0
Diffstat (limited to 'pkgs')
-rw-r--r-- | pkgs/by-name/gc/gcs/package.nix | 106 |
1 files changed, 65 insertions, 41 deletions
diff --git a/pkgs/by-name/gc/gcs/package.nix b/pkgs/by-name/gc/gcs/package.nix index 1493836491af..e8d9a337f04a 100644 --- a/pkgs/by-name/gc/gcs/package.nix +++ b/pkgs/by-name/gc/gcs/package.nix @@ -1,32 +1,32 @@ -{ lib -, buildGoModule -, fetchFromGitHub -, pkg-config -, moreutils -, libGL -, libX11 -, libXcursor -, libXrandr -, libXinerama -, libXi -, libXxf86vm -, mupdf -, fontconfig -, freetype -, stdenv -, darwin -, nix-update-script +{ + lib, + buildGoModule, + buildNpmPackage, + fetchFromGitHub, + pkg-config, + libGL, + libX11, + libXcursor, + libXrandr, + libXinerama, + libXi, + libXxf86vm, + mupdf, + fontconfig, + freetype, + stdenv, + darwin, }: buildGoModule rec { pname = "gcs"; - version = "5.20.4"; + version = "5.21.0"; src = fetchFromGitHub { owner = "richardwilkes"; repo = "gcs"; rev = "v${version}"; - hash = "sha256-aoU2wRz2XB6+3e6am/dLjRbcDmWTjtDtTBwc6c4n3DE="; + hash = "sha256-mes1aXh4R1re4sW3xYDWtSIcW7lwkWoAxbcbdyT/W+o="; }; modPostBuild = '' @@ -34,30 +34,56 @@ buildGoModule rec { sed -i 's|-lmupdf[^ ]* |-lmupdf |g' vendor/github.com/richardwilkes/pdf/pdf.go ''; - vendorHash = "sha256-ee6qvwnUXtsBcovPOORfVpdndICtIUYe4GrP52V/P3k="; + vendorHash = "sha256-H5GCrrqmDwpCneXawu7kZsRfrQ8hcsbqhpAAG6FCawg="; - nativeBuildInputs = [ pkg-config moreutils ]; + frontend = buildNpmPackage { + name = "${pname}-${version}-frontend"; - buildInputs = [ - libGL - libX11 - libXcursor - libXrandr - 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 - ]; + inherit src; + sourceRoot = "${src.name}/server/frontend"; + + npmDepsHash = "sha256-wP6sjdcjljzmTs0GUMbF2BPo83LKpfdn15sUuMEIn6E="; + + installPhase = '' + runHook preInstall + mkdir -p $out + cp -r dist $out/dist + runHook postInstall + ''; + }; + + postPatch = '' + cp -r ${frontend}/dist server/frontend/dist + ''; + + nativeBuildInputs = [ pkg-config ]; + + buildInputs = + [ + libGL + libX11 + libXcursor + libXrandr + 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 + ]; # flags are based on https://github.com/richardwilkes/gcs/blob/master/build.sh flags = [ "-a" ]; - ldflags = [ "-s" "-w" "-X github.com/richardwilkes/toolbox/cmdline.AppVersion=${version}" ]; + ldflags = [ + "-s" + "-w" + "-X github.com/richardwilkes/toolbox/cmdline.AppVersion=${version}" + ]; installPhase = '' runHook preInstall @@ -65,8 +91,6 @@ buildGoModule rec { runHook postInstall ''; - passthru.updateScript = nix-update-script { }; - meta = { changelog = "https://github.com/richardwilkes/gcs/releases/tag/${src.rev}"; description = "A stand-alone, interactive, character sheet editor for the GURPS 4th Edition roleplaying game system"; |