forgejo: use buildGoModule
This commit is contained in:
parent
4d52a644a7
commit
f37a8bd339
1 changed files with 12 additions and 8 deletions
|
@ -1,18 +1,18 @@
|
|||
{ lib
|
||||
, stdenv
|
||||
, buildGoPackage
|
||||
, buildGoModule
|
||||
, fetchurl
|
||||
, makeWrapper
|
||||
, git
|
||||
, bash
|
||||
, gzip
|
||||
, openssh
|
||||
, gzip
|
||||
, pam
|
||||
, pamSupport ? true
|
||||
, sqliteSupport ? true
|
||||
}:
|
||||
|
||||
buildGoPackage rec {
|
||||
buildGoModule rec {
|
||||
pname = "forgejo";
|
||||
version = "1.18.2-1";
|
||||
|
||||
|
@ -23,10 +23,13 @@ buildGoPackage rec {
|
|||
hash = "sha256-XSh17AwPtC+Y24lgjjXJzT/uBHg+0hWZ2RZ/eNF4mCY=";
|
||||
};
|
||||
|
||||
vendorHash = null;
|
||||
|
||||
subPackages = [ "." ];
|
||||
|
||||
outputs = [ "out" "data" ];
|
||||
|
||||
nativeBuildInputs = [ makeWrapper ];
|
||||
|
||||
buildInputs = lib.optional pamSupport pam;
|
||||
|
||||
patches = [
|
||||
|
@ -39,22 +42,23 @@ buildGoPackage rec {
|
|||
|
||||
tags = lib.optional pamSupport "pam"
|
||||
++ lib.optionals sqliteSupport [ "sqlite" "sqlite_unlock_notify" ];
|
||||
|
||||
ldflags = [
|
||||
"-s"
|
||||
"-w"
|
||||
"-X main.Version=${version}"
|
||||
"-X 'main.Tags=${lib.concatStringsSep " " tags}'"
|
||||
];
|
||||
|
||||
postInstall = ''
|
||||
mkdir $data
|
||||
cp -R ./go/src/${goPackagePath}/{public,templates,options} $data
|
||||
cp -R ./{public,templates,options} $data
|
||||
mkdir -p $out
|
||||
cp -R ./go/src/${goPackagePath}/options/locale $out/locale
|
||||
cp -R ./options/locale $out/locale
|
||||
wrapProgram $out/bin/gitea \
|
||||
--prefix PATH : ${lib.makeBinPath [ bash git gzip openssh ]}
|
||||
'';
|
||||
|
||||
goPackagePath = "code.gitea.io/gitea";
|
||||
|
||||
meta = with lib; {
|
||||
description = "A self-hosted lightweight software forge";
|
||||
homepage = "https://forgejo.org";
|
||||
|
|
Loading…
Reference in a new issue