tetrio-plus: split tpsecore into seperate package (#353557)
This commit is contained in:
@@ -2,74 +2,25 @@
|
|||||||
lib,
|
lib,
|
||||||
stdenv,
|
stdenv,
|
||||||
fetchFromGitLab,
|
fetchFromGitLab,
|
||||||
rustPlatform,
|
|
||||||
rustc,
|
|
||||||
wasm-pack,
|
|
||||||
wasm-bindgen-cli,
|
|
||||||
binaryen,
|
|
||||||
|
|
||||||
fetchYarnDeps,
|
fetchYarnDeps,
|
||||||
yarn,
|
yarn,
|
||||||
fixup-yarn-lock,
|
fixup-yarn-lock,
|
||||||
nodejs,
|
nodejs,
|
||||||
asar,
|
asar,
|
||||||
|
|
||||||
|
tpsecore,
|
||||||
tetrio-desktop,
|
tetrio-desktop,
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
version = "0.27.4";
|
version = "0.27.5";
|
||||||
rev = "electron-v${version}-tetrio-v${tetrio-desktop.version}";
|
rev = "electron-v${version}-tetrio-v${tetrio-desktop.version}";
|
||||||
|
|
||||||
src = fetchFromGitLab {
|
src = fetchFromGitLab {
|
||||||
owner = "UniQMG";
|
owner = "UniQMG";
|
||||||
repo = "tetrio-plus";
|
repo = "tetrio-plus";
|
||||||
inherit rev;
|
inherit rev;
|
||||||
hash = "sha256-HwGFg8dxqtqghdP+PXWXr6Fi5vfgopThs+QNa3N1awk=";
|
hash = "sha256-hbHofrC2dJOh2kh3VLb/d0dHrcszyqTyID1PAaGApxY=";
|
||||||
fetchSubmodules = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
wasm-bindgen-82 = wasm-bindgen-cli.override {
|
|
||||||
version = "0.2.82";
|
|
||||||
hash = "sha256-BQ8v3rCLUvyCCdxo5U+NHh30l9Jwvk9Sz8YQv6fa0SU=";
|
|
||||||
cargoHash = "sha256-mP85+qi2KA0GieaBzbrQOBqYxBZNRJipvd2brCRGyOM=";
|
|
||||||
};
|
|
||||||
|
|
||||||
tpsecore = rustPlatform.buildRustPackage {
|
|
||||||
pname = "tpsecore";
|
|
||||||
inherit version src;
|
|
||||||
|
|
||||||
sourceRoot = "${src.name}/tpsecore";
|
|
||||||
|
|
||||||
cargoHash = "sha256-zqeoPeGZvSz7W3c7MXnvvq73hvavg1RGzPc3iTqAjBo=";
|
|
||||||
|
|
||||||
nativeBuildInputs = [
|
|
||||||
wasm-pack
|
|
||||||
wasm-bindgen-82
|
|
||||||
binaryen
|
|
||||||
rustc.llvmPackages.lld
|
|
||||||
];
|
|
||||||
|
|
||||||
buildPhase = ''
|
|
||||||
HOME=$(mktemp -d) wasm-pack build --target web --release
|
|
||||||
'';
|
|
||||||
|
|
||||||
installPhase = ''
|
|
||||||
cp -r pkg/ $out
|
|
||||||
'';
|
|
||||||
|
|
||||||
doCheck = false;
|
|
||||||
|
|
||||||
meta = {
|
|
||||||
description = "Self contained toolkit for creating, editing, and previewing TPSE files";
|
|
||||||
homepage = "https://gitlab.com/UniQMG/tpsecore";
|
|
||||||
license = lib.licenses.mit;
|
|
||||||
maintainers = with lib.maintainers; [
|
|
||||||
huantian
|
|
||||||
wackbyte
|
|
||||||
];
|
|
||||||
platforms = lib.platforms.linux;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
offlineCache = fetchYarnDeps {
|
offlineCache = fetchYarnDeps {
|
||||||
@@ -119,16 +70,12 @@ stdenv.mkDerivation (finalAttrs: {
|
|||||||
# Actually install tetrio-plus where the above patch script expects
|
# Actually install tetrio-plus where the above patch script expects
|
||||||
cp -r $src out/tetrioplus
|
cp -r $src out/tetrioplus
|
||||||
chmod -R u+w out/tetrioplus
|
chmod -R u+w out/tetrioplus
|
||||||
|
|
||||||
# Install tpsecore
|
# Install tpsecore
|
||||||
cp ${tpsecore}/{tpsecore_bg.wasm,tpsecore.js} out/tetrioplus/source/lib/
|
cp ${tpsecore}/{tpsecore_bg.wasm,tpsecore.js} out/tetrioplus/source/lib/
|
||||||
# Remove uneeded tpsecore source code
|
|
||||||
rm -rf out/tetrioplus/tpsecore/
|
|
||||||
|
|
||||||
# Disable useless uninstall button in the tetrio-plus popup
|
# Disable useless uninstall button in the tetrio-plus popup
|
||||||
substituteInPlace out/tetrioplus/desktop-manifest.js \
|
substituteInPlace out/tetrioplus/desktop-manifest.js \
|
||||||
--replace-fail '"show_uninstaller_button": true' '"show_uninstaller_button": false'
|
--replace-fail '"show_uninstaller_button": true' '"show_uninstaller_button": false'
|
||||||
|
|
||||||
# Display 'nixpkgs' next to version in tetrio-plus popup
|
# Display 'nixpkgs' next to version in tetrio-plus popup
|
||||||
echo "nixpkgs" > out/tetrioplus/resources/override-commit
|
echo "nixpkgs" > out/tetrioplus/resources/override-commit
|
||||||
|
|
||||||
|
|||||||
68
pkgs/by-name/tp/tpsecore/package.nix
Normal file
68
pkgs/by-name/tp/tpsecore/package.nix
Normal file
@@ -0,0 +1,68 @@
|
|||||||
|
{
|
||||||
|
lib,
|
||||||
|
fetchFromGitLab,
|
||||||
|
rustPlatform,
|
||||||
|
rustc,
|
||||||
|
wasm-pack,
|
||||||
|
wasm-bindgen-cli,
|
||||||
|
binaryen,
|
||||||
|
}:
|
||||||
|
|
||||||
|
let
|
||||||
|
version = "0.1.1";
|
||||||
|
|
||||||
|
wasm-bindgen-cli-95 = wasm-bindgen-cli.override {
|
||||||
|
version = "0.2.95";
|
||||||
|
hash = "sha256-prMIreQeAcbJ8/g3+pMp1Wp9H5u+xLqxRxL+34hICss=";
|
||||||
|
cargoHash = "sha256-6iMebkD7FQvixlmghGGIvpdGwFNLfnUcFke/Rg8nPK4=";
|
||||||
|
};
|
||||||
|
in
|
||||||
|
rustPlatform.buildRustPackage {
|
||||||
|
pname = "tpsecore";
|
||||||
|
inherit version;
|
||||||
|
|
||||||
|
src = fetchFromGitLab {
|
||||||
|
owner = "UniQMG";
|
||||||
|
repo = "tpsecore";
|
||||||
|
rev = "v${version}";
|
||||||
|
hash = "sha256-+OynnLMBEiYwdFzxGzgkcBN6xrHoH1Q6O5i+OW7RBLo=";
|
||||||
|
};
|
||||||
|
|
||||||
|
cargoHash = "sha256-mPaWXiDjJd/uTBpktauKWg8X9sNBb3FXw5BSGB33NxI=";
|
||||||
|
|
||||||
|
nativeBuildInputs = [
|
||||||
|
wasm-pack
|
||||||
|
wasm-bindgen-cli-95
|
||||||
|
binaryen
|
||||||
|
rustc.llvmPackages.lld
|
||||||
|
];
|
||||||
|
|
||||||
|
buildPhase = ''
|
||||||
|
runHook preBuild
|
||||||
|
|
||||||
|
HOME=$(mktemp -d) wasm-pack build --target web --release
|
||||||
|
|
||||||
|
runHook postBuild
|
||||||
|
'';
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
runHook preInstall
|
||||||
|
|
||||||
|
cp -r pkg/ $out
|
||||||
|
|
||||||
|
runHook postInstall
|
||||||
|
'';
|
||||||
|
|
||||||
|
doCheck = false;
|
||||||
|
|
||||||
|
meta = {
|
||||||
|
description = "Self contained toolkit for creating, editing, and previewing TPSE files";
|
||||||
|
homepage = "https://gitlab.com/UniQMG/tpsecore";
|
||||||
|
license = lib.licenses.mit;
|
||||||
|
maintainers = with lib.maintainers; [
|
||||||
|
huantian
|
||||||
|
wackbyte
|
||||||
|
];
|
||||||
|
platforms = lib.platforms.linux;
|
||||||
|
};
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user