-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: phanirithvij <[email protected]>
- Loading branch information
1 parent
5c44f6f
commit 2a55440
Showing
2 changed files
with
69 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
@ ["packages","","dependencies"] | ||
+ {"esbuild":"^0.18.20"} | ||
@ ["packages","node_modules/@esbuild/linux-x64","dev"] | ||
- true | ||
@ ["packages","node_modules/esbuild","dev"] | ||
- true | ||
@ ["packages","node_modules/@esbuild/android-arm"] | ||
+ {"cpu":["arm"],"engines":{"node":"\u003e=12"},"integrity":"sha512-fyi7TDI/ijKKNZTUJAQqiG5T7YjJXgnzkURqmGj13C6dCqckZBLdl4h7bkhHt/t0WP+zO9/zwroDvANaOqO5Sw==","license":"MIT","optional":true,"os":["android"],"resolved":"https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.18.20.tgz","version":"0.18.20"} | ||
@ ["packages","node_modules/@esbuild/android-arm64"] | ||
+ {"cpu":["arm64"],"engines":{"node":"\u003e=12"},"integrity":"sha512-Nz4rJcchGDtENV0eMKUNa6L12zz2zBDXuhj/Vjh18zGqB44Bi7MBMSXjgunJgjRhCmKOjnPuZp4Mb6OKqtMHLQ==","license":"MIT","optional":true,"os":["android"],"resolved":"https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.18.20.tgz","version":"0.18.20"} | ||
@ ["packages","node_modules/@esbuild/android-x64"] | ||
+ {"cpu":["x64"],"engines":{"node":"\u003e=12"},"integrity":"sha512-8GDdlePJA8D6zlZYJV/jnrRAi6rOiNaCC/JclcXpB+KIuvfBN4owLtgzY2bsxnx666XjJx2kDPUmnTtR8qKQUg==","license":"MIT","optional":true,"os":["android"],"resolved":"https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.18.20.tgz","version":"0.18.20"} | ||
@ ["packages","node_modules/@esbuild/darwin-arm64"] | ||
+ {"cpu":["arm64"],"engines":{"node":"\u003e=12"},"integrity":"sha512-bxRHW5kHU38zS2lPTPOyuyTm+S+eobPUnTNkdJEfAddYgEcll4xkT8DB9d2008DtTbl7uJag2HuE5NZAZgnNEA==","license":"MIT","optional":true,"os":["darwin"],"resolved":"https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.18.20.tgz","version":"0.18.20"} | ||
@ ["packages","node_modules/@esbuild/darwin-x64"] | ||
+ {"cpu":["x64"],"engines":{"node":"\u003e=12"},"integrity":"sha512-pc5gxlMDxzm513qPGbCbDukOdsGtKhfxD1zJKXjCCcU7ju50O7MeAZ8c4krSJcOIJGFR+qx21yMMVYwiQvyTyQ==","license":"MIT","optional":true,"os":["darwin"],"resolved":"https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.18.20.tgz","version":"0.18.20"} | ||
@ ["packages","node_modules/@esbuild/freebsd-arm64"] | ||
+ {"cpu":["arm64"],"engines":{"node":"\u003e=12"},"integrity":"sha512-yqDQHy4QHevpMAaxhhIwYPMv1NECwOvIpGCZkECn8w2WFHXjEwrBn3CeNIYsibZ/iZEUemj++M26W3cNR5h+Tw==","license":"MIT","optional":true,"os":["freebsd"],"resolved":"https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.18.20.tgz","version":"0.18.20"} | ||
@ ["packages","node_modules/@esbuild/freebsd-x64"] | ||
+ {"cpu":["x64"],"engines":{"node":"\u003e=12"},"integrity":"sha512-tgWRPPuQsd3RmBZwarGVHZQvtzfEBOreNuxEMKFcd5DaDn2PbBxfwLcj4+aenoh7ctXcbXmOQIn8HI6mCSw5MQ==","license":"MIT","optional":true,"os":["freebsd"],"resolved":"https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.18.20.tgz","version":"0.18.20"} | ||
@ ["packages","node_modules/@esbuild/linux-arm"] | ||
+ {"cpu":["arm"],"engines":{"node":"\u003e=12"},"integrity":"sha512-/5bHkMWnq1EgKr1V+Ybz3s1hWXok7mDFUMQ4cG10AfW3wL02PSZi5kFpYKrptDsgb2WAJIvRcDm+qIvXf/apvg==","license":"MIT","optional":true,"os":["linux"],"resolved":"https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.18.20.tgz","version":"0.18.20"} | ||
@ ["packages","node_modules/@esbuild/linux-arm64"] | ||
+ {"cpu":["arm64"],"engines":{"node":"\u003e=12"},"integrity":"sha512-2YbscF+UL7SQAVIpnWvYwM+3LskyDmPhe31pE7/aoTMFKKzIc9lLbyGUpmmb8a8AixOL61sQ/mFh3jEjHYFvdA==","license":"MIT","optional":true,"os":["linux"],"resolved":"https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.18.20.tgz","version":"0.18.20"} | ||
@ ["packages","node_modules/@esbuild/linux-ia32"] | ||
+ {"cpu":["ia32"],"engines":{"node":"\u003e=12"},"integrity":"sha512-P4etWwq6IsReT0E1KHU40bOnzMHoH73aXp96Fs8TIT6z9Hu8G6+0SHSw9i2isWrD2nbx2qo5yUqACgdfVGx7TA==","license":"MIT","optional":true,"os":["linux"],"resolved":"https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.18.20.tgz","version":"0.18.20"} | ||
@ ["packages","node_modules/@esbuild/linux-loong64"] | ||
+ {"cpu":["loong64"],"engines":{"node":"\u003e=12"},"integrity":"sha512-nXW8nqBTrOpDLPgPY9uV+/1DjxoQ7DoB2N8eocyq8I9XuqJ7BiAMDMf9n1xZM9TgW0J8zrquIb/A7s3BJv7rjg==","license":"MIT","optional":true,"os":["linux"],"resolved":"https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.18.20.tgz","version":"0.18.20"} | ||
@ ["packages","node_modules/@esbuild/linux-mips64el"] | ||
+ {"cpu":["mips64el"],"engines":{"node":"\u003e=12"},"integrity":"sha512-d5NeaXZcHp8PzYy5VnXV3VSd2D328Zb+9dEq5HE6bw6+N86JVPExrA6O68OPwobntbNJ0pzCpUFZTo3w0GyetQ==","license":"MIT","optional":true,"os":["linux"],"resolved":"https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.18.20.tgz","version":"0.18.20"} | ||
@ ["packages","node_modules/@esbuild/linux-ppc64"] | ||
+ {"cpu":["ppc64"],"engines":{"node":"\u003e=12"},"integrity":"sha512-WHPyeScRNcmANnLQkq6AfyXRFr5D6N2sKgkFo2FqguP44Nw2eyDlbTdZwd9GYk98DZG9QItIiTlFLHJHjxP3FA==","license":"MIT","optional":true,"os":["linux"],"resolved":"https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.18.20.tgz","version":"0.18.20"} | ||
@ ["packages","node_modules/@esbuild/linux-riscv64"] | ||
+ {"cpu":["riscv64"],"engines":{"node":"\u003e=12"},"integrity":"sha512-WSxo6h5ecI5XH34KC7w5veNnKkju3zBRLEQNY7mv5mtBmrP/MjNBCAlsM2u5hDBlS3NGcTQpoBvRzqBcRtpq1A==","license":"MIT","optional":true,"os":["linux"],"resolved":"https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.18.20.tgz","version":"0.18.20"} | ||
@ ["packages","node_modules/@esbuild/linux-s390x"] | ||
+ {"cpu":["s390x"],"engines":{"node":"\u003e=12"},"integrity":"sha512-+8231GMs3mAEth6Ja1iK0a1sQ3ohfcpzpRLH8uuc5/KVDFneH6jtAJLFGafpzpMRO6DzJ6AvXKze9LfFMrIHVQ==","license":"MIT","optional":true,"os":["linux"],"resolved":"https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.18.20.tgz","version":"0.18.20"} | ||
@ ["packages","node_modules/@esbuild/netbsd-x64"] | ||
+ {"cpu":["x64"],"engines":{"node":"\u003e=12"},"integrity":"sha512-iO1c++VP6xUBUmltHZoMtCUdPlnPGdBom6IrO4gyKPFFVBKioIImVooR5I83nTew5UOYrk3gIJhbZh8X44y06A==","license":"MIT","optional":true,"os":["netbsd"],"resolved":"https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.18.20.tgz","version":"0.18.20"} | ||
@ ["packages","node_modules/@esbuild/openbsd-x64"] | ||
+ {"cpu":["x64"],"engines":{"node":"\u003e=12"},"integrity":"sha512-e5e4YSsuQfX4cxcygw/UCPIEP6wbIL+se3sxPdCiMbFLBWu0eiZOJ7WoD+ptCLrmjZBK1Wk7I6D/I3NglUGOxg==","license":"MIT","optional":true,"os":["openbsd"],"resolved":"https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.18.20.tgz","version":"0.18.20"} | ||
@ ["packages","node_modules/@esbuild/sunos-x64"] | ||
+ {"cpu":["x64"],"engines":{"node":"\u003e=12"},"integrity":"sha512-kDbFRFp0YpTQVVrqUd5FTYmWo45zGaXe0X8E1G/LKFC0v8x0vWrhOWSLITcCn63lmZIxfOMXtCfti/RxN/0wnQ==","license":"MIT","optional":true,"os":["sunos"],"resolved":"https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.18.20.tgz","version":"0.18.20"} | ||
@ ["packages","node_modules/@esbuild/win32-arm64"] | ||
+ {"cpu":["arm64"],"engines":{"node":"\u003e=12"},"integrity":"sha512-ddYFR6ItYgoaq4v4JmQQaAI5s7npztfV4Ag6NrhiaW0RrnOXqBkgwZLofVTlq1daVTQNhtI5oieTvkRPfZrePg==","license":"MIT","optional":true,"os":["win32"],"resolved":"https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.18.20.tgz","version":"0.18.20"} | ||
@ ["packages","node_modules/@esbuild/win32-ia32"] | ||
+ {"cpu":["ia32"],"engines":{"node":"\u003e=12"},"integrity":"sha512-Wv7QBi3ID/rROT08SABTS7eV4hX26sVduqDOTe1MvGMjNd3EjOz4b7zeexIR62GTIEKrfJXKL9LFxTYgkyeu7g==","license":"MIT","optional":true,"os":["win32"],"resolved":"https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.18.20.tgz","version":"0.18.20"} | ||
@ ["packages","node_modules/@esbuild/win32-x64"] | ||
+ {"cpu":["x64"],"engines":{"node":"\u003e=12"},"integrity":"sha512-kTdfRcSiDfQca/y9QIkng02avJ+NCaQvrMejlsB3RRv5sE9rRoeBPISaZpKxHELzRxZyLvNts1P27W3wV+8geQ==","license":"MIT","optional":true,"os":["win32"],"resolved":"https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.18.20.tgz","version":"0.18.20"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,38 +4,36 @@ | |
buildNpmPackage, | ||
fetchFromGitHub, | ||
moreutils, | ||
npm-lockfile-fix, | ||
jd-diff-patch, | ||
jq, | ||
git, | ||
}: | ||
let | ||
# finalAttrs when 🥺 (buildGoModule does not support them) | ||
# https://github.com/NixOS/nixpkgs/issues/273815 | ||
version = "1.7.5"; | ||
version = "1.8.1"; | ||
src = fetchFromGitHub { | ||
owner = "thomiceli"; | ||
repo = "opengist"; | ||
rev = "v${version}"; | ||
hash = "sha256-mZ4j9UWdKa3nygcRO5ceyONetkks3ZGWxvzD34eOXew="; | ||
|
||
# follow https://github.com/thomiceli/opengist/pull/350 and remove here | ||
postFetch = '' | ||
${lib.getExe npm-lockfile-fix} $out/package-lock.json | ||
''; | ||
hash = "sha256-rUE4E5moMujVeN/2obp1LlvyKOPGyP6de1xI/2GdAUc="; | ||
}; | ||
jd' = lib.getExe jd-diff-patch; | ||
jq' = lib.getExe jq; | ||
sponge = "${moreutils}/bin/sponge"; | ||
|
||
frontend = buildNpmPackage { | ||
pname = "opengist-frontend"; | ||
inherit version src; | ||
|
||
nativeBuildInputs = [ | ||
moreutils | ||
jq | ||
]; | ||
|
||
# npm complains of "invalid package". shrug. we can give it a version. | ||
preBuild = '' | ||
jq '.version = "${version}"' package.json | sponge package.json | ||
# esbuild optional dependencies installed explicitly | ||
# as they are missing for non-x86_64-linux in package-lock.json | ||
# nix shell nixpkgs#{nodejs,jd-diff-patch} -c \ | ||
# sh -c "npm add [email protected]; git difftool -yx jd @ -- package-lock.json > package-lock-esbuild.jd.diff" | ||
prePatch = '' | ||
${jq'} '.version = "${version}"' package.json | ${sponge} package.json | ||
${jd'} -o package-lock.json -p ${./package-lock-esbuild.jd.diff} package-lock.json || true | ||
''; | ||
|
||
# copy pasta from the Makefile upstream, seems to be a workaround of sass | ||
|
@@ -50,13 +48,13 @@ let | |
cp -R public $out | ||
''; | ||
|
||
npmDepsHash = "sha256-cITkgRvWOml6uH77WkiNgFedEuPNze63Gntet09uS5w="; | ||
npmDepsHash = "sha256-TLf2+44JFW5J1/0OxFiooYLWpY/MYyqvdDRDzS0LSBs="; | ||
}; | ||
in | ||
buildGoModule { | ||
pname = "opengist"; | ||
inherit version src; | ||
vendorHash = "sha256-6PpS/dsonc/akBn8NwUIVFNe2FjynAhF1TYIYT9K/ws="; | ||
vendorHash = "sha256-B8h+/pUMDzLew0+r2/nTHDcm3Y7Bnwj9R3FzHts6i+k="; | ||
tags = [ "fs_embed" ]; | ||
ldflags = [ | ||
"-s" | ||
|
@@ -73,6 +71,12 @@ buildGoModule { | |
export OG_OPENGIST_HOME=$(mktemp -d) | ||
''; | ||
|
||
checkPhase = '' | ||
runHook preCheck | ||
make test | ||
runHook postCheck | ||
''; | ||
|
||
postPatch = '' | ||
cp -R ${frontend}/public/{manifest.json,assets} public/ | ||
''; | ||
|