Commit 36d16142 authored by 3pleX-dev's avatar 3pleX-dev
Browse files

libbytesize: fix unreproducible builds by compiling .pyc files in the build phase

parent 567f1e2d
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -60,6 +60,9 @@ stdenv.mkDerivation (finalAttrs: {
  postInstall = ''
    substituteInPlace $out/${python3Packages.python.sitePackages}/bytesize/bytesize.py \
      --replace-fail 'CDLL("libbytesize.so.1")' "CDLL('$out/lib/libbytesize.so.1')"

    # Force compilation of .pyc files to make them deterministic
    ${python3Packages.python.interpreter} -m compileall $out/${python3Packages.python.sitePackages}/bytesize
  '';

  pythonImportsCheck = [ "bytesize" ];