about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/tools/glamoroustoolkit
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2023-09-14 13:17:39 +0000
committerAlyssa Ross <hi@alyssa.is>2023-09-14 13:17:39 +0000
commit56e87d10ec12e00eab5c4b5710e01ab50eec267f (patch)
treebaff33c3da97619d02441379b3f0f369da8f3d5a /nixpkgs/pkgs/development/tools/glamoroustoolkit
parentcc14c6e02d8424c1d446d248f71e08243181af8d (diff)
parent3a2786eea085f040a66ecde1bc3ddc7099f6dbeb (diff)
downloadnixlib-56e87d10ec12e00eab5c4b5710e01ab50eec267f.tar
nixlib-56e87d10ec12e00eab5c4b5710e01ab50eec267f.tar.gz
nixlib-56e87d10ec12e00eab5c4b5710e01ab50eec267f.tar.bz2
nixlib-56e87d10ec12e00eab5c4b5710e01ab50eec267f.tar.lz
nixlib-56e87d10ec12e00eab5c4b5710e01ab50eec267f.tar.xz
nixlib-56e87d10ec12e00eab5c4b5710e01ab50eec267f.tar.zst
nixlib-56e87d10ec12e00eab5c4b5710e01ab50eec267f.zip
Merge branch 'nixos-unstable' of https://github.com/NixOS/nixpkgs
Diffstat (limited to 'nixpkgs/pkgs/development/tools/glamoroustoolkit')
-rwxr-xr-xnixpkgs/pkgs/development/tools/glamoroustoolkit/GlamorousToolkit-GetImage25
-rw-r--r--nixpkgs/pkgs/development/tools/glamoroustoolkit/default.nix103
2 files changed, 128 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/tools/glamoroustoolkit/GlamorousToolkit-GetImage b/nixpkgs/pkgs/development/tools/glamoroustoolkit/GlamorousToolkit-GetImage
new file mode 100755
index 000000000000..20c2c315a350
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/glamoroustoolkit/GlamorousToolkit-GetImage
@@ -0,0 +1,25 @@
+#! /usr/bin/env nix-shell
+#! nix-shell -i bash --packages curl
+#
+# Download the latest GlamorousToolkit image to the current directory, which must be empty
+#
+set -e
+
+if [ ! -z "$(ls)" ]
+then
+	echo "Warning: the directory is not empty, continuing may overwrite some files"
+	read -p "Continue? (Y/N): " confirm && [[ $confirm == [yY] || $confirm == [yY][eE][sS] ]] || exit 1
+fi
+
+GTVERSION=$(curl -s https://api.github.com/repos/feenkcom/gtoolkit/releases/latest 2>/dev/null | grep tag_name | cut -d '"' -f 4)
+if [ -z "$GTVERSION" ]
+then
+	echo "Failed to get Gt Version string, exiting..."
+	exit 1
+fi
+
+curl -L \
+  -o gt-image.zip \
+  https://github.com/feenkcom/gtoolkit/releases/download/${GTVERSION}/GlamorousToolkit-Linux-x86_64-${GTVERSION}.zip
+unzip gt-image.zip
+rm -rf bin lib
diff --git a/nixpkgs/pkgs/development/tools/glamoroustoolkit/default.nix b/nixpkgs/pkgs/development/tools/glamoroustoolkit/default.nix
new file mode 100644
index 000000000000..814eb368929e
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/glamoroustoolkit/default.nix
@@ -0,0 +1,103 @@
+{ lib
+, stdenv
+, fetchzip
+, cairo
+, dbus
+, fontconfig
+, freetype
+, glib
+, gtk3
+, libX11
+, libXcursor
+, libXext
+, libXi
+, libXrandr
+, libXrender
+, libglvnd
+, libuuid
+, libxcb
+, makeWrapper
+}:
+
+stdenv.mkDerivation (finalAttrs: {
+  pname = "glamoroustoolkit";
+  version = "0.7.3";
+
+  src = fetchzip {
+    url = "https://github.com/feenkcom/gtoolkit-vm/releases/download/v${finalAttrs.version}/GlamorousToolkit-x86_64-unknown-linux-gnu.zip";
+    stripRoot = false;
+    hash = "sha256-xkGip3RN44SZhYbogxUabO2EDsrRUZAJ+qAOEGdBgQ4=";
+  };
+
+  sourceRoot = ".";
+
+  dontConfigure = true;
+  dontBuild = true;
+  dontPatchELF = true;
+
+  installPhase = ''
+    runHook preInstall
+
+    install -d $out/bin $out/lib
+    cp -r $src/bin $src/lib $out/
+    cp ${./GlamorousToolkit-GetImage} $out/bin/GlamorousToolkit-GetImage
+
+    runHook postInstall
+  '';
+
+preFixup = let
+    libPath = lib.makeLibraryPath [
+      cairo
+      dbus
+      fontconfig
+      freetype
+      glib
+      gtk3
+      libX11
+      libXcursor
+      libXext
+      libXi
+      libXrandr
+      libXrender
+      libglvnd
+      libuuid
+      libxcb
+      stdenv.cc.cc.lib
+    ];
+  in ''
+    chmod +x $out/lib/*.so
+    patchelf \
+      --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
+      --set-rpath "${libPath}:$out/lib" \
+      $out/bin/GlamorousToolkit $out/bin/GlamorousToolkit-cli
+    patchelf --shrink-rpath \
+      $out/bin/GlamorousToolkit $out/bin/GlamorousToolkit-cli
+    patchelf \
+      --set-rpath "${libPath}:$out/lib" \
+      $out/lib/*.so
+    patchelf --shrink-rpath $out/lib/*.so
+    #
+    # shrink-rpath gets it wrong for the following libraries,
+    # restore the full rpath.
+    #
+    patchelf \
+      --set-rpath "${libPath}:$out/lib" \
+      $out/lib/libPharoVMCore.so \
+      $out/lib/libWinit.so \
+      $out/lib/libPixels.so
+    patchelf --set-rpath $out/lib $out/lib/libssl.so
+
+    ln -s $out/lib/libcrypto.so $out/lib/libcrypto.so.1.1
+    ln -s $out/lib/libcairo.so $out/lib/libcairo.so.2
+    ln -s $out/lib/libgit2.so $out/lib/libgit2.so.1.1
+  '';
+
+  meta = {
+    homepage = "https://gtoolkit.com";
+    description = "The GlamorousToolkit Development Environment";
+    license = lib.licenses.mit;
+    maintainers = [ lib.maintainers.akgrant43 ];
+    platforms = [ "x86_64-linux" ];
+    sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
+  };
+})