aboutsummaryrefslogtreecommitdiff
path: root/pkgs/applications/version-management/gogs
diff options
context:
space:
mode:
authorBob van der Linden <bobvanderlinden@gmail.com>2017-10-02 23:15:13 +0200
committerBob van der Linden <bobvanderlinden@gmail.com>2017-10-02 23:15:13 +0200
commit41c2fb3f25c31fa07ca990b35b5a0fa1980652a8 (patch)
treec3bc39c048acdc7faacd0037c379d71ec427cd00 /pkgs/applications/version-management/gogs
parent9d841295f3da4e02d7b7e87fac86b25cd1081f36 (diff)
gogs: patch gogs to include default STATIC_ROOT_PATH
Diffstat (limited to 'pkgs/applications/version-management/gogs')
-rw-r--r--pkgs/applications/version-management/gogs/default.nix7
-rw-r--r--pkgs/applications/version-management/gogs/static-root-path.patch13
2 files changed, 18 insertions, 2 deletions
diff --git a/pkgs/applications/version-management/gogs/default.nix b/pkgs/applications/version-management/gogs/default.nix
index 5553a759894a..1522f348ca1a 100644
--- a/pkgs/applications/version-management/gogs/default.nix
+++ b/pkgs/applications/version-management/gogs/default.nix
@@ -16,9 +16,12 @@ buildGoPackage rec {
sha256 = "1xn1b4dxf7r8kagps3yvp31zskfxn50k1gfic9abl4kjwpwk78c0";
};
- patchPhase = ''
+ patches = [ ./static-root-path.patch ];
+
+ postPatch = ''
patchShebangs .
- '';
+ substituteInPlace pkg/setting/setting.go --subst-var data
+ '';
nativeBuildInputs = [ makeWrapper ];
diff --git a/pkgs/applications/version-management/gogs/static-root-path.patch b/pkgs/applications/version-management/gogs/static-root-path.patch
new file mode 100644
index 000000000000..9eaa72a0c85d
--- /dev/null
+++ b/pkgs/applications/version-management/gogs/static-root-path.patch
@@ -0,0 +1,13 @@
+diff --git a/pkg/setting/setting.go b/pkg/setting/setting.go
+index f206592d..796da6ef 100644
+--- a/pkg/setting/setting.go
++++ b/pkg/setting/setting.go
+@@ -474,7 +474,7 @@ func NewContext() {
+ LocalURL = sec.Key("LOCAL_ROOT_URL").MustString(string(Protocol) + "://localhost:" + HTTPPort + "/")
+ OfflineMode = sec.Key("OFFLINE_MODE").MustBool()
+ DisableRouterLog = sec.Key("DISABLE_ROUTER_LOG").MustBool()
+- StaticRootPath = sec.Key("STATIC_ROOT_PATH").MustString(workDir)
++ StaticRootPath = sec.Key("STATIC_ROOT_PATH").MustString("@data@")
+ AppDataPath = sec.Key("APP_DATA_PATH").MustString("data")
+ EnableGzip = sec.Key("ENABLE_GZIP").MustBool()
+