chore(nix): install zip too for tests in devenv

This commit is contained in:
Erica Marigold 2025-02-13 16:13:43 +00:00
parent af2b3e128d
commit b90e15a8f0
Signed by: DevComp
SSH key fingerprint: SHA256:jD3oMT4WL3WHPJQbrjC3l5feNCnkv7ndW8nYaHX5wFw

77
dev.nix
View file

@ -1,51 +1,46 @@
{ pkgs ? import <nixpkgs> { } }:
let
buildDerivation = name: version: sha256: lib:
pkgs.stdenv.mkDerivation {
name = "${name}-${version}";
src = pkgs.fetchurl {
url = "http://ftp.debian.org/debian/pool/main/${builtins.substring 0 1 name}/${name}/${name}_${version}_amd64.deb";
sha256 = sha256;
};
buildInputs = [ pkgs.binutils pkgs.gnutar pkgs.pkg-config lib ];
dontStrip = true; # in order to prevent `set` calls tampering with generated strip script
unpackPhase = ''
#!/bin/bash
set -euo pipefail
mkdir -p tmp/
ar x $src
mv data.tar.xz tmp/
'';
installPhase = ''
#!/bin/bash
set -euo pipefail
mkdir -p $out/bin $out/lib
tar -xf ./tmp/data.tar.xz -C $out
mv $out/usr/bin/${name} $out/bin/
cp $(pkg-config --variable=libdir ${lib.pname})/* $out/lib/
rm -rf $out/usr tmp/
'';
};
in
pkgs.mkShell {
buildInputs = [
pkgs.curl
pkgs.git
pkgs.lune
(
let version = "6.0-28"; in pkgs.stdenv.mkDerivation {
name = "unzip-${version}";
src = pkgs.fetchurl {
url = "http://ftp.debian.org/debian/pool/main/u/unzip/unzip_${version}_amd64.deb";
sha256 = "13h6cm4708p5zczi7fc4qbdlwl1nhnhrk0ncwv9chb1q6jf55ndk";
};
buildInputs = [ pkgs.binutils pkgs.gnutar pkgs.bzip2 pkgs.pkg-config ];
unpackPhase = ''
mkdir -p tmp/
ar x $src
mv data.tar.xz tmp/
'';
installPhase = ''
mkdir -p $out/bin $out/lib
tar -xf ./tmp/data.tar.xz -C $out
mv $out/usr/bin/unzip $out/bin/
cp $(pkg-config --variable=libdir bzip2)/libbz2.so.1.0.8 $out/lib/libbz2.so.1.0
rm -rf $out/usr tmp/
'';
}
)
(
let version = "0.6.0-rc.4"; in
pkgs.stdenv.mkDerivation {
name = "pesde";
version = version;
src = pkgs.fetchzip {
url = "https://github.com/pesde-pkg/pesde/releases/download/v${version}+registry.0.2.0-rc.1/pesde-${version}-linux-x86_64.zip";
sha256 = "sha256-3aD2OGUUV4+ptWLTBHVDug9RDHicSM58YDcXCiYRSyY=";
};
installPhase = ''
mkdir -p $out/bin
cp pesde $out/bin/
'';
}
)
(buildDerivation "unzip" "6.0-28" "s9lSnDQ4LMjS5syCmaGFNlBO28KEuRM/++UicEhlBo4=" pkgs.bzip2)
(buildDerivation "zip" "3.0-14" "0vsh9c5wfbwsx1r1b5mkfxj5vy1xqv0wbj2i93jysyb7x1c3pq8n" pkgs.zlib)
];
shellHook = ''