-
Notifications
You must be signed in to change notification settings - Fork 1
NixOS build instructions #42
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
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
53d6859
Project: fix FSharpTargetsPath-related issues.
ForNeVeR 077e934
Docs: add build guide.
ForNeVeR 0b9848d
Solution: add build documentation.
ForNeVeR 5651685
Build documentation: improve NixOS build instructions.
ForNeVeR 2ff7d9a
Readme: add a link to the build instructions.
ForNeVeR 56e32e2
Build guide: changes after review.
ForNeVeR File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,72 @@ | ||
| Naggum Build Guide | ||
| ================== | ||
|
|
||
| Windows | ||
| ------- | ||
|
|
||
| To build Naggum on Windows, just use Visual Studio or MSBuild like that: | ||
|
|
||
| $ cd naggum | ||
| $ nuget restore | ||
| $ msbuild /p:Configuration=Release Naggum.sln | ||
|
|
||
| Linux | ||
| ----- | ||
|
|
||
| See general build instructions for Linux in the file `.travis.yml` inside the | ||
| Naggum source directory. | ||
|
|
||
| You'll need [Mono][mono], [NuGet][nuget] and [F# Compiler][fsharp] installed. | ||
| Some of them may or may not be part of your Mono installation; just make sure | ||
| you've got them all. | ||
|
|
||
| Below is an example of setting up these tools on [NixOS Linux][nixos]; feel free | ||
| to add instructions for any other distributions. | ||
|
|
||
| ### NixOS Linux | ||
|
|
||
| First of all, install `mono` and `fsharp` packages to your environment: | ||
|
|
||
| $ nix-env -i mono fsharp | ||
|
|
||
| Please note that you need `fsharp` >= 4.0 to build Naggum, which is currently in | ||
| the unstable channel. So maybe you'll need to switch to the unstable channel or | ||
| build `fsharp` from [Nixpkgs][nixpkgs] source. | ||
|
|
||
| According to the recommendations in | ||
| [`patch-fsharp-targets`][patch-fsharp-targets] build helper, you may want to set | ||
| up the environment variable `FSharpTargetsPath` either globally or locally: | ||
|
|
||
| $ export FSharpTargetsPath=$(dirname $(which fsharpc))/../lib/mono/4.5/Microsoft.FSharp.Targets | ||
|
|
||
| You'll need a NuGet executable. Unfortunately, there is no NixOS package for | ||
| NuGet, so you have to download it manually: | ||
|
|
||
| $ nix-env -i wget # if not installed already | ||
| $ cd naggum | ||
| $ wget https://dist.nuget.org/win-x86-commandline/latest/nuget.exe | ||
|
|
||
| After that you can download the dependencies and build the project using | ||
| `xbuild`: | ||
|
|
||
| $ mono nuget.exe restore Naggum.sln | ||
| $ xbuild /p:Configuration=Release /p:TargetFrameworkVersion="v4.5" Naggum.sln | ||
|
|
||
| After that you should copy `FSharp.Core.dll` to the project output directory, | ||
| because currently Nix have problems with concept of Mono global assembly cache: | ||
|
|
||
| $ FSHARP_CORE=$HOME/.nix-profile/lib/mono/Reference\ Assemblies/Microsoft/FSharp/.NETFramework/v4.0/4.4.0.0/FSharp.Core.dll | ||
| $ echo Naggum.*/bin/Release | xargs -n 1 cp -f "$FSHARP_CORE" | ||
|
|
||
| After that, you can run Naggum.Compiler, for example: | ||
|
|
||
| $ cd Naggum.Compiler/bin/Release/ | ||
| $ mono Naggum.Compiler.exe ../../../tests/test.naggum | ||
| $ mono test.exe | ||
|
|
||
| [fsharp]: http://fsharp.org/ | ||
| [mono]: http://www.mono-project.com/ | ||
| [nixos]: http://nixos.org/ | ||
| [nixpkgs]: https://github.com/NixOS/nixpkgs | ||
| [nuget]: http://www.nuget.org/ | ||
| [patch-fsharp-targets]: https://github.com/NixOS/nixpkgs/blob/d4681bf62672083f92545e02e00b8cf040247e8d/pkgs/build-support/dotnetbuildhelpers/patch-fsharp-targets.sh | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a review, but just a note of admiration: that's a cool trick! That's a very nice way to copy things into multiple directories.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Found it here :)