Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions pkgs/by-name/pl/plasticscm-client-complete/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
buildEnv,
lib,
plasticscm-client-core,
plasticscm-client-gui,
}:
buildEnv {
pname = "plasticscm-client-complete";
inherit (plasticscm-client-core) version;
name = "plasticscm-client-complete-${plasticscm-client-core.version}";

paths = [
plasticscm-client-core
plasticscm-client-gui
];

meta = {
homepage = "https://www.plasticscm.com";
description = "SCM by Unity for game development";
platforms = [ "x86_64-linux" ];
mainProgram = "plasticgui";
license = lib.licenses.unfree;
maintainers = with lib.maintainers; [ musjj ];
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
};
}
64 changes: 64 additions & 0 deletions pkgs/by-name/pl/plasticscm-client-core-unwrapped/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
{
dpkg,
fetchurl,
lib,
makeWrapper,
stdenvNoCC,
writeShellApplication,
common-updater-scripts,
curl,
jc,
jq,
}:
stdenvNoCC.mkDerivation (finalAttrs: {
pname = "plasticscm-client-core-unwrapped";
version = "11.0.16.9791";

src = fetchurl {
url = "https://www.plasticscm.com/plasticrepo/stable/debian/amd64/plasticscm-client-core_${finalAttrs.version}_amd64.deb";
hash = "sha256-NuMY75JnnWVRKBSh/1XYipqc0m+O0vt7lJMVkQyTaNA=";
};

nativeBuildInputs = [
dpkg
makeWrapper
];

dontFixup = true;

installPhase = ''
runHook preInstall

mkdir -p $out
cp -r opt usr/{share,bin} $out

runHook postInstall
'';

passthru.updateScript = lib.getExe (writeShellApplication {
name = "update-plasticscm-client-core-unwrapped";
runtimeInputs = [
common-updater-scripts
curl
jc
jq
];
text = ''
eval "$(curl -sSL https://www.plasticscm.com/plasticrepo/stable/debian/Packages |
jc --pkg-index-deb |
jq -r '[.[] | select(.package == "plasticscm-client-core")] | sort_by(.version) | last | @sh "version=\(.version) hash=\(.sha256)"')"
# shellcheck disable=SC2154
update-source-version plasticscm-client-core-unwrapped "$version" "sha256-$(xxd -r -p <<<"$hash" | base64)"
'';
});

meta = {
homepage = "https://www.plasticscm.com";
description = "SCM by Unity for game development";
platforms = [ "x86_64-linux" ];
mainProgram = "cm";
license = lib.licenses.unfree;
maintainers = with lib.maintainers; [ musjj ];
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
};
})
47 changes: 47 additions & 0 deletions pkgs/by-name/pl/plasticscm-client-core/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
buildFHSEnv,
extraLibs ? _: [ ],
extraPkgs ? _: [ ],
libgcc,
libz,
plasticscm-client-core-unwrapped,
}:
buildFHSEnv {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you really need an FHS env for these packages or does autoPatchelfHook suffice?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, buildFSHEnv is required here. I initially started with autoPatchelfHook but it did not work very well. The way some of the dependencies are loaded just necessitates an FSH environment for full compatibility (either that, or some really invasive/unstable patching). See unityhub.

pname = "plasticscm-client-core";
inherit (plasticscm-client-core-unwrapped) version meta;

runScript = "/usr/bin/cm";

targetPkgs =
pkgs:
[
plasticscm-client-core-unwrapped
]
++ extraPkgs pkgs;

multiPkgs =
pkgs:
with pkgs;
[
# Dependencies from the Debian package
glibc.out
libgcc.lib
libz
krb5.lib
lttng-ust.out
openssl_3.out
icu76

# Transitive dependencies from the Debian package
libidn2.out
libunistring
e2fsprogs.out
keyutils.lib
numactl.out
]
++ extraLibs pkgs;

extraInstallCommands = ''
mv $out/bin/plasticscm-client-core $out/bin/cm
'';
}
62 changes: 62 additions & 0 deletions pkgs/by-name/pl/plasticscm-client-gui-unwrapped/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{
dpkg,
fetchurl,
lib,
stdenvNoCC,
writeShellApplication,
common-updater-scripts,
curl,
jc,
jq,
}:
stdenvNoCC.mkDerivation (finalAttrs: {
pname = "plasticscm-client-gui-unwrapped";
version = "11.0.16.9791";

src = fetchurl {
url = "https://www.plasticscm.com/plasticrepo/stable/debian/amd64/plasticscm-client-gui_${finalAttrs.version}_amd64.deb";
hash = "sha256-sSabW3j9h9uNQSwWKvAH+3D9lRWvMRYcuITDonD7Inw=";
};

nativeBuildInputs = [
dpkg
];

dontFixup = true;

installPhase = ''
runHook preInstall

mkdir -p $out
cp -r opt usr/{share,bin} $out

runHook postInstall
'';

passthru.updateScript = lib.getExe (writeShellApplication {
name = "update-plasticscm-client-gui-unwrapped";
runtimeInputs = [
common-updater-scripts
curl
jc
jq
];
text = ''
eval "$(curl -sSL https://www.plasticscm.com/plasticrepo/stable/debian/Packages |
jc --pkg-index-deb |
jq -r '[.[] | select(.package == "plasticscm-client-gui")] | sort_by(.version) | last | @sh "version=\(.version) hash=\(.sha256)"')"
# shellcheck disable=SC2154
update-source-version plasticscm-client-gui-unwrapped "$version" "sha256-$(xxd -r -p <<<"$hash" | base64)"
'';
});

meta = {
homepage = "https://www.plasticscm.com";
description = "SCM by Unity for game development";
platforms = [ "x86_64-linux" ];
mainProgram = "plasticgui";
license = lib.licenses.unfree;
maintainers = with lib.maintainers; [ musjj ];
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
};
})
102 changes: 102 additions & 0 deletions pkgs/by-name/pl/plasticscm-client-gui/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
{
buildFHSEnv,
extraLibs ? _: [ ],
extraPkgs ? _: [ ],
imagemagick,
makeWrapper,
plasticscm-client-core-unwrapped,
plasticscm-client-gui-unwrapped,
plasticscm-theme,
}:
buildFHSEnv {
pname = "plasticscm-client-gui";
inherit (plasticscm-client-gui-unwrapped) version meta;

runScript = "";

targetPkgs =
pkgs:
with pkgs;
[
plasticscm-client-gui-unwrapped

# Dependencies from the Debian package
plasticscm-client-core-unwrapped

fontconfig
]
++ extraPkgs pkgs;

multiPkgs =
pkgs:
with pkgs;
[
# Dependencies from the Debian package
glibc.out
libgcc.lib
krb5.lib
lttng-ust.out
openssl_3.out
icu76
plasticscm-theme

# Transitive dependencies from the Debian package
libidn2.out
libunistring
e2fsprogs.out
keyutils.lib
numactl.out
libz

# Undocumented dependencies discovered from testing
gtk3
xorg.libICE
xorg.libSM
xorg.libX11
xorg.libXcursor
xorg.libXi
]
++ extraLibs pkgs;

nativeBuildInputs = [
makeWrapper
imagemagick
];

extraBuildCommands = ''
for app in linplasticx lingluonx; do
cp --remove-destination $(readlink $out/opt/plasticscm5/client/$app) $out/opt/plasticscm5/client/$app
done
'';

extraInstallCommands = ''
mv $out/bin/plasticscm-client-gui $out/bin/.plasticscm-client-gui-fhsenv

for app in plasticgui semanticmergetool gtkmergetool gluon; do
makeWrapper $out/bin/.plasticscm-client-gui-fhsenv $out/bin/$app \
--add-flags /usr/bin/$app
done

mkdir -p $out/share/applications

for entry in ${plasticscm-client-gui-unwrapped}/share/applications/{unityvcs,plasticx}.desktop; do
substitute $entry $out/share/applications/$(basename $entry) \
--replace-fail /opt/plasticscm5/client/linplasticx plasticgui \
--replace-fail /opt/plasticscm5/theme/avalonia/icons/linunityvcs.ico linunityvcs
done

substitute ${plasticscm-client-gui-unwrapped}/share/applications/gluonx.desktop \
$out/share/applications/gluonx.desktop \
--replace-fail /opt/plasticscm5/client/lingluonx gluon \
--replace-fail /opt/plasticscm5/theme/avalonia/icons/lingluonx.ico lingluonx

for ico in ${plasticscm-client-gui-unwrapped}/opt/plasticscm5/theme/avalonia/icons/*; do
tmpdir=$(mktemp -d)
magick $ico $tmpdir/$(basename $ico .ico).png
for png in $tmpdir/*; do
size=$(magick identify -format %wx%h $png)
install -Dm444 -T $png $out/share/icons/hicolor/$size/apps/$(basename $ico .ico).png
done
done
'';
}
61 changes: 61 additions & 0 deletions pkgs/by-name/pl/plasticscm-theme/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{
dpkg,
fetchurl,
lib,
stdenvNoCC,
writeShellApplication,
common-updater-scripts,
curl,
jc,
jq,
}:
stdenvNoCC.mkDerivation (finalAttrs: {
pname = "plasticscm-theme";
version = "11.0.16.9791";

src = fetchurl {
url = "https://www.plasticscm.com/plasticrepo/stable/debian/amd64/plasticscm-theme_${finalAttrs.version}_amd64.deb";
hash = "sha256-sInKMW6KoUNZ/06+E8MTGyVtOd+8wFLPrFibNw/DYQ0=";
};

nativeBuildInputs = [
dpkg
];

dontFixup = true;

installPhase = ''
runHook preInstall

mkdir -p $out
cp -r opt usr/share $out

runHook postInstall
'';

passthru.updateScript = lib.getExe (writeShellApplication {
name = "update-plasticscm-theme";
runtimeInputs = [
common-updater-scripts
curl
jc
jq
];
text = ''
eval "$(curl -sSL https://www.plasticscm.com/plasticrepo/stable/debian/Packages |
jc --pkg-index-deb |
jq -r '[.[] | select(.package == "plasticscm-theme")] | sort_by(.version) | last | @sh "version=\(.version) hash=\(.sha256)"')"
# shellcheck disable=SC2154
update-source-version plasticscm-theme "$version" "sha256-$(xxd -r -p <<<"$hash" | base64)"
'';
});

meta = {
homepage = "https://www.plasticscm.com";
description = "SCM by Unity for game development";
platforms = [ "x86_64-linux" ];
license = lib.licenses.unfree;
maintainers = with lib.maintainers; [ musjj ];
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
};
})
Loading