Skip to content
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

gofer: init at 2.30a #100171

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft

gofer: init at 2.30a #100171

wants to merge 2 commits into from

Conversation

siraben
Copy link
Member

@siraben siraben commented Oct 10, 2020

It builds but running the executable complains about lack of standard prelude, which has to be placed according in a location analogous to /usr/local/lib/Gofer.

You will need a directory which is available to all Gofer users on
your system to store prelude files etc.  You can choose this to be
whatever you like.  I'll just call it $GOFLIB here.  On Unix systems,
I usually use /usr/local/lib/Gofer or a subdirectory of my home
directory, Gofer/lib.  On DOS systems, I suggest C:\GOFER\LIB.
$ ./result/bin/gofc hello.hs    
Gofer->C Version 1.03 (2.30b)  Copyright (c) Mark P Jones 1992-1995

Reading script file "standard.prelude":
ERROR "standard.prelude": Unable to open file
Aborting compilation
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@siraben
Copy link
Member Author

siraben commented Oct 12, 2020

Note that goferc doesn't work since it's a shell script has hardcoded paths.

$ ./result/bin/goferc hello.hs 
./result/bin/goferc: line 34: /usr/local/lib/Gofer/gofc: No such file or directory
[Compiling with gcc]
clang: error: no such file or directory: './hello.c'
clang: error: no such file or directory: '/usr/local/lib/Gofer/runtime.o'
error: /Applications/Xcode.app/Contents/Developer/Toolchains/

@siraben
Copy link
Member Author

siraben commented Oct 12, 2020

I'm not entirely sure how to go about doing this, but the tar.gz file that is downloaded has the following directory structure. Nix seems to cd into the src directory, but files such as standard.prelude need to be copied into $out/lib for the goferc executable to work.

.
├── [1.2K]  Readme
├── [4.2K]  array.gs
├── [ 29K]  cc.prelude
├── [1.2K]  demos
├── [1.1K]  docs
├── [ 288]  docsrc
├── [4.1K]  gofer.el
├── [740K]  gofer230a.tar.gz
├── [1.6K]  ioarray.gs
├── [2.1K]  iomonad.gs
├── [1.0K]  min.prelude
├── [ 27K]  nofloat.prelude
├── [ 192]  scripts
├── [ 19K]  simple.prelude
├── [1.3K]  src
└── [ 27K]  standard.prelude

 862K used in 5 directories, 11 files

installPhase = ''
mkdir -p $out/bin
mkdir -p $out/lib
# cp $src/standard.prelude $out/lib
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# cp $src/standard.prelude $out/lib

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May be needed at run time, need to check.


hardeningDisable = [ "format" ];

src = fetchurl {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can use fetchzip here to remove the unpack phase.

@stale
Copy link

stale bot commented Jul 19, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jul 19, 2021
siraben and others added 2 commits August 2, 2021 18:37
Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Aug 2, 2021
@stale
Copy link

stale bot commented Apr 19, 2022

I marked this as stale due to inactivity. → More info

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Apr 19, 2022
@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Mar 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants