New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
miranda: init at 2.066 #100085
miranda: init at 2.066 #100085
Conversation
@GrahamcOfBorg eval |
@doronbehar It compiles but when one tries to run the |
8008242
to
60bedc3
Compare
Build succeeds but I see a bunch of permission errors due to the way the |
Result of running the
When I perform |
It probably finds |
I created three patches here: https://github.com/jtojnar/miranda/commits/master and sent them to the e-mail address from the Miranda homepage. |
I extracted the changes into a
|
The patch uses different |
Thanks @jtojnar , the patches fixes the build. |
Permission error when running
|
Should the patch be adjusted to remove the call to |
The If I apply Basically, if fetchzip {
url = "https://www.cs.kent.ac.uk/people/staff/dat/miranda/src/mira-${builtins.replaceStrings [ "." ] [ "" ] version}-src.tgz";
sha256 = "KE/FTL9YW9l7VBAgkFZlqgSM1Bt/BXT6GkkONtyKJjQ=";
} The installed files differ slightly between those two sources and it makes no sense to me. diffoscope output
|
Huh, that's interesting. Is there some source of non-determinism? |
Looking at https://github.com/jtojnar/miranda/blob/daf8abb8f30ec1cca21698e3fc355578b9f7c571/data.c#L578-L580, the
Sizes are in bytes, numeric fields seem to use little-endian here. From diffoscope output, we can see that it is the mtime of the When pointing I would expect the reason |
I would suggest you use
|
This seems to build and run correctly: diff --git a/pkgs/development/compilers/miranda/default.nix b/pkgs/development/compilers/miranda/default.nix
index 21c0194cb04..bdad89e1e52 100644
--- a/pkgs/development/compilers/miranda/default.nix
+++ b/pkgs/development/compilers/miranda/default.nix
@@ -1,37 +1,69 @@
-{ stdenv, lib, fetchurl, fetchpatch, gcc }:
+{ stdenv, lib, fetchzip, fetchpatch, gcc }:
stdenv.mkDerivation rec {
- version = "2.066";
pname = "miranda";
+ version = "2.066";
- src = fetchurl {
+ # The build generates object files (`.x`) from module files (`.m`).
+ # To be able to invalidate object file, it contains the `mtime`
+ # of the corresponding module file at the time of the build.
+ # When a file is installed to Nix store its `mtime` is set to `1`,
+ # so the `mtime` field in the object file would no longer match
+ # and Miranda would try to regenerate it at the runtime,
+ # even though it is up to date.
+ # Using `fetchzip` will make all the source files have `mtime=1`
+ # from the start so this mismatch cannot occur.
+ src = fetchzip {
url = "https://www.cs.kent.ac.uk/people/staff/dat/miranda/src/mira-${builtins.replaceStrings [ "." ] [ "" ] version}-src.tgz";
- sha256 = "1sqn031agwwgq3pka55pxd6m22dagmkxjhbwrni8gpigihg2h72j";
+ sha256 = "KE/FTL9YW9l7VBAgkFZlqgSM1Bt/BXT6GkkONtyKJjQ=";
};
- enableParallelBuilding = true;
-
patches = [
+ # Allow passing `PREFIX` to makeFlags.
+ # Sent upstream on 2020-10-10.
(fetchpatch {
name = "fix-makefile-variables.patch";
url = "https://github.com/jtojnar/miranda/commit/be62d2150725a4c314aa7e3e1e75a165c90be65d.patch";
sha256 = "0r8nnr7iyzp1a3w3n6y1xi0ralqhm1ifp75yhyj3h1g229vk51a6";
})
+
+ # Create the installation directories.
+ # Sent upstream on 2020-10-10.
(fetchpatch {
name = "add-mkdirs-makefile.patch";
url = "https://github.com/jtojnar/miranda/commit/048754606625975d5358e946549c41ae7b5d3428.patch";
sha256 = "1n8xv679i7s789km2dxxrs2pphyyi7vr7rhafqvmkcdmhmxk9h2a";
})
+
+ # Use correct installation path for finding the library.
+ # Sent upstream on 2020-10-10.
(fetchpatch {
name = "c-path-fixes.patch";
url = "https://github.com/jtojnar/miranda/commit/aea0a118a802a0da6029b781f7cfd388224263cf.patch";
sha256 = "1z3giv8fzc35a23ga9ahz9d1fbvya67kavnb8h4rv2icbzr5j5gd";
})
+
+ # Make build reproducible.
+ # Sent upstream on 2020-10-10.
+ (fetchpatch {
+ name = "deterministic-build.patch";
+ url = "https://github.com/jtojnar/miranda/commit/daf8abb8f30ec1cca21698e3fc355578b9f7c571.patch";
+ sha256 = "TC/YrHrMzdlwicJ3oJ/TjwhkufmV3ypemgyqhMmVut4=";
+ })
+ ];
+
+ nativeBuildInputs = lib.optionals stdenv.isDarwin [ gcc ];
+
+ makeFlags = [
+ "CFLAGS=-O2"
+ "PREFIX=${placeholder "out"}"
];
- makeFlags = [ "CFLAGS=-O2" "PREFIX=${placeholder "out"}" ];
+ enableParallelBuilding = true;
- buildInputs = lib.optionals stdenv.isDarwin [ gcc ];
+ postPatch = ''
+ patchShebangs quotehostinfo
+ '';
meta = with stdenv.lib; {
description = "Compiler for Miranda -- a pure, non-strict, polymorphic, higher order functional programming language"; |
Patch applied! |
Thanks. |
Motivation for this change
Add
miranda
. It's not building ATM, hope to get more eyes on it.Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)