Skip to content

Commit

Permalink
init: gokapi at 1.9.6
Browse files Browse the repository at this point in the history
  • Loading branch information
delliottxyz committed Jan 11, 2025
1 parent 037cf30 commit 9fad7e4
Showing 1 changed file with 71 additions and 0 deletions.
71 changes: 71 additions & 0 deletions pkgs/by-name/go/gokapi/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
{
lib,
buildGoModule,
fetchFromGitHub,
nixosTests,
nix-update-script,
versionCheckHook,
}:

buildGoModule rec {
pname = "gokapi";
version = "1.9.6";

src = fetchFromGitHub {
owner = "Forceu";
repo = "Gokapi";
tag = "v${version}";
hash = "sha256-RDEvKh3tUun7wt1nhtCim95wEN9V9RlztZ9zcw9nS1o=";
};

vendorHash = "sha256-9GRAlgng+yq7q0VQz374jIOCjeDIIDD631BglM/FsQQ=";

preBuild = ''
# This is the go generate is ran in the upstream builder, but we have to run the components seperately for things to work.
# go generate ./...
# Hopefully at some point this is no longer necessary
# Enter package dir, to match behaviour of go:generate
cd ./cmd/gokapi/
go run "../../build/go-generate/updateVersionNumbers.go"
# Ran by go-generate, but breaks build in nix
# As it tries to download "golang.org/x/exp/slices"
# go run "../../build/go-generate/updateProtectedUrls.go"
go run "../../build/go-generate/buildWasm.go"
# Must specify go root to import wasm_exec.js
GOROOT="$(go env GOROOT)" go run "../../build/go-generate/copyStaticFiles.go"
# Return to toplevel before build
cd ../..
'';

subPackages = [
"cmd/gokapi"
];

ldflags = [
"-s"
"-w"
];

nativeInstallCheckInputs = [ versionCheckHook ];
versionCheckProgramArg = "--version";
doInstallCheck = true;

passthru = {
tests = {
inherit (nixosTests) gokapi;
};
updateScript = nix-update-script { };
};

meta = {
description = "Lightweight selfhosted Firefox Send alternative without public upload. AWS S3 supported";
homepage = "https://github.com/Forceu/Gokapi";
changelog = "https://github.com/Forceu/Gokapi/releases/tag/v${version}";
license = lib.licenses.agpl3Only;
maintainers = with lib.maintainers; [
delliott
];
mainProgram = "gokapi";
};
}

0 comments on commit 9fad7e4

Please sign in to comment.