diff --git a/pkgs/by-name/pl/plasticscm-client-complete/package.nix b/pkgs/by-name/pl/plasticscm-client-complete/package.nix new file mode 100644 index 0000000000000..af9a4b6d281d6 --- /dev/null +++ b/pkgs/by-name/pl/plasticscm-client-complete/package.nix @@ -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 ]; + }; +} diff --git a/pkgs/by-name/pl/plasticscm-client-core-unwrapped/package.nix b/pkgs/by-name/pl/plasticscm-client-core-unwrapped/package.nix new file mode 100644 index 0000000000000..f659c730ac349 --- /dev/null +++ b/pkgs/by-name/pl/plasticscm-client-core-unwrapped/package.nix @@ -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 ]; + }; +}) diff --git a/pkgs/by-name/pl/plasticscm-client-core/package.nix b/pkgs/by-name/pl/plasticscm-client-core/package.nix new file mode 100644 index 0000000000000..a6bb4b0e78df9 --- /dev/null +++ b/pkgs/by-name/pl/plasticscm-client-core/package.nix @@ -0,0 +1,47 @@ +{ + buildFHSEnv, + extraLibs ? _: [ ], + extraPkgs ? _: [ ], + libgcc, + libz, + plasticscm-client-core-unwrapped, +}: +buildFHSEnv { + 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 + ''; +} diff --git a/pkgs/by-name/pl/plasticscm-client-gui-unwrapped/package.nix b/pkgs/by-name/pl/plasticscm-client-gui-unwrapped/package.nix new file mode 100644 index 0000000000000..7e0755e219f54 --- /dev/null +++ b/pkgs/by-name/pl/plasticscm-client-gui-unwrapped/package.nix @@ -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 ]; + }; +}) diff --git a/pkgs/by-name/pl/plasticscm-client-gui/package.nix b/pkgs/by-name/pl/plasticscm-client-gui/package.nix new file mode 100644 index 0000000000000..59008bb453c58 --- /dev/null +++ b/pkgs/by-name/pl/plasticscm-client-gui/package.nix @@ -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 + ''; +} diff --git a/pkgs/by-name/pl/plasticscm-theme/package.nix b/pkgs/by-name/pl/plasticscm-theme/package.nix new file mode 100644 index 0000000000000..98b50427ffcec --- /dev/null +++ b/pkgs/by-name/pl/plasticscm-theme/package.nix @@ -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 ]; + }; +})