gitea: use buildGoModule
This commit is contained in:
parent
9bf79ea2f9
commit
003cbe2553
1 changed files with 10 additions and 6 deletions
|
@ -1,6 +1,6 @@
|
|||
{ lib
|
||||
, stdenv
|
||||
, buildGoPackage
|
||||
, buildGoModule
|
||||
, fetchurl
|
||||
, makeWrapper
|
||||
, git
|
||||
|
@ -13,7 +13,7 @@
|
|||
, nixosTests
|
||||
}:
|
||||
|
||||
buildGoPackage rec {
|
||||
buildGoModule rec {
|
||||
pname = "gitea";
|
||||
version = "1.18.3";
|
||||
|
||||
|
@ -23,6 +23,8 @@ buildGoPackage rec {
|
|||
hash = "sha256-jqjpbDgcmwZoc/ovgburFeeta9mAJOmz7yrvmUKAwRU=";
|
||||
};
|
||||
|
||||
vendorHash = null;
|
||||
|
||||
patches = [
|
||||
./static-root-path.patch
|
||||
];
|
||||
|
@ -31,6 +33,8 @@ buildGoPackage rec {
|
|||
substituteInPlace modules/setting/setting.go --subst-var data
|
||||
'';
|
||||
|
||||
subPackages = [ "." ];
|
||||
|
||||
nativeBuildInputs = [ makeWrapper ];
|
||||
|
||||
buildInputs = lib.optional pamSupport pam;
|
||||
|
@ -48,20 +52,20 @@ buildGoPackage rec {
|
|||
)
|
||||
'';
|
||||
|
||||
ldflags = [ "-s" "-w" ];
|
||||
|
||||
outputs = [ "out" "data" ];
|
||||
|
||||
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";
|
||||
|
||||
passthru.tests = nixosTests.gitea;
|
||||
|
||||
meta = with lib; {
|
||||
|
|
Loading…
Reference in a new issue