nosql-workbench: unpack with 7zz

This commit is contained in:
Weijia Wang 2024-02-29 05:32:22 +01:00
parent 0858160853
commit f80431b147

View file

@ -4,7 +4,7 @@
fetchurl, fetchurl,
jdk21, jdk21,
stdenv, stdenv,
undmg _7zz
}: }:
let let
pname = "nosql-workbench"; pname = "nosql-workbench";
@ -39,30 +39,19 @@ if stdenv.isDarwin then stdenv.mkDerivation {
sourceRoot = "."; sourceRoot = ".";
nativeBuildInputs = [ _7zz ];
buildInputs = [ jdk21 ]; buildInputs = [ jdk21 ];
# DMG file is using APFS which is unsupported by "undmg". # DMG file is using APFS which is unsupported by "undmg".
# Fix found: https://discourse.nixos.org/t/help-with-error-only-hfs-file-systems-are-supported-on-ventura/25873/8 # Instead, use "7zz" to extract the contents.
# "undmg" issue: https://github.com/matthewbauer/undmg/issues/4 # "undmg" issue: https://github.com/matthewbauer/undmg/issues/4
unpackCmd = '' unpackCmd = ''
echo "Creating temp directory" runHook preUnpack
mnt=$(TMPDIR=/tmp mktemp -d -t nix-XXXXXXXXXX)
function finish { 7zz x $curSrc
echo "Ejecting temp directory"
/usr/bin/hdiutil detach $mnt -force
rm -rf $mnt
}
# Detach volume when receiving SIG "0"
trap finish EXIT
# Mount DMG file runHook postUnpack
echo "Mounting DMG file into \"$mnt\""
/usr/bin/hdiutil attach -nobrowse -mountpoint $mnt $curSrc
# Copy content to local dir for later use
echo 'Copying extracted content into "sourceRoot"'
cp -a $mnt/NoSQL\ Workbench.app $PWD/
''; '';
installPhase = '' installPhase = ''