Merge pull request #236976 from amarshall/zip-reproducible

This commit is contained in:
Janik 2023-06-27 00:24:36 +02:00 committed by GitHub
commit 974b43038e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 117 additions and 19 deletions

View file

@ -9,6 +9,7 @@
, dpkg , dpkg
, writeScript , writeScript
, bash , bash
, strip-nondeterminism
, tor , tor
, zip , zip
, xz , xz
@ -41,7 +42,15 @@ stdenv.mkDerivation rec {
sha256 = "0jisxzajsc4wfvxabvfzd0x9y1fxzg39fkhap1781q7wyi4ry9kd"; sha256 = "0jisxzajsc4wfvxabvfzd0x9y1fxzg39fkhap1781q7wyi4ry9kd";
}; };
nativeBuildInputs = [ makeWrapper copyDesktopItems imagemagick dpkg zip xz ]; nativeBuildInputs = [
copyDesktopItems
dpkg
imagemagick
makeWrapper
strip-nondeterminism
xz
zip
];
desktopItems = [ desktopItems = [
(makeDesktopItem { (makeDesktopItem {
@ -64,8 +73,9 @@ stdenv.mkDerivation rec {
mkdir -p native/linux/x64/ mkdir -p native/linux/x64/
cp ${bisq-tor} ./tor cp ${bisq-tor} ./tor
tar -cJf native/linux/x64/tor.tar.xz tor tar --sort=name --mtime="@$SOURCE_DATE_EPOCH" -cJf native/linux/x64/tor.tar.xz tor
zip -r opt/bisq/lib/app/desktop-${version}-all.jar native zip -r opt/bisq/lib/app/desktop-${version}-all.jar native
strip-nondeterminism opt/bisq/lib/app/desktop-${version}-all.jar
''; '';
installPhase = '' installPhase = ''

View file

@ -23,6 +23,7 @@
, rapidyaml , rapidyaml
, SDL2 , SDL2
, soundtouch , soundtouch
, strip-nondeterminism
, vulkan-headers , vulkan-headers
, vulkan-loader , vulkan-loader
, wayland , wayland
@ -58,7 +59,13 @@ stdenv.mkDerivation rec {
"-DDISABLE_BUILD_DATE=TRUE" "-DDISABLE_BUILD_DATE=TRUE"
]; ];
nativeBuildInputs = [ cmake pkg-config wrapQtAppsHook zip ]; nativeBuildInputs = [
cmake
pkg-config
strip-nondeterminism
wrapQtAppsHook
zip
];
buildInputs = [ buildInputs = [
curl curl
@ -95,6 +102,7 @@ stdenv.mkDerivation rec {
install -Dm644 $src/.github/workflows/scripts/linux/pcsx2-qt.desktop $out/share/applications/PCSX2.desktop install -Dm644 $src/.github/workflows/scripts/linux/pcsx2-qt.desktop $out/share/applications/PCSX2.desktop
zip -jq $out/bin/resources/patches.zip ${pcsx2_patches}/patches/* zip -jq $out/bin/resources/patches.zip ${pcsx2_patches}/patches/*
strip-nondeterminism $out/bin/resources/patches.zip
''; '';
qtWrapperArgs = [ qtWrapperArgs = [

View file

@ -1,7 +1,13 @@
{stdenv, unzip, jq, zip, fetchurl,writeScript, ...}: { stdenv
, fetchurl
, jq
, strip-nondeterminism
, unzip
, writeScript
, zip
}:
{ { name
name
, url ? null , url ? null
, md5 ? "" , md5 ? ""
, sha1 ? "" , sha1 ? ""
@ -14,7 +20,8 @@
let let
extid = if fixedExtid == null then "nixos@${name}" else fixedExtid; extid = if fixedExtid == null then "nixos@${name}" else fixedExtid;
source = if url == null then src else fetchurl { source = if url == null then src else
fetchurl {
url = url; url = url;
inherit md5 sha1 sha256 sha512 hash; inherit md5 sha1 sha256 sha512 hash;
}; };
@ -38,7 +45,14 @@ stdenv.mkDerivation {
echo "$NEW_MANIFEST" > "$out/$UUID/manifest.json" echo "$NEW_MANIFEST" > "$out/$UUID/manifest.json"
cd "$out/$UUID" cd "$out/$UUID"
zip -r -q -FS "$out/$UUID.xpi" * zip -r -q -FS "$out/$UUID.xpi" *
strip-nondeterminism "$out/$UUID.xpi"
rm -r "$out/$UUID" rm -r "$out/$UUID"
''; '';
nativeBuildInputs = [ unzip zip jq ];
nativeBuildInputs = [
jq
strip-nondeterminism
unzip
zip
];
} }

View file

@ -1,4 +1,12 @@
{ lib, stdenv, fetchFromGitHub, zip, unzip, firefox, bash }: { lib
, bash
, fetchFromGitHub
, firefox
, strip-nondeterminism
, stdenv
, unzip
, zip
}:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "slimerjs"; pname = "slimerjs";
@ -12,7 +20,10 @@ stdenv.mkDerivation rec {
}; };
buildInputs = [ zip ]; buildInputs = [ zip ];
nativeBuildInputs = [ unzip ]; nativeBuildInputs = [
strip-nondeterminism
unzip
];
preConfigure = '' preConfigure = ''
test -d src && cd src test -d src && cd src
@ -20,6 +31,7 @@ stdenv.mkDerivation rec {
''; '';
installPhase = '' installPhase = ''
strip-nondeterminism --type zip omni.ja
mkdir -p "$out"/{bin,share/doc/slimerjs,lib/slimerjs} mkdir -p "$out"/{bin,share/doc/slimerjs,lib/slimerjs}
cp LICENSE README* "$out/share/doc/slimerjs" cp LICENSE README* "$out/share/doc/slimerjs"
cp -r * "$out/lib/slimerjs" cp -r * "$out/lib/slimerjs"

View file

@ -1,5 +1,13 @@
{ lib, stdenv, fetchFromGitHub, zip, love, makeWrapper, makeDesktopItem { lib
, copyDesktopItems }: , copyDesktopItems
, fetchFromGitHub
, love
, makeDesktopItem
, makeWrapper
, stdenv
, strip-nondeterminism
, zip
}:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "mari0"; pname = "mari0";
@ -12,7 +20,12 @@ stdenv.mkDerivation rec {
sha256 = "1zqaq4w599scsjvy1rsb21fd2r8j3srx9vym4ir9bh666dp36gxa"; sha256 = "1zqaq4w599scsjvy1rsb21fd2r8j3srx9vym4ir9bh666dp36gxa";
}; };
nativeBuildInputs = [ makeWrapper copyDesktopItems zip ]; nativeBuildInputs = [
copyDesktopItems
makeWrapper
strip-nondeterminism
zip
];
desktopItems = [ desktopItems = [
(makeDesktopItem { (makeDesktopItem {
@ -28,6 +41,7 @@ stdenv.mkDerivation rec {
installPhase = '' installPhase = ''
runHook preInstall runHook preInstall
zip -9 -r mari0.love ./* zip -9 -r mari0.love ./*
strip-nondeterminism --type zip mari0.love
install -Dm444 -t $out/share/games/lovegames/ mari0.love install -Dm444 -t $out/share/games/lovegames/ mari0.love
makeWrapper ${love}/bin/love $out/bin/mari0 \ makeWrapper ${love}/bin/love $out/bin/mari0 \
--add-flags $out/share/games/lovegames/mari0.love --add-flags $out/share/games/lovegames/mari0.love

View file

@ -1,5 +1,15 @@
{ lib, stdenv, fetchurl, fetchFromGitHub, love, zip, fetchpatch, makeWrapper { lib
, makeDesktopItem, copyDesktopItems }: , copyDesktopItems
, fetchFromGitHub
, fetchpatch
, fetchurl
, love
, makeDesktopItem
, makeWrapper
, stdenv
, strip-nondeterminism
, zip
}:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "orthorobot"; pname = "orthorobot";
@ -29,7 +39,12 @@ stdenv.mkDerivation rec {
}) })
]; ];
nativeBuildInputs = [ makeWrapper zip copyDesktopItems ]; nativeBuildInputs = [
copyDesktopItems
makeWrapper
strip-nondeterminism
zip
];
patches = [ patches = [
# support for love11 # support for love11
@ -42,6 +57,7 @@ stdenv.mkDerivation rec {
installPhase = '' installPhase = ''
runHook preInstall runHook preInstall
zip -9 -r orthorobot.love ./* zip -9 -r orthorobot.love ./*
strip-nondeterminism --type zip orthorobot.love
install -Dm444 -t $out/share/games/lovegames/ orthorobot.love install -Dm444 -t $out/share/games/lovegames/ orthorobot.love
makeWrapper ${love}/bin/love $out/bin/orthorobot \ makeWrapper ${love}/bin/love $out/bin/orthorobot \
--add-flags $out/share/games/lovegames/orthorobot.love --add-flags $out/share/games/lovegames/orthorobot.love

View file

@ -6,6 +6,7 @@
, makeWrapper , makeWrapper
, makeDesktopItem , makeDesktopItem
, copyDesktopItems , copyDesktopItems
, strip-nondeterminism
}: }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
@ -19,7 +20,12 @@ stdenv.mkDerivation rec {
hash = "sha256-8BshnGLuA8lmG9g7FU349DWKP/fZvlvjrQBau/LSJ4E="; hash = "sha256-8BshnGLuA8lmG9g7FU349DWKP/fZvlvjrQBau/LSJ4E=";
}; };
nativeBuildInputs = [ makeWrapper copyDesktopItems zip ]; nativeBuildInputs = [
copyDesktopItems
makeWrapper
strip-nondeterminism
zip
];
desktopItems = [ desktopItems = [
(makeDesktopItem { (makeDesktopItem {
@ -35,6 +41,7 @@ stdenv.mkDerivation rec {
installPhase = '' installPhase = ''
runHook preInstall runHook preInstall
zip -9 -r Wireworld.love ./* zip -9 -r Wireworld.love ./*
strip-nondeterminism --type zip Wireworld.love
install -Dm444 -t $out/share/games/lovegames/ Wireworld.love install -Dm444 -t $out/share/games/lovegames/ Wireworld.love
makeWrapper ${love}/bin/love $out/bin/Wireworld \ makeWrapper ${love}/bin/love $out/bin/Wireworld \
--add-flags $out/share/games/lovegames/Wireworld.love --add-flags $out/share/games/lovegames/Wireworld.love

View file

@ -1,4 +1,12 @@
{ lib, stdenv, fetchFromGitHub, python3, zip }: let { lib
, fetchFromGitHub
, python3
, stdenv
, strip-nondeterminism
, zip
}:
let
version = "1.1.0"; version = "1.1.0";
sha256 = "sha256-563xOz63vto19yuaHtReV1dSw6BgNf+CLtS3lrPnaoc="; sha256 = "sha256-563xOz63vto19yuaHtReV1dSw6BgNf+CLtS3lrPnaoc=";
@ -9,25 +17,33 @@
rev = "v" + version; rev = "v" + version;
inherit sha256; inherit sha256;
}; };
in stdenv.mkDerivation { in
stdenv.mkDerivation {
inherit pname version src; inherit pname version src;
nativeBuildInputs = [ nativeBuildInputs = [
strip-nondeterminism
zip zip
]; ];
buildInputs = [ buildInputs = [
(python3.withPackages (pythonPackages: with pythonPackages; [ (python3.withPackages (pythonPackages: with pythonPackages; [
distro distro
])) ]))
]; ];
buildPhase = '' buildPhase = ''
runHook preBuild runHook preBuild
pushd src pushd src
zip -r ../pridefetch.zip ./* zip -r ../pridefetch.zip ./*
strip-nondeterminism ../pridefetch.zip
popd popd
echo '#!/usr/bin/env python' | cat - pridefetch.zip > pridefetch echo '#!/usr/bin/env python' | cat - pridefetch.zip > pridefetch
rm pridefetch.zip rm pridefetch.zip
runHook postBuild runHook postBuild
''; '';
installPhase = '' installPhase = ''
runHook preInstall runHook preInstall
mkdir -p $out/bin mkdir -p $out/bin
@ -35,6 +51,7 @@ in stdenv.mkDerivation {
chmod +x $out/bin/pridefetch chmod +x $out/bin/pridefetch
runHook postInstall runHook postInstall
''; '';
meta = with lib; { meta = with lib; {
description = "Print out system statistics with pride flags"; description = "Print out system statistics with pride flags";
longDescription = '' longDescription = ''