2022-11-29 06:24:55 -07:00
|
|
|
{ stdenv, lib, buildGo119Module, fetchFromGitHub, makeWrapper, go, git, ffmpeg
|
2022-10-04 21:57:49 -06:00
|
|
|
, ... }:
|
2022-09-12 21:48:43 -06:00
|
|
|
let
|
2023-02-21 05:43:57 -07:00
|
|
|
gotosocialVersion = "0.7.1";
|
|
|
|
gtswaHash = "sha256:0k0i3qw89fq6w2akdbrbg4s3amp5hznr2b5z5dzz2jragvb8a6yx";
|
|
|
|
gtssHash = "sha256-ejAnHxXVM7+JA+DVPZKGwW/leMS6dAEvtH8iGRVig90=";
|
2022-09-12 21:48:43 -06:00
|
|
|
gotosocialWebAssets = builtins.fetchurl {
|
2022-09-12 21:53:58 -06:00
|
|
|
url =
|
|
|
|
"https://github.com/superseriousbusiness/gotosocial/releases/download/v${gotosocialVersion}/gotosocial_${gotosocialVersion}_web-assets.tar.gz";
|
2023-02-17 05:44:31 -07:00
|
|
|
sha256 = gtswaHash;
|
2022-09-12 21:48:43 -06:00
|
|
|
};
|
2022-09-12 21:53:58 -06:00
|
|
|
in with lib;
|
2022-11-29 06:24:55 -07:00
|
|
|
buildGo119Module rec {
|
2022-09-12 21:48:43 -06:00
|
|
|
pname = "gotosocial";
|
|
|
|
version = gotosocialVersion;
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "superseriousbusiness";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2023-02-17 05:44:31 -07:00
|
|
|
hash = gtssHash;
|
2022-09-12 21:48:43 -06:00
|
|
|
};
|
|
|
|
|
2022-09-19 13:36:42 -06:00
|
|
|
ldflags = [
|
|
|
|
"-s"
|
|
|
|
"-w"
|
|
|
|
"-extldflags '-static'"
|
|
|
|
"-X 'main.Commit=${version}'"
|
|
|
|
"-X 'main.Version=${version}'"
|
|
|
|
];
|
2022-09-12 21:48:43 -06:00
|
|
|
|
2022-09-19 13:36:42 -06:00
|
|
|
propagatedBuildInputs = [ ffmpeg ];
|
2022-09-12 21:48:43 -06:00
|
|
|
|
|
|
|
proxyVendor = false;
|
|
|
|
|
|
|
|
vendorSha256 = null;
|
|
|
|
|
2022-09-26 07:49:55 -06:00
|
|
|
doCheck = false;
|
|
|
|
|
2023-01-02 08:37:52 -07:00
|
|
|
preBuild = ''
|
|
|
|
echo ${go}/bin/go
|
|
|
|
${go}/bin/go version
|
2023-01-03 08:24:11 -07:00
|
|
|
'';
|
2023-01-02 08:37:52 -07:00
|
|
|
|
2022-09-12 21:48:43 -06:00
|
|
|
postInstall = ''
|
|
|
|
mkdir -p $out/assets
|
|
|
|
tar -C $out/assets/ -zxvf ${gotosocialWebAssets}
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Fast, fun, ActivityPub server, powered by Go.";
|
|
|
|
homepage = "https://github.com/superseriousbusiness/gotosocial";
|
|
|
|
license = licenses.agpl3;
|
|
|
|
maintainers = with maintainers; [ qbit ];
|
|
|
|
};
|
|
|
|
}
|